/* Geo Trainer styles.
   Design tokens come first (colours, type, radii, shadows). Dark mode follows the computer unless it is
   set in Progress › Settings. Layout: sidebar on wide screens, bottom tab bar on phones. */
:root {
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --surface-2: #F2F5F9;
  --surface-3: #E6EBF2;
  --text: #0F1B2D;
  --muted: #5A6A82;
  --line: #E2E8F0;
  --line-strong: #CDD6E2;
  --brand: #0E7A66;
  --brand-strong: #0A6252;
  --brand-soft: #E2F3EE;
  --brand-2: #0C5D7E;
  --accent: #F5A524;
  --accent-soft: #FEF2D9;
  --accent-ink: #7A4A00;
  --good: #10915A;
  --good-soft: #E2F5EB;
  --bad: #DC3F48;
  --bad-soft: #FCE9EA;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .05);
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 10px 28px -14px rgba(15, 27, 45, .22);
  --shadow-lg: 0 24px 60px -20px rgba(15, 27, 45, .35);
  --radius: 16px;
  --radius-sm: 11px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --sidebar: 244px;
  --map-sea: #D8E5EF;
  --map-land: #FFFFFF;
  --map-border: #AFBFD0;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A111D; --surface: #111A29; --surface-2: #162133; --surface-3: #1E2B41; --text: #E8EEF7; --muted: #95A4BA;
    --line: #223049; --line-strong: #2E3F5E; --brand: #2BB394; --brand-strong: #49C7A9; --brand-soft: #123128; --brand-2: #2A8DB5;
    --accent: #F7B648; --accent-soft: #3A2B0E; --accent-ink: #F8D08A; --good: #3CCB85; --good-soft: #10301F;
    --bad: #F2666D; --bad-soft: #3A171B; --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -14px rgba(0, 0, 0, .6); color-scheme: dark;
    --map-sea: #0B1524; --map-land: #1C2940; --map-border: #34476A;
  }
}
:root[data-theme="dark"] {
  --bg: #0A111D; --surface: #111A29; --surface-2: #162133; --surface-3: #1E2B41; --text: #E8EEF7; --muted: #95A4BA;
  --line: #223049; --line-strong: #2E3F5E; --brand: #2BB394; --brand-strong: #49C7A9; --brand-soft: #123128; --brand-2: #2A8DB5;
  --accent: #F7B648; --accent-soft: #3A2B0E; --accent-ink: #F8D08A; --good: #3CCB85; --good-soft: #10301F;
  --bad: #F2666D; --bad-soft: #3A171B; --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -14px rgba(0, 0, 0, .6); color-scheme: dark;
  --map-sea: #0B1524; --map-land: #1C2940; --map-border: #34476A;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.015em; }
h1 { font-size: 1.9rem; font-weight: 800; }
h2 { font-size: 1.18rem; font-weight: 700; }
h3 { font-size: 1.03rem; font-weight: 700; }
p { margin: .4em 0; }
b, strong { font-weight: 700; }
kbd { font: 700 11px/1 var(--font); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; color: var(--muted); background: var(--surface); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; width: var(--sidebar); flex: none; display: flex; flex-direction: column;
  padding: 22px 14px 18px; background: var(--surface); border-right: 1px solid var(--line); z-index: 30; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 10px 22px; color: var(--text); font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 800; color: var(--brand); }
.brand-mark svg { width: 34px; height: 34px; display: block; }
.bm-bg { fill: var(--brand); }
.bm-line { fill: none; stroke: #fff; stroke-width: 2; }
.bm-line.thin { stroke-width: 1.6; }
.bm-dot { fill: var(--accent); stroke: var(--brand); stroke-width: 1.6; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--muted); font-weight: 600; font-size: 14.5px; transition: background .12s, color .12s; }
.side-nav a .icon { width: 20px; height: 20px; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-nav a.active { background: var(--brand-soft); color: var(--brand-strong); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 10px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.mini-streak { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.mini-streak .icon { width: 26px; height: 26px; color: var(--accent); }
.mini-streak b { display: block; font-size: 14px; }
.mini-streak small { color: var(--muted); font-size: 12px; }
.theme-btn { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 11px; background: transparent; color: var(--muted);
  font-weight: 600; font-size: 13.5px; cursor: pointer; }
.theme-btn:hover { background: var(--surface-2); color: var(--text); }
.mobile-bar { display: none; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 34px 40px 56px; flex: 1; outline: none; }
.footer { width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px 40px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px;
  display: flex; flex-direction: column; gap: 3px; }

/* ---------- generic pieces ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.95rem; }
.page-head .sub { color: var(--muted); margin-top: 7px; max-width: 720px; font-size: 15px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.pad { padding: 20px 22px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.label { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.icon svg { width: 100%; height: 100%; }
.icon.big { width: 56px; height: 56px; color: var(--muted); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 34px 0 14px; }
.section-title h2 { font-size: 1.25rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); padding: 10px 16px; border-radius: 11px; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .06s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--brand) 80%, transparent); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.small { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { display: inline-flex; border: 0; background: transparent; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }

input[type=text], input[type=search], input[type=url], input[type=password], select, textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 11px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
textarea { min-height: 80px; resize: vertical; }
.field { margin-bottom: 16px; }
.field > span { display: block; font-weight: 700; margin-bottom: 6px; font-size: 14px; }
.field .hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }

.flag { width: 24px; height: 18px; border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 1px rgba(15, 27, 45, .12); flex: none; background: var(--surface-3); }
.flag-fallback { display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--text); font-size: 13px; line-height: 1.5; font-weight: 600; }
.chip .flag { width: 20px; height: 15px; border-radius: 50%; }
a.chip:hover { text-decoration: none; border-color: var(--brand); }
.chip.muted { opacity: .8; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.brand { background: var(--brand-soft); color: var(--brand-strong); }
.meter { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 60%, var(--accent))); border-radius: inherit; }

/* ---------- topic tiles (quiz picker, library topics) ---------- */
.topic { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; color: var(--text); min-height: 100%;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.topic:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.topic .t-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-strong);
  display: flex; align-items: center; justify-content: center; flex: none; }
.topic .t-icon .icon { width: 20px; height: 20px; }
.topic b { display: block; font-size: 15px; margin-bottom: 3px; }
.topic small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.topic small + small { margin-top: 8px; font-weight: 700; color: var(--brand-strong); font-size: 12.5px; }
.topic[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.page-actions label.row { gap: 8px; font-weight: 700; color: var(--muted); }
.page-actions select { width: auto; min-width: 190px; color: var(--text); }

/* ---------- home dashboard ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.dash-head h1 { font-size: 2.05rem; }
.dash-head .sub { color: var(--muted); margin-top: 6px; font-size: 15.5px; }
.streak { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; }
.streak .icon { width: 20px; height: 20px; color: var(--accent); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; }
.hero-card { position: relative; overflow: hidden; padding: 28px; border: 0; color: #fff; min-height: 230px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%); box-shadow: var(--shadow); }
.hero-card .eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.hero-card h2 { color: #fff; font-size: 1.6rem; margin: 8px 0 6px; max-width: 70%; }
.hero-card p { opacity: .9; max-width: 62%; margin: 0; }
.hero-card .hero-stats { display: flex; gap: 22px; margin-top: 18px; flex-wrap: wrap; }
.hero-card .hero-stats b { display: block; font-size: 1.5rem; line-height: 1.1; }
.hero-card .hero-stats span { font-size: 12.5px; opacity: .85; }
.hero-card .actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.hero-card .btn.primary { background: #fff; color: #0A5C4D; border-color: #fff; box-shadow: none; }
.hero-card .btn.primary:hover { background: #F2FAF7; }
.hero-card .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .45); }
.hero-card .btn.ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.hero-globe { position: absolute; right: -40px; top: -30px; width: 300px; height: 300px; opacity: .18; pointer-events: none; }
.hero-globe circle, .hero-globe path { fill: none; stroke: #fff; stroke-width: 1.2; }
.week { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.day i { width: 100%; height: 42px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 800; color: var(--muted); font-size: 12px; }
.day.on i { background: var(--brand); border-color: var(--brand); color: #fff; }
.day.today i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.week-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.week-stats div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.week-stats b { display: block; font-size: 1.3rem; }
.week-stats span { font-size: 12px; color: var(--muted); }
.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mode-card { display: flex; flex-direction: column; overflow: hidden; color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; }
.mode-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); text-decoration: none; }
.mode-card .visual { height: 150px; display: flex; align-items: center; justify-content: center; gap: 14px; border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at 30% 20%, var(--brand-soft), transparent 60%), var(--surface-2); }
.mode-card .visual svg { height: 104px; width: auto; filter: drop-shadow(0 8px 14px rgba(15, 27, 45, .18)); }
.mode-card .visual .icon { width: 64px; height: 64px; color: var(--brand); }
.mode-card .txt { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mode-card .txt p { color: var(--muted); margin: 0; flex: 1; font-size: 14px; }
.mode-card .go { color: var(--brand); font-weight: 800; display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tp { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; color: var(--text); }
.tp:hover { border-color: var(--brand); text-decoration: none; }
.tp .row { gap: 10px; flex-wrap: nowrap; }
.tp .t-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-strong); display: flex; align-items: center; justify-content: center; flex: none; }
.tp b { display: block; font-size: 14.5px; }
.tp small { display: block; color: var(--muted); font-size: 12.5px; }
.cotd { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 20px 22px; }
.cotd .flag { width: 84px; height: 63px; border-radius: 10px; }
.cotd ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.cotd li { margin: 2px 0; }

/* ---------- quiz ---------- */
.quiz { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.quiz-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.progress { flex: 1; min-width: 160px; height: 9px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .3s; border-radius: inherit; }
.score { font-weight: 800; }
.stage { padding: 0; overflow: hidden; }
.stage .art { display: flex; align-items: center; justify-content: center; padding: 28px; min-height: 300px;
  background: radial-gradient(circle at 50% 35%, var(--surface) 0, var(--surface-2) 70%); }
.stage .art svg { max-width: min(100%, 420px); max-height: 340px; width: 100%; height: auto; filter: drop-shadow(0 10px 18px rgba(15, 27, 45, .2)); }
.stage .art-plate svg, .stage .art-text svg { max-width: min(100%, 520px); }
.stage .art-none { min-height: 220px; }
.prompt { padding: 18px 22px 6px; }
.prompt .q { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }
.prompt .clue-title { font-size: 1.04rem; margin-top: 4px; color: var(--text); }
.prompt .tag { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 22px 22px; }
.opts.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  cursor: pointer; text-align: left; font-weight: 700; min-height: 52px; transition: border-color .12s, background .12s, transform .06s; }
.opt:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.opt:active:not(:disabled) { transform: translateY(1px); }
.opt kbd { flex: none; }
.opt .opt-name { overflow: hidden; text-overflow: ellipsis; }
.opt.right { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.opt.dim { opacity: .5; }
.opt:disabled { cursor: default; }
.side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
.explain h3 { margin-bottom: 4px; }
.explain-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; }
.explain-foot .src { color: var(--muted); font-size: 12px; }
.verdict { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }
.verdict .icon { width: 22px; height: 22px; }
.next-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 0 22px 20px; flex-wrap: wrap; }
.instead { margin-top: 12px; padding: 11px 13px; border-radius: 11px; background: var(--surface-2); font-size: 13.5px; }
.summary { text-align: center; padding: 38px 20px; }
.summary .big { font-size: 3.2rem; font-weight: 800; letter-spacing: -.03em; color: var(--brand); }
.missed { text-align: left; margin-top: 18px; }
.missed li { margin: 6px 0; }

/* ---------- Street View ---------- */
.sv-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 300px; background: #0B111B; }
.sv-frame.tall { aspect-ratio: 16 / 10; min-height: 380px; }
.sv-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sv-pano { position: absolute; inset: 0; }
.sv-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #8996A8; font-size: 14px; font-weight: 600; }
.sv-cover { position: absolute; left: 0; top: 0; width: 320px; max-width: 70%; height: 96px; background: #0F1724; color: #C9D3E0;
  display: flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 13px; font-weight: 700; border-bottom-right-radius: 12px; z-index: 2; }
.sv-cover .icon { color: var(--accent); }
.sv-hint { position: absolute; left: 12px; bottom: 34px; z-index: 2; background: rgba(10, 16, 26, .82); color: #fff; padding: 7px 11px; border-radius: 10px;
  font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; pointer-events: none; backdrop-filter: blur(4px); }
.sv-hint span { display: inline-flex; align-items: center; gap: 6px; }
.sv-lazy { padding: 10px 0; }
.sv-lazy .sv-frame { border-radius: var(--radius-sm); overflow: hidden; }

/* ---------- trainer ---------- */
.trainer { display: grid; grid-template-columns: 304px minmax(0, 1fr); gap: 22px; align-items: start; }
.garage-col { display: flex; flex-direction: column; gap: 14px; }
.topic-list { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.topic-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); }
.topic-row:hover { background: var(--surface-2); text-decoration: none; }
.topic-row.on { background: var(--brand-soft); color: var(--brand-strong); }
.topic-row .tname { flex: 1; font-weight: 700; font-size: 14px; }
.topic-row small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.garage { padding: 18px; }
.garage h2 { font-size: 1.05rem; }
.garage .toggle { margin: 12px 0 0; }
.deck { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.deck li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; background: var(--surface-2); }
.deck li .who { flex: 1; min-width: 0; }
.deck li .who b { display: block; font-size: 13.5px; }
.deck li .who small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.deck .meter { margin-top: 5px; height: 4px; }
.deck-size { margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.deck-size .row { gap: 6px; }
.range-row { flex-wrap: nowrap; margin-top: 8px; }
.deck-range { flex: 1; min-width: 0; accent-color: var(--brand); }
.step-btn { width: 30px; height: 30px; flex: none; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
  font-size: 17px; font-weight: 800; line-height: 1; cursor: pointer; color: var(--text); }
.step-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.step-btn:disabled { opacity: .4; cursor: default; }
.flags { display: inline-flex; gap: 3px; }
.car-info { padding: 18px 22px; }
.car-info .look { margin-top: 8px; padding: 11px 13px; background: var(--brand-soft); border-radius: 11px; font-size: 14px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: var(--radius); background: var(--good-soft); color: var(--good); font-weight: 700; margin-bottom: 14px; flex-wrap: wrap; }
.run-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; margin-bottom: 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; transition: background .2s, border-color .2s; }
.run-bar > .icon { width: 20px; height: 20px; color: var(--accent); }
.run-bar b { font-size: 1.12rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.run-bar .run-best { color: var(--muted); }
.run-bar .run-best b { color: var(--text); font-size: 1rem; }
.run-bar.record { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); }
.run-note { font-weight: 700; color: var(--accent-ink); }
.run-note.bad { color: var(--bad); }
.run-badge { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px 1px 4px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent-ink); font-size: 12px; font-weight: 800; }
.run-badge .icon { width: 13px; height: 13px; }
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.lib-item .who { flex: 1; min-width: 0; }
.lib-item .who small { color: var(--muted); display: block; }

/* ---------- difficulty and typed answers ---------- */
.difficulty { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--brand-strong); box-shadow: var(--shadow-sm); }
.seg-note { color: var(--muted); font-size: 13px; }
.type-wrap { padding: 12px 22px 22px; }
.type-answer { max-width: 540px; }
.suggest { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 8px; overflow: hidden; box-shadow: var(--shadow); }
.suggest-item { display: flex; align-items: center; gap: 10px; padding: 9px 13px; cursor: pointer; font-weight: 700; }
.suggest-item + .suggest-item { border-top: 1px solid var(--line); }
.suggest-item.on, .suggest-item:hover { background: var(--brand-soft); }
.type-row { display: flex; gap: 8px; }
.type-row input.type-box { flex: 1; width: auto; min-width: 0; font-size: 16px; padding: 12px 14px; }
.type-box.right { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.type-box.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.type-hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

/* ---------- daily five ---------- */
.daily-strip { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-top: 18px; color: var(--text); }
.daily-strip:hover { border-color: var(--brand); text-decoration: none; }
.daily-strip .ds-icon { width: 46px; height: 46px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; flex: none; }
.daily-strip .ds-icon .icon { width: 23px; height: 23px; }
.daily-strip .txt { flex: 1; min-width: 0; }
.daily-strip .txt b { display: block; font-size: 15.5px; }
.daily-strip .txt small { color: var(--muted); font-size: 13.5px; }
.daily-rounds { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 8px; align-items: stretch; margin-bottom: 16px; }
.daily-rounds .dr { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 7px 6px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; }
.daily-rounds .dr b { color: var(--text); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.daily-rounds .dr.now { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.daily-rounds .dr.good b, .good-text { color: var(--good); }
.daily-rounds .dr.miss b { color: var(--accent-ink); }
.daily-rounds .total { display: flex; align-items: center; justify-content: flex-end; gap: 2px; padding: 0 6px 0 10px; font-variant-numeric: tabular-nums; }
.daily-rounds .total b { font-size: 1.2rem; }
.daily-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.map-card { display: flex; flex-direction: column; overflow: hidden; }
.daily-map { position: relative; flex: 1; min-height: 340px; isolation: isolate; background: var(--map-sea); }
.leaflet-container.daily-map { font: inherit; background: var(--map-sea); }
.daily-map.leaflet-grab { cursor: crosshair; }
.daily-map .land { fill: var(--map-land); fill-opacity: 1; stroke: var(--map-border); stroke-width: .8px; stroke-opacity: 1; }
.daily-map .guess-pin { fill: var(--brand); fill-opacity: 1; stroke: #fff; stroke-width: 2.5px; stroke-opacity: 1; }
.daily-map .answer-pin { fill: var(--accent); fill-opacity: 1; stroke: #fff; stroke-width: 2.5px; stroke-opacity: 1; }
.daily-map .guess-line { stroke: var(--text); stroke-width: 2px; stroke-dasharray: 6 6; stroke-opacity: .75; fill: none; }
.daily-map .leaflet-bar { border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.daily-map .leaflet-bar a { background: var(--surface); color: var(--text); border-bottom-color: var(--line); }
.daily-map .leaflet-bar a:hover { background: var(--surface-2); }
.map-foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.map-foot > .small { flex: 1; min-width: 180px; }
.daily-verdict { flex: 1 1 100%; }
.daily-verdict + .btn { margin-left: auto; }
.daily-learn { margin-top: 18px; }
.daily-score .big { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; color: var(--brand); line-height: 1.1; font-variant-numeric: tabular-nums; }
.daily-score .big span { font-size: 1.1rem; color: var(--muted); font-weight: 700; letter-spacing: 0; }
.daily-score .squares { font-size: 1.4rem; letter-spacing: 2px; margin: 8px 0 4px; }
.share-box { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
  font: 600 14px/1.55 var(--font); white-space: pre-wrap; word-break: break-word; }
.daily-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.daily-stats div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.daily-stats b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.daily-stats span { font-size: 12px; color: var(--muted); }

/* ---------- narrow it down ---------- */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.step { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; }
.step .thumb { background: var(--surface-2); border-radius: 11px; display: flex; align-items: center; justify-content: center; height: 96px; overflow: hidden; }
.step .thumb svg { max-height: 86px; max-width: 130px; width: auto; height: auto; }
.step .thumb .icon { width: 34px; height: 34px; color: var(--muted); }
.step .arrow { color: var(--muted); font-size: 13px; }
.cands { margin-top: 10px; }
.cands .chip.out { opacity: .35; text-decoration: line-through; }

/* ---------- library (study) ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { border: 0; background: transparent; padding: 7px 15px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.region-block { margin-bottom: 24px; }
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 8px; }
.country-tile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--text); font-weight: 600; font-size: 14px; }
.country-tile:hover { border-color: var(--brand); text-decoration: none; }
.country-tile small { color: var(--muted); margin-left: auto; font-size: 12px; font-weight: 600; }
.clue-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.clue-card { display: flex; flex-direction: column; overflow: hidden; }
.clue-card .art { display: flex; align-items: center; justify-content: center; height: 170px; padding: 14px; background: var(--surface-2); }
.clue-card .art svg { max-height: 150px; max-width: 100%; width: auto; height: auto; }
.clue-card .body { padding: 15px 17px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.clue-card .body p { color: var(--muted); font-size: 14px; margin: 0; }
.clue-card .sv-lazy { padding: 0; }
.country-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.country-head .flag { width: 56px; height: 42px; border-radius: 7px; }
.facts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cat-group { margin: 28px 0 12px; display: flex; align-items: center; gap: 8px; }
.search { max-width: 380px; }

/* ---------- my cards / progress ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
table.stats { width: 100%; border-collapse: collapse; font-size: 14px; }
table.stats th, table.stats td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.stats th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
table.stats td.num { font-variant-numeric: tabular-nums; }
.toggle { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.toggle input { width: 17px; height: 17px; accent-color: var(--brand); }
.empty { text-align: center; padding: 38px 20px; color: var(--muted); }
.key-row { flex-wrap: nowrap; margin-top: 10px; }
.key-row input { flex: 1; min-width: 0; }
details.steps code { font-size: 12.5px; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); word-break: break-all; }
details.steps { margin-top: 10px; }
details.steps summary { cursor: pointer; font-weight: 700; }
details.steps ol { padding-left: 20px; margin: 10px 0; }
details.steps li { margin: 6px 0; }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(8, 14, 24, .5); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: 18px; width: min(880px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 20px; overflow: auto; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 11px 17px; border-radius: 12px;
  font-weight: 700; opacity: 0; transition: .2s; pointer-events: none; z-index: 70; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .quiz, .trainer, .two-col, .dash-grid, .daily-grid { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .mode-cards { grid-template-columns: minmax(0, 1fr); }
  .mode-card { flex-direction: row; }
  .mode-card .visual { height: auto; width: 160px; flex: none; border-bottom: 0; border-right: 1px solid var(--line); }
  .mode-card .visual svg { height: 80px; }
}
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; width: 100%; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); }
  .sidebar .brand, .side-foot, .hide-mobile { display: none !important; }
  .side-nav { flex-direction: row; justify-content: space-around; width: 100%; gap: 0; }
  .side-nav a { flex: 1; flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 11px; border-radius: 10px; }
  .side-nav a.active { background: transparent; color: var(--brand); }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .mobile-bar .brand { padding: 0; font-size: 1.05rem; }
  .mobile-bar .brand-mark svg { width: 30px; height: 30px; }
  .content { padding-bottom: 70px; }
  .main { padding: 20px 16px 32px; }
  .footer { padding: 16px; }
  .page-head h1, .dash-head h1 { font-size: 1.6rem; }
  .hero-card h2, .hero-card p { max-width: 100%; }
  .hero-globe { width: 200px; height: 200px; right: -50px; top: -40px; }
  .cotd { grid-template-columns: auto minmax(0, 1fr); }
  .cotd .btn { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .opts { grid-template-columns: 1fr; padding: 12px 16px 18px; }
  .opts.many { grid-template-columns: 1fr 1fr; padding: 12px 16px 18px; }
  .type-wrap { padding: 12px 16px 18px; }
  .prompt { padding: 16px 16px 4px; }
  .next-row { padding: 0 16px 18px; }
  .stage .art { min-height: 220px; padding: 18px; }
  .sv-frame { min-height: 250px; aspect-ratio: 4 / 3; }
  .sv-cover { width: 230px; height: 88px; }
  .step { grid-template-columns: 90px minmax(0, 1fr); }
  .step .thumb { height: 70px; }
  .step .thumb svg { max-height: 62px; max-width: 84px; }
  .clue-list { grid-template-columns: 1fr; }
  .mode-card { flex-direction: column; }
  .mode-card .visual { width: auto; height: 120px; border-right: 0; border-bottom: 1px solid var(--line); }
  .week-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .key-row { flex-wrap: wrap; }
  .key-row input { flex-basis: 100%; }
  table.stats { font-size: 13px; }
  table.stats th, table.stats td { padding: 9px 5px; }
  table.stats th { letter-spacing: .03em; }
  .daily-rounds { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .daily-rounds .total { grid-column: 1 / -1; justify-content: center; padding: 2px 0 0; }
  .daily-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-map { min-height: 300px; }
  .daily-strip { flex-wrap: wrap; }
  .daily-strip .txt { flex-basis: calc(100% - 62px); }
  .daily-strip .btn { width: 100%; }
}

.page-actions .search { width: 320px; max-width: 100%; }
