/* ==================================================================
   LearnGeo
   Design language: white paper, hairline rules, one accent,
   monospace for anything numeric. Restraint over decoration.
   ================================================================== */

:root {
  --ink:        #0A0A0B;
  --ink-2:      #3F4147;
  --muted:      #6B7280;
  --faint:      #9CA3AF;
  --line:       #E6E8EC;
  --line-soft:  #F1F2F5;
  --paper:      #FAFAFB;
  --white:      #FFFFFF;

  --accent:      #1B4DFF;
  --accent-ink:  #143BC4;
  --accent-soft: #EEF2FF;

  --success:      #0E9F6E;
  --success-soft: #E7F7F1;
  --danger:       #E02424;
  --danger-soft:  #FDECEC;
  --gold:         #F5B301;
  --diamond:      #38BDF8;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --r-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(10,10,11,.05);
  --shadow:    0 2px 8px rgba(10,10,11,.06), 0 1px 2px rgba(10,10,11,.04);
  --shadow-lg: 0 12px 40px rgba(10,10,11,.10), 0 2px 8px rgba(10,10,11,.05);
  --shadow-xl: 0 24px 70px rgba(10,10,11,.16);

  --emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, var(--emoji);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace, var(--emoji);

  --topbar-h: 60px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; font-weight: 640; letter-spacing: -0.022em; line-height: 1.15; }
p  { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* Small-caps section label used throughout */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
}

/* ---------------------------- buttons ---------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: var(--r);
  font-size: 14px; font-weight: 560; letter-spacing: -.01em;
  border: 1px solid transparent;
  transition: background .15s var(--ease), border-color .15s var(--ease),
              transform .12s var(--ease), box-shadow .15s var(--ease), color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #26272B; }
.btn--accent  { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(27,77,255,.3); }
.btn--accent:hover { background: var(--accent-ink); }
.btn--ghost   { border-color: var(--line); background: var(--white); color: var(--ink); }
.btn--ghost:hover { border-color: #D3D7DE; background: var(--paper); }
.btn--quiet   { color: var(--muted); }
.btn--quiet:hover { color: var(--ink); background: var(--line-soft); }
.btn--lg { height: 48px; padding: 0 26px; font-size: 15px; border-radius: 12px; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn svg { flex: none; }

/* ============================== LANDING ============================ */
.landing { display: block; }

.nav {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 32px;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__links { display: flex; gap: 26px; margin-left: 8px; }
.nav__links a { font-size: 14px; color: var(--muted); font-weight: 500; transition: color .15s; }
.nav__links a:hover { color: var(--ink); }
.nav__spacer { flex: 1; }

.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 660; letter-spacing: -.028em; font-size: 16px; }
.brand__mark {
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
}
.brand__mark svg { width: 15px; height: 15px; }

/* hero */
.hero {
  position: relative;
  padding: 92px 32px 76px;
  max-width: 1180px; margin: 0 auto;
  text-align: center;
  overflow: hidden;
}
.hero__grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 25%, transparent 78%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 25%, transparent 78%);
}
.hero > * { position: relative; z-index: 1; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 8px 0 8px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--white);
  font-size: 12.5px; color: var(--muted); font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.pill b { color: var(--ink); font-weight: 600; }
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

.hero h1 {
  margin: 26px auto 0; max-width: 15ch;
  font-size: clamp(44px, 6.6vw, 82px);
  font-weight: 660; letter-spacing: -.042em; line-height: .98;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero__sub {
  margin: 22px auto 0; max-width: 56ch;
  font-size: 18px; color: var(--muted); line-height: 1.6;
}
.hero__cta { margin-top: 34px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero__note { margin-top: 16px; font-size: 13px; color: var(--faint); }

/* stat strip */
.stats {
  max-width: 1180px; margin: 8px auto 0; padding: 0 32px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.stat { padding: 26px 8px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat__n { font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: -.03em; }
.stat__l { margin-top: 3px; font-size: 12.5px; color: var(--faint); }

/* sections */
.section { max-width: 1180px; margin: 0 auto; padding: 84px 32px; }
.section--paper { background: var(--paper); max-width: none; border-block: 1px solid var(--line); }
.section--paper > .section__inner { max-width: 1180px; margin: 0 auto; }
.section__head { max-width: 62ch; margin-bottom: 42px; }
.section__head h2 { margin-top: 12px; font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.032em; }
.section__head p  { margin-top: 14px; font-size: 17px; color: var(--muted); }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mode-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px; text-align: left;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
  display: flex; flex-direction: column;
}
.mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #D8DCE3; }
.mode-card__icon {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; margin-bottom: 18px;
  background: var(--accent-soft); color: var(--accent);
}
.mode-card h3 { font-size: 18px; }
.mode-card p  { margin-top: 8px; font-size: 14.5px; color: var(--muted); flex: 1; }
.mode-card ul { margin: 16px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line-soft); }
.mode-card li {
  font-size: 13.5px; color: var(--ink-2); padding: 8px 0 0 20px; position: relative;
}
.mode-card li::before {
  content: ''; position: absolute; left: 4px; top: 16px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.step { padding: 0 24px 0 0; border-left: 1px solid var(--line); padding-left: 24px; }
.step__n {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  font-weight: 600; letter-spacing: .08em;
}
.step h4 { margin-top: 10px; font-size: 16px; }
.step p  { margin-top: 6px; font-size: 14px; color: var(--muted); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.feature-list { list-style: none; margin: 0; padding: 0; }
.feature-list li { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.feature-list li:last-child { border-bottom: none; }
.feature-list svg { flex: none; margin-top: 2px; color: var(--accent); }
.feature-list b { display: block; font-weight: 600; font-size: 15px; }
.feature-list span { font-size: 14px; color: var(--muted); }

/* reward preview card on landing */
.preview-card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--white); box-shadow: var(--shadow-lg); overflow: hidden;
}
.preview-card__bar {
  height: 38px; display: flex; align-items: center; gap: 6px; padding: 0 14px;
  border-bottom: 1px solid var(--line); background: var(--paper);
}
.preview-card__dot { width: 9px; height: 9px; border-radius: 50%; background: #D8DCE3; }
.preview-card__body { padding: 24px; }
.pv-q { font-size: 13px; color: var(--faint); }
.pv-a { margin-top: 6px; font-size: 26px; font-weight: 640; letter-spacing: -.03em; }
.pv-opts { margin-top: 18px; display: grid; gap: 8px; }
.pv-opt {
  border: 1px solid var(--line); border-radius: var(--r); padding: 11px 14px;
  font-size: 14px; display: flex; justify-content: space-between; align-items: center;
}
.pv-opt.is-right { border-color: var(--success); background: var(--success-soft); color: #0A5C42; font-weight: 560; }
.pv-rewards { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 10px;
  border-radius: 999px; font-size: 12.5px; font-weight: 560;
  font-family: var(--mono);
}
.chip--xp   { background: var(--accent-soft); color: var(--accent); }
.chip--gem  { background: #E6F6FE; color: #0369A1; }
.chip--fire { background: #FFF3E0; color: #B45309; }

.footer {
  border-top: 1px solid var(--line); padding: 34px 32px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto;
  font-size: 13px; color: var(--faint);
}
.footer .nav__spacer { flex: 1; }

/* =============================== APP ============================== */
.app { display: none; flex-direction: column; height: 100vh; }
.app.is-open { display: flex; }

.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 10px; padding: 0 18px;
  border-bottom: 1px solid var(--line); background: var(--white);
  position: relative; z-index: 60;
}
.tabs { display: flex; gap: 2px; margin-left: 14px; }
.tab {
  height: 34px; padding: 0 14px; border-radius: 8px;
  font-size: 14px; font-weight: 520; color: var(--muted);
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .14s, color .14s;
}
.tab:hover { background: var(--line-soft); color: var(--ink); }
.tab.is-active { background: var(--ink); color: #fff; }
.tab.is-active:hover { background: var(--ink); }

.hud { display: flex; align-items: center; gap: 6px; }
.hud__item {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white);
  font-family: var(--mono); font-size: 13px; font-weight: 560;
  transition: transform .18s var(--ease);
}
.hud__item.is-bumped { animation: bump .42s var(--ease); }
@keyframes bump {
  0% { transform: scale(1); } 35% { transform: scale(1.16); } 100% { transform: scale(1); }
}
.hud__gem  { color: #0369A1; border-color: #BAE6FD; background: #F0F9FF; }
.hud__xp   { color: var(--accent); border-color: #C7D2FE; background: var(--accent-soft); }
.hud__fire { color: #B45309; border-color: #FDE68A; background: #FFFBEB; }

/* ------------------------------ avatar ---------------------------- */
.avatar-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; flex: none; }
.avatar-btn:hover .avatar__img { transform: scale(1.06); }

.avatar { position: relative; display: block; width: 100%; height: 100%; }

.avatar__img {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--white); border: 2px solid var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
  display: grid; place-items: center; padding: 20%;
  transition: transform .18s var(--ease);
}
.avatar__img svg { display: block; width: 100%; height: 100%; }

/* gradient ring sits behind, so the white avatar border reads as a gap */
.avatar__ring { position: absolute; inset: -3px; border-radius: 50%; }

.avatar__badge {
  position: absolute; right: -8%; top: -10%;
  width: 44%; height: 44%; min-width: 13px; min-height: 13px;
  border-radius: 50%; background: var(--white);
  box-shadow: 0 1px 3px rgba(10,10,11,.22);
  display: grid; place-items: center; padding: 14%;
}
.avatar__badge svg { width: 100%; height: 100%; display: block; }

.avatar__orbit {
  position: absolute; inset: -5px; border-radius: 50%;
  border: 1.5px dashed currentColor; animation: spin 7s linear infinite;
}
.avatar__orbit i {
  position: absolute; top: -3.5px; left: 50%; margin-left: -3.5px;
  width: 7px; height: 7px; border-radius: 50%;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* the online/idle/dnd dot — sized off the avatar so it scales with it */
.avatar__status {
  position: absolute; right: -1%; bottom: -1%;
  width: 30%; height: 30%; min-width: 12px; min-height: 12px;
  border-radius: 50%; border: 2.5px solid var(--white);
  box-shadow: 0 0 0 .5px rgba(10,10,11,.08);
}

/* profile dropdown */
.menu {
  position: absolute; top: calc(var(--topbar-h) - 6px); right: 16px; width: 272px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-xl);
  padding: 6px; z-index: 120;
  transform-origin: top right;
  animation: pop .16s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.menu__head {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 12px 13px; margin-bottom: 5px;
  border-bottom: 1px solid var(--line-soft);
}
.menu__name { font-weight: 620; font-size: 14.5px; letter-spacing: -.01em; }
.menu__meta { font-size: 12px; color: var(--faint); font-family: var(--mono); }
.menu__item {
  width: 100%; display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: var(--ink-2); text-align: left;
  transition: background .13s, color .13s;
}
.menu__item:hover { background: var(--line-soft); color: var(--ink); }
.menu__item svg { color: var(--faint); flex: none; }
.menu__item:hover svg { color: var(--ink-2); }
.menu__item--danger { color: var(--danger); }
.menu__item--danger:hover { background: var(--danger-soft); color: var(--danger); }
.menu__item--danger svg { color: var(--danger); }
.menu__sep { height: 1px; background: var(--line-soft); margin: 5px 8px; }

/* --------------------------- workspace --------------------------- */
.workspace { flex: 1; display: flex; min-height: 0; }

.sidebar {
  width: 400px; flex: none; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; background: var(--white);
}
.sidebar__head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); flex: none; }
.sidebar__title { font-size: 17px; font-weight: 620; letter-spacing: -.022em; }
.sidebar__body { flex: 1; overflow-y: auto; padding: 20px 22px 26px; }
.sidebar__foot { flex: none; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--white); }

/* Leaflet assigns its own panes z-index 400-800. Without a stacking context
   here, those numbers compete with the app chrome and paint over the profile
   menu, modals, toasts and confetti. `isolation` contains them. */
.map-pane, .map-strip {
  position: relative; min-width: 0; background: var(--paper);
  z-index: 0; isolation: isolate;
}
.map-pane { flex: 1; }
#map { position: absolute; inset: 0; }
.leaflet-container { background: #F4F6F8; font-family: var(--sans); }

.map-badge {
  position: absolute; top: 14px; left: 14px; z-index: 500;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 13px; box-shadow: var(--shadow);
  font-size: 13px; max-width: 320px;
}
.map-badge b { display: block; font-size: 14px; letter-spacing: -.01em; }
.map-badge span { color: var(--muted); font-size: 12.5px; }

.map-hint {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 500;
  background: rgba(10,10,11,.86); color: #fff; backdrop-filter: blur(6px);
  border-radius: 999px; padding: 7px 16px; font-size: 12.5px; font-weight: 500;
  pointer-events: none; animation: pop .2s var(--ease);
}

/* capital markers */
.cap-pin {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(10,10,11,.35);
  transition: transform .16s var(--ease), background .16s;
}
.cap-pin:hover { transform: scale(1.35); }
.cap-pin--target { background: var(--gold); animation: pulse 1.5s infinite; }
.cap-pin--right  { background: var(--success); }
.cap-pin--wrong  { background: var(--danger); }
.cap-pin--dim    { background: var(--faint); opacity: .5; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,179,1,.6); }
  70%     { box-shadow: 0 0 0 13px rgba(245,179,1,0); }
}

/* ----------------------- question components --------------------- */
.qcard { animation: slideIn .26s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } }

.qmeta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.qprompt { font-size: 13.5px; color: var(--muted); }
.qsubject {
  margin-top: 5px; font-size: 27px; font-weight: 640; letter-spacing: -.032em; line-height: 1.15;
}
.qsubject small { display: block; font-size: 13px; font-weight: 500; color: var(--faint); letter-spacing: 0; margin-top: 5px; }

.options { display: grid; gap: 9px; margin-top: 20px; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--white); text-align: left; font-size: 14.5px; font-weight: 500;
  transition: border-color .14s, background .14s, transform .1s var(--ease);
}
.option:hover:not(.is-locked) { border-color: #C9CFD9; background: var(--paper); }
.option:active:not(.is-locked) { transform: scale(.995); }
.option__key {
  flex: none; width: 24px; height: 24px; border-radius: 6px;
  background: var(--line-soft); color: var(--muted);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  transition: background .14s, color .14s;
}
.option__text { flex: 1; }
.option__mark { flex: none; opacity: 0; transition: opacity .14s; }
.option.is-right {
  border-color: var(--success); background: var(--success-soft); color: #0A5C42;
  animation: rightPop .34s var(--ease);
}
.option.is-right .option__key { background: var(--success); color: #fff; }
.option.is-right .option__mark { opacity: 1; color: var(--success); }
.option.is-wrong {
  border-color: var(--danger); background: var(--danger-soft); color: #9B1C1C;
  animation: shake .34s var(--ease);
}
.option.is-wrong .option__key { background: var(--danger); color: #fff; }
.option.is-wrong .option__mark { opacity: 1; color: var(--danger); }
.option.is-locked { cursor: default; }
.option.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.option.is-selected .option__key { background: var(--accent); color: #fff; }
@keyframes rightPop { 0%{transform:scale(1)} 40%{transform:scale(1.022)} 100%{transform:scale(1)} }
@keyframes shake {
  0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)}
  40%{transform:translateX(5px)} 60%{transform:translateX(-3px)} 80%{transform:translateX(2px)}
}

.answer-input {
  width: 100%; height: 46px; padding: 0 14px; margin-top: 18px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--white);
  font-size: 15px; transition: border-color .14s, box-shadow .14s;
}
.answer-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(27,77,255,.12); }

/* feedback strip */
.feedback {
  margin-top: 16px; padding: 13px 15px; border-radius: 11px;
  display: flex; gap: 11px; align-items: flex-start;
  animation: slideIn .22s var(--ease);
}
.feedback--right { background: var(--success-soft); }
.feedback--wrong { background: var(--danger-soft); }
.feedback b { font-size: 14px; }
.feedback p { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.feedback svg { flex: none; margin-top: 1px; }
.feedback--right svg, .feedback--right b { color: #0A5C42; }
.feedback--wrong svg, .feedback--wrong b { color: #9B1C1C; }
.feedback__gain {
  margin-top: 9px; display: flex; gap: 6px; flex-wrap: wrap;
}

/* progress */
.pbar { height: 4px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.pbar__fill { height: 100%; background: var(--ink); border-radius: 999px; transition: width .4s var(--ease); }
.pbar__fill--accent { background: var(--accent); }
.pbar__fill--success { background: var(--success); }

.meter-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }

/* combo meter */
.combo {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; border-radius: 11px;
  background: linear-gradient(90deg,#FFFBEB,#FFF7ED);
  border: 1px solid #FDE68A; margin-bottom: 16px;
  animation: slideIn .2s var(--ease);
}
.combo__n { font-family: var(--mono); font-size: 20px; font-weight: 650; color: #B45309; }
.combo__l { font-size: 12.5px; color: #92400E; font-weight: 500; }
.combo__mult {
  margin-left: auto; font-family: var(--mono); font-size: 12px; font-weight: 620;
  background: #B45309; color: #fff; padding: 3px 8px; border-radius: 999px;
}

/* setup form */
.field { margin-bottom: 20px; }
.field__label { display: block; font-size: 13px; font-weight: 560; margin-bottom: 8px; }
.field__hint  { font-size: 12.5px; color: var(--faint); margin-top: 6px; }
.seg { display: flex; gap: 4px; padding: 3px; background: var(--line-soft); border-radius: 10px; }
.seg button {
  flex: 1; height: 32px; border-radius: 7px; font-size: 13px; font-weight: 520; color: var(--muted);
  transition: background .14s, color .14s, box-shadow .14s;
}
.seg button.is-active { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 580; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.check {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 9px; font-size: 13.5px;
  transition: border-color .14s, background .14s;
}
.check:hover { border-color: #C9CFD9; }
.check.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 550; }
.check__box {
  width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--line);
  flex: none; display: grid; place-items: center; transition: all .14s;
}
.check.is-on .check__box { background: var(--accent); border-color: var(--accent); }
.check.is-on .check__box svg { color: #fff; }
.check__box svg { opacity: 0; }
.check.is-on .check__box svg { opacity: 1; }

select.input, input.input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--white);
  font-size: 14px;
}
select.input:focus, input.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(27,77,255,.12); }
textarea.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px; resize: vertical; min-height: 84px;
}
textarea.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(27,77,255,.12); }

/* ---------------- test mode: navigator + report ------------------ */
.navgrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.navcell {
  aspect-ratio: 1; border-radius: 7px; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; font-weight: 560; color: var(--muted);
  display: grid; place-items: center; position: relative;
  transition: all .13s;
}
.navcell:hover { border-color: var(--ink); color: var(--ink); }
.navcell.is-answered { background: var(--ink); border-color: var(--ink); color: #fff; }
.navcell.is-current  { box-shadow: 0 0 0 2px var(--accent); border-color: var(--accent); }
.navcell.is-flagged::after {
  content: ''; position: absolute; top: 2px; right: 2px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--gold);
}
.navcell.is-right { background: var(--success-soft); border-color: var(--success); color: #0A5C42; }
.navcell.is-wrong { background: var(--danger-soft); border-color: var(--danger); color: #9B1C1C; }

.timer {
  font-family: var(--mono); font-size: 14px; font-weight: 600;
  padding: 5px 11px; border-radius: 8px; background: var(--line-soft);
}
.timer.is-low { background: var(--danger-soft); color: var(--danger); animation: bump 1s infinite; }

.report { max-width: 880px; margin: 0 auto; padding: 44px 32px 64px; }
.score-hero { text-align: center; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.score-ring { width: 168px; height: 168px; margin: 0 auto; position: relative; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring__n {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: 40px; font-weight: 650; letter-spacing: -.03em;
}
.score-ring__n small { display: block; font-size: 12px; color: var(--faint); font-weight: 500; letter-spacing: .06em; }

.breakdown { margin-top: 34px; }
.brow {
  display: grid; grid-template-columns: 150px 1fr 92px; gap: 16px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px;
}
.brow:last-child { border-bottom: none; }
.brow__n { font-family: var(--mono); font-size: 13px; color: var(--muted); text-align: right; }

.review-item {
  display: flex; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line-soft);
}
.review-item__i {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 600;
}
.review-item__i--right { background: var(--success-soft); color: #0A5C42; }
.review-item__i--wrong { background: var(--danger-soft); color: #9B1C1C; }
.review-item__q { font-size: 14.5px; font-weight: 550; }
.review-item__a { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.review-item__a b { color: var(--ink); font-weight: 560; }
.review-item__a .bad { color: var(--danger); text-decoration: line-through; }

/* --------------------------- flashcards --------------------------
   Sized to the viewport: the deck never scrolls, the card shrinks.
-------------------------------------------------------------------*/
.fc-shell { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.fc-stage {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  padding: 22px 28px; background: var(--paper);
  overflow-y: auto;                 /* safety valve on very short screens */
}
.fc-wrap {
  width: 100%; max-width: 560px; display: flex; flex-direction: column;
  gap: 14px; min-height: 0;
}

.fc-card {
  position: relative; width: 100%;
  height: clamp(150px, 30vh, 280px);
  perspective: 1600px; cursor: pointer; flex: none;
}
.fc-inner {
  position: absolute; inset: 0;
  transition: transform .5s var(--ease); transform-style: preserve-3d;
}
.fc-card.is-flipped .fc-inner { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--white); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px 26px; text-align: center; overflow: hidden;
}
.fc-face--back { transform: rotateY(180deg); }
.fc-face__top {
  position: absolute; top: 16px; left: 20px; right: 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.fc-term {
  font-size: clamp(24px, 3.4vw, 38px); font-weight: 640;
  letter-spacing: -.035em; line-height: 1.08; max-width: 100%;
}
.fc-sub { margin-top: 10px; font-size: 14px; color: var(--muted); max-width: 42ch; }
.fc-note {
  margin-top: 10px; font-size: 12.5px; color: var(--faint);
  max-width: 44ch; line-height: 1.45;
}
.fc-coord {
  position: absolute; bottom: 16px; left: 0; right: 0;
  font-family: var(--mono); font-size: 11px; color: var(--faint); text-align: center;
}
.fc-flip-hint {
  position: absolute; bottom: 16px; left: 0; right: 0;
  font-size: 12px; color: var(--faint); text-align: center;
}

.fc-actions { flex: none; }
.fc-rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fc-rate button:not(.btn) {
  height: 52px; border: 1px solid var(--line); border-radius: 12px; background: var(--white);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 13.5px; font-weight: 570; color: var(--ink);
  transition: all .14s var(--ease);
}
.fc-rate button:not(.btn):hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.fc-rate span { font-family: var(--mono); font-size: 10px; color: var(--faint); font-weight: 500; }
.fc-rate .r-again:hover { border-color: var(--danger); color: var(--danger); }
.fc-rate .r-hard:hover  { border-color: #B45309; color: #B45309; }
.fc-rate .r-good:hover  { border-color: var(--accent); color: var(--accent); }
.fc-rate .r-easy:hover  { border-color: var(--success); color: var(--success); }

.fc-progress {
  flex: none; display: flex; align-items: center; gap: 12px;
  font-size: 12.5px; color: var(--muted);
}
.fc-progress .pbar { flex: 1; }

/* the map only matters once the card is turned over */
.fc-map {
  flex: none; height: clamp(110px, 22vh, 190px); position: relative;
  border-top: 1px solid var(--line); background: var(--paper);
}
/* #cards-map needs its own stacking context or Leaflet's panes (z-index 400)
   paint straight over the veil. */
#cards-map { z-index: 0; }
.fc-map__veil {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center; text-align: center;
  background: var(--paper); color: var(--faint); font-size: 12.5px;
  transition: opacity .3s var(--ease);
}
.fc-map__veil.is-gone { opacity: 0; pointer-events: none; }

/* compact deck summary in the sidebar */
.deck-stat {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center;
}
.deck-stat div b { font-family: var(--mono); font-size: 18px; font-weight: 640; display: block; }
.deck-stat div span { font-size: 11px; color: var(--faint); }

.deck-summary {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  text-align: center;
}
.deck-summary__n { font-family: var(--mono); font-size: 30px; font-weight: 650; letter-spacing: -.03em; }
.deck-summary__l { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

@media (max-width: 860px) {
  .fc-card { height: clamp(150px, 26vh, 230px); }
  .fc-stage { padding: 16px; }
}
/* short windows: the card keeps priority over the map strip */
@media (max-height: 620px) {
  .fc-stage { padding: 12px 20px; gap: 10px; }
  .fc-map { height: 104px; }
  .fc-rate button:not(.btn) { height: 44px; }
}

/* ---------------------------- modals ----------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,10,11,.42); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
  animation: fade .18s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--white); border-radius: 18px; box-shadow: var(--shadow-xl);
  width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column;
  overflow: hidden; animation: rise .22s var(--ease);
}
.modal--wide { max-width: 940px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.modal__head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--line); flex: none;
}
.modal__head h3 { font-size: 17px; flex: 1; }
.modal__body { padding: 22px; overflow-y: auto; flex: 1; }
.modal__foot {
  padding: 14px 22px; border-top: 1px solid var(--line); flex: none;
  display: flex; gap: 10px; justify-content: flex-end; align-items: center;
}
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  color: var(--faint); transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }

/* settings / customization tabs */
.vtabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--line); flex: none; }
.vtab {
  height: 42px; padding: 0 12px; font-size: 13.5px; font-weight: 540; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color .14s, border-color .14s;
}
.vtab:hover { color: var(--ink); }
.vtab.is-active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 580; }

.setting-row {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 0; border-bottom: 1px solid var(--line-soft);
}
.setting-row:last-child { border-bottom: none; }
.setting-row__t { flex: 1; }
.setting-row__t b { display: block; font-size: 14.5px; font-weight: 560; }
.setting-row__t span { font-size: 13px; color: var(--muted); }

.switch {
  width: 42px; height: 24px; border-radius: 999px; background: var(--line);
  position: relative; flex: none; transition: background .18s var(--ease);
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow-sm); transition: transform .18s var(--ease);
}
.switch.is-on { background: var(--success); }
.switch.is-on::after { transform: translateX(18px); }

/* ------------------ profile card (centred, Discord-like) ---------- */
.profile-card {
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--white); box-shadow: var(--shadow); position: relative;
  text-align: center;
}
.profile-card__banner { height: 78px; position: relative; }
.profile-card__body {
  padding: 0 18px 20px; position: relative;
  display: flex; flex-direction: column; align-items: center;
}
.profile-card__avatar {
  width: 82px; height: 82px; margin-top: -41px; position: relative;
  border-radius: 50%; background: var(--white); padding: 4px;
}
.profile-card__name {
  margin-top: 12px; font-size: 19px; font-weight: 640; letter-spacing: -.024em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 4px 14px; border-radius: 9px; max-width: 100%;
}
.profile-card__tag {
  font-size: 12.5px; color: var(--muted); font-family: var(--mono);
  margin-top: 6px; display: inline-flex; align-items: center; gap: 6px;
}
.profile-card__pronouns { font-size: 12.5px; color: var(--faint); margin-top: 3px; }
.profile-card__about {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word;
  width: 100%; text-align: center;
}
.profile-card__stats {
  margin-top: 16px; display: flex; gap: 22px; justify-content: center;
  width: 100%; padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.profile-card__stat { text-align: center; }
.profile-card__stat b { font-family: var(--mono); font-size: 17px; font-weight: 620; display: block; }
.profile-card__stat span { font-size: 11.5px; color: var(--faint); }

/* profile effect particles — CSS shapes, no emoji required */
.profile-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.profile-fx i {
  position: absolute; display: block; animation: fxfall linear infinite;
}
.fx-dot   { width: 6px; height: 6px; border-radius: 50%; }
.fx-rect  { width: 6px; height: 9px; border-radius: 1px; }
.fx-ring  { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid; background: none !important; }
.fx-drop  { width: 4px; height: 10px; border-radius: 0 0 3px 3px / 0 0 6px 6px; }
.fx-star  { width: 8px; height: 8px; clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%); }
.fx-leaf  { width: 9px; height: 6px; border-radius: 9px 0 9px 0; }
@keyframes fxfall {
  from { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  12%  { opacity: .9; }
  to   { transform: translateY(230px) rotate(280deg); opacity: 0; }
}

/* shop grid */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; }
.shop-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px 11px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--white); transition: all .15s var(--ease); position: relative;
}
.shop-item:hover { border-color: #C9CFD9; transform: translateY(-2px); box-shadow: var(--shadow); }
.shop-item.is-equipped { border-color: var(--accent); background: var(--accent-soft); }
.shop-item.is-locked .shop-item__vis { opacity: .55; }
.shop-item__vis {
  font-family: var(--emoji);
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  position: relative; font-size: 25px;
}
.shop-item__vis--bar { width: 100%; height: 32px; border-radius: 8px; }
.shop-item__name { font-size: 12.5px; font-weight: 550; text-align: center; line-height: 1.3; }
.shop-item__price {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px; color: #0369A1;
}
.shop-item__owned { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.shop-item__eq { font-size: 11px; color: var(--accent); font-weight: 620; font-family: var(--mono); }

/* achievements */
.ach-row { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.ach-row:last-child { border-bottom: none; }
.ach-row__i {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--line-soft); color: var(--faint); flex: none;
}
.ach-row.is-done .ach-row__i { background: var(--success-soft); color: var(--success); }
.ach-row__t b { font-size: 14px; font-weight: 560; display: block; }
.ach-row__t span { font-size: 12.5px; color: var(--muted); }
.ach-row__r { margin-left: auto; }

/* --------------------------- feedback FX -------------------------- */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti-bit { position: absolute; width: 8px; height: 12px; border-radius: 2px; will-change: transform, opacity; }
.float-gain {
  position: absolute; font-family: var(--mono); font-size: 15px; font-weight: 650;
  animation: floatUp 1.1s var(--ease) forwards; white-space: nowrap;
}
@keyframes floatUp {
  from { transform: translateY(0) scale(.85); opacity: 0; }
  18%  { opacity: 1; transform: translateY(-10px) scale(1.05); }
  to   { transform: translateY(-62px) scale(1); opacity: 0; }
}

.toast-stack {
  position: fixed; bottom: 22px; right: 22px; z-index: 320;
  display: flex; flex-direction: column-reverse; gap: 9px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  background: var(--ink); color: #fff; border-radius: 12px;
  padding: 12px 16px; box-shadow: var(--shadow-xl);
  font-size: 13.5px; font-weight: 500; max-width: 340px;
  animation: toastIn .26s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(28px) scale(.96); } }
.toast.is-out { animation: toastOut .24s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(28px) scale(.96); } }
.toast__i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.14); }
.toast b { display: block; font-weight: 620; }
.toast span { color: rgba(255,255,255,.66); font-size: 12.5px; }

/* level-up celebration */
.levelup {
  text-align: center; padding: 34px 30px 30px;
}
.levelup__ring {
  width: 108px; height: 108px; margin: 0 auto 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #22D3EE);
  display: grid; place-items: center; color: #fff;
  font-family: var(--mono); font-size: 38px; font-weight: 660;
  animation: rise .4s var(--ease), glow 2.4s ease-in-out infinite;
}
@keyframes glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(27,77,255,.32); }
  50%     { box-shadow: 0 0 0 20px rgba(27,77,255,0); }
}
.levelup h3 { font-size: 24px; letter-spacing: -.03em; }
.levelup p  { margin-top: 8px; color: var(--muted); font-size: 14.5px; }

/* daily goal ring in sidebar */
.goal { display: flex; align-items: center; gap: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.goal__ring { position: relative; width: 44px; height: 44px; flex: none; }
.goal__ring svg { transform: rotate(-90deg); }
.goal__ring span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 620;
}
.goal__t b { font-size: 13.5px; font-weight: 570; display: block; }
.goal__t span { font-size: 12.5px; color: var(--muted); }

/* empty / util */
.empty { text-align: center; padding: 44px 20px; color: var(--faint); font-size: 14px; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.stack-8  > * + * { margin-top: 8px; }
.stack-14 > * + * { margin-top: 14px; }
.stack-22 > * + * { margin-top: 22px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.grow { flex: 1; }
.t-muted { color: var(--muted); }
.t-sm { font-size: 13px; }
.t-center { text-align: center; }

/* --------------------------- responsive -------------------------- */
@media (max-width: 1080px) {
  .split { grid-template-columns: 1fr; gap: 34px; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 26px; }
  .modes { grid-template-columns: 1fr; }
  .sidebar { width: 340px; }
}
@media (max-width: 860px) {
  .nav__links { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .workspace { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--line); max-height: 56%; }
  .map-pane { min-height: 260px; }
  .navgrid { grid-template-columns: repeat(10, 1fr); }
  .section { padding: 56px 20px; }
  .hero { padding: 60px 20px 52px; }
  .tabs .tab span { display: none; }
  .hud__item { padding: 0 9px; }
}
/* Narrow phones: the top bar has to shed weight so the avatar stays reachable. */
@media (max-width: 560px) {
  .nav { padding: 0 14px; gap: 10px; }
  #nav-resume { display: none; }
  .hero__cta .btn { width: 100%; }
  .topbar { padding: 0 10px; gap: 6px; }
  .topbar .brand__text { display: none; }
  .tabs { margin-left: 4px; }
  .tab { padding: 0 9px; }
  .hud__xp { display: none; }
  .hud__item { padding: 0 8px; font-size: 12px; }
  .avatar-btn { width: 34px; height: 34px; }
  .sidebar__head, .sidebar__body, .sidebar__foot { padding-left: 16px; padding-right: 16px; }
  .fc-rate { grid-template-columns: 1fr 1fr; }
  .modal__body { padding: 16px; }
  .vtabs { overflow-x: auto; }
  .split { grid-template-columns: 1fr !important; }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
}

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

/* ================================================================
   AUTH — account gate before the study centre
   ================================================================ */
.auth-screen {
  min-height: 100vh; display: grid; place-items: center;
  padding: 32px 20px; background: var(--paper);
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--white);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 34px 32px 28px;
  text-align: center;
}
.auth-card .brand { justify-content: center; margin-bottom: 20px; }
.auth-card h2 { font-size: 24px; letter-spacing: -.03em; }
.auth-card > p { margin-top: 8px; color: var(--muted); font-size: 14.5px; }
.auth-form { margin-top: 24px; text-align: left; }
.auth-form .field { margin-bottom: 14px; }
.auth-error {
  margin-top: 14px; padding: 10px 13px; border-radius: 10px;
  background: var(--danger-soft); color: #9B1C1C; font-size: 13.5px;
  display: flex; gap: 9px; align-items: flex-start; text-align: left;
}
.auth-switch { margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.auth-switch button { color: var(--accent); font-weight: 560; }
.auth-switch button:hover { text-decoration: underline; }
.auth-note {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--faint); line-height: 1.5;
}
.auth-back {
  position: fixed; top: 20px; left: 20px; z-index: 5;
}

/* ================================================================
   PORTAL — the study centre home screen
   ================================================================ */
.portal {
  flex: 1; overflow-y: auto; background: var(--paper);
}
.portal__inner { max-width: 1080px; margin: 0 auto; padding: 38px 32px 60px; }

.portal__head {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding-bottom: 26px; border-bottom: 1px solid var(--line);
}
.portal__hello h1 { font-size: 30px; letter-spacing: -.032em; }
.portal__hello p { margin-top: 6px; color: var(--muted); font-size: 15px; }
.portal__avatar { width: 62px; height: 62px; flex: none; }

.portal__metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 26px;
}
.metric {
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; text-align: center;
}
.metric__n {
  font-family: var(--mono); font-size: 26px; font-weight: 650;
  letter-spacing: -.03em; line-height: 1.1;
}
.metric__l { margin-top: 4px; font-size: 12.5px; color: var(--faint); }
.metric--goal { display: flex; align-items: center; gap: 14px; text-align: left; }

.portal__section { margin-top: 36px; }
.portal__section > .eyebrow { display: block; margin-bottom: 14px; }

.portal-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.portal-mode {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; text-align: left; display: flex; flex-direction: column;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}
.portal-mode:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #D5DAE2; }
.portal-mode__top { display: flex; align-items: center; gap: 12px; }
.portal-mode__icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.portal-mode h3 { font-size: 17px; }
.portal-mode p { margin-top: 12px; font-size: 14px; color: var(--muted); flex: 1; }
.portal-mode__foot {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--faint);
}
.portal-mode__go { color: var(--accent); font-weight: 580; display: inline-flex; align-items: center; gap: 5px; }

.portal-split { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px;
}
.panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel__head h3 { font-size: 15px; }

.region-row {
  display: grid; grid-template-columns: 132px 1fr 74px; gap: 14px;
  align-items: center; padding: 9px 0; font-size: 13.5px;
}
.region-row + .region-row { border-top: 1px solid var(--line-soft); }
.region-row__n { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }

/* ================================================================
   LANDING — app screenshots
   ================================================================ */
.shots { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
.shot {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--white); box-shadow: var(--shadow-lg);
}
.shot__bar {
  height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 12px;
  border-bottom: 1px solid var(--line); background: var(--paper);
}
.shot__dot { width: 8px; height: 8px; border-radius: 50%; background: #D8DCE3; }
.shot__label {
  margin-left: 6px; font-family: var(--mono); font-size: 10.5px;
  color: var(--faint); letter-spacing: .06em; text-transform: uppercase;
}
.shot__body { padding: 0; }
.shot__caption {
  padding: 12px 14px; border-top: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--muted); text-align: center;
}

/* miniature reproductions of real app screens */
.mini { font-size: 11px; }
.mini__app { display: grid; grid-template-columns: 150px 1fr; min-height: 210px; }
.mini__side { border-right: 1px solid var(--line); padding: 12px; }
.mini__map {
  background:
    radial-gradient(circle at 30% 40%, #DCE7DA 0 22%, transparent 22%),
    radial-gradient(circle at 62% 62%, #DCE7DA 0 17%, transparent 17%),
    radial-gradient(circle at 78% 30%, #DCE7DA 0 13%, transparent 13%),
    #E8EEF3;
  position: relative;
}
.mini__pin {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.mini__eyebrow {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint);
}
.mini__q { margin-top: 7px; font-size: 15px; font-weight: 640; letter-spacing: -.02em; }
.mini__opt {
  margin-top: 5px; border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 7px; font-size: 10px; color: var(--ink-2);
}
.mini__opt.is-right { border-color: var(--success); background: var(--success-soft); color: #0A5C42; font-weight: 560; }
.mini__ring { display: grid; place-items: center; padding: 18px 0; }
.mini__card {
  margin: 14px; border: 1px solid var(--line); border-radius: 12px;
  padding: 22px 14px; text-align: center; box-shadow: var(--shadow-sm);
}
.mini__card b { font-size: 17px; letter-spacing: -.02em; }
.mini__rate { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; margin: 0 14px 14px; }
.mini__rate span {
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 0;
  text-align: center; font-size: 9px; color: var(--muted);
}

@media (max-width: 1080px) {
  .portal__metrics { grid-template-columns: 1fr 1fr; }
  .portal-modes { grid-template-columns: 1fr; }
  .portal-split { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .portal__inner { padding: 24px 16px 44px; }
  .portal__metrics { grid-template-columns: 1fr 1fr; }
  .portal__hello h1 { font-size: 24px; }
  .auth-card { padding: 26px 20px 22px; }
  .mini__app { grid-template-columns: 120px 1fr; }
}

.prose-block { max-width: 720px; }
.check-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .check-grid--3 { grid-template-columns: 1fr 1fr; } }

/* centred setup panel for the practice test */
#test-setup { flex: 1; overflow-y: auto; background: var(--paper); }
.setup-panel {
  max-width: 640px; margin: 0 auto; padding: 34px 28px 44px;
}
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 700px) { .setup-grid { grid-template-columns: 1fr; } }

/* shop tile internals for the SVG cosmetics */
.shop-item__disc {
  width: 100%; height: 100%; border-radius: 50%; background: var(--white);
  display: grid; place-items: center; padding: 22%;
}
.shop-item__vis-inner { display: block; width: 100%; height: 100%; }
.shop-item__vis-inner svg { width: 100%; height: 100%; display: block; }
.shop-item__badge {
  position: absolute; top: -2px; right: -2px; width: 20px; height: 20px;
  background: var(--white); border-radius: 50%; padding: 3px;
  box-shadow: 0 1px 3px rgba(10,10,11,.2);
}
.shop-item__badge svg { width: 100%; height: 100%; display: block; }
.shop-item__vis--fx { display: flex; align-items: center; justify-content: center; gap: 3px; }
