/* Light palette shared with Design Critic: warm paper, black ink, red accent */
@font-face {
  font-family: Oswald;
  src: url("fonts/Oswald.ttf") format("truetype");
  font-weight: 200 700;
  font-display: swap;
}

@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }

:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --raised: #ecebe5;
  --stroke: #e3e1da;
  --field-stroke: #cfccc2;
  --hero: #ffffff;

  --accent: #141414;
  --accent-pressed: #000000;
  --accent-muted: rgba(var(--tint), .08);
  --red: #c8231b;
  --now: #d9620b;
  --now-muted: rgba(217, 98, 11, .1);
  --now-ink: #9a4a07;
  --success: #15803d;
  --success-muted: rgba(21, 128, 61, .08);
  --error: #c8231b;
  --error-muted: rgba(200, 35, 27, .07);
  --info: #2563eb;
  --info-muted: rgba(37, 99, 235, .07);

  --text: #141414;
  --text-2: #555550;
  --text-3: #8a8a83;
  --on-accent: #ffffff;

  --code-bg: #1b1b1f;
  --code-head: #faf9f6;
  --tint: 20, 20, 20;
  --radius: 18px;
  --display: Oswald, "Arial Narrow", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}


/* Black mode: chosen with the White/Black switch on Review Deck (/review-deck/theme.js) */
:root[data-theme="dark"] {
  --bg: #0e0e0f;
  --surface: #18181a;
  --raised: #242427;
  --stroke: #2a2a2d;
  --field-stroke: #3a3a3e;
  --hero: #18181a;

  --accent: #f4f3ef;
  --accent-pressed: #ffffff;
  --red: #ef4b40;
  --now: #f07a2a;
  --now-muted: rgba(240, 122, 42, .14);
  --now-ink: #f59a5a;
  --success: #3fbf6f;
  --success-muted: rgba(63, 191, 111, .12);
  --error: #ef4b40;
  --error-muted: rgba(239, 75, 64, .13);
  --info: #5b8def;
  --info-muted: rgba(91, 141, 239, .13);

  --text: #f4f3ef;
  --text-2: #b4b3ad;
  --text-3: #85847e;
  --on-accent: #0e0e0f;

  --code-bg: #111113;
  --code-head: #1d1d20;
  --tint: 255, 255, 255;
  color-scheme: dark;
}
:root[data-theme="dark"] .brand-logo { border-radius: 10px; box-shadow: 0 0 0 1px var(--field-stroke); }
:root[data-theme="dark"] .chip.kind-explain { color: #7ba4f2; background: rgba(91, 141, 239, .14); }
:root[data-theme="dark"] .chip.kind-why { color: #a98cf5; background: rgba(160, 124, 245, .14); }
:root[data-theme="dark"] .chip.kind-what-if { color: #f59a5a; background: rgba(240, 122, 42, .14); }
:root[data-theme="dark"] .chip.kind-improve { color: #3fbf6f; background: rgba(63, 191, 111, .13); }
:root[data-theme="dark"] .chip.kind-concept { color: #ef6b62; background: rgba(239, 75, 64, .13); }

* { box-sizing: border-box; }

html { scrollbar-color: var(--raised) var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- buttons ---------- */
button {
  font: inherit;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--stroke);
  background: var(--raised);
  border-radius: 12px;
  padding: 9px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, border-color .15s, transform .1s;
}
button:hover:not(:disabled) { border-color: var(--field-stroke); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-pressed); border-color: var(--accent-pressed); }

.icon-btn { width: 38px; height: 38px; padding: 0; border-radius: 50%; background: var(--surface); }
.pill-btn { height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 500; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  font-weight: 600; font-size: 14px;
}
.streak { color: var(--text-2); transition: color .3s, background .3s, border-color .3s; }
.streak.lit { color: var(--now); border-color: rgba(217, 98, 11, .3); background: var(--now-muted); }

/* daily goal (Duolingo-style): pips fill per answered question, flame lights at the goal */
.daily-goal {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 18px; padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  font-size: 13px;
}
.daily-goal:empty { display: none; }
.daily-goal strong { font: 600 14px var(--display); letter-spacing: .04em; }
.dg-flame { display: grid; color: var(--text-2); }
.dg-flame svg { fill: currentColor; stroke: none; }
.daily-goal.met { border-color: rgba(217, 98, 11, .35); background: var(--now-muted); }
.daily-goal.met .dg-flame { color: var(--now); animation: flicker 1.6s ease-in-out infinite; }
@keyframes flicker { 50% { transform: scale(1.12) rotate(-4deg); } }
.pips { display: flex; gap: 5px; }
.pip { width: 22px; height: 8px; border-radius: 99px; background: rgba(var(--tint), .1); transition: background .3s; }
.pip.on { background: var(--now); }
.dg-text { color: var(--text-2); margin-left: auto; }
.daily-goal.met .dg-text { color: var(--now-ink); }
.next-btn { margin-top: 18px; padding: 11px 22px; font-size: 15px; }
.streak .flame { fill: currentColor; stroke: none; }

select.lang {
  height: 38px;
  font: inherit; font-size: 13px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--stroke); border-radius: 999px; padding: 0 12px;
  cursor: pointer;
}

/* ---------- top bar ---------- */
.topbar {
  max-width: 880px;
  margin: 0 auto;
  padding: 22px 16px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 40px; height: 40px; }
h1 { font: 600 20px/1.1 var(--display); letter-spacing: .02em; margin: 0; }
.brand-sub { margin: 2px 0 0; color: var(--red); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 8px; }

main { max-width: 880px; margin: 0 auto; padding: 8px 16px 80px; }

/* ---------- hero ---------- */
.hero {
  margin-top: 14px;
  padding: 26px 26px 22px;
  border-radius: 22px;
  background: var(--hero);
  border: 1px solid var(--stroke);
  box-shadow: inset 4px 0 0 var(--red);
  position: relative;
  overflow: hidden;
}
.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-2);
  font-weight: 500;
}
.hero h2 { font: 600 34px/1.15 var(--display); letter-spacing: .01em; margin: 6px 0 4px; }
.hero-today { margin: 0; color: var(--text-2); }
.hero-today strong { color: var(--text); font-weight: 600; }

.progress { margin-top: 20px; }
.segments { display: flex; gap: 6px; }
.seg { flex: 1; height: 8px; border-radius: 99px; background: rgba(var(--tint), .08); transition: background .4s; }
.seg.now { background: var(--accent-muted); box-shadow: inset 0 0 0 1px var(--accent); }
.progress-label { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--text-2); }

/* ---------- section label ---------- */
.section-label { margin: 30px 4px 0; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 14px;
}

.banner {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(217, 98, 11, .3);
  background: var(--now-muted);
  color: var(--now-ink);
  font-size: 14px;
}
.banner code { color: var(--text); font-family: var(--mono); font-size: 13px; }
.banner.error { border-color: rgba(200, 35, 27, .35); background: var(--error-muted); color: var(--error); }

/* ---------- code card ---------- */
.code-card { padding: 0; overflow: hidden; }
.code-top {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 14px;
  background: var(--code-head);
  border-bottom: 1px solid var(--stroke);
}
.file-tab {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 13px var(--mono);
  padding: 6px 12px;
  border-radius: 9px;
  background: var(--raised);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-tab svg { color: var(--now); width: 15px; height: 15px; }
.owner { color: var(--text-2); font: 13px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.code-tools { margin-left: auto; display: flex; gap: 6px; flex: none; }
.code-tools button { height: 34px; padding: 0 12px; font-size: 13px; background: transparent; border-color: transparent; color: var(--text-2); }
.code-tools button:hover { color: var(--text); background: var(--raised); }

.code-wrap { display: flex; overflow-x: auto; background: var(--code-bg); }
/* fixed pixel line height so a line number maps exactly to a y position (double-click + bands) */
.gutter, .code-wrap pre code { font: 13px/22px var(--mono); }
.gutter {
  padding: 16px 12px 16px 18px;
  text-align: right;
  color: #6b6b72;
  user-select: none;
  white-space: pre;
}
.code-wrap pre { margin: 0; flex: 1; }
.code-wrap pre code { display: block; padding: 16px 20px 16px 8px; white-space: pre; color: #d6d6dc; }

.code-foot {
  padding: 10px 18px;
  border-top: 1px solid var(--stroke);
  font: 12px var(--mono);
  color: var(--text-2);
  word-break: break-all;
}

.code-card .code-wrap { cursor: pointer; }
.code-card .code-wrap:hover { background: #222227; }
.code-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dbl-hint { color: var(--accent); font-family: Inter, system-ui, sans-serif; white-space: nowrap; }

/* ---------- full-file viewer ---------- */
dialog.file-dialog {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  height: calc(100vh - 48px);
  max-height: none;
  padding: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
dialog.file-dialog[open] { display: flex; }
.fv-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke);
  background: var(--code-head);
}
.fv-path { color: var(--text-2); font: 12px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fv-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.fv-actions .primary { height: 38px; font-size: 14px; }
.fv-body { flex: 1; overflow: auto; background: var(--code-bg); }
.fv-code { display: flex; width: max-content; min-width: 100%; overflow: visible; background: transparent; }
.fv-code .gutter { position: sticky; left: 0; background: var(--code-bg); z-index: 2; }
.fv-pre { position: relative; flex: 1; }
.fv-pre pre { position: relative; z-index: 1; }
.bands { position: absolute; inset: 0; pointer-events: none; }
.band { position: absolute; left: 0; right: 0; }
.band-chunk { background: rgba(255, 255, 255, .05); box-shadow: inset 3px 0 0 rgba(229, 55, 44, .75); }
.band-line { background: rgba(255, 180, 84, .16); box-shadow: inset 3px 0 0 var(--now); }
mark.word { background: rgba(255, 180, 84, .35); color: inherit; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 180, 84, .6); }
.fv-foot { padding: 10px 16px; border-top: 1px solid var(--stroke); font-size: 13px; color: var(--text-2); }
.fv-foot strong { color: var(--now); font-family: var(--mono); font-weight: 500; }
.q-text, .feedback li, .feedback p { cursor: text; }


/* syntax colours for the dark code panels */
.hljs-keyword, .hljs-meta .hljs-keyword { color: #ff8a80; }
.hljs-built_in, .hljs-type, .hljs-title.class_ { color: #5ec8f8; }
.hljs-title.function_ { color: #ffd08a; }
.hljs-string { color: #8fe3a8; }
.hljs-number, .hljs-literal { color: #ffb454; }
.hljs-comment { color: #6b6987; font-style: italic; }
.hljs-meta { color: #f38ba8; }
.hljs-params { color: #d9d7ea; }
.hljs-variable, .hljs-attr { color: #c9c6e8; }
.language-xml .hljs-tag { color: #6e6c8a; }
.language-xml .hljs-name { color: #ff8a80; }
.language-xml .hljs-attr { color: #5ec8f8; }

/* ---------- questions ---------- */
.question { transition: border-color .2s, box-shadow .2s; }
.question.current { border-color: var(--text); box-shadow: 0 0 0 4px rgba(var(--tint), .05); }

.q-head { display: flex; align-items: center; gap: 10px; }
.q-num {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--raised);
  font: 600 14px var(--display);
}
.question.current .q-num { background: var(--accent); color: var(--on-accent); }
.question.done .q-num { background: var(--success-muted); color: var(--success); box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .4); }

.chip {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  background: var(--raised); color: var(--text-2);
}
.chip.kind-explain { color: #2563eb; background: rgba(37, 99, 235, .08); }
.chip.kind-why { color: #7c3aed; background: rgba(124, 58, 237, .08); }
.chip.kind-what-if { color: #b45309; background: rgba(217, 98, 11, .1); }
.chip.kind-improve { color: #15803d; background: rgba(21, 128, 61, .08); }
.chip.kind-concept { color: #c8231b; background: rgba(200, 35, 27, .07); }

.q-score { margin-left: auto; font: 600 15px var(--display); }
.q-text { font-size: 17px; font-weight: 500; line-height: 1.55; margin: 14px 0 16px; }

.answer-box {
  border: 1px solid var(--field-stroke);
  border-radius: 14px;
  background: var(--bg);
  transition: border-color .15s, box-shadow .15s;
}
.answer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
textarea {
  display: block;
  width: 100%;
  min-height: 110px;
  resize: vertical;
  background: transparent;
  color: var(--text);
  border: 0;
  outline: 0;
  padding: 14px 16px 6px;
  font: inherit;
}
textarea::placeholder { color: var(--text-3); }
.answer-bar { display: flex; align-items: center; gap: 10px; padding: 8px; }
.hint { margin-left: auto; font-size: 12px; color: var(--text-3); }
.mic { background: transparent; border-color: var(--stroke); color: var(--text-2); }
.mic:hover { color: var(--text); }
.mic.listening { background: var(--error); border-color: var(--error); color: var(--on-accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(200, 35, 27, .2); } }

/* ---------- feedback ---------- */
.feedback { margin-top: 18px; animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.score-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--raised);
}
.score-ring {
  --p: 0;
  --c: var(--accent);
  width: 62px; height: 62px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(var(--tint), .08) 0);
  display: grid; place-items: center;
  transition: --p .8s;
}
.score-ring span {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--raised);
  display: grid; place-items: center;
  font: 600 20px var(--display);
}
.verdict { margin: 0; font: 600 13px var(--display); letter-spacing: .1em; text-transform: uppercase; }
.headline { margin: 2px 0 0; font-weight: 500; }

.fb-grid { display: grid; gap: 10px; margin-top: 10px; }
.fb-section { border-radius: 14px; padding: 12px 16px; border: 1px solid transparent; }
.fb-section h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font: 600 13px var(--display); letter-spacing: .1em; text-transform: uppercase; }
.fb-section h4 svg { width: 16px; height: 16px; }
.fb-section ul { margin: 0; padding-left: 20px; }
.fb-section li { margin: 4px 0; }
.fb-section li::marker { color: var(--text-2); }
.fb-right { background: var(--success-muted); border-color: rgba(21, 128, 61, .18); }
.fb-right h4 { color: var(--success); }
.fb-missed { background: var(--error-muted); border-color: rgba(200, 35, 27, .18); }
.fb-missed h4 { color: var(--error); }
.fb-further { background: var(--info-muted); border-color: rgba(37, 99, 235, .18); }
.fb-further h4 { color: var(--info); }

details { margin-top: 10px; border: 1px solid var(--stroke); border-radius: 14px; padding: 12px 16px; }
summary { cursor: pointer; font-weight: 500; color: var(--accent); list-style: none; display: flex; align-items: center; gap: 8px; }
summary::-webkit-details-marker { display: none; }
summary svg { width: 16px; height: 16px; transition: transform .2s; }
details[open] summary svg { transform: rotate(90deg); }
details p { margin: 10px 0 0; color: var(--text); }

/* ---------- summary ---------- */
.summary {
  text-align: center;
  padding: 34px 22px 30px;
  background: var(--surface);
  border-color: rgba(217, 98, 11, .3);
}
.summary .trophy { width: 40px; height: 40px; color: var(--now); }
.summary .big { font: 600 64px/1 var(--display); margin: 10px 0 6px; color: var(--now); }
.summary p { margin: 4px 0; color: var(--text-2); }
.summary .msg { color: var(--text); font-size: 16px; }

/* ---------- mastery ---------- */
html { scroll-behavior: smooth; }

.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.hero-stat {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 10px 10px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--stroke);
  color: inherit; text-decoration: none;
  transition: border-color .15s, background .15s;
}
.hero-stat:empty { display: none; }
.hero-stat:hover { border-color: var(--text); background: var(--raised); }
.hero-stat strong { display: block; font: 600 15px var(--display); letter-spacing: .03em; }
.hero-stat small { color: var(--text-2); font-size: 12px; }
.mini-ring {
  --p: 0;
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--success) calc(var(--p) * 1%), rgba(var(--tint), .1) 0);
  display: grid; place-items: center;
}
.mini-ring span {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface);
  display: grid; place-items: center;
  font: 600 13px var(--display);
}

.m-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.m-stat { padding: 14px 16px; border-radius: 14px; background: var(--raised); }
.m-value { font: 600 34px/1.1 var(--display); }
.m-label { font: 600 13px var(--display); letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }
.m-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.is-mastered .m-value, .is-mastered .m-label { color: var(--success); }
.is-known .m-value, .is-known .m-label { color: var(--accent); }
.is-unseen .m-value { color: var(--text-2); }
.is-unseen .m-label { color: var(--text-2); }

.stack { display: flex; height: 8px; border-radius: 99px; background: rgba(var(--tint), .07); overflow: hidden; }
.stack.big { height: 12px; margin-top: 18px; }
.stack i { display: block; height: 100%; transition: width .6s ease-out; }
.s-mastered { background: var(--success); }
.s-learning { background: var(--accent); }
.s-unseen { background: rgba(var(--tint), .12); }

.legend { display: flex; gap: 18px; margin-top: 10px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.file-head {
  display: flex; justify-content: space-between;
  margin: 24px 0 4px; padding-bottom: 8px;
  border-bottom: 1px solid var(--stroke);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2);
}
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 210px) 1fr 44px;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
}
.file-row { cursor: pointer; border-radius: 8px; }
.file-row:hover .f-name { color: var(--accent); }
.f-name { font: 13px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-pct { text-align: right; font: 600 15px var(--display); color: var(--text-2); }
.show-more { margin-top: 10px; width: 100%; background: transparent; color: var(--accent); }


/* ---------- misc ---------- */
.loading { text-align: center; padding: 120px 0; color: var(--text-2); }
.spinner {
  width: 36px; height: 36px; margin: 0 auto 16px;
  border: 3px solid var(--raised); border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--raised); border: 1px solid var(--stroke);
  padding: 10px 18px; border-radius: 16px; font-size: 14px;
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 64px));
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 20px 22px;
}
dialog::backdrop { background: rgba(10, 10, 10, .55); backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dialog-head h2 { margin: 0; font: 600 22px var(--display); }
.h-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid var(--stroke); }
.h-row:last-child { border-bottom: 0; }
.h-row small { color: var(--text-2); display: block; }
.h-score { font: 600 20px var(--display); align-self: center; }
.h-bar { grid-column: 1 / -1; height: 4px; border-radius: 99px; background: var(--raised); overflow: hidden; }
.h-bar i { display: block; height: 100%; border-radius: 99px; }
.empty { color: var(--text-2); padding: 20px 0; text-align: center; }


@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

[hidden] { display: none !important; }

/* ---------- login ---------- */
.login { max-width: 640px; margin: 28px auto 0; padding: 30px 32px 24px; }
.login h2 { font: 600 32px/1.15 var(--display); margin: 0 0 6px; }
.login-lead { margin: 0 0 8px; color: var(--text-2); }
.step { margin-top: 24px; }
.step h3 { display: flex; align-items: center; gap: 10px; margin: 0; font: 600 18px var(--display); letter-spacing: .03em; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 14px;
}
.step-hint { margin: 4px 0 12px 36px; color: var(--text-2); font-size: 14px; }
.step-hint a, .privacy a { color: var(--accent); }
.drop {
  border: 2px dashed var(--field-stroke);
  border-radius: 16px;
  padding: 24px 20px 18px;
  text-align: center;
  background: var(--bg);
  transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--accent); background: var(--accent-muted); }
.drop.ready { border-style: solid; border-color: rgba(21, 128, 61, .45); }
.drop-title { margin: 0 0 12px; font-weight: 500; }
.drop-buttons { display: flex; gap: 10px; justify-content: center; }
.drop-status { margin: 14px 0 0; font-size: 13px; color: var(--text-2); }
.drop-status.ok { color: var(--success); }
.drop-status.bad { color: var(--error); }
.field {
  width: 100%;
  font: 15px var(--mono);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--field-stroke);
  border-radius: 12px;
  padding: 11px 14px;
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
.field-label { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 14px; color: var(--text-2); }
.field-label span { white-space: nowrap; }
.field-label .field { font-family: Inter, system-ui, sans-serif; }
.login-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.start-btn { padding: 11px 28px; font-size: 16px; }
.privacy { display: flex; gap: 10px; align-items: flex-start; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--stroke); font-size: 13px; color: var(--text-2); }
.privacy svg { width: 16px; height: 16px; margin-top: 2px; color: var(--success); }

/* link back to Review Deck (shown when you came from there) */
.deck-back { flex: none; display: inline-flex; align-items: center; height: 30px; padding: 0 11px; margin-right: 4px; border-radius: 999px; border: 1px solid #cfccc2; background: #fff; color: #141414; font: 600 12.5px Inter, system-ui, sans-serif; text-decoration: none; white-space: nowrap; }
.deck-back:hover { border-color: #141414; }
:root[data-theme="dark"] .deck-back { border-color: #3a3a3e; background: #18181a; color: #f4f3ef; }
:root[data-theme="dark"] .deck-back:hover { border-color: #f4f3ef; }
.topbar .brand { margin-right: auto; }
