:root {
  color-scheme: light;
  --canvas: #f5f7f6;
  --surface: #fff;
  --surface-2: #f1f6f4;
  --ink: #172c38;
  --muted: #50646e;
  --border: #d8e2e1;
  --border-strong: #a8bdbe;
  --teal: #096b61;
  --accent: #0c7167;
  --accent-hover: #075b53;
  --accent-ink: #fff;
  --accent-soft: #dff2eb;
  --nav: #142b3a;
  --nav-text: #d1e0e4;
  --nav-muted: #acbfc7;
  --nav-active: #264957;
  --attention: #77501b;
  --attention-bg: #fff5e3;
  --danger: #9a3939;
  --danger-bg: #fbeceb;
  --focus: #178273;
  --radius: 13px;
  --shadow: 0 2px 6px #1b383709;
  --serif: Georgia, 'Times New Roman', serif;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 100%;
  line-height: 1.58;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #101c23;
  --surface: #19282f;
  --surface-2: #202f35;
  --ink: #eaf2f1;
  --muted: #b1c3c8;
  --border: #3b5158;
  --border-strong: #657d84;
  --teal: #9be3d0;
  --accent: #9be3d0;
  --accent-hover: #b9f7e7;
  --accent-ink: #102923;
  --accent-soft: #244741;
  --nav: #111f2a;
  --attention: #f3ce94;
  --attention-bg: #3e3223;
  --danger: #ffc1bd;
  --danger-bg: #4d3033;
  --focus: #a6ebd7;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --canvas: #101c23;
    --surface: #19282f;
    --surface-2: #202f35;
    --ink: #eaf2f1;
    --muted: #b1c3c8;
    --border: #3b5158;
    --border-strong: #657d84;
    --teal: #9be3d0;
    --accent: #9be3d0;
    --accent-hover: #b9f7e7;
    --accent-ink: #102923;
    --accent-soft: #244741;
    --nav: #111f2a;
    --attention: #f3ce94;
    --attention-bg: #3e3223;
    --danger: #ffc1bd;
    --danger-bg: #4d3033;
    --focus: #a6ebd7;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
h1, h2, h3, p, figure { margin: 0; }
p + p { margin-top: .78em; }
h2 + p, h3 + p { margin-top: .55em; }
h1, h2, h3 { line-height: 1.25; }
h1 { font: 500 clamp(2rem, 4vw, 3.2rem)/1.09 var(--serif); letter-spacing: -.035em; overflow-wrap: anywhere; }
h2 { font-size: 1.16rem; font-weight: 680; letter-spacing: -.014em; }
h3 { font-size: .99rem; font-weight: 690; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, a, input, textarea, select, summary { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a { color: var(--teal); text-underline-offset: 3px; }
button, input, select, textarea { color: inherit; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; flex: none; margin: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
legend { padding: 0; font-weight: 670; }
summary { cursor: pointer; font-weight: 650; }
details { padding: 12px 0; }
details p { margin-top: .5em; }
progress { width: 100%; height: 7px; border: 0; border-radius: 8px; overflow: hidden; color: var(--accent); background: var(--border); vertical-align: middle; }
progress::-webkit-progress-bar { background: var(--border); border-radius: 8px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 8px; }
.sr-only, .skip:not(:focus) { width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); position: absolute; white-space: nowrap; }
.skip:focus { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 8px 12px; background: var(--surface); }
.muted { color: var(--muted); font-size: .88rem; }
.note { margin: 10px 0 0; }
.plain { padding: 0; margin: 14px 0 0; list-style: none; }
.pre-line { white-space: pre-wrap; overflow-wrap: anywhere; }

.sidebar {
  width: 220px; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 27px 16px 20px;
  color: var(--nav-text); background: var(--nav); overflow: auto;
}
.brand { padding: 0 4px; border: 0; display: flex; text-align: left; align-items: center; gap: 10px; background: none; color: #fff; font-size: 1rem; font-weight: 720; }
.brand small { color: var(--nav-muted); display: block; font-weight: 450; font-size: .75rem; }
.logo { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #6faaa3; border-radius: 9px; color: #9ce4d0; font-size: 1.15rem; }
.sidebar nav { margin-top: 30px; display: grid; gap: 21px; }
.nav-group { display: grid; gap: 4px; }
.nav-heading { margin: 0 10px 4px; color: var(--nav-muted); font-size: .72rem; font-weight: 690; letter-spacing: .07em; text-transform: uppercase; }
.nav-group button { border: 0; background: transparent; color: inherit; padding: 9px 10px; text-align: left; border-radius: 8px; font-size: .89rem; font-weight: 560; white-space: nowrap; }
.nav-group button:hover, .nav-group button[aria-current] { background: var(--nav-active); color: #f4fffd; }
.nav-group button[aria-current] { box-shadow: inset 3px 0 #9ce4d0; }
.nav-group button span { display: inline-block; color: #9ce4d0; width: 22px; font-size: 1rem; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 20px 9px 0; display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--nav-muted); }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #9ce4d0; }
.workspace { margin-left: 220px; min-width: 0; }
.topbar { min-height: 64px; padding: 9px clamp(16px, 3.2vw, 48px); display: flex; justify-content: space-between; align-items: center; gap: 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.course { font-weight: 720; }
.course small { margin-left: 5px; font-size: .72rem; font-weight: 550; color: var(--muted); }
.top-actions, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.theme { width: auto; font-size: .82rem; }
#screen, .footer { max-width: 1450px; margin: 0 auto; padding: 32px clamp(16px, 3.2vw, 48px); }
#screen:focus { outline: 0; }
.footer { padding-top: 0; padding-bottom: 24px; color: var(--muted); font-size: .78rem; }
.exam-writing .sidebar, .exam-writing .footer, .exam-writing [data-action="export"] { display: none; }
.exam-writing .workspace { margin-left: 0; }
.exam-writing #screen { max-width: 1160px; }
.page-heading { margin: 0 0 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-heading p { margin-top: 9px; color: var(--muted); max-width: 66ch; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-head > h2 { margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(15px, 2vw, 24px); box-shadow: var(--shadow); min-width: 0; }
.panel + .panel, .stats-grid + .panel, .result-panel + .panel { margin-top: 15px; }
.button, select, input[type="search"], input[type="number"], textarea {
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink);
}
.button { display: inline-flex; align-items: center; justify-content: center; padding: .56em .91em; min-height: 42px; gap: 7px; font-weight: 650; font-size: .88rem; text-decoration: none; }
.button:not(:disabled):hover { background: var(--surface-2); border-color: var(--teal); }
.button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button.primary:not(:disabled):hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.compact { min-height: 36px; padding: .35em .7em; font-size: .82rem; }
.button.on-dark { background: #ffffff0a; color: #effcf9; border-color: #85a7ab; }
.button.on-dark:hover { background: #ffffff24; border-color: #c4e5df; }
.button.bare { border-color: transparent; background: transparent; color: var(--teal); }
.button.danger-text { color: var(--danger); margin-top: 10px; }
.button.wide { width: 100%; margin-top: 13px; }
.button.icon-button { padding: 2px 7px; min-width: 34px; min-height: 34px; }
.link-button { border: 0; padding: 4px 1px; background: none; color: var(--teal); font-weight: 650; font-size: .88rem; text-align: left; }
.link-button:hover { text-decoration: underline; }
.badge { line-height: 1.2; display: inline-flex; flex: none; padding: 5px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: .76rem; font-weight: 660; }
.badge.accent { background: var(--accent-soft); color: var(--teal); }
.badges { display: flex; gap: 5px; flex-wrap: wrap; }
.empty, .notice { border-radius: 8px; padding: 10px 13px; font-size: .88rem; }
.empty { color: var(--muted); background: var(--surface-2); margin-top: 12px; }
.notice { color: var(--attention); background: var(--attention-bg); margin: 12px 0; }
.storage-warning { margin: 12px clamp(16px, 3.2vw, 48px) 0; }

.welcome { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 30%; gap: 18px; min-height: 246px; align-items: center; padding: clamp(24px, 4.5vw, 52px); border-radius: 16px; background: #163845; color: #f4fbfa; }
.welcome > div:first-child { z-index: 1; }
.welcome h1 { max-width: 17ch; font-size: clamp(2.05rem, 4.2vw, 3.55rem); }
.welcome p { max-width: 49ch; color: #d4e5e5; margin: 13px 0 20px; }
.welcome .primary { background: #a2e9d4; color: #102f2e; border-color: #a2e9d4; }
.welcome .primary:hover { background: #c1f5e7; border-color: #c1f5e7; }
.welcome :focus-visible, .sidebar :focus-visible { outline-color: #b6f2e4; }
.cell-art { position: absolute; right: 4%; width: min(28vw, 300px); aspect-ratio: 1; display: grid; place-items: center; pointer-events: none; }
.cell-art i { position: absolute; border: 1px solid #71b2a882; border-radius: 50%; inset: 13%; transform: rotate(-24deg) scaleY(.8); }
.cell-art i:nth-child(2) { inset: 6%; transform: rotate(32deg) scaleY(.73); }
.cell-art i:nth-child(3) { inset: 22%; transform: rotate(68deg) scaleY(.68); }
.cell-art i:nth-child(4) { inset: 0; border-color: #71b2a844; transform: rotate(-37deg) scaleY(.75); }
.cell-art b { width: 23%; aspect-ratio: 1; border-radius: 50%; background: #9fe3d33b; box-shadow: 0 0 0 12px #87d3c019, 0 0 0 28px #87d3c013; }
.home-grid { margin-top: 26px; display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 18px; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mode-card { position: relative; display: grid; align-content: start; gap: 6px; text-align: left; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.mode-card:hover { border-color: var(--teal); background: var(--surface-2); }
.mode-card strong { font-size: 1rem; font-weight: 690; }
.mode-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 4px; border-radius: 9px; background: var(--accent-soft); color: var(--teal); font-size: 1.05rem; }
.page-heading + .mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.recent-runs { margin-top: 18px; }
.score-panel .section-head { margin-bottom: 13px; }
.metric strong { color: var(--ink); display: block; font: 550 2.25rem/1.09 var(--serif); letter-spacing: -.04em; }
.metric small { font-size: 1.05rem; color: var(--muted); }
.metric > span { color: var(--muted); display: block; font-size: .84rem; margin-top: 5px; }
.score-panel progress { margin-top: 9px; }
.metrics-two { border-top: 1px solid var(--border); margin-top: 17px; padding-top: 13px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.metrics-two strong { font-size: 1.65rem; }
.home-side .button, .open-runs { margin-top: 12px; }
.list-row { display: flex; justify-content: space-between; gap: 13px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; padding-bottom: 1px; }
.list-row strong, .list-row h3 { overflow-wrap: anywhere; }
.list-row .button { flex: none; }
.list-row .muted { font-size: .81rem; }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; gap: 14px; }
.split > .panel { margin-top: 0; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 13px 0 16px; }
.field { display: grid; align-content: start; gap: 5px; min-width: 0; font-weight: 650; font-size: .85rem; }
.field input, .field select, .theme { min-width: 0; min-height: 38px; padding: 7px 8px; font-weight: 450; }
.field input[type="search"] { width: 100%; }
.search input { font-size: 1rem; }
.time-field { max-width: 180px; margin-top: 17px; }
.chapter-picker { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 0 15px; }
.chapter-picker label { display: flex; gap: 6px; align-items: center; padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; font-size: .84rem; cursor: pointer; }
.chapter-picker label:has(input:checked) { background: var(--accent-soft); color: var(--teal); border-color: var(--teal); }
.setup-checks { display: grid; gap: 8px; }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: .9rem; }
.check input { margin-top: 3px; }
.check small, .compact-list small { display: block; color: var(--muted); font-size: .78rem; }
#setup-form .primary { margin-top: 16px; }
.exam-options { display: grid; gap: 8px; margin-top: 13px; }
.exam-option { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.exam-option:has(input:checked) { border-color: var(--teal); background: var(--accent-soft); }
.exam-option small { display: block; color: var(--muted); }
.compact-list li, .manual-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .86rem; }
.compact-list li > span { flex: none; }
.manual-list { max-height: 435px; overflow: auto; padding: 3px 6px; }
.manual-list .actions { flex: none; gap: 4px; }
.bank-filters .fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bank-source { color: var(--teal); font-size: .79rem; margin-top: 2px; }

.session-layout { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 2fr); gap: 15px; align-items: start; }
.session-layout.single-question { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
.question-map { position: sticky; top: 12px; }
.question-map > p { font-size: .86rem; color: var(--muted); }
.question-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; margin: 13px 0 10px; max-height: 285px; overflow: auto; padding: 3px; }
.question-tab { display: flex; justify-content: center; gap: 3px; align-items: center; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); min-height: 37px; font-size: .76rem; font-weight: 680; }
.question-tab small { font-size: .67rem; }
.question-tab.answered { background: var(--accent-soft); color: var(--teal); }
.question-tab.flagged { background: var(--attention-bg); color: var(--attention); }
.question-tab[aria-current] { border: 2px solid var(--teal); }
.question-tab:hover { border-color: var(--teal); }
.legend { display: flex; flex-wrap: wrap; gap: 3px 9px; color: var(--muted); font-size: .74rem; }
.timer { padding: 6px 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; font-weight: 720; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timer.urgent { color: var(--attention); background: var(--attention-bg); }
.question-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: clamp(1rem, 1.45vw, 1.13rem); line-height: 1.7; margin: 13px 0; }
.question-source { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: .84rem; }
.question-figure { margin: 12px 0; }
.figure-button { width: 100%; display: grid; justify-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px; font-size: .84rem; font-weight: 650; color: var(--teal); cursor: zoom-in; }
.figure-button img { display: block; max-width: 100%; max-height: 420px; object-fit: contain; border-radius: 5px; }
figcaption { color: var(--muted); font-size: .78rem; margin-top: 5px; }
.answer-label { display: block; font-size: 1.13rem; font-weight: 670; margin-bottom: 10px; }
textarea { width: 100%; display: block; padding: 12px; font-size: 1rem; line-height: 1.6; resize: vertical; min-height: 132px; }
textarea[readonly] { background: var(--surface-2); }
.answer-panel .button { margin-top: 10px; }
.choice-set { display: grid; gap: 7px; }
.choice-set legend { margin-bottom: 9px; font-size: 1.13rem; }
.choice { display: flex; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--border); border-radius: 7px; cursor: pointer; }
.choice.correct { color: var(--teal); background: var(--accent-soft); }
.choice.incorrect { color: var(--danger); background: var(--danger-bg); }
.session-controls { display: flex; justify-content: space-between; gap: 10px; margin-top: 15px; }
.compare { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.25fr); gap: 9px; }
.compare > div { background: var(--surface-2); padding: 12px; border-radius: 8px; }
.compare p { font-size: .93rem; }
.compare h3:not(:first-child) { margin-top: 12px; }
.compare .model-answer { border-left: 3px solid var(--accent); }
.hint { background: var(--accent-soft); padding: 11px 13px; border-radius: 7px; margin-top: 12px; }
.hint ul { margin: 5px 0 0; padding-left: 21px; }
.rubric-head { margin: 13px 0 4px; }
.rubric-head output { color: var(--teal); font-weight: 730; flex: none; }
.rubric-group { display: grid; gap: 5px; margin-top: 13px; }
.rubric-group legend { padding-bottom: 5px; }
.rubric-group legend small { color: var(--muted); font-weight: 500; margin-left: 7px; }
.criterion { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 8px; align-items: start; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; font-size: .9rem; }
.criterion:has(input:checked) { background: var(--accent-soft); }
.criterion input { margin-top: 3px; }
.criterion small { color: var(--muted); white-space: nowrap; }
.rubric-actions { margin-top: 13px; }
.result-score { display: block; color: var(--teal); font: 650 3rem/1.2 var(--serif); margin: 9px 0; }
.result-score small { font-size: 1.55rem; color: var(--muted); }
.stats-grid, .stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
.stats-grid .panel, .stat-grid .panel { margin-top: 0; }
.bars { margin: 11px 0 3px; display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(35px, .8fr) 45px; gap: 8px; align-items: center; font-size: .83rem; }
.bar-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.subsection { margin-top: 18px; }
.figure-gallery { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.panel p + .actions { margin-top: 13px; }
.transfer-steps { margin: .75em 0; padding-inline-start: 1.5em; }
.transfer-steps li + li { margin-top: .35em; }

#toast { position: fixed; z-index: 30; right: 16px; bottom: 16px; max-width: min(440px, calc(100% - 32px)); border-radius: 8px; background: var(--nav); color: #fff; padding: 10px 13px; box-shadow: 0 8px 24px #192b3c40; font-size: .9rem; }
#toast:empty { display: none; }
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 0; max-width: calc(100% - 24px); }
dialog::backdrop { background: #081521c9; }
.dialog-body { width: min(450px, 100%); padding: 20px; }
.dialog-body .actions { margin-top: 17px; justify-content: flex-end; }
#figure-dialog { width: min(1080px, 96vw); }
.figure-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 12px; gap: 10px; }
.figure-bar h2 { font-size: 1rem; }
#zoom-label { min-width: 3.7em; text-align: center; }
#figure-viewport { max-height: 77vh; overflow: auto; padding: 12px; background: var(--surface-2); }
#figure-image { display: block; height: auto; max-width: none; margin: 0 auto; }

@media (max-width: 1060px) {
  .sidebar { width: 192px; }
  .workspace { margin-left: 192px; }
  .home-grid { grid-template-columns: 1.55fr 1fr; }
  .session-layout { grid-template-columns: minmax(184px, .65fr) minmax(0, 1.65fr); }
  .compare { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .sidebar { position: static; width: auto; overflow: visible; padding: 12px 16px; gap: 10px; }
  .sidebar nav { display: flex; flex-wrap: wrap; margin: 0; gap: 3px 9px; }
  .nav-group { display: contents; }
  .nav-heading, .sidebar-foot { display: none; }
  .nav-group button { padding: 6px 7px; }
  .nav-group button span { width: 17px; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 55px; }
  #screen { padding-top: 22px; }
}

@media (max-width: 600px) {
  .course { font-size: .83rem; }
  .course small, .desktop-only { display: none; }
  .top-actions { gap: 5px; }
  .topbar { padding-inline: 12px; }
  .welcome { min-height: 0; display: block; padding: 23px 18px; }
  .cell-art { display: none; }
  .home-grid, .split, .session-layout, .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .section-head, .page-heading { align-items: flex-start; flex-wrap: wrap; }
  .page-heading { margin-bottom: 15px; gap: 9px; }
  .mode-card { padding: 13px; }
  .mode-card .muted { font-size: .82rem; }
  .page-heading + .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field input, .field select, .theme { font-size: 1rem; }
  .fields, .bank-filters .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .question-map { position: static; }
  .question-nav { max-height: 135px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 350px) {
  .mode-grid, .page-heading + .mode-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
}

@media print {
  .sidebar, .topbar, .button, #toast, .timer, .session-controls, .footer { display: none !important; }
  .workspace { margin: 0; }
  .session-layout { display: block; }
  .question-map { display: none; }
  .panel { box-shadow: none; }
}

.reading-book #screen { max-width: 1680px; padding-inline: clamp(12px, 2vw, 32px); container: book-screen / inline-size; }
.book-toolbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 12px 20px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border);
}
.book-toolbar label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; }
.book-toolbar select { padding: 5px 6px; min-height: 36px; }
.book-source { color: var(--teal); font-weight: 720; overflow-wrap: anywhere; }
.book-layout { display: grid; grid-template-columns: minmax(155px, .82fr) minmax(0, 3.35fr) minmax(155px, .88fr); align-items: start; gap: clamp(10px, 1.5vw, 22px); }
.book-focus .book-outline, .book-focus .book-related { display: none; }
.book-layout.chapters-hidden { grid-template-columns: minmax(0, 1fr) minmax(170px, .26fr); }
.book-layout.related-hidden { grid-template-columns: minmax(170px, .26fr) minmax(0, 1fr); }
.book-layout.chapters-hidden.related-hidden { grid-template-columns: minmax(0, 1fr); }
.chapters-hidden .book-outline, .related-hidden .book-related { display: none; }
.book-focus.chapters-hidden.related-hidden { grid-template-columns: minmax(0, 870px); justify-content: center; }
.reading-wide .sidebar { display: none; }
.reading-wide .workspace { margin-left: 0; }
.book-wide .book-middle, .book-self-test .book-middle { max-width: 1180px; width: 100%; justify-self: center; }
.book-wide .book-paper > :is(h1,h2,h3,h4,p,ul,ol) { max-width: 72ch; margin-inline: auto; }
.book-self-test :is(.book-paper,.book-notes,.book-inline-practice) { display: none; }
.book-toolbar:has([data-action="lab-exit"]) :is(.reader-settings,[data-action="book-focus"],[data-action="book-note"],[data-action="book-to-text"]) { display: none; }
.book-targeted { background: var(--accent-soft); box-shadow: -3px 0 var(--teal); outline-offset: 4px; }
.book-middle { min-width: 0; }
.book-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.book-outline, .book-related { padding: 13px; position: sticky; top: 14px; max-height: calc(100dvh - 28px); overflow: auto; }
.book-outline summary { padding: 3px 0 7px; }
.book-outline nav ul, .book-related ul { margin: 6px 0 0; padding-inline-start: 0; list-style: none; }
.book-outline li + li, .book-related li + li { margin-top: 4px; }
.book-outline nav h3, .book-related h3 { color: var(--muted); font-size: .81rem; margin: 14px 0 4px; }
.book-related h2 { font-size: 1rem; }
.book-outline a, .book-related a { display: block; padding: 5px 6px; text-decoration: none; border-radius: 6px; font-size: .84rem; line-height: 1.42; overflow-wrap: anywhere; }
.book-outline a:hover, .book-related a:hover { background: var(--surface-2); text-decoration: underline; }
.book-outline .book-current { background: var(--accent-soft); color: var(--teal); font-weight: 720; }
.book-outline .book-section-list { border-inline-start: 1px solid var(--border); padding-inline-start: 7px; list-style: none; }
.book-section-list li { display: flex; align-items: start; }
.book-section-list span { font-size: .85rem; padding-top: 4px; }
.book-paper { --reading-size: 1.06rem; --reading-leading: 1.7; padding: clamp(17px, 3vw, 38px); }
.book-paper.text-small { --reading-size: .95rem; }
.book-paper.text-large { --reading-size: 1.24rem; }
.book-paper.lines-wide { --reading-leading: 1.93; }
.book-paper h1 { font-size: clamp(1.8rem, 3.05vw, 2.8rem); line-height: 1.15; margin-bottom: 22px; }
.book-paper h2, .book-paper h3, .book-paper h4 { scroll-margin-top: 16px; margin: 1.45em 0 .55em; }
.book-paper h2 { font-size: 1.25rem; }
.book-paper h3 { font-size: 1.13rem; }
.book-paper h4 { font-size: 1rem; }
.book-paper p, .book-paper li { font-size: var(--reading-size); line-height: var(--reading-leading); overflow-wrap: anywhere; white-space: pre-wrap; tab-size: 3; }
.book-paper li + li { margin-top: .35em; }
.book-copy { scroll-margin-top: 14px; }
.book-paper .book-source-PilotLabel { margin: 1.2em 0 0; padding: .7em 1em; border-radius: 9px 9px 0 0; background: var(--accent-soft); color: var(--teal); font-weight: 730; font-size: .91rem; }
.book-paper .book-source-PilotCard, .book-paper .book-source-PilotNote, .book-paper .book-source-PilotTest,
.book-paper .book-source-Pedagogiskexempelruta { padding: .7em 1em; margin: 0; background: var(--surface-2); border-inline-start: 3px solid var(--teal); }
.book-paper .book-source-PilotTest { font-weight: 600; }
.book-paper .book-source-Sourcenote, .book-paper .book-source-Pedagogisksource, .book-paper .book-source-Frontsmall { color: var(--muted); font-size: .86em; }
.book-paper .book-source-ExerciseQuestion { margin-top: 1.15em; font-weight: 650; }
.book-answer { padding: .65em 1em; margin: .65em 0; background: var(--surface-2); border-radius: 8px; }
.book-figure { margin: 16px 0; scroll-margin-top: 14px; }
.book-figure .figure-button { background: var(--surface-2); padding: 8px; }
.book-figure .figure-button > img { display: block; width: 100%; height: auto; max-width: 100%; max-height: none; object-fit: contain; }
.book-figure figcaption { font-size: .88rem; line-height: 1.48; margin-top: 8px; }
.pdf-figure-source { display: block; color: var(--muted); }
.book-table { overflow-x: auto; margin-block: 15px; }
.book-table table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.book-table th, .book-table td { border: 1px solid var(--border); padding: .6em .7em; text-align: left; vertical-align: top; min-width: 7em; overflow-wrap: anywhere; }
.book-table th { background: var(--surface-2); font-weight: 720; }
.book-table p { font-size: inherit; line-height: 1.53; }
.book-table p + p { margin-top: .25em; }
.book-term { border: 0; padding: 0; margin: 0; color: var(--teal); background: none; font: inherit; text-decoration: underline dotted; text-underline-offset: .16em; }
.book-term-list { display: flex; flex-wrap: wrap; gap: 6px; }
.book-term-list button { white-space: normal; min-width: 0; }
.book-definition { margin: 1rem 0; }
.book-definition dt { color: var(--muted); font-weight: 650; }
.book-definition dd { margin: 0 0 .75em; overflow-wrap: anywhere; }
.book-paper mark { color: var(--ink); background: var(--attention-bg); box-shadow: inset 0 -2px var(--attention); }
.book-note-item blockquote, #note-quote { margin: .65em 0; padding-inline-start: .8em; border-inline-start: 3px solid var(--teal); }
.book-notes, .book-inline-practice { padding: 16px; margin-top: 14px; scroll-margin-top: 12px; }
.book-inline-practice .page-heading h1 { font-size: 1.5rem; }
.book-inline-practice .result-panel, .book-inline-practice .question { padding: 15px; }
.book-inline-practice > ul, .book-related ul:has(button) { padding-inline-start: 0; list-style: none; }
.book-inline-practice > ul > li, .book-related li:has(> button) { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; padding-block: 5px; }
.book-related li:has(> button) { border-bottom: 1px solid var(--border); font-size: .83rem; }
.book-note-item + .book-note-item { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.book-note-item .actions { margin-top: 8px; }
.book-footer { border-top: 1px solid var(--border); margin-top: 25px; padding-top: 15px; }
.book-next { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.book-next > :nth-child(2) { justify-self: end; text-align: right; }
.book-question-actions { margin-top: 16px; }
.book-progress-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 9px 18px; margin-top: 12px; }
.book-progress-list div { display: grid; grid-template-columns: 1fr auto; gap: 4px 9px; align-items: center; }
.book-progress-list a { grid-column: 1 / -1; }
.book-progress-list small { color: var(--muted); }
.stats-grid:has(.bar-row) { margin-top: 15px; }
#course-search .actions { margin-top: 12px; }
#course-hits { margin-top: 14px; }
#course-hits .panel:first-of-type { margin-top: 10px; }
#figure-image { cursor: grab; user-select: none; -webkit-user-drag: none; }
.figure-dragging #figure-image { cursor: grabbing; }
.exam-writing [data-page="search"] { display: none; }

@container book-screen (max-width: 900px) {
  .book-layout { grid-template-columns: minmax(145px, .8fr) minmax(0, 3fr); }
  .book-related { grid-column: 2; position: static; max-height: none; }
  .book-layout.chapters-hidden { grid-template-columns: minmax(0, 1fr); }
  .book-layout.chapters-hidden .book-related { grid-column: 1; }
}
@container book-screen (max-width: 640px) {
  .book-layout, .book-layout.related-hidden { grid-template-columns: minmax(0, 1fr); }
  .book-outline, .book-related { position: static; max-height: none; grid-column: 1; }
  .book-outline[open] nav { max-height: none; }
}
@media (max-width: 695px) {
  .topbar { flex-wrap: wrap; }
  .book-toolbar .actions { gap: 6px; }
  .book-paper h1 { hyphens: auto; }
  .book-paper .book-footer .button { min-height: 44px; }
}

.mobile-menu { display: none; }
.bank-categories { margin-bottom: 12px; }
.bank-row-actions { flex: 0 0 auto; }
.question-figure .figure-button > img { width: 100%; height: auto; max-height: none; object-fit: contain; }
@media (max-width: 600px) {
  .bank-row { align-items: flex-start; flex-direction: column; }
}
.test-profile .course small { display: inline; color: var(--teal); font-weight: 700; }
.stats-grid + .panel, #repetition-plan + .panel { margin-top: 14px; }
.criterion-followup { padding-inline-start: 1.3em; }
.criterion-followup li + li { margin-top: 12px; }
.criterion-followup p { margin: 3px 0 7px; }
.answer-guide { margin-block: 8px; }
.answer-guide dt { font-weight: 700; }
.answer-guide dd { margin: 0 0 10px; }
.search-excerpt { max-width: 75ch; color: var(--muted); font-size: .9rem; margin-top: 4px; }
.search-excerpt mark { padding: 0 2px; background: var(--attention-bg); color: var(--ink); }
#course-search .actions { align-items: end; }
.reader-settings { position: relative; padding: 0; }
.reader-settings[open] { display: flex; flex-wrap: wrap; gap: 6px; }
.reader-settings summary { padding: .4em .56em; border-radius: 8px; border: 1px solid var(--border); font-size: .84rem; }
.reading-focus .sidebar { display: none; }
.reading-focus .workspace { margin-left: 0; }
.reading-focus .topbar { min-height: 44px; padding-block: 5px; }
.reading-focus .top-actions > :not(#theme), .reading-focus .footer { display: none; }
.reading-focus .book-source { font-size: .86rem; }
.reading-focus .book-toolbar { padding-bottom: 8px; margin-bottom: 9px; }
.reading-focus #screen { padding-top: 10px; }
.return-to-run { margin-bottom: 8px; }
#book-text, #repetition-plan, #study-lab { scroll-margin-top: 12px; }
.guided-feedback { display: grid; gap: 12px 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.guided-feedback ul { padding-inline-start: 1.3em; }
.guided-feedback .button, #guided-lesson .button { margin-top: 8px; }
.review-options, #guided-lesson { margin-block: 16px; }
.daily-card .actions, .daily-card > p { margin-top: 10px; }
.daily-items { list-style: none; padding: 0; margin-block: 8px; }
.daily-items li { border-bottom: 1px solid var(--border); }
.daily-items label { display: flex; align-items: start; gap: 9px; padding: 9px 0; }
.daily-items small { display: block; color: var(--muted); }
.sketch-editor { margin: 12px 0; }
.sketch-editor p { margin: 8px 0; }
.sketch-tools input { max-width: 12rem; }
.sketch-canvas { width: 100%; aspect-ratio: 16 / 9; background: #f9fcfc; border: 1px solid var(--border); border-radius: 8px; display: block; touch-action: none; }
.knowledge-stages { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.knowledge-stages .metric { border-top: 3px solid var(--teal); }
.progress-details > summary { margin-bottom: 10px; }
.book-paper .book-copy.book-source-h4 { font-size: 1.05rem; }
.study-lab { padding: 16px; margin-top: 14px; }
.study-lab > .actions { margin-top: 10px; }
.lab-exercise { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.lab-exercise h3 { font-size: 1.16rem; }
.lab-exercise p { overflow-wrap: anywhere; }
.lab-exercise form { display: grid; gap: 12px; justify-items: start; }
.lab-exercise form > :not(button) { width: 100%; min-width: 0; }
.lab-exercise select { width: 100%; white-space: normal; }
.lab-exercise textarea { min-height: 74px; }
.lab-order { display: grid; list-style: none; counter-reset: steps; margin: 12px 0 0; padding: 0; gap: 5px; }
.lab-order li { counter-increment: steps; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 7px; padding: 6px; }
.lab-order li::before { content: counter(steps); min-width: 1.4em; text-align: center; color: var(--teal); font-weight: 750; }
.lab-order .actions { gap: 4px; }
.lab-order button { min-width: 36px; }
.lab-feedback { margin-top: 13px; padding: 12px; border-radius: 9px; background: var(--surface-2); }
.lab-feedback p:last-of-type { margin-bottom: 9px; }
.lab-figure { position: relative; background: white; border: 1px solid var(--border); }
.lab-figure img { display: block; width: 100%; height: auto; }
.lab-mask { position: absolute; display: grid; place-items: center; padding: 0; border: 0; background: #153e4b; color: white; font-weight: 760; font-size: clamp(.48rem, 1.2vw, .85rem); line-height: 1; }
.lab-targets { display: grid; gap: 8px; }
.lab-catalogue { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,190px),1fr)); gap: 12px; margin-top: 12px; }
.lab-catalogue button { text-align: start; justify-content: start; margin-top: 3px; }
.exam-writing .mobile-menu { display: none; }

@media (max-width: 820px) {
  .mobile-menu { display: inline-flex; }
  body:not(.mobile-menu-open) .sidebar { display: none; }
  body.mobile-menu-open .sidebar { display: block; }
  .mobile-menu-open .sidebar nav { margin-top: 10px; }
  .topbar { justify-content: flex-start; align-items: center; gap: 6px 9px; min-height: 46px; padding-block: 6px; }
  .reading-book #screen { padding-top: 10px; }
  .reading-book .topbar [data-action="export"] { display: none; }
  .reading-book .topbar .course { margin-inline-end: auto; }
  .book-toolbar { gap: 4px; padding-bottom: 7px; margin-bottom: 8px; }
  .book-toolbar > div:first-child { display: flex; column-gap: 8px; flex-wrap: wrap; }
  .book-toolbar > div:first-child p { margin: 0; font-size: .8rem; }
  .book-outline { padding: 4px 11px; }
  .book-outline summary { padding-block: 5px; }
  .book-paper { padding: 14px; }
  .book-paper h1 { margin-bottom: 12px; }
  .reading-focus .mobile-menu { display: none; }
  .reading-focus.mobile-menu-open .sidebar { display: none; }
}
.quiz-filters,.quiz-modules,.quiz-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,245px),1fr)); gap: 12px; }
.quiz-filters { align-items: end; margin-block: 12px; }
.quiz-filters select { width: 100%; }
.quiz-modules { margin-block: 12px; }
.quiz-module { min-width: 0; }
.quiz-module h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.quiz-module details,.quiz-question details { margin-top: 12px; }
.quiz-list { list-style: none; padding: 0; }
.quiz-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding-block: 9px; border-bottom: 1px solid var(--border); }
.quiz-list small { display: block; color: var(--muted); }
.quiz-pick { flex-basis: 100%; min-width: 0; }
.quiz-pick select { width: min(100%, 380px); }
.quiz-question .question-text { margin: 10px 0; }
.quiz-question .actions { margin-top: 10px; }
.quiz-context { padding-block: 10px; border-bottom: 1px solid var(--border); }
.quiz-question figure { max-width: 760px; margin: 12px 0; }
.quiz-question img { width: 100%; height: auto; display: block; }
.quiz-choices { display: grid; gap: 7px; margin-block: 8px; }
.quiz-choices .button { justify-content: start; white-space: normal; text-align: start; min-height: 40px; }
.quiz-flow { grid-template-columns: repeat(auto-fit,minmax(min(100%,155px),1fr)); }
.quiz-question [aria-pressed="true"], .quiz-jumps [aria-current="step"] { background: var(--accent-soft); border-color: var(--teal); color: var(--teal); }
.quiz-jumps [data-answered]:not([aria-current]) { border-color: var(--teal); }
.quiz-jumps > div + div { margin-top: 8px; }
.quiz-hotspot { position: relative; max-width: 760px; background: #edf4f6; border-radius: 10px; }
.quiz-hotspot .button { position: absolute; translate: -50% -50%; min-width: 32px; min-height: 32px; padding: 3px 7px; border-radius: 50%; }
.quiz-sorting { padding-inline-start: 1.5em; }
.quiz-sorting li { padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; margin-bottom: 6px; }
.quiz-sorting .actions { margin-top: 4px; }
.quiz-feedback { margin-top: 14px; }
.quiz-fields select,.quiz-question > select { max-width: 100%; white-space: normal; }
.quiz-cloze select { margin: 4px; max-width: 100%; }
.course-lecture-picks { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,190px),1fr)); gap: 5px 12px; margin: 8px 0 14px; }
.course-result li { margin: 5px 0; }
.course-outcomes { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-inline-start: 1.1rem; }
.coach-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.coach-steps { padding-inline-start: 1.35rem; }
.coach-steps li { padding: .65rem .15rem; overflow-wrap: anywhere; }
.coach-steps li p, .coach-goal p { margin-block: .2rem; }
.coach-levels { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.coach-profile { margin-block: 12px; }
.coach-error { margin-block: .8rem; }
@media (max-width: 740px) { .coach-grid { grid-template-columns: minmax(0, 1fr); } }
.course-result .actions { margin-top: 12px; }
.bank-row .bank-prompt { margin: .35rem 0; white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .quiz-hotspot .button { min-width: 26px; min-height: 26px; font-size: .75rem; }
}
.exam-section-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  list-style: none;
  padding: 0;
}
.exam-section-nav [aria-current="true"] { border-color: currentColor; text-decoration: underline; }
.chapter-quiz { border: 1px solid var(--line); border-top: 3px solid var(--accent); background: var(--surface,var(--paper)); border-radius: 12px; margin-block: 24px; padding: clamp(14px,3vw,26px); min-width: 0; }
.chapter-quiz header h2 { margin: 0 0 4px; scroll-margin-top: calc(var(--study-header, 72px) + 16px); }
.chapter-quiz header p { color: var(--muted); margin: 0 0 16px; }
.chapter-quiz fieldset { display: block; min-inline-size: 0; margin: 0 0 14px; padding: 8px 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.chapter-quiz legend { font-weight: 680; padding-inline: 5px; max-width: 100%; overflow-wrap: anywhere; }
.chapter-quiz-choice { display: flex; align-items: start; gap: 8px; margin-block: 3px; padding: 8px 6px; min-block-size: 40px; border-radius: 5px; overflow-wrap: anywhere; }
.chapter-quiz-choice input { flex: 0 0 auto; margin: .28em 0 0; accent-color: var(--accent); }
.registered-course .chapter-quiz-choice input { width: auto; }
.chapter-quiz-choice:has(input:checked:not(:disabled)), .chapter-quiz-correct { background: var(--accent-soft,var(--soft)); }
.chapter-quiz-wrong { outline: 1px dashed var(--muted); outline-offset: -1px; }
.chapter-quiz-choice small, .chapter-quiz-explain span { display: block; }
.chapter-quiz-explain { margin: 8px 0 0; }
.chapter-quiz-result { font-size: 1.15em; font-weight: 750; scroll-margin-top: 100px; }
.chapter-quiz-followup { margin-block: 8px 16px; }
.chapter-quiz-followup button { min-height: 44px; margin-block-start: 4px; white-space: normal; }
.chapter-quiz-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chapter-quiz-actions p { margin: 0; color: var(--muted); }
.question-help {
  margin: 8px 0 10px;
  padding: 0 10px;
  border: 1px solid var(--dashboard-line,color-mix(in srgb,currentColor 27%,transparent));
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.question-help[open] { padding-bottom: 10px; }
.chapter-quiz fieldset:has(+ .question-help) { margin-bottom: 0; }
.chapter-quiz .question-help:not([open]) { margin-top: 0; border-color: transparent; }
.question-help > summary {
  cursor: pointer;
  min-height: 44px;
  padding-block: 9px;
  font-size: .92rem;
  font-weight: 650;
}
.question-help label { display: grid; gap: 4px; margin-top: 8px; font-size: .92rem; font-weight: 650; }
.question-help label[hidden] { display: none; }
.question-help :is(select,textarea) { width: 100%; min-width: 0; min-height: 44px; font-size: 1rem; }
.question-help-note { margin: 8px 0; font-size: .91rem; }
.question-help-note:empty { margin: 0; }
.study-certainty, .chapter-quiz .study-certainty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 0;
  margin: 0 0 4px;
  border: 0;
  min-inline-size: 0;
}
.study-certainty legend {
  font-size: .9rem;
  font-weight: 650;
  padding: 0;
}
.study-certainty label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}
.study-certainty input {
  margin: 0;
  accent-color: var(--accent);
}
.study-certainty label:has(input:focus-visible) {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}
.study-certainty:disabled label { opacity: .68; }
.study-pass-certainty .p-button, .study-review-intervals .p-button { min-height: 44px; }
.study-pass-certainty [aria-pressed=true], .study-review-intervals [aria-pressed=true] {
  outline: 2px solid currentColor;
  outline-offset: -2px;
  font-weight: 750;
}
.study-pass-certainty:disabled { opacity: .65; }
.study-certainty-status:empty, .study-review-intervals p:empty { display: none; }
.study-recovery, .study-review-queue {
  border: 1px solid var(--line,var(--studio-line));
  border-inline-start: 3px solid var(--accent,var(--studio-line));
  border-radius: 10px;
  padding: 4px 14px;
  margin-block: 12px;
  overflow-wrap: anywhere;
}
.study-recovery summary, .study-review-queue summary {
  cursor: pointer;
  font-weight: 680;
  min-height: 44px;
  padding-block: 10px;
}
.study-recovery-steps { margin: 0 0 12px; padding-inline-start: 24px; }
.study-recovery-steps > li { padding-block: 9px; }
.study-recovery-steps > li + li { border-top: 1px solid var(--line,var(--studio-line)); }
.study-recovery-steps p { margin-block: 4px; }
.study-review-intervals { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.study-review-intervals p { flex-basis: 100%; }
.profile-data-dialog {
  width: min(36rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: clamp(16px, 4vw, 32px);
  color: var(--text, inherit);
}
.profile-data-dialog form { display: grid; gap: 12px; }
.profile-data-dialog h2, .profile-data-dialog p, .profile-data-dialog ul { margin-block: 0; }
.profile-data-dialog fieldset { display: grid; gap: 12px; border: 0; padding: 8px 0; margin: 0; }
.profile-data-dialog label { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; cursor: pointer; }
.profile-data-dialog input { flex: 0 0 auto; margin-block-start: .35em; }
.profile-data-actions, .book-study-links { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-export-reminder { max-width: 62ch; }
.book-study-links { margin-block: 16px 24px; }
.book-self-check { margin-block: 0 16px; }
.book-study-links :is(button, a) { max-width: 100%; white-space: normal; text-align: start; }
.dashboard-insights { display: grid; gap: 8px; margin-block: 16px; }
.dashboard-insights > div { padding: 8px 0; }
.dashboard-insights h3 { font-size: 1rem; margin: 0 0 4px; }
.dashboard-insights p { margin: 0; }
.dashboard-milestones { margin: 0; padding-inline-start: 1.5rem; }
.dashboard-milestones li { margin-block: 6px; }
.study-daily {
  margin-block: 16px 24px;
  padding: clamp(16px, 3vw, 28px);
  max-inline-size: 100%;
  border: 1px solid var(--studio-line, var(--line));
  border-inline-start: 4px solid var(--studio-pigment, var(--accent));
  border-radius: 12px;
  background: var(--studio-surface, var(--surface));
  color: var(--studio-ink, var(--ink));
  scroll-margin-block-start: calc(var(--study-header, 72px) + 12px);
  overflow-wrap: anywhere;
}
.study-daily > header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
  padding-block-end: 12px;
  border-bottom: 1px solid var(--studio-line, var(--line));
}
.study-daily h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); margin: 0; }
.study-daily h3 { font-size: 1rem; margin-block: 12px 4px; }
.study-daily p { margin-block: 4px; max-inline-size: 68ch; }
.study-daily > header p, .study-daily li p, .study-daily-course {
  color: var(--studio-muted, var(--muted));
}
.study-daily-course, .study-daily-duration { font-weight: 720; font-size: .9rem; }
.study-daily-steps { padding: 0; margin-block: 8px 12px; list-style: none; }
.study-daily-steps > li {
  display: grid;
  grid-template-columns: minmax(4rem, auto) minmax(0, 1fr);
  gap: 8px 16px;
  padding: 8px;
  border-bottom: 1px solid var(--studio-line, var(--line));
}
.study-daily-steps > [aria-current=step] {
  border-inline-start: 3px solid var(--studio-pigment, var(--accent));
  background: color-mix(in srgb, currentColor 5%, transparent);
}
.study-daily-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.study-daily-actions :is(a, button) { min-block-size: 44px; max-inline-size: 100%; }
.study-daily-actions p:empty { display: none; }
.study-daily-follow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 12px 24px;
  margin-block-start: 16px;
  border-top: 1px solid var(--studio-line, var(--line));
}
.study-daily-follow :is(details, ul) { margin-block: 4px; }
.study-daily summary { cursor: pointer; min-block-size: 44px; padding-block: 10px; }
.study-daily-return { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.start-diagnosis .study-daily > header { position: static; background: transparent; padding-block-end: 12px; }
.study-result-view, .study-readiness, .study-start-guide {
  margin-block: 16px;
  padding: clamp(12px, 2.4vw, 22px);
  border: 1px solid var(--studio-line, var(--line));
  border-radius: 12px;
  background: var(--studio-surface, var(--surface));
  overflow-wrap: anywhere;
}
.study-result-questions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 12px 20px;
}
.study-result-questions h3, .study-exam-report h3 { margin: 0 0 4px; font-size: 1rem; }
.study-result-view p, .study-readiness p, .study-start-guide p { margin-block: 4px 8px; max-inline-size: 68ch; }
.study-readiness h2 { font-size: clamp(1.15rem, 3vw, 1.5rem); margin-block: 0 8px; }
.study-results-detail, .study-result-areas, .study-exam-report {
  border-top: 1px solid var(--studio-line, var(--line));
  margin-block-start: 12px;
  padding-block-start: 8px;
}
.study-result-view ul, .study-start-guide ul, .study-readiness ul { list-style: none; margin-block: 8px; padding: 0; }
.study-result-areas li, .study-readiness li, .study-start-guide li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding-block: 8px;
  border-top: 1px solid var(--studio-line, var(--line));
}
.study-result-view small { display: block; color: var(--studio-muted, var(--muted)); }
.study-start-guide li { display: block; }
.study-result-view :is(summary, a), .study-readiness :is(summary, a), .study-start-guide :is(summary, a) {
  min-block-size: 44px;
}
.study-result-view summary, .study-readiness summary, .study-start-guide summary {
  cursor: pointer;
  font-weight: 680;
  padding-block: 10px;
}
.study-exam-report ul { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.study-mode-pick {
  display: inline-block;
  color: var(--studio-pigment, var(--accent));
  font-weight: 720;
  font-size: .85rem;
  margin-inline-end: 6px;
}
.study-start-advice { margin-block: 8px; font-size: .9rem; }
.study-start-advice > :last-child { display: block; }
.study-mode-entry { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.study-mode-entry .p-button { min-block-size: 44px; }
.study-mode-entry h2, .study-mode-entry p { margin-block: 4px; }
.study-session-mode { color: var(--muted, var(--studio-muted)); }
.history-section { margin-block: 1.4rem; min-width: 0; }
.history-section h2 { margin-bottom: .65rem; }
.history-priority, .history-two, .history-mechanisms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-block: .7rem;
  align-items: start;
}
.history-priority .priority-card { align-self: stretch; }
.history-model, .history-guide { margin-block: .75rem; }
.history-guide summary h2 { display: inline; font-size: 1.13rem; }
.history-mechanism summary strong, .history-mechanism summary span { display: inline; }
.history-mechanism summary span { display: block; margin-inline-start: 1rem; font-size: .9rem; }
.history-scroll { max-width: 100%; overflow-x: auto; margin-top: .75rem; }
.history-heat { border-collapse: collapse; width: 100%; }
.history-heat caption { text-align: left; margin-bottom: .5rem; font-weight: 650; }
.history-heat th, .history-heat td { border-bottom: 1px solid var(--border); padding: .38rem; text-align: center; }
.history-heat th:first-child { min-width: 8.5rem; text-align: left; }
.history-heat small { display: block; font-size: .82rem; }
.history-cell {
  color: inherit; width: 100%; min-width: 4.5rem; border: 1px solid currentColor;
  border-radius: .45rem; padding: .28rem; cursor: pointer; font-weight: 650;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.history-cell[data-intensity="2"] { background: color-mix(in srgb, var(--accent) 23%, transparent); }
.history-cell[data-intensity="3"] { background: color-mix(in srgb, var(--accent) 34%, transparent); }
.history-cell:hover { text-decoration: underline; }
.history-questions { padding-inline-start: 1.25rem; }
.history-question { min-width: 0; overflow-wrap: anywhere; }
.history-original-image { display: block; max-width: min(100%, 48rem); max-height: 60vh; width: auto; height: auto; object-fit: contain; }
.history-book { margin-block: 1rem; padding: .85rem 1rem; }
.history-book h3 { margin-top: .75rem; font-size: 1.05rem; }
#history-compare, #history-cell, #history-original { scroll-margin-top: 5rem; }
@media (max-width: 760px) {
  .history-priority, .history-two, .history-mechanisms { grid-template-columns: minmax(0, 1fr); }
  .history-heat th:first-child { min-width: 7.5rem; }
}
.mechanism-tabs { margin-block: 0 18px; }
.mechanism-coach { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.mechanism-coach .button, .coach-goal .button { max-width: 100%; white-space: normal; text-align: start; overflow-wrap: anywhere; }
.mechanism-catalogue { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 16px; }
.mechanism-catalogue article { margin: 0; display: flex; flex-direction: column; align-items: start; }
.mechanism-catalogue article h2 { margin-bottom: .35rem; }
.mechanism-catalogue article .button { margin-top: auto; }
.mechanism-toolgrid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; margin-block: 1rem; }
.mechanism-toolgrid fieldset { min-inline-size: 0; margin: 0; border: 1px solid var(--border); border-radius: 9px; padding: 10px; }
.mechanism-toolgrid legend { font-weight: 720; }
.mechanism-toolgrid button { margin: 4px 3px 0 0; }
.mechanism-fields { display: flex; align-items: end; flex-wrap: wrap; gap: 5px 10px; }
.mechanism-fields .field { flex: 1 0 9rem; min-width: 0; margin: 0 0 5px; }
.mechanism-fields select { width: 100%; text-overflow: ellipsis; }
.mechanism-scroll, .mechanism-picture { overflow: auto; max-width: 100%; border: 1px solid var(--border); border-radius: 9px; }
.mechanism-scroll { margin-bottom: .8rem; }
.mechanism-board { position: relative; min-width: 580px; height: 390px; isolation: isolate; }
.mechanism-board.bands-3 { height: 510px; }
.mechanism-board.bands-4 { height: 660px; }
.mechanism-bands { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--surface-2); }
.mechanism-bands > div { flex: 1; padding: 5px 9px; border-bottom: 1px dashed var(--teal); }
.mechanism-bands > div:nth-child(even) { background: var(--accent-soft); }
.mechanism-bands > div:last-child { border-bottom: 0; }
.mechanism-bands span { font-size: .86rem; color: var(--ink); font-weight: 650; }
.mechanism-arrows { display: block; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: var(--teal); }
.mechanism-edge { fill: none; stroke: var(--teal); stroke-width: 2.5; }
.mechanism-edge.edge-inh { stroke: var(--attention); }
.mechanism-edge.edge-bind { stroke-dasharray: 4 3; }
.mechanism-edge.edge-move { stroke-width: 3.5; }
.mechanism-edge-label { fill: var(--ink); stroke: var(--surface); paint-order: stroke; stroke-width: 5px; stroke-linejoin: round;
  font: 700 13px system-ui; text-anchor: middle; dominant-baseline: central; }
.mechanism-ghost { fill: none; stroke: var(--ink); stroke-width: 2px; stroke-dasharray: 4 3; }
.mechanism-node { position: absolute; z-index: 1; transform: translate(-50%,-50%); display: grid; place-items: center;
  padding: 6px 7px; width: clamp(82px, 16%, 135px); min-height: 38px; text-align: center; overflow-wrap: anywhere;
  font: 620 .78rem/1.2 system-ui; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); }
button.mechanism-node { cursor: grab; user-select: none; touch-action: none; }
.mechanism-node:focus-visible, .mechanism-node[aria-pressed="true"] { outline: 2px solid var(--teal); outline-offset: 2px; z-index: 2; }
.mechanism-edges { margin-block: .75rem; }
.mechanism-edges li { margin-block: .45rem; }
.mechanism-figure { margin: .8rem 0; }
.mechanism-picture { background: white; }
.mechanism-image { width: 100%; position: relative; }
.mechanism-image img { display: block; width: 100%; height: auto; max-width: none; max-height: none; border-radius: 0; }
.mechanism-picture.is-zoomed .mechanism-image { width: max(940px, 140%); }
.mechanism-mask { position: absolute; display: block; background: #edf1f3; box-shadow: inset 0 0 0 1px #6a818a33; }
.mechanism-pin { position: absolute; transform: translate(-50%,-50%); z-index: 1; width: 38px; height: 38px;
  padding: 0; color: #fff; background: #164f61; border: 2px solid white; border-radius: 50%; font-size: .9rem; font-weight: 750; cursor: pointer; }
.mechanism-pin.filled { background: #37456e; }
.mechanism-pin[data-active] { outline: 3px solid var(--teal); outline-offset: 2px; box-shadow: 0 0 0 6px var(--surface); z-index: 2; }
.mechanism-pin:focus-visible { outline: 3px solid #9b5613; outline-offset: 1px; z-index: 3; }
.mechanism-placed { position: absolute; left: 50%; transform: translateX(-50%); top: 100%; white-space: nowrap; padding: 2px 5px;
  color: #173142; background: #fff; border: 1px solid #b3c0c6; border-radius: 4px; font-size: .72rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.mechanism-figure figcaption { color: var(--muted); font-size: .9rem; margin-top: 5px; }
.mechanism-figure-questions { padding: 0; list-style: none; display: grid; gap: 10px; }
.mechanism-figure-questions > li { padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.mechanism-figure-questions > li[data-active] { border-color: var(--teal); box-shadow: inset 3px 0 var(--teal); }
.mechanism-question-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mechanism-figure-questions h3 { margin: 0; }
.mechanism-figure-questions textarea { width: 100%; }
.mechanism-review details { margin-block: .75rem; }
.mechanism-review details summary { font-weight: 700; }
[data-m-status]:empty { display: none; }
@media (max-width: 720px) {
  .coach-goal { flex-wrap: wrap; }
  .coach-goal > .actions { flex-basis: 100%; }
  .mechanism-toolgrid { grid-template-columns: minmax(0,1fr); }
  .mechanism-pin { width: 32px; height: 32px; }
  .mechanism-placed { max-width: 76px; }
}
.map-switch { margin-block: 0 14px; }
.map-switch [aria-pressed=true], .map-viewbar [aria-pressed=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.map-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem 1rem; }
.map-toolbar .field { flex: 1 0 145px; min-width: 0; margin: 0; }
.map-toolbar .map-search { flex-grow: 2; flex-basis: 250px; }
.map-toolbar .field :is(input,select) { width: 100%; }
.map-tracks { margin-block: .9rem; }
.map-tracks summary, .map-relations summary, .map-hierarchy summary, .map-browse > summary { color: var(--teal); font-weight: 700; cursor: pointer; }
.map-tracks details { padding: .2rem .1rem; }
.map-tracks .actions, .map-track-nodes { margin-top: .6rem; }
.map-track-nodes { display: flex; gap: .45rem; flex-wrap: wrap; list-style: none; margin-bottom: 0; padding: 0; }
.map-tracks button[aria-pressed=true], .map-track-nodes button[aria-current=true] { background: var(--accent-soft); border-color: var(--teal); }
.map-summary { margin: .8rem 0; color: var(--muted); font-size: .92rem; }
.map-status-legend, .map-legend { padding: 0; margin: .55rem 0 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.map-workspace { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(0,1fr); gap: 16px; align-items: start; }
.map-workspace .map-detail { margin-top: 0; }
.map-detail:empty { display: none; }
.map-viewbar { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: .85rem; }
.map-viewbar h2 { margin: 0; }
.map-graph-tools { margin-bottom: .65rem; }
.map-viewport { position: relative; overflow: auto; scrollbar-gutter: stable; max-height: 545px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.map-stage { position: relative; min-width: 100%; overflow: hidden; }
.map-plane { position: absolute; left: 0; top: 0; transform-origin: top left; isolation: isolate; }
.map-plane svg { position: absolute; inset: 0; pointer-events: none; color: var(--teal); }
.map-edge { fill: none; stroke: var(--teal); stroke-width: 2; }
.map-edge.edge-pre { stroke-dasharray: 7 4; }
.map-edge.edge-part { stroke-dasharray: 2 4; }
.map-edge.edge-carried { stroke-width: 4; }
.map-edge.edge-inh { stroke: var(--danger); }
.map-edge.edge-act { stroke-width: 2.8; }
.map-node-card { position: absolute; width: 204px; max-height: 100px; transform: translate(-50%,-50%);
  padding: 7px 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: 8px;
  text-align: start; cursor: pointer; display: grid; justify-items: start; gap: 1px; line-height: 1.22; overflow-wrap: anywhere; }
.map-node-card[aria-current] { border: 2px solid var(--teal); background: var(--accent-soft); }
.map-node-card:hover { border-color: var(--teal); }
.map-node-card strong { font-size: .98rem; }
.map-node-card > .map-node-course { width: 100%; display: flex; justify-content: space-between; }
.map-node-course, .map-marks { color: var(--teal); font-size: .82rem; font-weight: 720; }
.map-legend { font-size: .86rem; color: var(--muted); }
.map-legend span { display: inline-grid; place-items: center; min-width: 1.27rem; padding-inline: .15rem; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--ink); }
.map-evidence { display: inline-flex; width: fit-content; flex-wrap: wrap; align-items: center; gap: .3em; border: 1px solid var(--border);
  border-radius: 6px; padding: .16em .45em; background: var(--surface-2); color: var(--muted); font-size: .82rem; line-height: 1.25; }
.map-evidence[data-map-status=mastered] { color: var(--teal); background: var(--accent-soft); }
.map-evidence[data-map-status=weak] { color: var(--danger); background: var(--danger-bg); }
.map-evidence[data-map-status=due] { color: var(--attention); background: var(--attention-bg); }
.map-hierarchy details { border-bottom: 1px solid var(--border); }
.map-hierarchy details:first-child { border-top: 1px solid var(--border); }
.map-hierarchy summary { padding: .5rem 0; }
.map-hierarchy summary .muted { display: inline-block; font-size: .82rem; margin-left: .5rem; }
.map-hierarchy ul, .map-relations ul, .map-prereqs ul, .map-levels { list-style: none; padding: 0; margin: .45rem 0; }
.map-hierarchy li button { display: flex; flex-wrap: wrap; width: 100%; min-height: 38px; align-items: center; justify-content: space-between; gap: 5px;
  border: 0; border-radius: 6px; padding: .45rem .6rem; background: none; color: var(--ink); text-align: start; cursor: pointer; }
.map-hierarchy li button:hover, .map-hierarchy li button[aria-current] { background: var(--accent-soft); }
.map-chapter-button { margin-block: .3rem; }
.map-browse, .map-search-results { margin-top: .8rem; }
.map-browse[open] > summary { margin-bottom: .6rem; }
.map-search-results { max-height: 290px; overflow: auto; margin: 0 0 .8rem; }
.map-resources { margin-block: .85rem; }
.map-resources .button, .map-prereqs .button, .map-relations .button { max-width: 100%; white-space: normal; text-align: start; overflow-wrap: anywhere; }
.map-progress, .map-prereqs { padding: .75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.map-progress > p { margin-block: .4rem; }
.map-progress .map-levels li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem; font-size: .88rem; }
.map-prereqs { margin-bottom: .8rem; }
.map-prereqs li + li, .map-relations li + li { margin-top: .7rem; border-top: 1px solid var(--border); padding-top: .7rem; }
.map-prereqs li p, .map-relations li p { font-size: .88rem; margin-top: .3rem; }
.map-relations { margin-top: .8rem; }
.map-relation-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.map-verb { font-size: .81rem; font-weight: 700; padding: .2rem .4rem; border-radius: 5px; color: var(--teal); background: var(--accent-soft); }
.map-verb[data-relation=inh] { color: var(--danger); background: var(--danger-bg); }
@media (max-width: 1100px) {
  .map-workspace { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 580px) {
  .map-toolbar { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .5rem; }
  .map-toolbar .map-search, #map-status-filter { grid-column: 1 / -1; }
  .map-toolbar .field select { overflow: hidden; text-overflow: ellipsis; }
}

.course-switch {
  display: block;
  width: fit-content;
  margin: 0 5px 4px;
  padding: 6px 9px;
  border: 1px solid #7899a2;
  border-radius: 7px;
  color: #e6f4f4;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 650;
}
.course-switch:hover { color: #fff; background: #264957; }

/* Semantic palette shared by the course picker and both course shells. */
:root {
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-6: 24px; --s-8: 32px; --s-12: 48px;
  --study-radius: 12px;
  --study-bg: light-dark(#F6F8FA, #101820);
  --study-paper: light-dark(#FFFFFF, #17242E);
  --study-muted: light-dark(#536473, #B4C4CE);
  --study-text: light-dark(#172532, #ECF3F6);
  --study-line: light-dark(#D6DFE6, #364956);
  --study-control: light-dark(#8799A7, #748C9C);
  --study-wash: light-dark(#EEF3F6, #21333F);
  --study-bio: light-dark(#17695E, #82D9C9);
  --study-math: light-dark(#2A57A8, #A7BFFF);
  --study-on-accent: light-dark(#FFFFFF, #101820);
  --study-serif: Georgia, 'Times New Roman', serif;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="system"] { color-scheme: light dark; }

body.study-shell {
  --canvas: var(--study-bg); --surface: var(--study-paper); --paper: var(--study-paper);
  --ink: var(--study-text); --text: var(--study-text); --muted: var(--study-muted);
  --line: var(--study-line); --border: var(--study-line); --border-strong: var(--study-control);
  --soft: var(--study-wash); --surface-2: var(--study-wash);
  --bar: var(--study-paper); --bar-text: var(--study-text);
  --accent: var(--study-bio); --teal: var(--accent); --focus: var(--accent);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--study-paper));
  --accent-deep: color-mix(in srgb, var(--accent) 85%, var(--study-text)); --accent-hover: var(--accent-deep);
  --on-accent: var(--study-on-accent); --accent-ink: var(--study-on-accent);
  --rad: var(--study-radius); --radius: var(--study-radius);
  --shadow: 0 1px 2px #0b213109, 0 6px 18px #0b213104;
  --study-side: 210px; --study-header: 64px;
  min-height: 100vh;
}
body.study-shell.mathematics, .study-shell .mathematics { --accent: var(--study-math); }
.study-shell :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.study-shell .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.study-shell .platform-wrap { max-width: 1480px; padding-inline: clamp(16px, 3.2vw, 48px); }
.study-shell .platform-bar { position: sticky; top: 0; z-index: 6; background: var(--paper); border-bottom: 1px solid var(--line); }
.study-shell .platform-bar > div { min-height: var(--study-header); }
.study-identity, .study-top-actions { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.study-top-actions { flex-wrap: nowrap; }
.study-shell .brand-mark { flex: none; display: grid; place-items: center; inline-size: 34px; block-size: 34px;
  font: 650 1.1rem var(--study-serif); color: var(--accent); border: 1px solid var(--line); background: var(--accent-soft); border-radius: 8px; }
.study-shell .platform-brand, .study-shell .course { display: inline-flex; gap: var(--s-2); align-items: center; min-width: 0; font-weight: 680; color: var(--text); }
.study-shell .course { border: 0; background: transparent; padding: 0; color: var(--ink); }
.study-shell .course small, .study-shell .platform-brand small { color: var(--accent); font-size: .78rem; font-weight: 700; }
.study-shell .theme, .study-theme select { min-height: 40px; max-width: 100%; border: 1px solid var(--study-control); border-radius: 8px; padding: 4px 8px; background: var(--paper); color: var(--text); font-size: .82rem; }
.study-shell .topbar [data-action="export"] { display: none; }
.study-shell .course-switch { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; margin: 0; padding: 4px var(--s-3); border: 1px solid var(--study-control); border-radius: 8px; background: var(--paper); color: var(--text); font-size: .85rem; font-weight: 680; white-space: nowrap; }
.study-shell .course-switch:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.study-shell .study-menu { display: none; }
.biology.study-shell .topbar { position: fixed; z-index: 6; inset: 0 0 auto; min-height: var(--study-header); justify-content: space-between; padding: var(--s-2) clamp(16px, 3.2vw, 48px); }
.biology.study-shell .workspace { padding-top: var(--study-header); margin-inline-start: var(--study-side); }
.biology.study-shell .sidebar { inset: var(--study-header) auto 0 0; width: var(--study-side); padding: var(--s-4) var(--s-3); background: var(--paper); color: var(--text); border-inline-end: 1px solid var(--line); }
.biology.study-shell .sidebar > .brand { display: none; }
.biology.study-shell .sidebar nav { margin: 0; gap: var(--s-3); }
.study-shell .sidebar .nav-group button { white-space: normal; display: flex; gap: var(--s-1); min-height: 36px; align-items: center; padding: 5px 8px; line-height: 1.32; }
.study-shell .sidebar .nav-group button span { flex: 0 0 18px; color: var(--accent); font-size: inherit; line-height: 1; }
.study-shell .sidebar .nav-heading, .study-nav-heading { color: var(--muted); font-size: .71rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0 8px 2px; }
.study-shell .sidebar .nav-group button:hover, .study-shell .sidebar .nav-group button[aria-current] { background: var(--accent-soft); color: var(--accent); }
.study-shell .sidebar .nav-group button[aria-current], .study-shell .math-sidebar a[aria-current] { box-shadow: inset 2px 0 var(--accent); }
.study-shell .sidebar .sidebar-foot { color: var(--muted); }
.study-shell .sidebar .online-dot { background: var(--accent); }
.biology.study-shell:is(.exam-writing, .reading-focus, .reading-wide) .workspace { margin-inline-start: 0; }
.study-shell.exam-writing .course-switch { display: none; }
.study-shell #screen { padding-top: var(--s-6); }
.study-shell .math-layout { grid-template-columns: minmax(170px, 204px) minmax(0, 1fr); gap: var(--s-8); padding-block: var(--s-6) var(--s-12); }
.study-shell .math-sidebar { position: sticky; top: calc(var(--study-header) + 24px); align-self: start; max-height: calc(100dvh - var(--study-header) - 48px); overflow: auto; }
.study-shell .math-course-label { display: none; }
.study-shell .math-sidebar nav { gap: var(--s-3); }
.study-nav-group { display: grid; gap: 2px; }
.study-shell .math-sidebar nav a { min-height: 36px; display: flex; align-items: center; line-height: 1.3; padding: 5px 8px; }
.study-shell :is(.nav-group,.study-nav-group):last-child { padding-top: var(--s-2); border-top: 1px solid var(--line); }

.study-shell .platform-start { max-width: 1240px; min-height: calc(100vh - 64px); padding-block: clamp(32px, 6vw, 84px) var(--s-12); }
.study-shell .platform-intro { margin-bottom: var(--s-8); }
.study-shell .platform-intro h1 { font-size: clamp(2.65rem, 6vw, 4.55rem); letter-spacing: -.05em; }
.study-shell .platform-intro p { margin-top: var(--s-3); }
.study-shell .section-heading { display: flex; align-items: center; gap: var(--s-4); margin: var(--s-6) 0 var(--s-3); }
.study-shell .section-heading::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.study-shell .section-heading h2 { flex: none; font-size: 1rem; letter-spacing: 0; }
.study-shell .course-options { max-width: none; gap: var(--s-6); }
.study-shell .course-choice { min-width: 0; padding: var(--s-6); box-shadow: var(--shadow); border-top-width: 3px; }
.study-shell .course-choice h2 { font: 550 clamp(1.6rem, 2.7vw, 2.3rem)/1.12 var(--study-serif); letter-spacing: -.028em; }
.study-shell .course-choice p { max-width: 43ch; margin: var(--s-2) 0 var(--s-4); }
.study-shell .choice-top { min-height: 76px; margin: 0 0 var(--s-4); }
.choice-visual { width: clamp(108px, 17vw, 188px); height: 72px; position: relative; isolation: isolate; overflow: hidden; border-radius: 8px; }
.cell-model, .calculus-model { color: var(--accent); background-color: var(--accent-soft); }
.cell-model { display: grid; place-items: center; }
.cell-model i { position: absolute; border: 1px solid currentColor; inset: 19% 24%; border-radius: 50%; transform: rotate(22deg); }
.cell-model i:nth-child(2) { inset: 24% 18%; transform: rotate(-19deg); opacity: .65; }
.cell-model i:nth-child(3) { inset: 36% 37%; transform: rotate(-15deg); background: color-mix(in srgb, var(--accent) 20%, transparent); }
.calculus-model { display: grid; place-items: center; font: italic 3rem/1 var(--study-serif); background-image: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 16%, transparent) 1px, transparent 1px), linear-gradient(to right, color-mix(in srgb, var(--accent) 16%, transparent) 1px, transparent 1px); background-size: 16px 16px; }
.choice-links { width: 100%; display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--line); font-size: .9rem; }
.study-resume, .study-shell .study-next { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s-3); background: var(--paper); border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); padding: var(--s-4) var(--s-6); border-radius: var(--study-radius); }
.study-resume h2 { font: 550 1.65rem/1.2 var(--study-serif); }
.study-resume p, .study-next p { color: var(--muted); }
.study-shell .study-next { margin-top: var(--s-4); }
.study-kicker { display: inline-block; font-size: .79rem; letter-spacing: .08em; font-weight: 730; color: var(--accent); margin-bottom: var(--s-2); }
.study-shell .math-hero, .study-shell .welcome { position: relative; isolation: isolate; color: var(--text); background: linear-gradient(118deg, var(--paper) 32%, var(--accent-soft)); border: 1px solid var(--line); border-radius: var(--study-radius); box-shadow: var(--shadow); padding: clamp(20px, 3vw, 48px); overflow: hidden; }
.study-shell .math-hero h1, .study-shell .welcome h1 { font-size: clamp(2.1rem, 4.2vw, 3.65rem); line-height: 1.08; }
.study-shell .welcome { grid-template-columns: minmax(0, 1fr); min-height: 0; }
.study-shell .welcome p, .study-shell .math-hero p { color: var(--muted); margin-block: var(--s-3); max-width: 53ch; }
.study-hero-content { position: relative; z-index: 1; max-width: 75%; }
.study-hero-art { position: absolute; z-index: -1; inset: 0 0 0 auto; width: 24%; font-size: clamp(4rem, 10vw, 9rem); background-color: transparent; }
.study-shell .welcome .cell-art { z-index: -1; }
.study-shell .welcome .cell-art i { border-color: color-mix(in srgb, var(--accent) 38%, transparent); }
.study-shell .welcome :focus-visible { outline-color: var(--accent); }
.study-shell .welcome .on-dark, .study-shell .math-hero .p-button { color: var(--text); border: 1px solid var(--study-control); background: var(--paper); }
.study-shell .math-hero .p-button:hover, .study-shell .welcome .on-dark:hover { background: var(--accent-soft); }
.study-shell :is(.button, .p-button):not(.bare):not(.link-button) { border-radius: 8px; }
.study-shell .p-button:not(.primary) { border-color: var(--study-control); }
.study-shell :is(.p-button, .button).primary, .study-shell .math-hero .p-button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.study-shell :is(.p-button, .button).primary:hover:not(:disabled), .study-shell .math-hero .p-button.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.study-shell .panel, .study-shell .book-panel { box-shadow: var(--shadow); }
.study-shell :is(.math-label,.field) :is(input:not([type=range]),select,textarea) { border-color: var(--study-control); }
.study-shell :is(.archive-stat,.score-panel,.course-result) progress { accent-color: var(--accent); }
.study-shell :is(#archive-result,.course-result) { font-variant-numeric: tabular-nums; }
.study-shell .course-outcomes { list-style: none; padding: 0; margin: var(--s-4) 0; gap: var(--s-2); }
.study-shell .course-outcomes li { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-1) var(--s-3);
  border: 1px solid var(--line); border-radius: 8px; background: var(--soft); font-size: .87rem; }
.study-shell .course-outcomes [data-outcome="correct"] { color: var(--study-bio); }
.study-shell .course-outcomes [data-outcome="wrong"] { color: var(--danger); }
.study-shell .course-outcomes [data-outcome="uncertain"] { border-style: dashed; }
.study-shell .exam-plan { min-width: 0; padding: var(--s-4); background: var(--soft); border: 1px solid var(--line); border-radius: var(--study-radius); }
.study-shell .exam-plan .bank-feedback { padding-inline: 0; border: none; }
.study-shell .exam-generator { display: grid; align-items: start; gap: var(--s-6); }
.study-shell .exam-fields { min-width: 0; }
.study-shell .exam-fields > :first-child { margin-top: 0; }
.study-shell .exam-options label { padding: var(--s-1); border-radius: 6px; }
.study-shell .exam-options label:has(input:checked) { background: var(--accent-soft); }
@media (min-width: 1080px) {
  .study-shell .exam-generator { grid-template-columns: minmax(0, 1fr) minmax(200px, .47fr); }
  .study-shell :is(.exam-plan,#generator-preview) { position: sticky; top: calc(var(--study-header) + 24px); }
}
.study-shell .archive-questions button[aria-label*="osäker"] { border-style: dashed; }
.study-shell .archive-questions button[aria-label*="påbörjad"]:not(.primary) { background: var(--accent-soft); }
.study-shell dialog { border-color: var(--line); }
.study-shell .book-reading :is(.book-section,.book-example,.solution-step) > :is(p,ul,ol) { max-width: 72ch; }
.study-shell .book-paper > :is(h1,h2,h3,h4,p,ul,ol) { max-width: calc(38.5 * var(--reading-size)); margin-inline: auto; }
.study-shell .book-paper h1:focus-visible { outline-width: 2px; outline-offset: 5px; }
.study-shell .book-outline a { hyphens: auto; }
.study-shell :is(.book-paper,.book-reading) h2 { font: 550 clamp(1.3rem, 2.1vw, 1.8rem)/1.22 var(--study-serif); letter-spacing: -.02em; }
.study-shell :is(.book-paper,.book-reading) h3 { font: 580 clamp(1.08rem, 1.7vw, 1.35rem)/1.25 var(--study-serif); }
.study-shell :is(.book-outline,.book-related) { top: calc(var(--study-header) + 16px); max-height: calc(100dvh - var(--study-header) - 32px); }
.study-shell .book-reading { padding: clamp(16px, 3.1vw, 40px); line-height: 1.65; }
.study-shell .book-notation { grid-template-columns: repeat(auto-fit,minmax(min(100%,15rem),1fr)); }
.study-shell .book-notation .notation-wide { grid-column: 1 / -1; background: var(--soft); padding: var(--s-3) var(--s-4); }
.study-shell .book-notation .notation-wide dt { font-size: 1.1em; }
.study-shell .book-notation .notation-wide dd { max-width: 72ch; }
.study-shell .book-paper :is([id], h2, h3, h4), .study-shell .book-example, .study-shell .book-reading h2 { scroll-margin-top: calc(var(--study-header) + 16px); }
.study-shell .book-wide .book-middle { max-width: 1260px; }
.study-shell .book-toolbar { gap: var(--s-2) var(--s-4); }
.study-shell .book-toolbar .actions { gap: var(--s-1) var(--s-2); }
.study-shell .book-toolbar .actions button { min-height: 36px; }
.study-shell .math-heading { margin-bottom: var(--s-4); }
@container book-screen (max-width: 900px) {
  .study-shell .book-related { position: static; max-height: none; }
}
@container book-screen (max-width: 640px) {
  .study-shell .book-outline { position: static; max-height: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .study-shell :is(.button,.p-button,.course-choice,a.panel,.mode-card) { transition: color 125ms ease, border-color 125ms ease, background-color 125ms ease, box-shadow 125ms ease; }
  .study-shell :is(.course-choice,a.panel,.mode-card):hover { box-shadow: 0 2px 8px #0b213112, 0 8px 24px #0b21310c; }
}
@media (max-width: 1060px) {
  body.study-shell { --study-side: 188px; }
  .study-shell .math-layout { gap: var(--s-4); }
}
@media (max-width: 820px) {
  .study-shell .math-layout { display: block; padding-block: var(--s-4) var(--s-8); }
  .biology.study-shell .workspace { margin-inline-start: 0; }
  .study-shell .study-menu { display: inline-flex; }
  .study-shell .math-sidebar { display: none; }
  .study-shell.mobile-menu-open .math-sidebar, .biology.study-shell.mobile-menu-open .sidebar {
    display: block; position: fixed; inset: var(--study-header) auto auto 0; z-index: 5; max-width: calc(100vw - 24px);
    width: 310px; max-height: calc(100dvh - var(--study-header)); overflow: auto; overscroll-behavior: contain;
    padding: var(--s-4); background: var(--paper); border: 1px solid var(--line); border-radius: 0 0 12px 0; box-shadow: 0 16px 36px #0b21312e;
  }
  .study-shell .sidebar nav { display: grid; }
  .study-shell .sidebar .nav-group { display: grid; gap: 2px; }
  .study-shell .sidebar .nav-heading { display: block; }
  .study-shell .sidebar .nav-group button, .study-shell .math-sidebar nav a { min-height: 42px; }
  .biology.study-shell.reading-focus .sidebar, .biology.study-shell.exam-writing .sidebar { display: none; }
}
@media (max-width: 600px) {
  .study-shell .course-options { grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
  .study-shell .course-choice { padding: var(--s-4); }
  .study-shell .choice-top { min-height: 57px; margin-bottom: var(--s-2); }
  .choice-visual { height: 56px; }
  .study-shell .study-course-title, .study-shell .topbar [data-page="search"] { display: none; }
  .study-shell .course small, .study-shell .platform-brand small { display: inline; margin: 0; }
  .study-shell .study-identity .brand-mark { display: none; }
  .study-shell :is(.study-identity,.study-top-actions) { gap: var(--s-1); }
  .study-shell .platform-bar > div, .biology.study-shell .topbar { padding-inline: var(--s-3); gap: var(--s-2); }
  .study-shell .study-top-actions select { max-width: 91px; }
  .study-shell .math-hero h1, .study-shell .welcome h1 { font-size: clamp(2rem, 8vw, 2.7rem); }
  .study-hero-content { max-width: 100%; }
  .study-hero-art { display: none; }
  .study-shell #screen { padding-top: var(--s-4); }
  .study-shell .book-toolbar { padding-bottom: var(--s-2); }
}
@media (max-width: 350px) {
  .study-shell .study-identity small { display: none; }
}
@media print {
  .study-shell .platform-bar { display: none; }
  .biology.study-shell .workspace { padding-top: 0; margin-inline-start: 0; }
}

.study-shell .study-search-dialog {
  box-sizing: border-box;
  width: min(640px, calc(100% - 24px));
  max-height: min(680px, 90dvh);
  padding: clamp(16px, 4vw, 32px);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 48px #10182040;
}
.study-search-dialog::backdrop { background: #10182090; }
.study-search-dialog header { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.study-search-dialog h2 { margin: 0; font: 550 clamp(1.22rem, 4vw, 1.7rem)/1.2 var(--study-serif); }
.study-search-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3); }
.study-search-tools label { display: grid; gap: var(--s-1); }
.study-search-tools :is(input, select) { min-width: 0; width: 100%; min-height: 40px; }
#study-search-status { color: var(--muted); margin: var(--s-3) 0; }
#study-search-results { margin: 0; padding: 0; list-style: none; }
#study-search-results a {
  display: grid; gap: var(--s-1); padding: var(--s-3);
  border-block-start: 1px solid var(--line); border-radius: 6px;
  color: var(--ink); text-decoration: none; overflow-wrap: anywhere;
}
#study-search-results a span { color: var(--muted); font-size: .88rem; }
#study-search-results a:is(:hover, [data-selected]) { background: var(--accent-soft); }
.study-shell .study-activities .study-resume { padding-block: var(--s-3); }
.study-shell :is(.generator-advanced, .answer-templates) { border-block-start: 1px solid var(--line); margin-block: var(--s-3); padding-block: var(--s-2); }
.study-shell :is(.generator-advanced, .answer-templates) > summary { font-weight: 650; cursor: pointer; }
.study-shell :is(.exam-status-legend, .exam-scope) { color: var(--muted); font-size: .9rem; }
.study-shell :is(.archive-questions, .quiz-jumps) [aria-label*="besvarad"]:not([aria-label*="obesvarad"], .primary, .current) { border-color: var(--accent); }
.study-shell [aria-label*="markerad"] { border-style: dashed; }
.study-shell #archive-source-note { scroll-margin-top: calc(var(--study-header) + 16px); }
@media (max-width: 600px) {
  .study-shell [data-study-search] { padding-inline: var(--s-2); }
  .study-search-tools { grid-template-columns: minmax(0, 1fr); }
}

.study-save-feedback {
  position: fixed; z-index: 7; inset: auto max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) auto;
  max-inline-size: calc(100vw - 24px); display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--focus); border-radius: 8px; background: var(--paper); color: var(--text);
  box-shadow: 0 2px 10px #10182020; font-size: .875rem;
}
.study-save-feedback[hidden], .study-save-feedback button[hidden] { display: none; }
.study-save-feedback[data-state="saved"] { pointer-events: none; }
.study-save-feedback[data-state="saved"] span::before { content: "✓"; margin-inline-end: 6px; color: var(--accent); }
.study-shell :is(.history-cell[aria-pressed="true"], .analysis-examples[open]) {
  box-shadow: inset 3px 0 var(--accent); border-color: var(--accent); background: var(--accent-soft);
}
.study-shell :is(#history-cell, #map-node-title):focus { outline: 2px solid var(--accent); outline-offset: 4px; }
.study-shell .analysis-examples[open] > summary { color: var(--accent); }
.study-shell .analysis-examples summary { scroll-margin-top: calc(var(--study-header) + 12px); }
.study-shell .map-resources { padding: var(--s-3); background: var(--soft); border-radius: 8px; }
.study-shell .map-resources h3 { margin: 0 0 var(--s-2); font-size: .9rem; }
.biology.study-shell.mechanism-board-page #screen { padding-inline: clamp(12px, 2vw, 24px); }
.study-shell .graph-workspace { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: var(--s-4); margin-block-start: var(--s-3); }
.study-shell #math-graph { color: var(--accent); margin: 0; max-width: none; }
.study-shell .graph-reading { min-width: 0; padding: var(--s-4); border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.study-shell .graph-reading h3 { margin: 0; }
.study-shell .graph-reading output { display: block; font-weight: 650; font-variant-numeric: tabular-nums; }
.study-shell .graph-reading .math-label { margin: var(--s-3) 0 0; }
.study-shell .graph-reading input { width: 100%; accent-color: var(--accent); }
.study-shell :is(.math-block, .mechanism-picture, .map-viewport):focus-visible { outline-offset: -3px; }
@media (min-width: 980px) {
  .study-shell .graph-workspace { grid-template-columns: minmax(0, 1fr) minmax(12rem, .36fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .study-shell :is(dialog[open], .study-save-feedback:not([hidden])) { animation: study-feedback-in 150ms ease-out both; }
  .study-shell :is(.analysis-examples, .history-cell, .mechanism-pin, [data-m-field], .solution-step) {
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
  }
}
@keyframes study-feedback-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Frost and Midnight. These roles are shared by BB1160, SF1625 and the course picker. */
:root {
  --study-bg: #f1f4fa; --study-nav: #f7f9fd; --study-paper: #fff;
  --study-raised: #fff; --study-wash: #eaf0f8; --study-hover: #e7edf8;
  --study-text: #152238; --study-muted: #506079; --study-faint: #596d85;
  --study-line: #dbe4ef; --study-control: #798aa2;
  --study-bio: #096f65; --study-math: #315bb3; --study-on-accent: #fff;
  --study-ok: #126855; --study-bad: #a33249; --study-warn: #80500a;
  --study-shadow-color: #1d386523;
  --study-veil: #0a132968;
  --study-ui: 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --study-display: 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
  --study-serif: var(--study-display);
  --surface-radius: 16px; --float-radius: 18px; --control-radius: 9px;
  --study-duration: 155ms; --study-ease: cubic-bezier(.2,.7,.25,1);
}
@supports (color: light-dark(#000, #fff)) {
  :root {
    --study-bg: light-dark(#f1f4fa,#0b1120);
    --study-nav: light-dark(#f7f9fd,#10192a);
    --study-paper: light-dark(#fff,#151f30);
    --study-raised: light-dark(#fff,#1b2940);
    --study-wash: light-dark(#edf2fa,#19263b);
    --study-hover: light-dark(#e7edf8,#23344d);
    --study-text: light-dark(#152238,#eff4fb);
    --study-muted: light-dark(#506079,#adbed3);
    --study-faint: light-dark(#596d85,#98abc5);
    --study-line: light-dark(#dbe4ef,#2a3a51);
    --study-control: light-dark(#798aa2,#7185a1);
    --study-bio: light-dark(#096f65,#59d8c4);
    --study-math: light-dark(#315bb3,#a1b8ff);
    --study-on-accent: light-dark(#fff,#0b1120);
    --study-ok: light-dark(#126855,#78d8bb);
    --study-bad: light-dark(#a33249,#ff9bab);
    --study-warn: light-dark(#80500a,#f5c478);
    --study-shadow-color: light-dark(#1d38651b,#03060e90);
    --study-veil: light-dark(#0a132968,#030611aa);
  }
}
body.study-shell {
  --study-radius: var(--surface-radius);
  --rad: var(--surface-radius); --radius: var(--surface-radius);
  --shadow: 0 1px 2px var(--study-shadow-color), 0 10px 30px -22px var(--study-shadow-color);
  --float-shadow: 0 22px 60px -28px var(--study-shadow-color), 0 6px 16px -8px var(--study-shadow-color);
  --accent-soft: color-mix(in srgb,var(--accent) 9%,var(--paper));
  --accent-deep: color-mix(in srgb,var(--accent) 88%,var(--study-on-accent));
  --danger: var(--study-bad); --success: var(--study-ok); --attention: var(--study-warn);
  font-family: var(--study-ui); color: var(--text); background: var(--canvas);
  accent-color: var(--accent);
}
.study-shell :is(h1,h2,h3,h4,.platform-brand,.course,.result-score,.course-code) {
  font-family: var(--study-display);
}
.study-shell :is(.platform-intro,.math-heading,.page-heading,.welcome,.math-hero) h1 {
  font-weight: 720; letter-spacing: -.051em; line-height: 1.08; text-wrap: balance;
}
.study-shell :is(.math-heading,.page-heading) h1 { font-size: clamp(1.9rem,3.4vw,3rem); }
.study-shell :is(.math-heading,.page-heading) { margin-block-end: var(--s-6); }
.study-shell :is(.math-heading,.page-heading) p { color: var(--muted); max-width: 72ch; }
.study-shell :is(h2,h3) { letter-spacing: -.025em; }
.study-shell :is(input,button,textarea,select) { font-family: inherit; }
.study-shell :focus-visible { outline-color: var(--accent); }
.study-shell #studieyta:focus-visible { outline: none; }
.study-shell #studieyta:focus-visible > :is(.math-heading,.math-hero) h1 { box-shadow: -3px 0 var(--accent); }
.study-shell :is(.sr-only,.skip-link):focus { z-index: 10; }

/* App chrome and controls */
.study-shell .platform-bar, .biology.study-shell .topbar {
  background: var(--study-nav);
  border-block-end: 1px solid var(--line);
  box-shadow: 0 8px 20px -21px var(--study-shadow-color);
}
.study-shell .brand-mark {
  position: relative; border-radius: 10px; font-weight: 770; font-size: 1.05rem;
  color: var(--on-accent); background: var(--accent); border: 1px solid var(--accent);
  box-shadow: inset 0 1px #ffffff40, 0 6px 12px -8px var(--accent);
}
.study-shell .brand-mark::after {
  content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%;
  inset: auto 5px 5px auto; background: currentColor; opacity: .72;
}
.biology.study-shell .sidebar { background: var(--study-nav); }
.study-shell .math-sidebar {
  border-radius: var(--surface-radius); background: var(--study-nav);
  border: 1px solid var(--line); padding: var(--s-3);
}
.study-shell :is(.sidebar,.math-sidebar) nav { gap: var(--s-3); }
.study-shell :is(.sidebar,.math-sidebar) :is(.nav-heading,.study-nav-heading) {
  color: var(--study-faint); font-size: .69rem; letter-spacing: .10em;
}
.study-shell :is(.sidebar .nav-group button,.math-sidebar a) {
  border-radius: var(--control-radius); color: var(--muted); gap: var(--s-2); font-size: .84rem; font-weight: 550;
}
.study-shell :is(.sidebar .nav-group button,.math-sidebar a):hover { color: var(--text); background: var(--study-hover); }
.study-shell :is(.sidebar .nav-group button,.math-sidebar a)[aria-current] {
  color: var(--accent); font-weight: 700; background: var(--accent-soft); box-shadow: inset 2px 0 var(--accent);
}
.study-nav-icon { width: 1rem; flex: 0 0 1rem; text-align: center; color: var(--accent); }
.study-nav-icon::before { content: attr(data-icon); }
.study-shell.study-shell :is(.course-switch,.theme,.study-theme select,.button,.p-button):not(.bare):not(.link-button) {
  border-radius: var(--control-radius);
}
.study-shell :is(.course-switch,.theme,.study-theme select,.button,.p-button):not(.primary):not(.bare):not(.link-button) {
  background-color: var(--study-nav); border-color: var(--study-control); color: var(--text);
}
.study-shell :is(.course-switch,.button,.p-button):not(.primary):not(.bare):not(.link-button):hover:not(:disabled) {
  background-color: var(--study-hover); border-color: var(--accent); color: var(--text);
}
.study-shell :is(.p-button,.button).primary:not(:disabled) {
  box-shadow: inset 0 1px #ffffff30, 0 6px 16px -12px var(--accent);
}
.study-shell :is(button,[role=button])[aria-pressed=true]:not(.primary):not(.bare):not(.link-button) {
  background-color: var(--accent-soft); color: var(--accent); border-color: var(--accent);
}
.study-shell :is(input:not([type=range],[type=checkbox],[type=radio],[type=file]),select,textarea) {
  border-radius: var(--control-radius); background-color: var(--study-nav); border-color: var(--study-control); color: var(--text);
}
.study-shell input::placeholder, .study-shell textarea::placeholder { color: var(--study-faint); }
.study-shell .study-search-trigger::before {
  content: ""; display: inline-block; width: .59em; height: .59em; flex: none;
  border: .11em solid currentColor; border-radius: 50%; margin-inline-end: .4em;
  box-shadow: .30em .29em 0 -.23em currentColor; transform: translateY(-.02em);
}

/* Course entry and dashboard composition */
.course-picker.study-shell {
  background:
    radial-gradient(ellipse at 16% 16%,color-mix(in srgb,var(--study-math) 8%,transparent),transparent 44%),
    radial-gradient(ellipse at 87% 9%,color-mix(in srgb,var(--study-bio) 7%,transparent),transparent 36%),
    var(--canvas);
}
.course-picker.study-shell .platform-bar > div, .course-picker.study-shell .platform-start { max-width: 1280px; }
.course-picker.study-shell .platform-start { padding-block: clamp(28px,5vw,72px) var(--s-12); }
.start-masthead {
  position: relative; isolate: isolate; display: grid; align-items: center;
  grid-template-columns: minmax(0,1fr) minmax(260px,.54fr);
  gap: var(--s-8); padding: clamp(24px,4.2vw,64px); min-width: 0;
  border: 1px solid var(--line); border-radius: calc(var(--surface-radius) + 6px);
  background:
    radial-gradient(ellipse at 10% 0%,color-mix(in srgb,var(--study-math) 13%,transparent),transparent 68%),
    linear-gradient(115deg,var(--study-nav),var(--paper));
  box-shadow: var(--shadow);
}
.start-masthead::before {
  content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb,var(--study-math) 24%,transparent) 1px,transparent 1px);
  background-size: 20px 20px; mask-image: linear-gradient(130deg,transparent 35%,#000 150%);
}
.course-picker.study-shell .platform-intro { margin: 0; }
.course-picker.study-shell .platform-intro h1 { font-size: clamp(2.65rem,5.4vw,4.55rem); text-wrap: initial; }
.course-picker.study-shell .platform-intro p { color: var(--muted); max-width: 36ch; font-size: clamp(1rem,1.55vw,1.2rem); }
.start-activity { position: relative; min-width: 0; }
.start-activity .study-resume, .start-quick {
  display: grid; gap: var(--s-3); padding: var(--s-4);
  border: 1px solid var(--line); border-radius: var(--surface-radius);
  background: var(--study-raised); box-shadow: var(--float-shadow);
}
.start-activity .study-resume[hidden], .start-activity .study-resume:not([hidden]) + .start-quick { display: none; }
.start-activity .study-resume h2 { font: 720 clamp(1.12rem,2vw,1.42rem)/1.2 var(--study-display); }
.start-activity .study-resume p { font-size: .83rem; }
.start-activity .study-resume > a { justify-self: start; }
.study-shell .start-search { display: flex; width: 100%; justify-content: space-between; gap: var(--s-2); text-align: start; }
.start-search kbd { padding: 2px 5px; background: var(--soft); border: 1px solid var(--line); border-radius: 4px; font: 650 .72rem var(--study-ui); color: var(--muted); white-space: nowrap; }
.quick-courses { display: grid; gap: var(--s-1); }
.quick-courses a { display: flex; justify-content: space-between; gap: var(--s-2); padding: 6px var(--s-2); border-radius: 6px; color: var(--muted); font-size: .85rem; text-decoration: none; }
.quick-courses a:hover { color: var(--text); background: var(--study-hover); }
.course-picker.study-shell .section-heading { margin: var(--s-8) 0 var(--s-3); }
.course-picker.study-shell .section-heading h2 { font-size: 1.12rem; font-weight: 710; }
.course-picker.study-shell .course-choice {
  padding: 0; overflow: clip; border: 1px solid var(--line); border-radius: var(--surface-radius);
  background: var(--paper); box-shadow: var(--shadow);
}
.course-picker.study-shell .choice-top {
  isolation: isolate; position: relative; margin: 0; padding: var(--s-4) clamp(16px,2.35vw,32px);
  min-height: clamp(86px,9vw,131px); border-block-end: 1px solid var(--line); overflow: hidden;
  background:
    radial-gradient(ellipse at 85% 6%,color-mix(in srgb,var(--accent) 23%,transparent),transparent 71%),
    linear-gradient(120deg,var(--accent-soft),var(--study-nav));
}
.course-picker.study-shell .course-code {
  align-self: center; z-index: 1; color: var(--accent); background: var(--paper);
  border: 1px solid color-mix(in srgb,var(--accent) 45%,var(--line)); border-radius: 7px;
  padding: 5px 10px; letter-spacing: .10em; font-size: .75rem; font-weight: 750;
}
.course-picker.study-shell .choice-visual {
  position: absolute; inset: 0 0 0 auto; width: 56%; height: 100%; border-radius: 0;
  background-color: transparent; opacity: .8; font-size: clamp(3.3rem,7vw,6.1rem);
}
.course-picker.study-shell .cell-model {
  background-image: linear-gradient(115deg,transparent 49%,color-mix(in srgb,var(--accent) 20%,transparent) 50%,transparent 51%),
    radial-gradient(color-mix(in srgb,var(--accent) 27%,transparent) 1px,transparent 1px); background-size: auto, 17px 17px;
}
.course-picker.study-shell .cell-model i { inset: 15% 15%; border-width: 1.5px; }
.course-picker.study-shell .cell-model i:nth-child(2) { inset: 26% 22%; }
.course-picker.study-shell .cell-model i:nth-child(3) { inset: 39% 38%; }
.choice-main { padding: var(--s-6) clamp(16px,2.3vw,32px) var(--s-4); }
.course-picker.study-shell .choice-main h2 { font: 720 clamp(1.32rem,2.45vw,2rem)/1.12 var(--study-display); letter-spacing: -.042em; }
.course-picker.study-shell .choice-main p { color: var(--muted); }
.choice-action { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.choice-action [data-course-entry] { gap: var(--s-4); }
.choice-progress { color: var(--accent); font-size: .84rem; font-weight: 650; }
.choice-progress:not([hidden])::before { content: "✓"; margin-inline-end: .45em; }
.course-picker.study-shell .choice-links { margin-top: var(--s-4); gap: var(--s-4); }
.course-picker.study-shell .choice-links a { color: var(--muted); font-weight: 640; text-decoration: none; }
.course-picker.study-shell .choice-links a:hover { color: var(--accent); text-decoration: underline; }
.course-picker.study-shell .study-activities:not(:empty) { margin-top: var(--s-4); }
.study-shell :is(.math-hero,.welcome) {
  background:
    radial-gradient(ellipse at 92% 1%,color-mix(in srgb,var(--accent) 16%,transparent),transparent 63%),
    linear-gradient(114deg,var(--paper) 36%,var(--study-nav));
  border-radius: calc(var(--surface-radius) + 4px);
}
.study-shell :is(.math-hero,.welcome) h1 { font-size: clamp(2rem,4.1vw,3.65rem); }
.study-shell :is(.math-hero,.welcome) .study-kicker {
  border: 1px solid color-mix(in srgb,var(--accent) 42%,var(--line)); border-radius: 6px;
  padding: 4px 8px; letter-spacing: .065em; background: var(--accent-soft); font-size: .73rem;
}
.study-shell .study-hero-art { width: 33%; color: var(--accent); opacity: .65; mask-image: linear-gradient(90deg,transparent,#000 37%); }
.study-shell .study-next { background: var(--study-raised); box-shadow: var(--shadow); }
.study-shell :is(a.panel,.mode-card) { border-color: var(--line); background: var(--paper); box-shadow: var(--shadow); }
.study-shell :is(a.panel,.mode-card):hover { border-color: var(--accent); background: var(--accent-soft); }
.study-shell .score-panel .metric > strong, .study-shell .math-progress strong { color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.study-shell .score-panel .metrics-two { border-top: 1px solid var(--line); padding-top: var(--s-3); }
.study-shell :is(.study-resume,.study-next) h2 { font-family: var(--study-display); font-weight: 700; }

/* Reading and worked examples */
.study-shell :is(.reader-crumbs,.book-toolbar) { color: var(--muted); }
.study-shell :is(.book-outline,.book-related,.reader-contents,.reader-on-page) {
  background: var(--study-nav); border: 1px solid var(--line); border-radius: 12px; box-shadow: none;
}
.study-shell :is(.book-outline,.book-related) :is(.book-current,[aria-current]) {
  color: var(--accent); background: var(--accent-soft); box-shadow: inset 2px 0 var(--accent);
}
.study-shell :is(.book-paper,.math-reader .book-reading) {
  background: linear-gradient(177deg,var(--study-nav),var(--paper) 16rem);
  border: 1px solid var(--line); border-radius: var(--surface-radius); box-shadow: var(--shadow);
}
.study-shell .book-paper h1, .study-shell .reader-content h1 {
  font: 720 clamp(1.95rem,3.8vw,3.2rem)/1.09 var(--study-display);
  letter-spacing: -.049em; text-wrap: balance;
}
.study-shell :is(.book-paper,.book-reading) h2 {
  font: 720 clamp(1.24rem,2.25vw,1.66rem)/1.2 var(--study-display);
  letter-spacing: -.035em;
}
.study-shell :is(.book-paper,.book-reading) h3 { font: 680 clamp(1rem,1.55vw,1.2rem)/1.35 var(--study-display); }
.study-shell .book-paper :is(p,ul,ol) { line-height: var(--reading-leading,1.7); }
.study-shell .book-paper h2 { border-block-start: 1px solid var(--line); padding-block-start: var(--s-4); }
.study-shell :is(.book-figure,.mechanism-figure) figcaption {
  margin-block-start: var(--s-2); padding: var(--s-2) var(--s-3); color: var(--muted);
  background: var(--study-nav); border-radius: 7px; font-size: .8rem;
}
.study-shell :is(.book-figure,.book-demo,.mechanism-picture) { border-radius: 12px; }
.study-shell .book-figure img { object-fit: contain; }
.study-shell .book-figure .figure-button { background: var(--study-wash); border-color: var(--line); }
.study-shell :is(.reader-definitions,.book-start,.book-hint,.book-supplement) {
  background: var(--accent-soft); color: var(--text); border-inline-start: 3px solid var(--accent);
}
.study-shell .book-starter { border-block: 1px solid var(--line); border-inline-start-color: var(--study-control); background: var(--study-nav); border-radius: 0 10px 10px 0; }
.study-shell .book-example {
  border: 1px solid var(--line); border-inline-start: 3px solid var(--accent);
  background: var(--study-nav); border-radius: 0 12px 12px 0;
}
.study-shell :is(.book-example-level,.book-figure figcaption) { color: var(--muted); }
.study-shell :is(.book-steps,.book-starter-steps) {
  position: relative; list-style: none; counter-reset: shown-step; padding-inline-start: var(--s-6);
  border-inline-start: 1px solid var(--line); margin-inline-start: var(--s-3);
}
.study-shell :is(.book-steps,.book-starter-steps) > li {
  position: relative; counter-increment: shown-step; border: 0; border-block-end: 1px solid var(--line);
  border-radius: 0; background: transparent; margin: 0; padding: var(--s-3) 0;
}
.study-shell :is(.book-steps,.book-starter-steps) > li::before {
  content: counter(shown-step); position: absolute; inset: 15px auto auto calc(-1 * var(--s-6) - 12px);
  width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: 50%; color: var(--accent); background: var(--paper); font: 720 .75rem var(--study-ui);
}
.study-shell .book-steps > li[hidden] { display: none; }
.study-shell :is(.book-steps,.book-starter-steps) h4 { margin-block: 0 var(--s-1); }
.study-shell .book-steps > li:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-radius: 7px; padding-inline: var(--s-2); }
.study-shell .book-example .math-block { background: var(--paper); }
.study-shell .reader-followup { border-color: var(--line); }

/* Banks, answer workspaces, results and data */
.study-shell :is(.panel,.book-panel,.exam-plan,.bank-help,.quiz-question) { border-color: var(--line); }
.study-shell :is(.panel,.book-panel) { box-shadow: var(--shadow); }
.study-shell :is(#bank-results,.bank-results,.math-list,.archive-stat) :is(.list-row,li) { border-color: var(--line); }
.study-shell :is(.bank-row,.math-list li,.list-row) > :first-child { min-width: 0; }
.study-shell :is(.question,.quiz-question,.archive-task,.bank-task) { border-block-start: 3px solid var(--accent); }
.study-shell :is(.question-text,.quiz-question .question-text) { font-size: clamp(1rem,1.4vw,1.13rem); line-height: 1.65; }
.study-shell :is(.answer-panel,.bank-response,.archive-response,.exam-plan,#generator-preview) { background: var(--study-nav); }
.study-shell :is(.bank-response,.archive-response) { border-radius: 10px; padding: clamp(12px,2vw,20px); }
.study-shell :is(.quiz-session-tools,.archive-run-nav) { background: var(--study-nav); }
.study-shell :is(.quiz-jumps,.archive-questions,.question-nav) button[aria-current] {
  border-color: var(--accent); box-shadow: inset 0 -2px var(--accent);
}
.study-shell :is(.result-panel,.course-result,.archive-result-panel) {
  background: linear-gradient(138deg,var(--accent-soft),var(--paper) 58%);
  border-block-start: 3px solid var(--accent);
}
.study-shell :is(.premium-score,.result-score) {
  color: var(--text); font-variant-numeric: tabular-nums; font-weight: 750;
  letter-spacing: -.075em; font-size: clamp(2rem,5vw,3.5rem); line-height: 1.06;
}
.study-shell .premium-score small { font-size: .45em; letter-spacing: -.025em; color: var(--muted); }
.study-shell .result-metrics, .study-shell .course-outcomes { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.study-shell .result-metrics { align-items: baseline; gap: var(--s-2) var(--s-4); }
.study-shell .result-metrics p { margin: 0 var(--s-2) 0 0; }
.study-shell .result-metric-grid, .study-shell .archive-numbers {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,10rem),1fr));
  gap: var(--s-2); margin-block: var(--s-3);
}
.study-shell :is(.result-metric-grid,.archive-numbers) p {
  border: 1px solid var(--line); background: var(--study-nav); color: var(--muted);
  border-radius: 9px; padding: var(--s-3); margin: 0;
}
.study-shell .result-metric-grid .premium-score { display: block; margin-block-end: var(--s-1); }
.study-shell .archive-numbers strong {
  display: block; color: var(--accent); font-size: clamp(1.5rem,3vw,2.2rem); line-height: 1.1;
  letter-spacing: -.05em; font-variant-numeric: tabular-nums;
}
.study-shell .archive-scope-panel > p { max-width: 76ch; }
.study-shell .exam-plan .bank-feedback { padding-inline: var(--s-3); }
.study-shell .course-outcomes li { background: var(--study-nav); }
.study-shell .course-outcomes li strong { font-variant-numeric: tabular-nums; }
.study-shell :is(.history-priority .priority-card,.bank-feedback,.quiz-feedback,.review) { border-inline-start: 3px solid var(--accent); }
.study-shell [data-result=correct] { border-inline-start-color: var(--study-ok); }
.study-shell [data-result=incorrect] { border-inline-start-color: var(--study-bad); }
.study-shell .history-heat th, .study-shell .analysis-table th { background: var(--study-wash); color: var(--text); }
.study-shell :is(.history-heat,.analysis-table) { font-variant-numeric: tabular-nums; }
.study-shell :is(.history-heat,.analysis-table) tbody tr:hover { background: var(--study-hover); }
.study-shell :is(.archive-stat,.history-section,.score-panel,.stats-grid) progress { accent-color: var(--accent); }
.study-shell .archive-stat summary::before { content: "›"; color: var(--accent); margin-inline-end: var(--s-1); }
.study-shell .archive-stat details[open] > summary::before { content: "⌄"; }
.study-shell .archive-stat summary span { flex: 1; }
.study-shell .archive-stat .archive-points-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: baseline; }
.study-shell .archive-points-row progress { grid-column: 2 / -1; height: 5px; margin: 0 0 3px; }
.study-shell :is(.map-viewport,.mechanism-bands,.graph-reading,.demo-controls) { background: var(--study-wash); }
.study-shell .mechanism-bands > div { border-color: var(--study-control); }
.study-shell :is(.graph,.demo-graph,.graph-reading,.mechanism-scroll,.map-viewport) {
  border-radius: 12px; border-color: var(--line);
}
.study-shell dialog {
  border-radius: var(--float-radius); border-color: var(--study-control); background: var(--study-raised);
  color: var(--text); box-shadow: var(--float-shadow);
}
.study-shell dialog::backdrop { background: var(--study-veil); }
.study-shell .study-save-feedback { background: var(--study-raised); box-shadow: var(--float-shadow); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .study-shell :is(.button,.p-button,a.panel,.mode-card,.course-choice,.nav-group button,.math-sidebar a) {
    transition: background-color var(--study-duration) var(--study-ease), color var(--study-duration) var(--study-ease),
      border-color var(--study-duration) var(--study-ease), box-shadow var(--study-duration) var(--study-ease),
      transform var(--study-duration) var(--study-ease);
  }
  .course-picker.study-shell .course-choice:has([data-course-entry]:is(:hover,:focus-visible)) {
    transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--float-shadow);
  }
}
@media (max-width: 820px) {
  .start-masthead { grid-template-columns: minmax(0,1fr); gap: var(--s-4); padding: clamp(16px,4vw,28px); }
  .study-shell .start-activity .study-resume { padding: var(--s-3); }
}
@media (max-width: 600px) {
  .study-shell .study-search-trigger::before { display: none; }
  .course-picker.study-shell .platform-start { padding-block-start: 22px; }
  .course-picker.study-shell .platform-intro h1 { font-size: clamp(2.2rem,10vw,3rem); }
  .course-picker.study-shell .section-heading { margin-block-start: var(--s-6); }
  .start-quick { padding: 0; border: 0; box-shadow: none; background: none; }
  .start-quick .quick-courses { display: none; }
  .course-picker.study-shell .choice-top { min-height: 62px; }
  .choice-main { padding-block-start: var(--s-4); }
  .study-shell :is(.math-heading,.page-heading) { margin-block-end: var(--s-4); }
  .study-shell .archive-stat summary { gap: var(--s-1); }
  .study-shell :is(.bank-response,.archive-response) { padding-inline: var(--s-2); }
  .study-shell .archive-numbers { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .study-shell .archive-numbers p { padding-inline: var(--s-2); font-size: .78rem; overflow-wrap: anywhere; }
}

.studio-start, .study-shell:has(.studio-overview), .studio-overview {
  --studio-canvas: light-dark(#f4f4f0,#141619);
  --studio-surface: light-dark(#fafaf7,#1a1d21);
  --studio-line: light-dark(#d8dad2,#353a40);
  --studio-ink: light-dark(#1d2427,#eef0f1);
  --studio-muted: light-dark(#4f5855,#b0b9c3);
  --studio-control: light-dark(#737d78,#78838d);
  --studio-mono: 'Cascadia Mono', Consolas, ui-monospace, monospace;
  --studio-gap: clamp(1.5rem, 3.5vw, 3rem);
}
.studio-start, .studio-overview { color: var(--studio-ink); }
.studio-cover { display: none; }

.course-picker.study-shell.studio-start,
.study-shell:has(.studio-overview) {
  background: var(--studio-canvas);
}
.study-shell:has(.studio-overview) :is(.platform-bar,.topbar,.sidebar,.math-sidebar),
.course-picker.studio-start .platform-bar {
  background: var(--studio-canvas);
  border-color: var(--studio-line);
  box-shadow: none;
}
.study-shell:has(.studio-overview) .math-sidebar { border-radius: 7px; }
.study-shell:has(.studio-overview) .brand-mark,
.studio-start .platform-brand .brand-mark { border-radius: 5px; box-shadow: none; }
.study-shell:has(.studio-overview) :is(.topbar,.platform-bar) :is(.button,.p-button,.course-switch,.theme,select):not(.primary),
.study-shell.studio-start .platform-bar :is(.p-button,select) {
  background: var(--studio-surface);
  border-color: var(--studio-control);
}
.course-picker.study-shell.studio-start :is(.platform-bar > div,.platform-start) { max-width: 1176px; }
.course-picker.study-shell.studio-start .platform-start { padding-block: clamp(24px,5vw,65px) 48px; }
.studio-overview { max-width: 1180px; margin-inline: auto; }
.studio-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block-end: 18px;
  border-bottom: 1px solid var(--studio-line);
  margin-block-end: 24px;
}
.studio-heading h1 {
  margin: 0;
  color: var(--studio-ink);
  font-size: clamp(1.7rem,3vw,2.45rem);
  font-weight: 680;
  line-height: 1.12;
  letter-spacing: -.046em;
}
.studio-heading .studio-code { display: block; margin-block-end: 5px; }
.studio-code, .studio-label, .studio-module-id, .studio-task-time, .studio-plan-head {
  font-family: var(--studio-mono);
  font-size: .76rem;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: .025em;
}
.studio-code { color: var(--accent, var(--teal)); }
.studio-code > span { color: var(--studio-muted); }
.studio-label { color: var(--studio-muted); margin: 0 0 10px; text-transform: uppercase; }
.studio-heading-stat {
  display: grid;
  gap: 2px;
  color: var(--studio-muted);
  text-decoration: none;
  font-size: .8rem;
}
.studio-heading-stat strong { color: var(--studio-ink); font-weight: 640; }
.studio-heading-stat:hover strong { text-decoration: underline; }

.studio-start-grid, .studio-course-grid {
  display: grid;
  grid-template-columns: minmax(0,1.55fr) minmax(0,1fr);
  gap: var(--studio-gap);
  align-items: start;
}
.studio-start-grid {
  grid-template-areas: "activity courses" "secondary courses";
  grid-template-rows: auto 1fr;
  row-gap: 16px;
}
.studio-start-work { grid-area: activity; }
.studio-start .study-activities { grid-area: secondary; }
.studio-start .study-activities:empty { display: none; }
.studio-start-work, .studio-directory, .studio-course-side, .studio-daily, .studio-path { min-width: 0; }
.studio-directory { grid-area: courses; padding-inline-start: var(--studio-gap); border-inline-start: 1px solid var(--studio-line); }
.studio-start .study-resume.studio-activity, .studio-overview .studio-activity {
  display: grid;
  align-items: start;
  justify-content: stretch;
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--studio-line);
  border-inline-start: 3px solid var(--accent, var(--teal));
  border-radius: 4px 8px 8px 4px;
  background: var(--studio-surface);
  box-shadow: none;
}
.studio-start .study-resume.studio-activity[hidden] { display: none; }
.studio-start [data-study-resume]:not([hidden]) + .studio-empty { display: none; }
.studio-start .studio-activity h2, .studio-overview .studio-activity h2,
.studio-empty h3 {
  color: var(--studio-ink);
  font-size: clamp(1.2rem,2.4vw,1.65rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -.033em;
  overflow-wrap: anywhere;
  margin: 0;
}
.studio-activity p, .studio-empty p { color: var(--studio-muted); font-size: .9rem; line-height: 1.45; margin: 0; }
.studio-start .study-resume p { margin-bottom: 5px; }
.studio-overview .studio-activity p.studio-label { margin-bottom: 7px; font: 600 .73rem/1.35 var(--studio-mono); }
.studio-overview .studio-activity-copy > p:last-child { margin-top: 7px; }
.studio-activity > :is(a,button) { justify-self: start; min-height: 41px; }
.study-shell :is(.studio-overview,.studio-start-grid) :is(.button,.p-button).primary:not(:disabled) { box-shadow: none; }
.studio-empty { padding: 16px 0 12px; border-top: 1px solid var(--studio-line); }
.studio-empty p { margin-top: 8px; max-width: 43ch; }
.studio-start .study-activities .studio-activity {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--studio-line);
  border-radius: 0;
  padding: 14px 0 0;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
}
.studio-start .study-activities .studio-activity h2 { font-size: 1.08rem; }
.studio-start .study-activities .studio-activity > a {
  align-self: center;
  color: var(--studio-ink);
  background: none;
  border: 0;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.course-picker.study-shell.studio-start .studio-course {
  display: block;
  margin: 0;
  padding: 14px 0;
  border: 0;
  border-top: 1px solid var(--studio-line);
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.course-picker.study-shell.studio-start .studio-course:last-child { border-bottom: 1px solid var(--studio-line); }
.studio-course-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.studio-course-meta .choice-progress { color: var(--studio-muted); font-size: .8rem; }
.studio-course h3 { margin: 3px 0 6px; font-size: 1.22rem; line-height: 1.2; }
.studio-course h3 a {
  min-height: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--studio-ink);
  text-decoration: none;
}
.studio-course h3 a:hover { color: var(--accent); }
.studio-course h3 a span, .studio-row-arrow { color: var(--accent); }
.studio-inline { display: flex; flex-wrap: wrap; gap: 5px 18px; }
.studio-inline a, .studio-section-top > a, .studio-next-step a {
  color: var(--studio-muted);
  text-underline-offset: .19em;
  font-size: .85rem;
}
.studio-inline a:hover, .studio-section-top > a:hover, .studio-next-step a:hover { color: var(--accent); }

.studio-course-grid {
  grid-template-columns: minmax(0,2fr) minmax(245px,1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "work resume" "work side";
  row-gap: 20px;
}
.studio-course-grid > .studio-activity { grid-area: resume; }
.studio-course-side {
  grid-area: side;
  display: grid;
  align-content: start;
  gap: 20px;
}
.studio-no-pass { grid-template-areas: "work side"; grid-template-rows: auto; }
.studio-daily, .studio-path { grid-area: work; }
.studio-shortcuts { display: grid; }
.studio-shortcuts > :is(button,a) {
  display: flex;
  min-height: 40px;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin: 0;
  padding: 6px 0;
  border: 0;
  border-top: 1px solid var(--studio-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--studio-ink);
  font-weight: 620;
  font-size: .88rem;
  line-height: 1.25;
  text-decoration: none;
  text-align: start;
}
.studio-shortcuts > :is(button,a):hover { color: var(--accent, var(--teal)); text-decoration: underline; }
.studio-shortcuts > a span { color: var(--studio-muted); font-weight: 400; font-size: .77rem; }
.studio-next-step { padding-block: 12px 0; border-top: 1px solid var(--studio-line); }
.studio-next-step h2 { margin-bottom: 5px; }
.studio-next-step p { margin: 0 0 4px; font-weight: 620; }
.studio-daily-top, .studio-section-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-block-end: 10px;
}
.studio-daily-top h2, .studio-section-top h2 {
  margin: 0;
  font-size: 1.27rem;
  line-height: 1.18;
  font-weight: 690;
  letter-spacing: -.027em;
}
.studio-duration { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.studio-overview .studio-duration .button {
  min-height: 38px;
  padding: 5px 10px;
  border-width: 1px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.studio-overview .studio-duration .button[aria-pressed=true] {
  background: var(--studio-surface);
  border-color: var(--studio-line);
  color: var(--accent, var(--teal));
}
.studio-plan-head {
  color: var(--studio-muted);
  border-block: 1px solid var(--studio-line);
  padding: 8px 12px 8px 34px;
  background: var(--studio-surface);
}
.studio-plan-head, .studio-daily .daily-items label {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(80px,.36fr) minmax(48px,.21fr);
  gap: 4px 12px;
}
.studio-daily .daily-items { margin: 0; }
.studio-daily .daily-items li { border-color: var(--studio-line); }
.studio-daily .daily-items label {
  grid-template-columns: 16px minmax(0,1fr) minmax(80px,.36fr) minmax(48px,.21fr);
  align-items: start;
  padding: 11px 12px 11px 6px;
  cursor: pointer;
}
.studio-daily .daily-items label:hover { background: var(--studio-surface); }
.studio-daily input[type=checkbox] { margin: 4px 0 0; width: 16px; height: 16px; }
.studio-task-title { font-size: .92rem; line-height: 1.35; }
.studio-daily .studio-task-title small { margin-top: 3px; font-size: .79rem; color: var(--studio-muted); }
.studio-task-kind { font-size: .79rem; line-height: 1.4; color: var(--studio-muted); }
.studio-task-time { white-space: nowrap; color: var(--studio-muted); font-variant-numeric: tabular-nums; }
.studio-daily .studio-plan-footer { justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.studio-plan-footer output { color: var(--studio-muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.studio-module-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--studio-line); }
.studio-module {
  display: grid;
  grid-template-columns: 4rem minmax(0,1fr) minmax(6.25rem,auto) 1rem;
  align-items: center;
  gap: 3px 12px;
  padding: 10px 10px 10px 12px;
  min-height: 45px;
  border-bottom: 1px solid var(--studio-line);
  color: var(--studio-ink);
  text-decoration: none;
}
.studio-module strong { font-size: .92rem; font-weight: 650; line-height: 1.27; }
.studio-module strong small { display: block; margin-top: 3px; color: var(--accent); font-size: .75rem; }
.studio-module-id, .studio-module-status { color: var(--studio-muted); }
.studio-module-status { font-size: .8rem; white-space: nowrap; justify-self: end; font-variant-numeric: tabular-nums; }
.studio-module:hover, .studio-module[aria-current=true] { background-color: var(--studio-surface); }
.studio-module[aria-current=true] { box-shadow: inset 2px 0 var(--accent); }
.studio-overview > .open-runs {
  margin-block: 24px 0;
  padding: 14px 0 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--studio-line);
  border-radius: 0;
  box-shadow: none;
}
.studio-overview > .open-runs h2 { font-size: 1.2rem; }
.studio-manage summary { font-weight: 650; cursor: pointer; }
.studio-manage[open] summary { margin-bottom: 10px; }
.studio-biology .home-grid { column-gap: var(--studio-gap); }
.studio-biology .mode-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; }
.studio-biology .mode-grid .mode-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
  align-items: start;
  gap: 4px 12px;
  padding: 10px 2px;
  border: 0;
  border-top: 1px solid var(--studio-line);
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.studio-biology .mode-grid .mode-card:hover { background: var(--studio-surface); }
.studio-biology .mode-card .mode-icon { display: none; }
.studio-biology .mode-card .muted { color: var(--studio-muted); }
.studio-biology .home-side .panel {
  border-radius: 5px;
  background: var(--studio-surface);
  border-color: var(--studio-line);
  box-shadow: none;
}
.study-shell :is(#screen,#studieyta):focus-visible .studio-heading h1 { box-shadow: -3px 0 var(--accent); }

@media (max-width: 850px) {
  .studio-start-grid, .studio-course-grid { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .studio-start-grid { grid-template-areas: "activity" "courses" "secondary"; }
  .studio-start-grid:has([data-study-resume][hidden]) { grid-template-areas: "courses" "activity"; }
  .studio-course-grid { grid-template-areas: "resume" "work" "side"; grid-template-rows: auto; }
  .studio-no-pass { grid-template-areas: "work" "side"; }
  .studio-directory { padding-inline-start: 0; border-inline-start: 0; }
}
@media (max-width: 480px) {
  .studio-heading { margin-block-end: 18px; padding-block-end: 13px; }
  .studio-start .study-activities .studio-activity { gap: 8px; }
  .studio-biology .mode-grid .mode-card { grid-template-columns: minmax(0,1fr); }
  .studio-plan-head { display: none; }
  .studio-daily .daily-items { border-top: 1px solid var(--studio-line); }
  .studio-daily .daily-items label {
    grid-template-columns: 16px minmax(0,1fr) auto;
    padding: 9px 4px;
    column-gap: 9px;
  }
  .studio-task-title { grid-column: 2; }
  .studio-task-kind { grid-row: 2; grid-column: 2; }
  .studio-task-time { grid-column: 3; grid-row: 1; }
  .studio-module {
    grid-template-columns: 3.5rem minmax(0,1fr) 1rem;
    padding-inline: 8px;
    column-gap: 8px;
  }
  .studio-module-status { grid-column: 2; justify-self: start; grid-row: 2; }
  .studio-row-arrow { grid-column: 3; grid-row: 1; }
}

.journey {
  --journey-paper: var(--paper,var(--surface));
  --journey-ink: var(--folio-book-ink,var(--accent,var(--teal)));
  --journey-tint: var(--folio-book,var(--accent-soft));
  --journey-rule: var(--line,var(--border));
  --journey-warn: var(--folio-amber-ink,var(--muted));
  --journey-ready: var(--study-ok,var(--teal));
  --journey-header-gap: clamp(16px,3vw,32px);
  font-variant-numeric: tabular-nums;
  max-width: 1240px;
  margin-inline: auto;
}
.journey svg, .journey-teaser svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.65;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.journey-header {
  display: grid;
  grid-template-columns: minmax(0,1.5fr) minmax(210px,1fr);
  gap: var(--journey-header-gap);
  align-items: end;
  padding: var(--journey-header-gap);
  border: 1px solid var(--journey-rule);
  border-inline-start: 4px solid var(--journey-ink);
  border-radius: 8px;
  background: var(--journey-tint);
}
.journey-header-copy h1 {
  margin: .23rem 0;
  font-size: clamp(1.9rem,4vw,3.15rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}
.journey-header-copy p, .journey-meter span, .journey-attempt p, .journey-due p, .journey-teaser p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}
.journey-meter {
  display: grid;
  gap: 6px;
  font-size: .86rem;
  padding: 12px 14px;
  background: var(--journey-paper);
  border: 1px solid var(--journey-rule);
  border-radius: 6px;
}
.journey-meter label strong { color: var(--journey-ink); font-size: 1.23rem; }
.journey-meter progress { width: 100%; height: 8px; accent-color: var(--journey-ink); }
.journey-guide, .journey-due, .journey-attempt, .journey-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 13px 16px;
  margin-block: 12px;
  border: 1px solid var(--line,var(--border));
  border-radius: 6px;
  background: var(--paper,var(--surface));
}
.journey-guide > div, .journey-teaser-next { display: grid; gap: 1px; }
.journey-guide span, .journey-detail-id p, .journey-teaser-next span {
  font-size: .79rem;
  color: var(--muted);
}
.journey-due { border-inline-start: 4px solid var(--journey-warn); }
.journey-attempt { border-inline-start: 4px solid var(--folio-book-ink,var(--teal)); }
.journey-attempt[data-journey-pass] { border-inline-start-color: var(--study-ok,var(--teal)); }
.journey-attempt[data-journey-pass] strong { color: var(--study-ok,var(--teal)); }
.journey-context { margin-block: 0 12px; }
@media (prefers-reduced-motion: no-preference) {
  .journey-attempt[data-journey-pass] { animation: journey-milestone 180ms ease-out; }
  @keyframes journey-milestone {
    from { opacity: .7; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
.journey-layout {
  display: grid;
  grid-template-columns: minmax(0,1.72fr) minmax(235px,1fr);
  align-items: start;
  gap: clamp(14px,2.4vw,30px);
  margin-block: 18px 26px;
}
.journey-track {
  min-width: 0;
  padding-inline-start: 14px;
  border-inline-start: 2px solid var(--journey-rule);
}
.journey-stage {
  position: relative;
  min-width: 0;
  margin: 0 0 10px;
  border: 1px solid var(--journey-rule);
  border-radius: 6px;
  background: var(--journey-paper);
}
.journey-stage > summary {
  position: relative;
  display: grid;
  grid-template-columns: 2.1rem minmax(0,1fr) 14px;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 9px 14px 9px 10px;
  cursor: pointer;
  list-style: none;
}
.journey-stage > summary::-webkit-details-marker { display: none; }
.journey-stage > summary::before {
  content: '';
  position: absolute;
  inset-inline-start: -20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--journey-ink);
  box-shadow: 0 0 0 2px var(--journey-paper);
}
.journey-stage-number {
  width: 31px;
  height: 31px;
  place-content: center;
  display: grid;
  border-radius: 5px;
  background: var(--journey-tint);
  color: var(--journey-ink);
  font: 700 .83rem ui-monospace,Consolas,monospace;
}
.journey-stage-title, .journey-node-text { display: grid; gap: 2px; min-width: 0; }
.journey-stage-title strong, .journey-node strong { line-height: 1.24; }
.journey-stage-title small, .journey-node small { color: var(--muted); font-size: .72rem; }
.journey-stage-chevron {
  width: 7px;
  height: 7px;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.journey-stage[open] .journey-stage-chevron { transform: rotate(225deg); }
.journey-stage-track { border-block-start: 1px solid var(--journey-rule); padding: 2px 10px 8px 16px; }
.journey-track-row {
  padding-block: 9px;
  display: grid;
  grid-template-columns: minmax(105px,.85fr) minmax(0,2.5fr);
  gap: 6px 12px;
  align-items: center;
}
.journey-track-row + .journey-track-row { border-block-start: 1px solid var(--journey-rule); }
.journey-track-row h3 { margin: 0; font-size: .88rem; line-height: 1.26; letter-spacing: 0; overflow-wrap: anywhere; }
.journey-track-row h3 small { display: block; color: var(--journey-ink); margin-bottom: 3px; font-size: .74rem; }
.journey-nodes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 6px;
}
.journey-nodes[data-four-steps] { grid-template-columns: repeat(4,minmax(0,1fr)); }
.journey-nodes::before {
  content: '';
  position: absolute;
  inset: 17px 7% auto;
  border-block-start: 1px dashed var(--journey-rule);
}
.journey-node {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: start;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  min-width: 0;
  min-height: 70px;
  padding: 3px 5px;
  font-size: .78rem;
  text-align: start;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.journey-glyph {
  display: grid;
  align-items: center;
  justify-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  color: var(--journey-ink,var(--folio-book-ink,var(--teal)));
  border: 1px solid var(--journey-rule,var(--line,var(--border)));
  border-radius: 50%;
  background: var(--journey-tint,var(--folio-book,var(--surface)));
}
.journey-node[data-station-type="checkpoint"] .journey-glyph,
.journey-node[data-station-type="final"] .journey-glyph { width: 37px; height: 37px; border-radius: 8px; }
.journey-node[data-status="done"] .journey-glyph { color: var(--journey-ready); }
.journey-node[data-status="locked"] .journey-glyph { color: var(--muted); background: var(--journey-paper); border-style: dashed; }
.journey-node[data-status="review"] .journey-glyph,
.journey-detail-status[data-status="review"] { color: var(--journey-warn); }
.journey-node[aria-current="step"] .journey-glyph { box-shadow: 0 0 0 2px var(--journey-ink); }
.journey-node:is([aria-pressed="true"],:hover) { border-color: var(--journey-rule); background: var(--journey-tint); }
.journey-detail {
  position: sticky;
  top: calc(var(--study-header,64px) + 16px);
  padding: clamp(12px,2vw,24px);
  background: var(--journey-paper);
  border: 1px solid var(--journey-rule);
  border-block-start: 3px solid var(--journey-ink);
  border-radius: 7px;
  min-width: 0;
}
.journey-detail-id, .journey-teaser-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.journey-detail-id h2, .journey-teaser h2 { margin: 0; font-size: 1.21rem; }
.journey-detail-status {
  margin: 10px 0 4px;
  color: var(--journey-ink);
  font-size: .87rem;
  font-weight: 700;
}
.journey-scope summary, .journey-settings summary, .journey-history summary { cursor: pointer; }
.journey-scope p, .journey-note, .journey-requirement { margin: 8px 0; }
.journey-detail-main { margin-block: 12px 0; }
.journey-detail-main > .button { margin: 4px 6px 5px 0; }
.journey-links, .journey-history ul { padding-inline-start: 1.1em; margin-block: 8px; }
.journey-links li + li, .journey-history li + li { margin-top: 4px; }
.journey-facts { display: grid; gap: 0; margin: 0 0 10px; font-size: .88rem; }
.journey-facts > div { padding-block: 7px; border-block-end: 1px solid var(--journey-rule); }
.journey-facts dt { color: var(--muted); font-size: .77rem; }
.journey-facts dd { margin: 0; font-weight: 660; }
.journey-history { margin-top: 9px; }
.journey-history li :is(strong,a) { display: block; }
.journey-resources, .journey-history .journey-evidence { list-style: none; padding: 0; margin: 12px 0 0; }
.journey-resources li, .journey-evidence li {
  display: grid;
  gap: 1px;
  padding: 7px 0;
  border-block-start: 1px solid var(--journey-rule);
}
.journey-resources small, .journey-evidence small { color: var(--muted); font-size: .77rem; }
.journey-evidence li a { display: inline-block; margin-inline-end: 8px; font-size: .85rem; }
.journey-evidence li small { display: block; }
.journey-history h3 { margin-top: 14px; font-size: .9rem; }
.journey-settings {
  padding: 13px 16px;
  border: 1px solid var(--journey-rule);
  border-radius: 6px;
  background: var(--journey-paper);
}
.journey-settings p { margin-block: 8px; color: var(--muted); }
.journey-intervals { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.journey-intervals label { display: grid; gap: 3px; flex: 0 1 96px; font-size: .85rem; }
.journey-intervals input { width: 100%; min-height: 40px; }
.journey-teaser { border-inline-start: 3px solid var(--folio-book-ink,var(--teal)); }
.studio-overview .journey-teaser { margin-block: 0 20px; }
@media (max-width: 1050px) {
  .journey-track-row { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 850px) {
  .journey-layout { grid-template-columns: minmax(0,1fr); }
  .journey-detail { position: static; scroll-margin-block-start: 74px; }
  .journey-node { min-height: 70px; }
}
@media (max-width: 530px) {
  .journey-header { grid-template-columns: minmax(0,1fr); }
  .journey-nodes { gap: 4px; }
  .journey-nodes[data-four-steps] { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .journey-nodes[data-four-steps]::before { inset-inline: 7% 7%; }
  .journey-node { padding-inline: 4px; }
  .journey-stage-track { padding-inline: 8px; }
}

.studio-start, .study-shell:has(.studio-overview), .studio-overview {
  --studio-canvas: light-dark(#f7f3eb,#191722);
  --studio-surface: light-dark(#fffbf4,#242131);
  --studio-line: light-dark(#d9d0c3,#484253);
  --studio-ink: light-dark(#25212c,#f8f1f5);
  --studio-muted: light-dark(#56515e,#c9becb);
  --studio-control: light-dark(#7e7380,#96899d);
}

.studio-start .studio-course.biology, .studio-biology {
  --studio-art: url("figures/studio-bb1160.jpg");
  --studio-art-base: #795251;
  --studio-tint: light-dark(#f6ded3,#3e2637);
  --studio-pigment: light-dark(#934534,#ffb297);
  --studio-trim: light-dark(#bf7461,#a65c70);
}
.studio-start .studio-course.mathematics, .studio-math {
  --studio-art: url("figures/studio-sf1625.jpg");
  --studio-art-base: #2d3175;
  --studio-tint: light-dark(#e7e7ff,#282751);
  --studio-pigment: light-dark(#4f45a4,#c3bafa);
  --studio-trim: light-dark(#7b73c4,#7a69c0);
}

:is(.studio-start, .studio-overview) .studio-cover {
  display: block;
  align-self: stretch;
  min-width: 0;
  background: var(--studio-art-base) var(--studio-art) center / cover no-repeat;
}
.course-picker.study-shell.studio-start .platform-start {
  padding-top: clamp(22px,3.6vw,49px);
}
.studio-start .studio-heading {
  border-color: var(--studio-line);
  padding-block-end: 17px;
}
.studio-start .studio-heading h1::before {
  content: "";
  display: inline-block;
  width: .21em;
  height: .71em;
  margin-inline-end: .3em;
  border-radius: .04em;
  background: light-dark(#ac472d,#ffac73);
}
.studio-start .studio-start-grid {
  grid-template-columns: minmax(0,1.7fr) minmax(0,1fr);
  grid-template-areas: "courses activity" "courses secondary";
}
.studio-start .studio-directory {
  border: 0;
  padding: 0;
}
.studio-start .studio-start-work { position: relative; }
.studio-start .studio-start-work > .studio-label { color: light-dark(#85432d,#ffba88); }
.studio-start .studio-empty {
  padding: 18px 20px;
  border: 1px solid var(--studio-line);
  border-radius: 5px;
  background: var(--studio-surface);
}
.studio-start .study-resume.studio-activity[data-study-resume] {
  background: color-mix(in srgb,var(--accent) 9%,var(--studio-surface));
}
.studio-start .studio-course-copy {
  min-width: 0;
  padding: clamp(12px,2.1vw,25px);
}
.course-picker.study-shell.studio-start .studio-course {
  display: grid;
  grid-template-areas: "copy art";
  grid-template-columns: minmax(55%,1fr) minmax(0,45%);
  align-items: center;
  min-height: 148px;
  padding: 0;
  margin-block: 0 12px;
  border: 1px solid var(--studio-trim);
  border-radius: 6px;
  background: var(--studio-tint);
}
.course-picker.study-shell.studio-start .studio-course.mathematics {
  grid-template-areas: "art copy";
  grid-template-columns: minmax(0,38%) minmax(62%,1fr);
}
.course-picker.study-shell.studio-start .studio-course:last-child {
  border-color: var(--studio-trim);
}
.studio-start .studio-course-copy { grid-area: copy; }
.studio-start .studio-course .studio-cover { grid-area: art; }
.studio-start .studio-course.biology .studio-cover { border-radius: 0 5px 5px 0; }
.studio-start .studio-course.mathematics .studio-cover { border-radius: 5px 0 0 5px; }
.studio-start .studio-course h3 {
  font-size: clamp(1.12rem,2.1vw,1.55rem);
  letter-spacing: -.04em;
}
.studio-start .studio-course h3 a:hover { color: var(--studio-pigment); }
.studio-start .studio-course .studio-code,
.studio-start .studio-course h3 a span { color: var(--studio-pigment); }
.studio-start .studio-course .studio-inline a { color: var(--studio-ink); }
.studio-start .studio-course .studio-inline a:hover { color: var(--studio-pigment); }
.studio-start .studio-inline { gap: 5px 14px; }
.studio-start .studio-course:is(:hover,:focus-within) h3 a { text-decoration: underline; text-underline-offset: .14em; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .studio-start .studio-course .studio-cover { transition: filter 155ms ease-out; }
  .studio-start .studio-course:is(:hover,:focus-within) .studio-cover { filter: saturate(1.12) brightness(1.05); }
}

.studio-overview .studio-course-heading {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,36%);
  align-items: stretch;
  gap: 0;
  min-height: clamp(110px,14vw,166px);
  padding: 0;
  border: 1px solid var(--studio-trim);
  border-radius: 6px;
  background: var(--studio-tint);
}
.studio-overview .studio-course-title {
  align-self: center;
  min-width: 0;
  padding: clamp(12px,2.25vw,26px);
}
.studio-course-heading .studio-cover { border-radius: 0 5px 5px 0; }
.studio-biology .studio-course-heading .studio-cover { background-position: 58% 50%; }
.studio-math .studio-course-heading .studio-cover { background-position: 56% 60%; }
.studio-course-heading .studio-code { color: var(--studio-pigment); }
.studio-course-heading h1 { font-size: clamp(1.5rem,3.2vw,2.55rem); }
.studio-course-heading .studio-heading-stat { display: flex; flex-wrap: wrap; gap: 1px 9px; margin-top: 9px; }
.studio-overview .studio-course-grid > .studio-activity {
  background: color-mix(in srgb,var(--studio-tint) 65%,var(--studio-surface));
  border-inline-start-color: var(--studio-trim);
}
.studio-overview .studio-activity p.studio-label { color: var(--studio-pigment); }
.studio-overview .studio-plan-head { color: var(--studio-pigment); background: var(--studio-tint); }
.studio-overview .studio-duration .button[aria-pressed=true] {
  background: var(--studio-tint);
  border-color: var(--studio-trim);
  color: var(--studio-pigment);
}
.studio-module[aria-current=true] {
  background: var(--studio-tint);
  box-shadow: inset 2px 0 var(--studio-trim);
}
.studio-module[aria-current=true] strong small { color: var(--studio-pigment); }
.studio-overview :is(.studio-shortcuts,.studio-next-step) .studio-label { color: var(--studio-pigment); }

@media (max-width: 850px) {
  .studio-start .studio-start-grid {
    grid-template-columns: minmax(0,1fr);
    grid-template-areas: "activity" "courses" "secondary";
  }
  .studio-start .studio-start-grid:has([data-study-resume][hidden]) {
    grid-template-areas: "courses" "activity";
  }
}
@media (max-width: 480px) {
  .course-picker.study-shell.studio-start .studio-course {
    grid-template-columns: minmax(0,64%) minmax(0,36%);
    min-height: 112px;
  }
  .course-picker.study-shell.studio-start .studio-course.mathematics {
    grid-template-columns: minmax(0,30%) minmax(0,70%);
  }
  .studio-start .studio-course h3 a { min-height: 30px; }
  .studio-start .studio-course h3 { margin-bottom: 2px; }
  .studio-start .studio-inline { gap: 2px 10px; }
  .studio-start .studio-inline a { font-size: .8rem; }
  .studio-overview .studio-course-heading { grid-template-columns: minmax(0,1fr) minmax(0,29%); }
  .studio-course-heading h1 { overflow-wrap: anywhere; }
  .studio-course-heading .studio-heading-stat { font-size: .74rem; }
}

/* The illustration and colour treatments live on the surrounding UI. */
body.study-shell {
  --study-bg: light-dark(#f7f3eb,#191722);
  --study-nav: light-dark(#faf6ef,#1d1a29);
  --study-paper: light-dark(#fffcf7,#242131);
  --study-raised: light-dark(#fffdf8,#2b273b);
  --study-wash: light-dark(#f2ece2,#2b2839);
  --study-hover: light-dark(#ece6dc,#353044);
  --study-text: light-dark(#25212c,#f8f1f5);
  --study-muted: light-dark(#554d5b,#c8bdce);
  --study-faint: light-dark(#5e5665,#bbb0c2);
  --study-line: light-dark(#ded4c9,#494253);
  --study-control: light-dark(#7d7480,#9b8fa5);
  --folio-plum: light-dark(#f2e6f4,#37283f);
  --folio-plum-ink: light-dark(#6a4177,#e0b9eb);
  --folio-amber: light-dark(#f7e9cf,#3a2d28);
  --folio-amber-ink: light-dark(#754318,#ffc68e);
  --folio-slate: light-dark(#e5edee,#27363c);
  --folio-slate-ink: light-dark(#2e5c66,#a3d8df);
}
body.study-shell.biology {
  --folio-jacket: url("figures/studio-bb1160.jpg");
  --folio-workbench: url("figures/studio-bb1160-tools.jpg");
  --folio-book: light-dark(#fae6db,#3b2737);
  --folio-book-ink: light-dark(#8c4235,#ffb49d);
  --folio-lab: light-dark(#e7eed5,#2b382d);
  --folio-lab-ink: light-dark(#3e5a2d,#b4e394);
}
body.study-shell.mathematics {
  --folio-jacket: url("figures/studio-sf1625.jpg");
  --folio-workbench: url("figures/studio-sf1625-tools.jpg");
  --folio-book: light-dark(#eae8ff,#302953);
  --folio-book-ink: light-dark(#5145a3,#cbc1fb);
  --folio-lab: light-dark(#f9e4db,#3c2937);
  --folio-lab-ink: light-dark(#934734,#ffb9a0);
}

/* A continuous backdrop with a quiet centre behind the study surfaces. */
body.study-shell {
  --folio-backdrop-west: light-dark(#edd9df,#382741);
  --folio-backdrop-east: light-dark(#e2def4,#25294b);
  --folio-backdrop-art: var(--folio-jacket);
  --folio-backdrop-opacity: .21;
  isolation: isolate;
}
body.study-shell.studio-start {
  --folio-backdrop-art: url("figures/studio-sf1625.jpg");
}
body.study-shell.biology {
  --folio-backdrop-west: light-dark(#dbe8df,#203831);
  --folio-backdrop-east: light-dark(#f0d8cc,#41283d);
}
body.study-shell.mathematics {
  --folio-backdrop-west: light-dark(#e2daf3,#342850);
  --folio-backdrop-east: light-dark(#d7e5f2,#20374e);
}
body.study-shell:is(.reading-focus,.math-reading,.exam-writing),
body.study-shell:has(.archive-task) {
  --folio-backdrop-opacity: .12;
}
body.study-shell::before,
body.study-shell::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}
body.study-shell::before {
  background:
    radial-gradient(ellipse at 0% 100%, var(--folio-backdrop-west), transparent 67%),
    radial-gradient(ellipse at 100% 7%, var(--folio-backdrop-east), transparent 66%),
    var(--canvas);
}
body.study-shell::after {
  background: var(--folio-backdrop-art) center 52% / cover no-repeat;
  mask-image: radial-gradient(ellipse at 50% 37%, transparent 27%, #0003 53%, #000c 90%, #000 112%);
  opacity: var(--folio-backdrop-opacity);
}
@media (max-width: 700px) {
  body.study-shell::after {
    background-position: 58% center;
    opacity: min(.15,var(--folio-backdrop-opacity));
  }
}
@media (forced-colors: active) {
  body.study-shell::before,
  body.study-shell::after { display: none; }
}

.study-shell :is(.sidebar,.math-sidebar) {
  scrollbar-color: var(--study-control) transparent;
}
.study-shell :is(.sidebar,.math-sidebar) :is(.nav-heading,.study-nav-heading) { color: var(--folio-book-ink); }
.study-shell :is(.sidebar,.math-sidebar) a[aria-current=page],
.study-shell .sidebar .nav-group button[aria-current=page] {
  border-radius: 5px;
  background-color: var(--folio-book);
  color: var(--folio-book-ink);
  box-shadow: inset 3px 0 var(--folio-book-ink);
}

.study-shell :is(#screen > .page-heading:first-child,#studieyta > .math-heading:first-child) {
  --folio-heading-bg: var(--folio-plum);
  --folio-heading-rule: var(--folio-plum-ink);
  --folio-heading-image: var(--folio-workbench);
  min-width: 0;
  padding: clamp(14px,2.25vw,26px);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--folio-heading-rule);
  border-radius: 5px;
  background-color: var(--folio-heading-bg);
}
.study-shell :is(#screen,#studieyta):has(:is(#generator-form,.exam-generator,.exam-plan,.archive-scope-panel,.history-heat)) >
  :is(.page-heading,.math-heading):first-child {
  --folio-heading-bg: var(--folio-amber);
  --folio-heading-rule: var(--folio-amber-ink);
}
.study-shell :is(#screen,#studieyta):has(:is(.book-index,.reader-library,.book-home,.module-preview)) >
  :is(.page-heading,.math-heading):first-child {
  --folio-heading-bg: var(--folio-book);
  --folio-heading-rule: var(--folio-book-ink);
  --folio-heading-image: var(--folio-jacket);
}
.study-shell :is(#screen,#studieyta):has(:is(#knowledge-map,#math-graph,.mechanism-toolgrid,.mechanism-board)) >
  :is(.page-heading,.math-heading):first-child {
  --folio-heading-bg: var(--folio-lab);
  --folio-heading-rule: var(--folio-lab-ink);
}
.study-shell :is(#screen,#studieyta):has(:is(#coach-today,.math-progress,.score-panel)) >
  :is(.page-heading,.math-heading):first-child {
  --folio-heading-bg: var(--folio-slate);
  --folio-heading-rule: var(--folio-slate-ink);
}
.study-shell :is(#screen,#studieyta):has(:is(.archive-task,.quiz-question,.session-layout,.mechanism-image)) >
  :is(.page-heading,.math-heading):first-child {
  --folio-heading-image: none;
  padding-block: 12px;
}
@media (min-width: 360px) and (max-width: 839px) {
  .study-shell:not(.exam-writing) :is(#screen,#studieyta):has(:is(#knowledge-map,#math-graph,#generator-form,.exam-generator,.archive-scope-panel)) >
    :is(.page-heading,.math-heading):first-child:not(:has(a,button,select,input,.timer)) {
    padding-inline-end: 72px;
    background-image: var(--folio-heading-image);
    background-repeat: no-repeat;
    background-position: right 11px top 13px;
    background-size: 48px 48px;
  }
}
@media (min-width: 840px) {
  .study-shell:not(.exam-writing) :is(#screen > .page-heading:first-child,#studieyta > .math-heading:first-child):not(:has(a,button,select,input,.timer)) {
    padding-inline-end: min(24%,260px);
    background-image: var(--folio-heading-image);
    background-repeat: no-repeat;
    background-position: right center;
    background-size: clamp(125px,21%,235px) auto;
  }
  .study-shell :is(#screen,#studieyta):has(:is(.archive-task,.quiz-question,.session-layout,.mechanism-image)) >
    :is(.page-heading,.math-heading):first-child {
    padding-inline-end: clamp(14px,2.25vw,26px);
  }
}
.study-shell :is(.page-heading,.math-heading) h1 {
  font-size: clamp(1.6rem,3vw,2.6rem);
  line-height: 1.12;
}

/* Reading controls and chapter rails. Figures and the reading measure are unaffected. */
.study-shell .book-toolbar {
  border-color: var(--line);
  border-inline-start: 3px solid var(--folio-book-ink);
  background-color: var(--folio-book);
  padding-inline: 10px;
}
.study-shell :is(.book-outline,.book-related,.reader-contents,.reader-on-page) {
  border-color: var(--line);
  background-color: var(--study-nav);
}
.study-shell :is(.book-outline,.reader-contents,.reader-on-page) [aria-current] {
  background-color: var(--folio-book);
  color: var(--folio-book-ink);
}
.study-shell .book-paper {
  border-block-start: 5px solid var(--folio-book-ink);
}
.study-shell .reader-content > .math-heading {
  border-block-end: 2px solid var(--folio-book-ink);
  padding-block-end: 10px;
}
.study-shell .reader-content > .math-heading h1 { font-size: clamp(1.65rem,3.05vw,2.75rem); }
.study-shell .reader-followup {
  border-block-start-color: var(--folio-book-ink);
}
.study-shell :is(.reader-mathlab,.book-inline-practice) {
  border-inline-start: 3px solid var(--folio-lab-ink);
}

/* Work surfaces, notes and assessments have separate visual cues. */
.study-shell :is(#generator-form,.exam-generator,.archive-scope-panel,.exam-plan) {
  border-block-start: 3px solid var(--folio-amber-ink);
}
.study-shell :is(.exam-plan,.archive-scope-panel,.exam-generator .exam-estimate) {
  background-color: var(--folio-amber);
}
.study-shell :is(.question,.quiz-question,.archive-task,.bank-task) {
  border-block-start-color: var(--folio-book-ink);
}
.study-shell :is(.question-nav,.exam-navigation,.quiz-jumps) {
  border-block-end: 1px solid var(--line);
}
.study-shell :is(.result-panel,.course-result,.archive-result-panel,.score-panel) {
  border-block-start: 3px solid var(--folio-slate-ink);
}
.study-shell :is(.archive-result-metrics,.archive-numbers) > * {
  background-color: var(--folio-slate);
}
.study-shell :is(.archive-stat,.history-heat,.math-progress,.coach-grid > .panel) {
  border-block-start-color: var(--folio-slate-ink);
}
.study-shell :is(.map-toolbar,.mechanism-panel,#math-graph) { border-color: var(--line); }
.study-shell :is(.map-toolbar,.math-reader .reader-mathlab,.mechanism-panel:has(.mechanism-toolgrid)) {
  border-block-start: 3px solid var(--folio-lab-ink);
}
.study-shell .graph-workspace { background-color: var(--folio-lab); border-radius: 5px; }
.study-shell .graph-workspace canvas { background-color: var(--paper); }
.study-shell .mode-grid .mode-icon { background-color: var(--folio-lab); color: var(--folio-lab-ink); }
.study-shell .mode-grid .mode-card:nth-child(3n+2) .mode-icon { background-color: var(--folio-book); color: var(--folio-book-ink); }
.study-shell .mode-grid .mode-card:nth-child(3n+3) .mode-icon { background-color: var(--folio-amber); color: var(--folio-amber-ink); }
.study-shell :is(dialog,.study-search-dialog) {
  border-block-start: 3px solid var(--folio-book-ink, var(--accent));
  background-color: var(--paper);
}
.study-shell #figure-dialog { border-block-start-color: var(--line); }

.course-overview {
  --overview-link: var(--studio-pigment, var(--accent, #325c92));
  --overview-border: var(--studio-trim, var(--studio-line));
  --overview-tint: color-mix(in srgb,var(--studio-tint,var(--studio-surface)) 65%,var(--studio-surface));
  max-width: 1030px;
}
.course-overview .studio-course-heading {
  margin-bottom: clamp(14px,2.1vw,22px);
  min-height: clamp(82px,10vw,128px);
}
.course-overview .studio-course-title { padding: clamp(12px,2.1vw,24px); }
.course-overview .studio-course-heading h1 { font-size: clamp(1.48rem,3.8vw,2.5rem); }
.course-overview.course-overview-plain .studio-course-heading { grid-template-columns: minmax(0,1fr); min-height: 0; }
.course-overview .course-overview-next {
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 12px clamp(14px,2.4vw,25px);
  padding: clamp(16px,2.4vw,26px);
  border: 1px solid var(--overview-border);
  border-inline-start-width: 4px;
  border-radius: 10px;
  background: var(--overview-tint);
}
.course-overview .studio-activity .course-overview-kicker {
  color: var(--overview-link);
  font-size: .875rem;
  font-weight: 700;
  margin: 0 0 5px;
}
.course-overview .studio-activity h2 { font-size: clamp(1.3rem,2.75vw,1.9rem); }
.course-overview .studio-activity-copy > p:last-child { max-width: 58ch; }
.course-overview-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.course-overview-next .course-overview-actions { justify-content: flex-end; max-width: 320px; }
.course-overview-actions :is(a,button) {
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.course-overview-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,170px),1fr));
  gap: clamp(8px,1.4vw,14px);
  margin: clamp(12px,2vw,20px) 0 clamp(22px,3vw,34px);
}
.course-overview-shortcuts > a {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px;
  min-height: 54px;
  border: 1px solid var(--studio-line);
  border-radius: 9px;
  background: var(--studio-surface);
  color: var(--studio-ink);
  text-decoration: none;
}
.course-overview-shortcuts > a strong { font-weight: 690; text-decoration: underline; text-underline-offset: .21em; }
.course-overview-shortcuts > a span { color: var(--studio-muted); font-size: .875rem; line-height: 1.4; }
.course-overview-shortcuts > a:hover { border-color: var(--overview-link); background: var(--overview-tint); }
.course-overview-shortcuts > a:focus-visible, .course-overview-panel > summary:focus-visible {
  outline: 2px solid var(--overview-link);
  outline-offset: 3px;
}

.course-overview-more { margin-top: 20px; }
.course-overview-more > h2 { font-size: 1.16rem; margin: 0 0 10px; }
.course-overview .course-overview-panel {
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--studio-line);
  background: transparent;
  border-radius: 0;
}
.course-overview-panel:nth-child(2) { border-top: 1px solid var(--studio-line); }
.course-overview-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px 10px 2px;
  cursor: pointer;
  color: var(--studio-ink);
  list-style: none;
}
.course-overview-panel[open] > summary { margin: 0; }
.course-overview-panel > summary::-webkit-details-marker { display: none; }
.course-overview-panel > summary::after {
  content: '';
  width: 7px;
  height: 7px;
  flex: none;
  border: solid var(--overview-link);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.course-overview-panel[open] > summary::after { transform: rotate(225deg); }
.course-overview-panel > summary:hover .course-overview-summary strong { color: var(--overview-link); text-decoration: underline; }
.course-overview-summary { display: grid; gap: 2px; min-width: 0; }
.course-overview-summary strong { font-size: .98rem; }
.course-overview-summary span { color: var(--studio-muted); font-size: .875rem; font-weight: 400; }
.course-overview-panel-body { min-width: 0; padding: 2px 0 16px; }
.course-overview-panel-body > :is(.journey-teaser,.mode-grid):not(:first-child) { margin-top: 14px; }
.course-overview-panel-body .studio-section-top h3,
.course-overview-panel-body .studio-next-step h3 { margin: 0 0 4px; font-size: 1rem; }
.course-overview-follow-up { display: grid; gap: 12px; justify-items: start; }
.course-overview-follow-up > p { margin: 0; }
.course-overview #daily-card { scroll-margin-top: calc(var(--study-header,72px) + 10px); }

@media (max-width: 730px) {
  .course-overview .course-overview-next { grid-template-columns: minmax(0,1fr); }
  .course-overview-next .course-overview-actions { justify-content: flex-start; max-width: none; }
}
@media (max-width: 520px) {
  .course-overview-shortcuts { grid-template-columns: minmax(0,1fr); }
  .course-overview-shortcuts > a {
    grid-template-columns: minmax(5.5rem,.75fr) minmax(0,1.5fr);
    align-items: center;
    gap: 7px 10px;
    padding: 8px 11px;
  }
}
.study-area-overview {
  margin-block: 12px 24px;
  padding: 4px 16px;
  border: 1px solid var(--studio-line);
  border-radius: 12px;
  background: var(--studio-surface);
}
.study-area-overview summary {
  padding-block: 12px;
  min-height: 44px;
  font-weight: 650;
  cursor: pointer;
}
.study-area-overview ul { list-style: none; padding: 0; margin: 8px 0 12px; }
.study-area-overview li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  border-bottom: 1px solid var(--studio-line);
}
.study-area-overview li a { padding-block: 10px; min-height: 44px; }
.study-area-overview li span { color: var(--studio-muted); font-size: .9rem; }

.visual-workspace {
  --visual-line: light-dark(#d8cde0,#544663);
  --visual-panel: light-dark(#fffaf6,#242130);
  --visual-soft: light-dark(#f2e7fb,#382d49);
  --visual-ink: light-dark(#2b1d3d,#f9f0fd);
  --visual-muted: light-dark(#5c4d65,#d1c5db);
  --visual-link: light-dark(#552778,#ead2ff);
  color: var(--visual-ink);
  max-width: 1270px;
  margin: 0 auto;
}
.visual-header {
  display: grid;
  gap: 12px;
  padding: clamp(14px,2.1vw,25px);
  border: 1px solid var(--visual-line);
  border-radius: 12px;
  background: linear-gradient(120deg,var(--visual-soft),var(--visual-panel) 74%);
}
.visual-header, .visual-scene-heading, [data-visual-title] { scroll-margin-top: calc(var(--study-header,70px) + 10px); }
.visual-kicker {
  margin: 0 0 5px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--visual-link);
}
.visual-header h1 {
  margin: 0;
  font-size: clamp(1.7rem,3.8vw,3rem);
  letter-spacing: -.05em;
  line-height: 1.08;
}
.visual-header h1 + p {
  max-width: 66ch;
  margin: 8px 0 0;
  color: var(--visual-muted);
  font-size: .94rem;
}
.visual-starts, .visual-actions, .visual-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.visual-starts { margin-block: 12px; }
.visual-workspace .visual-link, .visual-mode button, .visual-player button {
  min-height: 42px;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
.visual-workspace .visual-link[aria-current=step],
.visual-mode button[aria-pressed=true]:not(:disabled) {
  border-color: var(--visual-link);
  text-decoration: underline;
  text-underline-offset: .23em;
}
.visual-slide {
  display: grid;
  grid-template-columns: minmax(0,1.52fr) minmax(0,1fr);
  align-items: stretch;
  gap: clamp(10px,1.8vw,20px);
  margin-block: 12px;
}
.visual-scene-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px 14px;
}
.visual-scene-heading h2 {
  margin: 0;
  color: var(--visual-ink);
  font-size: clamp(1.3rem,2.5vw,2.02rem);
  letter-spacing: -.038em;
  line-height: 1.13;
}
.visual-scene-count {
  flex: none;
  color: var(--visual-link);
  font-size: .83rem;
  padding: 3px 8px;
  border: 1px solid var(--visual-line);
  border-radius: 6px;
  background: var(--visual-soft);
  font-variant-numeric: tabular-nums;
}
.visual-frame, .visual-notes { min-width: 0; border-radius: 12px; overflow: hidden; align-self: start; }
.visual-frame {
  display: grid;
  align-self: start;
  border: 1px solid #55466d;
  background: #171425;
  color: #f8f2ff;
}
.visual-frame-head, .visual-player, .visual-frame-navigation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  padding: 8px 10px;
}
.visual-frame-head { justify-content: space-between; }
.visual-position, .visual-step-count {
  color: #e0d4f1;
  font-size: .83rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.study-shell .visual-frame :is(.visual-mode,.visual-player) button:not(.primary):not(.bare):not(.link-button) {
  --visual-control: #2e2847;
  color: #f8f2ff;
  background: var(--visual-control);
  border-color: #9c8db6;
}
.study-shell .visual-frame .visual-mode button[aria-pressed=true]:not(:disabled):not(.primary):not(.bare):not(.link-button) {
  color: #f8f2ff;
  border-color: #e3c9fa;
  background: #51416c;
}
.visual-frame :is(button,input):focus-visible {
  outline: 2px solid #f3c6ff;
  outline-offset: 3px;
}
.visual-image { margin: 0; min-width: 0; }
.visual-image img, .visual-image canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  background: #1d1730;
}
.visual-image [hidden] { display: none; }
.visual-image figcaption {
  min-height: 3.65rem;
  border-top: 1px solid #55466d;
  padding: 9px 13px;
  color: #f8f2ff;
  font-size: .91rem;
  line-height: 1.45;
}
.visual-player { border-top: 1px solid #55466d; }
.visual-frame-navigation { border-top: 1px solid #55466d; }
.study-shell .visual-frame .visual-frame-navigation :is(a,button):not(.primary):not(.bare):not(.link-button) {
  color: #f8f2ff;
  background: #2e2847;
  border-color: #9c8db6;
}
.visual-seek { flex: 1 1 90px; min-width: 70px; }
.visual-seek input {
  display: block;
  width: 100%;
  height: 24px;
  accent-color: #bfb0fb;
}
.visual-notes {
  padding: clamp(13px,2vw,22px);
  background: var(--visual-panel);
  border: 1px solid var(--visual-line);
}
.visual-summary { color: var(--visual-muted); margin: 0 0 14px; max-width: 62ch; }
.visual-choices {
  display: grid;
  gap: 6px;
  padding-block: 11px;
  border-block: 1px solid var(--visual-line);
  margin-bottom: 12px;
}
.visual-choices h3 { font-size: .97rem; margin: 0 0 3px; }
.visual-transcript { margin-block: 10px 12px; }
.visual-transcript > summary, .visual-jump { font-weight: 650; color: var(--visual-link); }
.visual-transcript > summary { cursor: pointer; min-height: 35px; padding-block: 6px; }
.visual-transcript ol { margin: 4px 0; padding-inline-start: 1.65rem; }
.visual-transcript li + li { margin-top: 4px; }
.visual-notes .visual-beat {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 5px 8px;
  text-align: start;
  color: var(--visual-link);
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
}
.visual-beat:hover, .visual-notes .visual-beat[aria-current=step] {
  background: var(--visual-soft);
  border-color: var(--visual-line);
}
.visual-beat[aria-current=step] { box-shadow: inset 3px 0 var(--visual-link); }
.visual-source {
  margin: 10px 0 0;
  overflow-wrap: anywhere;
  font-size: .84rem;
}
.visual-source a, .visual-map a { color: var(--visual-link); text-decoration: underline; }
.visual-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: end;
  gap: 8px 14px;
  padding-block: 8px 12px;
}
.visual-jump {
  display: grid;
  gap: 3px;
  min-width: 0;
  width: min(100%,19rem);
  font-size: .875rem;
}
.visual-jump select { min-width: 0; min-height: 42px; max-width: 100%; }
.visual-footnote, .visual-map { color: var(--visual-muted); font-size: .85rem; margin: 6px 0; }
.visual-book-link { margin: 0 0 10px; }
.visual-path {
  border-block: 1px solid var(--visual-line);
  margin: 12px 0 20px;
  padding: 8px 0;
  color: var(--visual-link);
}
.visual-path summary { cursor: pointer; min-height: 36px; padding: 6px 0; font-weight: 720; }
.visual-path ol, .visual-stage-list ol {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,13rem),1fr));
  gap: 8px;
  margin: 4px 0 8px;
  padding: 0;
  list-style: none;
}
.visual-path ol { counter-reset: visual-path; }
.visual-path li { counter-increment: visual-path; }
.visual-path a {
  display: flex;
  gap: 8px;
  height: 100%;
  align-items: baseline;
  border: 1px solid var(--visual-line);
  border-radius: 6px;
  background: var(--visual-panel);
  padding: 8px;
  color: var(--visual-link);
  font-size: .88rem;
}
.visual-path a::before { content: counter(visual-path,decimal-leading-zero); font-variant-numeric: tabular-nums; }
.visual-path a[aria-current="step"] { box-shadow: inset 3px 0 var(--visual-link); background: var(--visual-soft); }
.visual-path-cell {
  display: grid;
  grid-template-columns: minmax(0,1.5fr) minmax(0,1fr);
  align-items: center;
  gap: 12px;
  margin: 4px 0 12px;
  border: 1px solid var(--visual-line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--visual-panel);
}
.visual-path-cell canvas { display: block; width: 100%; height: auto; }
.visual-path-cell figcaption { padding: 8px 14px; color: var(--visual-muted); font-size: .9rem; }
.visual-slide-lecture { grid-template-columns: minmax(0,2.1fr) minmax(14rem,1fr); align-items: start; }
.visual-slide-lecture .visual-scene-heading { margin-bottom: 4px; }
.visual-slide-lecture .visual-image figcaption { min-height: 6.1rem; padding: 13px 15px; }
.visual-step-controls { display: flex; gap: 5px; }
.visual-step-controls button { min-width: 42px; }
.visual-step-controls [aria-disabled="true"] { opacity: .73; }
.visual-key { border-top: 1px solid var(--visual-line); padding-top: 12px; margin-bottom: 12px; }
.visual-key h3 { margin: 0 0 8px; line-height: 1.24; }
.visual-key ul, .visual-stage-text ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 5px;
}
.visual-key li, .visual-stage-text li {
  padding: 3px 6px;
  border: 1px solid var(--visual-line);
  border-radius: 5px;
  background: var(--visual-soft);
  color: var(--visual-link);
  font-size: .8rem;
  font-weight: 680;
  overflow-wrap: anywhere;
}
.visual-stage-list { grid-column: 1 / -1; margin-block: 3px 8px; }
.visual-concepts { grid-column: 1 / -1; background: var(--visual-panel); border: 1px solid var(--visual-line); border-radius: 9px; }
.visual-concepts summary { color: var(--visual-link); padding: 11px 14px; cursor: pointer; font-weight: 720; }
.visual-concepts dl { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,19rem),1fr)); gap: 12px 20px; margin: 0; padding: 5px 15px 15px; }
.visual-concepts dt { font-weight: 720; }
.visual-concepts dd { margin: 3px 0 0; color: var(--visual-muted); font-size: .9rem; }
.visual-stage-list h3 { margin: 0 0 9px; font-size: 1.1rem; }
.visual-stage-list > ol { grid-template-columns: repeat(auto-fit,minmax(min(100%,15.5rem),1fr)); gap: 10px; }
.visual-stage-list > ol > li { background: var(--visual-panel); border: 1px solid var(--visual-line); border-radius: 9px; min-width: 0; }
.visual-stage-list .visual-beat {
  display: flex;
  width: 100%;
  min-height: 49px;
  gap: 8px;
  align-items: baseline;
  background: transparent;
  color: var(--visual-link);
  border: 0;
  border-bottom: 1px solid var(--visual-line);
  border-radius: 8px 8px 0 0;
  text-align: start;
  font-weight: 740;
  padding: 9px;
  line-height: 1.25;
}
.visual-stage-list .visual-beat:hover, .visual-stage-list .visual-beat[aria-current="step"] { background: var(--visual-soft); }
.visual-stage-list .visual-beat span { border: 1px solid var(--visual-line); padding: 3px 6px; border-radius: 4px; font-size: .8em; }
.visual-stage-text { padding: 10px; font-size: .88rem; color: var(--visual-muted); }
.visual-stage-thumbnail { display: block; width: 100%; aspect-ratio: 8 / 5; height: auto; background: #171425; }
.visual-stage-text p { margin: 0 0 8px; line-height: 1.5; }
.visual-zoom {
  width: min(96vw,68rem);
  max-width: 100%;
  max-height: 90dvh;
  padding: 12px;
  border: 1px solid var(--visual-line);
  border-radius: 12px;
  background: var(--visual-panel);
  color: var(--visual-ink);
}
.visual-zoom::backdrop { background: #0e0a1bcc; }
.visual-zoom header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.visual-zoom h3 { margin: 0; font-size: 1rem; }
.visual-zoom-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.visual-zoom canvas { display: block; width: 100%; min-width: 620px; height: auto; }
.visual-zoom p { margin: 10px 0 0; }
.visual-workspace :is(.visual-path,.visual-stage-list,.visual-zoom,.visual-concepts) :focus-visible { outline: 2px solid var(--visual-link); outline-offset: 2px; }
.visual-workspace [hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .visual-slide { animation: visual-slide-in 190ms ease-out both; }
  @keyframes visual-slide-in {
    from { opacity: .48; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
  }
}
@media (max-width: 850px) {
  .visual-slide { grid-template-columns: minmax(0,1fr); }
  .visual-path-cell { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 480px) {
  .visual-path ol { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .visual-step-controls { margin-inline-start: auto; }
  .visual-frame-head { align-items: flex-start; }
  .visual-slide-lecture .visual-image figcaption { min-height: 8.8rem; }
}

.repetition {
  --rep-ink: light-dark(#192637,#f2f5fc);
  --rep-muted: light-dark(#475770,#bac8d9);
  --rep-surface: light-dark(#fffdfa,#182136);
  --rep-line: light-dark(#c5d0dc,#465877);
  --rep-accent: light-dark(#17695e,#82d9c9);
  --rep-wash: light-dark(#e2f4ed,#233f42);
  max-width: 70rem;
  margin-inline: auto;
  color: var(--rep-ink);
}
[data-course="SF1625"] .repetition { --rep-accent: light-dark(#2a57a8,#a7bfff); --rep-wash: light-dark(#e5edfc,#29406a); }
.repetition-header {
  border: 1px solid var(--rep-line);
  border-radius: 14px;
  background: linear-gradient(126deg,var(--rep-wash),var(--rep-surface) 73%);
  padding: clamp(16px,3vw,34px);
  margin-bottom: 14px;
}
.repetition-header h1 { margin: 0; font-size: clamp(1.7rem,4vw,2.9rem); line-height: 1.13; }
.repetition-header h1 + p { max-width: 62ch; margin: 8px 0 0; }
.repetition-eyebrow { margin: 0 0 6px; color: var(--rep-accent); font-size: .88rem; font-weight: 720; }
.repetition-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 24px;
  padding: 14px;
  background: var(--rep-surface);
  border: 1px solid var(--rep-line);
  border-radius: 12px;
}
.repetition-settings > label { display: grid; gap: 4px; max-width: 100%; font-weight: 700; }
.repetition-settings select { min-width: 0; max-width: 100%; min-height: 44px; }
.repetition-settings :is(fieldset,legend) { padding: 0; border: 0; }
.repetition-settings fieldset { display: flex; flex-wrap: wrap; gap: 4px 14px; min-inline-size: 0; }
.repetition-settings legend { font-weight: 700; }
.repetition-settings fieldset label { display: flex; align-items: center; gap: 5px; min-height: 42px; }
.repetition-settings input { accent-color: var(--rep-accent); }
.repetition-rule,.repetition-storage { color: var(--rep-muted); margin: 12px 0; }
.repetition-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,14rem),1fr));
  gap: 12px;
}
.repetition-mode {
  --rep-card: light-dark(#def5ef,#254843);
  --rep-card-ink: light-dark(#10584e,#9be8d6);
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--rep-line);
  border-radius: 12px;
  background: linear-gradient(142deg,var(--rep-card),var(--rep-surface) 58%);
}
.repetition-mode:nth-child(2) { --rep-card: light-dark(#e3ecff,#283e68); --rep-card-ink: light-dark(#2b4d97,#b4c7fc); }
.repetition-mode:nth-child(3) { --rep-card: light-dark(#ffe9d0,#563e32); --rep-card-ink: light-dark(#804725,#ffd19f); }
.repetition-mode:nth-child(4) { --rep-card: light-dark(#f2e6fb,#493759); --rep-card-ink: light-dark(#6f3a90,#e6c1fc); }
.repetition-mode-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid currentColor;
  border-radius: 10px;
  color: var(--rep-card-ink);
  font-size: 1.45rem;
  line-height: 1;
}
.repetition-mode h2 { margin: 11px 0 4px; font-size: 1.14rem; }
.repetition-mode p { margin: 0 0 9px; color: var(--rep-muted); }
.repetition-mode p.repetition-best { color: var(--rep-card-ink); font-weight: 700; margin-top: auto; }
.repetition-mode .repetition-mode-meta { font-size: .88rem; }
.repetition .button { min-height: 44px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.repetition .repetition-mode .button { justify-content: center; text-align: center; margin-top: 5px; }
.repetition :is(button,input,select,a,summary):focus-visible {
  outline: 2px solid var(--rep-accent);
  outline-offset: 3px;
}
.repetition [tabindex="-1"] { scroll-margin-block-start: 5.5rem; }
.repetition-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  background: var(--rep-wash);
  padding: 10px 14px;
  border: 1px solid var(--rep-line);
  border-radius: 10px;
  margin-bottom: 13px;
  font-variant-numeric: tabular-nums;
}
.repetition-meter { display: grid; justify-items: end; gap: 2px; margin-inline-start: auto; }
.repetition-meter progress { display: block; width: min(9rem,100%); height: .6rem; accent-color: var(--rep-accent); }
.repetition-arena,.repetition-result,.repetition-log {
  border: 1px solid var(--rep-line);
  border-radius: 12px;
  background: var(--rep-surface);
  padding: clamp(13px,3vw,24px);
  margin-bottom: 12px;
}
.repetition-arena :is(h2,h3) { margin: 0 0 10px; max-width: 56ch; line-height: 1.32; }
.repetition-context { display: block; margin-top: 6px; color: var(--rep-muted); font-weight: 550; font-size: .9em; }
.repetition math { display: inline-block; max-width: 100%; vertical-align: middle; overflow-x: auto; overflow-y: hidden; }
.repetition-options .button:has(math) { display: block; overflow-wrap: anywhere; }
.repetition-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.repetition .repetition-options .button {
  justify-content: flex-start;
  text-align: start;
  min-height: 53px;
  line-height: 1.36;
}
.repetition-order { border-top: 1px solid var(--rep-line); padding-top: 10px; }
.repetition-order ol { margin: 4px 0 12px; }
.repetition-order-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 10px; }
.repetition-result dl { display: flex; flex-wrap: wrap; gap: 18px 36px; margin: 0; }
.repetition-result dd,.repetition-gain {
  margin: 0;
  color: var(--rep-accent);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.repetition-result dd { font-size: clamp(1.5rem,4vw,2.3rem); }
.repetition-review article + article,.repetition-log li + li { border-top: 1px solid var(--rep-line); margin-top: 12px; padding-top: 12px; }
.repetition-log summary { cursor: pointer; min-height: 32px; font-weight: 700; }
.repetition-storage { font-size: .9rem; }
@media (max-width: 550px) {
  .repetition-options { grid-template-columns: minmax(0,1fr); }
}

/* Room treatments belong to the shell. Course material uses the existing paper surfaces. */
body.study-shell {
  --room-base: light-dark(#edf2f5,#101721);
  --room-west: light-dark(#dfebed,#172e35);
  --room-east: light-dark(#e2e8f5,#252541);
  --room-thread: light-dark(#1a536421,#b4e8ff20);
  --room-edge: light-dark(#203b5528,#9bcbe43f);
  --room-ink: light-dark(#2b5364,#a6d7dc);
  --room-wash: light-dark(#e7f2f3,#24343e);
  --room-dark: #112239;
  --room-art: none;
  --room-banner-art: none;
  --room-atlas: none;
  --room-lab-art: none;
  --room-practice-art: var(--folio-workbench,none);
  --room-library-art: var(--folio-jacket,none);
  --room-pattern: linear-gradient(90deg, var(--room-thread) 1px, transparent 1px),
    linear-gradient(var(--room-thread) 1px, transparent 1px);
  --room-grid: 46px 46px, 46px 46px, cover;
  --room-art-position: center, center, center;
  --room-strength: .47;
  --room-mask: radial-gradient(ellipse at 42% 33%, transparent 13%, #0004 48%, #000c 73%, black 97%);
}

body.study-shell:where(.biology:not(.registered-course)) {
  --room-atlas: url("figures/studio-bio-atlas.jpg");
  --room-lab-art: url("figures/studio-bio-micro.jpg");
  --room-base: light-dark(#eef4f1,#0e181a);
  --room-west: light-dark(#d5eae0,#123331);
  --room-east: light-dark(#e1eeef,#1e3040);
  --room-ink: light-dark(#176458,#96e1cf);
  --room-wash: light-dark(#e2f1e9,#20372f);
  --room-thread: light-dark(#1764582e,#96e1cf2e);
  --room-dark: #071e20;
}
body.study-shell:where(.mathematics:not(.registered-course)) {
  --room-atlas: url("figures/studio-math-wave.jpg");
  --room-lab-art: var(--folio-workbench);
  --room-practice-art: url("figures/studio-math-contour.jpg");
  --room-base: light-dark(#eff2f8,#111525);
  --room-west: light-dark(#e4e6f8,#272547);
  --room-east: light-dark(#dcecf4,#162f45);
  --room-ink: light-dark(#344c92,#b1c7ff);
  --room-wash: light-dark(#e9edff,#29344e);
  --room-thread: light-dark(#37539433,#a1c7ff33);
  --room-dark: #111a36;
}

body.study-shell[data-studio-scene]::before {
  background:
    radial-gradient(ellipse at 2% 94%, var(--room-west), transparent 68%),
    radial-gradient(ellipse at 97% 8%, var(--room-east), transparent 63%),
    var(--room-base);
}
body.study-shell[data-studio-scene]::after {
  background-image: var(--room-pattern), var(--room-art);
  background-size: var(--room-grid);
  background-position: var(--room-art-position);
  background-repeat: repeat, repeat, no-repeat;
  mask-image: var(--room-mask);
  opacity: var(--room-strength);
}

body.study-shell[data-studio-scene="dashboard"] {
  --room-atlas: url("figures/studio-bio-atlas.jpg");
  --room-wave: url("figures/studio-math-wave.jpg");
  --room-pattern: linear-gradient(90deg, var(--room-thread) 1px, transparent 1px),
    repeating-linear-gradient(124deg, transparent 0 41px, var(--room-thread) 42px, transparent 44px 84px);
  --room-west: light-dark(#e4e5f6,#262443);
  --room-east: light-dark(#d5eaf0,#1d384b);
  --room-art-position: center, center, 70% 55%;
}
[data-studio-scene="overview"].study-shell {
  --room-art: var(--room-atlas);
  --room-banner-art: var(--room-atlas);
  --room-strength: .57;
}
[data-studio-scene="overview"].biology {
  --room-banner-art: var(--folio-jacket);
  --room-pattern: repeating-radial-gradient(ellipse at 7% 106%, transparent 0 23px, var(--room-thread) 24px, transparent 26px 37px),
    radial-gradient(circle, var(--room-thread) 1px, transparent 2px);
  --room-grid: 100% 100%, 22px 22px, cover;
}
[data-studio-scene="library"].study-shell {
  --room-art: var(--room-library-art);
  --room-banner-art: var(--room-library-art);
  --room-strength: .36;
}
[data-studio-scene="reading"].study-shell {
  --room-strength: .34;
  --room-pattern: repeating-linear-gradient(90deg, var(--room-thread) 0 1px, transparent 1px 5px),
    linear-gradient(0deg, var(--room-thread) 1px, transparent 1px);
  --room-grid: 31px 31px, 31px 31px, cover;
}
[data-studio-scene="reading"].biology {
  --room-art: var(--room-atlas);
  --room-art-position: center, center, 45% 70%;
}
[data-studio-scene="reading"].mathematics {
  --room-art: var(--room-library-art);
}
[data-studio-scene="journey"].study-shell {
  --room-art: var(--room-library-art);
  --room-banner-art: var(--room-library-art);
  --room-pattern: radial-gradient(circle, var(--room-thread) 1.4px, transparent 2.2px),
    linear-gradient(120deg, transparent 35%, var(--room-thread) 36%, transparent 38%);
  --room-grid: 23px 23px, 100% 100%, cover;
}
[data-studio-scene="practice"].study-shell {
  --room-art: var(--room-practice-art);
  --room-banner-art: var(--room-practice-art);
  --room-pattern: radial-gradient(circle, var(--room-thread) 1.4px, transparent 2px),
    repeating-linear-gradient(125deg, transparent 0 23px, var(--room-thread) 24px, transparent 25px 48px);
  --room-grid: 18px 18px, 100% 100%, cover;
  --room-strength: .48;
}
[data-studio-scene="practice"].mathematics:not(.registered-course) {
  --room-west: light-dark(#f3dbc9,#483042);
  --room-east: light-dark(#e4e5f7,#2e244e);
  --room-wash: light-dark(#f8eadd,#3c3047);
  --room-ink: light-dark(#783d34,#ffd0b6);
  --room-dark: #291a32;
}
[data-studio-scene="lab"].study-shell {
  --room-art: var(--room-lab-art);
  --room-banner-art: var(--room-lab-art);
  --room-pattern: repeating-linear-gradient(0deg, transparent 0 29px, var(--room-thread) 30px, transparent 31px 60px),
    repeating-linear-gradient(90deg, transparent 0 29px, var(--room-thread) 30px, transparent 31px 60px);
  --room-strength: .56;
}
[data-studio-scene="lab"].biology {
  --room-dark: #16122c;
  --room-west: light-dark(#e7e1fb,#33234e);
  --room-east: light-dark(#f3deed,#482641);
  --room-ink: light-dark(#5c3986,#e1b9ff);
  --room-wash: light-dark(#f2e7fa,#352a49);
}
[data-studio-scene="exams"].study-shell {
  --room-west: light-dark(#f1e4ce,#302d3a);
  --room-east: light-dark(#e0e9ee,#222d38);
  --room-ink: light-dark(#784519,#efca97);
  --room-wash: light-dark(#f5ebd8,#3c302b);
  --room-dark: #252432;
  --room-pattern: repeating-linear-gradient(135deg, transparent 0 17px, var(--room-thread) 18px, transparent 19px 36px),
    linear-gradient(0deg, var(--room-thread) 1px, transparent 1px);
  --room-grid: 100% 100%, 37px 37px, cover;
}
[data-studio-scene="results"].study-shell {
  --room-west: light-dark(#dbe8f0,#202e46);
  --room-east: light-dark(#dbefed,#1c3c39);
  --room-ink: light-dark(#2d566e,#a5daea);
  --room-wash: light-dark(#e5f0f3,#253d4a);
  --room-pattern: repeating-radial-gradient(ellipse at 92% 87%, transparent 0 17px, var(--room-thread) 18px, transparent 19px 28px),
    linear-gradient(90deg, var(--room-thread) 1px, transparent 1px);
  --room-grid: 100% 100%, 27px 27px, cover;
}
[data-studio-scene="assessment"].study-shell,
body.study-shell.reading-focus {
  --room-art: none;
  --room-strength: .18;
}

/* Primary titles get a dark art surface with a protected reading zone. */
.study-shell[data-studio-scene] :is(.dashboard-title,.visual-header,.repetition-header),
.study-shell[data-studio-scene="overview"] .course-overview:not(.course-overview-plain) .studio-course-heading {
  --room-title-muted: #e0edf3;
  --room-banner-gradient: linear-gradient(90deg, var(--room-dark) 0%, color-mix(in srgb,var(--room-dark) 94%,transparent) 46%, color-mix(in srgb,var(--room-dark) 16%,transparent) 100%);
  isolation: isolate;
  position: relative;
  overflow: clip;
  border: 1px solid #6c919c82;
  border-radius: 17px;
  color: #f5fbff;
  background: var(--room-banner-gradient), var(--room-banner-art,none) 62% 56% / cover no-repeat, var(--room-dark);
  box-shadow: 0 15px 34px #0f173324;
}
.study-shell[data-studio-scene] :is(.dashboard-title,.visual-header,.repetition-header)::after,
.study-shell[data-studio-scene="overview"] .course-overview:not(.course-overview-plain) .studio-course-heading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .66;
  background:
    radial-gradient(circle, #d6f5ff72 1px, transparent 1.45px) right 28px top 18px / 17px 17px,
    linear-gradient(110deg, transparent 68%, #d0f9ff26 68.2%, transparent 68.4%, transparent 76%, #aaf2ff31 76.2%, transparent 76.4%);
  mask-image: linear-gradient(90deg,transparent 58%,black 100%);
}
.study-shell[data-studio-scene] :is(.dashboard-title,.visual-header,.repetition-header) h1,
.study-shell[data-studio-scene="overview"] .studio-course-heading h1 {
  color: inherit;
  letter-spacing: -.05em;
}
.study-shell[data-studio-scene] :is(.dashboard-title,.visual-header,.repetition-header) :is(p,.visual-kicker,.repetition-eyebrow) {
  color: var(--room-title-muted);
}
.study-shell[data-studio-scene] :is(.dashboard-title,.visual-header,.repetition-header) :focus-visible,
.study-shell[data-studio-scene="overview"] .studio-course-heading :focus-visible {
  outline-color: #9af4e9;
}
.course-picker.study-shell.studio-start .study-dashboard .dashboard-title {
  min-height: clamp(185px,21vw,265px);
  margin-bottom: clamp(14px,2.4vw,25px);
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  padding: clamp(18px,3.8vw,52px);
  background:
    linear-gradient(95deg,#112239 14%,#112239e6 42%,#11223940 82%),
    repeating-radial-gradient(ellipse at 92% 104%,transparent 0 17px,#8ce4e74d 18px,transparent 19px 34px),
    radial-gradient(ellipse at 110% 106%,#176a79 0%,transparent 68%),
    radial-gradient(ellipse at 79% -35%,#443c81 0%,transparent 72%),#112239;
}
.course-picker.study-shell.studio-start .study-dashboard.dashboard-has-resume .dashboard-title {
  min-height: 0;
  padding: clamp(14px,2.25vw,32px);
}
.dashboard-title > div { max-width: min(100%,36rem); }
.dashboard-title .dashboard-jumps { gap: 5px; margin-top: 6px; }
.dashboard-title .dashboard-jumps a {
  min-height: 44px;
  padding-inline: 12px;
  border: 1px solid #c6e8f75c;
  border-radius: 7px;
  color: #eaf8ff;
  background: #101e2ecc;
  text-decoration: none;
}
.dashboard-title .dashboard-jumps a:hover { background: #2a4960; text-decoration: underline; }
.course-picker.study-shell.studio-start .study-dashboard .studio-course.biology {
  --studio-art: var(--room-atlas);
  --studio-tint: light-dark(#e9f4ed,#23362e);
  --studio-pigment: light-dark(#1b6255,#a1ead0);
  --studio-trim: light-dark(#6f9d88,#548879);
}
.course-picker.study-shell.studio-start .study-dashboard .studio-course.mathematics {
  --studio-art: var(--room-wave);
  --studio-tint: light-dark(#eef0fc,#272f4a);
  --studio-pigment: light-dark(#3e5395,#bfcdff);
  --studio-trim: light-dark(#8398c8,#637eb3);
}
.course-picker.study-shell.studio-start .study-dashboard :is(.biology,.mathematics).studio-course {
  grid-template-rows: clamp(100px,13vw,164px) 1fr;
  box-shadow: 0 9px 24px #17294b18;
}
.studio-start .study-dashboard :is(.biology,.mathematics) .studio-cover {
  background-position: 64% 57%;
  border-block-end: 1px solid var(--studio-trim);
}

.study-shell[data-studio-scene="overview"] .course-overview:not(.course-overview-plain) .studio-course-heading {
  grid-template-columns: minmax(0,1fr);
  min-height: clamp(146px,18vw,232px);
}
.study-shell[data-studio-scene="overview"] .course-overview .studio-course-heading .studio-course-title {
  padding: clamp(18px,4.2vw,52px);
  max-width: 77%;
}
.study-shell[data-studio-scene="overview"] .course-overview .studio-course-heading .studio-code {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 5px;
  color: #d3f0ef;
  background-color: #0f2539bb;
  border: 1px solid #8bc7c56e;
  border-radius: 5px;
  padding: 4px 8px;
}
.study-shell[data-studio-scene="overview"] .course-overview .studio-course-heading h1 {
  font-size: clamp(1.7rem,4.5vw,3.65rem);
  line-height: 1.06;
  margin-block-start: 9px;
}
.study-shell[data-studio-scene="overview"] .course-overview .studio-course-heading .studio-cover {
  display: none;
}
.study-shell[data-studio-scene="overview"] .course-overview-plain .studio-course-heading {
  color: var(--studio-ink);
}
.study-shell[data-studio-scene="overview"] .course-overview-plain .studio-course-heading .studio-code {
  color: var(--room-ink);
  background-color: var(--room-wash);
  border-color: var(--room-edge);
}
.study-shell[data-studio-scene="overview"] .course-overview-next {
  --overview-link: var(--room-ink);
  --overview-border: var(--room-edge);
  background: linear-gradient(115deg,var(--room-wash),var(--studio-surface) 82%);
  border-inline-start-color: var(--room-ink);
}
.study-shell .course-overview-shortcuts { gap: 10px; }
.study-shell .course-overview-shortcuts > a {
  --quick-mark: light-dark(#227767,#8cdbc9);
  --quick-surface: light-dark(#e7f2ed,#233d34);
  padding-inline-start: 14px;
  border-inline-start: 3px solid var(--quick-mark);
  background:
    linear-gradient(144deg,var(--quick-surface),var(--studio-surface) 70%);
  box-shadow: 0 3px 10px #0e233a0c;
}
.study-shell .course-overview-shortcuts > a:nth-child(2) { --quick-mark: light-dark(#7a50a0,#cbb6ed); --quick-surface: light-dark(#f0eafa,#3c3152); }
.study-shell .course-overview-shortcuts > a:nth-child(3) { --quick-mark: light-dark(#986034,#e2b580); --quick-surface: light-dark(#f7efe0,#402f2d); }
.study-shell .course-overview-shortcuts > a:hover { border-color: var(--quick-mark); background: var(--quick-surface); }
.study-shell .course-overview-more {
  padding: clamp(12px,2vw,20px);
  border: 1px solid var(--studio-line);
  border-radius: 13px;
  background: var(--studio-surface);
  box-shadow: 0 8px 26px #162b4c15;
}

.study-shell[data-studio-scene] :is(.visual-header,.repetition-header) {
  min-height: 124px;
  padding: clamp(16px,3vw,34px);
}
.study-shell .visual-header > div, .study-shell .repetition-header > p:not(.repetition-eyebrow) {
  max-width: min(100%,68ch);
}
.study-shell .visual-header h1 + p { max-width: 57ch; }
.study-shell .repetition-header h1 + p { max-width: 54ch; }
.study-shell[data-studio-scene] :is(.repetition-header,.visual-header) a {
  color: #eefaff;
  border-color: #a4cae5;
  background: #14283d;
}

.study-shell[data-studio-scene] :is(#screen,#studieyta) > :is(.page-heading,.math-heading):first-child {
  --folio-heading-bg: var(--room-wash);
  --folio-heading-rule: var(--room-ink);
  --folio-heading-image: var(--room-banner-art);
  border-start-end-radius: 14px;
  border-end-end-radius: 14px;
  box-shadow: 0 7px 21px #112c4a0f;
}
.study-shell[data-studio-scene] :is(.sidebar,.math-sidebar) :is(.nav-heading,.study-nav-heading) { color: var(--room-ink); }
.study-shell[data-studio-scene] :is(.sidebar .nav-group button,.math-sidebar a)[aria-current="page"] {
  color: var(--room-ink);
  background-color: var(--room-wash);
  box-shadow: inset 3px 0 var(--room-ink);
}
.study-shell[data-studio-scene="lab"] :is(#screen,#studieyta) > :is(.page-heading,.math-heading):first-child {
  --folio-heading-image: var(--room-lab-art);
}
.study-shell[data-studio-scene="assessment"] :is(#screen,#studieyta) > :is(.page-heading,.math-heading):first-child {
  --folio-heading-image: none;
  box-shadow: none;
}
.study-shell[data-studio-scene="reading"] :is(.book-toolbar,.reader-contents,.reader-on-page) {
  border-radius: 10px;
  border-color: var(--room-edge);
}
.study-shell[data-studio-scene="reading"] .book-toolbar {
  background: linear-gradient(110deg,var(--room-wash),var(--study-paper));
  border-inline-start-color: var(--room-ink);
}
.study-shell[data-studio-scene="reading"] .book-paper {
  border-block-start-color: var(--room-ink);
}
@media (min-width: 840px) {
  .study-shell:is([data-studio-scene="lab"],[data-studio-scene="library"],[data-studio-scene="practice"])
  :is(#screen,#studieyta) > :is(.page-heading,.math-heading):first-child:not(:has(a,button,select,input,.timer)) {
    background-image: linear-gradient(90deg,var(--room-wash),transparent 62%), var(--room-banner-art);
    background-position: right center;
    background-repeat: no-repeat;
    background-size: min(23%,275px) 100%, min(23%,275px) auto;
  }
}

@media (max-width: 700px) {
  body.study-shell[data-studio-scene]::after {
    --room-mask: radial-gradient(ellipse at 28% 22%, transparent 7%, #0005 46%, black 96%);
    opacity: min(.36,var(--room-strength));
  }
  .study-shell[data-studio-scene] :is(.dashboard-title,.visual-header,.repetition-header),
  .study-shell[data-studio-scene="overview"] .course-overview .studio-course-heading {
    --room-banner-gradient: linear-gradient(100deg,var(--room-dark),color-mix(in srgb,var(--room-dark) 88%,transparent) 48%,color-mix(in srgb,var(--room-dark) 45%,transparent));
    border-radius: 12px;
  }
  .study-shell[data-studio-scene="overview"] .course-overview .studio-course-heading .studio-course-title {
    max-width: 93%;
  }
}
@media (forced-colors: active) {
  .study-shell[data-studio-scene] :is(.dashboard-title,.visual-header,.repetition-header,.studio-course-heading) {
    background: Canvas;
    color: CanvasText;
  }
  .study-shell[data-studio-scene] :is(.dashboard-title,.visual-header,.repetition-header,.studio-course-heading)::after {
    display: none;
  }
}

.study-shell :is(.sidebar,.math-sidebar) nav.course-menu {
  display: grid;
  align-content: start;
  gap: 2px;
}
.course-menu details { border-top: 1px solid var(--line); }
.course-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 690;
  color: var(--text);
}
.course-menu summary::-webkit-details-marker { display: none; }
.course-menu summary::after {
  content: '';
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  width: 7px;
  height: 7px;
  margin-inline-end: 4px;
  transform: rotate(45deg);
  flex: none;
}
.course-menu details[open] > summary::after { transform: rotate(225deg); }
.course-menu summary:hover, .course-menu-current > summary { background: var(--accent-soft); }
.course-menu .course-menu-current > summary { color: var(--accent); }
.course-menu .course-menu-items {
  display: grid;
  gap: 2px;
  padding: 2px 0 8px;
}
.study-shell .course-menu .nav-group.course-menu-items:last-child {
  padding: 2px 0 8px;
  border: 0;
}
.course-menu details .course-menu-items { margin-inline-start: 10px; }
.study-shell .course-menu :is(.course-menu-items a,.course-menu-plan) {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: .9rem;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.study-shell .course-menu .course-menu-plan {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .2em;
}
.study-shell .course-menu .course-menu-plan[hidden] { display: none; }
.course-plan-return {
  display: flex;
  margin-block: 0 12px;
  padding-inline-start: 12px;
  border-inline-start: 2px solid var(--accent);
}
.course-plan-return a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .92rem;
  font-weight: 650;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .2em;
}
@media (max-width: 820px) {
  .study-shell .course-menu :is(summary,.course-menu-items a,.course-menu-items button) { min-height: 44px; }
}

/* Shared course book index and reading workspace. Course skins supply the palette. */
.course-book-directory {
  display: grid;
  gap: var(--s-4);
  min-width: 0;
}
.course-book-header, .course-book-start, .course-book-search, .course-book-group, .course-book-empty {
  min-width: 0;
  padding: clamp(16px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--study-radius);
  background: var(--paper);
}
.course-book-header { border-inline-start: 4px solid var(--accent); }
.course-book-header h1 { margin: 0; font-size: clamp(1.8rem, 3.8vw, 2.8rem); }
.course-book-header p { margin: 8px 0 0; color: var(--muted); }
.course-book-start {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,16rem),1fr));
  align-items: start; gap: 12px 24px;
}
.course-book-start > :is(a,details) { justify-self: start; }
.course-book-start ul { padding-inline-start: 20px; }
.course-book-start summary, .course-reader-controls summary { cursor: pointer; }
.reader-progress-label { display: grid; gap: 6px; max-width: 23rem; font-size: .88rem; color: var(--muted); }
.reader-progress-label progress { width: 100%; height: .6rem; accent-color: var(--accent); }
.course-book-search { display: grid; grid-template-columns: minmax(0,1fr) minmax(9rem,.3fr); gap: 8px 16px; }
.course-book-search label { display: block; margin-bottom: 4px; font-weight: 680; }
.course-book-search :is(input, select) { width: 100%; min-width: 0; min-height: 44px; }
.course-book-recommended { display: grid; gap: 2px; }
.course-book-recommended a, .course-book-empty button { padding-inline: 0; }
.course-book-empty button { border: 0; background: none; cursor: pointer; text-decoration: underline; }
.course-book-group + .course-book-group { margin-top: var(--s-4); }
.course-book-group summary {
  cursor: pointer; min-height: 44px; overflow-wrap: anywhere;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
}
.course-book-group summary small { margin-inline-start: 10px; font-size: .84rem; color: var(--muted); }
.course-book-group > p { color: var(--muted); }
.course-book-group ul { padding: 0; margin: 0; list-style: none; }
.course-book-group li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 6px 16px; padding-block: 8px; border-block-end: 1px solid var(--line);
}
.course-book-group li:last-child { border-block-end: 0; padding-bottom: 0; }
.course-book-group li > div { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.course-book-group li small { display: block; color: var(--muted); }
.course-book-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 10px;
  color: var(--accent); font-weight: 700; text-underline-offset: .2em;
}

.study-shell .course-reader-toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 8px 20px; margin: 0 0 var(--s-4); padding: 12px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--study-radius);
}
.course-reader-controls, .course-reader-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.study-shell .course-reader-controls > details > summary {
  min-height: 40px; padding: 8px 10px; border: 1px solid var(--study-control);
  border-radius: 8px; color: var(--text); font-size: .88rem; font-weight: 680;
}
.course-reader-controls > details[open] > summary { margin-bottom: 8px; }
.course-reader-controls :is(button, select) { min-height: 40px; }
.course-reader-controls a { min-height: 40px; display: inline-flex; align-items: center; }
.course-reader-context { min-width: 0; }
.course-reader-context small { display: block; color: var(--muted); }
.study-shell .course-reader-layout {
  display: grid; grid-template: "contents" auto "outline" auto "main" auto / minmax(0,1fr);
  align-items: start; gap: clamp(10px,1.5vw,24px);
}
.course-reader-contents { grid-area: contents; }
.course-reader-outline { grid-area: outline; }
.course-reader-main { grid-area: main; min-width: 0; }
.study-shell .course-reader-layout > :is(.course-reader-contents,.course-reader-outline) {
  min-width: 0; margin: 0; padding: 0 12px; position: static; max-height: none;
  border: 1px solid var(--line); border-radius: var(--study-radius);
}
.course-reader-layout > details > summary { cursor: pointer; min-height: 44px; padding-block: 10px; font-weight: 720; }
.course-reader-layout > details[open] > :is(nav,.course-reader-outline-body) { padding-bottom: 12px; }
.course-reader-layout > details nav a { min-height: 32px; }
.study-shell .course-reader-paper { min-width: 0; padding: clamp(16px, 3vw, 38px); }
.study-shell .course-reader-paper h1 {
  font: 720 clamp(1.65rem, 3.2vw, 2.75rem)/1.13 var(--study-display);
  margin-block: 0 clamp(16px, 2vw, 24px); letter-spacing: -.038em; overflow-wrap: anywhere;
}
.study-shell .course-reader-paper > .math-heading { margin: 0; }
.course-reader-neighbors {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px;
  margin-top: var(--s-4);
}
.course-reader-neighbors a {
  min-width: 0; display: grid; gap: 4px; padding: 10px; overflow-wrap: anywhere;
  border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--accent);
}
.course-reader-neighbors a:hover { border-color: var(--accent); }
.course-reader-neighbors small { color: var(--muted); }

@media (min-width: 1060px) {
  .study-shell .course-reader-layout {
    grid-template: "contents outline" auto "contents main" 1fr / minmax(165px,.24fr) minmax(0,1fr);
  }
  .study-shell .course-reader-layout > .course-reader-contents {
    position: sticky; top: calc(var(--study-header) + 12px);
    max-height: calc(100dvh - var(--study-header) - 24px); overflow: auto;
  }
  .study-shell .course-reader-layout.chapters-hidden { grid-template: "outline" auto "main" 1fr / minmax(0,1fr); }
  .study-shell .course-reader-layout.related-hidden { grid-template-areas: "contents main"; }
}
@media (min-width: 1280px) {
  .study-shell .course-reader-layout {
    grid-template: "contents main outline" 1fr / minmax(165px,.24fr) minmax(0,1fr) minmax(160px,.22fr);
  }
  .study-shell .course-reader-layout > .course-reader-outline {
    position: sticky; top: calc(var(--study-header) + 12px);
    max-height: calc(100dvh - var(--study-header) - 24px); overflow: auto;
  }
  .study-shell .course-reader-layout.chapters-hidden { grid-template: "main outline" 1fr / minmax(0,1fr) minmax(160px,.22fr); }
  .study-shell .course-reader-layout.related-hidden { grid-template: "contents main" 1fr / minmax(165px,.24fr) minmax(0,1fr); }
}
.study-shell :is([data-reader-layout="focus"],[data-reader-layout="wide"]) .course-reader-layout,
.study-shell .course-reader-layout.chapters-hidden.related-hidden {
  grid-template: "main" 1fr / minmax(0,1fr);
}
.study-shell :is([data-reader-layout="focus"],[data-reader-layout="wide"]) .course-reader-layout > details { display: none; }
.study-shell .book-layout.book-focus { max-width: 910px; margin-inline: auto; }
.study-shell.course-reader-open.biology .workspace { margin-inline-start: 0; }
.study-shell.course-reader-open.biology .mobile-menu { display: inline-flex; }
.study-shell.course-reader-open.biology .sidebar { display: none; }
.study-shell.course-reader-open.biology.mobile-menu-open .sidebar {
  display: block; position: fixed; z-index: 5; width: min(310px,calc(100vw - 24px));
  max-height: calc(100dvh - var(--study-header)); overflow: auto;
}
.study-shell.course-reader-open.biology #screen { max-width: 1560px; padding-inline: clamp(16px,3.2vw,48px); }
.registered-reading[data-reader-scale="small"] { font-size: .96rem; }
.registered-reading[data-reader-scale="large"] { font-size: 1.24rem; }
.registered-reading > :is(p,h2,h3) { max-width: 70ch; }
.registered-reader .course-reader-contents ul { list-style: none; padding-inline-start: 12px; }
.registered-reader .course-reader-contents a { display: block; padding-block: 5px; }
.registered-reader .course-reader-contents [aria-current] { color: var(--accent); font-weight: 700; }
.registered-reader .registered-reading { line-height: 1.7; }
.registered-reader .course-reader-paper { max-width: none; }
.registered-reader[data-reader-layout="focus"] { max-width: 910px; margin-inline: auto; }
.registered-reader[data-reader-layout="wide"] { max-width: 1200px; margin-inline: auto; }
@media (max-width: 560px) {
  .course-book-search { grid-template-columns: minmax(0,1fr); }
}
