/*
 * GovTyping site styles.
 * Tokens mirror the Flutter app's design system (lib/core/design_system),
 * so the public site and the practice app read as one product.
 */

/* ---------- Tokens ---------- */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #f1f3f5;
  --border: #e6e8eb;
  --border-strong: #d3d7dd;
  --text: #0e1116;
  --text-2: #4b5563;
  --text-muted: #8a919c;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --on-accent: #ffffff;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --success: #15803d;
  --success-soft: rgba(21, 128, 61, 0.1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, 0.1);
  --overlay: rgba(14, 17, 22, 0.45);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.05), 0 24px 48px rgba(0, 0, 0, 0.1);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --max: 1200px;
  --gutter: 32px;
  color-scheme: light;
}

.dark {
  --bg: #0a0b0d;
  --surface: #111316;
  --surface-raised: #16191d;
  --surface-sunken: #0d0f11;
  --border: #1f2328;
  --border-strong: #2c3138;
  --text: #edeef0;
  --text-2: #a1a7b0;
  --text-muted: #6b7280;
  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
  --on-accent: #04201d;
  --accent-soft: rgba(20, 184, 166, 0.14);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --danger: #f2555a;
  --danger-soft: rgba(242, 85, 90, 0.14);
  --warning: #f5a524;
  --warning-soft: rgba(245, 165, 36, 0.14);
  --overlay: rgba(0, 0, 0, 0.7);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 48px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

@media (max-width: 1023px) { :root { --gutter: 24px; } }
@media (max-width: 639px) { :root { --gutter: 16px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; color: var(--text); font-weight: 650; letter-spacing: -0.02em; line-height: 1.18; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden], .hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.icon { width: 17px; height: 17px; flex: none; stroke-width: 1.75; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 64px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (max-width: 767px) { .section { padding: 48px 0; } }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow { display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.h1 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.18; }
.h2 { font-size: clamp(21px, 2.4vw, 28px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.lead { font-size: clamp(14.5px, 1.1vw, 16px); color: var(--text-2); line-height: 1.55; margin-top: 12px; }
.body { color: var(--text-2); font-size: 14px; line-height: 1.55; }
.small { font-size: 12.5px; color: var(--text-2); }
.caption { font-size: 11.5px; color: var(--text-muted); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1023px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.stack > * + * { margin-top: 14px; }
.spacer { flex: 1; }
.d-block { display: block; }
.when-dark { display: none; }
.dark .when-dark { display: contents; }
.dark .when-light { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; background: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-sunken); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface-sunken); }
.btn-tonal { background: var(--accent-soft); color: var(--accent); }
.btn-tonal:hover { filter: brightness(0.97); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }
.icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); border: 1px solid transparent; background: none; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-sunken); color: var(--text); }
.link { color: var(--accent); font-weight: 600; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }

/* ---------- Cards, badges ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.card-sunken { background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; }
.card-link { display: block; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.card-link:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.icon-tile {
  width: 36px; height: 36px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); flex: none;
}
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: var(--r-sm);
  font-size: 11.5px; font-weight: 600; line-height: 1.4; background: var(--surface-sunken); color: var(--text-2);
}
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: 12px; color: var(--text-2);
}

/* ---------- Forms ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text); margin-bottom: 5px; }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface-sunken); color: var(--text);
  font-size: 14px; transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 120px; line-height: 1.55; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-code { font-family: var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.msg { font-size: 12.5px; padding: 9px 12px; border-radius: var(--r-md); margin-top: 14px; }
.msg-error { background: var(--danger-soft); color: var(--danger); }
.msg-success { background: var(--success-soft); color: var(--success); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { height: 64px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; }
.nav-links { display: flex; gap: 4px; margin-left: 12px; }
.nav-links a { padding: 8px 12px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; color: var(--text-2); }
.nav-links a:hover { color: var(--text); background: var(--surface-sunken); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-menu-btn { display: none; }
.mobile-menu { display: none; border-top: 1px solid var(--border); padding: 12px var(--gutter) 20px; background: var(--bg); }
.mobile-menu a, .mobile-menu button.menu-item { display: block; width: 100%; text-align: left; padding: 12px 4px; font-weight: 500; border: 0; background: none; border-bottom: 1px solid var(--border); }
.mobile-menu.open { display: block; }
@media (max-width: 899px) {
  .nav-links, .nav-actions .hide-mobile { display: none; }
  .nav-menu-btn { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero { padding: 44px 0 0; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -40% -10% auto; height: 520px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.12fr 1fr; gap: 36px; align-items: center; padding-bottom: 36px; }
@media (max-width: 1023px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } .hero { padding-top: 36px; } }

/* Launch Eyebrow Pill */
.launch-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  font-size: 12px;
  color: var(--text);
  margin-bottom: 16px;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
  width: fit-content;
}
.launch-pill:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.launch-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.launch-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.7); }
  70% { box-shadow: 0 0 0 5px rgba(20, 184, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
}
.launch-text {
  font-weight: 500;
  color: var(--text-2);
}
.launch-pill:hover .launch-text {
  color: var(--text);
}

/* Dual Actions & Inline Code Box */
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.hero-cta-main {
  box-shadow: 0 3px 12px var(--accent-soft);
}
.hero-code-box {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 3px 6px 3px 11px;
  gap: 8px;
  transition: border-color .15s ease, box-shadow .15s ease;
  height: 44px;
}
.hero-code-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.hero-code-box .code-icon {
  color: var(--text-muted);
}
.hero-code-input {
  border: 0;
  background: transparent;
  min-height: auto;
  padding: 0;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  width: 125px;
  color: var(--text);
}
.hero-code-input:focus {
  outline: none;
  box-shadow: none;
}
.hero-code-input::placeholder {
  font-weight: 500;
  letter-spacing: normal;
  font-family: var(--font);
  font-size: 12.5px;
  color: var(--text-muted);
}
.hero-code-btn {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}

/* Popular Quick Chips */
.hero-quick-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.chips-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 2px;
}
.chip-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  transition: all .15s ease;
}
.chip-item:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-sunken);
  transform: translateY(-1px);
}
.chip-item .chip-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}
.chip-more {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
  border-color: transparent;
}
.chip-more:hover {
  background: var(--accent-soft);
  filter: brightness(0.95);
}

.hero-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* ---------- Demo simulator ---------- */
.demo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.demo-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-sunken); flex-wrap: wrap; gap: 8px; }
.demo-head-left { display: flex; align-items: center; gap: 8px; }
.demo-traffic-dots { display: flex; gap: 5px; }
.demo-dot { width: 9px; height: 9px; border-radius: 50%; }
.demo-dot.red { background: #ef4444; }
.demo-dot.yellow { background: #eab308; }
.demo-dot.green { background: #22c55e; }
.terminal-title { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: -0.01em; }
.demo-rules-chip { font-family: var(--mono); font-size: 11px; padding: 2px 7px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.demo-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* Preset tabs */
.demo-tabs { display: flex; gap: 2px; padding: 4px 12px 0; border-bottom: 1px solid var(--border); background: var(--surface-sunken); overflow-x: auto; }
.demo-tab-btn { background: none; border: 0; padding: 6px 10px; font-size: 12px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; transition: all .15s ease; white-space: nowrap; }
.demo-tab-btn:hover { color: var(--text); }
.demo-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.demo-body { padding: 16px; }
.demo-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
@media (max-width: 479px) { .demo-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.demo-stat { padding: 8px 10px; border-radius: var(--r-md); background: var(--surface-sunken); border: 1px solid var(--border); }
.demo-stat .value { font-family: var(--mono); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.demo-stat .label { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.demo-stat.pass { border-color: color-mix(in srgb, var(--success) 40%, transparent); background: var(--success-soft); }
.demo-stat.pass .value { color: var(--success); }
.demo-stat.fail { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); }
.demo-stat.fail .value { color: var(--danger); }
.prompt { font-family: var(--mono); font-size: 13px; line-height: 1.6; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-sunken); border: 1px solid var(--border); color: var(--text-muted); user-select: none; }
.prompt .ok { color: var(--text); }
.prompt .bad { color: var(--danger); background: var(--danger-soft); border-radius: 2px; }
.prompt .cur { box-shadow: inset 0 -2px 0 var(--accent); color: var(--text); }
.demo-input { display: flex; gap: 6px; margin-top: 10px; }
.demo-input .input { font-family: var(--mono); font-size: 13px; min-height: 38px; padding: 8px 12px; }

/* Above-the-fold Trust & Scale Strip */
.hero-strip {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 0;
}
.hero-strip-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) {
  .hero-strip-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (max-width: 500px) {
  .hero-strip-inner {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
.strip-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.strip-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.strip-icon-wrap .icon {
  width: 16px;
  height: 16px;
}
.strip-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.strip-text strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.strip-text span {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- Exams grid ---------- */
.exam-card { display: flex; align-items: center; gap: 12px; padding: 13px 16px; }
.exam-logo { width: 36px; height: 36px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--border); padding: 5px; flex: none; display: flex; align-items: center; justify-content: center; }
.exam-logo img { width: 100%; height: 100%; object-fit: contain; }
.exam-card .name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.exam-card .meta { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.exam-card .arrow { margin-left: auto; color: var(--text-muted); }

/* ---------- Steps / features ---------- */
.step-num { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 16px; display: inline-block; }
.feature .icon-tile { margin-bottom: 16px; }
.feature h3 { margin-bottom: 8px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); background: var(--surface-sunken); padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table td { padding: 16px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-2); }
.table tr:last-child td { border-bottom: 0; }
.table td:first-child { color: var(--text); font-weight: 600; }

/* ---------- Diagnostics panel ---------- */
.panel-dark { background: #0d0f11; color: #edeef0; border-radius: var(--r-xl); border: 1px solid #1f2328; }
.dark .panel-dark { background: var(--surface); border-color: var(--border); }
.panel-dark .body, .panel-dark .small { color: #a1a7b0; }
.panel-dark h2, .panel-dark h3, .panel-dark h4 { color: #edeef0; }
.diag-row { display: flex; gap: 14px; }
.diag-row + .diag-row { margin-top: 24px; }
.diag-row .icon-tile { background: rgba(20, 184, 166, 0.14); color: #2dd4bf; }
.code-card { background: #111316; border: 1px solid #1f2328; border-radius: var(--r-lg); padding: 20px; font-family: var(--mono); font-size: 13px; color: #a1a7b0; }
.code-card .k { color: #6b7280; }
.code-card .v { color: #edeef0; }
.code-card .bad { color: #f2555a; text-decoration: line-through; }
.code-card .half { color: #f5a524; text-decoration: underline; }

/* ---------- Keyboard ---------- */
/* Keys flex to fill the card; below ~520px the keyboard scrolls sideways instead of shrinking further. */
.kbd { padding: 20px; overflow-x: auto; }
.kbd-rows { display: flex; flex-direction: column; gap: 5px; min-width: 520px; }
.kbd-row { display: flex; gap: 5px; }
.kbd-key {
  flex: 1 1 0; min-width: 0; height: 42px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border);
  border-bottom-width: 3px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11.5px; line-height: 1.15; color: var(--text); text-align: center; user-select: none; overflow: hidden;
}
.kbd-key.wide { flex-grow: 1.6; color: var(--text-muted); font-size: 10.5px; }
.kbd-key.wider { flex-grow: 2.2; color: var(--text-muted); font-size: 10.5px; }
.kbd-key.space { flex-grow: 7; }
.tools-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 16px; align-items: start; }
@media (max-width: 1023px) { .tools-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Segmented ---------- */
.segmented { display: inline-flex; padding: 3px; border-radius: var(--r-md); background: var(--surface-sunken); border: 1px solid var(--border); gap: 2px; flex-wrap: wrap; }
.segmented button { height: 32px; padding: 0 12px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--text-2); font-size: 13px; font-weight: 500; }
.segmented button[aria-pressed="true"] { background: var(--surface); border-color: var(--border); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* ---------- Calculator ---------- */
.range { width: 100%; accent-color: var(--accent); }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.result { padding: 14px; border-radius: var(--r-md); background: var(--surface-sunken); border: 1px solid var(--border); }
.result .value { font-family: var(--mono); font-size: 20px; font-weight: 600; }
.verdict { margin-top: 12px; padding: 14px; border-radius: var(--r-md); text-align: center; font-weight: 700; letter-spacing: 0.04em; }
.verdict.pass { background: var(--success-soft); color: var(--success); }
.verdict.fail { background: var(--danger-soft); color: var(--danger); }

/* ---------- CTA, footer ---------- */
.cta { padding: 56px; border-radius: var(--r-xl); background: var(--accent); color: var(--on-accent); text-align: center; }
.cta h2 { color: var(--on-accent); }
.cta p { color: color-mix(in srgb, var(--on-accent) 80%, transparent); margin: 12px auto 0; max-width: 560px; }
.cta .btn-secondary { background: var(--on-accent); color: var(--accent); border-color: transparent; }
@media (max-width: 639px) { .cta { padding: 36px 20px; } }
.footer { border-top: 1px solid var(--border); padding: 56px 0 32px; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
@media (max-width: 767px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
.footer h4 { font-size: 13px; margin-bottom: 12px; color: var(--text); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li + li { margin-top: 8px; }
.footer li a { font-size: 14px; color: var(--text-2); }
.footer li a:hover { color: var(--text); }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--overlay); }
.modal-panel {
  position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow-lg);
  animation: modal-in .18s ease-out;
}
.modal-panel.wide { max-width: 880px; }
.modal-close { position: absolute; top: 16px; right: 16px; }
.modal-panel h3 { font-size: 22px; font-weight: 650; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 639px) { .modal-panel { padding: 22px 18px; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 24px 0; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 4px; margin-right: 16px; font-size: 14px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.list-item { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-sunken); }
.list-item + .list-item { margin-top: 8px; }
.list-item .grow { flex: 1; min-width: 180px; }
.code-display { font-family: var(--mono); font-size: 24px; font-weight: 700; letter-spacing: 0.12em; padding: 10px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); color: var(--accent); }

/* ---------- Supervised exam ---------- */
.exam-panel { max-width: 920px; display: flex; flex-direction: column; gap: 16px; }
.exam-passage { height: 200px; overflow-y: auto; padding: 18px; border-radius: var(--r-md); background: var(--surface-sunken); border: 1px solid var(--border); line-height: 1.8; font-size: 16px; user-select: none; color: var(--text-muted); }
.exam-passage .w { padding: 1px 2px; border-radius: 3px; }
.exam-passage .w.done { color: var(--text); }
.exam-passage .w.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.exam-input { min-height: 130px; font-size: 16px; resize: none; }
.timer { font-family: var(--mono); font-size: 22px; font-weight: 700; }
.timer.low { color: var(--warning); }
.result-overlay { position: absolute; inset: 0; z-index: 2; background: var(--surface-raised); border-radius: var(--r-xl); padding: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow-y: auto; }
.result-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 560px; margin: 24px 0; }
@media (max-width: 559px) { .result-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Chat widget ---------- */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 52px; height: 52px; border-radius: 16px; border: 0; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-lg); display: inline-flex; align-items: center; justify-content: center; }
.chat-fab:hover { background: var(--accent-hover); }
.chat-window { position: fixed; right: 20px; bottom: 84px; z-index: 90; width: 380px; max-width: calc(100vw - 32px); height: min(540px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; animation: modal-in .18s ease-out; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.bubble.bot { background: var(--surface-sunken); border: 1px solid var(--border); border-top-left-radius: 4px; align-self: flex-start; }
.bubble.user { background: var(--accent); color: var(--on-accent); border-top-right-radius: 4px; align-self: flex-end; }
.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: dot 1s infinite ease-in-out; }
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.chat-feedback { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-sunken); }
.stars { display: flex; gap: 4px; margin-top: 6px; }
.stars button { background: none; border: 0; padding: 2px; color: var(--border-strong); }
.stars button.on { color: #f5a524; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-input .input { min-height: 40px; }

/* ---------- Exam detail page ---------- */
.exam-page-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 899px) { .exam-page-grid { grid-template-columns: minmax(0, 1fr); } }
.rule-list { list-style: none; padding: 0; margin: 16px 0 0; }
.rule-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.rule-list li + li { margin-top: 10px; }
.rule-list li svg, .rule-list li i { color: var(--accent); margin-top: 3px; }
.spec-list { margin: 16px 0 0; }
.spec-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.spec-list > div:last-child { border-bottom: 0; }
.spec-list dt { color: var(--text-2); }
.spec-list dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- Exam updates & news (top spotlight + ticker) ---------- */
.exam-ticker {
  background: linear-gradient(90deg, #092220 0%, #0f766e 50%, #092220 100%);
  color: #f0fdfa;
  border-bottom: 1px solid rgba(94, 234, 212, 0.25);
  font-size: 12.5px;
  overflow: hidden;
  position: relative;
}
.exam-ticker-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
}
.ticker-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  flex: none;
}
.ticker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5eead4;
  box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.8);
  animation: pulse-dot 1.8s infinite;
}
.ticker-track-wrap {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  animation: ticker-scroll 34s linear infinite;
}
.exam-ticker:hover .ticker-track,
.exam-ticker:focus-within .ticker-track {
  animation-play-state: paused;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  color: #ecfdf5;
  font-weight: 500;
}
.ticker-item strong { color: #ffffff; font-weight: 700; }
.ticker-item:hover { text-decoration: underline; }
.ticker-sep { opacity: 0.45; }
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; flex-wrap: wrap; width: auto; gap: 14px; }
  .ticker-dup { display: none; }
  .exam-ticker-inner { height: auto; padding: 8px 0; }
}

.updates-spotlight {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60% 70% at 15% 0%, rgba(20, 184, 166, 0.14), transparent 70%),
    radial-gradient(50% 60% at 90% 15%, rgba(245, 165, 36, 0.10), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.updates-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.updates-live-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 1.8s infinite;
}
.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.news-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow);
}
.news-card.is-hot {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface)) 0%, var(--surface) 48%);
  box-shadow: 0 6px 20px -6px color-mix(in srgb, var(--accent) 18%, transparent);
}
.news-card.is-hot::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, var(--accent), #f59e0b);
}
.news-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.news-links { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }

/* ---------- Reviews & Feedback ---------- */
.reviews-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
@media (max-width: 1023px) { .reviews-layout { grid-template-columns: minmax(0, 1fr); } }
.rating-summary-top { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.rating-big { font-family: var(--mono); font-size: 38px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--text); }
.rating-stars-display { color: #f59e0b; font-size: 17px; letter-spacing: 0.08em; line-height: 1.2; }
.rating-bars { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.rating-bar-row { display: grid; grid-template-columns: 26px 1fr 28px; align-items: center; gap: 8px; }
.rating-bar-track { height: 7px; border-radius: 999px; background: var(--surface-sunken); border: 1px solid var(--border); overflow: hidden; }
.rating-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #f59e0b); border-radius: 999px; transition: width .25s ease; }
.rating-bar-count { text-align: right; }
.star-picker { display: inline-flex; gap: 6px; padding: 6px 10px; border-radius: var(--r-md); background: var(--surface-sunken); border: 1px solid var(--border); }
.star-picker button { border: 0; background: none; padding: 2px 4px; font-size: 22px; line-height: 1; color: var(--border-strong); transition: transform .1s ease, color .1s ease; }
.star-picker button.on { color: #f59e0b; }
.star-picker button:hover { transform: scale(1.12); }
.reviews-feed { display: grid; gap: 14px; }
.review-card { display: flex; flex-direction: column; gap: 10px; }
.review-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.review-stars { color: #f59e0b; font-size: 15px; letter-spacing: 0.06em; }
.review-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); margin-top: 2px; }
.review-empty { text-align: center; padding: 36px 24px; }

/* ---------- Legal & utility prose ---------- */
.legal-prose h2 { margin-top: 28px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 18px; }
.legal-prose p { margin-top: 12px; color: var(--text-2); line-height: 1.65; }
.legal-prose ul { margin: 10px 0 0; padding-left: 20px; color: var(--text-2); line-height: 1.65; }
.legal-prose li + li { margin-top: 6px; }
.tool-split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 18px; align-items: start; }
@media (max-width: 899px) { .tool-split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Reveal on scroll (visible by default for crawlers/no-JS, animated when .js-reveal is active) ---------- */
.reveal { opacity: 1; transform: none; transition: opacity .45s ease, transform .45s ease; }
.js-reveal .reveal { opacity: 0; transform: translateY(12px); }
.js-reveal .reveal.in { opacity: 1; transform: none; }
