/*
 * Tokens follow GoodEd/np-designs (resources/design-system/tokens).
 * Amber is the only accent and marks the primary action. Everything else is
 * graphite, ink and surface. Inter is the only typeface. No pill radii.
 */
:root {
  color-scheme: light dark;

  --amber: #f5a100;
  --amber-2: #ffb726;
  --amber-ink: #0c0c0e;
  --bronze-ink: #5a3a00;

  --stage: #f2f2f4;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f6f6f8;
  --ink: #0c0c0e;
  --ink-2: #2b2b30;
  --muted: #6b6b72;
  --muted-2: #9a9aa3;
  --border: rgba(0, 0, 0, 0.08);
  --border-2: rgba(0, 0, 0, 0.14);
  --chip: rgba(0, 0, 0, 0.05);

  --success: #12805c;
  --success-tint: rgba(18, 128, 92, 0.1);
  --success-line: rgba(18, 128, 92, 0.35);
  --danger: #c0392b;
  --danger-tint: rgba(192, 57, 43, 0.08);
  --danger-line: rgba(192, 57, 43, 0.3);

  --e-1: 0 1px 2px rgba(15, 15, 20, 0.06);
  --e-2: 0 8px 20px rgba(15, 15, 20, 0.08), 0 1px 2px rgba(15, 15, 20, 0.05);
  --e-3: 0 30px 60px -20px rgba(15, 15, 20, 0.18), 0 12px 24px -8px rgba(15, 15, 20, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --glow-amber: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 0 1px rgba(245, 161, 0, 0.4), 0 8px 20px rgba(245, 161, 0, 0.28);

  --r-xs: 4px;
  --r-s: 8px;
  --r-m: 10px;
  --r-l: 16px;
  --r-xl: 24px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --d-fast: 150ms;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01", "ss03";
  color: var(--ink);
  background: var(--stage);
}

@media (prefers-color-scheme: dark) {
  :root {
    --stage: #0c0c0e;
    --bg: #111114;
    --surface: #17171b;
    --surface-2: #1e1e24;
    --ink: #f5f5f7;
    --ink-2: #c9c9cf;
    --muted: #8a8a93;
    --muted-2: #5f5f66;
    --border: rgba(255, 255, 255, 0.08);
    --border-2: rgba(255, 255, 255, 0.14);
    --chip: rgba(255, 255, 255, 0.06);

    --success: #39d6a5;
    --success-tint: rgba(57, 214, 165, 0.12);
    --success-line: rgba(57, 214, 165, 0.3);
    --danger: #ff6b6b;
    --danger-tint: rgba(255, 107, 107, 0.1);
    --danger-line: rgba(255, 107, 107, 0.3);

    --e-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --e-2: 0 8px 24px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
    --e-3: 0 30px 60px -20px rgba(0, 0, 0, 0.6), 0 12px 24px -8px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--stage); }
button, input { font: inherit; color: inherit; }
button, a { cursor: pointer; -webkit-tap-highlight-color: transparent; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--amber-2); outline-offset: 2px; }

.stage {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.phone {
  width: min(420px, 100%);
  height: min(900px, calc(100dvh - 48px));
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--e-3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.scroll {
  flex: 1;
  overflow: auto;
  padding: 16px 16px 32px;
}

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.top h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0;
}
.mark {
  width: 32px;
  height: 32px;
  border-radius: var(--r-s);
  background: var(--amber);
  color: var(--bronze-ink);
  display: grid;
  place-items: center;
  flex: none;
}
.mark svg { display: block; }
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.lede { color: var(--muted); font-size: 14px; line-height: 1.5; }

.icon-btn, .text-btn, .primary, .secondary, .row, .chip, .opt, .tab {
  border: 0;
  background: transparent;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--r-m);
  border: 1px solid var(--border-2);
  background: var(--surface);
  display: grid;
  place-items: center;
  flex: none;
  transition: background-color var(--d-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); }

/* Segmented toggle, amber-active: the subject filter changes the list below. */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 16px 0 12px;
  background: var(--chip);
  border: 1px solid var(--border);
  border-radius: var(--r-m);
}
.tab {
  flex: 1;
  min-height: 36px;
  border-radius: var(--r-s);
  padding: 8px 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--d-fast) var(--ease), background-color var(--d-fast) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-pressed="true"] { background: var(--amber); color: var(--amber-ink); }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-l);
  box-shadow: var(--e-1);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
}
.row:hover { border-color: var(--border-2); box-shadow: var(--e-2); }
.row-name { font-weight: 600; font-size: 16px; line-height: 1.35; letter-spacing: -0.01em; }
.row-meta { color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.chips { display: flex; gap: 4px; }
.chip {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--r-xs);
  padding: 3px 6px;
  background: var(--chip);
  border: 1px solid var(--border);
  color: var(--ink-2);
}
.chip.off { color: var(--muted-2); text-decoration: line-through; }

.level-card {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-l);
  box-shadow: var(--e-1);
  padding: 16px;
  margin-top: 12px;
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
}
.level-card:hover:not(:disabled) { border-color: var(--border-2); box-shadow: var(--e-2); }
.level-card:disabled { opacity: 0.55; cursor: not-allowed; }
.level-kicker { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.level-title { font-size: 22px; font-weight: 700; line-height: 1.2; margin: 6px 0 4px; letter-spacing: -0.015em; }
.level-copy { color: var(--muted); font-size: 14px; line-height: 1.5; }

.progress-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.progress-count { font-variant-numeric: tabular-nums; font-weight: 700; }
.track { height: 6px; background: var(--chip); border-radius: var(--r-xs); margin: 8px 0 16px; overflow: hidden; }
.track span { display: block; height: 100%; background: var(--ink); border-radius: inherit; }

.stem {
  font-size: 17px;
  line-height: 1.55;
  margin-bottom: 16px;
}
.stem, .explain { overflow-wrap: anywhere; }
.stem p { margin: 0 0 8px; }
.stem p:empty { display: none; }
.stem svg, .stem img, .explain img { max-width: 100%; height: auto; vertical-align: middle; }
/* Diagrams carry inline width and height. Without this, max-width squashes them instead of scaling. */
.stem img, .explain img { height: auto !important; cursor: zoom-in; }
/* Explanations embed YouTube with width="560". Inline-styled responsive wrappers keep their own sizing. */
.stem iframe, .explain iframe, .explain video { width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; }
.stem svg { display: block; margin-top: 8px; }

/*
 * app.js wraps every content table in .table-wrap. The table fills the width
 * (its inline width/min-width are authoring leftovers); one too wide for the
 * phone scrolls sideways inside the frame, with a shade on the hidden side.
 */
.table-wrap {
  margin: 8px 0 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-m);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  background:
    linear-gradient(to right, var(--surface) 40%, transparent) left / 24px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 40%, transparent) right / 24px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--ink) 18%, transparent), transparent) left / 10px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--ink) 18%, transparent), transparent) right / 10px 100% no-repeat scroll,
    var(--surface);
}
.table-wrap table {
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  border: 0;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: break-word;
}
.table-wrap td, .table-wrap th {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.table-wrap th { font-weight: 600; background: var(--surface-2); }
.table-wrap tr:first-child > * { border-top: 0; }
.table-wrap tr:last-child > * { border-bottom: 0; }
.table-wrap tr > :first-child { border-left: 0; }
.table-wrap tr > :last-child { border-right: 0; }
.table-wrap td p, .table-wrap th p { margin: 0; }
.table-wrap td img { display: block; }
/* "1." beside its option reads as one unit: no rule between them. */
.table-wrap .cell-key {
  width: 1%;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding-right: 2px;
  border-right: 0;
}
.table-wrap .cell-key + td { border-left: 0; padding-left: 6px; }

.stem .katex, .explain .katex { font-size: 1.1em; }
.katex-display, .katex.is-wide { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.katex.is-wide { display: block; }

@media (prefers-color-scheme: dark) {
  /* Diagrams are dark line art, often on a transparent background. */
  .stem img, .explain img { background: #fff; border-radius: var(--r-xs); }
}

.figure-back {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: rgba(12, 12, 14, 0.92);
}
.figure-close { position: absolute; top: 12px; right: 12px; z-index: 1; }
.figure-scroll {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  place-items: center;
  padding: 68px 12px 12px;
}
.figure-scroll img { width: 100%; height: auto; background: #fff; border-radius: var(--r-s); cursor: zoom-in; }
.figure-back.zoomed .figure-scroll { place-items: start; }
.figure-back.zoomed .figure-scroll img { width: 260%; max-width: none; cursor: zoom-out; }
.figure-hint { color: rgba(255, 255, 255, 0.7); font-size: 13px; text-align: center; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
/* AITS explanations are often an audio note. The bank only keeps questions with an audio or video explanation. */
.explain audio { display: block; width: 100%; margin: 8px 0; }

.num-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.num-opt {
  display: grid;
  place-items: center;
  height: 48px;
  border-radius: var(--r-m);
  border: 1px solid var(--border-2);
  background: var(--surface);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--d-fast) var(--ease), background-color var(--d-fast) var(--ease);
}
button.num-opt:hover { border-color: var(--muted-2); }
.num-opt[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.num-opt.good { border-color: var(--success-line); background: var(--success-tint); color: var(--success); }
.num-opt.bad { border-color: var(--danger-line); background: var(--danger-tint); color: var(--danger); }
.num-opt.chosen { box-shadow: inset 0 0 0 2px currentColor; }
.q-card .num-opt { height: 40px; font-size: 15px; }
.num-key { font-size: 13px; color: var(--muted); margin-top: 8px; font-weight: 600; }

.source { color: var(--muted); font-size: 13px; line-height: 1.4; margin-bottom: 4px; }

.options { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-m);
  padding: 12px;
  transition: border-color var(--d-fast) var(--ease), background-color var(--d-fast) var(--ease);
}
button.opt:hover { border-color: var(--muted-2); }
.opt[aria-pressed="true"] { border-color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink); }
.opt.good { border-color: var(--success-line); background: var(--success-tint); }
.opt.bad { border-color: var(--danger-line); background: var(--danger-tint); }
.letter {
  width: 28px;
  height: 28px;
  border-radius: var(--r-s);
  background: var(--chip);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}
.opt[aria-pressed="true"] .letter { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.opt.good .letter { background: var(--success); border-color: var(--success); color: var(--surface); }
.opt.bad .letter { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.opt-body { font-size: 15px; line-height: 1.5; padding-top: 3px; }
.opt-body p { margin: 0; }

.footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
}
.footer .primary { flex: 1; }
.text-btn {
  color: var(--ink-2);
  font-weight: 600;
  padding: 12px;
  border-radius: var(--r-m);
  transition: background-color var(--d-fast) var(--ease);
}
.text-btn:hover { background: var(--chip); color: var(--ink); }

.primary, .secondary {
  min-height: 48px;
  border-radius: var(--r-m);
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.2;
  transition: background-color var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease), transform var(--d-fast) var(--ease);
}
.primary {
  background: var(--amber);
  color: var(--amber-ink);
  font-weight: 700;
  letter-spacing: -0.005em;
  box-shadow: var(--glow-amber);
}
.primary:hover:not(:disabled) { background: var(--amber-2); }
.primary:active:not(:disabled) { transform: translateY(1px); }
.primary:disabled { opacity: 0.5; cursor: not-allowed; }
.secondary { background: var(--surface); border: 1px solid var(--border-2); color: var(--ink); font-weight: 600; }
.secondary:hover:not(:disabled) { background: var(--surface-2); }
.secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.full { width: 100%; margin-top: 12px; }

.score {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin: 8px 0 8px;
}
.score small { font-size: 28px; font-weight: 700; color: var(--muted); letter-spacing: -0.02em; }
.sense {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin: 24px 0 12px;
}
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.topic-chip {
  background: var(--danger-tint);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  border-radius: var(--r-s);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
}

.ask { margin: 8px 0 16px; }
.ask p { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.ask .pair { display: flex; gap: 8px; }
.ask .pair button { flex: 1; }

.review { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.review h2 { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--r-l);
  box-shadow: var(--e-1);
  padding: 16px;
}
.q-card.good { border-left-color: var(--success); }
.q-card.bad { border-left-color: var(--danger); }
.q-card .stem { font-size: 16px; margin-bottom: 12px; }
.explain { color: var(--ink-2); font-size: 14px; line-height: 1.55; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.tag { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }

.sheet-back {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 14, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  padding: 12px;
}
.sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-l);
  box-shadow: var(--e-3);
  padding: 20px 16px 16px;
  width: 100%;
}
.sheet h2 { font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 8px; }
.sheet > p:not(.eyebrow) { color: var(--muted); font-size: 15px; line-height: 1.5; margin-bottom: 16px; }
.sheet a.primary { display: block; text-align: center; text-decoration: none; }

.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-m);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color var(--d-fast) var(--ease), background-color var(--d-fast) var(--ease);
}
.choice:hover { border-color: var(--muted-2); background: var(--surface-2); }
.choice svg { color: var(--muted); flex: none; }
.choice-label { display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.choice-course { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
button.choice { width: 100%; text-align: left; }

/* Header slot on the right, e.g. Log out. */
.top-title { flex: 1; min-width: 0; }
.top-action { flex: none; font-size: 13px; padding: 8px 10px; }

/* OTP login. */
.auth { padding-top: 8px; }
.auth h2 { font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 6px; }
.auth a.primary { display: block; text-align: center; text-decoration: none; }
.field { display: block; margin-top: 20px; }
.field input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-m);
  background: var(--surface);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.field input:focus { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.field input::placeholder { color: var(--muted-2); font-weight: 500; letter-spacing: 0; }
.phone-input { display: flex; align-items: stretch; }
.phone-input .prefix {
  display: grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--border-2);
  border-right: 0;
  border-radius: var(--r-m) 0 0 var(--r-m);
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
}
.phone-input input { border-radius: 0 var(--r-m) var(--r-m) 0; }
.auth-links { display: flex; justify-content: space-between; margin-top: 8px; }
.auth-links .text-btn { font-size: 14px; }
.text-btn:disabled { color: var(--muted-2); cursor: default; background: transparent; }

/* Free students: today's two chapters, then the locked rest. */
.today {
  margin: 12px 0 4px;
  padding: 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-l);
  background: var(--surface-2);
}
.today-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.today-head .eyebrow { color: var(--ink); margin: 0; }
.today-clock { color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.today-note { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 10px; }
.row.locked { background: var(--surface-2); box-shadow: none; }
.row.locked .row-name { color: var(--muted); }
.lock { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }

/* Weak-topic picker for the DPP. Ticked is ink, as answer selection is. */
.dpp-pick { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.dpp-pick h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px; }
.picks { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pick {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--border-2);
  border-radius: var(--r-m);
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  transition: border-color var(--d-fast) var(--ease), background-color var(--d-fast) var(--ease);
}
.pick:hover { border-color: var(--muted-2); }
.pick[aria-checked="true"] { border-color: var(--ink); background: var(--surface-2); }
.pick .box {
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-xs);
  background: var(--surface);
}
.pick[aria-checked="true"] .box { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Wait sheet: the Target Batch check and redirects. */
.waiting { display: flex; align-items: center; gap: 14px; padding: 8px 4px; }
.waiting p { font-size: 16px; font-weight: 600; color: var(--ink); }
.spinner {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  border: 3px solid var(--chip);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.note { color: var(--ink-2); font-size: 14px; margin-top: 8px; }
.error {
  background: var(--danger-tint);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  border-radius: var(--r-m);
  padding: 10px 12px;
  font-size: 14px;
  margin: 8px 0;
}
.empty { color: var(--muted); padding: 24px 0; line-height: 1.5; }
details.qa { margin-top: 24px; color: var(--muted); font-size: 12px; }
details.qa summary { cursor: pointer; }

@media (max-width: 640px) {
  .stage { padding: 0; }
  .phone {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
