/* ==========================================================================
   iEval — Spatial Night-Mode Glassmorphism
   Mobile-first. No external fonts or assets.
   ========================================================================== */

:root {
  --bg: #080c14;
  --glass: rgba(17, 24, 39, 0.75);
  --glass-2: rgba(30, 41, 59, 0.55);
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.3);
  --blue: #3b82f6;
  --blue-soft: #93c5fd;
  --blue-glow: rgba(59, 130, 246, 0.35);
  --text: #e5ecf7;
  --muted: #9aa8be;
  --dim: #6b7a92;
  --ok: #34d399;
  --warn: #fbbf24;
  --hot: #fb7185;
  --radius: 22px;
  --radius-sm: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Static depth: faint grid of light far behind the glass */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(59, 130, 246, 0.14), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(59, 130, 246, 0.08), transparent 60%);
  pointer-events: none;
}

/* ---------- Ambient pointer light (position driven by engine.js) ---------- */
.ambient-light {
  position: fixed;
  top: 0;
  left: 0;
  width: 640px;
  height: 640px;
  margin: -320px 0 0 -320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.26) 0%, rgba(59, 130, 246, 0.1) 35%, transparent 68%);
  pointer-events: none;
  z-index: -1;
  will-change: transform;
  transform: translate3d(50vw, 30vh, 0);
}

/* ---------- Page frame ---------- */
.page-wrapper {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- AdSense slots: reserved height, so no layout shift ---------- */
.ad-slot {
  position: relative;
  width: 100%;
  margin: 0 auto;
  border: 1px dashed rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.35);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  contain: layout paint;
}
.ad-slot:empty::before,
.ad-slot::before {
  content: "Advertisement";
  position: absolute;
  top: 6px;
  left: 10px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.4);
}
.ad-slot-top { height: 100px; max-width: 728px; }       /* 320x100 mobile banner */
.ad-slot-bottom { height: 250px; max-width: 336px; }    /* 300x250 rectangle */

/* ---------- Glass panel ---------- */
.glass-panel {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 18px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  /* Tall enough that question-to-question changes don't shove the bottom ad around */
  min-height: 540px;
}

.view { animation: viewIn 0.45s var(--ease) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Type ---------- */
h1, h2, h3 { margin: 0; line-height: 1.18; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 7vw, 2.7rem); font-weight: 750; }
h2 { font-size: 1.25rem; font-weight: 680; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--blue-soft); }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-soft);
}
.subtitle { color: var(--muted); margin-top: 12px; max-width: 58ch; }
.subtitle strong { color: var(--text); font-weight: 600; }

/* ---------- Landing ---------- */
#landingView h1 { margin-top: 12px; }
.mode-cards { display: grid; gap: 14px; margin-top: 24px; perspective: 900px; }

.mode-card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.55));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.18s var(--ease);
}
.mode-card h2 { margin: 10px 0 6px; }
.mode-card p { color: var(--muted); font-size: 0.94rem; }
.mode-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-soft);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px;
  padding: 4px 10px;
}
.mode-cta { display: inline-block; margin-top: 14px; color: var(--blue-soft); font-weight: 600; font-size: 0.95rem; }
.mode-card.is-target { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 14px 40px var(--blue-glow); }

.landing-meta { margin-top: 18px; color: var(--dim); font-size: 0.82rem; text-align: center; }
.resume-link { display: block; margin: 10px auto 0; }

.compare-banner {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.1);
  font-size: 0.94rem;
}
.compare-banner strong { color: #fff; }

/* ---------- 3D tilt (vars written by engine.js on mouse hover only) ---------- */
.tilt {
  --rx: 0deg;
  --ry: 0deg;
  --lift: 0px;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transform-style: preserve-3d;
  will-change: transform;
}

/* ---------- Quiz ---------- */
.quiz-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.step-counter { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

.progress-track {
  height: 4px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  box-shadow: 0 0 12px var(--blue-glow);
  transition: width 0.45s var(--ease);
}

.question-stage { margin-top: 22px; }
.question-stage.q-enter { animation: qIn 0.38s var(--ease) both; }
@keyframes qIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

.question-text {
  font-size: clamp(1.12rem, 4.4vw, 1.4rem);
  font-weight: 620;
  line-height: 1.35;
  /* Reserve room for ~5 lines so the answer list doesn't jump between questions */
  min-height: 7.4em;
  text-wrap: pretty;
}
.question-act {
  display: block;
  margin-top: 10px;
  color: var(--blue-soft);
  font-weight: 700;
}

.options-grid { display: grid; gap: 10px; margin-top: 16px; perspective: 900px; }

.option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 560;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: var(--glass-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  touch-action: manipulation;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.16s var(--ease);
}
.opt-key {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  transition: inherit;
}
.option-card:active { transform: scale(0.985); }
.option-card.is-selected {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue), 0 10px 30px var(--blue-glow);
}
.option-card.is-selected .opt-key { background: var(--blue); border-color: var(--blue); color: #fff; }

.quiz-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; min-height: 44px; }
.quiz-hint { color: var(--dim); font-size: 0.8rem; }

/* Hover styles only where a real hover exists (keeps touch from sticking) */
@media (hover: hover) and (pointer: fine) {
  .mode-card:hover, .option-card:hover {
    --lift: -2px;
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(59, 130, 246, 0.25);
  }
  .btn:hover { filter: brightness(1.12); }
  .ghost-link:hover { color: var(--blue-soft); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 650;
  color: #fff;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(180deg, #4f8ff8, #2563eb);
  box-shadow: 0 10px 28px var(--blue-glow);
  touch-action: manipulation;
  transition: filter 0.2s, transform 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn-ghost { background: rgba(30, 41, 59, 0.6); border-color: var(--line-strong); box-shadow: none; color: var(--text); }
.btn-block { width: 100%; }

.ghost-link {
  font: inherit;
  font-size: 0.86rem;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 10px 6px;
  min-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
}
.ghost-link:disabled { opacity: 0.35; cursor: default; }
.ghost-link[aria-pressed="true"] { color: var(--blue-soft); }

:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 2px; border-radius: 8px; }

/* ---------- Analyzing ---------- */
#analyzingView { text-align: center; padding: 70px 0 60px; }
#analyzingView .subtitle { margin-left: auto; margin-right: auto; min-height: 3.2em; }
.scanner-ring {
  width: 96px;
  height: 96px;
  margin: 0 auto 28px;
  border-radius: 50%;
  border: 3px solid rgba(59, 130, 246, 0.18);
  border-top-color: var(--blue);
  box-shadow: 0 0 40px var(--blue-glow), inset 0 0 24px rgba(59, 130, 246, 0.2);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Result ---------- */
.result-head { text-align: center; }
.archetype-name {
  margin-top: 10px;
  font-size: clamp(1.9rem, 8vw, 2.8rem);
  font-weight: 780;
  background: linear-gradient(180deg, #fff, #9cc2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.archetype-tagline { margin-top: 8px; color: var(--muted); font-style: italic; }

.headline-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.stat {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.5);
  text-align: center;
}
.stat-label { font-size: 0.68rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.stat-value { margin-top: 4px; font-size: 1.9rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 0.5em; color: var(--muted); font-weight: 600; }
.tier-low { color: var(--ok); }
.tier-guarded { color: var(--blue-soft); }
.tier-elevated { color: var(--warn); }
.tier-high { color: var(--hot); }

.section { margin-top: 28px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-title .eyebrow { color: var(--muted); }

/* 4P 2x2 grid */
.axis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.axis-cell {
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.5);
  min-width: 0;
}
.axis-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.axis-code { font-family: var(--mono); font-size: 0.72rem; color: var(--blue-soft); }
.axis-score { font-size: 1.35rem; font-weight: 740; font-variant-numeric: tabular-nums; }
.axis-name { font-size: 0.86rem; font-weight: 600; margin-top: 2px; }
.axis-bar {
  position: relative;
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}
.axis-bar::after { content: ""; position: absolute; left: 50%; top: -3px; width: 1px; height: 12px; background: var(--line-strong); }
.axis-bar i {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  box-shadow: 0 0 10px var(--blue-glow);
  transition: left 0.4s var(--ease), width 0.4s var(--ease);
}
.axis-bar i.neg { background: linear-gradient(90deg, #fb7185, #f59e0b); box-shadow: 0 0 10px rgba(251, 113, 133, 0.3); }
.axis-poles { display: flex; justify-content: space-between; gap: 6px; margin-top: 6px; font-size: 0.66rem; color: var(--dim); }
.axis-poles span { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.axis-poles span:last-child { text-align: right; }
.axis-poles .on { color: var(--text); }

.read p { color: #cfd8e6; }
.read p + p { margin-top: 12px; }

/* Actions */
.actions { display: grid; gap: 10px; }
.link-row { display: flex; gap: 8px; margin-top: 10px; }
.link-row input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(8, 12, 20, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.note { margin-top: 8px; font-size: 0.82rem; color: var(--dim); }
.toast { min-height: 1.3em; margin-top: 8px; font-size: 0.84rem; color: var(--ok); }

/* Compare */
.compare-card {
  padding: 16px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.07);
}
.compare-heads { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; text-align: center; }
.compare-heads .who { font-size: 0.66rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.compare-heads .arch { font-weight: 700; font-size: 0.98rem; line-height: 1.2; margin-top: 2px; }
.sync-pct { font-size: 1.6rem; font-weight: 780; color: var(--blue-soft); font-variant-numeric: tabular-nums; }
.sync-pct small { display: block; font-size: 0.6rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.diff-table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.diff-table th { font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; text-align: right; padding: 4px 6px; }
.diff-table th:first-child, .diff-table td:first-child { text-align: left; }
.diff-table td { padding: 7px 6px; border-top: 1px solid var(--line); text-align: right; }
.friction-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.friction-list li { padding: 10px 12px; border-radius: 12px; background: rgba(8, 12, 20, 0.45); border: 1px solid var(--line); font-size: 0.88rem; }
.friction-list .q { font-weight: 600; }
.friction-list .a { color: var(--muted); margin-top: 3px; }

/* ---------- Dossier (teaser + unlocked) ---------- */
.dossier {
  position: relative;
  padding: 18px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(8, 12, 20, 0.5);
  overflow: hidden;
}
.dossier-lead { color: #dbe4f2; }
.dossier-lead strong { color: #fff; }
.dossier-blur {
  margin-top: 12px;
  color: #cfd8e6;
  filter: blur(6px);
  opacity: 0.75;
  user-select: none;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
}
.dossier-blur p + p { margin-top: 10px; }

.unlock-card {
  position: relative;
  margin-top: -44px;
  padding: 18px 16px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(59, 130, 246, 0.5);
  background: linear-gradient(180deg, rgba(23, 37, 84, 0.92), rgba(15, 23, 42, 0.95));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(59, 130, 246, 0.18);
}
.unlock-card h3 { font-size: 1.08rem; }
.unlock-list { list-style: none; margin: 12px 0 14px; padding: 0; text-align: left; font-size: 0.88rem; color: var(--muted); display: grid; gap: 6px; }
.unlock-list li::before { content: "\2713"; color: var(--blue-soft); margin-right: 8px; }

.badge {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  white-space: nowrap;
}
.badge-hot { color: var(--hot); border-color: rgba(251, 113, 133, 0.5); background: rgba(251, 113, 133, 0.08); }
.badge-blue { color: var(--blue-soft); border-color: rgba(59, 130, 246, 0.5); background: rgba(59, 130, 246, 0.1); }

.dossier h3 { margin: 22px 0 8px; }
.dossier h3:first-child { margin-top: 0; }
.dossier p { color: #cfd8e6; }
.dossier p + p { margin-top: 10px; }

.callout {
  margin-top: 8px;
  padding: 14px;
  border-left: 3px solid var(--blue);
  border-radius: 0 12px 12px 0;
  background: rgba(59, 130, 246, 0.08);
}

/* What-If simulator */
.sim-out {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.07);
}
.sim-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 0.9rem; }
.sim-row .k { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; flex: none; }
.sim-row .v { font-weight: 700; text-align: right; }
.sim-row .v s { display: block; color: var(--dim); font-weight: 500; font-size: 0.86em; }
.sim-axes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.sim-axes div { padding: 8px 2px; border-radius: 10px; background: rgba(8, 12, 20, 0.5); border: 1px solid var(--line); }
.sim-axes b { display: block; font-size: 1.02rem; }
.sim-axes span { font-size: 0.66rem; color: var(--muted); font-family: var(--mono); }
.sim-axes em { display: block; font-style: normal; font-size: 0.7rem; color: var(--dim); min-height: 1.2em; }
.sim-axes em.up { color: var(--ok); }
.sim-axes em.down { color: var(--hot); }
.sim-changed { animation: pulse 0.5s var(--ease); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--blue-glow); } 100% { box-shadow: 0 0 0 14px transparent; } }

.sim-q { margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(15, 23, 42, 0.5); }
.sim-q .q { font-size: 0.9rem; font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 10px; }
.seg button {
  position: relative;
  min-height: 46px;
  padding: 4px 2px;
  font: inherit;
  font-size: 0.66rem;
  line-height: 1.15;
  color: var(--muted);
  cursor: pointer;
  background: rgba(8, 12, 20, 0.55);
  border: 1px solid var(--line);
  border-radius: 9px;
  touch-action: manipulation;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.seg button.is-on { color: #fff; background: rgba(59, 130, 246, 0.28); border-color: var(--blue); }
.seg button.is-orig::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
}
.sim-legend { margin-top: 10px; font-size: 0.78rem; color: var(--dim); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sim-legend i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-right: 6px; vertical-align: middle; }

/* Question-by-question breakdown */
.qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.qlist li { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(15, 23, 42, 0.45); }
.qlist li.is-friction { border-color: rgba(251, 113, 133, 0.45); }
.qlist .qh { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.qlist .qn { font-family: var(--mono); font-size: 0.74rem; color: var(--blue-soft); }
.qlist .qt { font-weight: 650; font-size: 0.92rem; margin-right: auto; }
.qlist .qm { margin-top: 6px; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.qlist .qm b { color: var(--text); font-weight: 600; }
.qlist .qnote { margin-top: 6px; font-size: 0.88rem; color: #cfd8e6; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip { font-family: var(--mono); font-size: 0.7rem; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.chip.up { color: var(--ok); border-color: rgba(52, 211, 153, 0.35); }
.chip.down { color: var(--hot); border-color: rgba(251, 113, 133, 0.35); }

/* ---------- Footer ---------- */
.app-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: 0.82rem;
  color: var(--dim);
}
.app-footer a { color: var(--muted); }
.disclaimer { flex-basis: 100%; font-size: 0.72rem; color: var(--dim); line-height: 1.45; }

/* ---------- Wider screens ---------- */
@media (min-width: 640px) {
  .page-wrapper { padding: 24px 24px 40px; gap: 20px; }
  .glass-panel { padding: 36px 36px; }
  .mode-cards { grid-template-columns: 1fr 1fr; }
  .actions { grid-template-columns: 1fr 1fr; }
  .seg button { font-size: 0.74rem; }
  .question-text { min-height: 5.6em; }
}
@media (min-width: 768px) {
  .ad-slot-top { height: 90px; }                         /* 728x90 leaderboard */
  .ad-slot-bottom { max-width: 728px; height: 250px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .scanner-ring { animation: none; border-color: var(--blue); }
  .tilt { transform: none; }
}
