/* Study platform UI — palette, type and cards follow the original corvinus-client dashboard. */
:root {
  --bg: #f5f4f0; --surface: #ffffff; --surface-2: #efede7; --ink: #1d1c1a; --muted: #625f58;
  --faint: #6e6a63; --line: #e3e0d8; --accent: #2e5e4e; --accent-ink: #ffffff; --accent-soft: #e2ece7;
  --danger: #a83e2b; --danger-soft: #f6e4df; --danger-ink: #ffffff; --warn: #8a5a0f; --warn-soft: #f5ead6; --ok: #2b6f46;
  --ai: #6a3fb0; --ai-soft: #efe6fb; --gold: #e2b267;
  --shadow: 0 1px 2px rgba(30,28,24,.05), 0 4px 16px rgba(30,28,24,.04);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.18);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --radius: 14px; --radius-s: 10px; --sidebar: 260px; --tabbar: 64px;
  /* 8px spacing scale */
  --s-05: 4px; --s-1: 8px; --s-15: 12px; --s-2: 16px; --s-3: 24px; --s-4: 32px; --s-5: 40px; --s-6: 48px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --input-line: #8f8a80;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131312; --surface: #1c1b19; --surface-2: #252421; --ink: #ecebe7; --muted: #aaa79f;
    --faint: #98958d; --line: #2f2e2a; --accent: #7fbfa6; --accent-ink: #10201a; --accent-soft: #1f302a;
    --danger: #ec8a77; --danger-soft: #3a221d; --danger-ink: #1f0c08; --kL: #e2c06a; --kS: #6fcdb6; --warn: #e2b267; --warn-soft: #362a17; --ok: #7cc79a;
    --ai: #c4a6f2; --ai-soft: #2c2140; --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 20px 60px rgba(0,0,0,.5); --input-line: #5e5b55;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131312; --surface: #1c1b19; --surface-2: #252421; --ink: #ecebe7; --muted: #aaa79f;
  --faint: #98958d; --line: #2f2e2a; --accent: #7fbfa6; --accent-ink: #10201a; --accent-soft: #1f302a;
  --danger: #ec8a77; --danger-soft: #3a221d; --danger-ink: #1f0c08; --kL: #e2c06a; --kS: #6fcdb6; --warn: #e2b267; --warn-soft: #362a17; --ok: #7cc79a;
  --ai: #c4a6f2; --ai-soft: #2c2140; --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 20px 60px rgba(0,0,0,.5); --input-line: #5e5b55;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  background: var(--bg); color: var(--ink); min-height: 100vh;
  font: 14.5px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
a.link, .prose a, .md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; cursor: pointer; }
img, svg { flex: none; }
.tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.stack { display: grid; gap: var(--s-2); grid-template-columns: minmax(0, 1fr); } .stack-s { display: grid; gap: var(--s-1); grid-template-columns: minmax(0, 1fr); }
.hstack > .main { flex: 1; min-width: 0; }
h1, h2, h3, .card-head > *, .row .title { overflow-wrap: anywhere; }
.hstack { display: flex; gap: var(--s-1); align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
[hidden] { display: none !important; }

/* Focus: visible ring for keyboard users only */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
#view:focus-visible { outline: none; }
.btn:focus-visible, .input:focus-visible, .tab:focus-visible, .nav-item:focus-visible, .row:focus-visible { outline: none; box-shadow: var(--ring); }
.skip { position: absolute; left: var(--s-1); top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: var(--s-1) var(--s-2); border-radius: var(--radius-s); }
.skip:focus { top: var(--s-1); }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.app.bare { grid-template-columns: minmax(0, 1fr); }
.app.bare .sidebar, .app.bare .tabbar, .app.bare .topbar { display: none; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line);
  padding: var(--s-3) var(--s-15) var(--s-2); display: flex; flex-direction: column; gap: 2px;
}
main { padding: var(--s-4) var(--s-5) 96px; max-width: 1180px; width: 100%; min-width: 0; margin: 0 auto; }
.app.bare main { max-width: 1040px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px var(--s-2); font-weight: 650; letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.nav-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: var(--s-2) 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted);
  transition: background .15s, color .15s; border: 0; background: none; width: 100%; text-align: left; min-height: 36px;
}
.nav-item svg { width: 17px; height: 17px; opacity: .85; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav-item .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin: 0 4px; }
.nav-item .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.nav-item .count { font-size: 11px; font-weight: 650; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 6px; min-width: 18px; text-align: center; }
.search-btn {
  display: flex; align-items: center; gap: 8px; margin: 0 0 var(--s-1); padding: 8px 10px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--faint); text-align: left; width: 100%;
}
.search-btn kbd { margin-left: auto; }
kbd { font: 11px ui-monospace, SFMono-Regular, monospace; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--muted); background: var(--surface-2); }
.side-foot { margin-top: auto; padding-top: var(--s-2); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
.side-foot > * { min-width: 0; }
.side-foot .lang-switch { display: flex; }
.side-foot .lang-switch button { font-size: 12px; padding: 6px 0; }
.side-foot .who { font-size: 12px; color: var(--faint); padding: 0 10px; display: flex; gap: 6px; align-items: center; }

.theme-switch { display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-s); background: var(--surface-2); }
.theme-switch button { flex: 1; border: 0; background: none; padding: 6px 0; border-radius: 8px; color: var(--muted); font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 5px; transition: background .15s, color .15s; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.topbar { display: none; }
.tabbar { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: var(--s-1); position: sticky; top: 0; z-index: 20;
    padding: calc(env(safe-area-inset-top) + 10px) var(--s-2) 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line);
  }
  .topbar .brand { padding: 0; flex: 1; min-width: 0; font-size: 15px; }
  .topbar .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px); background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11px; color: var(--faint); border-radius: 10px; position: relative; min-height: 48px; justify-content: center; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .tabbar .count { position: absolute; top: 2px; left: calc(50% + 6px); font-size: 10px; background: var(--danger); color: var(--danger-ink); border-radius: 999px; padding: 0 5px; line-height: 16px; }
  main { padding: var(--s-3) var(--s-2) calc(var(--tabbar) + 48px + env(safe-area-inset-bottom)); overflow-x: clip; }
  .app.bare main { padding-bottom: var(--s-6); }
}

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-3); flex-wrap: wrap; }
.page-head > * { min-width: 0; max-width: 100%; }
.eyebrow { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; margin: 0; font-weight: 680; text-wrap: balance; }
h2 { font-size: 15px; margin: 0; font-weight: 640; letter-spacing: -.005em; }
h3 { font-size: 14px; margin: 0; font-weight: 620; }
.lede { color: var(--muted); font-size: 15px; margin: var(--s-1) 0 0; max-width: 62ch; text-wrap: pretty; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: var(--s-1); }
.back:hover { color: var(--ink); }
@media (max-width: 900px) { h1 { font-size: 23px; } .page-head { margin-bottom: var(--s-2); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9px; min-height: 36px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 540; white-space: nowrap;
  transition: transform .1s, background .15s, filter .15s, box-shadow .15s; color: var(--ink); text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); color: var(--danger-ink); border-color: transparent; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.ai { background: var(--ai-soft); color: var(--ai); border-color: transparent; }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { padding: 12px 20px; min-height: 46px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: 36px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 15px; height: 15px; }
.btn-row { display: flex; gap: var(--s-1); flex-wrap: wrap; align-items: center; }
.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards & grid ---------- */
.grid { display: grid; gap: var(--s-2); }
.grid > * { min-width: 0; }
.cols-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: var(--s-3); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-2) 18px 10px; gap: 10px; }
.card-head > * { min-width: 0; }
.card-head .meta, .meta { color: var(--faint); font-size: 12.5px; }
.card-foot { padding: 0 18px var(--s-2); }
@media (max-width: 900px) { .cols-2 { grid-template-columns: minmax(0, 1fr); } .card.pad { padding: 18px; } }

/* Hero (next deadline) */
.hero { padding: 22px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c, var(--accent)); }
.hero .label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hero .title { font-size: 21px; font-weight: 650; letter-spacing: -.015em; line-height: 1.3; text-wrap: balance; }
.hero .when { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hero .count { font-size: 34px; font-weight: 700; letter-spacing: -.03em; }
.stats { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .hero .count { font-size: 28px; } }

/* ---------- Chips & badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 2px 8px 2px 6px; border-radius: 999px; background: var(--surface-2); max-width: 100%; min-width: 0; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; letter-spacing: .02em; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge.new, .badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.done { background: var(--surface-2); color: var(--ok); }
.badge.ai { background: var(--ai-soft); color: var(--ai); }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0 8px 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-s); transition: background .12s; min-width: 0; }
a.row:hover, button.row:hover { background: var(--surface-2); }
button.row { width: 100%; border: 0; background: none; text-align: left; }
.row .main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.row .name { font-weight: 540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .name.wrap { white-space: normal; }
.row .sub { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .end { flex: none; color: var(--muted); font-size: 12.5px; text-align: right; display: flex; gap: 6px; align-items: center; }
.row.done .name { color: var(--muted); }
.row .actions { display: flex; gap: 4px; flex: none; }
.group-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 12px 10px 4px; }
.datebox { min-width: 44px; flex: none; text-align: center; border-radius: var(--radius-s); background: var(--surface-2); padding: 5px 6px; line-height: 1.15; }
.datebox .m { font-size: 10.5px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.datebox .d { font-size: 17px; font-weight: 680; }
.datebox.over { background: var(--danger-soft); color: var(--danger); }
.datebox.over .m { color: var(--danger); }
.datebox.none .d { font-size: 13px; color: var(--faint); }
/* Phone: a long trailing badge/label must not squeeze the row's main text — let it wrap below instead (placed after the base .row rules so it wins by source order) */
@media (max-width: 640px) {
  .row { flex-wrap: wrap; row-gap: 6px; }
  .row .main { min-width: 55%; }
  .row .end { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
  .row .end .badge { white-space: normal; text-align: right; }
}
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 7px; align-self: flex-start; }
.unread-dot.read { background: transparent; }

.ficon { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; font-size: 9.5px; font-weight: 750; letter-spacing: .04em; background: var(--surface-2); color: var(--muted); }
.ficon.pdf { background: #f6e1dc; color: #a8381f; }
.ficon.ppt { background: #f7e6d6; color: #9e4914; }
.ficon.doc { background: #dfe7f5; color: #2c58a0; }
.ficon.xls { background: #dcefe2; color: #1f6d42; }
.ficon.task { background: var(--accent-soft); color: var(--accent); }
.ficon.link { background: #e8e2f3; color: #6a4aa5; }
.ficon.note { background: var(--ai-soft); color: var(--ai); }
:root[data-theme="dark"] .ficon.pdf { background: #3b221d; color: #f09b86; }
:root[data-theme="dark"] .ficon.ppt { background: #3a2a1c; color: #eea76f; }
:root[data-theme="dark"] .ficon.doc { background: #1d2738; color: #8fb0ea; }
:root[data-theme="dark"] .ficon.xls { background: #1c3124; color: #7fcf9b; }
:root[data-theme="dark"] .ficon.link { background: #2a2338; color: #b9a2e6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ficon.pdf { background: #3b221d; color: #f09b86; }
  :root:not([data-theme="light"]) .ficon.ppt { background: #3a2a1c; color: #eea76f; }
  :root:not([data-theme="light"]) .ficon.doc { background: #1d2738; color: #8fb0ea; }
  :root:not([data-theme="light"]) .ficon.xls { background: #1c3124; color: #7fcf9b; }
  :root:not([data-theme="light"]) .ficon.link { background: #2a2338; color: #b9a2e6; }
}

/* ---------- Courses ---------- */
.courses { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.course-card { padding: var(--s-2) 18px; display: flex; flex-direction: column; gap: 10px; transition: transform .15s var(--ease), box-shadow .15s; position: relative; overflow: hidden; min-height: 132px; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(30,28,24,.08); }
.course-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); }
.course-card .t { font-weight: 640; line-height: 1.3; text-wrap: balance; }
.course-card .bottom { display: flex; justify-content: space-between; align-items: end; margin-top: auto; gap: 8px; }
.grade { font-size: 22px; font-weight: 680; letter-spacing: -.02em; }
.grade.none { color: var(--faint); font-size: 14px; font-weight: 500; }
.bar { height: 6px; border-radius: 9px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; background: var(--c, var(--accent)); }
.bar i.lost { background: var(--danger); opacity: .7; }
.type { font-size: 12px; color: var(--muted); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Lecture / seminar marker */
.type-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 20px; }
.kind-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.kind-badge.kL { color: var(--kL, #7a5b16); border-color: color-mix(in srgb, #caa23a 55%, var(--line)); background: color-mix(in srgb, #caa23a 12%, transparent); }
.kind-badge.kS { color: var(--kS, #1f6a5a); border-color: color-mix(in srgb, #2f9e86 50%, var(--line)); background: color-mix(in srgb, #2f9e86 12%, transparent); }
/* Subject with both a lecture and a seminar: one card, a tappable row each, a thin line between */
.subject-pair { gap: 8px; }
.course-card.subject-pair:hover { transform: none; box-shadow: none; } /* the card is a container; only its rows are links */
.subject-pair .subject-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.subject-pair .subject-head .t { font-weight: 640; line-height: 1.3; }
.pair-rows { display: flex; flex-direction: column; margin-top: auto; }
.pair-div { height: 1px; background: var(--line); margin: 2px 0; }
.pair-row { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-radius: var(--radius-s); color: inherit; min-width: 0; }
.pair-row:hover { background: var(--surface-2); }
.pair-row .pair-mid { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); }
.pair-row .grade { font-size: 16px; font-weight: 640; }
.pair-row .grade.none { font-size: 12px; }
.pair-row .pair-go { color: var(--faint); display: inline-flex; }
.stack-xs { display: grid; gap: 6px; }
/* Section headers inside the Files disclosures */
.fsec { font-weight: 600; }
.row.compact { padding: 6px 2px; }
/* Flashcard decks */
.deck-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
/* Study by week: one card per class week with flashcards / reels / notes side by side */
.week-list { gap: 12px; }
.week-card h2 { font-size: 16px; line-height: 1.3; flex: none; }
.week-card .wk-title { min-width: 0; }
.week-card.latest { box-shadow: inset 3px 0 0 var(--accent); }
.week-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.week-acts .wa { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); min-width: 0; }
.week-acts .wa-h { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.week-acts .btn-row { margin-top: auto; flex-wrap: wrap; }
.warn-t { color: var(--warn); font-weight: 600; }
.wk-prog { display: flex; align-items: center; gap: 10px; }
.wk-prog .progress { flex: 1; margin: 0; }
.wk-prog.done .meta { color: var(--ok); font-weight: 600; }
.wk-prog.done .progress i { background: var(--ok); }
.wa-ok { display: inline-flex; color: var(--ok); margin-left: 2px; }
.mk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mk-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 4px; }
.mk-item.fixed { color: var(--muted); }
.mk-q { font-weight: 600; }
.mk-a { color: var(--muted); }
.mk-a p { margin: 0; }
.mk-fixed summary { cursor: pointer; color: var(--muted); font-size: 13.5px; margin-bottom: 8px; }
.wk-files { display: flex; flex-wrap: wrap; gap: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.file-chip:hover { color: var(--ink); border-color: var(--accent); }
.file-chip .ell { min-width: 0; }
.wk-shaky { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--warn); }
.wk-shaky .main { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 6px; }
.next-class { border-left: 3px solid var(--accent); margin-bottom: 14px; }
.next-class .ico-round { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); flex: none; }
.next-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.next-list li { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.next-list li .main { flex: 1; min-width: 0; }
.next-list li.done { color: var(--muted); }
.next-list li.done svg { color: var(--ok); }
.quiz-card .quiz-q { font-size: 19px; line-height: 1.4; margin: 4px 0; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt { text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.quiz-opt:hover:not(:disabled) { border-color: var(--accent); }
.quiz-opt.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.quiz-opt.bad { border-color: var(--danger); background: var(--danger-soft); }
.quiz-opt:disabled { cursor: default; }
.quiz-why { color: var(--muted); margin: 0; }
.quiz-done { text-align: center; align-items: center; }
.quiz-score { font-size: 44px; font-weight: 700; }
.quiz-missed { text-align: left; margin: 0; padding-left: 18px; color: var(--muted); }
.wk-missed { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
/* v1.18: week tools, quiz guess, explain it back, focus bar, streak, gap cards, practice-exam marking */
.wk-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wk-tools .meta { display: inline-flex; align-items: center; gap: 4px; }
.quiz-opt.picked { border-color: var(--accent); box-shadow: var(--ring); }
.quiz-conf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quiz-conf .small { margin-right: auto; }
.cal-row { display: grid; grid-template-columns: 7.5em 1fr auto; align-items: center; gap: 10px; }
.cal-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.cal-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.cal-bar.unsure i { background: var(--faint); }
.cal-main { border-left: 3px solid var(--accent); }
.cal-main h2, .stack h3.ell { margin: 0; font-size: 16px; }
.notice.cram { display: grid; gap: 8px; margin: 4px 0; }
.cram-days .chip-btn { white-space: nowrap; text-decoration: none; }
.cram-days { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.cram-days li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cram-days .meta { min-width: 6.5em; }
.cram-alert { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; margin-bottom: 12px; }
.cram-alert .main { flex: 1; min-width: 0; }
/* v1.21: error types, concept maps */
.mk-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.mk-tags .chip-btn { font-size: 12px; padding: 2px 10px; }
.mk-filter { margin-bottom: 12px; }
.mk-filter .chip-btn b { font-weight: 700; margin-left: 2px; }
.mk-advice h2 { margin: 0; font-size: 16px; }
.mk-advice p { margin: 0; }
.mk-advice .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mk-advice .row .main { flex: 1; min-width: 12em; }
.cmap { margin: 0 0 16px; }
.cmap-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cmap-svg { display: block; max-width: 100%; min-width: 560px; height: auto; margin: 0 auto; font-family: inherit; }
@media (min-width: 761px) { .cmap-svg { min-width: 0; } }
.cmap figcaption { margin-top: 6px; text-align: center; }
.cm-edge line { stroke: var(--faint); stroke-width: 1.4; }
.cm-edge rect { fill: var(--surface); }
.cm-edge text { fill: var(--muted); font-size: 10.5px; text-anchor: middle; font-style: italic; }
.cm-node rect { fill: var(--surface); stroke: var(--accent); stroke-width: 1.4; }
.cm-node text { fill: var(--ink); font-size: 12px; text-anchor: middle; font-weight: 600; }
.cm-main rect { fill: var(--accent); stroke: none; }
.cm-main text { fill: var(--accent-ink); font-size: 13px; font-weight: 700; }
.cm-example rect { fill: var(--surface-2); stroke: var(--line); stroke-dasharray: 4 3; }
.cm-example text { font-weight: 500; fill: var(--muted); }
.xp-text { min-height: 180px; resize: vertical; }
#xp-mic.on { border-color: var(--danger); color: var(--danger); }
.xp-result .quiz-score { font-size: 36px; margin-right: 12px; }
.xp-result h3 { font-size: 15px; margin: 0 0 6px; }
.xp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.xp-list li { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.xp-list.ok li { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); display: flex; gap: 6px; align-items: flex-start; }
.xp-list.ok svg { color: var(--ok); flex: none; margin-top: 3px; }
.xp-list.bad s { color: var(--danger); }
.focus-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: 10px;
  width: min(460px, calc(100vw - 32px)); padding: 8px 10px 8px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: 0 8px 28px rgba(0, 0, 0, .25); }
.focus-bar b { font-size: 16px; }
.focus-bar .btn { color: inherit; }
.focus-bar.paused b { opacity: .6; }
@media (max-width: 760px) { .focus-bar { bottom: calc(72px + env(safe-area-inset-bottom)); } }
.streak-card h2 { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 16px; }
.streak-card h2 svg { color: #d9822b; }
.streak-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.streak-week .sd { display: grid; justify-items: center; gap: 3px; color: var(--faint); }
.streak-week .sd i { width: 100%; max-width: 34px; height: 8px; border-radius: 999px; background: var(--surface-2); }
.streak-week .sd.on i { background: var(--accent); }
.streak-week .sd.today small { color: var(--ink); font-weight: 700; }
.input.sm { padding: 4px 8px; font-size: 13px; width: auto; min-height: 0; }
.gap-btn { position: absolute; z-index: 70; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.chip-btn { font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.chip-btn.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.plan-pick { margin-bottom: 12px; }
.exam-missed { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.exam-missed h3 { margin: 0; font-size: 15px; }
.exam-missed { grid-template-columns: minmax(0, 1fr); }
.exam-missed .list { min-width: 0; }
.exam-missed li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.exam-missed .main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-missed .btn { flex: none; }
#h-goal { width: auto; min-width: 8.5em; flex: none; }
/* v1.19: mixed practice source line, timed practice exam */
.quiz-from { margin: 0; display: inline-flex; align-items: center; gap: 4px; }
.es-clock { position: sticky; top: 8px; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; margin-bottom: 12px;
  border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.es-clock b { font-size: 18px; }
.es-clock.low b { color: #ff9b85; }
.es-q .md p:last-child { margin-bottom: 0; }
.es-q.right { box-shadow: inset 3px 0 0 var(--ok); }
.es-q.partly { box-shadow: inset 3px 0 0 var(--warn); }
.es-q.wrong { box-shadow: inset 3px 0 0 var(--danger); }
.es-yours, .es-key { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.es-yours p { margin: 4px 0 0; white-space: pre-wrap; }
.btn.on-right { background: var(--ok); color: var(--bg); border-color: transparent; }
.btn.on-partly { background: var(--warn); color: var(--bg); border-color: transparent; }
.btn.on-wrong { background: var(--danger); color: var(--danger-ink); border-color: transparent; }
.es-total { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); }
@media (max-width: 760px) { .es-total { bottom: calc(68px + env(safe-area-inset-bottom)); } }
.wk-missed .main { flex: 1; min-width: 0; }
.wk-due { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; }
.wk-due li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink); }
.wk-due li.done { color: var(--muted); text-decoration: line-through; }
.wk-due li.late { color: var(--danger); }
.wk-due li .meta { white-space: nowrap; }
@media (max-width: 640px) { .wk-all { order: 9; } .wk-missed { flex-wrap: wrap; } }
.wk-exam { color: var(--muted); }
.exam-ranges { gap: 10px; margin-bottom: 14px; }
.exam-range { border-left: 3px solid var(--warn); }
.exam-range .main { min-width: 0; }
.exam-range .ico-round { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); flex: none; }
@media (max-width: 640px) { .exam-range > .hstack { flex-wrap: wrap; } .week-card .wk-exam { display: none; } }
@media (max-width: 640px) {
  .week-acts { grid-template-columns: 1fr; gap: 8px; }
  .week-acts .wa { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 2px; align-items: center; padding: 8px 10px; }
  .week-acts .wa > .meta { grid-row: 2; font-size: 12.5px; }
  .week-acts .btn-row { grid-column: 2; grid-row: 1 / 3; margin: 0; flex-wrap: nowrap; }
}
@media (max-width: 400px) { .week-acts .btn-row { grid-column: 1 / -1; grid-row: 3; flex-wrap: wrap; } }
.deck { min-height: 0; }
.deck h2 { font-size: 16px; line-height: 1.3; min-width: 0; }
.deck-stats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 20px; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-sm { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.chip-sm b { color: var(--ink); font-weight: 650; }
.topics { display: flex; gap: 5px; flex-wrap: wrap; }
.topic-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 2px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-tag.faint { color: var(--faint); }
.topic-tag .dot-due { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); flex: none; }
/* Notes grouped by class */
.note-group + .note-group { margin-top: var(--s-2); }
.course-hero { padding: var(--s-1) 0 0; margin-bottom: var(--s-2); border-bottom: 1px solid var(--line); }
.course-hero .stripe { width: 40px; height: 4px; border-radius: 4px; background: var(--c); margin-bottom: var(--s-15); }

/* Tabs / segmented */
.tabs { display: flex; gap: 4px; margin-top: 18px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 8px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 540; white-space: nowrap; min-height: 36px; display: inline-flex; align-items: center; }
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.tab .n { color: var(--faint); font-weight: 450; margin-left: 4px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-s); background: var(--surface-2); flex: none; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 12.5px; color: var(--muted); min-height: 30px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }

/* ---------- Forms ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: var(--s-2); align-items: center; flex-wrap: wrap; }
.input, select.input, textarea.input {
  flex: 1; min-width: 0; width: 100%; padding: 10px 12px; border-radius: var(--radius-s); border: 1px solid var(--input-line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s; min-height: 42px;
}
textarea.input { resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input.mono { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 13.5px; }
.field { display: grid; gap: 6px; margin-bottom: var(--s-2); }
.field > label, .label { font-weight: 600; font-size: 13.5px; }
.help { color: var(--muted); font-size: 12.5px; }
.input-wrap { position: relative; display: flex; }
.input-wrap .input { padding-right: 76px; }
.input-wrap .btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 14px; cursor: pointer; background: var(--surface); }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.switch { position: relative; width: 40px; height: 24px; flex: none; appearance: none; -webkit-appearance: none; background: var(--line); border-radius: 999px; cursor: pointer; transition: background .15s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .18s var(--ease); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { box-shadow: var(--ring); outline: none; }
.setting-row { display: flex; align-items: center; gap: var(--s-2); padding: 12px 0; border-top: 1px solid var(--line); }
.setting-row:first-child { border-top: 0; }
.setting-row .main { flex: 1; min-width: 0; }
.setting-row .main b { display: block; font-weight: 560; }
.setting-row .main span { color: var(--muted); font-size: 12.5px; }

/* ---------- States ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-s); }
.sk-line { height: 12px; margin: 8px 0; }
.sk-row { display: flex; gap: 12px; align-items: center; padding: 10px; }
.sk-row .skeleton:first-child { width: 40px; height: 40px; flex: none; }
.sk-row .sk-grow { flex: 1; display: grid; gap: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { padding: var(--s-3) 18px; color: var(--muted); font-size: 14px; text-align: center; display: grid; justify-items: center; gap: var(--s-1); }
.empty .em-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; font-size: 22px; }
.empty b { color: var(--ink); font-weight: 600; }
.empty p { margin: 0; max-width: 42ch; text-wrap: pretty; }
.empty.compact { padding: var(--s-2) 18px; text-align: left; justify-items: start; }
.error-box { padding: var(--s-2) 18px; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); display: flex; gap: var(--s-15); align-items: center; flex-wrap: wrap; }
.error-box .btn { margin-left: auto; }
.notice { padding: 12px 14px; border-radius: var(--radius-s); font-size: 13.5px; margin: var(--s-1) 0; display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); color: var(--ink); }
.notice > .ico { flex: none; font-size: 16px; line-height: 1.3; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.err { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--accent-soft); color: var(--accent); }
.notice.ai { background: var(--ai-soft); color: var(--ai); }
.notice b { font-weight: 650; }
.fade-in { animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
#adm > .stack { grid-template-columns: minmax(0, 1fr); }
.admin-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-filter .seg { flex-wrap: wrap; }
.admin-filter .input { flex: 1 1 220px; }
.badge.life { background: var(--ai-soft); color: var(--ai); }
.admin-stats { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (max-width: 520px) { .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .admin-stats .kpi { font-size: 19px; } }
.danger-text { color: var(--danger); }
.admin-stats .kpi { font-size: 22px; letter-spacing: -.01em; }
.admin-two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.meter { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--surface-2); max-width: 220px; }
.meter i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.chart { position: relative; display: flex; flex-direction: column; min-width: 0; }
.chart > details { min-width: 0; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 10px; }
.chart .bar path { fill: var(--accent); }
.chart .bar .hit { fill: transparent; }
.chart .bar:hover path, .chart .bar:focus path { fill: var(--ink); }
.chart .bar:focus { outline: none; }
.chart-tip { position: absolute; top: -6px; background: var(--ink); color: var(--bg); font-size: 12px; padding: 3px 8px; border-radius: 6px; pointer-events: none; white-space: nowrap; }
.dev-bar { position: sticky; top: 0; z-index: 26; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid currentColor; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-align: center; padding: 4px var(--s-2); }
.side-foot .release { margin-top: 6px; }
.offline-bar { position: sticky; top: 0; z-index: 25; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; text-align: center; padding: 6px var(--s-2); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600; padding: 12px 18px 8px; }
td { padding: 11px 18px; border-top: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.total td { font-weight: 650; background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.table-wrap th, .table-wrap td.tabular { white-space: nowrap; }
.table-wrap > table { min-width: 760px; } /* scroll sideways on phones instead of crushing columns */
/* Assessments: each item in its own inset panel so it has real room inside the card */
.asm-list { list-style: none; margin: 8px 0 2px; padding: 0 18px; display: flex; flex-direction: column; gap: 10px; }
.asm-row { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.asm-head { display: flex; align-items: baseline; gap: 12px; }
.asm-name { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; line-height: 1.4; }
.asm-weight { flex: 0 0 auto; font-weight: 700; color: var(--ink); white-space: nowrap; }
.asm-meta { margin-top: 5px; font-size: 12px; color: var(--muted); }
.asm-meta .cap { text-transform: capitalize; }
.asm-meta .sep { margin: 0 6px; opacity: .5; }
.asm-when { white-space: nowrap; }
.asm-det { margin-top: 9px; font-size: 12.5px; line-height: 1.6; color: var(--faint); }
.card > .pad { padding: 18px 18px 6px; } /* card heading above a table: lines up with the cells */
@media (max-width: 600px) { .card > .pad { padding: 14px 10px 4px; } }
@media (max-width: 600px) { th, td { padding: 9px 10px; } }

/* ---------- Grades ---------- */
.standing { display: grid; gap: 14px; padding: 0 18px 18px; grid-template-columns: minmax(0, 1fr); }
.calc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.calc-stats div { background: var(--surface-2); border-radius: var(--radius-s); padding: 10px 12px; }
.calc-stats b { display: block; font-size: 20px; letter-spacing: -.02em; }
.calc-stats span { font-size: 12px; color: var(--muted); }
.targets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.target { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
.target b { color: var(--ink); font-size: 16px; display: block; }
.target.ok { border-color: var(--ok); background: var(--accent-soft); }
.target.no { color: var(--muted); }
.target.no b { color: var(--muted); }
@media (max-width: 700px) { .calc-stats, .targets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Compact grade ladder (1 = fail, then the minimum % for 2–5) */
.grade-ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.grade-ladder .gl { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 4px; text-align: center; min-width: 0; }
.grade-ladder .gl b { display: block; font-size: 15px; line-height: 1.1; color: var(--ink); }
.grade-ladder .gl span { display: block; margin-top: 2px; font-size: 11px; line-height: 1.25; color: var(--muted); white-space: nowrap; }
.grade-ladder .gl.g1 { color: var(--muted); background: var(--bg-soft, transparent); }
.grade-ladder .gl.g5 b { color: var(--ok, var(--ink)); }

/* ---------- Markdown ---------- */
.md { line-height: 1.65; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h1 { font-size: 22px; margin: 20px 0 8px; } .md h2 { font-size: 17px; margin: 24px 0 8px; } .md h3 { font-size: 15px; margin: 18px 0 6px; }
.md p { margin: 8px 0; } .md ul, .md ol { padding-left: 22px; margin: 8px 0; } .md li { margin: 3px 0; }
.md code { font: 12.5px ui-monospace, SFMono-Regular, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-s); overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 10px 0; padding: 4px 14px; border-left: 3px solid var(--line); color: var(--muted); }
.md table { border: 1px solid var(--line); border-radius: var(--radius-s); margin: 10px 0; font-size: 13.5px; display: block; overflow-x: auto; }
.md th, .md td { padding: 8px 12px; border-top: 1px solid var(--line); text-transform: none; letter-spacing: 0; font-size: 13.5px; }
.md th { background: var(--surface-2); color: var(--ink); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- Ask / chat ---------- */
.chat { display: grid; gap: var(--s-1); padding-bottom: 150px; }
.bubble-q { margin: var(--s-2) 0 4px auto; max-width: 80%; width: fit-content; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-a { padding: 14px 18px; max-width: 92%; border-radius: 16px 16px 16px 4px; }
.bubble-a .sources { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.src { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); color: var(--muted); max-width: 100%; }
.src:hover { color: var(--ink); }
.src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.cite { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 650; vertical-align: 1px; text-decoration: none !important; }
a.cite:hover { background: var(--accent); color: var(--accent-ink); }
.composer { position: fixed; bottom: 0; left: var(--sidebar); right: 0; padding: var(--s-2) var(--s-5) var(--s-3); background: linear-gradient(transparent, var(--bg) 30%); z-index: 10; }
.composer .card { max-width: 1100px; margin: 0 auto; padding: 10px; display: flex; gap: var(--s-1); align-items: flex-end; }
.composer textarea { border: 0; box-shadow: none !important; resize: none; min-height: 44px; max-height: 180px; background: none; }
.composer select { max-width: 180px; flex: none; width: auto; font-size: 13px; min-height: 36px; padding: 6px 8px; }
@media (max-width: 900px) {
  .composer { left: 0; padding: var(--s-1) var(--s-1) calc(var(--tabbar) + env(safe-area-inset-bottom) + 8px); }
  .composer .card { flex-wrap: wrap; }
  .composer select { max-width: none; flex: 1 1 100%; order: -1; min-height: 34px; }
  .bubble-q { max-width: 92%; } .bubble-a { max-width: 100%; }
}
.progress-line { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13.5px; padding: 12px 4px; }
.progress-line .dots { display: inline-flex; gap: 3px; }
.progress-line .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
.progress-line .dots i:nth-child(2) { animation-delay: .2s; } .progress-line .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- Flashcards ---------- */
.review-card { padding: var(--s-3); max-width: 720px; margin: 0 auto; min-height: 300px; display: flex; flex-direction: column; }
.review-q { font-size: 21px; font-weight: 600; line-height: 1.4; margin: var(--s-3) 0 18px; text-wrap: balance; }
.review-a { font-size: 17px; line-height: 1.5; padding: var(--s-2) 18px; border-radius: 12px; background: var(--accent-soft); margin-bottom: 18px; animation: fade .2s; }
.review-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: auto; }
.review-btns .btn { flex-direction: column; gap: 0; min-height: 56px; }
.review-btns .btn small { color: inherit; opacity: .7; font-weight: 450; font-size: 11px; }
.review-btns .again { color: var(--danger); } .review-btns .good { color: var(--accent); }
.progress { height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .3s var(--ease); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: var(--s-3); z-index: 80; display: grid; gap: var(--s-1); width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; animation: pop .2s var(--ease); }
.toast.err { background: var(--danger); color: var(--danger-ink); }
.toast .btn { margin-left: auto; min-height: 28px; padding: 2px 10px; background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 40%, transparent); }
@media (max-width: 900px) { .toasts { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); } }

/* ---------- Dialog / drawer ---------- */
dialog.modal { border: 1px solid var(--line); border-radius: 18px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 64px); }
dialog.modal.wide { width: min(860px, calc(100% - 32px)); }
dialog.modal::backdrop { background: rgba(15,14,12,.4); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .18s var(--ease); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: var(--s-2) 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { flex: 1; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: var(--s-1); justify-content: flex-end; flex-wrap: wrap; }
.snippet { color: var(--muted); font-size: 12.5px; white-space: normal; }
.snippet mark, mark { background: var(--warn-soft); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.textview { white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
.textview .pg { display: block; color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 4px; }

/* ---------- Landing / wizard ---------- */
/* Public pages: editorial, not "app marketing" — serif headings, hairline rules instead of cards, no icons or emoji. */
.landing { display: grid; gap: var(--s-6); padding-top: var(--s-2); }
.land-nav { display: flex; align-items: center; gap: var(--s-1); }
.land-nav .brand { padding: 0; flex: 1; font-size: 16px; }
.land-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--s-5); align-items: center; padding-bottom: var(--s-2); }
.land-hero h1 { font: 600 46px/1.08 var(--serif); letter-spacing: -.02em; margin: 0; max-width: 17ch; text-wrap: balance; }
.land-hero .lede { font-size: 17px; line-height: 1.55; margin: var(--s-2) 0 var(--s-3); color: var(--muted); }
.land-hero .help { margin-top: var(--s-15); max-width: 52ch; }
.kicker { color: var(--accent); font-size: 14px; font-weight: 600; margin: 0 0 var(--s-15); }
.preview { padding: 18px; display: grid; gap: 8px; box-shadow: 0 1px 2px rgba(30,28,24,.05), 0 18px 48px -18px rgba(30,28,24,.22); }
.preview .row { background: var(--bg); }
.preview .chip .dot, .school-chip .dot { background: var(--c, var(--accent)); }
.pv-grade { margin-top: 4px; padding: 12px; border-radius: var(--radius-s); background: var(--accent-soft); display: grid; gap: 8px; font-size: 13px; }
.pv-grade p { margin: 0; color: var(--ink); }
.pv-bar { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 18%, transparent); overflow: hidden; }
.pv-bar i { display: block; height: 100%; width: 72%; border-radius: inherit; background: var(--accent); }
.land-sec { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s-3); border-top: 1px solid var(--line); padding-top: var(--s-3); }
.land-sec > .site-h2 { margin: 0; }
.land-sec p { margin: 0; }
.how { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); counter-reset: how; }
.how li { counter-increment: how; }
.how li::before { content: counter(how); display: block; font: 600 28px/1 var(--serif); color: var(--accent); margin-bottom: var(--s-1); }
.how h3 { font-size: 15px; margin: 0 0 4px; }
.how p { margin: 0; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-4); margin: 0; }
.features > div { padding: var(--s-15) 0; border-bottom: 1px solid var(--line); }
.features > div:nth-last-child(-n+2) { border-bottom: 0; }
.features dt { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.features dt::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.features > div:nth-child(1) { --c: #4f7cac; } .features > div:nth-child(2) { --c: #c0693f; } .features > div:nth-child(3) { --c: #5b8c5a; }
.features > div:nth-child(4) { --c: #8e6bb5; } .features > div:nth-child(5) { --c: #b88a3e; } .features > div:nth-child(6) { --c: #3f8f9a; }
.features dd { margin: 4px 0 0; color: var(--muted); }
.school-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.school-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 550; }
a.school-chip:hover { border-color: var(--accent); color: var(--accent); }
.school-chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.school-chip.soon { background: none; border-style: dashed; color: var(--faint); font-weight: 450; }
.soon-list { margin: 0; padding-left: 18px; color: var(--muted); columns: 2; }
.promise { margin: 0; padding-left: 18px; display: grid; gap: var(--s-1); }
.promise strong, .promise b { color: var(--ink); }
.land-foot { display: flex; gap: var(--s-2); flex-wrap: wrap; color: var(--faint); font-size: 12.5px; padding-bottom: var(--s-3); }
.land-foot .theme-switch button { padding: 6px 10px; }
@media (max-width: 900px) {
  .land-hero { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
  .land-hero h1 { font-size: 34px; }
  .land-sec { grid-template-columns: minmax(0, 1fr); gap: var(--s-15); }
  .features { grid-template-columns: minmax(0, 1fr); }
  .features > div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .soon-list { columns: 1; }
  .landing { gap: var(--s-5); }
}
.wizard { max-width: 640px; margin: 0 auto; }
/* Sign-in: find the university, then the usual Moodle login */
.signin h1 { font: 600 28px/1.2 var(--serif); letter-spacing: -.015em; }
.school-search { position: relative; }
.school-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); display: flex; pointer-events: none; }
.school-search .input { padding-left: 38px; font-size: 16px; min-height: 48px; }
.school-results { list-style: none; margin: 6px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); display: grid; gap: 2px; }
.school-results li { padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: var(--s-1); flex-wrap: wrap; }
.school-results li[aria-selected="true"], .school-results li:hover { background: var(--accent-soft); }
.school-results li.off b { color: var(--muted); font-weight: 500; }
.school-results .tag { font-size: 12px; color: var(--warn); }
.school-picked { display: flex; align-items: center; gap: var(--s-1); padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2); }
.school-picked b { flex: 1; min-width: 0; }
.school-picked .ok { color: var(--ok); display: flex; } .school-picked .off { color: var(--warn); display: flex; }
.signin .btn.block { justify-content: center; }
.trust { list-style: none; margin: 0; padding: var(--s-2) 0 0; border-top: 1px solid var(--line); display: grid; gap: var(--s-1); font-size: 13.5px; color: var(--muted); }
.trust li { display: flex; gap: var(--s-1); align-items: flex-start; }
.trust svg { color: var(--ok); margin-top: 3px; }
.trust b { color: var(--ink); }
.wizard.wide { max-width: 860px; }
.stepper { display: flex; gap: 6px; margin: var(--s-2) 0 var(--s-3); list-style: none; padding: 0; }
.stepper li { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.stepper li.done { background: var(--accent); }
.stepper li.cur { background: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.step-count { color: var(--faint); font-size: 12.5px; }
.guide { list-style: none; counter-reset: g; margin: 0; padding: 0; display: grid; gap: var(--s-15); }
.guide > li { counter-increment: g; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.guide > li::before { content: counter(g); width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.guide p { margin: 3px 0 6px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s-1); }
.choice { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); padding: 12px 14px; text-align: left; display: grid; gap: 2px; transition: border-color .15s, background .15s; }
.choice:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.choice b { font-weight: 620; } .choice small { color: var(--muted); font-size: 12px; }
.paths { display: grid; gap: var(--s-1); }
.path { display: flex; gap: 14px; align-items: flex-start; padding: var(--s-2); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; width: 100%; }
.path:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.path[aria-expanded="true"] { border-color: var(--accent); }
.path .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; font-size: 18px; flex: none; }
.path span.main { display: grid; gap: 2px; flex: 1; } .path small { color: var(--muted); font-size: 13px; }
.copybox { display: flex; gap: 6px; align-items: stretch; margin: 6px 0; }
.copybox code { flex: 1; min-width: 0; font: 12.5px/1.4 ui-monospace, SFMono-Regular, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; overflow-x: auto; white-space: nowrap; }
details.disclose { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); margin: var(--s-1) 0; }
details.disclose > summary { cursor: pointer; padding: 12px 14px; font-weight: 580; list-style: none; display: flex; gap: 8px; align-items: center; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::after { content: "›"; margin-left: auto; color: var(--faint); transition: transform .2s; font-size: 18px; line-height: 1; }
details.disclose[open] > summary::after { transform: rotate(90deg); }
details.disclose > div { padding: 0 14px 14px; }
.big-check { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 30px; margin: 0 auto var(--s-2); }
.center { text-align: center; }

/* ---------- Settings ---------- */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s-3); align-items: start; }
.settings-nav { position: sticky; top: var(--s-3); display: grid; gap: 2px; }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
  .settings-nav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; gap: 4px; padding-bottom: 6px; }
  .settings-nav .nav-item { width: auto; flex: none; }
  .settings-nav { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); padding-right: 32px; }
}

/* ---------- Pill (OCR / folder sync) ---------- */
.pills { position: fixed; right: var(--s-2); bottom: var(--s-2); z-index: 30; display: grid; gap: var(--s-1); justify-items: end; grid-template-columns: minmax(0, 1fr); max-width: calc(100% - 32px); pointer-events: none; }
.pill { pointer-events: auto; display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12.5px; color: var(--muted); max-width: 100%; animation: pop .2s var(--ease); }
.pill > span:not(.ring) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pill .btn { min-height: 26px; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.pill .ring { width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), var(--surface-2) 0); flex: none; }
@media (max-width: 900px) { .pills { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 10px); right: var(--s-1); } }
.app.bare ~ .pills { display: none; }

/* Notes */
.note-edit { min-height: 50vh; font: 13.5px/1.6 ui-monospace, SFMono-Regular, monospace; }
.prose { max-width: 72ch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print { .sidebar, .tabbar, .topbar, .composer, .pill, .toasts { display: none !important; } .app { display: block; } }

/* Course colours (classes instead of inline styles: CSP style-src 'self') */
.cc0 { --c: #4f7cac; } .cc1 { --c: #c0693f; } .cc2 { --c: #5b8c5a; } .cc3 { --c: #8e6bb5; } .cc4 { --c: #b88a3e; }
.cc5 { --c: #3f8f8a; } .cc6 { --c: #b55c7a; } .cc7 { --c: #6b7a8f; } .cc8 { --c: #a0563a; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.ficon .dot { width: 12px; height: 12px; }
.label { font-weight: 600; font-size: 13.5px; }
.md li.nested { margin-left: 18px; list-style-type: circle; }
.center-row { justify-content: center; }
@media (max-width: 600px) { .hide-s { display: none; } }
.wizard { display: grid; gap: var(--s-3); padding-top: var(--s-2); }
.plain-list { list-style: none; padding: 0; margin: 0; }

/* Correct weights editor */
.rules-edit td { vertical-align: middle; }
.rules-edit .input { padding: 6px 8px; min-width: 0; }
.rules-edit .input.num { width: 84px; text-align: right; }
.rules-edit input[type="date"] { width: 150px; }
.rules-edit input[type="time"] { width: 104px; }
.rules-edit tr.removed td { opacity: .55; }
.note.warn { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 12px; margin: 0 18px 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ok-text { color: var(--accent); }
.warn-text { color: var(--warn); }
.targets .target .input { margin-top: 4px; width: 100%; }

/* Plans & billing */
.plans { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.plan.featured { border-color: var(--accent); box-shadow: var(--ring); }
.plan .price b { font-size: 26px; letter-spacing: -0.02em; }
.plan .plain-list { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.term-switch { max-width: 420px; }
.term-switch button { padding: 8px 0; font-size: 13px; }
.billing-note { text-decoration: none; }
.nav-item.billing-note .txt { white-space: normal; overflow-wrap: anywhere; }
a.notice.billing-note { color: inherit; margin-bottom: var(--s-3); }
.upgrade { max-width: 560px; }

/* ---------- Animated setup guides (assets/guides.js) ---------- */
.gplayer { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; display: grid; }
.gtitle { padding: 10px 14px 0; font-weight: 600; font-size: 13.5px; }
.gstage { position: relative; height: 300px; background: radial-gradient(circle at 50% 30%, var(--accent-soft), var(--surface-2) 70%); cursor: pointer; overflow: hidden; }
.gscene { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; opacity: 0; visibility: hidden; transition: opacity .35s var(--ease); }
.gscene.on { opacity: 1; visibility: visible; }
.gbar { height: 3px; background: var(--line); }
.gbar i { display: block; height: 100%; width: 0; background: var(--accent); }
.gbar i.run { animation: g-bar var(--dur, 5s) linear both; }
.gcap { margin: 0; padding: 12px 14px 4px; display: grid; gap: 2px; min-height: 66px; }
.gcap .gnum { font-size: 12px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.gcap .gtext { font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.gctl { display: flex; align-items: center; gap: 6px; padding: 4px 10px 12px; }
.gdots { display: flex; gap: 0; flex: 1; min-width: 0; justify-content: center; }
.gdots button { width: 18px; height: 24px; border: 0; background: none; padding: 0; display: grid; place-items: center; }
.gdots button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background .2s, transform .2s; }
.gdots button[aria-current="step"]::before { background: var(--accent); transform: scale(1.3); }
.gplayer > details.disclose { margin: 0 10px 10px; }

/* Mock devices: fixed light palette so they look like real apps in both themes */
.gdev { --m-bg: #fff; --m-ink: #1d1c1a; --m-mute: #6b7076; --m-line: #e3e5e8; --m-blue: #3390ec; --m-out: #e3f5d8;
  background: var(--m-bg); color: var(--m-ink); border-radius: 18px; box-shadow: 0 12px 34px rgba(0,0,0,.18); overflow: hidden; font-size: 12px; line-height: 1.35; display: flex; flex-direction: column; }
.gdev.phone { width: 220px; height: 272px; border: 6px solid #1d1c1a; border-radius: 26px; }
.gdev.browser { width: min(440px, 100%); height: 256px; border-radius: 12px; }
.gtop { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--m-blue); color: #fff; font-size: 12.5px; }
.gav { width: 24px; height: 24px; border-radius: 50%; background: #e8eef7; display: grid; place-items: center; font-size: 13px; flex: none; }
.gbody { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 7px; overflow: hidden; }
.gbody.chat { background: #dfe9d7; }
.gcompose { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-top: 1px solid var(--m-line); color: var(--m-mute); }
.gcompose span { flex: 1; } .gcompose i { width: 18px; height: 18px; border-radius: 50%; background: var(--m-blue); }
.gurl { display: flex; align-items: center; gap: 5px; padding: 7px 10px; background: #eef0f2; border-bottom: 1px solid var(--m-line); }
.gurl i { width: 8px; height: 8px; border-radius: 50%; background: #c9ccd1; }
.gurl span { margin-left: 8px; flex: 1; background: #fff; border-radius: 6px; padding: 3px 8px; color: var(--m-mute); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gapp { display: grid; gap: 8px; align-content: start; }
.gb { max-width: 85%; padding: 6px 9px; border-radius: 12px; box-shadow: 0 1px 1px rgba(0,0,0,.08); background: #fff; }
.gb.in { align-self: flex-start; border-bottom-left-radius: 4px; }
.gb.out { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--m-out); }
.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 6px 12px; border-radius: 8px; background: #f0f2f4; border: 1px solid var(--m-line); font-weight: 600; justify-self: start; align-self: flex-start; }
.gbtn.primary { background: #2e5e4e; border-color: #2e5e4e; color: #fff; }
.gbtn.wide { align-self: stretch; justify-content: center; width: 100%; background: #fff; color: var(--m-blue); }
.gbtn.round { width: 26px; height: 26px; padding: 0; border-radius: 50%; }
.gsearch { background: #fff; border-radius: 16px; padding: 6px 10px; color: var(--m-mute); }
.grow { display: flex; gap: 8px; align-items: center; background: #fff; border-radius: 10px; padding: 7px 9px; width: 100%; }
.grow small { display: block; color: var(--m-mute); }
.grow2 { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.gtick { color: var(--m-blue); }
.gcode { font: 11px ui-monospace, SFMono-Regular, monospace; background: #eef3fb; color: #1d5fb0; padding: 1px 4px; border-radius: 4px; display: inline-block; margin-top: 3px; }
.gnote { font-size: 11px; color: #8a5a0f; background: #fbf1dd; border-radius: 8px; padding: 5px 8px; align-self: flex-start; }
.gok { color: #2b6f46; font-weight: 700; align-self: flex-start; } .gok.big { font-size: 18px; }
.gtoast { position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: 22px; background: #1d1c1a; color: #fff; border-radius: 999px; padding: 5px 12px; font-size: 11.5px; font-weight: 600; }
.gpanel { background: #fff; border: 1px solid var(--m-line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.gfield { display: grid; gap: 3px; } .gfield small { color: var(--m-mute); }
.gin { border: 1px solid var(--m-line); border-radius: 7px; padding: 6px 8px; min-height: 28px; font: 11.5px ui-monospace, SFMono-Regular, monospace; white-space: nowrap; overflow: hidden; background: #fff; }
.gcols { display: grid; grid-template-columns: 110px 1fr; gap: 12px; height: 100%; }
.gcols > div { display: grid; gap: 8px; align-content: start; }
.gside { border-right: 1px solid var(--m-line); padding-right: 8px; color: var(--m-mute); line-height: 2; }
.gcenter { display: grid; gap: 10px; place-items: center; height: 100%; align-content: center; }
.gchips { display: flex; gap: 6px; } .gchips > span { border: 1px solid var(--m-line); border-radius: 8px; padding: 4px 9px; }
.gchip-on { border-color: #2e5e4e !important; background: #e2ece7; font-weight: 700; }
.gswitch { width: 30px; height: 18px; border-radius: 999px; background: #2e5e4e; position: relative; flex: none; display: inline-block; }
.gswitch::after { content: ""; position: absolute; top: 2px; left: 14px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }

/* Animations: the default style is the end state; `both` fill shows the start state during the delay. */
.gscene .a { animation-delay: var(--d, 0s); animation-fill-mode: both; }
.gscene:not(.on) .a, .gscene:not(.on) .a::after, .gscene:not(.on) .a::before { animation: none !important; }
.gscene.on .a-pop { animation-name: g-pop; animation-duration: .4s; animation-timing-function: var(--ease); }
.gscene.on .a-type { display: inline-block; animation-name: g-type; animation-duration: 1.1s; animation-timing-function: steps(14, end); }
.gscene.on .a-hl { border-radius: 5px; animation-name: g-hl; animation-duration: 1.4s; }
.gscene.on .a-on { animation-name: g-on; animation-duration: .3s; }
.gscene.on .a-on::after { animation: g-knob .3s var(--d, 0s) both; }
.a-tap { position: relative; }
.a-tap::before { content: "👆"; position: absolute; right: -10px; bottom: -20px; font-size: 22px; opacity: 0; pointer-events: none; z-index: 2; }
.gscene.on .a-tap::before { animation: g-finger 1.2s var(--d, 0s) both; }
.gscene.on .a-tap { animation: g-press 1.2s var(--d, 0s) both; }
.gplayer.paused .gscene.on .a, .gplayer.paused .gscene.on .a::before, .gplayer.paused .gscene.on .a::after { animation-play-state: paused; }
@keyframes g-bar { from { width: 0; } to { width: 100%; } }
@keyframes g-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes g-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes g-hl { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 30%, 70% { box-shadow: 0 0 0 3px #e2b267; background: #fbf1dd; } }
@keyframes g-on { from { background: #c9ccd1; } }
@keyframes g-knob { from { left: 2px; } }
@keyframes g-finger { 0% { opacity: 0; transform: translate(18px, 18px); } 35% { opacity: 1; transform: none; } 50% { transform: scale(.85); } 65% { transform: none; opacity: 1; } 100% { opacity: 0; } }
@keyframes g-press { 0%, 40% { box-shadow: 0 0 0 0 rgba(46,94,78,0); } 50% { transform: scale(.95); box-shadow: 0 0 0 6px rgba(46,94,78,.25); } 70%, 100% { transform: none; box-shadow: 0 0 0 0 rgba(46,94,78,0); } }
@media (prefers-reduced-motion: reduce) {
  .gscene .a, .gscene .a::before, .gscene .a::after, .gbar i { animation: none !important; }
  .gscene { transition: none; }
}
@media (max-width: 480px) { .gstage { height: 290px; } .gcols { grid-template-columns: 84px 1fr; } }

/* "Which AI is right for me?" */
.ai-pick { display: grid; gap: var(--s-1); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.ai-pick .choice b { font-size: 14px; }
.tag-rec { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; margin-left: 4px; vertical-align: 1px; }

/* ---------- Public pages (app/Site, server-rendered): home, pricing, schools, FAQ, help, blog ---------- */
/* The home page (/) holds both #site and #app: theme.js / app.js set html.in-app when the app should show. */
html:not(.in-app) #app { display: none; }
html.in-app #site { display: none; }
.site { max-width: 1040px; margin: 0 auto; padding: var(--s-3) var(--s-5) 0; display: grid; gap: var(--s-5); }
.site-main { padding: 0; max-width: none; }
.site-nav { display: flex; align-items: center; gap: var(--s-2); }
.site-nav .brand { padding: 0; font-size: 16px; }
.site-links { display: flex; gap: 2px; flex: 1; justify-content: center; }
.site-links a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.site-links a:hover, .site-links a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.site-cta { flex-wrap: nowrap; }
.site-h2 { font: 600 22px/1.25 var(--serif); letter-spacing: -.01em; }
.site h1 { font-family: var(--serif); letter-spacing: -.015em; }
/* Language: both visible, the current one marked */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-s); background: var(--surface-2); }
.lang-switch a, .lang-switch button { flex: 1; display: flex; align-items: center; justify-content: center; padding: 5px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 13px; line-height: 1.4; white-space: nowrap; transition: background .15s, color .15s; }
.lang-switch a:hover, .lang-switch button:hover { color: var(--ink); }
.lang-switch a[aria-current], .lang-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.lang-switch .short { display: none; }
.stack-l { display: grid; gap: var(--s-4); }
.school-list, .article-list, .related { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-1); }
.article-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-2); }
.article-list li, .article-card { display: grid; }
.article-card { align-content: start; }
.article-card h2 { font-size: 17px; line-height: 1.3; }
.article-card p { margin: 0; }
.school-row { display: flex; align-items: center; gap: var(--s-2); padding: 14px 18px; }
.school-row .main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.school-row:hover, .article-card:hover { border-color: var(--accent); }
.site .plan { display: flex; flex-direction: column; }
.site .plan .btn-row { margin-top: auto; }
.price-list { display: grid; gap: 10px; padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.price-list li { display: grid; gap: 0; }
.price-list b { font-size: 20px; letter-spacing: -.015em; }
.faq details.disclose > summary h2 { font-size: 15px; font-weight: 600; display: inline; }
.faq details.disclose p { margin: 0; color: var(--muted); }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--faint); margin-bottom: var(--s-3); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
@media (pointer: coarse), (max-width: 700px) { .site-links a { display: inline-flex; align-items: center; min-height: 40px; } .crumbs { align-items: center; } .crumbs a { display: inline-flex; align-items: center; min-height: 40px; } }
.final-cta { display: grid; gap: var(--s-1); border-top: 1px solid var(--line); padding-top: var(--s-4); }
.final-cta h2 { font: 600 30px/1.15 var(--serif); letter-spacing: -.015em; margin: 0; }
.final-cta p { margin: 0; }
.final-cta .btn { margin-top: var(--s-1); }
.site .prose { max-width: 70ch; }
.site .md { font-size: 15.5px; }
.site .md > h1:first-child { font-size: 28px; margin-bottom: var(--s-2); }
.site .md h2 { font-size: 20px; margin-top: var(--s-4); }
.site .md h3 { font-size: 16px; }
.site article header .lede { font-size: 17px; }
.site .md .table-wrap > table { min-width: 0; }
.kv th { text-align: left; padding: 4px 16px 4px 0; color: var(--muted); font-weight: 500; vertical-align: top; }
.kv td { padding: 4px 0; }
.site-foot { border-top: 1px solid var(--line); padding: var(--s-4) 0 var(--s-3); display: grid; gap: var(--s-2); font-size: 13.5px; }
.site-foot-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: var(--s-3); align-items: start; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }
.site-foot p { margin: 0; }
@media (max-width: 900px) {
  .site { padding: var(--s-2) var(--s-2) 0; gap: var(--s-4); }
  .site-nav { flex-wrap: wrap; row-gap: var(--s-1); }
  .site-nav .brand { flex: 1; }
  .site-links { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; margin: 0 calc(-1 * var(--s-2)); padding: 0 var(--s-2); scrollbar-width: none; }
  .how { grid-template-columns: minmax(0, 1fr); }
  .site-foot-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .lang-switch .long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* still read out */
  .lang-switch .short { display: inline; }
}
/* iOS zooms into fields under 16px; fingers need bigger targets than a mouse */
@media (max-width: 900px) { .input, select.input, textarea.input { font-size: 16px; } }
@media (pointer: coarse) {
  .theme-switch button, .lang-switch a, .lang-switch button, .btn.sm, .btn.icon, .chip-btn, .back { min-height: 40px; }
  .btn.icon, .btn.icon.sm.menu-btn { min-width: 40px; min-height: 40px; }
  .back { padding: 8px 0; }
}

/* ======================================================================= App v1.3: simpler UI */
/* ⋯ menus — secondary actions behind one small button */
.btn.icon.sm.menu-btn { width: 30px; min-height: 30px; color: var(--faint); }
.btn.menu-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--ink); }
.menu-pop { position: fixed; z-index: 60; min-width: 210px; max-width: min(320px, calc(100vw - 16px)); padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); animation: menu-in .12s var(--ease); }
.menu-pop > [role=menuitem] { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; text-decoration: none; cursor: pointer; }
.menu-pop > [role=menuitem] svg { color: var(--muted); flex: none; }
.menu-pop > [role=menuitem]:hover, .menu-pop > [role=menuitem]:focus-visible { background: var(--surface-2); outline: none; }
.menu-pop > .danger, .menu-pop > .danger svg { color: var(--danger); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .menu-pop { animation: none; } }
/* Today + Study hub */
.grid.today { max-width: 760px; }
.grid.today.settling { visibility: hidden; }
.today-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-1); }
.today-links .row { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s-1); }
.hub-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); min-height: 108px; transition: border-color .15s, transform .15s var(--ease); }
.hub-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.hub-tile .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.hub-tile b { font-weight: 600; font-size: 14px; }
.hub-tile small { color: var(--faint); font-size: 12.5px; }
@media (max-width: 560px) { .today-links { grid-template-columns: minmax(0, 1fr); } .hub { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hub-tile { min-height: 96px; padding: 14px; } }
/* Course page: one scroll, sections open in place */
.c-sec { margin-top: var(--s-2); scroll-margin-top: 76px; }
.c-sec > summary { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; list-style: none; }
.c-sec > summary::-webkit-details-marker { display: none; }
.c-sec > summary h2 { margin: 0; font-size: 15px; }
.c-sec > summary .chev svg { transition: transform .15s var(--ease); }
.c-sec[open] > summary .chev svg { transform: rotate(90deg); }
.c-sec[open] > summary { border-bottom: 1px solid var(--line); }
.c-sec > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.c-body { padding: var(--s-1) var(--s-2) var(--s-2); }
.c-body > .card, .c-body > section.card { box-shadow: none; border: 0; background: transparent; }
#c-over { margin-top: var(--s-2); }
@media (max-width: 560px) { .c-sec > summary { padding: 12px 14px; } .c-body { padding: 8px 10px 12px; } }
/* Timetable */
.tt-days { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.tt-day.is-today { border-color: var(--accent); }
.tt-free { padding: 4px 18px 14px; margin: 0; }
/* Attendance */
.att-count { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.att-count b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.att-count span { color: var(--muted); }
.att-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.att-list li { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.att-list li:last-child { border-bottom: 0; }
.att-add { flex-wrap: wrap; }
.att-add .input { width: auto; flex: 1 1 140px; }
/* Grade what-if */
.whatif .stack-s { padding-top: 8px; }
.wi-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, 160px) 44px; align-items: center; gap: 10px; font-size: 13.5px; }
.wi-row input[type=range] { width: 100%; accent-color: var(--accent); }
.wi-val { text-align: right; }
.wi-out { margin: 4px 0 0; font-size: 14px; }
@media (max-width: 560px) { .wi-row { grid-template-columns: minmax(0, 1fr) 44px; } .wi-row input[type=range] { grid-column: 1 / -1; grid-row: 2; } }
/* Workload chart: one series, thin bars on a quiet baseline, tooltip on hover/focus */
.wl-chart { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); align-items: end; gap: 6px; padding: 8px 18px 4px; border-bottom: 1px solid var(--line); margin: 0 18px; padding-inline: 0; }
.wl-col { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-height: 140px; border-radius: 6px; outline: none; cursor: default; }
.wl-col:focus-visible { box-shadow: var(--ring); }
.wl-bar { display: block; width: min(28px, 70%); background: var(--accent); border-radius: 4px 4px 0 0; }
.wl-bar.zero { background: var(--line); }
.wl-col:hover .wl-bar, .wl-col:focus-visible .wl-bar { filter: brightness(1.15); }
.wl-val { font-size: 11.5px; color: var(--muted); min-height: 14px; }
.wl-x { position: absolute; top: 100%; margin-top: 6px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.wl-chart + .help { margin: 26px 18px 14px; }
.wl-tip { display: none; position: absolute; bottom: calc(100% - 4px); left: 50%; transform: translateX(-50%); z-index: 5; width: max-content; max-width: 240px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 12.5px; }
.wl-col.start .wl-tip { left: 0; transform: none; }
.wl-col.end .wl-tip { left: auto; right: 0; transform: none; }
.wl-col:hover .wl-tip, .wl-col:focus-visible .wl-tip { display: grid; gap: 3px; }
.wl-ti { display: flex; gap: 10px; justify-content: space-between; min-width: 0; }
.wl-ti .ell { min-width: 0; }
@media (max-width: 560px) { .wl-chart { gap: 3px; margin: 0 12px; } .wl-x { font-size: 10px; } .wl-chart + .help { margin-inline: 12px; } }
@media (max-width: 560px) { .wl-col:nth-child(even) .wl-x { visibility: hidden; } }
/* Exam plan + readiness */
.ready-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.ready-score { display: flex; align-items: baseline; gap: 8px; }
.ready-score b { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.ready-score span { color: var(--muted); }
.plan-item { cursor: pointer; }
.plan-item .plan-check { width: 20px; height: 20px; flex: none; accent-color: var(--accent); margin: 0 2px; }
.plan-item.done .name { text-decoration: line-through; color: var(--faint); }
/* Command bar (⌘K) */
.cmdk-back { position: fixed; inset: 0; z-index: 90; background: rgba(15,14,12,.42); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: menu-in .12s var(--ease); }
.cmdk { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.cmdk-top { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.cmdk-in { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 16px; padding: 15px 0; }
.cmdk-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.cmdk-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-s); cursor: pointer; min-width: 0; color: var(--ink); }
.cmdk-list li svg { color: var(--muted); flex: none; }
.cmdk-list li .faint { margin-left: auto; flex: 0 1 auto; }
.cmdk-list li[aria-selected=true] { background: var(--accent-soft); }
.cmdk-list li[aria-selected=true] svg { color: var(--accent); }
.cmdk-foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--line); }
.cmdk-foot kbd { margin-right: 3px; }
body.cmdk-open { overflow: hidden; }
@media (max-width: 560px) { .cmdk-back { padding-top: 8px; } .cmdk { max-height: calc(100dvh - 24px); } .cmdk-foot { display: none; } }
@media (prefers-reduced-motion: reduce) { .cmdk-back { animation: none; } }
/* Swipe actions: the row's content slides, the action shows underneath */
.swipe-row { position: relative; touch-action: pan-y; }
.swipe-row > * { transition: transform .18s var(--ease); }
.swipe-row.swiping > * { transition: none; transform: translateX(var(--sx, 0)); }
.swipe-row.swiping { background: var(--ok); }
.swipe-row.swiping::after { content: attr(data-swipe-label); position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--surface); font-weight: 600; font-size: 13.5px; }
.swipe-row.swiping.armed::after { content: "✓ " attr(data-swipe-label); }
.review-card.drag { transition: none; }
.review-card { transition: transform .18s var(--ease); touch-action: pan-y; }
.review-card.drag-left { box-shadow: inset 0 0 0 2px var(--danger); }
.review-card.drag-right { box-shadow: inset 0 0 0 2px var(--ok); }
/* Pull to sync */
.ptr { position: fixed; left: 50%; top: 8px; z-index: 60; transform: translate(-50%, -60px); padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; pointer-events: none; }
.ptr.armed { color: var(--accent); }
.swipe-hint { display: none; }
@media (hover: none) and (pointer: coarse) { .swipe-hint { display: block; } }
.key-hint { display: none; }
@media (hover: hover) and (pointer: fine) { .key-hint { display: block; } }
/* A single centred card (MCP sign-in screens). */
.solo { max-width: 34rem; margin: 2rem auto; }
.solo-sm { max-width: 32rem; margin-top: 3rem; }
/* Admin → Feedback */
.fb-msg { white-space: pre-wrap; margin: 4px 0; overflow-wrap: anywhere; }
.fb-row { align-items: flex-start; }
.fb-row.done { opacity: .6; }
.gen-deck { margin-bottom: var(--s-2); } .gen-deck select { max-width: 360px; }

/* ---------------------------------------------------------------- Study reels (prototype) */
html.reels-open, html.reels-open body { overflow: hidden; }
.reels { position: fixed; inset: 0; z-index: 90; background: #0e0e0d; color: #f4f3ef; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.reels::-webkit-scrollbar { display: none; }
.reels-top { position: fixed; z-index: 5; top: calc(18px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(480px, 100%); padding: 0 12px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.reels-top > * { pointer-events: auto; }
.reels-btn { width: 40px; height: 40px; border-radius: 999px; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .4); color: #fff; cursor: pointer; }
.reels-btn[aria-pressed="true"] { background: #f4f3ef; color: #0e0e0d; }
.reel { position: relative; height: 100vh; height: 100dvh; max-width: 480px; margin: 0 auto; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #22302b 0%, #0e0e0d 60%); }
.reel-bars { position: absolute; z-index: 4; top: calc(8px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; gap: 4px; }
.reel-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.reel-bars b { display: block; height: 100%; width: 0; background: #fff; }
.reel-bars .done b { width: 100%; }
.reel-bars .now b { animation: reel-fill var(--ms, 3s) linear forwards; }
.reel.held .reel-bars .now b, .reel:not(.playing) .reel-bars .now b { animation-play-state: paused; }
@keyframes reel-fill { to { width: 100%; } }
.reel-stage { position: absolute; inset: 0; z-index: 1; padding: calc(76px + env(safe-area-inset-top)) 20px calc(150px + env(safe-area-inset-bottom)); display: grid; align-content: center; }
.beat { display: grid; gap: 22px; }
.beat.in { animation: reel-in .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes reel-in { from { opacity: 0; transform: translateY(14px); } }
.reel-label { justify-self: start; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 5px 11px; border-radius: 999px; background: #7fbfa6; color: #10201a; }
.reel-cap { margin: 0; font-size: 25px; line-height: 1.28; font-weight: 750; letter-spacing: -.01em; text-wrap: balance; }
.beat.hook .reel-cap { font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.15; }
.beat.card { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: 20px; padding: 24px 22px; }
.beat.in .reel-cap span { animation: reel-word .32s ease var(--w, 0ms) both; }
/* With the voice on, words light up as they are spoken (tts.js reports the progress), not on a timer. */
.beat.in .reel-cap.voiced span { animation: none; opacity: .32; transition: opacity .12s, color .12s; }
.beat.in .reel-cap.voiced span.lit { opacity: 1; }
.beat.in .reel-cap.voiced span.now { color: #f7d774; }
.reel-bars .now.manual b { animation: none; width: calc(var(--p, 0) * 100%); transition: width .2s linear; }
@keyframes reel-word { from { opacity: .18; } }
.reel-slide { aspect-ratio: 4 / 3; background: #fbfaf6; color: #1d1c1a; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.reel-slide-in { height: 100%; box-sizing: border-box; padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; transform-origin: 50% 50%;
  transform: scale(var(--fs, 1)) translateY(var(--fy, 0px)); transition: transform 2.6s cubic-bezier(.3, .1, .2, 1); }
.beat.in .reel-slide:not([data-focus="-1"]) .reel-slide-in { --fs: 1.05; }
.reel-slide h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 21px; }
.reel-slide ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 15px; }
.reel-slide li { padding: 1px 4px; border-radius: 4px; transition: background .6s .5s, color .6s .5s; }
.reel-slide li.on { background: linear-gradient(transparent 45%, #f7d774 45%); font-weight: 650; }
.reel-slide small { margin-top: auto; color: #6e6a63; font-size: 11px; }
.reel-page { aspect-ratio: var(--ar, 4 / 3); max-height: 54vh; margin: 0 auto; width: 100%; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.reel-page-in { position: relative; width: 100%; height: 100%; transform-origin: 0 0; transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--zs, 1)); }
.reel-page-in.zoom { transition: transform 3s cubic-bezier(.3, .1, .2, 1) .35s; }
.reel-page canvas { display: block; width: 100%; height: 100%; }
.reel-hl { position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); width: calc(var(--w) * 100%); height: calc(var(--h) * 100%);
  border-radius: 4px; background: rgba(247, 215, 116, .45); mix-blend-mode: multiply; box-shadow: 0 0 0 2px rgba(214, 170, 40, .8); animation: reel-hl .6s ease 1.2s both; }
@keyframes reel-hl { from { opacity: 0; transform: scaleX(.3); transform-origin: left; } }
.reel-del { position: absolute; z-index: 4; right: 16px; bottom: calc(26px + env(safe-area-inset-bottom)); }
.reel-msg { display: grid; place-items: center; padding: 24px; text-align: left; }
.reel-msg .stack { width: 100%; max-width: 380px; }
.reel-msg h2 { margin: 0; font-family: var(--serif); font-size: 30px; }
.reel-msg p { color: #cfcdc6; margin: 0; }
.reel-msg .input { background: rgba(255, 255, 255, .08); color: #f4f3ef; border-color: rgba(255, 255, 255, .2); }
.reel-msg .input option { color: #1d1c1a; }
.reel-q { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 750; }
.reel-opts { display: grid; gap: 10px; }
.reel-opt { text-align: left; font: inherit; font-size: 17px; font-weight: 600; color: inherit; padding: 15px 16px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .07); cursor: pointer; }
.reel-opt:disabled { cursor: default; opacity: .6; }
.reel-opt.ok { opacity: 1; background: #2f6f57; border-color: #7fbfa6; }
.reel-opt.bad { opacity: 1; background: #6b2a22; border-color: #e08a7a; }
.reel-why { margin: 0; color: #cfcdc6; font-size: 16px; }
.reel-guess { justify-self: start; font: inherit; font-size: 14px; color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
/* Scenes: animated layouts; each .si part fades/slides in when it gets .on */
.scene-box { min-height: 220px; display: grid; align-content: center; }
.scene .si { opacity: 0; transform: translateY(16px) scale(.97); transition: opacity .45s ease, transform .55s cubic-bezier(.2, .8, .2, 1.2); }
.scene .si.on { opacity: 1; transform: none; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.vs-side { border-radius: 16px; padding: 14px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); }
.vs-side b { display: block; font-size: 19px; margin-bottom: 6px; }
.vs-side ul { margin: 0; padding-left: 16px; display: grid; gap: 4px; font-size: 15px; color: #dcdad3; }
.vs-side.cc0 { border-color: #7fbfa6; } .vs-side.cc1 { border-color: #e6a96b; }
.vs-mid { align-self: center; font-family: var(--serif); font-style: italic; font-size: 22px; color: #f7d774; }
.steps, .tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: center; font-size: 18px; font-weight: 650; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .07); }
.steps .n { flex: none; width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: #7fbfa6; color: #10201a; font-size: 15px; }
.formula { display: flex; flex-wrap: wrap; gap: 10px 8px; align-items: flex-start; justify-content: center; }
.fp { display: grid; justify-items: center; gap: 4px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.fp b { font-family: var(--serif); font-size: 26px; }
.fp small { font-size: 12px; color: #cfcdc6; max-width: 120px; text-align: center; }
.fp.c0 b { color: #7fbfa6; } .fp.c1 b { color: #f7d774; } .fp.c2 b { color: #e6a96b; } .fp.c3 b { color: #a9b8f5; }
.bignum { display: flex; justify-content: center; align-items: baseline; gap: 6px; font-family: var(--serif); font-size: 30px; color: #f7d774; }
.bignum .num { font-size: 76px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bn-label { text-align: center; font-size: 18px; color: #e4e2db; margin-top: 8px; }
.tl { position: relative; padding-left: 20px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: rgba(255, 255, 255, .25); }
.tl li { position: relative; display: grid; gap: 2px; }
.tl li::before { content: ""; position: absolute; left: -19px; top: 6px; width: 12px; height: 12px; border-radius: 999px; background: #7fbfa6; }
.tl b { color: #f7d774; font-size: 15px; } .tl span { font-size: 17px; font-weight: 600; }
.myth { display: grid; gap: 12px; }
.myth .si { border-radius: 16px; padding: 16px; }
.myth .m { background: rgba(224, 138, 122, .14); border: 1px solid rgba(224, 138, 122, .5); }
.myth:has(.f.on) .m p { text-decoration: line-through; text-decoration-color: #e08a7a; opacity: .7; }
.myth .f { background: rgba(127, 191, 166, .14); border: 1px solid rgba(127, 191, 166, .55); }
.myth .tag { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.myth p { margin: 6px 0 0; font-size: 18px; font-weight: 650; }
.chart { display: flex; align-items: flex-end; justify-content: center; gap: 10px; height: 230px; }
.chart .cbar { flex: 1; max-width: 64px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.chart .cbar i { width: 100%; height: 0; border-radius: 8px 8px 3px 3px; background: linear-gradient(#7fbfa6, #4e8f78); transition: height .9s cubic-bezier(.2, .8, .2, 1); }
.chart .cbar.on i { height: calc(var(--v, 0) * 70%); }
.chart .bv { font-size: 14px; font-weight: 700; color: #f7d774; } .chart .bl { font-size: 12px; color: #cfcdc6; text-align: center; }
/* True or false: a card you swipe */
.tf-card { position: relative; border-radius: 22px; padding: 26px 22px 46px; background: #fbfaf6; color: #1d1c1a; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); touch-action: pan-y;
  transform: translateX(var(--dx, 0px)) rotate(calc(var(--dx, 0px) / 22)); transition: transform .35s ease, opacity .35s ease; cursor: grab; user-select: none; }
.tf-card.drag { transition: none; cursor: grabbing; }
.tf-card.gone { opacity: 0; }
.tf-card p { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 700; }
.tf-hint { position: absolute; left: 22px; right: 22px; bottom: 14px; display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: #6e6a63; }
.tf-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tf-btns .reel-opt { text-align: center; }
.reel-exam { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #f7d774; color: #2a2000; }
.reel-meta .hstack { gap: 6px; flex-wrap: wrap; }
.reel-tap { position: absolute; z-index: 2; top: 64px; bottom: 150px; width: 32%; border: 0; background: transparent; cursor: pointer; }
.reel-tap.prev { left: 0; } .reel-tap.next { right: 0; }
.reel.quiz-on .reel-tap { display: none; }
.reel-meta { position: absolute; z-index: 3; left: 20px; right: 20px; bottom: calc(26px + env(safe-area-inset-bottom)); display: grid; gap: 6px; justify-items: start; }
.reel-meta b { font-size: 17px; }
.reel-meta small { color: #b9b6ae; font-size: 13px; }
.reel :focus-visible { outline-color: #7fbfa6; }
@media (prefers-reduced-motion: reduce) {
  .beat.in, .beat.in .reel-cap span { animation: none; }
  .reel-slide-in, .reel-page-in.zoom { transition: none; }
  .reel-hl { animation: none; }
  .scene .si, .tf-card, .chart .cbar i { transition: none; }
}
.reels-scope { margin-right: auto; margin-left: 8px; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.45); color: #fff; font-size: 13px; font-weight: 600; }

/* v1.21: Study hub subject picker */
.study-focus { margin-bottom: 16px; }
.study-focus h2 { margin: 0; font-size: 16px; }
.study-focus .help { margin: 0; }
.sf-chips .chip-btn { font-size: 13px; }
.sf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; margin-top: 6px; }
.sf-week { display: grid; align-content: start; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); min-width: 0; }
.sf-wk { font-size: 14px; }
.sf-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; color: var(--muted); }
.sf-files li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sf-week .btn-row { margin: 0; }
.focus-only { margin: 6px 0 0; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* v1.21.1: lecture + seminar merged in the sidebar; the parts show under the open subject */
.nav-item.nav-sub { padding-left: 40px; font-size: 13px; min-height: 30px; color: var(--muted); }
.nav-item.nav-sub[aria-current="page"] { color: var(--ink); }

/* v1.22: relearning dots, worked examples, likely topics, exam wrapper, cheat sheet print */
.relearn { display: inline-flex; gap: 3px; vertical-align: middle; }
.relearn i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--faint); }
.relearn i.on { background: var(--accent); border-color: var(--accent); }
.worked { margin-bottom: 8px; }
.wk-ex h3 { margin: 0; font-size: 15px; }
.wk-problem { margin: 0; font-weight: 600; }
.wk-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.wk-steps li.hid .st { filter: blur(5px); user-select: none; }
.wk-steps li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wk-steps li::marker { color: var(--muted); }
.wk-steps li .st { flex: 1 1 14em; }
.wk-ans { margin: 0; }
.wk-ans.hid span { filter: blur(6px); user-select: none; }
.likely summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.likely .help { margin: 6px 0; }
.likely-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.likely-list li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.likely-list li .main { flex: 1; min-width: 10em; color: inherit; text-decoration: none; }
.chip-sm.warn { color: var(--warn-ink, var(--ink)); background: var(--warn-bg, var(--surface-2)); }
.notice.lesson { display: flex; gap: 8px; }
.wrapper { margin-bottom: 16px; }
.faces { display: flex; gap: 8px; flex-wrap: wrap; }
.face { font-size: 26px; line-height: 1; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.face[aria-pressed="true"] { border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 2px var(--accent) inset; }
#bd-timer.on { border-color: var(--accent); color: var(--accent); }
@media print {
  .print-sheet .back, .print-sheet .page-head .btn-row, .print-sheet .help { display: none !important; }
  .print-sheet .card { border: 0; box-shadow: none; padding: 0; }
  .print-sheet .prose { font-size: 10.5pt; line-height: 1.35; columns: 2; column-gap: 18px; }
  .print-sheet h1 { font-size: 14pt; margin: 0 0 6px; }
}

/* v1.23: more practice menu, teach chat, own question, balance, study blocks, listen */
.wk-more { display: inline-block; position: relative; }
.wk-more > summary { list-style: none; cursor: pointer; }
.wk-more > summary::-webkit-details-marker { display: none; }
.wk-more[open] > summary { background: var(--surface-2); }
.wk-more-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; padding: 4px 2px; }
.bubble { max-width: 85%; padding: 9px 12px; border-radius: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.them { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.stars { font-size: 20px; letter-spacing: 2px; color: var(--accent); white-space: nowrap; }
.mq-result h3 { margin: 0 0 4px; font-size: 14px; }
.bal { gap: 14px; }
.bal-key { display: flex; gap: 16px; color: var(--muted); }
.bal-key .k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bal-row { display: grid; gap: 5px; }
.bal-row .main { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.bal-bar { display: grid; grid-template-columns: 1fr 7.5em; align-items: center; gap: 8px; }
.bal-bar .track { display: block; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bal-bar .track i { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.bal-bar i.time, .bal-key .k.time { background: var(--accent); }
.bal-bar i.weight, .bal-key .k.weight { background: var(--muted); }
.bal-bar > span:last-child { color: var(--muted); }
.chip-sm.ok { background: var(--ok-bg, var(--surface-2)); }
.blocks { margin-top: 16px; }
.blocks h2 { margin: 0; font-size: 16px; }
.blk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.blk-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.blk-list .meta { min-width: 9.5em; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.listen-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.listen-bar .main { flex: 1; min-width: 10em; }

/* v1.23: user guide, first-login tour */
.side-guide { margin-bottom: 8px; }
.mn-toc { margin-bottom: 14px; }
.mn h2 { margin: 0; font-size: 18px; }
.mn .lede { margin: 0; }
.mn-list { margin: 0; display: grid; gap: 10px; }
.mn-list dt { font-weight: 600; }
.mn-list dd { margin: 2px 0 0; color: var(--muted); line-height: 1.5; }
.tour { position: fixed; inset: 0; z-index: 1000; }
.tour-dim { position: fixed; inset: 0; background: rgba(15, 20, 18, .55); }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(15, 20, 18, .55); outline: 2px solid var(--accent); transition: all .25s ease; pointer-events: none; }
.tour-card { position: fixed; max-width: calc(100vw - 32px); z-index: 1; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.tour-card.center { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); }
.tour-card h2 { margin: 0; font-size: 18px; }
.tour-card p { margin: 0; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

/* Invite a friend (screens/invite.js) */
.invite-hero { display: flex; gap: var(--s-2); align-items: flex-start; }
.invite-hero h2 { margin: 0 0 4px; font-size: 20px; }
.invite-gift { font-size: 40px; line-height: 1; }
.invite-link { display: flex; gap: var(--s-1); }
.invite-link .input { flex: 1; min-width: 0; font-size: 13px; }
.invite-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: var(--s-1); }
.invite-app { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius-s); border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: 14px; color: #fff; text-decoration: none; transition: transform .15s var(--ease), filter .15s; }
.invite-app:hover { transform: translateY(-1px); filter: brightness(1.08); }
.invite-app.wa { background: #1f8f4e; border-color: #1f8f4e; } .invite-app.fb { background: #1f6fe5; border-color: #1f6fe5; }
.invite-app.tg { background: #2a8bc6; border-color: #2a8bc6; } .invite-app.x { background: #111; border-color: #333; }
.invite-app.mail { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.invite-app.ig { background: linear-gradient(45deg, #c1356b, #d65a2f 60%, #c99a2e); border: 0; }
.invite-app.more { background: var(--surface-2); color: var(--ink); }
.invite-count { margin: 0; color: var(--muted); }
