/* =====================================================================
   SIA Test Pass — "Nightshift Credential"
   Dark, premium security-tech identity for the SIA Door Supervisor /
   Security Officer licence exam-prep app.
   Space Grotesk display + Inter body + JetBrains Mono for figures.
   Signature devices: spotlight radial glow, fine scanline/grid texture,
   ID-credential badge card, steel-blue accent with cyan glow.
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* ---------- Design tokens — DARK (primary / lead theme) ---------- */
:root {
  /* Ground */
  --bg:        #0b0e14;   /* near-black cool graphite */
  --bg-2:      #06080d;   /* wells / inputs / darker floor */

  /* Surfaces (glass over the graphite) */
  --panel:     #11151e;   /* card surface */
  --panel-2:   #171d29;   /* raised chips, letters */
  --panel-3:   #1f2735;   /* hover lift */
  --glass:     rgba(19,24,34,.62);

  /* Structure */
  --line:      #232c3b;   /* primary borders */
  --line-soft: #1a2029;   /* hairlines / dividers */
  --line-lit:  rgba(79,143,247,.38);
  --grid:      rgba(120,160,220,.045); /* scanline / grid ink */

  /* Text */
  --text:      #eef3fb;   /* primary — crisp white */
  --muted:     #9fb1cb;   /* secondary — ~7:1 on --panel */
  --faint:     #6c7d97;   /* tertiary micro-labels */

  /* Signal blue */
  --accent:    #4f8ff7;   /* steel blue */
  --accent-2:  #3b82f6;   /* confident blue */
  --accent-ink:#ffffff;
  --cyan:      #38bdf8;   /* cyan glow — info accents */

  /* Semantic */
  --green:     #34d399;
  --green-ink: #04241a;
  --red:       #f87171;
  --red-ink:   #2a0606;
  --amber-warn:#fbbf24;

  /* Atmosphere */
  --glow:      rgba(59,130,246,.20);   /* hero spotlight */
  --glow-cyan: rgba(56,189,248,.30);
  --topbar-bg: rgba(9,12,18,.78);
  --overlay:   rgba(3,6,11,.74);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
  --shadow-md: 0 10px 30px rgba(0,0,0,.40);

  /* Geometry */
  --radius:    12px;
  --radius-sm: 8px;
  --space-section: 30px;
  --space-block: 16px;

  /* Type */
  --display: "Space Grotesk", "Inter Tight", "Inter", system-ui, sans-serif;
  --sans:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

/* ---------- DAY (light) theme — "Daylight credential" ---------- */
:root[data-theme="light"] {
  --bg:        #eef2f8;
  --bg-2:      #ffffff;

  --panel:     #ffffff;
  --panel-2:   #eef2f8;
  --panel-3:   #e2e9f3;
  --glass:     rgba(255,255,255,.72);

  --line:      #d3dcea;
  --line-soft: #e6ecf5;
  --line-lit:  rgba(37,99,235,.35);
  --grid:      rgba(40,80,140,.05);

  --text:      #0f1826;
  --muted:     #47566c;   /* ~7:1 on white */
  --faint:     #6b7c93;

  --accent:    #2563eb;   /* deepened for contrast on light */
  --accent-2:  #1d4ed8;
  --accent-ink:#ffffff;
  --cyan:      #0e7490;

  --green:     #15803d;
  --green-ink: #ffffff;
  --red:       #c0392b;
  --red-ink:   #ffffff;
  --amber-warn:#b45309;

  --glow:      rgba(59,130,246,.12);
  --glow-cyan: rgba(14,116,144,.16);
  --topbar-bg: rgba(255,255,255,.86);
  --overlay:   rgba(18,28,44,.5);
  --shadow-lg: 0 22px 50px rgba(30,50,90,.20);
  --shadow-md: 0 10px 26px rgba(30,50,90,.14);
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    radial-gradient(900px 520px at 50% -12%, var(--glow), transparent 68%);
  background-size: 46px 46px, 46px 46px, 100% 100%;
  background-attachment: fixed, fixed, fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Very subtle scanline sheen over the whole page */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(
    0deg, rgba(255,255,255,.014) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}
:root[data-theme="light"] body::before { display: none; }

main, .topbar, .modal-overlay, .foot { position: relative; z-index: 1; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.12;
  margin: 0;
}
h2 { font-size: clamp(26px, 4.4vw, 40px); }
h3 { font-size: 20px; }
p { margin: 0; }

::selection { background: rgba(79,143,247,.32); color: #fff; }

a { color: var(--accent); }

:where(button, a, input, select, [tabindex]):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79,143,247,.5);
  border-radius: var(--radius-sm);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px;
  position: sticky; top: 0; z-index: 40;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(79,143,247,.10);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo {
  display: inline-flex; line-height: 0;
  filter: drop-shadow(0 0 10px var(--glow-cyan));
}
.brand h1 {
  font-family: var(--display);
  font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 0;
}
.brand-pass { color: var(--accent); }
.brand p {
  margin: 2px 0 0; font-size: 10.5px; color: var(--faint);
  font-family: var(--mono); letter-spacing: .4px; text-transform: uppercase;
}

nav { display: flex; gap: 4px; margin-left: 6px; }
.nav-btn {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  transition: color .15s, background .15s, border-color .15s;
}
.nav-btn:hover { color: var(--text); background: var(--panel-2); }
.nav-btn.active {
  color: var(--accent);
  background: rgba(79,143,247,.10);
  border-color: var(--line-lit);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--radius-sm); padding: 12px 20px;
  font-family: var(--sans); font-size: 15px; font-weight: 600; cursor: pointer;
  letter-spacing: .01em; line-height: 1; white-space: nowrap;
  transition: transform .14s ease, box-shadow .18s ease, background .15s, border-color .15s, color .15s;
}
.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, 0 6px 18px rgba(59,130,246,.28);
}
.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 10px 26px rgba(59,130,246,.5), 0 0 0 1px var(--line-lit);
}
.btn.primary:active { transform: translateY(0); box-shadow: 0 3px 12px rgba(59,130,246,.35); }
.btn.primary:focus-visible { box-shadow: 0 6px 18px rgba(59,130,246,.35), 0 0 0 3px rgba(56,189,248,.55); }

.btn.ghost {
  background: rgba(255,255,255,.02); border: 1px solid var(--line); color: var(--text);
}
.btn.ghost:hover { border-color: var(--accent); background: rgba(79,143,247,.08); box-shadow: 0 0 0 1px var(--line-lit); }
.btn.ghost:active { transform: translateY(1px); }

.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn:disabled:hover { filter: none; }
.btn-sm { padding: 7px 13px; font-size: 13px; }

/* Inline busy spinner */
.btn-spin {
  display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: btn-spin .6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-spin { animation-duration: 1.4s; } }

.back {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-family: var(--sans); font-size: 14px; padding: 0 0 16px;
  transition: color .15s, transform .15s;
}
.back:hover { color: var(--text); transform: translateX(-3px); }

/* ---------- Layout ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 28px 24px 64px; }
.view { display: none; }
.view.active { display: block; }
.view.active > * + * { margin-top: var(--space-block); }
.view.active > h2 + .view-intro,
.view.active > h2 + .browse-controls,
.view.active > .section-title + .cards,
.view.active > .section-title + .trade-grid { margin-top: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .view.active { animation: view-in .28s ease both; }
  @keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

.section-title {
  display: flex; align-items: center; gap: 14px; margin: 26px 0 14px;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px; color: var(--faint);
}
.section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.view-intro { color: var(--muted); max-width: 640px; margin: 0 0 14px; line-height: 1.65; }

/* Uppercase micro-label */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 2.4px; color: var(--accent);
}
.eyebrow::before {
  content: ''; width: 20px; height: 1px; background: var(--accent); opacity: .7;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(26px, 5vw, 48px);
  margin-bottom: var(--space-section);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(520px 300px at 12% -20%, var(--glow), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100% 100%, 30px 30px, 30px 30px;
}
.hero::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent);
  box-shadow: 0 0 18px var(--glow-cyan);
}
.hero > * { position: relative; z-index: 1; }
.hero h2 { max-width: 18ch; }
.hero p {
  margin-top: 16px; max-width: 60ch;
  color: var(--muted); font-size: clamp(15px, 1.6vw, 17px); line-height: 1.7;
}
.hero p strong { color: var(--text); font-weight: 600; }
.cta-row { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

/* Landing hero — asymmetric: copy + credential badge */
.hero-trades {
  display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center;
  text-align: left;
}
@media (min-width: 880px) {
  .hero-trades { grid-template-columns: 1.15fr .85fr; gap: 40px; }
}
.hero-copy { display: flex; flex-direction: column; gap: 6px; }
.hero-copy h2 { margin-top: 14px; }
.hero-stats {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px;
}
.hero-stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.03); border: 1px solid var(--line);
}
.hero-stat b {
  font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.hero-stat span { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); }

/* ---------- ID credential badge visual ---------- */
.hero-visual { display: flex; justify-content: center; }
.credential {
  position: relative; width: 100%; max-width: 320px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid var(--line-lit);
  border-radius: 16px;
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(59,130,246,.12);
  overflow: hidden;
}
.credential::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(120,170,255,.05) 0 2px, transparent 2px 5px);
}
.credential::after {
  content: ""; position: absolute; top: -40%; right: -30%;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow-cyan), transparent 70%);
  pointer-events: none;
}
.cred-top {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.cred-org {
  font-family: var(--mono); font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--muted);
}
.cred-chip {
  width: 26px; height: 20px; border-radius: 4px;
  background: linear-gradient(135deg, #cbe0ff, #6f9de0);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
  position: relative;
}
.cred-chip::before, .cred-chip::after {
  content: ""; position: absolute; background: rgba(11,14,20,.5);
}
.cred-chip::before { left: 0; right: 0; top: 50%; height: 1px; }
.cred-chip::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.cred-shield {
  position: relative; display: block; margin: 4px auto 16px;
  width: 96px; height: 96px;
  filter: drop-shadow(0 0 16px var(--glow-cyan));
}
.cred-name {
  position: relative; font-family: var(--display); font-weight: 700;
  font-size: 18px; letter-spacing: -.01em; text-align: center; color: var(--text);
}
.cred-role {
  position: relative; text-align: center; margin-top: 3px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--accent);
}
.cred-meta {
  position: relative; display: flex; justify-content: space-between; gap: 8px;
  margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line);
}
.cred-meta div { display: flex; flex-direction: column; gap: 2px; }
.cred-meta span { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
.cred-meta b { font-family: var(--mono); font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.cred-status {
  position: relative; display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--green);
}
.cred-status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
}
@media (prefers-reduced-motion: no-preference) {
  .credential { animation: cred-float 6s ease-in-out infinite; }
  @keyframes cred-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
  .cred-status::before { animation: live-pulse 1.4s steps(2,end) infinite; }
}

/* ---------- Grids ---------- */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
#mock-cards, #mock-cards-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 680px) { #mock-cards, #mock-cards-2 { grid-template-columns: 1fr; } }

/* Shared card surface */
.card, .mock-card, .setup-card, .question-card, .score-summary,
.review-item, .browse-item, .trade-card, .hist-row, .dash-stats .stat, .modal {
  background: var(--panel);
  border: 1px solid var(--line);
}

.card {
  border-radius: var(--radius); min-height: 168px;
  padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .card, .trade-card, .browse-item { transition: transform .16s ease, border-color .16s, box-shadow .18s; }
}
.card:hover { transform: translateY(-3px); border-color: var(--line-lit); box-shadow: var(--shadow-md); }
.card h4 { font-size: 18px; font-weight: 700; line-height: 1.2; }
.card p { flex: 1; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

.badge {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge::before {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px;
  border-radius: 50%; background: var(--accent); vertical-align: middle;
}

/* Mock-exam cards */
.mock-card { min-height: 200px; border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.mock-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent);
  border-radius: var(--radius) 0 0 var(--radius);
}
.mock-card:hover { transform: translateY(-3px); border-color: var(--line-lit); box-shadow: var(--shadow-md); }
@media (prefers-reduced-motion: no-preference) { .mock-card { transition: transform .16s, border-color .16s, box-shadow .18s; } }
.mock-card h4 { font-size: 18px; }
.mock-card p { color: var(--muted); font-size: 13.5px; line-height: 1.6; flex: 1; }
.exam-facts {
  list-style: none; margin: 4px 0 0; padding: 14px 0 0;
  border-top: 1px solid var(--line-soft); display: flex; gap: 14px; flex-wrap: wrap;
}
.exam-facts li { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 70px; align-items: flex-start; }
.exam-facts li span { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); margin-top: 3px; }
.exam-facts li b { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 20px; line-height: 1.1; font-weight: 700; color: var(--text); }
.exam-facts li:last-child b { color: var(--accent); }
.mock-card .start-mock { margin-top: 16px; width: 100%; }

/* ---------- Setup form ---------- */
.setup-card {
  border-radius: var(--radius); padding: 28px;
  display: flex; flex-direction: column; gap: 20px; max-width: 460px;
}
.setup-card label {
  display: flex; flex-direction: column; gap: 9px;
  font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--faint);
  text-transform: uppercase; letter-spacing: 1.4px;
}
.setup-card select, .setup-card input {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 12px 13px;
  font-family: var(--sans); font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.setup-card select:hover, .setup-card input:hover,
#browse-topic:hover, #browse-search:hover { border-color: var(--line-lit); }
.setup-card select, #browse-topic { cursor: pointer; }
#setup-count { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.setup-card select:focus, .setup-card input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,143,247,.2);
}
.setup-card small {
  color: var(--muted); font-size: 12px; border-left: 2px solid var(--accent); padding-left: 10px; line-height: 1.5;
}
.mock-only { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Quiz header ---------- */
.quiz-header { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.quiz-header .back { padding: 0; align-self: center; }
.progress-wrap { flex: 1; display: flex; align-items: center; gap: 12px; }
.progress-bar {
  flex: 1; height: 8px; background: var(--bg-2);
  border: 1px solid var(--line-soft); border-radius: 6px; overflow: hidden;
}
#progress-fill {
  position: relative; overflow: hidden; height: 100%; width: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(0,0,0,.28) 23px 24px),
    linear-gradient(90deg, var(--accent-2), var(--cyan));
  transition: width .3s ease;
}
#progress-fill.full { box-shadow: 0 0 10px var(--glow-cyan), 0 0 0 1px var(--line-lit) inset; }
@media (prefers-reduced-motion: no-preference) {
  #progress-fill::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
    transform: translateX(-100%); animation: sheen 2.2s ease-in-out infinite;
  }
  @keyframes sheen { to { transform: translateX(100%); } }
}
#progress-text { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.timer {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--panel); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: var(--radius-sm); white-space: nowrap; color: var(--text);
}
.timer::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
.timer.warn { color: var(--amber-warn); border-color: var(--amber-warn); }
.timer.warn::before { background: var(--amber-warn); box-shadow: 0 0 6px var(--amber-warn); }
@media (prefers-reduced-motion: no-preference) {
  .timer.warn { animation: live-pulse 1s steps(2, end) infinite; }
  @keyframes live-pulse { 50% { box-shadow: 0 0 0 3px rgba(251,191,36,.25); } }
}

/* ---------- Question card + options ---------- */
.question-card { border-radius: var(--radius); padding: clamp(20px, 4vw, 30px); }
.q-source {
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 10px;
}
.q-text { font-family: var(--display); font-size: clamp(18px, 2.4vw, 22px); font-weight: 600; line-height: 1.45; color: var(--text); margin-bottom: 22px; letter-spacing: -.01em; }
.options { display: flex; flex-direction: column; gap: 12px; }

.option {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--bg-2); border: 1.5px solid var(--line); border-radius: var(--radius);
  color: var(--text); font-family: var(--sans); font-size: 15.5px; font-weight: 500; line-height: 1.45;
  cursor: pointer; text-align: left; width: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .option { transition: transform .13s ease, border-color .13s, background .13s, box-shadow .13s; }
}
.option > span:last-child { flex: 1; }
.option .letter {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1.5px solid var(--line);
  color: var(--muted); font-family: var(--mono); font-size: 14px; font-weight: 700;
}
.option:hover:not(.disabled) {
  border-color: var(--line-lit); background: var(--panel-3); transform: translateX(2px);
  box-shadow: 0 0 0 1px var(--line-lit);
}
.option.selected {
  border-color: var(--accent); background: rgba(79,143,247,.12);
  box-shadow: inset 3px 0 0 var(--accent), 0 0 18px rgba(59,130,246,.15);
  font-weight: 600;
}
.option.selected .letter { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (prefers-reduced-motion: no-preference) {
  .option.selected { animation: patch-in .18s ease; }
  @keyframes patch-in { from { box-shadow: inset 3px 0 0 transparent; } to { box-shadow: inset 3px 0 0 var(--accent); } }
}
.option.correct { border-color: var(--green); background: rgba(52,211,153,.14); box-shadow: inset 3px 0 0 var(--green); }
.option.correct .letter { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.option.incorrect { border-color: var(--red); background: rgba(248,113,113,.14); box-shadow: inset 3px 0 0 var(--red); }
.option.incorrect .letter { background: var(--red); border-color: var(--red); color: var(--red-ink); }
.option.disabled { cursor: default; }
.option.disabled:hover { transform: none; box-shadow: none; }
@media (prefers-reduced-motion: no-preference) {
  .option.correct { animation: conduct-on .3s ease both; }
  @keyframes conduct-on {
    0% { box-shadow: inset 3px 0 0 var(--green); }
    40% { box-shadow: inset 3px 0 0 var(--green), 0 0 0 3px rgba(52,211,153,.30); }
    100% { box-shadow: inset 3px 0 0 var(--green); }
  }
  .option.correct .letter { animation: letter-pop .26s ease both; }
  @keyframes letter-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
  .option.incorrect { animation: nudge .22s ease both; }
  @keyframes nudge { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
}

/* Practice feedback */
.feedback {
  margin-top: 22px; padding: 18px 20px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: var(--radius-sm); display: none;
}
.feedback:has(.verdict.right) { border-left-color: var(--green); }
.feedback:has(.verdict.wrong) { border-left-color: var(--red); }
.feedback.show { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .feedback.show { animation: trace-in .22s ease both; }
  @keyframes trace-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}
.feedback .verdict { font-family: var(--mono); font-weight: 700; margin-bottom: 8px; font-size: 14px; letter-spacing: .5px; }
.feedback .verdict.right { color: var(--green); }
.feedback .verdict.wrong { color: var(--red); }
.feedback .expl { color: var(--muted); font-size: 14px; line-height: 1.6; }

.quiz-nav { display: flex; gap: 12px; margin-top: 24px; justify-content: space-between; }
.quiz-nav .btn { min-width: 120px; }

/* ---------- Results ---------- */
.score-summary { border-radius: var(--radius); padding: 32px 28px; text-align: center; margin-bottom: 24px; }
.score-ring {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 140px; height: 140px; border-radius: 50%;
  font: 700 40px/1 var(--mono); color: var(--text); font-variant-numeric: tabular-nums;
  background: radial-gradient(circle at center, var(--panel) 60%, transparent 61%);
}
.score-ring::before {
  content: ""; position: absolute; inset: -8px; border-radius: 50%; z-index: -1;
  background: conic-gradient(var(--ring-c, var(--accent)) 100%, var(--line-soft) 0);
  filter: drop-shadow(0 0 14px var(--glow));
}
.score-ring.pass { --ring-c: var(--green); color: var(--green); }
.score-ring.fail { --ring-c: var(--red); color: var(--red); }
.score-summary .sub { color: var(--muted); margin-top: 14px; }
.score-summary .sub strong { font-family: var(--mono); text-transform: uppercase; letter-spacing: 1px; }
.score-summary .sub .pass, .score-summary .pass { color: var(--green); }
.score-summary .sub .fail, .score-summary .fail { color: var(--red); }

.results-review { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.review-item { border-left: 4px solid var(--line); border-radius: var(--radius); padding: 16px; }
.review-item.right { border-left-color: var(--green); }
.review-item.wrong { border-left-color: var(--red); }
.review-item .rq { font-weight: 600; color: var(--text); margin-bottom: 8px; line-height: 1.45; }
.review-item .ra { font-size: 14px; color: var(--muted); }
.review-item .ra b { color: var(--text); }
.review-item .rexpl { font-size: 13px; color: var(--muted); margin-top: 8px; font-style: italic; line-height: 1.55; }

/* ---------- Topic analytics ---------- */
.topic-breakdown { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); text-align: left; }
.topic-breakdown h4 { margin: 0 0 14px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--faint); }
.topic-row { display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 12px; margin-bottom: 9px; }
.topic-name { font-size: 13px; color: var(--text); text-align: left; }
.topic-bar { height: 8px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.topic-fill { height: 100%; border-radius: 6px; transition: width .4s; }
.topic-fill.strong { background: var(--green); }
.topic-fill.ok { background: var(--amber-warn); }
.topic-fill.weak { background: var(--red); }
.topic-pct { font-family: var(--mono); font-size: 13px; font-weight: 700; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.topic-pct small { font-weight: 400; color: var(--muted); }
.topic-pct.strong { color: var(--green); }
.topic-pct.ok { color: var(--amber-warn); }
.topic-pct.weak { color: var(--red); }
.topic-tip { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.topic-tip strong { color: var(--red); }
.topic-tip.good strong, .topic-tip.good { color: var(--green); }

.review-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.topic-tag, .reg-tag {
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.reg-tag { color: var(--cyan); font-family: var(--mono); }

.dash-topics { margin: 8px 0; }

.trust-note {
  color: var(--green); font-size: 13px; font-weight: 500; margin: 0 0 24px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(52,211,153,.08); border: 1px solid rgba(52,211,153,.25);
  padding: 7px 12px; border-radius: 20px;
}

/* ---------- Trade picker (entry) ---------- */
.hero-trades.hero { }
.trade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.trade-card {
  text-align: left; cursor: pointer; font: inherit; color: var(--text);
  border-top: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px 20px; display: flex; flex-direction: column; gap: 6px; min-height: 176px;
  position: relative; overflow: hidden;
}
.trade-card.live::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(300px 160px at 80% -10%, var(--glow), transparent 70%);
  transition: opacity .2s;
}
.trade-card.live:hover { transform: translateY(-3px); border-color: var(--line-lit); box-shadow: var(--shadow-md), 0 0 0 1px var(--line-lit); }
.trade-card.live:hover::after { opacity: 1; }
.trade-card.soon { opacity: .5; cursor: not-allowed; transition: opacity .15s, border-color .15s; }
.trade-card.soon:hover { opacity: .72; }
.trade-card.soon:hover .trade-badge.soon { border-color: var(--cyan); color: var(--cyan); }
.trade-icon {
  font-size: 30px; line-height: 1; margin-bottom: 8px;
  width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; background: rgba(79,143,247,.10); border: 1px solid var(--line-lit);
  box-shadow: 0 0 18px rgba(59,130,246,.14);
}
.trade-name { font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.trade-tagline { font-size: 13px; color: var(--muted); flex: 1; line-height: 1.55; margin-bottom: 4px; }
.trade-badge { margin-top: auto; font-family: var(--mono); font-size: 12px; padding: 5px 11px; border-radius: 8px; align-self: flex-start; }
.trade-badge.live { background: rgba(79,143,247,.12); border: 1px solid var(--line-lit); color: var(--accent); }
.trade-badge.live::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--accent); vertical-align: middle; box-shadow: 0 0 6px var(--accent); }
.trade-badge.soon { background: var(--panel-2); border: 1px solid var(--line); color: var(--faint); }

/* ---------- Browse / question bank ---------- */
.browse-controls {
  display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
  position: sticky; top: 66px; z-index: 5;
  background: var(--bg); padding: 10px 0;
  box-shadow: 0 8px 12px -8px rgba(3,6,11,.8);
}
#browse-search {
  flex: 1; min-width: 220px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 16px; font-family: var(--sans);
}
#browse-search:focus, #browse-topic:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,143,247,.2); }
#browse-topic { background: var(--bg-2); border: 1px solid var(--line); color: var(--text); padding: 12px 14px; border-radius: var(--radius-sm); font-size: 16px; }
.browse-count { position: sticky; top: 124px; z-index: 5; background: var(--bg); color: var(--muted); font-size: 13px; margin: 0 0 18px; padding-top: 2px; font-family: var(--mono); }
@media (min-width: 560px) { .browse-count { text-align: right; } }
.browse-list { display: flex; flex-direction: column; gap: 14px; }
.browse-item { border-left: 3px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.browse-item:hover { border-left-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.bi-q { font-weight: 600; font-size: 15.5px; margin-bottom: 12px; line-height: 1.5; }
.bi-a { font-size: 14px; color: var(--text); margin-bottom: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.bi-a .bi-label, .bi-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--green); font-weight: 700; margin-right: 6px; }
.bi-expl { font-size: 13px; color: var(--muted); line-height: 1.55; font-style: italic; margin-bottom: 12px; }
.bi-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.browse-more-wrap { text-align: center; margin-top: 18px; }
.browse-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 6px; padding: 48px 24px; background: var(--panel);
  border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted);
}
.browse-empty-ico { font-family: var(--mono); font-size: 34px; line-height: 1; color: var(--cyan); opacity: .7; margin-bottom: 4px; }
.browse-empty-title { margin: 0; font-weight: 600; color: var(--text); font-size: 16px; }
.browse-empty-sub { margin: 0; font-size: 13.5px; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .browse-empty { animation: trace-in .22s ease both; } }

/* ---------- Auth area, chips, links ---------- */
.user-chip {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  background: rgba(79,143,247,.10); border: 1px solid var(--line-lit);
  padding: 5px 11px; border-radius: 20px; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plan-badge.premium {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--accent); background: rgba(79,143,247,.12);
  border: 1px solid var(--line-lit); padding: 5px 10px; border-radius: 20px;
}
.linklike { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.auth-switch .linklike, .auth-forgot .linklike { display: inline-block; padding: 6px 4px; }
.admin-link { text-decoration: none; border-color: var(--line-lit) !important; color: var(--accent) !important; }
.admin-link:hover { background: rgba(79,143,247,.1) !important; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--overlay); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative; width: 100%; max-width: 380px;
  border: 1px solid var(--line-lit); border-radius: var(--radius);
  padding: 28px 26px; box-shadow: var(--shadow-lg), 0 0 60px rgba(59,130,246,.10);
  background:
    radial-gradient(400px 180px at 50% -30%, var(--glow), transparent 70%),
    var(--panel);
  overflow: hidden;
}
.modal::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}
@media (prefers-reduced-motion: no-preference) {
  .modal { animation: modal-in .2s ease both; }
  @keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
}
.modal h3 { margin: 0 0 18px; font-size: 21px; }
.modal-close {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; border-radius: var(--radius-sm);
}
.modal-close:hover { color: var(--text); background: var(--panel-2); }
#auth-form, #reset-form { display: flex; flex-direction: column; gap: 14px; }
#auth-form label, #reset-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
#auth-form label[hidden], #reset-form label[hidden] { display: none; }
#auth-form input, #reset-form input {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 12px; border-radius: var(--radius-sm); font-size: 16px; font-family: var(--sans);
}
#auth-form input:focus, #reset-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,143,247,.2); }
#auth-form .btn, #reset-form .btn { margin-top: 4px; }

.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 44px; box-sizing: border-box; }
.pw-toggle {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted); border-radius: var(--radius-sm);
}
.pw-toggle:hover { color: var(--text); }
.auth-error { background: rgba(248,113,113,.12); border: 1px solid var(--red); color: var(--red); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.auth-ok { background: rgba(52,211,153,.12); border: 1px solid var(--green); color: var(--green); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.auth-switch { margin: 16px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.auth-forgot { margin: 12px 0 0; text-align: center; }
.auth-forgot .linklike { font-size: 13px; color: var(--muted); }
.auth-forgot .linklike:hover { color: var(--accent); }

/* ---------- Dashboard ---------- */
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 14px; margin-bottom: 8px; }
.dash-stats .stat {
  border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
}
.dash-stats .stat span { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--faint); }
.dash-stats .stat b { font-family: var(--mono); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-stats .stat b.pass { color: var(--green); }
.dash-stats .stat b.fail { color: var(--red); }
.dash-history { display: flex; flex-direction: column; gap: 8px; }
.hist-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-left: 4px solid var(--line); border-radius: var(--radius); padding: 13px 16px; }
.hist-row.right { border-left-color: var(--green); }
.hist-row.wrong { border-left-color: var(--red); }
.hist-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hist-mode { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--faint); }
.hist-exam { font-weight: 600; font-size: 14px; }
.hist-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.hist-when { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.hist-score { font-family: var(--mono); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.hist-score.pass { color: var(--green); }
.hist-score.fail { color: var(--red); }
.muted-line { color: var(--muted); padding: 14px 0; }
.dash-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; padding: 40px 24px; background: var(--panel);
  border: 1px dashed var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); color: var(--muted); font-size: 14.5px;
}
.dash-empty::before { content: '◈'; font-size: 30px; line-height: 1; color: var(--accent); opacity: .9; }
.dash-empty .linklike { font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .muted-line { animation: soft-pulse 1.4s ease-in-out infinite; }
  @keyframes soft-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
}

/* ---------- Paywall / upgrade ---------- */
.upgrade-card {
  max-width: 460px; margin: 10px auto 0; text-align: center; position: relative; overflow: hidden;
  background:
    radial-gradient(500px 220px at 50% -20%, var(--glow), transparent 70%),
    linear-gradient(160deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line-lit); border-radius: var(--radius); padding: 34px 28px;
  box-shadow: var(--shadow-md), 0 0 50px rgba(59,130,246,.08);
}
.upgrade-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}
.upgrade-badge {
  display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--accent);
  background: rgba(79,143,247,.10); border: 1px solid var(--line-lit);
  padding: 5px 12px; border-radius: 20px; margin-bottom: 14px;
}
.upgrade-card h2 { margin: 0 0 10px; }
.upgrade-price { margin: 6px 0 2px; }
.up-amount { font-family: var(--mono); font-size: 42px; font-weight: 700; color: var(--text); }
.up-per { color: var(--muted); font-size: 16px; }
.upgrade-sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.upgrade-list { list-style: none; padding: 0; margin: 0 0 24px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.upgrade-list li { position: relative; padding-left: 28px; font-size: 14px; line-height: 1.45; }
.upgrade-list li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 700; }
.upgrade-cta { width: 100%; font-size: 16px; padding: 14px; }
.upgrade-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); min-height: 18px; }
.upgrade-note.is-error { color: var(--red); }
.results-upsell {
  margin-top: 22px; padding: 18px; border-radius: var(--radius);
  background: rgba(79,143,247,.08); border: 1px solid var(--line-lit); text-align: center;
}
.results-upsell p { margin: 0 0 12px; color: var(--text); font-size: 14px; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 16px; line-height: 1; padding: 0;
  transition: background .15s, border-color .15s, transform .1s;
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0); }
.theme-ico { display: none; }
:root[data-theme="dark"]  .theme-ico-moon { display: inline; }
:root[data-theme="light"] .theme-ico-sun  { display: inline; }

/* ---------- Misc ---------- */
.hidden { display: none !important; }
.foot {
  text-align: center; padding: 28px 24px; max-width: 1080px; margin: 0 auto;
  color: var(--faint); font-size: 11.5px; font-family: var(--mono); line-height: 1.7;
  border-top: 1px solid var(--line-soft);
}
.q-image { margin: 14px 0 18px; }
.q-image img { max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; padding: 8px; display: block; }
.bi-q + .q-image { margin: 10px 0 12px; }
.bi-q + .q-image img { max-width: 340px; }
.ai-note {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 600;
  color: var(--muted); background: var(--panel-2); border: 1px solid var(--line);
  padding: 1px 7px; border-radius: 10px; vertical-align: middle; letter-spacing: .02em;
}

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .brand { flex: 1 1 100%; }
  nav {
    order: 3; flex: 1 1 100%; margin-left: 0;
    gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
  }
  nav::-webkit-scrollbar { display: none; }
  .nav-btn { white-space: nowrap; padding: 10px 14px; min-height: 40px; display: inline-flex; align-items: center; }
  .auth-area { margin-left: 0; }

  main { padding: 18px 16px 56px; }
  .hero { padding: 26px 22px; margin-bottom: 22px; }
  .hero p { margin-top: 12px; }
  .section-title { margin: 22px 0 14px; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta-row .btn { width: 100%; text-align: center; }
  .hero-stats { gap: 8px; }
  .credential { max-width: 300px; }

  .quiz-nav { flex-wrap: wrap; }
  .quiz-nav .btn { min-width: 0; flex: 1; }
  .score-ring { width: 112px; height: 112px; font-size: 32px; }

  .trade-grid { grid-template-columns: 1fr; gap: 12px; }
  .trade-card { min-height: 0; padding: 18px; }

  .browse-controls { flex-direction: column; gap: 10px; }
  #browse-topic { width: 100%; }
  #browse-search, #browse-topic { font-size: 16px; min-height: 44px; }
  .browse-list { gap: 12px; }
  .browse-item { padding: 15px 16px; }
  .bi-q { font-size: 15px; }
  .browse-count { text-align: left; margin-bottom: 14px; top: 0; }

  .back { padding: 8px 4px 14px; min-height: 36px; display: inline-flex; align-items: center; margin-left: -4px; }

  .auth-area { width: 100%; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
  .auth-area .btn-sm, #install-btn { min-height: 40px; }
  .user-chip { max-width: none; }
}

/* =====================================================================
   LANDING — marketing page (inside #view-trades)
   Consistent vertical rhythm, section heads, and the Nightshift system
   extended across trust, why, how, sample, stats, pricing, FAQ, CTA.
   ===================================================================== */
#view-trades .hero-trades { margin-bottom: 0; }
#view-trades > .lp-section { margin-top: clamp(56px, 8.5vw, 92px); }
#view-trades > .lp-trust { margin-top: 26px; }

/* Section head */
.lp-head { max-width: 660px; margin: 0 0 26px; }
.lp-head h3 {
  font-family: var(--display); font-size: clamp(23px, 3.4vw, 32px);
  letter-spacing: -.02em; line-height: 1.14; margin: 12px 0 0; text-wrap: balance;
}
.lp-head p { margin: 12px 0 0; color: var(--muted); font-size: clamp(14.5px, 1.6vw, 16px); line-height: 1.65; max-width: 64ch; }
.lp-lead { color: var(--muted); margin: -2px 0 0; max-width: 60ch; line-height: 1.6; }
.lp-start .section-title { margin-top: 0; }

/* Trust strip */
.lp-trust {
  list-style: none; margin: 0; padding: 16px 22px;
  display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; justify-content: center;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.lp-trust li {
  position: relative; display: inline-flex; align-items: center; gap: 9px; padding-left: 24px;
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.lp-trust li::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(79,143,247,.14); border: 1px solid var(--line-lit);
  box-shadow: 0 0 8px var(--glow-cyan);
}
.lp-trust li::after {
  content: "✓"; position: absolute; left: 0; top: 50%; width: 16px; transform: translateY(-50%);
  text-align: center; font-size: 10px; font-weight: 700; color: var(--accent); line-height: 1;
}

/* WHY — value cards */
.lp-why-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(236px, 1fr)); gap: 16px;
}
.lp-card {
  position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; display: flex; flex-direction: column; gap: 10px;
}
@media (prefers-reduced-motion: no-preference) {
  .lp-card { transition: transform .16s ease, border-color .16s, box-shadow .18s; }
}
.lp-card:hover { transform: translateY(-3px); border-color: var(--line-lit); box-shadow: var(--shadow-md); }
.lp-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(260px 140px at 85% -10%, var(--glow), transparent 70%);
  transition: opacity .2s;
}
.lp-card:hover::after { opacity: 1; }
.lp-ico {
  width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); background: rgba(79,143,247,.10); border: 1px solid var(--line-lit);
  box-shadow: 0 0 18px rgba(59,130,246,.14); margin-bottom: 4px;
}
.lp-ico svg { width: 23px; height: 23px; }
.lp-card h4 { font-family: var(--display); font-size: 17px; letter-spacing: -.01em; }
.lp-card p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }

/* HOW — steps */
.lp-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.lp-step {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-top: 2px solid var(--line-soft); border-radius: var(--radius);
  padding: 24px 22px 22px; display: flex; flex-direction: column; gap: 8px;
}
.lp-step-n {
  font-family: var(--mono); font-size: 30px; font-weight: 700; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.3px var(--accent);
  margin-bottom: 6px; letter-spacing: -.02em;
}
.lp-step h4 { font-family: var(--display); font-size: 17px; letter-spacing: -.01em; }
.lp-step p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }

/* SAMPLE QUESTION */
.lp-qcard {
  position: relative; overflow: hidden;
  background:
    radial-gradient(520px 260px at 100% -30%, var(--glow), transparent 70%),
    var(--panel);
  border: 1px solid var(--line-lit); border-radius: var(--radius);
  padding: clamp(22px, 3.5vw, 30px);
  box-shadow: var(--shadow-md);
}
.lp-qcard::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(120,170,255,.03) 0 2px, transparent 2px 5px);
}
.lp-qcard > * { position: relative; }
.lp-qtag {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--faint); margin-bottom: 12px;
}
.lp-qtext {
  font-family: var(--display); font-size: clamp(17px, 2.2vw, 20px); font-weight: 600;
  line-height: 1.45; letter-spacing: -.01em; margin: 0 0 20px; max-width: 62ch;
}
.lp-opts { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.lp-opt {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; background: var(--bg-2);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  font-size: 15px; line-height: 1.45; color: var(--text);
}
.lp-opt > span:last-of-type { flex: 1; }
.lp-letter {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1.5px solid var(--line);
  color: var(--muted); font-family: var(--mono); font-size: 14px; font-weight: 700;
}
.lp-opt.is-correct {
  border-color: var(--green); background: rgba(52,211,153,.12);
  box-shadow: inset 3px 0 0 var(--green);
}
.lp-opt.is-correct .lp-letter { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.lp-tick { width: 20px; height: 20px; color: var(--green); flex-shrink: 0; }
.lp-qexpl {
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--green);
  color: var(--muted); font-size: 14px; line-height: 1.6;
}
.lp-qexpl-tag {
  display: block; font-family: var(--mono); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px; color: var(--green); margin-bottom: 6px;
}

/* STATS BAND */
.lp-statsband {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background:
    radial-gradient(700px 220px at 50% -40%, var(--glow), transparent 70%),
    linear-gradient(150deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 20px; overflow: hidden;
}
.lp-figure {
  text-align: center; padding: 6px 12px; position: relative;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.lp-figure + .lp-figure::before {
  content: ""; position: absolute; left: 0; top: 12%; height: 76%; width: 1px;
  background: linear-gradient(180deg, transparent, var(--line), transparent);
}
.lp-figure b {
  font-family: var(--mono); font-size: clamp(30px, 5vw, 42px); font-weight: 700; line-height: 1;
  color: var(--accent); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 22px rgba(59,130,246,.25);
}
.lp-figure span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }

/* PRICING */
.lp-pricing .lp-head { text-align: center; margin-left: auto; margin-right: auto; }
.lp-pricing .lp-head p { margin-left: auto; margin-right: auto; }
.lp-price-card {
  position: relative; overflow: hidden; max-width: 460px; margin: 0 auto;
  background:
    radial-gradient(500px 220px at 50% -20%, var(--glow), transparent 70%),
    linear-gradient(160deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line-lit); border-radius: var(--radius);
  padding: 30px 28px; box-shadow: var(--shadow-md), 0 0 50px rgba(59,130,246,.08);
}
.lp-price-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}
.lp-price-top { text-align: center; }
.lp-price { margin: 14px 0 2px; }
.lp-price-amt { font-family: var(--mono); font-size: 44px; font-weight: 700; color: var(--text); }
.lp-price-per { color: var(--muted); font-size: 16px; }
.lp-price-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
.lp-price-list {
  list-style: none; padding: 20px 0; margin: 0 0 22px; text-align: left;
  display: flex; flex-direction: column; gap: 11px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.lp-price-list li { position: relative; padding-left: 30px; font-size: 14px; line-height: 1.5; }
.lp-price-list li::before {
  content: "✓"; position: absolute; left: 4px; top: 0; color: var(--green); font-weight: 700;
}
.lp-price-cta { width: 100%; font-size: 16px; padding: 14px; }
.lp-price-note { margin: 14px 0 0; font-size: 12.5px; color: var(--faint); text-align: center; }

/* FAQ */
.lp-faq-list { display: flex; flex-direction: column; gap: 10px; }
.lp-faq-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.lp-faq-item[open] { border-color: var(--line-lit); }
.lp-faq-item summary {
  list-style: none; cursor: pointer; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: var(--display); font-weight: 600; font-size: 15.5px; letter-spacing: -.01em; color: var(--text);
  transition: color .15s;
}
.lp-faq-item summary::-webkit-details-marker { display: none; }
.lp-faq-item summary:hover { color: var(--accent); }
.lp-faq-item summary:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--line-lit); border-radius: var(--radius); }
.lp-faq-mark { position: relative; width: 16px; height: 16px; flex-shrink: 0; }
.lp-faq-mark::before, .lp-faq-mark::after {
  content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--accent); border-radius: 2px;
}
.lp-faq-mark::before { width: 14px; height: 2px; }
.lp-faq-mark::after { width: 2px; height: 14px; transition: transform .2s ease; }
.lp-faq-item[open] .lp-faq-mark::after { transform: translate(-50%, -50%) scaleY(0); }
.lp-faq-body { padding: 0 20px 18px; }
.lp-faq-body p { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 0; max-width: 68ch; }
@media (prefers-reduced-motion: no-preference) {
  .lp-faq-item[open] .lp-faq-body { animation: trace-in .22s ease both; }
}

/* FINAL CTA */
.lp-final-inner {
  position: relative; overflow: hidden; text-align: center;
  background:
    radial-gradient(700px 300px at 50% 120%, var(--glow), transparent 70%),
    linear-gradient(150deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line-lit); border-radius: var(--radius);
  padding: clamp(34px, 6vw, 56px) 24px;
}
.lp-final-inner::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask: radial-gradient(60% 60% at 50% 50%, #000, transparent 75%);
  mask: radial-gradient(60% 60% at 50% 50%, #000, transparent 75%);
}
.lp-final-inner > * { position: relative; }
.lp-final-inner .eyebrow { justify-content: center; }
.lp-final-inner h3 {
  font-family: var(--display); font-size: clamp(24px, 4.2vw, 38px); letter-spacing: -.02em;
  line-height: 1.12; margin: 14px 0 0; text-wrap: balance;
}
.lp-final-inner p { color: var(--muted); margin: 14px auto 0; max-width: 52ch; line-height: 1.6; }
.lp-final-cta { justify-content: center; margin-top: 26px; }

/* RICHER FOOTER */
.foot { text-align: left; }
.foot-top {
  display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between;
  padding-bottom: 26px; margin-bottom: 22px; border-bottom: 1px solid var(--line-soft);
  text-align: left;
}
.foot-brand { display: flex; gap: 12px; align-items: flex-start; max-width: 340px; }
.foot-logo { display: inline-flex; line-height: 0; filter: drop-shadow(0 0 8px var(--glow-cyan)); }
.foot-brand strong { font-family: var(--display); font-size: 16px; color: var(--text); letter-spacing: -.01em; }
.foot-brand p { margin: 6px 0 0; font-family: var(--sans); font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.foot-links { display: flex; gap: 44px; flex-wrap: wrap; }
.foot-col { display: flex; flex-direction: column; gap: 9px; align-items: flex-start; }
.foot-col h5 {
  margin: 0 0 3px; font-family: var(--mono); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px; color: var(--faint);
}
.foot-col .linklike {
  font-family: var(--sans); font-size: 13px; color: var(--muted); text-decoration: none; padding: 2px 0;
  transition: color .15s;
}
.foot-col .linklike:hover { color: var(--accent); }
.foot-legal { font-family: var(--mono); font-size: 11.5px; color: var(--faint); line-height: 1.7; margin: 0; max-width: 900px; }

/* Landing responsive */
@media (max-width: 780px) {
  .lp-steps { grid-template-columns: 1fr; }
  .lp-statsband { grid-template-columns: repeat(2, 1fr); gap: 24px 8px; padding: 26px 16px; }
  .lp-figure:nth-child(3)::before { display: none; }
}
@media (max-width: 620px) {
  #view-trades > .lp-section { margin-top: clamp(44px, 12vw, 60px); }
  .lp-trust { padding: 14px 16px; gap: 8px 18px; justify-content: flex-start; }
  .lp-trust li { font-size: 12.5px; white-space: normal; }
  .lp-why-grid { grid-template-columns: 1fr; }
  .lp-final-cta { flex-direction: column; }
  .lp-final-cta .btn { width: 100%; }
  .foot-top { flex-direction: column; gap: 26px; }
  .foot-links { gap: 32px; }
}
@media (max-width: 400px) {
  .lp-statsband { grid-template-columns: 1fr; gap: 20px; }
  .lp-figure + .lp-figure::before { display: none; }
}
