/* =============================================================================
   theme.css - AlphaDrill single authoritative design system.

   Loaded LAST (after exam.css, polish.css, alphadrill.css). Every visual
   decision lives here. The three earlier files handle the exam runner skin
   (exam.html loads only exam.css + polish.css + alphadrill.css; no theme.css).
   For all other pages this file is the final word.

   Design language: calm finance-premium - "expensive fintech / Linear".
   One deep-ink neutral palette, ONE refined emerald accent, 8-px grid,
   generous whitespace, real hierarchy, no emoji.
   ============================================================================ */

/* ---- Google Fonts: Inter - falls back to system if unavailable ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================================
   TOKEN LAYER - single source of truth
   ============================================================================ */
:root {
  --f: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
       'Helvetica Neue', Arial, sans-serif;

  /* Neutral palette */
  --ink-0:  #0a0f1e;   /* page titles */
  --ink-1:  #1a2236;   /* body text */
  --ink-2:  #3d4f6b;   /* secondary */
  --ink-3:  #6b7c96;   /* muted / meta */
  --ink-4:  #9aaabb;   /* placeholder */

  --bg:        #f3f5f8;
  --surface:   #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef1f5;
  --line:      #e4e8ef;
  --line-2:    #d2d9e4;

  /* ONE accent - refined emerald */
  --accent:   #0f7a5a;
  --accent-d: #0b5c44;
  --accent-t: rgba(15,122,90,.07);
  --accent-t2:rgba(15,122,90,.14);

  /* Semantic */
  --ok:    #0f7a5a;   --ok-bg: rgba(15,122,90,.08);
  --bad:   #c2410c;   --bad-bg:rgba(194,65,12,.08);
  --warn:  #b45309;

  /* Shadows */
  --sh-xs: 0 1px 2px rgba(10,15,30,.04);
  --sh-sm: 0 2px 6px rgba(10,15,30,.06);
  --sh-md: 0 6px 24px rgba(10,15,30,.10);

  /* Geometry - strict 8-px grid */
  --r:    12px;
  --r-sm:  8px;
  --r-xs:  6px;
}

/* ============================================================================
   BASE
   ============================================================================ */
html { scroll-behavior: smooth; }

body {
  font-family: var(--f);
  background: var(--bg);
  color: var(--ink-1);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.003em;
}

/* Guard: only override exam.css on non-exam pages */
body:not(.exam-body) {
  background: var(--bg) !important;
  color: var(--ink-1) !important;
}

h1, h2, h3, h4 {
  font-family: var(--f);
  color: var(--ink-0);
  letter-spacing: -0.022em;
  line-height: 1.22;
  margin: 0;
}
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }

p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; text-underline-offset: 2px; }
a:hover { color: var(--accent-d); text-decoration: underline; }

.muted, .fine { color: var(--ink-3); }
.fine { font-size: 12px; }

code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 1px 5px;
  font-size: 12.5px;
}

/* ============================================================================
   LAYOUT SHELL
   ============================================================================ */
.home-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ============================================================================
   TOP NAVIGATION - glassmorphic sticky, no emoji
   ============================================================================ */
.bank-tabs {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 24px;
  height: 56px;
  background: rgba(255,255,255,.93);
  -webkit-backdrop-filter: saturate(200%) blur(16px);
  backdrop-filter: saturate(200%) blur(16px);
  border-bottom: 1px solid var(--line);
  margin: 0;
}

/* Brand wordmark in nav */
.bank-tabs::before {
  content: 'AlphaDrill';
  font-family: var(--f);
  font-weight: 800;
  font-size: 15px;
  color: var(--ink-0);
  letter-spacing: -0.04em;
  margin-right: 16px;
  white-space: nowrap;
}

/* Suppress data-ico emoji at all viewport sizes */
.bank-tabs a::before { content: none !important; }

.bank-tabs a {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color .13s, background .13s;
  white-space: nowrap;
  border: none;
  border-bottom: none !important;
  margin-bottom: 0;
}
.bank-tabs a:hover {
  color: var(--ink-1);
  background: var(--surface-3);
  text-decoration: none;
}
.bank-tabs a.active {
  color: var(--accent);
  background: var(--accent-t);
  font-weight: 600;
}

/* ============================================================================
   PAGE HEADER
   ============================================================================ */
.page-head { margin-bottom: 28px; }
.page-head h1 { margin: 0 0 6px; color: var(--ink-0); }
.page-head .muted { font-size: 14px; line-height: 1.5; }

/* ============================================================================
   CARDS
   ============================================================================ */
.card, .runner, .bank-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  margin: 0 0 16px;
  box-shadow: var(--sh-xs);
}
.card h2 { margin: 0 0 16px; font-size: 15px; font-weight: 650; color: var(--ink-0); }
.readiness-card {
  background: linear-gradient(160deg, #f8fffe 0%, var(--surface) 60%);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff !important;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 10px 20px;
  font-family: var(--f);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--sh-xs);
  transition: background .13s, border-color .13s, transform .08s, box-shadow .13s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary:hover {
  background: var(--accent-d);
  border-color: var(--accent-d);
  box-shadow: var(--sh-sm);
  text-decoration: none;
  color: #fff;
}
.btn-primary:active { transform: translateY(1px); box-shadow: none; }
.btn-primary:focus-visible { outline: 3px solid var(--accent-t2); outline-offset: 2px; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--ink-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 10px 20px;
  font-family: var(--f);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .13s, border-color .13s;
  text-decoration: none;
}
.btn-ghost:hover { background: var(--surface-3); }

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--f);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: color .13s;
}
.btn-link:hover { color: var(--accent-d); text-decoration: underline; }

.btn-reset {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--bad);
  border: 1px solid rgba(194,65,12,.35);
  border-radius: var(--r-sm);
  padding: 8px 16px;
  font-family: var(--f);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .13s, border-color .13s;
}
.btn-reset:hover { background: var(--bad-bg); border-color: var(--bad); }

/* ============================================================================
   FORM CONTROLS
   ============================================================================ */
label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

input, select, textarea {
  font-family: var(--f);
  font-size: 14px;
  color: var(--ink-1);
  background: var(--surface);
  border: 1px solid var(--line-2) !important;
  border-radius: var(--r-sm) !important;
  padding: 9px 12px;
  transition: border-color .13s, box-shadow .13s;
  appearance: none;
  -webkit-appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-t);
}
textarea { width: 100%; resize: vertical; line-height: 1.55; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7c96' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

/* ============================================================================
   HOME PAGE
   ============================================================================ */

/* Hero area - dark, confident, with emerald glow */
.home-hero {
  background: linear-gradient(135deg, #090f1e 0%, #0d2218 100%);
  border-radius: var(--r);
  padding: 48px 40px;
  margin-bottom: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 65% 80% at 85% 15%,
    rgba(15,122,90,.22) 0%, transparent 60%);
  pointer-events: none;
}
.home-hero h1 {
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 10px;
}
.home-hero .hero-tagline {
  color: rgba(255,255,255,.68);
  font-size: 16px;
  margin: 0 0 24px;
  max-width: 440px;
  line-height: 1.55;
}
.home-hero .hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 12px 24px;
  font-family: var(--f);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .08s;
  box-shadow: 0 4px 16px rgba(15,122,90,.35);
}
.home-hero .hero-cta:hover {
  background: var(--accent-d);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Privacy badge inside hero */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 4px 12px 4px 8px;
  font-size: 12px;
  color: rgba(255,255,255,.65);
  margin-top: 16px;
}
.privacy-badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Status strip: question count + due + streak */
.home-status {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.home-status strong { color: var(--ink-1); font-weight: 600; }
.home-status .hs-sep {
  width: 1px;
  height: 14px;
  background: var(--line-2);
  flex-shrink: 0;
}

/* Mode grid */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 0;
}
@media (max-width: 640px) { .mode-grid { grid-template-columns: 1fr; } }

/* ---- Dashboard split: practice (left) + readiness & stats (right) ---- */
.dash-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 18px;
}
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-col-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dash-col-head h2 { margin: 0; font-size: 18px; font-weight: 650; color: var(--ink-0); }
.dash-status { font-size: 12.5px; color: var(--ink-3); }
.dash-status strong { color: var(--ink-1); font-weight: 650; }
/* Practice modes stack vertically inside their column */
.dash-practice .mode-grid { grid-template-columns: 1fr; margin-top: 0; }
@media (max-width: 900px) {
  .dash-split { grid-template-columns: 1fr; gap: 18px; }
}

.mode-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--sh-xs);
  transition: box-shadow .18s, border-color .18s, transform .18s;
}
.mode-card:hover {
  box-shadow: var(--sh-md);
  border-color: var(--line-2);
  transform: translateY(-2px);
}
.mode-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-t);
}
.mode-card h2 { font-size: 16px; font-weight: 650; margin: 0; color: var(--ink-0); }
.mode-card p { color: var(--ink-3); font-size: 13.5px; line-height: 1.5; margin: 0; }
.mode-card label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.mode-card .btn-primary { margin-top: auto; width: 100%; }

/* ---- Practice bubble: one card, three aligned rows ------------------------
   The three modes live inside a single bordered "Practice" bubble. Each mode is
   a borderless row (info on the left, controls + Start flush right), divided by
   hairlines. Daily Review's green wash shows on hover only (no resting shine). */
.mode-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-xs);
  overflow: hidden;
}
.mode-bubble .mode-card {
  background: none; border: 0; border-radius: 0; box-shadow: none;
  padding: 15px 20px; gap: 18px; min-height: 84px; box-sizing: border-box;
  display: flex; flex-direction: row; align-items: center; justify-content: space-between;
  transition: background .15s;
}
.mode-bubble .mode-card + .mode-card { border-top: 1px solid var(--line); }
.mode-bubble .mode-card:hover { transform: none; box-shadow: none; border-color: var(--line); background: var(--surface-2); }
.mode-bubble .mode-card:focus-within { box-shadow: none; border-color: var(--line); }
.mode-bubble .mode-card.mode-recommended { background: none; border-color: var(--line); }
.mode-bubble .mode-card.mode-recommended:hover { background: linear-gradient(160deg, #f5fdf9 0%, var(--surface) 60%); }

.mode-bubble .mode-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mode-bubble .mode-info h2 { font-size: 16px; font-weight: 650; margin: 0; display: flex; align-items: center; gap: 8px; }
.mode-bubble .mode-info p { font-size: 12.5px; color: var(--ink-3); margin: 0; line-height: 1.4; }
.mode-bubble .mode-info p strong { color: var(--ink-1); }

.mode-bubble .mode-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.mode-bubble .mode-controls { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.mode-bubble label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.mode-bubble input, .mode-bubble select { width: auto; padding: 7px 9px; }
/* "# Qs" label sits inline to the left of its input box (not stacked above). */
.mode-bubble .mode-count { flex-direction: row; align-items: center; gap: 7px; white-space: nowrap; }
.mode-bubble .mode-count input { width: 62px; }
.mode-bubble .mode-controls select { min-width: 140px; max-width: 190px; }
.mode-bubble .btn-primary { margin: 0; width: auto; flex: none; min-width: 96px; align-self: center; }

/* Pro lock for a row (Exam Mode / Sudden Death): compact, right-aligned overlay
   instead of the full-card panel, so the title stays readable on the left. */
.mode-bubble .mode-lock {
  flex-direction: row; align-items: center; justify-content: flex-end;
  gap: 12px; padding: 0 20px; text-align: right; border: 0; border-radius: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, var(--surface) 42%);
}
.mode-bubble .mode-lock-badge { display: none; }
.mode-bubble .mode-lock p { font-size: 12px; max-width: 28ch; }
.mode-bubble .mode-lock .btn-primary { padding: 8px 15px; font-size: 13px; min-width: 0; }

/* "Practice" title now lives inside the bubble, as its first row. */
.mode-bubble-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px 14px; border-bottom: 1px solid var(--line);
}
.mode-bubble-head h2 { margin: 0; font-size: 18px; font-weight: 650; color: var(--ink-0); }

/* Exam Mode: its three controls (Topic / Focus / # Qs) sit inline on the right,
   matching the other rows. They wrap onto a second line on narrow widths, and the
   Start button stays the same compact, right-aligned size as Daily Review / Sudden
   Death so every row reads as an even stack. */
.mode-bubble #examForm .mode-info h2 { white-space: nowrap; }
.mode-bubble #examForm .mode-actions { flex: 0 1 auto; min-width: 0; }
.mode-bubble #examForm .mode-controls {
  justify-content: flex-end; flex-wrap: wrap; row-gap: 10px; min-width: 0;
}
.mode-bubble #examForm .mode-controls select { min-width: 120px; max-width: 160px; }

@media (max-width: 720px) {
  .mode-bubble .mode-card { flex-wrap: wrap; gap: 10px; }
  .mode-bubble .mode-actions { width: 100%; align-items: stretch; flex-wrap: wrap; }
  .mode-bubble .mode-controls { width: 100%; }
  .mode-bubble .mode-controls label { flex: 1 1 auto; }
  .mode-bubble .mode-count input,
  .mode-bubble .mode-controls select { width: 100%; max-width: none; }
  .mode-bubble .btn-primary { width: 100%; }
}

/* ============================================================================
   EMPTY STATE - teaches + sells; replaces the old bare <p>
   ============================================================================ */
#empty {
  text-align: center;
  padding: 48px 32px;
  background: var(--surface);
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r);
  margin: 16px 0;
}
#empty .es-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  background: var(--accent-t);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
#empty .es-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.75;
}
#empty h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-0);
  margin: 0 0 8px;
}
#empty p {
  color: var(--ink-3);
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto 20px;
  line-height: 1.55;
}

/* ============================================================================
   INLINE NOTICE (replaces alert()) - shown inside #runner
   ============================================================================ */
.runner-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 16px;
  animation: noticeIn .16s ease;
}
.runner-notice.rn-warn {
  background: #fff8ed;
  color: var(--warn);
  border: 1px solid rgba(180,83,9,.2);
}
.runner-notice.rn-bad {
  background: var(--bad-bg);
  color: var(--bad);
  border: 1px solid rgba(194,65,12,.2);
}
@keyframes noticeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================================
   QUIZ RUNNER - practice + sudden death
   ============================================================================ */
.runner { margin-top: 20px; }

.q-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.q-stem {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-0);
  margin: 0 0 20px;
  font-weight: 400;
}

.q-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice {
  text-align: left;
  background: var(--surface);
  color: var(--ink-1);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 13px 16px;
  cursor: pointer;
  font-family: var(--f);
  font-size: 14.5px;
  line-height: 1.45;
  transition: border-color .12s, background .12s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.choice strong {
  flex-shrink: 0;
  font-weight: 650;
  color: var(--ink-3);
  min-width: 18px;
}
.choice:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-t);
}
.choice:focus-visible {
  outline: 3px solid var(--accent-t2);
  outline-offset: 1px;
}
.choice:disabled { cursor: default; }

/* Post-answer state - these must win over the exam.css important rules */
.choice.right {
  border-color: var(--ok) !important;
  background: var(--ok-bg) !important;
  box-shadow: none !important;
}
.choice.wrong {
  border-color: var(--bad) !important;
  background: var(--bad-bg) !important;
  box-shadow: none !important;
}

.q-feedback {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.q-feedback .ok { color: var(--ok); font-weight: 650; }
.q-feedback .bad { color: var(--bad); font-weight: 650; }

.q-nav { margin-top: 16px; }

.q-results { text-align: center; padding: 40px 16px; }
.q-results h2 { margin-bottom: 12px; }

/* ============================================================================
   PILLS
   ============================================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ============================================================================
   DASHBOARD
   ============================================================================ */
.score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 0 16px;
}
@media (max-width: 860px) { .score-grid { grid-template-columns: repeat(2, 1fr); } }

.score-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  box-shadow: var(--sh-xs);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.score-card .big {
  display: block;
  font-size: 26px;
  font-weight: 750;
  color: var(--ink-0);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 2px;
  font-variant-numeric: tabular-nums;
}

.readiness-main {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.gauge { flex: 0 0 180px; }
.gauge svg { display: block; }
.readiness-text h2 { font-size: 24px; font-weight: 750; margin: 0 0 4px; }

.readiness-components {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 20px;
  margin: 16px 0 6px;
}
.comp-top {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 4px;
  font-weight: 500;
}
.comp-top span:last-child {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-0);
}

.bar {
  background: var(--surface-3);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.bar.small { height: 6px; }
.bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width .5s cubic-bezier(.4,0,.2,1);
  border-radius: 999px;
}
.bar-fill.warn { background: var(--warn); }

.topic-row {
  display: grid;
  grid-template-columns: 180px 1fr 52px;
  gap: 12px;
  align-items: center;
  margin: 6px 0;
}
.topic-name { font-size: 13.5px; font-weight: 500; color: var(--ink-1); }
.topic-acc {
  text-align: right;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-1);
  font-variant-numeric: tabular-nums;
}

#trend, #burnup { min-height: 0; }

/* ---- By-type bar chart ---- */
.type-chart { display: flex; flex-direction: column; gap: 10px; }
.type-bar-wrap {
  display: flex;
  height: 20px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.type-bar-seg { height: 100%; transition: width .5s cubic-bezier(.4,0,.2,1); }
.type-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-2);
}
.type-leg-item { display: flex; align-items: center; gap: 7px; }
.type-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.type-leg-item strong { color: var(--ink-0); font-weight: 650; }

/* ============================================================================
   QUESTION BANK TREE
   ============================================================================ */
.bank-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

.bank-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0;
  margin: 0;
  overflow: hidden;
  transition: box-shadow .15s;
}
.bank-item:hover { box-shadow: var(--sh-sm); }

.bank-item summary {
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-1);
  list-style: none;
  user-select: none;
}
.bank-item summary::-webkit-details-marker { display: none; }
.bank-item summary .btn-link {
  margin-left: auto;
  font-size: 12px;
  padding: 0;
  opacity: 0;
  transition: opacity .12s;
}
.bank-item:hover summary .btn-link,
.bank-item[open] summary .btn-link { opacity: 1; }
.bank-item[open] > summary {
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.bank-body {
  padding: 10px 16px 14px;
}
.bank-body ul { list-style: none; padding: 0; }
.bank-body li { padding: 3px 0; font-size: 13px; color: var(--ink-2); }
.bank-body li.right { color: var(--ok); font-weight: 500; }

/* ============================================================================
   IMPORT PAGE
   ============================================================================ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin: 16px 0;
  padding: 0;
  flex-wrap: wrap;
}
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-3);
  cursor: pointer;
  padding: 8px 12px 10px;
  font-family: var(--f);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: -1px;
  transition: color .12s, border-color .12s;
  white-space: nowrap;
}
.tab:hover { color: var(--ink-1); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.howto {
  margin: 12px 0 16px;
  padding-left: 22px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.7;
}
.howto li { margin: 4px 0; }

.code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 16px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-1);
  font-family: 'Courier New', Consolas, monospace;
}

.rev-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0;
  margin: 8px 0;
  overflow: hidden;
}
.rev-card.rev-flag { border-left: 3px solid var(--warn); }

/* ============================================================================
   UPLOAD ZONE (import page)
   ============================================================================ */
.upload-zone {
  border: 2px dashed var(--line-2);
  border-radius: var(--r);
  padding: 36px 24px 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--surface);
  position: relative;
  /* Absorb the invisible file input overlay */
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-t);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-zone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  background: var(--accent-t);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.upload-zone:hover .upload-zone-icon,
.upload-zone.drag-over .upload-zone-icon {
  background: var(--accent-t2);
}
.upload-zone-icon svg { width: 22px; height: 22px; }
.upload-zone h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; color: var(--ink-0); }
.upload-zone p { font-size: 13px; color: var(--ink-3); margin: 0; }

.uz-formats {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.uz-badge {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  font-family: 'Courier New', Consolas, monospace;
}

/* ============================================================================
   FOOTER
   ============================================================================ */
/* Footer: full-length legal text, but wrapped wide and low so it reads as a thin
   band across the bottom rather than a dense centred block. Longer line length +
   tighter line-height keeps the disclaimer intact while cutting its height. */
.site-foot {
  max-width: 1100px;
  margin: 64px auto 24px;
  padding: 22px 16px 0;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.6;
}
.site-foot p { margin: 0 0 8px; }
.site-foot strong { color: var(--ink-2); }
.site-foot .fine { font-size: 12px; color: var(--ink-4); line-height: 1.6; max-width: 1040px; margin: 0 auto 8px; }
.site-foot .privacy-line { font-weight: 500; color: var(--ink-3); }

/* ============================================================================
   ROW UTILITY
   ============================================================================ */
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 8px 0;
}

/* ============================================================================
   MOBILE ≤640px
   ============================================================================ */
@media (max-width: 640px) {
  .home-wrap { padding: 16px 16px 80px; }
  .bank-tabs { padding: 0 16px; height: 52px; }
  .bank-tabs::before { display: none; }
  .bank-toolbar { top: 52px; }
  body.bank-page .bank-item.bank-topic { scroll-margin-top: 116px; }
  h1 { font-size: 22px; }
  .page-head h1 { font-size: 22px; }
  .score-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-row { grid-template-columns: 110px 1fr 42px; }
  .home-hero { padding: 28px 20px; }
  .home-hero h1 { font-size: 22px; }
  .card, .runner { padding: 16px; }
  .mode-card { padding: 18px; }
}

/* ============================================================================
   MOBILE BOTTOM TAB BAR - override polish.css emoji approach with clean text
   ============================================================================ */
@media (max-width: 760px) {
  /* The fixed bottom bar from polish.css is kept but restyled cleanly */
  .bank-tabs {
    height: auto;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  }

  /* Remove the ::before brand wordmark (no room on phone bottom bar) */
  .bank-tabs::before { content: none !important; display: none; }

  /* Reset any ::before emoji from polish.css */
  .bank-tabs a::before { content: none !important; display: none !important; }

  /* Clean text-only tab items */
  .bank-tabs a {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
    min-height: 48px;
    padding: 8px 4px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--ink-4);
    text-align: center;
    line-height: 1.2;
    gap: 0;
    background: transparent;
  }
  .bank-tabs a:hover { background: var(--surface-3); color: var(--ink-2); }
  .bank-tabs a.active {
    color: var(--accent);
    background: var(--accent-t);
    font-weight: 700;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

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

/* ============================================================================
   IMPORT - AI-helper hero
   ============================================================================ */
.hero-import {
  position: relative;
  border: 1px solid var(--accent);
  background: linear-gradient(160deg, var(--accent-t) 0%, var(--surface) 55%);
  box-shadow: var(--sh-sm);
}
.hero-import-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.ai-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ai-steps > li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.ai-steps > li > div { flex: 1; min-width: 0; }
.ai-step-n {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.ai-steps strong { color: var(--ink-0); font-weight: 600; }
.ai-steps textarea { width: 100%; }

/* ============================================================================
   CURRICULUM TAXONOMY - Practice mode cards, nav level chip, exam plan,
   and the curriculum-structured Question Bank (topics → learning modules)
   ============================================================================ */

/* Mode card header (title + Recommended badge) */
.mode-card-head { display: flex; align-items: center; gap: 8px; }
.mode-badge {
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
}

/* Nav level chip (right-aligned, links to /setup) */
.nav-profile-slot { margin-left: auto; display: flex; align-items: center; }
.profile-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--line);
  text-decoration: none; transition: background .15s, border-color .15s;
}
.profile-chip:hover { background: var(--accent-t); border-color: var(--accent-t2); }
.profile-chip .profile-level {
  display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--accent); color: #fff; border-radius: 6px;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.profile-chip .profile-text { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
@media (max-width: 640px) { .profile-chip .profile-text { display: none; } }

/* Slim exam countdown chip in the nav, beside the level chip */
.nav-countdown {
  display: inline-flex; align-items: baseline; gap: 4px;
  margin-right: 9px; padding: 5px 10px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--line);
  text-decoration: none; font-size: 12px; color: var(--ink-2); white-space: nowrap;
  transition: border-color .15s;
}
.nav-countdown:hover { border-color: var(--accent); }
.nav-countdown strong { font-size: 13px; font-weight: 700; color: var(--accent); }
@media (max-width: 640px) { .nav-countdown .ncd-label { display: none; } }

/* Accuracy-by-topic: clickable rows that launch a focused drill */
.topic-row {
  display: grid; grid-template-columns: minmax(140px, 40%) 1fr auto;
  align-items: center; gap: 14px; width: 100%;
  padding: 9px 10px; margin: 0; border: 0; border-radius: 8px;
  background: none; cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: background .14s;
}
.topic-row:nth-child(odd) { background: var(--accent-t2); }
.topic-row:hover { background: var(--accent-t); }
.topic-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.topic-name { font-size: 13px; font-weight: 500; color: var(--ink-1); }
.topic-weight { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.topic-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.topic-fill { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }
.topic-val { font-size: 12.5px; font-weight: 700; min-width: 64px; text-align: right; }

/* Exam plan card (folded in from the old Schedule tab) */
.exam-plan label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.exam-plan input { min-width: 150px; }

/* Question Bank - topic weight badge */
.bank-weight {
  margin-left: 10px; font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-t); padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.bank-item[data-empty="1"] > summary { opacity: .62; }
.bank-item[data-empty="1"] > summary .pill { background: var(--surface-3); color: var(--ink-4); }

/* Drill button always visible enough to find, brighter on hover/open */
.bank-drill { font-size: 12px; margin-left: auto; white-space: nowrap; }

/* Section divider (Level III specialised pathways) */
.bank-section-divider {
  margin: 22px 2px 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3);
}

/* Learning-module list inside a topic */
.lm-list { list-style: none; margin: 0; padding: 4px 2px 2px; display: flex; flex-direction: column; gap: 2px; }
.lm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-xs);
  transition: background .12s;
}
.lm-row:hover { background: var(--surface-2); }
.lm-idx {
  flex: 0 0 auto; min-width: 42px;
  font-size: 11px; font-weight: 700; color: var(--ink-4);
  letter-spacing: .02em;
}
.lm-title { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink-1); }
.lm-count { flex: 0 0 auto; font-size: 11px; }
.lm-row.lm-empty { opacity: .5; }
.lm-row.lm-empty .lm-title { color: var(--ink-3); }
.lm-row.lm-empty .lm-count { background: var(--surface-3); color: var(--ink-4); }
.lm-row.lm-other .lm-title { font-style: italic; color: var(--ink-2); }

/* Progress / score badge shown on topics, LMs and category rows */
.bank-right { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }
.bank-right .bank-drill { margin-left: 0; }
.bank-stat { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; white-space: nowrap; }
.bank-stat .bs-done { color: var(--ink-3); font-weight: 600; }
.bank-stat .bs-score { font-weight: 700; }
.bank-stat.bs-none { color: var(--ink-4); font-weight: 500; font-style: italic; }

/* Top-level topic rows: a dense fixed-column grid. Count, weight and a
   FIXED-width name column line the left edge up, so the progress bar that
   follows starts at the same x on every row and reads as tied to the name.
   The bar column absorbs the row's slack (bar itself is capped), and the
   coverage line + action cluster sit at the right. */
.bank-item.bank-topic > summary,
.bank-item.bank-other > summary {
  display: grid;
  grid-template-columns: 40px 64px 240px minmax(220px, 1fr) auto auto 16px;
  align-items: center; gap: 8px;
}
/* Expand chevron, pinned to the right of every topic row; rotates when open. */
.bank-caret {
  flex: 0 0 auto; justify-self: end;
  color: var(--ink-4); font-size: 17px; line-height: 1;
  transition: transform .15s;
}
.bank-item.bank-topic[open] > summary .bank-caret,
.bank-item.bank-other[open] > summary .bank-caret { transform: rotate(90deg); }
.bank-item.bank-topic > summary > .pill,
.bank-item.bank-other > summary > .pill { justify-self: start; }
.bank-item.bank-topic > summary .bank-weight,
.bank-item.bank-other > summary .bank-weight { margin: 0; justify-self: start; }
.bank-item.bank-topic > summary .bank-weight:empty,
.bank-item.bank-other > summary .bank-weight:empty { background: none; padding: 0; }
.bank-item.bank-topic > summary .bank-topic-name,
.bank-item.bank-other > summary .bank-topic-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-0); font-weight: 600;
}

/* Coverage line (loaded/attempted/incorrect/due counts). Calm + muted, never a
   score, never red. Shown on topic, module and category rows. */
.bank-cov { font-size: 12px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bank-cov-none { font-style: italic; color: var(--ink-4); }
.bank-item.bank-topic > summary .bank-cov,
.bank-item.bank-other > summary .bank-cov { justify-self: end; text-align: right; }

/* Slim coverage bar: its own dedicated, fixed-width column between the topic name
   and the right-side metrics, LEFT-aligned in its cell (never centred, never
   squeezed beside the Drill button) so every row's bar is the same length and
   easy to read. Same muted-gold styling - no new colours. */
.bank-bar {
  width: 100%; max-width: 280px; height: 6px; border-radius: 999px;
  background: var(--surface-2); overflow: hidden; justify-self: start;
}
.bank-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--gold); }
/* On narrow screens drop the dedicated bar column (it's decorative/aria-hidden)
   so the count, name, metrics and Drill button stay aligned and uncramped. */
@media (max-width: 720px) {
  .bank-item.bank-topic > summary,
  .bank-item.bank-other > summary {
    grid-template-columns: 40px 56px minmax(0, 1fr) auto auto 16px;
  }
  .bank-item.bank-topic > summary .bank-bar,
  .bank-item.bank-other > summary .bank-bar { display: none; }
}

/* Topic Drill action: an understated, premium pill rather than a heavy filled
   block. It rests as a quiet hairline-outlined chip and fills with the app's
   premium primary (ink/bone, NOT gold) only on hover, so a screen of rows reads
   calm. Fixed min-width + height keep every Drill button identical in size, with
   the label optically centred. Gold is reserved for the Pro upsell
   (.btn-upgrade, which overrides the colours below). */
.btn-action {
  appearance: none; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 80px; height: 30px; padding: 0 15px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-1);
  font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1;
  border-radius: 999px; transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.btn-action:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
/* In dark mode --accent is bone, so the hover label needs dark ink to stay legible. */
:root[data-theme="dark"] .btn-action:hover { color: var(--bg); }
:root[data-theme="dark"] .btn-action.btn-upgrade { color: var(--surface); }
.bank-item.bank-topic > summary .bank-go,
.bank-item.bank-other > summary .bank-go { justify-self: end; }

/* ---- free / Pro gating UI (access control only; no new colours) ---------- */
/* Topic action cell for free users: a small "5 free" tag beside the Drill 5 /
   Unlock button. The wrapper is the single grid item, pinned right. */
.bank-free-wrap { display: inline-flex; align-items: center; gap: 7px; justify-self: end; }
/* Small quiet allowance pill ("10 left") sitting just left of the Drill button.
   Neutral, mixed-case and low-contrast on purpose, so it reads as a calm hint and
   never competes with the action beside it (no gold, no all-caps). */
.bank-free-tag {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0;
  color: var(--ink-3); white-space: nowrap;
  padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.bank-go.btn-upgrade .pro-crown { width: 12px; height: 12px; margin-right: 5px; flex: none; }

/* Pro-only module / EOC / example drill link (free users): subtle gold Pro badge
   in place of the "Drill ›" link, same footprint so rows stay compact. */
.btn-link.bank-pro {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--gold); font-weight: 650;
}
.btn-link.bank-pro .pro-crown { width: 11px; height: 11px; flex: none; }

/* One subtle, COMPACT upgrade notice under the toolbar (free users only). It is
   inline-flex so it shrinks to its content - never a full-width empty banner -
   and the [hidden] guard stops the empty div from showing as a strip when the
   user is on Pro (author display: would otherwise override the hidden attr). */
.bank-pro-prompt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin: 0 0 10px; padding: 7px 8px 7px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  font-size: 12px; line-height: 1.35; color: var(--ink-2);
}
.bank-pro-prompt[hidden] { display: none; }
/* Copy fills the row so the Pro badge sits left and the Upgrade button is pinned
   hard-right. */
.bank-pro-copy { flex: 1; min-width: 0; }
/* The single Upgrade action on the right: the one allowed gold accent here. Reuses
   the Drill pill geometry (.btn-action) so it sits flush with the rows below. */
.bank-pro-up { flex: none; }

/* Secondary drills (end-of-chapter / examples) live inside the expanded body. */
.bank-subdrills { display: flex; flex-wrap: wrap; gap: 16px; padding: 2px 2px 8px; }
.bank-subdrills:empty { display: none; }

/* ---- top KPI card: coverage + action metrics (no accuracy) ---- */
.bank-kpi { padding: 20px 22px; margin-bottom: 14px; }
.bank-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.bank-kpi-metric { display: flex; flex-direction: column; gap: 3px; }
.bank-kpi-metric .big { font-size: 30px; font-weight: 750; line-height: 1; color: var(--ink-0); font-variant-numeric: tabular-nums; }
.bank-kpi-label { font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em; text-transform: uppercase; }
.bank-kpi-sub { font-size: 11.5px; color: var(--ink-4); }
.bank-kpi-sub:empty { display: none; }
@media (max-width: 560px) { .bank-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }

/* ---- bank coverage by topic (read-only overview) ----
   Card chrome only; the row/table grid is owned by lux.css (loads last). */
.bank-coverage { padding: 18px 22px 8px; margin-bottom: 16px; }
.bank-cov-head h2 { font-family: var(--f-display, inherit); font-size: 17px; margin: 0 0 2px; color: var(--ink-0); }
.bank-cov-head p { font-size: 12.5px; margin: 0 0 14px; }

/* Score bubble shown inline on topic / module rows once a topic is started. */
.bank-score {
  display: inline-block; font-size: 11px; font-weight: 600; color: var(--ink-1);
  background: var(--surface-2); border-radius: 999px; padding: 1px 8px; margin-left: 2px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* Empty-state line shown when a filter tab has no matches. */
.bank-empty-filter { padding: 18px 2px; font-size: 14px; }

/* ---- Q.Bank sticky filter toolbar: lighter than the cards above it ---- */
.bank-toolbar {
  position: sticky; top: 56px; z-index: 40;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 0; margin-bottom: 8px;
  background: var(--bg);
}
.bank-toolbar #search { flex: 1; min-width: 200px; }
.bank-select {
  appearance: none; font: inherit; font-size: 13px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; cursor: pointer; max-width: 200px; text-align: center;
}
.bank-filter { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; }
.bf-opt {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 6px 14px; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 500;
  color: var(--ink-2); transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.bf-opt:hover { color: var(--ink-0); }
.bf-opt.active { background: var(--surface, #fff); color: var(--ink-0); font-weight: 650; box-shadow: var(--sh-sm, 0 1px 2px rgba(0,0,0,.08)); }
.bf-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
.bf-count:empty { display: none; }
/* "Incorrect" earns the red badge; Correct is green, Flagged is neutral. */
.bf-count-ok { background: var(--ok, #2f6b4f); }
.bf-count-flag { background: var(--ink-3); }
@media (max-width: 560px) {
  .bank-filter { width: 100%; } .bf-opt { flex: 1; text-align: center; }
  .bank-select { flex: 1; max-width: none; }
}

/* Expandable Learning Module -> End-of-chapter / Examples split */
.lm-row-wrap { list-style: none; }
.lm-item > summary { cursor: pointer; list-style: none; }
.lm-item > summary::-webkit-details-marker { display: none; }
.lm-item > summary.lm-row { padding-right: 10px; }
.lm-caret { flex: 0 0 auto; color: var(--ink-4); font-size: 16px; transition: transform .15s; }
.lm-item[open] > summary .lm-caret { transform: rotate(90deg); }
.lm-cats { display: flex; flex-direction: column; gap: 4px; padding: 4px 6px 8px 52px; }
.lm-cat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-left: 2px solid var(--accent-t2);
  background: var(--surface-2); border-radius: var(--r-xs);
}
.lm-cat-name { font-size: 13px; color: var(--ink-1); font-weight: 500; }
.lm-cat-empty { opacity: .8; border-left-color: var(--line); }
.lm-cat-note { margin-left: auto; font-size: 12px; color: var(--ink-4); font-style: italic; }

/* Empty-bank banner above the curriculum outline */
.bank-empty-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 18px; margin-bottom: 14px;
  background: var(--accent-t); border: 1px solid var(--accent-t2); border-radius: var(--r);
}
.bank-empty-banner strong { display: block; color: var(--ink-0); font-size: 14.5px; margin-bottom: 2px; }
.bank-empty-banner span { color: var(--ink-2); font-size: 13px; }
.bank-empty-banner .btn-primary { margin-left: auto; }
.bank-other > summary strong { color: var(--ink-2); }

/* ============================================================================
   IMPORT - rights gate + locked upload zone
   ============================================================================ */
.rights-gate {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
  cursor: pointer;
}
/* Custom rights checkbox: a refined box that fills gold with a crisp white
   tick when confirmed - a more deliberate, premium gesture than the native box. */
.rights-gate input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid var(--line-2, var(--line));
  border-radius: 6px;
  background: var(--surface, #fff);
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.rights-gate input[type="checkbox"]::after {
  content: "";
  width: 12px;
  height: 12px;
  transform: scale(0);
  transition: transform .16s cubic-bezier(.22, .61, .36, 1);
  background-color: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
}
.rights-gate input[type="checkbox"]:hover { border-color: var(--gold, #9b7a3c); }
.rights-gate input[type="checkbox"]:checked {
  background: var(--gold, #9b7a3c);
  border-color: var(--gold, #9b7a3c);
}
.rights-gate input[type="checkbox"]:checked::after { transform: scale(1); }
.rights-gate input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--gold-t, rgba(155, 122, 60, .3));
}

/* multi-file toggle: a quiet inline control under the upload zone */
.multi-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
  cursor: pointer;
}
.multi-toggle input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* per-file breakdown shown when several files are imported at once */
.import-summary {
  margin: 8px 0 2px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* the upload zone is locked until rights are confirmed */
.upload-zone.disabled {
  opacity: .5;
  pointer-events: none;
  filter: grayscale(0.4);
}
.upload-zone.disabled input[type="file"] { pointer-events: none; }

/* ============================================================================
   SETUP / WELCOME - first-run onboarding (premium, focused)
   ============================================================================ */
.setup-body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(900px 480px at 50% -8%, var(--accent-t2), transparent 60%),
    radial-gradient(700px 400px at 100% 110%, var(--accent-t), transparent 55%),
    var(--bg);
}

.setup-wrap {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 44px 40px 32px;
  box-shadow: 0 24px 60px -24px rgba(10,15,30,.22), var(--sh-sm);
  text-align: center;
}

.setup-brand {
  display: inline-block;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-t);
  border: 1px solid var(--accent-t2);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.setup-title {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink-0);
  margin: 0 0 8px;
}
.setup-sub {
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 30px;
}

.setup-field {
  display: block;
  text-align: left;
  max-width: 380px;
  margin: 0 auto 28px;
}
.setup-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
}
.setup-label em { color: var(--ink-4); font-style: normal; font-weight: 500; }
.setup-field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color .13s, box-shadow .13s;
}
.setup-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-t2);
}

.setup-q {
  font-weight: 650;
  font-size: 15px;
  color: var(--ink-0);
  margin: 0 0 14px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
@media (max-width: 520px) { .level-grid { grid-template-columns: 1fr; } }

.level-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 22px 12px 18px;
  cursor: pointer;
  font-family: var(--f);
  text-align: center;
  transition: border-color .15s, box-shadow .15s, transform .1s, background .15s;
}
.level-card:hover {
  border-color: var(--line-2);
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
}
.level-card.selected {
  border-color: var(--accent);
  background: var(--accent-t);
  box-shadow: 0 0 0 3px var(--accent-t2);
}
.level-card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-t2); }

/* selected check badge */
.level-card.selected::after {
  content: "✓";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  line-height: 1;
}

.level-num {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--ink-2);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  border: 1px solid var(--line);
  transition: background .15s, color .15s, border-color .15s;
}
.level-card.selected .level-num {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.level-name { font-weight: 650; font-size: 15px; color: var(--ink-0); }
.level-desc { font-size: 12px; color: var(--ink-3); line-height: 1.4; }

.setup-go {
  width: 100%;
  max-width: 380px;
  padding: 14px;
  font-size: 15px;
  margin: 0 auto;
}
.setup-note {
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.5;
  max-width: 420px;
  margin: 18px auto 0;
}
.setup-legal {
  color: var(--ink-4);
  font-size: 11px;
  line-height: 1.4;
  max-width: 420px;
  margin: 12px auto 0;
}
