/* ============================================================
   COMPONENTS — All UI component styles
   ============================================================ */

/* ──────────────────────────────────────────
   SHARED UTILITIES
   ────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.section {
  padding-block: var(--section-padding-y);
}

.section--surface {
  background-color: var(--bg-surface);
}

.section__header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--sp-16);
}

.section__label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-4);
}

.section__title {
  font-size: var(--text-4xl);
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
}

.section__description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

/* Badge / pill */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.04em;
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge--green {
  background: rgba(22, 163, 74, 0.08);
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.25);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
  transition: all var(--ease-base);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn--primary {
  background: var(--accent);
  color: #000;
}

.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.btn--lg {
  padding: calc(var(--sp-3) + 2px) var(--sp-8);
  font-size: var(--text-base);
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: all var(--ease-base);
}

.card:hover {
  border-color: rgba(245, 158, 11, 0.3);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  border: 1px solid rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-5);
  color: var(--accent);
  flex-shrink: 0;
}

.card__icon svg {
  width: 22px;
  height: 22px;
}

.card__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.card__body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* Divider line */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  border: none;
  margin: 0;
}

/* ──────────────────────────────────────────
   HEADER
   ────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-block: var(--sp-4);
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease-base);
}

.header.scrolled {
  border-bottom-color: var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.header__logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--color-amber-300));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header__logo-mark svg {
  width: 18px;
  height: 18px;
  color: #000;
}

.header__logo-text {
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.header__logo-xsm {
  color: var(--text-primary);
}

.header__logo-lab {
  color: var(--accent);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  flex: 1;
}

.header__nav-link {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  transition: color var(--ease-fast);
  position: relative;
}

.header__nav-link:hover,
.header__nav-link.active {
  color: var(--text-primary);
}

.header__nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-left: auto;
}

.header__menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--sp-2);
  cursor: pointer;
}

.header__menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--ease-base);
  display: block;
}

/* ──────────────────────────────────────────
   HERO
   ────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--sp-24) var(--sp-16);
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(ellipse at center,
    rgba(217, 119, 6, 0.05) 0%,
    transparent 65%);
  pointer-events: none;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-16);
  align-items: center;
}

.hero__badge {
  margin-bottom: var(--sp-6);
}

.hero__title {
  font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl));
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-6);
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 500px;
  margin-bottom: var(--sp-8);
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-10);
}

.hero__trust {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
}

.hero__trust-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.hero__trust-item svg {
  width: 14px;
  height: 14px;
  color: #16a34a;
  flex-shrink: 0;
}

/* Terminal */
.terminal {
  background: #020712;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18),
              0 0 0 1px rgba(0,0,0,0.08);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: #0d1117;
  border-bottom: 1px solid var(--border);
}

.terminal__dots {
  display: flex;
  gap: var(--sp-2);
}

.terminal__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.terminal__dot--red    { background: #ff5f56; }
.terminal__dot--yellow { background: #ffbd2e; }
.terminal__dot--green  { background: #27c93f; }

.terminal__title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.terminal__body {
  padding: var(--sp-6);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.9;
  overflow-x: auto;
}

.t-prompt { color: var(--color-amber-400); }
.t-cmd    { color: var(--color-slate-100); }
.t-key    { color: var(--color-slate-400); }
.t-val    { color: var(--color-amber-300); }
.t-ok     { color: var(--color-green-400); }
.t-muted  { color: var(--color-slate-500); }
.t-blank  { display: block; height: 0.6em; }

/* ──────────────────────────────────────────
   FEATURES
   ────────────────────────────────────────── */
.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-8);
  transition: all var(--ease-base);
}

.feature-card:hover {
  border-color: rgba(245, 158, 11, 0.25);
  box-shadow: var(--shadow-hover), 0 0 40px rgba(245,158,11,0.04);
  transform: translateY(-3px);
}

.feature-card__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--accent-subtle);
  border: 1px solid rgba(245, 158, 11, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-6);
  color: var(--accent);
}

.feature-card__icon svg {
  width: 26px;
  height: 26px;
}

.feature-card__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--sp-3);
}

.feature-card__body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--sp-5);
}

.feature-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.tag {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ──────────────────────────────────────────
   INTERFACES
   ────────────────────────────────────────── */
.interfaces__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.iface-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  transition: all var(--ease-base);
  cursor: default;
}

.iface-card:hover {
  border-color: rgba(245, 158, 11, 0.3);
  background: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.iface-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}

.iface-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  border: 1px solid rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.iface-card__icon svg {
  width: 20px;
  height: 20px;
}

.iface-card__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.iface-card__subtitle {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 2px;
}

.iface-card__body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* ──────────────────────────────────────────
   CRYPTOGRAPHY
   ────────────────────────────────────────── */
.crypto__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.crypto-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: all var(--ease-base);
}

.crypto-card:hover {
  border-color: rgba(245, 158, 11, 0.25);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.crypto-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  border: 1px solid rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: var(--sp-4);
}

.crypto-card__icon svg {
  width: 20px;
  height: 20px;
}

.crypto-card__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.crypto-card__body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--sp-4);
}

.crypto-card__ops {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.crypto-card__op {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.crypto-card__op::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  opacity: 0.6;
}

/* ──────────────────────────────────────────
   CTA
   ────────────────────────────────────────── */
.cta {
  padding-block: var(--section-padding-y);
}

.cta__inner {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-16) var(--sp-12);
  text-align: center;
  overflow: hidden;
}

.cta__inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 200px;
  background: radial-gradient(ellipse at top,
    rgba(217, 119, 6, 0.06) 0%,
    transparent 70%);
  pointer-events: none;
}

.cta__label {
  margin-bottom: var(--sp-4);
}

.cta__title {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
  letter-spacing: -0.02em;
}

.cta__description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 520px;
  margin-inline: auto;
  margin-bottom: var(--sp-10);
}

.cta__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* ──────────────────────────────────────────
   FOOTER
   ────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--sp-10);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.footer__logo-mark {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent), var(--color-amber-300));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer__logo-mark svg {
  width: 15px;
  height: 15px;
  color: #000;
}

.footer__copy {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

.footer__nav {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
}

.footer__link {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color var(--ease-fast);
}

.footer__link:hover {
  color: var(--text-secondary);
}

/* ──────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .features__grid,
  .interfaces__grid,
  .crypto__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding-y: var(--sp-16);
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: var(--sp-10);
  }

  .hero__terminal {
    order: -1;
  }

  .hero__description {
    max-width: 100%;
  }

  .header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(241, 245, 249, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-4) var(--sp-6);
  }

  .header__nav--open {
    display: flex;
  }

  .header__nav-link {
    padding-block: var(--sp-3);
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  .header__nav-link:last-child {
    border-bottom: none;
  }

  .header__menu-toggle {
    display: flex;
  }

  .header {
    position: relative; /* override sticky so mobile menu opens in flow */
  }

  .features__grid,
  .interfaces__grid,
  .crypto__grid {
    grid-template-columns: 1fr;
  }

  .section__title {
    font-size: var(--text-3xl);
  }

  .cta__title {
    font-size: var(--text-3xl);
  }

  .cta__inner {
    padding: var(--sp-10) var(--sp-6);
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-6);
  }
}

@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn--lg {
    width: 100%;
    justify-content: center;
  }
}

/* ──────────────────────────────────────────
   PARSER PAGE
   ────────────────────────────────────────── */
.parser-page {
  padding-block: var(--sp-16) var(--sp-24);
}

.parser-page__header {
  margin-bottom: var(--sp-10);
}

.parser-page__title {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-4xl));
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-3);
}

.parser-page__desc {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 620px;
  line-height: var(--leading-relaxed);
}

/* ── Form card ── */
.parser-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-8);
  margin-bottom: var(--sp-6);
}

.parser-form__api-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.parser-form__api-label {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.parser-form__api-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

.parser-form__api-row .form-input {
  max-width: 280px;
  background: var(--bg-surface);
  cursor: default;
  color: var(--text-muted);
}

/* Segmented toggle (4 / 8) */
.seg-toggle {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  flex-shrink: 0;
}

.seg-toggle__btn {
  padding: var(--sp-1) var(--sp-4);
  border-radius: calc(var(--radius-md) - 2px);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--ease-fast);
  line-height: 1.6;
}

.seg-toggle__btn:hover {
  color: var(--text-primary);
}

.seg-toggle__btn--active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid var(--border);
}

.parser-form__grid {
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
  gap: var(--sp-5);
  align-items: start;
  margin-bottom: var(--sp-6);
}

.parser-form__footer {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* ── Form elements ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.form-label__required {
  color: var(--accent);
  margin-left: 2px;
}

.form-input,
.form-textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  padding: var(--sp-3) var(--sp-4);
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
  width: 100%;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.form-textarea {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.75;
  resize: vertical;
  min-height: 108px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

.form-error-msg {
  font-size: var(--text-sm);
  color: #f87171;
  display: none;
  align-items: center;
  gap: var(--sp-2);
}

.form-error-msg.visible {
  display: flex;
}

/* ── Result area ── */
.parse-results {
  display: none;
}

.parse-results.visible {
  display: block;
}

.parse-results__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
}

/* Result card */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.result-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.result-card__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Fields table */
.result-table {
  width: 100%;
  border-collapse: collapse;
}

.result-table tr {
  border-bottom: 1px solid var(--border);
}

.result-table tr:last-child {
  border-bottom: none;
}

.result-table td {
  padding: var(--sp-3) var(--sp-6);
  vertical-align: top;
}

/* Top fixed rows (code / header / length): key bold, value accented */
.result-table__top-row .result-table__key {
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

.result-table__val--accent {
  color: var(--accent);
  font-weight: var(--weight-semibold);
}

/* Thin separator between fixed rows and field rows */
.result-table__sep td {
  padding: 0;
  height: 1px;
  background: var(--border);
  border-bottom: none;
}

.result-table__key {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  width: 1%;
  padding-right: var(--sp-4);
}

.result-table__val {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-primary);
  word-break: break-all;
}

/* Object section-header row: key has a value, val cell is empty */
.result-table tr:has(.result-table__val:empty) .result-table__key {
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding-top: var(--sp-4);
}

.result-table__val--null {
  color: var(--text-muted);
  font-style: italic;
}

/* Raw JSON */
.result-raw {
  margin-top: var(--sp-2);
}

.result-raw__toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: var(--sp-2) 0;
  transition: color var(--ease-fast);
  cursor: pointer;
}

.result-raw__toggle:hover {
  color: var(--text-secondary);
}

.result-raw__json {
  display: none;
  margin-top: var(--sp-3);
  background: #020712;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-slate-300);
  white-space: pre;
  overflow-x: auto;
  line-height: 1.75;
}

.result-raw__json.visible {
  display: block;
}

/* API error card */
.result-error {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: var(--radius-xl);
  padding: var(--sp-6) var(--sp-8);
  margin-bottom: var(--sp-6);
  display: none;
}

.result-error.visible {
  display: block;
}

.result-error__title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: #f87171;
  margin-bottom: var(--sp-2);
}

.result-error__title svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.result-error__message {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.result-error__detail {
  margin-top: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  white-space: pre;
  line-height: 1.7;
}

/* Loading button state */
.btn[aria-busy="true"] {
  opacity: 0.75;
  pointer-events: none;
  cursor: not-allowed;
  position: relative;
}

.btn[aria-busy="true"] .btn-spinner {
  display: inline-block;
}

.btn-spinner {
  display: none;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  animation: spin 0.55s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Nav divider */
.header__nav-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Parser responsive ── */
@media (max-width: 960px) {
  .parser-form__grid {
    grid-template-columns: 1fr 1fr;
  }

  .parser-form__grid .form-group:first-child {
    grid-column: span 2;
    max-width: 200px;
  }

  .parse-results__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .parser-form {
    padding: var(--sp-5);
  }

  .parser-form__grid {
    grid-template-columns: 1fr;
  }

  .parser-form__grid .form-group:first-child {
    grid-column: span 1;
    max-width: 100%;
  }
}
