/* SabiPass — calm, friendly, focused. Mobile first. */
:root {
  --bg: #f5f9fb;
  --surface: #ffffff;
  --surface-2: #edf4f8;
  --border: #dce6ed;
  --text: #18242e;
  --muted: #63717d;
  --primary: #0879b9;
  --primary-2: #062a4a;
  --primary-ink: #ffffff;
  --primary-soft: #e3f1f9;
  --accent: #edab72;
  --accent-soft: #fdf0e2;
  --teal: #08a6ad;
  --good: #0f9d6b;
  --good-soft: #def5ec;
  --bad: #e11d48;
  --bad-soft: #fde7ec;
  --info: #0879b9;
  --m-new: #a9b8c4;
  --m-learning: #edab72;
  --m-familiar: #08a6ad;
  --m-mastered: #0f9d6b;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(5, 42, 74, 0.05), 0 10px 30px rgba(5, 42, 74, 0.08);
  --shadow-lg: 0 24px 70px rgba(5, 42, 74, 0.2);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --read: Georgia, "Iowan Old Style", "Palatino Linotype", Charter, serif;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #051a2e; --surface: #0a2740; --surface-2: #0f3354; --border: #1b4266; --text: #e8f1f7; --muted: #9bb3c4;
    --primary: #3db4e8; --primary-2: #0879b9; --primary-ink: #04203a; --primary-soft: #0e3555; --accent: #edab72; --accent-soft: #3a2a18;
    --teal: #2dd4cf; --good: #34d399; --good-soft: #0d3a30; --bad: #fb7185; --bad-soft: #3d1621; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #051a2e; --surface: #0a2740; --surface-2: #0f3354; --border: #1b4266; --text: #e8f1f7; --muted: #9bb3c4;
  --primary: #3db4e8; --primary-2: #0879b9; --primary-ink: #04203a; --primary-soft: #0e3555; --accent: #edab72; --accent-soft: #3a2a18;
  --teal: #2dd4cf; --good: #34d399; --good-soft: #0d3a30; --bad: #fb7185; --bad-soft: #3d1621; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
svg[aria-hidden="true"] { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.main { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; }
.main.wide { max-width: 1040px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar h1 { font-size: 17px; color: var(--text); margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 18px; color: var(--text); }
.brand-mark { width: 34px; height: 34px; object-fit: contain; }
.brand-by { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; margin: 18px 0 0; }
.brand-by b { color: var(--text); }
.offline-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border: 1px solid color-mix(in srgb, var(--good) 28%, var(--border)); border-radius: 99px; color: var(--good); background: color-mix(in srgb, var(--good-soft) 72%, var(--surface)); font-size: 11px; font-weight: 800; white-space: nowrap; }
.offline-pill::before { content: ""; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.offline-pill.offline { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 36%, var(--border)); background: var(--accent-soft); }
.chip-xp { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, var(--text)); font-weight: 700; font-size: 14px; }
.chip-streak { background: #ffe9df; color: #c2410c; }
:root[data-theme="dark"] .chip-streak { background: #3b1f12; color: #fdba74; }

.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--border); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--primary); }
.tabbar .badge-dot { position: absolute; transform: translate(12px, -14px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.tabbar a > span.icon { position: relative; }

@media (min-width: 900px) {
  .shell { padding-bottom: 0; padding-left: 232px; }
  .tabbar { top: 0; right: auto; width: 232px; height: auto; grid-template-columns: 1fr; grid-auto-rows: 52px; align-content: start; padding: 72px 12px 12px; border-top: 0; border-right: 1px solid var(--border); }
  .tabbar a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; border-radius: 12px; font-size: 15px; }
  .tabbar a.active { background: var(--primary-soft); }
  .tabbar .side-brand { position: absolute; top: 18px; left: 26px; }
  .main { padding-top: 24px; }
}
@media (max-width: 899px) { .tabbar .side-brand { display: none; } }

/* ---------- type ---------- */
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
.page-title { font-size: 28px; margin: 6px 0 4px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 18px; margin: 28px 0 10px; }
.section-title small { font-size: 14px; font-weight: 600; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.center { text-align: center; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card.flat { box-shadow: none; }
.card.tint { background: var(--primary-soft); border-color: transparent; }
.card.warm { background: var(--accent-soft); border-color: transparent; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid.stats { grid-template-columns: repeat(3, 1fr); }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.spacer { flex: 1; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--primary); color: var(--primary-ink); font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .08s ease, filter .15s ease, background .15s; user-select: none; }
.btn:not(.soft):not(.ghost):not(.good):not(.danger) { background: linear-gradient(110deg, var(--primary-2), var(--primary)); box-shadow: 0 10px 24px rgba(8,121,185,.22); }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.big { min-height: 56px; font-size: 18px; border-radius: 14px; }
.btn.soft { background: var(--primary-soft); color: var(--primary); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.good { background: var(--good); color: #fff; }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn svg { width: 20px; height: 20px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
textarea.input { min-height: 90px; resize: vertical; }
.form-error { color: var(--bad); font-weight: 600; font-size: 14px; min-height: 20px; }
.seg { display: inline-flex; padding: 4px; background: var(--surface-2); border-radius: 12px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--primary-soft), transparent), var(--bg); }
.auth .card { width: 100%; max-width: 420px; padding: 28px 24px; }
.auth .brand { justify-content: center; font-size: 24px; margin-bottom: 6px; }
.auth .brand-mark { width: 48px; height: 48px; }
.auth h2 { text-align: center; margin: 8px 0 4px; }
.auth p.lead { text-align: center; }

/* ---------- today ---------- */
.hello { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.hello h2 { margin: 0; font-size: 24px; }
.goal { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.ring { --p: 0; --c: var(--primary); width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); display: grid; place-items: center; position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.ring > * { position: relative; font-weight: 800; font-size: 18px; }
.ring.small { width: 52px; height: 52px; }
.ring.small::before { inset: 6px; }
.ring.small > * { font-size: 13px; }
.ring.large { width: 140px; height: 140px; }
.ring.large::before { inset: 12px; }
.ring.large > * { font-size: 30px; }
.bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: inherit; transition: width .5s ease; }
.bar.accent > i { background: var(--accent); }
.bar.good > i { background: var(--good); }
.stat { text-align: center; padding: 14px 8px; }
.stat b { display: block; font-size: 24px; }
.stat span { font-size: 13px; color: var(--muted); }
.plan-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: inherit; cursor: pointer; }
.plan-item + .plan-item { margin-top: 10px; }
.plan-item:hover { border-color: var(--primary); text-decoration: none; }
.plan-item .pi-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.plan-item .pi-icon svg { width: 24px; height: 24px; }
.plan-item .pi-body { flex: 1; min-width: 0; }
.plan-item .pi-body b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-item .pi-body span { font-size: 13px; color: var(--muted); }
.pi-review { background: var(--accent-soft); color: var(--accent); }
.pi-learn { background: var(--primary-soft); color: var(--primary); }
.pi-quiz { background: var(--good-soft); color: var(--good); }
.pi-speed { background: #ffe9df; color: #ea580c; }
.exam-card { display: flex; align-items: center; gap: 16px; }
.exam-days { font-size: 40px; font-weight: 800; line-height: 1; color: var(--primary); }

/* ---------- packs ---------- */
.pack { position: relative; display: block; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: inherit; text-decoration: none; overflow: hidden; }
.pack:hover { text-decoration: none; border-color: var(--primary); }
.pack::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--pc, var(--primary)); }
.pack h3 { margin: 6px 0 4px; font-size: 18px; }
.pack .meta { font-size: 13px; color: var(--muted); }
.pc0 { --pc: #0879b9; } .pc1 { --pc: #08a6ad; } .pc2 { --pc: #0f9d6b; } .pc3 { --pc: #edab72; } .pc4 { --pc: #062a4a; } .pc5 { --pc: #5b8db8; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.status-pill.processing { background: var(--primary-soft); color: var(--primary); }
.status-pill.failed { background: var(--bad-soft); color: var(--bad); }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.action { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; color: inherit; text-decoration: none; }
.action:hover { border-color: var(--primary); text-decoration: none; }
.action svg { width: 26px; height: 26px; color: var(--primary); }
.action b { font-size: 15px; }
.action span { font-size: 12px; color: var(--muted); }
.topic-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none; }
.topic-row + .topic-row { margin-top: 8px; }
.topic-row:hover { border-color: var(--primary); text-decoration: none; }
.topic-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; background: var(--surface-2); color: var(--muted); border: 3px solid var(--mc, var(--m-new)); }
.topic-row .tr-body { flex: 1; min-width: 0; }
.topic-row .tr-body b { display: block; font-size: 15px; }
.topic-row .tr-body span { font-size: 12px; color: var(--muted); }
.mastery { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--mc); }
.m-new { --mc: var(--m-new); } .m-learning { --mc: var(--m-learning); } .m-familiar { --mc: var(--m-familiar); } .m-mastered { --mc: var(--m-mastered); }

/* ---------- upload ---------- */
.drop { display: grid; place-items: center; gap: 8px; padding: 34px 18px; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over, .drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.drop svg { width: 46px; height: 46px; color: var(--primary); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.file-row + .file-row { margin-top: 8px; }
.file-row .fr-body { flex: 1; min-width: 0; }
.file-row .fr-body b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .fr-body span { font-size: 12px; color: var(--muted); }
.file-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--surface-2); color: var(--muted); flex: none; }
.building { text-align: center; padding: 30px 10px; }
.building .orbit { width: 120px; height: 120px; margin: 0 auto 18px; border-radius: 50%; border: 6px solid var(--primary-soft); border-top-color: var(--primary); animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tips { margin-top: 18px; font-size: 14px; color: var(--muted); min-height: 42px; }

/* ---------- lesson / reading ---------- */
.lesson-head { margin: 4px 0 14px; }
.lesson-head .crumb { font-size: 13px; color: var(--muted); }
.lesson-head h2 { font-size: 26px; margin: 4px 0 8px; }
.prose { font-family: var(--read); font-size: 18px; line-height: 1.7; }
.prose h3 { font-family: var(--font); font-size: 18px; margin: 26px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin: 6px 0; }
.prose blockquote { margin: 0 0 14px; padding: 10px 14px; border-left: 4px solid var(--primary); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.prose strong { color: color-mix(in srgb, var(--primary) 45%, var(--text)); }
.prose mark { background: var(--accent-soft); color: inherit; padding: 0 2px; border-radius: 4px; }
.prose code { font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.callout { border-radius: var(--radius); padding: 16px 18px; margin: 16px 0; }
.callout h4 { margin: 0 0 6px; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.callout.analogy { background: var(--accent-soft); }
.callout.example { background: var(--good-soft); }
.callout.points { background: var(--primary-soft); }
.terms { display: grid; gap: 8px; }
.term { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.term summary { padding: 12px 14px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.term summary::-webkit-details-marker { display: none; }
.term summary::after { content: "Tap to reveal"; font-size: 12px; font-weight: 600; color: var(--muted); }
.term[open] summary::after { content: ""; }
.term p { margin: 0; padding: 0 14px 12px; color: var(--text); }
.explain-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--border); background: var(--surface); padding: 8px 12px; border-radius: 99px; font-weight: 600; font-size: 14px; cursor: pointer; }
.chip:hover, .chip.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.engine-note { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

/* ---------- bite player ---------- */
.player { display: flex; flex-direction: column; min-height: calc(100dvh - 140px); }
.player-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.player-top .bar { flex: 1; height: 12px; }
.bite { flex: 1; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.bite-kicker { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.bite h3 { font-size: 24px; margin: 6px 0 12px; }
.bite .prose { font-size: 19px; }
.player-foot { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 14px 0 10px; background: linear-gradient(transparent, var(--bg) 30%); }
@media (min-width: 900px) { .player-foot { bottom: 0; } }

/* ---------- questions ---------- */
.q-prompt { font-size: 21px; font-weight: 700; line-height: 1.4; margin: 6px 0 18px; white-space: pre-line; }
.q-prompt strong { color: var(--primary); }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 14px; text-align: left; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; font-size: 16px; line-height: 1.35; transition: border-color .12s, background .12s, transform .08s; }
.option:hover:not([disabled]) { border-color: var(--primary); }
.option:active:not([disabled]) { transform: scale(0.99); }
.option .key { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--surface-2); color: var(--muted); flex: none; }
.option.picked { border-color: var(--primary); background: var(--primary-soft); }
.option.right { border-color: var(--good); background: var(--good-soft); }
.option.right .key { background: var(--good); color: #fff; }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.wrong .key { background: var(--bad); color: #fff; }
.option[disabled] { cursor: default; }
.feedback { margin-top: 16px; padding: 16px; border-radius: 14px; animation: rise .2s ease; }
.feedback.good { background: var(--good-soft); }
.feedback.bad { background: var(--bad-soft); }
.feedback h4 { margin: 0 0 6px; font-size: 18px; }
.feedback .src { margin-top: 8px; font-size: 14px; color: var(--muted); font-style: italic; }
.qmeta { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px; color: var(--text); }
.timer.low { color: var(--bad); }
.combo { font-weight: 800; color: #ea580c; }
.exam-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.exam-nav button { height: 38px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; cursor: pointer; }
.exam-nav button.answered { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.exam-nav button.current { outline: 3px solid var(--accent); }
.result-hero { text-align: center; padding: 10px 0 6px; }
.result-hero h2 { font-size: 28px; margin: 14px 0 4px; }
.review-item { border-left: 4px solid var(--bad); }
.review-item.ok { border-left-color: var(--good); }

/* ---------- flashcards ---------- */
.flash-wrap { perspective: 1200px; }
.flash { position: relative; min-height: 300px; cursor: pointer; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.flash.flipped { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); backface-visibility: hidden; text-align: center; font-size: 22px; font-weight: 600; line-height: 1.4; }
.flash-face.back { transform: rotateY(180deg); background: var(--primary-soft); font-weight: 500; font-size: 20px; }
.flash-face small { position: absolute; top: 14px; left: 0; right: 0; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.grades button { min-height: 60px; border-radius: 14px; border: 0; font-weight: 800; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.grades button span { font-size: 11px; font-weight: 600; opacity: .8; }
.g-again { background: var(--bad-soft); color: var(--bad); }
.g-hard { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.g-good { background: var(--good-soft); color: var(--good); }
.g-easy { background: var(--primary-soft); color: var(--primary); }

/* ---------- tutor ---------- */
.chat { display: flex; flex-direction: column; gap: 12px; padding-bottom: 90px; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 18px; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.msg.assistant .prose { font-family: var(--font); font-size: 16px; }
.msg .cites { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.msg .cites a { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 10px 16px; background: var(--bg); border-top: 1px solid var(--border); z-index: 10; }
.composer form { max-width: 760px; margin: 0 auto; display: flex; gap: 8px; }
.composer .input { min-height: 48px; }
@media (min-width: 900px) { .composer { left: 232px; bottom: 0; } }
.typing span { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

/* ---------- progress ---------- */
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-2); }
.heat i.l1 { background: color-mix(in srgb, var(--good) 30%, var(--surface-2)); }
.heat i.l2 { background: color-mix(in srgb, var(--good) 55%, var(--surface-2)); }
.heat i.l3 { background: color-mix(in srgb, var(--good) 80%, var(--surface-2)); }
.heat i.l4 { background: var(--good); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; background: var(--mc); vertical-align: -1px; }
.mbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.mbar i { display: block; height: 100%; background: var(--mc); }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 34px 18px; }
.empty svg { width: 64px; height: 64px; margin: 0 auto 10px; color: var(--primary); }
.empty h3 { margin: 6px 0; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.notice.error { background: var(--bad-soft); color: var(--bad); }
.notice.info { background: var(--primary-soft); }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 100; padding: 12px 18px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 600; box-shadow: var(--shadow-lg); transition: all .25s ease; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.xp { background: var(--accent); color: #062a4a; }
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-mark { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--primary-soft); border-top-color: var(--primary); animation: spin 1s linear infinite; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; min-height: 70px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.celebrate { text-align: center; padding: 30px 10px; }
.celebrate .big-emoji { font-size: 64px; line-height: 1; }
.celebrate h2 { font-size: 28px; margin: 10px 0 6px; }
canvas.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; }
.modal-back { position: fixed; inset: 0; z-index: 90; background: rgba(5, 26, 46, .5); display: grid; place-items: end center; padding: 0; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: rise .2s ease; }
@media (min-width: 700px) { .modal-back { place-items: center; } .modal { border-radius: 22px; } }
.modal h3 { margin-top: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: .08em; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.page-title, .hello h2, .auth h2 { letter-spacing: -0.02em; }
.card { border-radius: var(--radius); }

/* =====================================================================
   v2 — sleek, modern, interactive (Haidar navy/teal system)
   ===================================================================== */
:root { --nav-h: 66px; --grad: linear-gradient(120deg, #062a4a 0%, #0b4f86 55%, #08a6ad 130%); --ring-soft: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
body { background: radial-gradient(900px 420px at 85% -80px, color-mix(in srgb, var(--teal) 14%, transparent), transparent), radial-gradient(800px 380px at -10% -60px, color-mix(in srgb, var(--primary) 12%, transparent), transparent), var(--bg); background-attachment: fixed; }
h1, h2, h3 { font-weight: 800; }

/* glass navigation */
.topbar { padding: 10px 16px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
.brand { font-size: 17px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 4px 14px rgba(6, 42, 74, .28); }
.tabbar { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: var(--nav-h); padding: 6px; border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); border-radius: 26px; background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); box-shadow: 0 18px 50px rgba(6, 42, 74, .22); }
.tabbar a { border-radius: 20px; transition: background .2s, color .2s, transform .2s; }
.tabbar a.active { color: #fff; background: var(--grad); box-shadow: 0 8px 20px rgba(8, 121, 185, .35); }
.tabbar a:active { transform: scale(.94); }
.shell { padding-bottom: calc(var(--nav-h) + 30px + env(safe-area-inset-bottom)); }
#toast { bottom: calc(var(--nav-h) + 30px + env(safe-area-inset-bottom)); }
.composer { bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .shell { padding-left: 252px; padding-bottom: 0; }
  .tabbar { left: 12px; top: 12px; bottom: 12px; right: auto; width: 228px; height: auto; border-radius: 26px; padding: 84px 12px 12px; grid-auto-rows: 50px; }
  .tabbar .side-brand { top: 24px; left: 22px; }
  .tabbar a { border-radius: 16px; }
  .composer { left: 252px; bottom: 0; }
  #toast { bottom: 30px; }
}

/* surfaces */
.card { border-color: color-mix(in srgb, var(--border) 85%, transparent); box-shadow: var(--shadow); }
.card.flat { box-shadow: none; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.btn { border-radius: 14px; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset; transition: transform .12s, box-shadow .2s, filter .2s; }
.btn:not(.soft):not(.ghost):not(.good):not(.danger) { background: var(--grad); box-shadow: 0 12px 28px rgba(8, 121, 185, .28); }
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn.big { min-height: 58px; font-size: 18px; border-radius: 18px; }
.chip { transition: all .15s; }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chip svg { width: 14px; height: 14px; margin-left: 4px; vertical-align: -2px; }
.input:focus { box-shadow: var(--ring-soft); }
.plan-item, .action, .topic-row, .pack { transition: transform .15s, border-color .15s, box-shadow .2s; }
.plan-item:hover, .action:hover, .topic-row:hover, .pack:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(6, 42, 74, .12); }
.plan-item .pi-icon { border-radius: 14px; }
.pi-learn { background: linear-gradient(135deg, var(--primary-soft), color-mix(in srgb, var(--teal) 22%, var(--primary-soft))); }
.action svg { padding: 7px; width: 38px; height: 38px; border-radius: 12px; background: var(--primary-soft); }

/* today */
.card.goal { --surface: #0c3d68; --surface-2: rgba(255,255,255,.2); background: var(--grad); color: #fff; border: 0; box-shadow: 0 22px 50px rgba(6, 42, 74, .32); position: relative; overflow: hidden; }
.card.goal::after { content: ""; position: absolute; right: -50px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(22, 201, 194, .45), transparent 70%); }
.card.goal .muted { color: rgba(255,255,255,.78); }
.card.goal .bar.accent > i { background: linear-gradient(90deg, #edab72, #ffd9b0); }
.coach { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; animation: rise .35s ease; }
.coach-av { width: 46px; height: 46px; border-radius: 14px; flex: none; box-shadow: 0 8px 20px rgba(6, 42, 74, .3); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-4px); } }
.coach-bubble { position: relative; flex: 1; padding: 12px 14px 14px; border-radius: 4px 20px 20px 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.coach-bubble b { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--primary); }
.coach-bubble p { margin: 4px 0 8px; font-size: 15.5px; }
.coach-bubble .btn { margin-top: 2px; }

/* lesson player */
.player-top { gap: 12px; }
.segs { flex: 1; display: flex; gap: 4px; }
.segs i { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; position: relative; }
.segs i::after { content: ""; position: absolute; inset: 0; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; border-radius: inherit; }
.segs i.on::after { transform: scaleX(1); }
.segs i.now::after { transform: scaleX(.35); }
.chip-xp.bump { animation: bump .45s ease; }
@keyframes bump { 30% { transform: scale(1.25); } }
.bite { animation: rise .35s cubic-bezier(.2, .8, .2, 1); }
.bite-kicker { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: var(--primary-soft); letter-spacing: .05em; font-size: 12px; }
.bite-kicker svg { width: 14px; height: 14px; }
.bite h3 { font-size: 26px; }
.bite-hero { padding: 26px 22px; border-radius: 26px; background: var(--grad); color: #fff; box-shadow: 0 22px 50px rgba(6, 42, 74, .3); position: relative; overflow: hidden; }
.bite-hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(237, 171, 114, .35), transparent 70%); }
.bite-hero .bite-kicker { background: rgba(255,255,255,.16); color: #fff; }
.bite-hero h3 { font-size: 30px; }
.bite-hero .prose, .bite-hero .muted { color: rgba(255,255,255,.9); }
.bite-hero .prose strong { color: #fff; }
.bite-card { padding: 22px 20px; border-radius: 24px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.bite-card h3 { margin-top: 10px; }
.bite-card.why { background: linear-gradient(135deg, color-mix(in srgb, var(--teal) 14%, var(--surface)), var(--surface)); }
.lead-text { font-size: 21px; line-height: 1.5; font-weight: 600; margin: 12px 0 0; }
.bite-card.real { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); }
.insight { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); font-weight: 600; }
.insight svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--accent); }
.bite-card.apply { border: 2px solid color-mix(in srgb, var(--primary) 55%, var(--border)); box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 10%, transparent), var(--shadow); }
.bite-card.beyond { border: 2px dashed color-mix(in srgb, var(--teal) 70%, var(--border)); background: color-mix(in srgb, var(--teal) 7%, var(--surface)); }
.badge-added { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: color-mix(in srgb, var(--teal) 18%, var(--surface)); color: color-mix(in srgb, var(--teal) 70%, var(--text)); font-size: 12px; font-weight: 800; }
.badge-added svg { width: 14px; height: 14px; }
.bite-card.share { background: var(--grad); color: #fff; border: 0; }
.bite-card.share .muted { color: rgba(255,255,255,.82); }
.bite-card.share .bite-kicker { background: rgba(255,255,255,.16); color: #fff; }
.share-text { white-space: pre-line; padding: 14px; margin: 12px 0; border-radius: 16px; background: rgba(255,255,255,.13); font-size: 15px; line-height: 1.55; }
.bite-card.share .btn.soft { background: rgba(255,255,255,.18); color: #fff; }
.bite-card.share .btn:not(.soft) { background: #fff; color: #062a4a; box-shadow: none; }
.option { border-radius: 16px; transition: transform .12s, border-color .15s, background .15s; }
.option:hover:not([disabled]) { transform: translateX(3px); background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.feedback { border-radius: 18px; }
.feedback.good { border: 1px solid color-mix(in srgb, var(--good) 40%, transparent); }
.feedback.bad { border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); }
.stars { display: flex; gap: 4px; margin-bottom: 8px; }
.stars svg { width: 28px; height: 28px; color: var(--border); }
.stars span.on svg { color: var(--accent); fill: var(--accent); animation: pop .4s ease backwards; }
.stars span:nth-child(2).on svg { animation-delay: .12s; } .stars span:nth-child(3).on svg { animation-delay: .24s; }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.3); } }
.pop { animation: pop .3s ease; }
.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* order + match + traps */
.order-done { list-style: none; counter-reset: o; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.order-done li { counter-increment: o; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--good-soft); border: 1px solid color-mix(in srgb, var(--good) 40%, transparent); font-weight: 600; }
.order-done li::before { content: counter(o); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--good); color: #fff; font-size: 13px; font-weight: 800; flex: none; }
.order-pool { display: grid; gap: 8px; }
.big-chip { text-align: left; border-radius: 14px; padding: 13px 14px; font-size: 15px; border-width: 2px; }
.match { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 8px; }
.match-col { display: grid; gap: 8px; align-content: start; }
.match-item { padding: 13px 12px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); text-align: left; cursor: pointer; font-size: 14.5px; line-height: 1.35; transition: all .15s; }
.match-item.term { font-weight: 800; }
.match-item:hover { border-color: var(--primary); }
.match-item.sel { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.02); }
.match-item.done { border-color: var(--good); background: var(--good-soft); opacity: .55; pointer-events: none; }
.traps { display: grid; gap: 8px; }
.trap { border-radius: 16px; border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.trap summary { display: flex; gap: 10px; align-items: flex-start; padding: 13px 14px; cursor: pointer; font-weight: 700; list-style: none; }
.trap summary::-webkit-details-marker { display: none; }
.trap summary svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--bad); }
.trap p { display: flex; gap: 10px; margin: 0; padding: 12px 14px; background: var(--good-soft); }
.trap p svg { width: 20px; height: 20px; flex: none; color: var(--good); margin-top: 2px; }
.celebrate .trophy { width: 96px; height: 96px; margin: 0 auto 8px; display: grid; place-items: center; border-radius: 30px; background: var(--grad); color: #ffd9b0; box-shadow: 0 22px 44px rgba(6, 42, 74, .35); animation: pop .6s ease; }
.celebrate .trophy svg { width: 52px; height: 52px; fill: currentColor; }
.next-up { margin: 18px auto 0; max-width: 380px; padding: 14px 16px; border-radius: 18px; background: var(--primary-soft); text-align: left; }
.next-up p { margin: 4px 0 0; }

/* onboarding + profile */
.wide-auth .card.onboard { max-width: 540px; }
.onboard .dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.onboard .dots i { width: 34px; height: 6px; border-radius: 99px; background: var(--surface-2); transition: background .2s; }
.onboard .dots i.on { background: var(--grad); }
.choice-grid { display: grid; gap: 8px; }
.choice { text-align: left; padding: 13px 14px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); font-weight: 700; cursor: pointer; }
.choice.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.tags .tag-list, .tags .tag-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tags .tag-sugg .chip { font-size: 13px; padding: 6px 10px; opacity: .85; }
.skipped summary { cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 700; list-style: none; }
.skipped summary::-webkit-details-marker { display: none; }
.skipped summary svg { width: 20px; height: 20px; color: var(--muted); }
.skipped summary small { margin-left: auto; color: var(--muted); font-weight: 600; }
.skip-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.skip-row .fr-body { flex: 1; min-width: 0; }
.skip-row .fr-body b { display: block; font-size: 14px; }
.skip-row .fr-body span { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.auth { background: radial-gradient(900px 500px at 50% -120px, color-mix(in srgb, var(--teal) 22%, transparent), transparent), radial-gradient(700px 400px at 100% 100%, color-mix(in srgb, var(--primary) 18%, transparent), transparent), var(--bg); }
.auth .card { border-radius: 28px; box-shadow: var(--shadow-lg); }
.auth .brand-mark { width: 60px; height: 60px; border-radius: 18px; }
.auth .brand { flex-direction: column; gap: 10px; text-align: center; }
.msg.user { background: var(--grad); }
.msg.assistant { border-radius: 20px 20px 20px 6px; }
.topic-num { border-width: 3px; }
.stat b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.player { padding-bottom: 96px; }
.player-foot { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); padding: 12px 16px; background: linear-gradient(transparent, var(--bg) 40%); z-index: 15; }
.player-foot .btn { max-width: 728px; margin: 0 auto; display: flex; }
@media (min-width: 900px) { .player-foot { left: 252px; bottom: 0; } }

/* ---------- avatar, top actions, photo row ---------- */
.grow { flex: 1; }
.avatar { --s: 36px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, var(--primary), var(--teal)); color: #fff; font-weight: 800; font-size: calc(var(--s) * .38); letter-spacing: .02em; box-shadow: 0 0 0 2px var(--surface), 0 2px 8px rgba(5, 42, 74, .18); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.top-avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.top-avatar:hover { background: var(--surface-2); text-decoration: none; }
.signout { color: var(--muted); }
.signout:hover { color: var(--bad); }
.photo-row { display: flex; align-items: center; gap: 16px; }
.photo-row .row { display: flex; flex-wrap: wrap; align-items: center; }

/* ---------- sign-in / join (v0.2.3) ---------- */
.auth2 { min-height: 100dvh; display: flex; flex-direction: column; background: #041a30; }
.auth-hero { position: relative; overflow: hidden; color: #fff; padding: calc(34px + env(safe-area-inset-top)) 24px 70px; background: linear-gradient(160deg, #0b4f86 0%, #062a4a 58%, #041a30 100%); }
.auth-hero .glow { position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; }
.auth-hero .g1 { width: 340px; height: 340px; right: -90px; top: -110px; background: rgba(22, 201, 194, .42); }
.auth-hero .g2 { width: 300px; height: 300px; left: -120px; bottom: -150px; background: rgba(237, 171, 114, .28); }
.hero-in { position: relative; max-width: 460px; margin: 0 auto; text-align: center; }
.hero-logo { display: inline-grid; margin-bottom: 14px; filter: drop-shadow(0 14px 28px rgba(0, 0, 0, .4)); }
.hero-mark { width: 76px; height: 76px; border-radius: 22px; }
.hero-by { margin: 0; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; color: #7fe3de; }
.auth-hero h1 { margin: 8px 0 4px; font-size: clamp(30px, 8vw, 44px); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; color: #fff; }
.hero-tag { margin: 0; color: #d6e8f5; font-size: 17px; }
.hero-points { display: none; list-style: none; margin: 34px 0 0; padding: 0; text-align: left; gap: 16px; }
.hero-points li { display: flex; gap: 14px; align-items: flex-start; }
.hero-points .pt-ico { flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: #7fe3de; }
.hero-points .pt-ico svg { width: 22px; height: 22px; }
.hero-points b { display: block; font-size: 17px; }
.hero-points small { display: block; color: #bcd4e6; font-size: 14px; margin-top: 2px; }
.auth-sheet { flex: 1; position: relative; margin-top: -34px; background: var(--bg); border-radius: 30px 30px 0 0; padding: 30px 22px calc(28px + env(safe-area-inset-bottom)); box-shadow: 0 -18px 50px rgba(2, 20, 38, .35); }
.auth-form { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-form h2 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.025em; text-align: left; }
.auth-form .lead { text-align: left; margin: 0 0 22px; color: var(--muted); }
.auth-form .field > span:first-child { font-size: 13px; letter-spacing: .02em; color: var(--muted); }
.in-wrap { position: relative; display: block; }
.in-wrap .input { padding-left: 46px; min-height: 52px; border-radius: 14px; background: var(--surface); }
.in-wrap .in-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; pointer-events: none; }
.in-wrap .in-ico svg { width: 20px; height: 20px; }
.in-wrap:focus-within .in-ico { color: var(--primary); }
.in-wrap .in-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.in-wrap .in-eye:hover { color: var(--text); background: var(--surface-2); }
.in-wrap .in-eye svg { width: 20px; height: 20px; }
.in-wrap:has(.in-eye) .input { padding-right: 52px; }
.auth-form .btn.big { margin-top: 4px; }
.auth-form .brand-by { margin-top: 26px; }
@media (min-width: 900px) {
  .auth2 { flex-direction: row; }
  .auth-hero { flex: 1.05; display: grid; place-items: center; padding: 48px; }
  .hero-in { text-align: left; max-width: 480px; }
  .hero-logo { margin-bottom: 22px; }
  .hero-mark { width: 92px; height: 92px; border-radius: 26px; }
  .hero-points { display: grid; }
  .auth-sheet { flex: 1; margin: 0; border-radius: 0; box-shadow: none; display: grid; place-items: center; padding: 48px; }
}
@media (max-height: 640px) and (max-width: 899px) { .auth-hero { padding-bottom: 54px; } .hero-logo { display: none; } }

/* ---------- organise choice + split hint (v0.2.4) ---------- */
.organise { margin-top: 16px; padding: 14px; border: 1.5px solid var(--border); border-radius: 18px; background: var(--surface); }
.organise[hidden] { display: none; }
.organise .opts { display: grid; gap: 8px; }
.organise .opt { text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--bg); cursor: pointer; display: grid; gap: 2px; }
.organise .opt b { font-size: 15px; }
.organise .opt span { font-size: 13px; color: var(--muted); }
.organise .opt.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.split-hint { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.split-hint span { flex: 1 1 200px; }

/* ======================= v0.3 — Learn with Maryam ======================= */
.maryam-face { width: var(--s, 40px); height: var(--s, 40px); border-radius: 50%; object-fit: cover; flex: none; background: #e8f3fa; }

/* ---- floating companion ---- */
.maryam { position: fixed; z-index: 60; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); }
.maryam.with-nav { bottom: calc(var(--nav-h) + 26px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .maryam.with-nav { bottom: 24px; } .maryam { right: 24px; } }
.mm-fab { display: flex; align-items: center; gap: 0; padding: 4px; border: 0; border-radius: 99px; background: linear-gradient(135deg, #16c9c2, #0879b9 60%, #062a4a); color: #fff; cursor: pointer; box-shadow: 0 14px 34px rgba(6, 42, 74, .35); transition: transform .2s, gap .2s, padding .2s; }
.mm-fab .maryam-face { border: 3px solid #fff; }
.mm-fab-label { max-width: 0; overflow: hidden; white-space: nowrap; font-weight: 700; transition: max-width .3s, margin .3s; }
.mm-fab:hover { transform: translateY(-2px); }
@media (hover: hover) { .mm-fab:hover .mm-fab-label { max-width: 140px; margin: 0 14px 0 10px; } }
.mm-fab::after { content: ""; position: absolute; right: 4px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #22c55e; border: 2.5px solid #fff; }
.maryam.open .mm-fab { transform: scale(0); pointer-events: none; }
.mm-panel { position: absolute; right: 0; bottom: 0; width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100dvh - 120px)); display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--border); border-radius: 26px; box-shadow: 0 30px 80px rgba(2, 20, 38, .35); overflow: hidden; transform-origin: bottom right; transform: scale(.6) translateY(20px); opacity: 0; pointer-events: none; transition: transform .22s cubic-bezier(.2, .9, .3, 1.2), opacity .18s; }
.maryam.open .mm-panel { transform: none; opacity: 1; pointer-events: auto; }
@media (max-width: 560px) {
  .maryam.open { inset: 0; }
  .maryam.open .mm-panel { position: fixed; inset: 0; width: 100%; height: 100dvh; border-radius: 0; border: 0; }
}
.mm-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; color: #fff; background: linear-gradient(130deg, #0b4f86, #062a4a 70%); }
.mm-head b { display: block; font-size: 17px; }
.mm-head small { color: #bcd4e6; font-size: 12.5px; }
.mm-head .icon-btn { color: #fff; }
.mm-head .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.mm-av { position: relative; display: inline-grid; }
.mm-av .maryam-face { border: 2px solid rgba(255, 255, 255, .8); }
.mm-av .online { position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid #062a4a; }
.mm-chat { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.mm-row { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; }
.mm-msg { padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.5; }
.mm-msg.bot { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.mm-msg.bot .prose { font-family: var(--font); font-size: 15px; line-height: 1.5; }
.mm-msg.bot .prose p { margin: 0 0 6px; } .mm-msg.bot .prose p:last-child { margin: 0; }
.mm-msg.bot .prose blockquote { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--teal); background: var(--surface-2); border-radius: 8px; font-size: 14px; }
.mm-msg.user { align-self: flex-end; max-width: 85%; color: #fff; background: linear-gradient(120deg, #0879b9, #062a4a); border-bottom-right-radius: 6px; }
.mm-msg .cites { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.mm-msg .cites a { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: var(--primary-soft); }
.dots3 { display: inline-flex; gap: 4px; padding: 4px 0; }
.dots3 i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1.2s infinite; }
.dots3 i:nth-child(2) { animation-delay: .15s; } .dots3 i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.mm-quick { padding: 0 12px; }
.mm-chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.mm-chips .chip { white-space: nowrap; font-size: 13px; padding: 7px 11px; }
.mm-form { display: flex; gap: 8px; padding: 6px 12px 4px; }
.mm-form .input { border-radius: 99px; min-height: 46px; }
.mm-form .btn { border-radius: 99px; width: 46px; padding: 0; }
.mm-note { margin: 2px 0 10px; text-align: center; font-size: 11px; color: var(--muted); padding: 0 12px; }

/* ---- onboarding: role choice + Maryam hello ---- */
.maryam-hello { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 10px; }
.maryam-hello .maryam-face { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--teal); }
.maryam-hello .bubble { background: var(--primary-soft); padding: 10px 14px; border-radius: 16px 16px 16px 4px; font-size: 14.5px; line-height: 1.45; }
.role-grid { display: grid; gap: 10px; }
@media (min-width: 520px) { .role-grid { grid-template-columns: 1fr 1fr; } }
.role-card { text-align: left; display: grid; gap: 4px; padding: 16px; border-radius: 18px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; transition: all .15s; }
.role-card b { font-size: 16px; } .role-card > span:last-child { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.role-card .rc-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 6px; }
.role-card .rc-ico svg { width: 22px; height: 22px; }
.role-card.on { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); background: color-mix(in srgb, var(--primary-soft) 60%, var(--surface)); }
.role-card.on .rc-ico { background: var(--grad, var(--primary)); color: #fff; }

/* ---- landing ---- */
.landing { background: var(--bg); min-height: 100dvh; }
.l-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.l-nav { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: color-mix(in srgb, #062a4a 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.l-nav .brand { color: #fff; font-size: 17px; }
.l-nav nav { display: flex; align-items: center; gap: 18px; }
.l-nav nav a { color: #d6e8f5; font-weight: 600; font-size: 14.5px; }
.l-nav nav a.btn { color: #fff; }
@media (max-width: 720px) { .l-nav nav a:not(.btn) { display: none; } .l-nav .brand { font-size: 15px; } }
.l-hero { position: relative; overflow: hidden; color: #fff; padding: 56px 0 84px; background: linear-gradient(150deg, #0b4f86 0%, #062a4a 55%, #041a30 100%); }
.l-hero .glow { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.l-hero .g1 { width: 480px; height: 480px; right: -120px; top: -140px; background: rgba(22, 201, 194, .4); }
.l-hero .g2 { width: 420px; height: 420px; left: -160px; bottom: -220px; background: rgba(237, 171, 114, .25); }
.l-hero-grid { position: relative; display: grid; gap: 44px; align-items: center; }
@media (min-width: 900px) { .l-hero-grid { grid-template-columns: 1.1fr .9fr; } .l-hero { padding: 84px 0 110px; } }
.eyebrow { margin: 0 0 12px; font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; font-weight: 800; color: #7fe3de; }
.eyebrow.dark { color: var(--teal); }
.l-hero h1 { margin: 0; font-size: clamp(40px, 7vw, 68px); line-height: 1.02; letter-spacing: -.04em; font-weight: 800; color: #fff; }
.grad { background: linear-gradient(100deg, #7fe3de, #edab72); -webkit-background-clip: text; background-clip: text; color: transparent; }
.l-lead { font-size: 19px; line-height: 1.55; color: #d6e8f5; margin: 20px 0 28px; max-width: 560px; }
.l-lead.dark { color: var(--muted); }
.l-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.l-cta.center { justify-content: center; }
.btn.ghost-light { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .3); box-shadow: none; }
.btn.light { background: #fff !important; color: #062a4a; }
.l-small { margin: 16px 0 0; font-size: 13px; color: #9fbcd2; }
.l-phone { position: relative; max-width: 420px; justify-self: center; width: 100%; }
.l-card { position: relative; z-index: 1; background: rgba(255, 255, 255, .97); color: #18242e; border-radius: 28px; padding: 18px; box-shadow: 0 40px 90px rgba(0, 0, 0, .45); display: grid; gap: 10px; }
.l-card-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid #e5edf2; }
.l-card-head b { display: block; } .l-card-head small { color: #0f9d6b; font-weight: 600; }
.l-msg { padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; max-width: 90%; }
.l-msg.bot { background: #eef5f9; border-bottom-left-radius: 6px; }
.l-msg.user { justify-self: end; background: linear-gradient(120deg, #0879b9, #062a4a); color: #fff; border-bottom-right-radius: 6px; }
.l-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.l-chips span { font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 99px; border: 1px solid #d5e3ec; color: #0879b9; }
.l-float { position: absolute; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 16px; background: #fff; color: #062a4a; box-shadow: 0 16px 40px rgba(0, 0, 0, .3); font-size: 14px; animation: floaty 5s ease-in-out infinite; }
.l-float svg { width: 18px; height: 18px; color: #e86a2c; }
.l-float.f1 { top: -18px; right: -6px; } .l-float.f2 { bottom: -20px; left: -10px; animation-delay: -2.5s; } .l-float.f2 svg { color: #0f9d6b; }
@keyframes floaty { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .l-float { animation: none; } }
.l-band { background: var(--surface); border-bottom: 1px solid var(--border); }
.l-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; padding: 26px 20px; }
@media (min-width: 800px) { .l-stats { grid-template-columns: repeat(4, 1fr); } }
.l-stats b { display: block; font-size: 22px; letter-spacing: -.02em; color: var(--primary-2); }
:root[data-theme="dark"] .l-stats b { color: #7fe3de; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .l-stats b { color: #7fe3de; } }
.l-stats span { color: var(--muted); font-size: 14px; }
.l-sec { padding: 72px 0; }
.l-sec.alt { background: color-mix(in srgb, var(--surface-2) 55%, var(--bg)); }
.l-sec h2, .l-ent h2 { font-size: clamp(28px, 4.4vw, 42px); letter-spacing: -.03em; line-height: 1.1; margin: 0 0 30px; max-width: 760px; }
.l-steps, .l-features { display: grid; gap: 16px; }
@media (min-width: 800px) { .l-steps { grid-template-columns: repeat(3, 1fr); } .l-features { grid-template-columns: repeat(3, 1fr); } }
.l-step, .l-feat { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 24px; box-shadow: var(--shadow); }
.l-step h3, .l-feat h3 { margin: 14px 0 6px; font-size: 19px; }
.l-step p, .l-feat p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 15px; }
.l-num { position: absolute; right: 20px; top: 16px; font-size: 44px; font-weight: 800; color: color-mix(in srgb, var(--primary) 14%, transparent); }
.l-ico { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #16c9c2, #0879b9 70%); box-shadow: 0 10px 24px rgba(8, 121, 185, .25); }
.l-ico svg { width: 24px; height: 24px; }
.l-split { display: grid; gap: 18px; }
@media (min-width: 800px) { .l-split { grid-template-columns: 1fr 1fr; } }
.l-who { border-radius: 26px; padding: 30px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.l-who.pro { color: #fff; background: linear-gradient(150deg, #0b4f86, #062a4a 70%); border: 0; }
.l-who h3 { font-size: 24px; letter-spacing: -.02em; margin: 14px 0 8px; }
.l-who p { line-height: 1.6; margin: 0; color: var(--muted); } .l-who.pro p { color: #d6e8f5; }
.l-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: 13px; background: var(--primary-soft); color: var(--primary); }
.l-who.pro .l-tag { background: rgba(255, 255, 255, .14); color: #7fe3de; }
.l-tag svg { width: 16px; height: 16px; }
.l-certs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.l-certs span { padding: 5px 10px; border-radius: 10px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); font-size: 12.5px; font-weight: 700; }
.l-ent { display: grid; gap: 34px; align-items: center; }
@media (min-width: 900px) { .l-ent { grid-template-columns: 1.2fr .8fr; } }
.l-list { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 10px; }
.l-list li { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.l-list svg { width: 20px; height: 20px; color: var(--good); flex: none; }
.l-maryam { display: grid; justify-items: center; gap: 16px; }
.l-maryam .maryam-face.big { box-shadow: 0 0 0 8px var(--surface), 0 0 0 12px var(--teal), 0 30px 60px rgba(6, 42, 74, .3); }
.l-quote { max-width: 320px; text-align: center; font-family: var(--read); font-size: 18px; line-height: 1.5; }
.l-quote b { display: block; font-family: var(--font); font-size: 14px; color: var(--muted); margin-top: 6px; }
.l-final { padding: 72px 0; text-align: center; color: #fff; background: linear-gradient(130deg, #0879b9, #062a4a 70%); }
.l-final h2 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.03em; margin: 0 0 10px; }
.l-final p { color: #d6e8f5; font-size: 18px; margin: 0 0 26px; }
.l-foot { padding: 26px 0 110px; font-size: 14px; }
.l-foot .l-wrap { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; }
.l-foot .brand-mark { width: 22px; height: 22px; vertical-align: middle; }
.linklike { border: 0; background: none; color: var(--primary); font: inherit; cursor: pointer; padding: 0; }

/* ---- plans ---- */
.plans-wrap { padding-top: 34px; padding-bottom: 110px; }
.plans-head { text-align: center; margin-bottom: 18px; }
.plans-head .lead { margin: 6px auto 16px; }
.billing-toggle em { font-style: normal; color: var(--good); font-size: 12px; }
.pilot-note { display: flex; align-items: center; gap: 12px; margin: 0 auto 18px; max-width: 760px; }
.plan-grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .plan-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .plan-grid { grid-template-columns: repeat(4, 1fr); } }
.plan { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 24px 20px 20px; border-radius: 24px; background: var(--surface); border: 1.5px solid var(--border); box-shadow: var(--shadow); }
.plan h3 { margin: 0; font-size: 20px; }
.plan.hot { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent), var(--shadow-lg); }
.plan.current { border-color: var(--good); }
.plan .ribbon { position: absolute; top: -12px; left: 20px; padding: 4px 12px; border-radius: 99px; color: #fff; font-size: 12px; font-weight: 800; background: linear-gradient(110deg, #0879b9, #16c9c2); }
.plan .price b { font-size: 32px; letter-spacing: -.03em; } .plan .price small { display: block; color: var(--muted); font-size: 13px; }
.plan ul { list-style: none; padding: 0; margin: 10px 0 18px; display: grid; gap: 8px; flex: 1; }
.plan li { display: flex; gap: 8px; font-size: 14px; line-height: 1.4; } .plan li svg { width: 18px; height: 18px; color: var(--good); flex: none; margin-top: 1px; }
.usage-card { display: grid; gap: 10px; max-width: 760px; margin: 0 auto 18px; }
.use-row { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 10px; align-items: center; font-size: 14px; }
.plan-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px; }
.coach-av.maryam-face { --s: 46px; border-radius: 50%; border: 2px solid var(--surface); }
.plan-set { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .small-select { min-height: 34px; padding: 4px 8px; width: auto; font-size: 13px; border-radius: 9px; } .plan-link { display: block; color: inherit; } .plan-link:hover { text-decoration: none; border-color: var(--primary); }
.mm-actions { display: grid; gap: 6px; margin-top: 10px; } .mm-actions .btn { justify-content: space-between; } .topbar .brand { min-width: 0; flex-shrink: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } @media (max-width: 420px) { .topbar .brand { font-size: 15px; } }
.l-small.dark { color: var(--muted); margin: -10px 0 18px; }
.tabbar .side-brand { white-space: nowrap; font-size: 15px; }
.role-nudge { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: inherit; } .role-nudge:hover { text-decoration: none; } .role-nudge span { flex: 1; } .role-nudge svg { width: 20px; height: 20px; flex: none; }
@media (max-width: 440px) { .topbar .brand { font-size: 0; gap: 0; } }

/* ---------- timetable & reminders (v0.3.1) ---------- */
.next-session { display: flex; align-items: center; gap: 10px; color: inherit; margin: 12px 0; }
.next-session:hover { text-decoration: none; }
.next-session span { flex: 1; } .next-session svg { width: 20px; height: 20px; flex: none; }
.next-session em { font-style: normal; color: var(--good); font-weight: 700; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0; }
.wk-day { display: grid; gap: 4px; justify-items: center; align-content: start; padding: 8px 2px; min-height: 64px; border-radius: 14px; background: var(--surface-2); font-size: 11.5px; }
.wk-day b { font-size: 12px; color: var(--muted); }
.wk-day.has { background: var(--primary-soft); }
.wk-day.has b { color: var(--primary); }
.wk-day span { padding: 2px 5px; border-radius: 8px; background: var(--surface); font-weight: 700; white-space: nowrap; }
.slot-list { display: grid; gap: 8px; }
.slot-row { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); }
.slot-main { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 6px; align-items: center; }
.slot-sub { display: grid; grid-template-columns: 110px 1fr; gap: 6px; }
.slot-row .small-select { width: 100%; }
.slot-row small { font-size: 12.5px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); cursor: pointer; }
.switch-row b { display: block; } .switch-row small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.switch-row.off { opacity: .6; cursor: not-allowed; }
.switch { position: relative; flex: none; width: 50px; height: 30px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--border); transition: background .2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + i { background: var(--good); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }
.soft-hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0 12px; }
.tt-link { display: flex; align-items: center; gap: 12px; }
.tt-link > span:nth-child(2) { flex: 1; }
.tt-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #16c9c2, #0879b9 70%); }
.tt-ico svg { width: 22px; height: 22px; }
.email-to { padding: 0 0 12px; } .email-form { display: grid; gap: 8px; margin-top: 8px; }

/* ---------- sign-in hero v3 (v0.4) ---------- */
.hero3 { padding: calc(18px + env(safe-area-inset-top)) 20px 64px; background: #041a30; isolation: isolate; }
.hero3 .mesh { position: absolute; inset: -20%; z-index: -2; background: linear-gradient(160deg, #0b4f86 0%, #062a4a 55%, #041a30 100%); }
.hero3 .mesh i { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .75; animation: drift 14s ease-in-out infinite alternate; }
.hero3 .mesh .o1 { width: 46%; aspect-ratio: 1; right: 4%; top: 6%; background: #16c9c2; opacity: .45; }
.hero3 .mesh .o2 { width: 40%; aspect-ratio: 1; left: 2%; bottom: 8%; background: #edab72; opacity: .32; animation-delay: -5s; }
.hero3 .mesh .o3 { width: 34%; aspect-ratio: 1; left: 38%; top: 30%; background: #0879b9; opacity: .5; animation-delay: -9s; }
@keyframes drift { to { transform: translate(6%, -5%) scale(1.12); } }
.hero3 .stars { position: absolute; inset: 0; z-index: -1; opacity: .5; background-image: radial-gradient(1.5px 1.5px at 12% 22%, #fff, transparent), radial-gradient(1px 1px at 72% 14%, #fff, transparent), radial-gradient(1.5px 1.5px at 86% 62%, #fff, transparent), radial-gradient(1px 1px at 30% 78%, #fff, transparent), radial-gradient(1px 1px at 52% 40%, #fff, transparent), radial-gradient(1.5px 1.5px at 92% 88%, #fff, transparent); }
.hero3 .hero-in { text-align: center; max-width: 520px; }
.hero-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.hero-brand:hover { text-decoration: none; }
.hero3 .hero-mark { width: 38px; height: 38px; border-radius: 12px; }
.hero-stage { position: relative; width: min(250px, 62vw); aspect-ratio: 1; margin: 22px auto 18px; }
.portrait { position: absolute; inset: 0; border-radius: 50%; padding: 6px; background: conic-gradient(from 200deg, #16c9c2, #7fe3de, #edab72, #0879b9, #16c9c2); box-shadow: 0 0 0 10px rgba(22, 201, 194, .12), 0 30px 70px rgba(0, 0, 0, .45); animation: halo 10s linear infinite; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; border-radius: 50%; border: 5px solid #062a4a; background: #f5f3ee; display: block; animation: counter 10s linear infinite; }
@keyframes halo { to { transform: rotate(360deg); } }
@keyframes counter { to { transform: rotate(-360deg); } }
.portrait .online { position: absolute; right: 13%; bottom: 9%; width: 20px; height: 20px; border-radius: 50%; background: #22c55e; border: 4px solid #062a4a; animation: counter 10s linear infinite; }
.hero-stage .bubble { position: absolute; left: 58%; top: -6px; width: max-content; max-width: 210px; padding: 10px 14px; border-radius: 18px 18px 18px 4px; background: #fff; color: #062a4a; font-size: 13.5px; font-weight: 600; line-height: 1.35; text-align: left; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); animation: pop .6s .4s both cubic-bezier(.2, .9, .3, 1.3); }
.hero-stage .chip { position: absolute; display: flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 14px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; font-size: 12.5px; white-space: nowrap; animation: pop .5s both cubic-bezier(.2, .9, .3, 1.3), bob 5s ease-in-out infinite; }
.hero-stage .chip svg { width: 16px; height: 16px; color: #7fe3de; }
.hero-stage .c1 { left: -28%; top: 30%; animation-delay: .8s, 1.3s; } .hero-stage .c1 svg { color: #fb923c; }
.hero-stage .c2 { right: -30%; top: 56%; animation-delay: 1s, 0s; } .hero-stage .c2 svg { color: #4ade80; }
.hero-stage .c3 { left: -16%; bottom: -2%; animation-delay: 1.2s, 2.4s; }
@keyframes pop { from { opacity: 0; transform: scale(.6) translateY(10px); } }
@keyframes bob { 50% { translate: 0 -6px; } }
.hero3 h1 { font-size: clamp(26px, 7.4vw, 50px); line-height: 1.05; margin: 10px 0 0; }
@media (max-width: 420px) { .hero-stage .c3 { display: none; } .hero-stage .bubble { left: 48%; max-width: 170px; font-size: 12.5px; } .hero-stage .c1 { left: -22%; } .hero-stage .c2 { right: -24%; } }
@media (max-height: 700px) and (max-width: 899px) { .hero-stage { width: 170px; margin: 14px auto 10px; } .hero-stage .chip { display: none; } .hero3 h1 { font-size: 26px; } }
@media (min-width: 900px) {
  .hero3 .hero-in { text-align: left; }
  .hero3 .hero-stage { width: 300px; margin: 34px 0 28px 60px; }
  .hero3 .hero-points { display: grid; margin-top: 28px; }
  .hero3 h1 { font-size: 46px; }
}
@media (prefers-reduced-motion: reduce) { .hero3 *, .hero3 *::before { animation: none !important; } }
.hero3 h1 .grad { display: block; } @media (max-height: 700px) and (max-width: 899px) { .hero3 h1 { font-size: 23px; } }

/* ---------- admin uploads ---------- */
.up-filters { display: grid; gap: 8px; margin: 12px 0; }
@media (min-width: 700px) { .up-filters { grid-template-columns: 1fr 1fr; } }
.up-list { display: grid; gap: 10px; margin-top: 12px; }
.up-card { padding: 14px; }
.up-top { display: flex; gap: 12px; align-items: center; }
.up-top b { display: block; word-break: break-word; }
.up-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.up-meta .pill { padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--text); font-weight: 600; }
.up-meta .pill.good { background: var(--good-soft); color: var(--good); }
.up-meta .pill.bad { background: var(--bad-soft); color: var(--bad); }
.up-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.text-view { max-height: 60vh; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.5; background: var(--surface-2); padding: 12px; border-radius: 12px; }

/* ---------- install the app ---------- */
.install-hero { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.install-hero img { border-radius: 16px; box-shadow: var(--shadow); }
.install-hero b { display: block; } .install-hero small { color: var(--muted); font-size: 13px; }
.install-steps ol { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.install-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font-size: 15px; }
.install-steps li > span:nth-child(2) { flex: 1; }
.st-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--grad, var(--primary)); color: #fff; font-weight: 800; font-size: 14px; }
.ios-share { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface); color: #0a84ff; }
.ios-share svg { width: 20px; height: 20px; }
.install-banner { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; margin: 0 0 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.install-banner img { border-radius: 11px; }
.install-banner b { display: block; font-size: 14.5px; } .install-banner small { color: var(--muted); font-size: 12.5px; }

/* ---------- mobile polish (v0.4) ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
button, a, .chip, .btn, input, select { touch-action: manipulation; }
.topbar { padding-top: calc(10px + env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.l-nav { padding-top: calc(12px + env(safe-area-inset-top)); }
.mm-chat, .text-view, .modal { overscroll-behavior: contain; }
.mm-panel { padding-bottom: env(safe-area-inset-bottom); }
.mm-head { padding-top: calc(14px + env(safe-area-inset-top) * var(--mm-full, 0)); }
@media (max-width: 560px) { .maryam.open .mm-panel { --mm-full: 1; } }
@media (max-width: 700px) {
  .input, select.input, textarea.input, .mm-form .input { font-size: 16px; } /* stops iOS zooming into fields */
  .icon-btn { min-width: 44px; min-height: 44px; }
  .btn { min-height: 48px; }
  .btn.small { min-height: 40px; }
  .card { border-radius: 20px; }
  .main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}
@media (hover: none) { .chip:hover { background: var(--surface); border-color: var(--border); color: inherit; } .chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); } }
@media (display-mode: standalone) { .install-only-browser { display: none !important; } }
.store-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.store-btn { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .35); color: #fff; cursor: pointer; text-align: left; font: inherit; }
.store-btn:hover { background: rgba(0, 0, 0, .5); }
.store-btn small { display: block; font-size: 11px; opacity: .8; line-height: 1.1; } .store-btn b { font-size: 16px; line-height: 1.15; }
.sb-ic { font-size: 22px; width: 26px; text-align: center; }
.nav-install svg { width: 16px; height: 16px; }
@media (max-width: 720px) { .l-nav .nav-install { display: none; } }
.install-card { text-align: center; max-width: 480px; margin: 0 auto; padding: 30px 22px; }
.install-card img { border-radius: 24px; box-shadow: var(--shadow-lg); }
.install-card h2 { margin: 16px 0 6px; }

/* ---------- welcome video / guide ---------- */
.guide-video { display: block; width: 100%; max-width: 300px; aspect-ratio: 9 / 16; height: auto; margin: 0 auto 14px; border-radius: 22px; background: #062a4a; box-shadow: var(--shadow-lg); object-fit: cover; }
.guide-steps { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.guide-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.guide-steps b { display: block; font-size: 15px; } .guide-steps small { color: var(--muted); font-size: 13px; }
.gs-ic { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #16c9c2, #0879b9 70%); }
.gs-ic svg { width: 18px; height: 18px; }
.guide-modal .guide-video { max-height: 52dvh; width: auto; }
.guide-page { display: grid; gap: 22px; align-items: start; }
@media (min-width: 860px) { .guide-page { grid-template-columns: 340px 1fr; } .guide-page .guide-video { max-width: 340px; } }
.l-play { position: relative; z-index: 3; display: inline-flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 8px 16px 8px 8px; border-radius: 99px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28); color: #fff; backdrop-filter: blur(8px); }
.l-play:hover { text-decoration: none; background: rgba(255, 255, 255, .2); }
.l-play .pl-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #0879b9; }
.l-play .pl-ic svg { width: 18px; height: 18px; margin-left: 2px; }
.l-play b { display: block; font-size: 14.5px; } .l-play small { color: #bcd4e6; font-size: 12px; }

/* ---------- calmer sign-in (v0.4.2) ---------- */
.hero3.calm { padding-bottom: 56px; }
.hero3.calm .portrait { animation: none; box-shadow: 0 0 0 8px rgba(22, 201, 194, .12), 0 24px 60px rgba(0, 0, 0, .4); }
.hero3.calm .portrait img { animation: none; }
.hero3.calm .hero-stage { width: min(170px, 44vw); margin: 22px auto 16px; }
.hero3.calm h1 { font-size: clamp(24px, 6.6vw, 44px); }
.hero-sub { margin: 10px 0 0; color: #bcd4e6; font-size: 15.5px; }
@media (max-height: 700px) and (max-width: 899px) { .hero3.calm .hero-stage { width: 120px; margin: 14px auto 10px; } .hero-sub { display: none; } }
@media (min-width: 900px) {
  .hero3.calm .hero-in { max-width: 440px; }
  .hero3.calm .hero-stage { width: 230px; margin: 40px 0 30px; }
  .hero-sub { font-size: 18px; }
}
.hero3.calm .mesh .o2 { opacity: .16; }


/* ---------- light + dark combined (v0.4.3) ----------
   Default look: light pages with the brand's deep-navy panels (top bar, heroes, highlight cards).
   Full dark mode only when chosen in Me → Appearance ("Dark", or "Match my phone"). */
.btn:not(.soft):not(.ghost):not(.good):not(.danger):not(.light) { color: #fff; }
.topbar { background: linear-gradient(120deg, #062a4a 0%, #0b4f86 70%, #0a6f8f 120%) !important; color: #fff; border-bottom: 0 !important; box-shadow: 0 6px 24px rgba(4, 26, 48, .18); }
.topbar .brand, .topbar h1 { color: #fff; }
.topbar .icon-btn { color: #e6f1f8; }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.topbar .signout:hover { color: #fecaca; }
.topbar .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.topbar .top-avatar:hover { background: rgba(255, 255, 255, .12); }
.topbar .chip-xp { background: rgba(255, 255, 255, .14); color: #ffe2c2; }
.topbar .chip-streak { background: rgba(251, 146, 60, .22); color: #fed7aa; }
.topbar .brand-mark { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3)); }
.tabbar .side-brand { color: var(--text); }
.l-play { margin-bottom: 30px; }
.faq-list { display: grid; gap: 10px; margin-bottom: 10px; }
.faq-item { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); }
.try-out { margin-top: 12px; }
.mm-msg .prose ul { margin: 6px 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.mm-msg .prose a { font-weight: 700; }

/* SabiPass study passes */
@media (min-width: 1000px) { .plan-grid.passes-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pass-status { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 12px 0 30px; color: var(--muted); font-size: 14px; }
.pass-status svg { width: 20px; height: 20px; flex: none; }
.pass-explainer { margin-top: 28px; }
.pass-explainer p { margin-top: 12px; line-height: 1.7; }
.pass-support { margin: 28px 0 10px; }
.payment-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.payment-row:last-child { border-bottom: 0; }
.payment-row > div { min-width: 0; }
.payment-row p { margin: 4px 0; }
.payment-ref { display: block; font-size: 11px; overflow-wrap: anywhere; margin: 8px 0; color: var(--muted); }
.payment-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 10px; }
.payment-state { border-radius: 30px; padding: 5px 12px; background: var(--bg); font-size: 12px; }
.payment-return { max-width: 600px; margin: 40px auto; display: grid; gap: 20px; text-align: center; }
.payment-return .brand-mark { margin: auto; }
.launch-checks { list-style: none; display: grid; gap: 12px; padding: 0; margin: 20px 0; }
.launch-checks li { display: flex; gap: 12px; }
@media (max-width: 550px) { .payment-row { align-items: flex-start; flex-direction: column; gap: 8px; } .payment-actions { align-items: flex-start; } .plans-head .page-title { font-size: 28px; } }
