:root {
  color-scheme: light dark;
  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --text: #17201d;
  --muted: #5b6763;
  --border: #d9e0dd;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #ccfbf1;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 16px rgb(0 0 0 / 5%);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1413;
    --surface: #171e1c;
    --surface-2: #1f2826;
    --text: #e5ece9;
    --muted: #9aa8a3;
    --border: #2c3835;
    --accent: #2dd4bf;
    --accent-ink: #062b27;
    --accent-soft: #134e48;
    --good: #4ade80;
    --warn: #fbbf24;
    --bad: #f87171;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
code, pre { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em; }
pre { background: var(--surface-2); padding: .75rem; border-radius: 8px; overflow-x: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--surface); padding: .5rem; }

.topbar {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: .75rem max(1rem, calc((100vw - 1100px) / 2));
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.topbar nav a { padding: .4rem .75rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; }
.topbar nav a:hover { color: var(--text); background: var(--surface-2); }
.topbar nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }
.status { margin-left: auto; font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.status::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--muted); }
.status.ok::before { background: var(--good); }
.status.bad::before { background: var(--bad); }
.status.busy::before { background: var(--warn); }
a.status { text-decoration: none; }
a.status:hover { color: var(--text); }

.model-row { display: flex; gap: 1rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.model-row > div:first-child { flex: 1; min-width: 240px; }
details > summary { cursor: pointer; font-weight: 600; color: var(--accent); }
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: min(92vw, 34rem); padding: 1.25rem; }
dialog::backdrop { background: rgb(0 0 0 / 45%); }
dialog ul { padding-left: 1.2rem; }
.load:not(:empty) { padding: .5rem; }
fieldset legend { padding: 0; margin-bottom: .25rem; font-size: .9rem; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
main:focus { outline: none; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.head { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }

button, .button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px;
  padding: .5rem 1rem; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  text-decoration: none; display: inline-flex; align-items: center; gap: .4rem;
}
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.ghost, .button.ghost { background: transparent; border-color: var(--border); color: var(--text); }
button.danger, .button.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.small { padding: .25rem .6rem; font-size: .85rem; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
input, textarea, select {
  font: inherit; color: inherit; background: var(--bg); width: 100%;
  border: 1px solid var(--border); border-radius: 8px; padding: .5rem .65rem;
}
textarea { min-height: 8rem; resize: vertical; }
.field { margin-bottom: .75rem; }
.fields { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .6rem 1rem; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.accent { background: var(--accent-soft); color: var(--text); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--bad); }
.pill.good { color: var(--good); }

.meter { height: .5rem; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); }

.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }

.banner { border-left: 4px solid var(--warn); }
.banner ol { margin: .5rem 0; padding-left: 1.25rem; }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }

.spinner { display: inline-block; width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.working { display: flex; gap: .75rem; align-items: center; color: var(--muted); padding: 1rem 0; }

/* Plan */
.day { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.day.today { background: var(--accent-soft); margin: 0 -1.25rem; padding: .75rem 1.25rem; border-radius: 8px; }
.day .date { font-weight: 700; }
.task { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .35rem; }

/* Flashcards */
.flash { min-height: 14rem; display: flex; flex-direction: column; justify-content: center; text-align: center; font-size: 1.2rem; }
.flash .back { border-top: 1px dashed var(--border); margin-top: 1rem; padding-top: 1rem; color: var(--text); }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.grades button { justify-content: center; flex-direction: column; gap: 0; }
.grades small { font-weight: 400; color: inherit; opacity: .8; }

/* Quiz */
.options { display: grid; gap: .5rem; margin: 1rem 0; }
.options button { justify-content: flex-start; text-align: left; background: var(--surface); color: var(--text); border-color: var(--border); font-weight: 500; }
.options button.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 15%, var(--surface)); }
.options button.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, var(--surface)); }
.options button:disabled { opacity: 1; cursor: default; }

/* Chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 11rem); min-height: 28rem; }
.messages { flex: 1; overflow-y: auto; padding: .5rem; display: flex; flex-direction: column; gap: .75rem; }
.msg { max-width: 85%; padding: .75rem 1rem; border-radius: 12px; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); }
.msg.assistant > :last-child { margin-bottom: 0; }
.msg img { max-width: 220px; border-radius: 8px; display: block; margin-top: .5rem; }
.msg.error { background: transparent; border: 1px solid var(--bad); color: var(--bad); }
.composer { display: flex; gap: .5rem; align-items: flex-end; border-top: 1px solid var(--border); padding-top: .75rem; }
.composer textarea { min-height: 3rem; max-height: 12rem; }
.attach-preview { display: flex; gap: .5rem; align-items: center; font-size: .85rem; }
.attach-preview img { height: 3rem; border-radius: 6px; }

/* Progress */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat b { display: block; font-size: 2rem; line-height: 1.1; }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: .35rem; align-items: end; height: 9rem; }
.bars div { background: var(--accent); border-radius: 4px 4px 0 0; min-height: 3px; }
.bars div.off { background: var(--surface-2); }
.bar-labels { display: grid; grid-template-columns: repeat(14, 1fr); gap: .35rem; font-size: .7rem; color: var(--muted); text-align: center; }
.badge { display: flex; gap: .75rem; align-items: center; }
.badge .medal { font-size: 1.6rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); }
.badge.locked { opacity: .45; }
.badge.locked .medal { background: var(--surface-2); filter: grayscale(1); }

.toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .7rem 1.1rem; border-radius: 10px; max-width: min(90vw, 36rem); z-index: 20; box-shadow: var(--shadow); }
.toast.error { background: var(--bad); color: #fff; }

/* --- Shared --------------------------------------------------------------- */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center { text-align: center; justify-content: center; }
.row.end { justify-content: flex-end; }
.row.tight { gap: .35rem; }
.tight-stack > * + * { margin-top: .5rem; }
.narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.block { width: 100%; justify-content: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 700; color: var(--accent); margin: 0 0 .25rem; }
.crumbs { margin: 0 0 .25rem; font-size: .9rem; }
.small-print { font-size: .82rem; margin-top: .75rem; }
.small-link { font-size: .9rem; }
.warn-text { color: var(--warn); }
.bad-text { color: var(--bad); }
.danger-text { color: var(--bad) !important; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain legend { margin-bottom: .5rem; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; cursor: pointer; }
button.icon { padding: .25rem .55rem; background: transparent; color: var(--text); border-color: var(--border); }
.meter.big { height: .8rem; }
.meter > span { transition: width .3s ease; }
blockquote.source { margin: .5rem 0 0; padding: .5rem .75rem; border-left: 3px solid var(--good); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.passage { max-height: 55vh; overflow-y: auto; white-space: pre-wrap; background: var(--surface-2); padding: .75rem; border-radius: 8px; font-size: .92rem; overflow-wrap: anywhere; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin: 0; cursor: pointer; }
.check input { width: auto; margin-top: .3rem; flex: none; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }

/* Chips: suggestion shortcuts, toggles and static tags */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 500; font-size: .92rem; text-decoration: none; cursor: pointer; margin: 0; }
.chip:hover { border-color: var(--accent); }
.chip.static { cursor: default; padding: .15rem .6rem; font-size: .8rem; background: var(--surface-2); }
.chip.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip.toggle:has(input:checked) { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip.toggle:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Selectable tiles (radio/checkbox cards) */
.tiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.tile { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; font-weight: 400; margin: 0; transition: border-color .15s, background .15s; }
.tile input { margin-top: .25rem; flex: none; }
.tile strong { display: block; }
.tile small { display: block; }
.tile:hover { border-color: var(--accent); }
.tile:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: inset 0 0 0 1px var(--accent); }
.tile:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Dialogs: centered on desktop, bottom sheet on phones */
dialog.sheet { width: min(92vw, 38rem); max-height: 88vh; overflow-y: auto; padding: 1.5rem; }
dialog.sheet h2 { margin-bottom: .25rem; }
.facts { margin: 0; padding-left: 1.2rem; }
.facts li + li { margin-top: .25rem; }
.wrap-buttons { flex-wrap: wrap; }

/* Skeletons and transitions */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
.skeleton.h1 { height: 2rem; width: 40%; margin-bottom: 1rem; }
.skeleton.line { height: 1rem; width: 70%; margin-bottom: 1.5rem; }
.skeleton.block { height: 12rem; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fade-in, .wizard-panel { animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --- Landing ---------------------------------------------------------------- */
:root { --amber: #f59e0b; --violet: #7c3aed; --sky: #0ea5e9; --rose: #e11d48; }
@media (prefers-color-scheme: dark) { :root { --amber: #fbbf24; --violet: #a78bfa; --sky: #38bdf8; --rose: #fb7185; } }

main.wide { max-width: none; padding: 0 0 0; }
.landing { overflow-x: clip; }
.landing .wrap { max-width: 1100px; margin: 0 auto; padding-inline: 1rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: .75rem; }
.l-section { padding: 4.5rem 0; }
.l-section h2 { font-size: clamp(1.5rem, 3.6vw, 2.25rem); letter-spacing: -.02em; max-width: 36rem; margin-bottom: 2rem; }

/* Hero */
.l-hero { position: relative; padding: 3.5rem 0 3rem; isolation: isolate;
  background:
    radial-gradient(50% 60% at 85% 35%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(40% 50% at 5% 90%, color-mix(in srgb, var(--amber) 14%, transparent), transparent 70%),
    radial-gradient(35% 40% at 45% 0%, color-mix(in srgb, var(--violet) 10%, transparent), transparent 70%); }
.l-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 14%, transparent) 1px, transparent 1.5px); background-size: 24px 24px;
  mask-image: radial-gradient(70% 70% at 60% 40%, #000 30%, transparent 75%); }
.l-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2rem; align-items: center; }
.hero-copy h1 { font-size: clamp(2.2rem, 5.6vw, 3.75rem); line-height: 1.05; letter-spacing: -.035em; margin-bottom: 1rem; }
.grad { background: linear-gradient(100deg, var(--accent), var(--violet) 60%, var(--rose)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34rem; margin-bottom: 1.75rem; }
.pulse { width: .55rem; height: .55rem; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); }
.hero-form { display: flex; gap: .5rem; max-width: 34rem; padding: .4rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow); transition: box-shadow .2s, border-color .2s; }
.hero-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 10px 30px -12px color-mix(in srgb, var(--accent) 45%, transparent); }
.hero-form input { font-size: 1.1rem; padding: .75rem .9rem; border: 0; background: transparent; min-width: 0; }
.hero-form input:focus-visible { outline: none; }
.hero-form button { padding: .75rem 1.3rem; border-radius: 13px; white-space: nowrap; font-size: 1rem; transition: transform .15s, filter .15s; }
.hero-form button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.hero-alt { margin: 1rem 0 0 .25rem; }
.hero-alt a { font-weight: 600; text-decoration: none; }
.hero-alt a::after { content: "→"; display: inline-block; margin-left: .35rem; transition: transform .2s; }
.hero-alt a:hover::after { transform: translateX(4px); }
.resume { margin-top: 1.5rem; max-width: 34rem; }
.hero-visual { display: flex; justify-content: center; }

/* Illustration (shared by hero and steps) */
.hero-art { width: 100%; max-width: 520px; height: auto; overflow: visible; --px: 0; --py: 0; }
.hero-art text, .step-art text { font-family: inherit; }
.st-accent { stop-color: var(--accent); }
.st-violet { stop-color: var(--violet); }
.art-ring { fill: none; stroke: color-mix(in srgb, var(--accent) 35%, transparent); stroke-width: 1.5; stroke-dasharray: 4 10; }
.art-page { fill: var(--surface); stroke: var(--border); }
.art-spine { stroke: var(--border); stroke-width: 2; }
.art-text path { fill: none; stroke: var(--border); stroke-width: 4; stroke-linecap: round; }
.art-card { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; filter: drop-shadow(0 10px 14px rgb(0 0 0 / 10%)); }
.art-bar { fill: var(--surface-2); }
.art-bar.strong { fill: color-mix(in srgb, var(--text) 22%, transparent); }
.art-bar.on-soft { fill: color-mix(in srgb, var(--text) 25%, transparent); }
.art-bar.on-accent { fill: color-mix(in srgb, var(--accent-ink) 70%, transparent); }
.art-q { font-size: 44px; font-weight: 800; text-anchor: middle; fill: var(--accent); }
.art-q.small { font-size: 34px; }
.art-label { font-size: 11px; font-weight: 600; fill: var(--muted); }
.opt { fill: none; stroke: var(--border); stroke-width: 2; }
.opt.ok { fill: var(--good); stroke: var(--good); }
.opt-hl { fill: color-mix(in srgb, var(--good) 14%, transparent); }
.tick { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tick.big { stroke-width: 5; }
.dot { fill: var(--muted); }
.badge { filter: drop-shadow(0 6px 10px rgb(0 0 0 / 15%)); }
.badge-t { font-size: 24px; font-weight: 800; fill: #fff; text-anchor: middle; }
.badge-t.small { font-size: 16px; }
.fill-amber { fill: var(--amber); } .fill-violet { fill: var(--violet); } .fill-sky { fill: var(--sky); } .fill-rose { fill: var(--rose); } .fill-accent { fill: var(--accent); }
.soft { fill-opacity: .22; }
.spark { fill: var(--amber); }
.lay { transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.lay-back { transform: translate(calc(var(--px) * -8px), calc(var(--py) * -8px)); }
.lay-mid { transform: translate(calc(var(--px) * 6px), calc(var(--py) * 6px)); }
.lay-front { transform: translate(calc(var(--px) * 18px), calc(var(--py) * 14px)); }
.float, .spark, .dot, .hl, .stop, .flag, .flip, .chip-in, .msg-in { transform-box: fill-box; transform-origin: center; }

/* Subject picker */
.subject-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.subject { --h: var(--accent); display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; min-height: 64px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; text-align: left; font-weight: 600;
  box-shadow: var(--shadow); transition: transform .2s cubic-bezier(.2,.7,.2,1), border-color .2s, box-shadow .2s, background .2s; }
.subject:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--h) 55%, var(--border)); box-shadow: 0 12px 24px -14px var(--h); }
.subject[aria-pressed="true"] { border-color: var(--h); background: color-mix(in srgb, var(--h) 10%, var(--surface)); box-shadow: 0 0 0 2px var(--h) inset; }
.subject-icon { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; color: var(--h);
  background: color-mix(in srgb, var(--h) 14%, var(--surface)); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.subject-icon svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.subject:hover .subject-icon, .subject[aria-pressed="true"] .subject-icon { transform: rotate(-8deg) scale(1.1); }
[data-hue="teal"] { --h: #0d9488; } [data-hue="green"] { --h: #16a34a; } [data-hue="pink"] { --h: #db2777; } [data-hue="blue"] { --h: #2563eb; }
[data-hue="amber"] { --h: #c2410c; } [data-hue="purple"] { --h: #9333ea; } [data-hue="cyan"] { --h: #0e7490; } [data-hue="gold"] { --h: #a16207; }
@media (prefers-color-scheme: dark) {
  [data-hue="teal"] { --h: #2dd4bf; } [data-hue="green"] { --h: #4ade80; } [data-hue="pink"] { --h: #f472b6; } [data-hue="blue"] { --h: #60a5fa; }
  [data-hue="amber"] { --h: #fb923c; } [data-hue="purple"] { --h: #c084fc; } [data-hue="cyan"] { --h: #22d3ee; } [data-hue="gold"] { --h: #facc15; }
}
.subject-ideas { margin-top: 1.25rem; }
.ideas-panel { --h: var(--accent); padding: 1.25rem; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--h) 40%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--h) 12%, var(--surface)), var(--surface) 70%); }
.subject-ideas[data-hue] .ideas-panel { --h: inherit; }
.ideas-title { font-weight: 700; margin-bottom: .75rem; }
.ideas-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.idea { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .5rem 1rem; border-radius: 999px; font-weight: 600; text-decoration: none;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); transition: transform .2s, border-color .2s; }
.idea span { color: var(--h); transition: transform .2s; }
.idea:hover { border-color: var(--h); transform: translateY(-2px); }
.idea:hover span { transform: translateX(3px); }
.idea-own { font-weight: 600; color: var(--h); }

/* How it works */
.l-how { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 6%, transparent) 30%, transparent); }
.steps { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 3.5rem; --progress: 0; }
.track { position: absolute; top: 1.5rem; bottom: 1.5rem; left: 50%; width: 4px; margin-left: -2px; border-radius: 4px; background: var(--border); overflow: hidden; }
.track span { display: block; height: 100%; transform-origin: top; transform: scaleY(var(--progress)); background: linear-gradient(var(--accent), var(--violet)); }
.step { display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem minmax(0, 1fr); align-items: center; }
.step-num { grid-column: 2; grid-row: 1; justify-self: center; z-index: 1; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%;
  font-weight: 800; font-size: 1.15rem; color: var(--accent-ink); background: var(--accent); box-shadow: 0 0 0 6px var(--bg); }
.step-text { grid-column: 1; grid-row: 1; text-align: right; }
.step-text h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.step-art { grid-column: 3; grid-row: 1; padding: 1rem; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.step-art svg { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto; overflow: visible; }
.step:nth-of-type(odd) .step-text { grid-column: 3; text-align: left; }
.step:nth-of-type(odd) .step-art { grid-column: 1; }
.hl { transform-origin: left center; }
.flow { fill: none; stroke: var(--muted); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.road { fill: none; stroke: var(--border); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 2 10; }
.road-fill { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.stop circle { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }
.pole { stroke: var(--muted); stroke-width: 2.5; stroke-linecap: round; }

/* Teaching styles */
.styles-demo { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.style-list { display: grid; gap: .5rem; }
.style-btn { display: grid; gap: .1rem; text-align: left; padding: .8rem 1rem; border-radius: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  transition: border-color .2s, background .2s, transform .2s; }
.style-btn small { font-weight: 500; }
.style-btn:hover { transform: translateX(3px); border-color: var(--accent); }
.style-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.style-btn[aria-pressed="true"] small { color: inherit; opacity: .85; }
.demo-chat { display: grid; gap: .75rem; padding: 1.5rem; border-radius: 20px; min-height: 18rem; align-content: start; }
.demo-msg { padding: .8rem 1rem; border-radius: 16px; max-width: 90%; }
.demo-msg.me { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; font-weight: 600; }
.demo-msg.tutor { justify-self: start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.demo-msg.tutor p:last-child, .demo-msg.tutor ol { margin-bottom: 0; }
.demo-msg.tutor ol { padding-left: 1.2rem; }
.demo-note { font-size: .8rem; color: var(--muted); margin: .25rem 0 0; }
.typing-dots { display: inline-flex; gap: .3rem; padding: .3rem 0; }
.typing-dots i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; } .typing-dots i:nth-child(3) { animation-delay: .3s; }

/* Trust and call to action */
.l-trust { padding-top: 1rem; }
.trust { padding: 1.5rem; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.trust-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.trust h3 { font-size: 1.1rem; margin-top: .75rem; }
.trust-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 14px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.trust-icon svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.landing .trust-note { margin-top: 1.5rem; font-size: .9rem; color: var(--muted); }
.l-cta { padding: 4rem 0 4.5rem; text-align: center; color: #fff;
  background: radial-gradient(60% 120% at 20% 0%, #14b8a6, transparent 60%), linear-gradient(120deg, #0f766e, #5b21b6); }
.l-cta h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); letter-spacing: -.02em; }
.l-cta p { opacity: .9; max-width: 34rem; margin: 0 auto 1.5rem; }
.cta-btn { background: #fff; color: #0f3d39; border-color: #fff; padding: .85rem 1.6rem; border-radius: 14px; font-size: 1.05rem; transition: transform .2s, box-shadow .2s; }
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -10px rgb(0 0 0 / 45%); }
.cta-btn:focus-visible { outline-color: #fff; }

/* Motion: only when the page opted in (JS on, motion allowed) */
.landing.animated .hero-copy > * { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.landing.animated .hero-copy > :nth-child(2) { animation-delay: .08s; }
.landing.animated .hero-copy > :nth-child(3) { animation-delay: .16s; }
.landing.animated .hero-copy > :nth-child(4) { animation-delay: .24s; }
.landing.animated .hero-copy > :nth-child(n+5) { animation-delay: .32s; }
.landing.animated .hero-visual { animation: art-in 1s .1s cubic-bezier(.2,.7,.2,1) both; }
.landing.animated .pulse { animation: pulse 2s infinite; }
.landing.animated .float { animation: floaty 6s ease-in-out infinite; }
.landing.animated .f2 { animation-duration: 7s; animation-delay: -2s; }
.landing.animated .f3 { animation-duration: 6.5s; animation-delay: -4s; }
.landing.animated .f4 { animation-duration: 5s; animation-delay: -1s; }
.landing.animated .f5 { animation-duration: 5.5s; animation-delay: -3s; }
.landing.animated .f6 { animation-duration: 4.6s; animation-delay: -2.5s; }
.landing.animated .f7 { animation-duration: 5.2s; animation-delay: -.5s; }
.landing.animated .art-ring { animation: dash 30s linear infinite; }
.landing.animated .art-ring.r2 { animation-duration: 45s; animation-direction: reverse; }
.landing.animated .hero-art .dot, .landing.animated .step.in-view .dot { animation: blink 1.2s infinite; }
.landing.animated .d2 { animation-delay: .2s !important; }
.landing.animated .d3 { animation-delay: .4s !important; }
.landing.animated .spark { animation: twinkle 3s ease-in-out infinite; }
.landing.animated .k2 { animation-delay: -1s; } .landing.animated .k3 { animation-delay: -2s; }
.landing.animated .k4 { animation-delay: -.5s; } .landing.animated .k5 { animation-delay: -1.6s; }
.hero-art.paused * { animation-play-state: paused !important; }

.landing.animated .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.landing.animated .reveal.in-view { opacity: 1; transform: none; }
.landing.animated .subject-grid.reveal .subject { opacity: 0; transform: translateY(16px) scale(.97); }
.landing.animated .subject-grid.in-view .subject { animation: tile-in .5s cubic-bezier(.2,.7,.2,1) both; }
.landing.animated .subject-grid.in-view .subject:nth-child(2) { animation-delay: .05s; }
.landing.animated .subject-grid.in-view .subject:nth-child(3) { animation-delay: .1s; }
.landing.animated .subject-grid.in-view .subject:nth-child(4) { animation-delay: .15s; }
.landing.animated .subject-grid.in-view .subject:nth-child(5) { animation-delay: .2s; }
.landing.animated .subject-grid.in-view .subject:nth-child(6) { animation-delay: .25s; }
.landing.animated .subject-grid.in-view .subject:nth-child(7) { animation-delay: .3s; }
.landing.animated .subject-grid.in-view .subject:nth-child(8) { animation-delay: .35s; }
.landing.animated .step .step-num { transform: scale(.4); opacity: 0; transition: transform .5s cubic-bezier(.3,1.6,.5,1) .15s, opacity .3s .15s; }
.landing.animated .step.in-view .step-num { transform: none; opacity: 1; }
.landing.animated .step .hl { transform: scaleX(0); }
.landing.animated .step.in-view .hl { animation: grow-x .6s cubic-bezier(.2,.7,.2,1) .4s both; }
.landing.animated .step.in-view .h2 { animation-delay: .8s; }
.landing.animated .step .flow { stroke-dasharray: 1; stroke-dashoffset: 1; }
.landing.animated .step.in-view .flow { animation: draw .5s ease-out 1.1s both; }
.landing.animated .step .chip-in { opacity: 0; }
.landing.animated .step.in-view .chip-in { animation: slide-in .45s cubic-bezier(.2,.7,.2,1) both; }
.landing.animated .step.in-view .c1 { animation-delay: 1.4s; } .landing.animated .step.in-view .c2 { animation-delay: 1.55s; } .landing.animated .step.in-view .c3 { animation-delay: 1.7s; }
.landing.animated .step .road-fill { stroke-dashoffset: 1; }
.landing.animated .step.in-view .road-fill { animation: draw 1.6s cubic-bezier(.4,0,.2,1) .3s both; }
.landing.animated .step .stop, .landing.animated .step .flag { transform: scale(0); }
.landing.animated .step.in-view .stop, .landing.animated .step.in-view .flag { animation: pop .45s cubic-bezier(.3,1.6,.5,1) both; }
.landing.animated .step.in-view .s1 { animation-delay: .4s; } .landing.animated .step.in-view .s2 { animation-delay: .9s; }
.landing.animated .step.in-view .s3 { animation-delay: 1.4s; } .landing.animated .step.in-view .flag { animation-delay: 1.9s; transform-origin: left center; }
.landing.animated .step .msg-in { opacity: 0; }
.landing.animated .step.in-view .msg-in { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
.landing.animated .step.in-view .m1 { animation-delay: .3s; } .landing.animated .step.in-view .m2 { animation-delay: .8s; } .landing.animated .step.in-view .m3 { animation-delay: 1.3s; }
.step .back { opacity: 0; }
.landing.animated .step.in-view .flip { animation: flip 6s ease-in-out 1.5s infinite; }
.landing.animated .step.in-view .front { animation: face-front 6s 1.5s infinite; }
.landing.animated .step.in-view .back { animation: face-back 6s 1.5s infinite; }

@keyframes art-in { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes tile-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes dash { to { stroke-dashoffset: -280; } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.6) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes flip { 0%, 40% { transform: scaleX(1); } 45% { transform: scaleX(0); } 50%, 90% { transform: scaleX(1); } 95% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
@keyframes face-front { 0%, 44.9% { opacity: 1; } 45%, 94.9% { opacity: 0; } 95%, 100% { opacity: 1; } }
@keyframes face-back { 0%, 44.9% { opacity: 0; } 45%, 94.9% { opacity: 1; } 95%, 100% { opacity: 0; } }

@media (max-width: 860px) {
  .l-hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: 2; }
  .hero-art { max-width: 420px; }
  .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .styles-demo { grid-template-columns: 1fr; }
  .style-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .track { left: 1.5rem; }
  .step { grid-template-columns: 3rem minmax(0, 1fr); column-gap: 1rem; row-gap: 1rem; }
  .step-num, .step:nth-of-type(odd) .step-num { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
  .step-text, .step:nth-of-type(odd) .step-text { grid-column: 2; grid-row: 1; text-align: left; }
  .step-art, .step:nth-of-type(odd) .step-art { grid-column: 2; grid-row: 2; }
}
@media (max-width: 640px) {
  .l-hero { padding: 1.75rem 0 2rem; }
  .l-section { padding: 3rem 0; }
  .hero-form { flex-direction: column; }
  .hero-form button { justify-content: center; }
  .subject { padding: .75rem; gap: .6rem; font-size: .95rem; }
  .subject-icon { width: 2.2rem; height: 2.2rem; }
  .steps { gap: 2.5rem; }
}
@media (max-width: 360px) {
  .subject-grid, .style-list { grid-template-columns: 1fr; }
}
.course-card { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.course-card:hover { border-color: var(--accent); transform: translateY(-2px); }

/* --- Onboarding --------------------------------------------------------------- */
.wizard { max-width: 760px; margin: 0 auto; }
.stepper { list-style: none; display: flex; gap: .35rem; padding: 0; margin: 0 0 1rem; overflow-x: auto; }
.stepper li { flex: 1; min-width: 4.5rem; font-size: .8rem; color: var(--muted); border-top: 4px solid var(--border); padding-top: .4rem; }
.stepper li.done { border-top-color: var(--accent); }
.stepper li.current { border-top-color: var(--accent); color: var(--text); font-weight: 700; }
.stepper button.link { font-size: .8rem; color: inherit; text-decoration: none; }
.wizard-panel h1 { font-size: clamp(1.4rem, 4vw, 1.9rem); }
.wizard-panel h1:focus { outline: none; }
.big-input { font-size: 1.15rem; padding: .85rem 1rem; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 1rem; }
.summary li { padding: .6rem 0; }

/* Upload */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; padding: 1.5rem 1rem; border: 2px dashed var(--border);
  border-radius: var(--radius); cursor: pointer; font-weight: 400; margin: 0; transition: border-color .15s, background .15s; }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.dropzone:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.dz-icon { font-size: 1.6rem; color: var(--accent); }
.files { list-style: none; padding: 0; margin: 0; }
.file { display: flex; gap: .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.file:last-child { border-bottom: 0; }
.file-icon { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 8px; display: grid; place-items: center; font-size: .72rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.file.failed .file-icon { color: var(--bad); }
.file-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* --- Workspace ------------------------------------------------------------------ */
.profile-pills { margin-top: .25rem; }
.next-up { border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.next-up h2 { font-size: 1.35rem; }
.why { margin: 0 0 1rem; padding-left: 1.2rem; color: var(--muted); }
.why li + li { margin-top: .25rem; }
.grid.compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.tool { display: flex; flex-direction: column; gap: .15rem; text-decoration: none; color: inherit; }
.tool:hover { border-color: var(--accent); }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }

/* Topics */
.section-title { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.topic-row { display: flex; gap: .6rem; align-items: center; }
.topic-row.dragging { opacity: .5; }
.handle { cursor: grab; color: var(--muted); user-select: none; padding: 0 .1rem; }
.topic-main { flex: 1; min-width: 0; }
.topic-title { font-weight: 600; display: inline-block; margin-bottom: .2rem; overflow-wrap: anywhere; }
.menu { position: relative; }
.menu > summary { list-style: none; padding: .25rem .6rem; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-weight: 700; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-items { position: absolute; right: 0; top: calc(100% + .25rem); z-index: 6; min-width: 11rem; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: .25rem; }
.menu-items button { background: transparent; color: var(--text); border: 0; justify-content: flex-start; font-weight: 500; }
.menu-items button:hover { background: var(--surface-2); }
.suggestion { display: flex; gap: .75rem; align-items: flex-start; }
.suggestion > .stack { flex: 1; min-width: 0; }
.suggestion:has(input[name="keep"]:not(:checked)) > .stack { opacity: .5; }
.split-list { max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; }

/* Tutor */
.chat-head { display: flex; justify-content: space-between; align-items: flex-end; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.chat-head h1 { margin: 0; }
.chat-controls { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.chat-controls label { font-weight: 400; font-size: .8rem; margin: 0; color: var(--muted); }
.chat-controls select { width: auto; max-width: 14rem; display: block; color: var(--text); }
.actions { display: flex; gap: .4rem; overflow-x: auto; padding: .5rem 0; scrollbar-width: thin; }
.actions .chip { white-space: nowrap; font-size: .85rem; padding: .35rem .75rem; }
.ai-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 .35rem; }
.sources { margin-top: .75rem; border-top: 1px solid var(--border); padding-top: .5rem; }
.sources details summary { font-size: .85rem; color: var(--good); }
.source-note { font-size: .8rem; color: var(--muted); margin: .5rem 0 .25rem; }

/* Touch: comfortable targets on coarse pointers */
@media (pointer: coarse) {
  button, .button, .chip, select, input:not([type="checkbox"]):not([type="radio"]), .tabs a, .topbar nav a { min-height: 44px; }
  button.small, .button.small { min-height: 40px; }
  a.pill, .small-link, .crumbs a { display: inline-flex; align-items: center; min-height: 32px; padding-inline: .4rem; }
}

@media (max-width: 640px) {
  .topbar { gap: .5rem .75rem; padding: .6rem 1rem; }
  .topbar nav { width: 100%; justify-content: space-between; }
  .status { margin-left: auto; }
  main { padding: 1rem 1rem 4rem; }
  h1 { font-size: 1.4rem; }
  .card { padding: 1rem; }
  .day { grid-template-columns: 1fr; gap: .25rem; }
  .day.today { margin: 0 -1rem; padding: .75rem 1rem; }
  .msg { max-width: 95%; }
  .chat { height: calc(100dvh - 9.5rem); min-height: 24rem; }
  .chat-controls { width: 100%; }
  .chat-controls label { flex: 1 1 40%; }
  .chat-controls select { max-width: none; width: 100%; }
  .wizard-nav > .row { flex: 1; justify-content: flex-end; }
  dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92dvh; }
  .topic-row { flex-wrap: wrap; }
  .handle { display: none; }
  .grades { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
  .skeleton, .fade-in, .wizard-panel { animation: none; }
  .meter > span, .tile, .course-card, .dropzone { transition: none; }
  .course-card:hover { transform: none; }
  .subject, .subject-icon, .idea, .idea span, .style-btn, .hero-form button, .cta-btn, .hero-alt a::after, .lay { transition: none; }
  .subject:hover, .idea:hover, .style-btn:hover, .hero-form button:hover, .cta-btn:hover, .subject:hover .subject-icon, .subject[aria-pressed="true"] .subject-icon { transform: none; }
}

/* --- Guided onboarding (journey) ---------------------------------------------- */
.ob { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 2rem; align-items: start; }
.ob-journey { position: sticky; top: 5rem; padding: 1.1rem; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.ob-count { font-size: .85rem; color: var(--muted); margin-bottom: .75rem; }
.ob-count strong { color: var(--text); }
.ob-bar { display: none; height: 6px; border-radius: 6px; background: var(--border); overflow: hidden; margin-bottom: .75rem; }
.ob-bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--violet)); }
.ob-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; position: relative; --fill: 0; }
.ob-steps::before, .ob-steps::after { content: ""; position: absolute; left: 23px; top: 24px; bottom: 24px; width: 3px; margin-left: -1.5px; border-radius: 3px; background: var(--border); }
.ob-steps::after { background: linear-gradient(var(--accent), var(--violet)); transform-origin: top; transform: scaleY(var(--fill)); }
.ob-steps li > button, .ob-steps .ob-item { position: relative; z-index: 1; display: flex; align-items: center; gap: .75rem; width: 100%; padding: .35rem; border: 0; border-radius: 12px;
  background: none; color: var(--muted); font-weight: 600; text-align: left; min-height: 0; }
.ob-steps li > button:hover { background: var(--surface-2); color: var(--text); }
.ob-dot:not([data-hue]) { --h: var(--accent); }
.ob-dot { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); color: var(--muted); }
.ob-dot svg, .ob-card-icon svg, .ob-card-check svg, .ob-check svg, #ai-topics svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ob-steps li.done .ob-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ob-steps li.current .ob-dot { border-color: var(--h); color: var(--h); background: color-mix(in srgb, var(--h) 14%, var(--surface)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--h) 18%, transparent); }
.ob-steps li.current .ob-label { color: var(--text); }
.ob-label small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }

.ob-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 2rem; box-shadow: var(--shadow); }
.ob-head { display: flex; gap: 1.25rem; align-items: center; margin-bottom: 1rem; }
.ob-head h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -.02em; margin-bottom: .35rem; }
.ob-head h1:focus { outline: none; }
.ob-head .eyebrow { margin-bottom: .3rem; }
.ob-head p.muted { margin: 0; }
.ob-scene:not([data-hue]) { --h: var(--accent); }
.ob-scene { flex: none; width: 112px; height: auto; overflow: visible; }
.sc-glow { fill: color-mix(in srgb, var(--h, var(--accent)) 16%, transparent); }
.sc-ring { fill: none; stroke: color-mix(in srgb, var(--h) 40%, transparent); stroke-width: 1.5; stroke-dasharray: 3 7; }
.sc-tile { fill: var(--h); filter: drop-shadow(0 8px 12px color-mix(in srgb, var(--h) 40%, transparent)); }
.sc-icon { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sc-b1, .sc-b2, .sc-b3 { transform-box: fill-box; transform-origin: center; }

.ob-why { margin: 0 0 1.25rem; }
.ob-why summary { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; list-style: none; padding: .3rem .75rem; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.ob-why summary::-webkit-details-marker { display: none; }
.ob-why summary::before { content: "i"; display: grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; font-size: .7rem; font-weight: 800; background: var(--accent); color: var(--accent-ink); }
.ob-why p { margin: .6rem 0 0; padding: .8rem 1rem; border-radius: 14px; font-size: .92rem; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); max-width: 40rem; }

.ob-subject-input .big-input { font-size: 1.2rem; padding: .95rem 1.1rem; border-radius: 14px; border-width: 1.5px; background: var(--surface); }
.ob-subject-input .big-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.ob-sub { margin: 1.25rem 0 .6rem; color: var(--muted); font-weight: 600; font-size: .9rem; }
.ob .subject-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr)); }
.ob .subject { min-height: 56px; padding: .7rem .8rem; font-size: .95rem; }
.ob .subject-icon { width: 2.2rem; height: 2.2rem; }
.ob .subject-ideas { margin-top: 1rem; }
.idea { font: inherit; font-weight: 600; cursor: pointer; }

.ob-cards { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.ob-cards.prefs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 195px), 1fr)); gap: .6rem; }
.ob-card { position: relative; display: flex; gap: .8rem; align-items: flex-start; margin: 0; padding: 1rem 2.4rem 1rem 1rem; border: 1.5px solid var(--border); border-radius: 16px;
  background: var(--surface); cursor: pointer; font-weight: 400; font-size: 1rem; }
.ob-cards.prefs .ob-card { align-items: center; padding: .75rem 2.2rem .75rem .75rem; }
.ob-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ob-card-icon { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.ob-cards.prefs .ob-card-icon { width: 2.1rem; height: 2.1rem; }
.ob-card-text strong { display: block; font-size: .98rem; }
.ob-card-text small { display: block; font-size: .85rem; margin-top: .15rem; }
.ob-card-check { position: absolute; top: .6rem; right: .6rem; display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); opacity: 0; transform: scale(.5); }
.ob-card-check svg { width: 14px; height: 14px; stroke-width: 3; }
.ob-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.ob-card:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: inset 0 0 0 1px var(--accent); }
.ob-card:has(input:checked) .ob-card-check { opacity: 1; transform: none; }
.ob-card:has(input:checked) .ob-card-icon { background: var(--accent); color: var(--accent-ink); }
.ob-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.ob-pop { position: relative; margin-top: 1rem; padding: 1rem 1.1rem; max-width: 34rem; border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); }
.ob-pop input { background: var(--surface); }
.ob-pop p { margin: 0; }
.ob-pop small { display: block; margin-top: .4rem; }

.ob-preview { margin-top: 1.25rem; padding: 1.1rem; display: grid; gap: .6rem; border-radius: 18px; background: color-mix(in srgb, var(--violet) 6%, var(--surface)); border: 1px solid var(--border); }
.ob-preview-label { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--violet); }
.ob-preview .demo-msg.tutor { background: var(--surface); border: 1px solid var(--border); }
.ob-preview .demo-msg small { display: block; font-weight: 700; color: var(--accent); }
.ob-minutes { border: 0; padding: 0; margin: 1.5rem 0 0; }
.ob-minutes legend { font-weight: 700; margin-bottom: .5rem; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg label { margin: 0; position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: inline-flex; align-items: center; min-height: 40px; padding: .35rem .95rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: .9rem; cursor: pointer; }
.seg span:hover { border-color: var(--accent); }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.ob-more { margin-top: 1.25rem; }
.ob-more textarea { margin-top: .6rem; }

.ob-topic-count { margin: 0 0 .5rem; color: var(--muted); }
.ob-topic-count strong { color: var(--text); }
.ob-topics { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.ob-topic { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.ob-topic.off { opacity: .6; background: var(--surface-2); }
.ob-topic.off .ob-topic-title { text-decoration: line-through; }
.ob-check { position: relative; flex: none; margin: 0; padding: .3rem; cursor: pointer; }
.ob-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ob-check > span[aria-hidden] { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 8px; border: 2px solid var(--border); color: transparent; background: var(--surface); }
.ob-check input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ob-check input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.ob-check svg { stroke-width: 3; width: 15px; height: 15px; }
.ob-topic-main { flex: 1; min-width: 0; }
.ob-topic-title { font-weight: 600; padding: .3rem .45rem; border: 1px solid transparent; background: transparent; }
.ob-topic-title:hover { border-color: var(--border); }
.ob-topic-title:focus { border-color: var(--accent); background: var(--surface); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.ob-topic-main small { display: block; padding-left: .45rem; overflow-wrap: anywhere; }
.ob-known { flex: none; font-size: .8rem; padding: .35rem .75rem; border-radius: 999px; background: transparent; border: 1px solid var(--border); color: var(--muted); }
.ob-known[aria-pressed="true"] { background: color-mix(in srgb, var(--good) 14%, var(--surface)); border-color: var(--good); color: var(--good); }
.ob-known[aria-pressed="true"]::before { content: "✓"; }
.ob-topic-tools { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1rem; }
.ob-add { display: flex; gap: .4rem; flex: 1; min-width: min(100%, 240px); }
.ob-empty { display: flex; align-items: center; gap: 1.25rem; padding: 1.25rem; border: 2px dashed var(--border); border-radius: 18px; }
.ob-empty p { margin: 0; }
.ob-empty-art { flex: none; width: 140px; height: auto; overflow: visible; }
.ob-skeleton span { display: block; height: 3.2rem; margin-bottom: .5rem; border-radius: 14px; background: var(--surface-2); }
.ob-note { margin: .75rem 0 0; padding: .6rem .85rem; border-radius: 12px; font-size: .88rem; background: color-mix(in srgb, var(--violet) 8%, var(--surface)); }
#ai-status .working { margin-top: .75rem; }

.ob-nav { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.ob-next { padding: .7rem 1.4rem; border-radius: 12px; font-size: 1rem; }
.ob-finish { text-align: center; margin-top: 1rem; }

.ob-ready { text-align: center; }
.ob-ready-art { display: block; width: 220px; max-width: 70%; height: auto; margin: 0 auto .5rem; overflow: visible; }
.ok-tick { stroke: var(--good); }
.ob-summary { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.ob-sum:not([data-hue]) { --h: var(--accent); }
.ob-sum { display: flex; align-items: center; gap: .75rem; padding: .75rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.ob-sum .ob-dot { border-color: transparent; background: color-mix(in srgb, var(--h) 14%, var(--surface)); color: var(--h); }
.ob-sum-text { flex: 1; min-width: 0; }
.ob-sum-text small, .ob-sum-text strong { display: block; }
.ob-sum-text strong { font-size: .92rem; overflow-wrap: anywhere; }
.ob-sum button { flex: none; }

.welcome-card { padding: 1.5rem 1.75rem; border-radius: 20px; color: #fff;
  background: radial-gradient(60% 120% at 10% 0%, #14b8a6, transparent 60%), linear-gradient(120deg, #0f766e, #5b21b6); }
.welcome-card .eyebrow { color: #ccfbf1; }
.welcome-card h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.welcome-facts { margin: .75rem 0 1rem; padding-left: 1.1rem; }
.welcome-facts li + li { margin-top: .3rem; }
.welcome-card a { color: #fff; font-weight: 700; }

/* Motion, only when allowed */
.ob.animated .sc-float { animation: floaty 5s ease-in-out infinite; }
.ob.animated .sc-b1 { animation: twinkle 3.2s ease-in-out infinite; }
.ob.animated .sc-b2 { animation: twinkle 3.2s ease-in-out -1.1s infinite; }
.ob.animated .sc-b3 { animation: twinkle 3.2s ease-in-out -2.2s infinite; }
.ob.animated .sc-ring { animation: dash 24s linear infinite; }
.ob.animated .ob-steps::after { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.ob.animated .ob-dot { transition: background .3s, border-color .3s, box-shadow .3s; }
.ob.animated .ob-card, .ob.animated .seg span, .ob.animated .ob-topic, .ob.animated .ob-check > span, .ob.animated .ob-known { transition: border-color .2s, background .2s, transform .2s, box-shadow .2s, opacity .2s; }
.ob.animated .ob-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -16px var(--accent); }
.ob.animated .ob-card-check { transition: opacity .2s, transform .3s cubic-bezier(.3,1.6,.5,1); }
.ob.animated .ob-card:has(input:checked) .ob-card-icon { animation: pop .35s cubic-bezier(.3,1.6,.5,1); }
.ob.animated .ob-why[open] p { animation: rise .25s ease-out; }
.ob.animated .ob-next { transition: transform .15s, filter .15s; }
.ob.animated .ob-next:hover { transform: translateY(-1px); filter: brightness(1.08); }
.ob.animated .ob-skeleton span { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.welcome-card { animation: rise .5s cubic-bezier(.2,.7,.2,1); }

@media (max-width: 860px) {
  .ob { grid-template-columns: 1fr; gap: 1rem; }
  .ob-journey { position: static; padding: .9rem 1rem; }
  .ob-count { margin-bottom: .5rem; }
  .ob-bar { display: block; }
  .ob-steps { display: flex; justify-content: space-between; }
  .ob-steps::before, .ob-steps::after { display: none; }
  .ob-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ob-steps li > button, .ob-steps .ob-item { width: auto; padding: .25rem; }
  .ob-panel { padding: 1.25rem; border-radius: 20px; }
  .ob-scene { width: 84px; }
  .ob-summary { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .ob-head { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .ob-scene { width: 72px; }
  .ob-dot { width: 30px; height: 30px; }
  .ob-topic { flex-wrap: wrap; row-gap: .25rem; }
  .ob-topic-main { flex-basis: calc(100% - 3.5rem); }
  .ob-known { margin-left: 2.6rem; }
  .ob-nav > .row { flex: 1; justify-content: flex-end; }
  .ob-empty { flex-direction: column; text-align: center; }
  .ob-cards.prefs { grid-template-columns: 1fr 1fr; }
  .ob-cards.prefs .ob-card { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .7rem 1.8rem .7rem .7rem; }
}
@media (pointer: coarse) {
  .ob-known { min-height: 40px; }
  .ob-check { padding: .55rem; margin: -.25rem; }
  .ob-steps li > button, .ob-steps .ob-item { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .welcome-card { animation: none; }
}

/* --- App screens: shared pieces ------------------------------------------------ */
.ic-tile:not([data-hue]) { --h: var(--accent); }
.ic-tile { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 12px; color: var(--h); background: color-mix(in srgb, var(--h) 14%, var(--surface)); }
.ic-tile svg, .ws-tabs svg, .button svg, button svg, .pill svg, .ground svg, .tp-chev svg, .go svg, .medal-icon svg, .starter svg, figcaption svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-tile.big { width: 3.25rem; height: 3.25rem; border-radius: 16px; }
.ic-tile.big svg { width: 24px; height: 24px; }
.ic-tile.on-dark { background: rgb(255 255 255 / 18%); color: #fff; }
.pill svg { width: 12px; height: 12px; vertical-align: -1px; }

.ring:not([data-hue]) { --h: var(--accent); }
.ring { flex: none; display: block; }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 6; }
.ring-fill { fill: none; stroke: var(--h); stroke-width: 6; stroke-linecap: round; }
.ring-text { font: 700 15px system-ui, sans-serif; text-anchor: middle; fill: var(--text); }

.sec-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.sec-head-text { flex: 1; min-width: 0; }
.sec-head h2 { margin: 0; font-size: 1.15rem; }
.sec-head .eyebrow { margin-bottom: .15rem; }
.sec-head p.muted { margin: .15rem 0 0; font-size: .9rem; }
.sec-head-extra { flex: none; }

.kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.kpi { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none; box-shadow: var(--shadow); }
a.kpi:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.kpi strong, .kpi small { display: block; }
.kpi strong { font-size: 1.05rem; }
.dash-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.note.warn { margin: 0; padding: .55rem .8rem; border-radius: 10px; font-size: .9rem; color: var(--text); background: color-mix(in srgb, var(--amber) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--amber) 40%, var(--border)); }
.pill.src { display: inline-flex; align-items: center; gap: .25rem; color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--surface)); }

/* Workspace shell */
.ws-hero { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.4rem; margin-bottom: 1rem; border-radius: 22px; border: 1px solid var(--border);
  background: radial-gradient(70% 140% at 0% 0%, color-mix(in srgb, var(--h) 16%, transparent), transparent 70%), var(--surface); box-shadow: var(--shadow); }
.ws-hero .subject-tile { width: 3.6rem; height: 3.6rem; border-radius: 18px; background: var(--h); color: #fff; box-shadow: 0 10px 20px -10px var(--h); }
.ws-hero .subject-tile svg { width: 28px; height: 28px; }
.ws-title { flex: 1; min-width: 0; }
.ws-title h1 { margin: 0 0 .35rem; font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -.02em; overflow-wrap: anywhere; }
.ws-title .crumbs { margin-bottom: .1rem; }
.profile-pills a.pill { text-decoration: none; }
.profile-pills a.pill:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.ws-hero-side { display: flex; align-items: center; gap: .9rem; }
.ws-tabs { display: flex; gap: .35rem; padding: .35rem; margin-bottom: 1.25rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .9rem; border-radius: 12px; color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap; }
.ws-tabs a:hover { color: var(--text); background: var(--surface-2); }
.ws-tabs a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }
.ws-tabs .count { min-width: 1.3rem; padding: 0 .35rem; border-radius: 999px; font-size: .72rem; line-height: 1.3rem; text-align: center; background: var(--rose); color: #fff; }

/* Dashboard */
.dash { display: grid; gap: 1rem; }
.next-hero { display: flex; align-items: center; gap: 1.1rem; padding: 1.4rem 1.5rem; border-radius: 22px; color: #fff;
  background: radial-gradient(60% 140% at 100% 0%, color-mix(in srgb, var(--violet) 70%, transparent), transparent 70%), linear-gradient(120deg, #0f766e, #134e4a); }
.next-hero .eyebrow { color: #ccfbf1; }
.next-hero h2 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); margin-bottom: .25rem; }
.next-hero p { margin: 0; color: rgb(255 255 255 / 85%); }
.next-text { flex: 1; min-width: 0; }
.next-go { flex: none; background: #fff; color: #0f766e; border-color: #fff; padding: .7rem 1.2rem; border-radius: 12px; }
.next-go:hover { filter: brightness(.95); }

.plan-line { list-style: none; margin: 0; padding: .25rem 0 .5rem; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: .75rem; overflow-x: auto; position: relative; scroll-snap-type: x proximity; }
.pl-day { position: relative; scroll-snap-align: start; display: grid; gap: .5rem; align-content: start; }
.pl-day::before { content: ""; position: absolute; top: 3.15rem; left: 0; right: -.75rem; height: 3px; background: var(--border); }
.pl-day:last-child::before { right: 50%; }
.pl-date { margin: 0; display: flex; flex-direction: column; line-height: 1.2; }
.pl-date small { color: var(--muted); }
.pl-node { position: relative; z-index: 1; display: grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--surface); border: 3px solid var(--border); margin-top: .1rem; }
.pl-node svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pl-day.today .pl-node { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); }
.pl-day.milestone .pl-node { width: 1.9rem; height: 1.9rem; margin-top: -.2rem; border-color: var(--amber); background: var(--amber); color: #fff; }
.pl-day.exam .pl-node { border-color: #a16207; background: #ca8a04; }
.pl-day.today .pl-date strong { color: var(--accent); }
.pl-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.pl-item { display: grid; gap: .3rem; padding: .6rem .7rem; border-radius: 12px; border: 1px solid var(--border); border-left: 4px solid var(--h); background: color-mix(in srgb, var(--h) 6%, var(--surface)); font-size: .9rem; }
.pl-kind { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 700; color: var(--h); text-transform: uppercase; letter-spacing: .04em; }
.pl-kind svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pl-what { overflow-wrap: anywhere; }
.pl-item .button { justify-self: start; }
.dash-plan .ob-why { margin: .75rem 0 0; }

.mastery-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.mastery-list a { display: grid; grid-template-columns: minmax(0, 1fr) 90px 2.6rem; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 10px; color: inherit; text-decoration: none; }
.mastery-list a:hover { background: var(--surface-2); }
.ml-title { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mastery-list small { text-align: right; }
.ml-bar { height: .5rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ml-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--muted); }
.ml-bar.good > span { background: var(--good); } .ml-bar.warn > span { background: var(--amber); } .ml-bar.bad > span { background: var(--rose); }

.quick { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.quick-card { display: flex; align-items: center; gap: .8rem; padding: 1rem; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.quick-card > span:nth-child(2) { flex: 1; min-width: 0; }
.quick-card strong, .quick-card small { display: block; }
.quick-card .go, .course-card .go { color: var(--muted); display: grid; }
.quick-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }

/* Personalize and practice setup */
.pz { display: grid; gap: 1.75rem; padding: 1.75rem; border-radius: 22px; }
.pz-intro h2 { font-size: 1.4rem; }
.pz-intro p { margin: 0; }
.pz-section { padding-top: 1.5rem; border-top: 1px solid var(--border); }
.pz-section > .ob-pop { max-width: 34rem; }
.pz-note { margin: .75rem 0 0; font-size: .9rem; color: var(--muted); }
.pz .ob-minutes { margin: 0; }
.pz-save { position: sticky; bottom: .75rem; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1rem; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border); box-shadow: 0 10px 30px -16px rgb(0 0 0 / 35%); backdrop-filter: blur(6px); }
.pz-save button { padding: .65rem 1.3rem; border-radius: 12px; }
.pz fieldset.plain legend { font-weight: 700; margin-bottom: .5rem; }
.pz .chip.toggle small { opacity: .75; }
.fam-row { margin-top: .75rem !important; }
.fam-row legend { font-weight: 600 !important; font-size: .92rem; }

/* Topics */
.tp-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .88rem; color: var(--muted); }
.tp-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.tp-legend .dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--border); }
.tp-legend .dot.good { background: var(--good); } .tp-legend .dot.warn { background: var(--amber); } .tp-legend .dot.bad { background: var(--rose); }
.tp-group { display: grid; gap: .5rem; }
.tp-group .section-title { margin: .5rem 0 0 .25rem; }
.tp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.tp-card { border-radius: 16px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.tp-card:has(details[open]) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.tp-card summary { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; list-style: none; cursor: pointer; color: var(--text); font-weight: 400; border-radius: 16px; }
.tp-card summary::-webkit-details-marker { display: none; }
.tp-card summary:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tp-main { flex: 1; min-width: 0; display: grid; gap: .3rem; }
.tp-main .topic-title { margin: 0; font-size: 1rem; }
.tp-chev { color: var(--muted); display: grid; }
.tp-card details[open] .tp-chev { transform: rotate(90deg); }
.tp-body { display: grid; gap: .75rem; padding: 0 1rem 1rem 1rem; margin-left: calc(44px + 1.6rem); }
.tp-body > p { margin: 0; }
.tp-source { margin: 0; }
.tp-source figcaption { display: flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 600; color: var(--good); }
.tp-source figcaption svg { width: 14px; height: 14px; }
.tp-tools { padding-top: .5rem; border-top: 1px dashed var(--border); }
.tp-head { margin-bottom: .25rem; }
.tp-head h2 { font-size: 1.35rem; }

/* Grounding labels for AI items */
.ground { margin: .6rem 0 0; font-size: .85rem; }
.ground summary, p.ground { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; }
.ground svg { width: 15px; height: 15px; }
.ground.ok summary, p.ground.ok { color: var(--good); }
.ground.partial summary, p.ground.partial { color: var(--warn); }
p.ground.general { color: var(--muted); }
.ground blockquote { text-align: left; font-weight: 400; }

/* Flashcards */
.fc { display: grid; gap: .75rem; }
.fc-top { display: flex; align-items: center; gap: .75rem; }
.fc-count { margin-left: auto; color: var(--muted); font-size: .9rem; }
.fc-feedback { min-height: 1.4rem; margin: 0; text-align: center; font-size: .9rem; color: var(--accent); font-weight: 600; }
.flip-card { perspective: 1400px; }
.flip-inner { position: relative; display: grid; }
.face { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; min-height: 16rem; padding: 2rem 1.5rem;
  border-radius: 22px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 18px 40px -26px rgb(0 0 0 / 45%), var(--shadow); }
.face.front { background: radial-gradient(70% 90% at 50% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%), var(--surface); }
.face.back { background: radial-gradient(70% 90% at 50% 0%, color-mix(in srgb, var(--violet) 9%, transparent), transparent 70%), var(--surface); visibility: hidden; }
.face-label { margin: 0 0 .75rem; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.face-text { margin: 0; font-size: clamp(1.15rem, 2.6vw, 1.45rem); font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.flip-card.flipped .front { visibility: hidden; }
.flip-card.flipped .back { visibility: visible; }
.fc-flip { padding: .8rem 1rem; border-radius: 14px; font-size: 1rem; }
.fc-flip small, .grade small { font-weight: 500; opacity: .8; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.grade { flex-direction: column; justify-content: center; gap: .1rem; padding: .65rem .5rem; border-radius: 14px; font-size: 1rem; }
.grade.g0 { background: transparent; color: var(--rose); border-color: var(--rose); }
.grade.g1 { background: transparent; color: var(--warn); border-color: var(--warn); }
.grade.g2 { background: var(--accent); }
.grade.g3 { background: var(--good); border-color: var(--good); color: #fff; }
.fc-done { text-align: center; padding: 2rem 1.5rem; border-radius: 22px; max-width: 720px; margin: 0 auto; }
.fc-done h2:focus { outline: none; }
.fc-art { display: block; width: 200px; max-width: 70%; height: auto; margin: 0 auto .5rem; overflow: visible; }
.fc-tally { list-style: none; margin: 1rem auto; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 5.5rem)); justify-content: center; gap: .5rem; }
.fc-tally li { padding: .6rem; border-radius: 14px; background: color-mix(in srgb, var(--h) 12%, var(--surface)); }
.fc-tally b { display: block; font-size: 1.5rem; color: var(--h); }

/* Practice */
.qz { display: grid; gap: .75rem; }
.qz-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.qz-top .eyebrow { margin: 0; }
.qz-dots { list-style: none; margin: 0; padding: 0; display: flex; gap: .3rem; }
.qz-dots li { flex: 1; height: 6px; border-radius: 6px; background: var(--border); }
.qz-dots li.now { background: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.qz-dots li.right { background: var(--good); } .qz-dots li.wrong { background: var(--rose); } .qz-dots li.skip { background: var(--muted); }
.qz-card { padding: 1.75rem; border-radius: 22px; }
.qz-card h2 { font-size: clamp(1.15rem, 2.6vw, 1.4rem); line-height: 1.35; }
.qz-card h2:focus { outline: none; }
.options button { gap: .75rem; padding: .75rem .9rem; border-radius: 14px; border-width: 1.5px; font-size: 1rem; }
.opt-key { flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 9px; font-weight: 700; font-size: .85rem; background: var(--surface-2); color: var(--muted); }
.opt-text { flex: 1; overflow-wrap: anywhere; }
.options button:not(:disabled):hover { border-color: var(--accent); }
.options button.right .opt-key { background: var(--good); color: #fff; }
.options button.wrong .opt-key { background: var(--rose); color: #fff; }
.qz-feedback { padding: .9rem 1rem; border-radius: 14px; border: 1px solid var(--border); }
.qz-feedback.ok { background: color-mix(in srgb, var(--good) 8%, var(--surface)); border-color: color-mix(in srgb, var(--good) 40%, var(--border)); }
.qz-feedback.no { background: color-mix(in srgb, var(--rose) 7%, var(--surface)); border-color: color-mix(in srgb, var(--rose) 35%, var(--border)); }
.qz-feedback p { margin: 0 0 .4rem; }
.qz-verdict { display: flex; align-items: center; gap: .45rem; }
.qz-feedback.ok .qz-verdict { color: var(--good); } .qz-feedback.no .qz-verdict { color: var(--rose); }
.qz-verdict svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.qz-next { margin-top: .9rem; }
.qz-results { display: grid; gap: 1rem; }
.qz-score { display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem; border-radius: 22px;
  background: radial-gradient(60% 140% at 0% 0%, color-mix(in srgb, var(--h) 14%, transparent), transparent 70%), var(--surface); }
.qz-score .ring-text { font-size: 13px; }
.qz-score h2:focus { outline: none; }
.qz-score p { margin: .25rem 0 0; }
.missed { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.missed li { display: grid; gap: .2rem; padding: .65rem .8rem; border-radius: 12px; background: var(--surface-2); }
.missed strong { color: var(--good); }
.missed strong::before { content: "Answer: "; color: var(--muted); font-weight: 500; }

/* Tutor */
.tutor { border-radius: 22px; }
.chat-title { display: flex; align-items: center; gap: .7rem; }
.chat-title small { display: block; }
.tutor-avatar { background: var(--accent); color: var(--accent-ink); border-radius: 14px; }
.msg-row { display: flex; align-items: flex-start; gap: .6rem; max-width: 92%; }
.msg-row .msg { max-width: none; min-width: 0; }
.msg-avatar { width: 2rem; height: 2rem; border-radius: 10px; }
.msg-avatar svg { width: 16px; height: 16px; }
.msg { border-radius: 18px; }
.msg.user { border-bottom-right-radius: 6px; }
.msg.assistant { border-top-left-radius: 6px; background: var(--surface); border: 1px solid var(--border); }
.typing { display: inline-flex; gap: .3rem; padding: .3rem 0; }
.typing i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); opacity: .5; }
.follow { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; padding-top: .65rem; border-top: 1px dashed var(--border); }
.follow .chip { font-size: .85rem; padding: .3rem .7rem; }
button.cite { display: inline-flex; padding: 0 .4rem; margin: 0 .1rem; min-height: 0; border-radius: 6px; font-size: .75rem; font-weight: 700; vertical-align: 1px;
  background: color-mix(in srgb, var(--good) 14%, var(--surface)); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 40%, var(--border)); }
.chat-empty { margin: auto; max-width: 36rem; text-align: center; padding: 1.5rem 1rem; display: grid; justify-items: center; gap: .5rem; }
.chat-empty h2 { margin: .25rem 0 0; }
.starters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; width: 100%; margin-top: .5rem; }
.starter { justify-content: flex-start; text-align: left; gap: .5rem; padding: .7rem .8rem; border-radius: 14px; background: var(--surface); color: var(--text); border-color: var(--border); font-weight: 500; }
.starter svg { color: var(--amber); }
.starter:hover { border-color: var(--accent); }
.composer { align-items: center; }
.composer textarea { border-radius: 14px; }
#send { border-radius: 12px; padding: .6rem 1rem; }

/* Progress */
.pg { display: grid; gap: 1rem; }
.pg-hero { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding: 1.4rem 1.5rem; border-radius: 22px; border: 1px solid var(--border);
  background: radial-gradient(60% 140% at 0% 0%, color-mix(in srgb, var(--amber) 18%, transparent), transparent 70%), var(--surface); box-shadow: var(--shadow); }
.pg-streak { display: flex; align-items: center; gap: 1rem; }
.pg-streak p { margin: 0; }
.flame { --h: var(--amber); width: 4rem; height: 4rem; border-radius: 20px; background: var(--amber); color: #fff; }
.flame svg { width: 30px; height: 30px; }
.pg-big { font-size: 1.1rem; }
.pg-big b { font-size: 2.4rem; line-height: 1; letter-spacing: -.02em; }
.pg-week { list-style: none; margin: 0; padding: 0; display: flex; gap: .4rem; }
.pg-week li { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--surface-2); }
.pg-week li.on { background: var(--amber); color: #fff; }
.pg-week li.today { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.chart { position: relative; padding-left: 3rem; }
.chart-grid { position: absolute; left: 0; top: 0; height: 10rem; display: flex; flex-direction: column; justify-content: space-between; font-size: .7rem; color: var(--muted); }
.chart .bars { height: 10rem; background: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 50%); background-size: 100% calc(50% + .5px); }
.chart .bars div { height: var(--h); background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 60%, var(--violet))); border-radius: 6px 6px 2px 2px; }
.chart .bars div.off { background: var(--surface-2); }
.chart .bars div.today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--amber); }
.chart .bar-labels { margin-top: .35rem; }
.pg-courses { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.pg-courses a { display: flex; align-items: center; gap: .75rem; padding: .5rem; border-radius: 12px; color: inherit; text-decoration: none; }
.pg-courses a:hover { background: var(--surface-2); }
.pg-c-name { flex: 1; min-width: 0; }
.pg-c-name strong, .pg-c-name small { display: block; overflow-wrap: anywhere; }
.medals { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.medal { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.medal-icon { flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; color: #fff;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--h) 70%, #fff), var(--h)); box-shadow: 0 6px 14px -6px var(--h), inset 0 0 0 3px rgb(255 255 255 / 35%); }
.medal-icon svg { width: 22px; height: 22px; }
.medal-text { flex: 1; min-width: 0; display: grid; gap: .2rem; }
.medal-text .pill { justify-self: start; }
.medal.locked .medal-icon { background: var(--surface-2); color: var(--muted); box-shadow: none; }
.medal-bar { display: block; height: .4rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: .2rem; }
.medal-bar > span { display: block; height: 100%; background: var(--h); border-radius: inherit; }

/* Home for returning students */
.home { display: grid; gap: 1rem; }
.home-hero { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.5rem; border-radius: 22px; border: 1px solid var(--border);
  background: radial-gradient(50% 120% at 100% 0%, color-mix(in srgb, var(--violet) 12%, transparent), transparent 70%), radial-gradient(50% 120% at 0% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%), var(--surface); box-shadow: var(--shadow); }
.home-hero h1 { margin-bottom: .25rem; font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -.02em; }
.home-hero p { margin: 0; }
.home .stack:empty { display: none; }
.note-card { padding: .85rem 1rem; }
.course-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.course-card:not([data-hue]) { --h: var(--accent); }
.course-card { position: relative; display: grid; gap: .75rem; height: 100%; padding: 1.1rem; padding-top: 3.2rem; border-radius: 20px; border: 1px solid var(--border); background: var(--surface);
  color: inherit; text-decoration: none; box-shadow: var(--shadow); overflow: hidden; }
.cc-band { position: absolute; inset: 0 0 auto 0; height: 4.4rem; background: linear-gradient(120deg, color-mix(in srgb, var(--h) 28%, var(--surface)), color-mix(in srgb, var(--h) 8%, var(--surface))); }
.cc-band svg { width: 100%; height: 100%; display: block; }
.cc-blob { fill: color-mix(in srgb, var(--h) 22%, transparent); }
.cc-icon { position: relative; width: 3.2rem; height: 3.2rem; border-radius: 16px; background: var(--h); color: #fff; box-shadow: 0 8px 18px -8px var(--h); margin-top: -1.6rem; }
.cc-icon svg { width: 24px; height: 24px; }
.cc-body { display: grid; gap: .3rem; }
.cc-name { font-size: 1.15rem; overflow-wrap: anywhere; }
.cc-foot { display: flex; align-items: center; gap: .6rem; margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--border); }
.cc-foot small { flex: 1; }
.course-card:hover { border-color: color-mix(in srgb, var(--h) 55%, var(--border)); }
.course-card.add { place-content: center; justify-items: center; text-align: center; padding: 2rem 1rem; border: 2px dashed var(--border); background: transparent; box-shadow: none; }
.course-card.add .ic-tile { --h: var(--accent); }

/* Motion, only when the screen opted in (motion allowed) */
.ws.animated .ws-body > *, .pg.animated > *, .home.animated > * { animation: rise .4s cubic-bezier(.2,.7,.2,1) both; }
.ws.animated .dash > *:nth-child(2), .pg.animated > *:nth-child(2), .home.animated > *:nth-child(2) { animation-delay: .05s; }
.ws.animated .dash > *:nth-child(3), .pg.animated > *:nth-child(3), .home.animated > *:nth-child(3) { animation-delay: .1s; }
.ws.animated .dash > *:nth-child(n+4), .pg.animated > *:nth-child(n+4), .home.animated > *:nth-child(n+4) { animation-delay: .15s; }
.ws.animated .dash, .ws.animated .ws-body > .dash { animation: none; }
.ws.animated .dash > * { animation: rise .4s cubic-bezier(.2,.7,.2,1) both; }
.ws.animated .ring-fill, .pg.animated .ring-fill, .home.animated .ring-fill { animation: ring-in .9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes ring-in { from { stroke-dashoffset: 163.4; } }
.ws.animated .ml-bar > span, .ws.animated .meter > span, .pg.animated .medal-bar > span { animation: grow-x .7s cubic-bezier(.2,.7,.2,1) both; transform-origin: left; }
.pg.animated .chart .bars div { animation: bar-up .6s cubic-bezier(.2,.7,.2,1) both; transform-origin: bottom; }
@keyframes bar-up { from { transform: scaleY(0); } }
.ws.animated .quick-card, .ws.animated .kpi, .ws.animated .tp-card, .home.animated .course-card, .ws.animated .options button, .ws.animated .starter { transition: transform .2s, border-color .2s, box-shadow .2s; }
.ws.animated .quick-card:hover, .home.animated .course-card:hover, .ws.animated a.kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -18px var(--accent); }
.ws.animated .options button:not(:disabled):hover { transform: translateX(3px); }
.ws.animated .tp-chev { transition: transform .25s; }
.ws.animated .tp-card details[open] .tp-body { animation: rise .25s ease-out; }
.ws.animated .flip-inner { transition: transform .55s cubic-bezier(.3,.7,.2,1); transform-style: preserve-3d; }
.ws.animated .face { backface-visibility: hidden; visibility: visible; }
.ws.animated .face.back { transform: rotateY(180deg); }
.ws.animated .flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.ws.animated .grades .grade { animation: rise .3s cubic-bezier(.2,.7,.2,1) both; }
.ws.animated .grades .grade:nth-child(2) { animation-delay: .04s; } .ws.animated .grades .grade:nth-child(3) { animation-delay: .08s; } .ws.animated .grades .grade:nth-child(4) { animation-delay: .12s; }
.ws.animated .qz-feedback, .ws.animated .fc-done, .ws.animated .qz-score { animation: rise .35s cubic-bezier(.2,.7,.2,1) both; }
.ws.animated .qz-dots li { transition: background .3s; }
.ws.animated .fc-art .badge { animation: pop .5s cubic-bezier(.3,1.6,.5,1) .15s both; transform-box: fill-box; transform-origin: center; }
.tutor.animated .msg { animation: rise .25s ease-out; }
.tutor.animated .typing i { animation: blink 1.2s ease-in-out infinite; }
.tutor.animated .typing i:nth-child(2) { animation-delay: .2s; } .tutor.animated .typing i:nth-child(3) { animation-delay: .4s; }
.tutor.animated .starter, .tutor.animated .follow .chip { transition: transform .15s, border-color .15s; }
.tutor.animated .starter:hover { transform: translateY(-2px); }
.pg.animated .pg-week li.on { animation: pop .45s cubic-bezier(.3,1.6,.5,1) both; }

@media (max-width: 860px) {
  .dash-grid { grid-template-columns: 1fr; }
  .ws-hero { flex-wrap: wrap; }
  .ws-hero-side { width: 100%; justify-content: space-between; }
  .next-hero { flex-wrap: wrap; }
  .next-go { width: 100%; justify-content: center; }
}
@media (max-width: 640px) {
  .ws-hero { padding: 1rem; border-radius: 18px; gap: .75rem; }
  .ws-hero .subject-tile { width: 3rem; height: 3rem; border-radius: 14px; }
  .ws-tabs { margin-inline: -1rem; border-radius: 0; border-inline: 0; padding-inline: 1rem; }
  .next-hero { padding: 1.1rem; border-radius: 18px; }
  .next-hero > .ic-tile { display: none; }
  .pz { padding: 1.1rem; border-radius: 18px; gap: 1.25rem; }
  .pz-section { padding-top: 1.1rem; }
  .pz-save { bottom: .5rem; }
  .tp-card summary { padding: .6rem .7rem; gap: .6rem; }
  .tp-card .ring { width: 38px; height: 38px; }
  .tp-body { margin-left: 0; padding: 0 .8rem .9rem; }
  .tp-study .button { flex: 1 1 100%; justify-content: center; }
  .face { min-height: 13rem; padding: 1.5rem 1rem; }
  .grades { grid-template-columns: repeat(2, 1fr); }
  .qz-card { padding: 1.1rem; border-radius: 18px; }
  .qz-score { flex-direction: column; text-align: center; padding: 1.25rem; }
  .qz-score .ring { width: 96px; height: 96px; }
  .starters { grid-template-columns: 1fr; }
  .msg-row { max-width: 100%; }
  .msg-avatar { display: none; }
  .chat-title small { display: none; }
  .pg-hero { padding: 1.1rem; }
  .pg-week li { width: 2rem; height: 2rem; }
  .chart { padding-left: 2.4rem; }
  .mastery-list a { grid-template-columns: minmax(0, 1fr) 70px 2.4rem; }
  .fc-tally { grid-template-columns: repeat(2, minmax(0, 6rem)); }
}
@media (pointer: coarse) {
  .tp-card summary { min-height: 56px; }
  button.cite { min-height: 28px; padding: 0 .55rem; }
  .ws-tabs a { min-height: 44px; }
  .mastery-list a, .pg-courses a { min-height: 44px; }
}
/* Single-column screen grids must not grow to their widest child (the plan timeline scrolls inside itself). */
.dash, .fc, .qz, .qz-results, .pg, .home { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 860px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
