:root {
  --bg: #f8f5ef;
  --ink: #171717;
  --ink-soft: #545454;
  --accent: #0f766e;
  --accent-2: #ca8a04;
  --card: rgba(255, 255, 255, 0.78);
  --border: rgba(23, 23, 23, 0.12);
  --ok: #166534;
  --bad: #b91c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 10% 15%, #fef3c7 0%, #f8f5ef 38%), linear-gradient(130deg, #f8f5ef 0%, #ecfeff 100%);
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100vh;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  z-index: -1;
  filter: blur(36px);
  opacity: 0.35;
}

.bg-shape-1 {
  width: 220px;
  height: 220px;
  background: #f59e0b;
  top: -60px;
  right: 8%;
}

.bg-shape-2 {
  width: 260px;
  height: 260px;
  background: #14b8a6;
  bottom: -80px;
  left: -70px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.hero p {
  color: var(--ink-soft);
  margin: 8px 0 12px;
}

.hero-copy {
  color: var(--ink-soft);
  margin: 10px 0 14px;
  max-width: 980px;
  line-height: 1.65;
}

.hero-copy p {
  margin: 0;
}

.hero-copy ul {
  margin: 10px 0;
  padding-left: 18px;
}

.hero-copy li {
  margin: 6px 0;
}

.hero-copy code {
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.25);
  padding: 1px 5px;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9em;
}

.hero a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
  animation: rise 280ms ease;
}

@keyframes rise {
  from { transform: translateY(7px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

h2 { margin: 0 0 14px; }

.grid {
  display: grid;
  gap: 12px;
}

.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); margin-top: 12px; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
}

input, textarea, select, button {
  font: inherit;
}

input, textarea, select {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 10px;
  color: var(--ink);
}

textarea {
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1.4;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

button {
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
}

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status {
  margin: 12px 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 8px;
  vertical-align: top;
}

td.ok { color: var(--ok); font-weight: 700; }
td.bad { color: var(--bad); font-weight: 700; }

.result-grid {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}

.result-grid .head-cell,
.result-grid .method-cell,
.result-grid .result-cell {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 10px;
  padding: 10px;
}

.result-grid .head-cell {
  font-weight: 700;
  background: rgba(20, 184, 166, 0.1);
}

.result-grid .method-cell {
  font-weight: 700;
  display: flex;
  align-items: center;
}

.result-grid .result-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-grid .result-cell.clickable {
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.result-grid .result-cell.clickable:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.45);
  background: rgba(255, 255, 255, 0.96);
}

.result-grid .result-status {
  font-weight: 700;
}

.result-grid .result-status.ok {
  color: var(--ok);
}

.result-grid .result-status.bad {
  color: var(--bad);
}

.result-grid .result-meta {
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.raw-box {
  margin-top: 12px;
}

.raw-box pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  background: rgba(255,255,255,0.76);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.86rem;
}

.raw-groups {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.raw-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.75);
  padding: 10px;
}

.raw-group h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.raw-group pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  padding: 16px;
}

.hidden { display: none; }

.modal-panel {
  width: min(900px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: white;
  border-radius: 16px;
  padding: 16px;
}

.modal-panel textarea {
  margin-top: 12px;
  width: 100%;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
}

.summary-table th, .summary-table td {
  border: 1px solid #ddd;
  padding: 6px;
}

@media (max-width: 900px) {
  .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .result-grid .head-cell { display: none; }
  th:nth-child(3), td:nth-child(3), th:nth-child(4), td:nth-child(4) {
    display: none;
  }
}
