
.archive-home { margin-block: 0 1rem; }
.analysis-table { border-collapse: collapse; width: 100%; text-align: start; }
.analysis-table th, .analysis-table td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); text-align: start; }
.analysis-table td { text-align: end; font-variant-numeric: tabular-nums; }
.archive-home a.panel { border-top: 3px solid var(--accent); }
.archive-nav { margin: 0 0 1rem; }
.archive-nav [aria-current="page"] { font-weight: 750; text-decoration: underline; text-underline-offset: .25em; }
.archive-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr));
  gap: .75rem;
  margin: 1rem 0;
}
.archive-facts div { border: 1px solid var(--line, #83998e); border-radius: .65rem; padding: .75rem; }
.archive-facts dt { font-size: .86rem; }
.archive-facts dd { margin: .2rem 0 0; font-weight: 650; }
.archive-count { max-width: 19rem; }
.archive-stat summary { display: flex; gap: .8rem; justify-content: space-between; align-items: baseline; }
.archive-stat summary strong { flex: none; font-size: .83rem; font-weight: 650; }
.archive-stat progress { display: block; width: 100%; height: .5rem; margin: .45rem 0 .9rem; accent-color: #3a8d7c; }
.archive-questions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.archive-questions .p-button { min-width: 2.7rem; min-height: 2.5rem; justify-content: center; }
.archive-timer { font-variant-numeric: tabular-nums; font-weight: 650; padding: .45rem .65rem; }
.archive-response { margin: 1.1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line, #83998e); }
.archive-response h3 { margin-top: 0; }
.archive-response textarea { resize: vertical; }
.archive-task, .archive-solution { min-width: 0; }
.archive-solution .fragment-scroll { gap: .6rem; }
@media (max-width: 36rem) {
  .archive-nav, .archive-run-nav .math-actions { align-items: stretch; }
  .archive-nav a { min-height: 2.75rem; }
  .archive-questions { gap: .3rem; }
  .archive-questions .p-button { min-width: 2.6rem; padding-inline: .55rem; }
}
@media (min-width: 68rem) {
  .math-home-grid.archive-home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
:root {
  color-scheme: light dark;
  --canvas: #f4f7f7;
  --paper: #fff;
  --soft: #eef3f3;
  --text: #182d39;
  --muted: #4e646d;
  --line: #d5e0e2;
  --accent: #096b61;
  --accent-deep: #07574f;
  --accent-soft: #e0f1ec;
  --on-accent: #fff;
  --bar: #152e3a;
  --bar-text: #f2fbfc;
  --focus: #966217;
  --rad: 14px;
  font: 100%/1.6 "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #101c23; --paper: #19282f; --soft: #23343c; --text: #eef4f5;
    --muted: #b1c4ca; --line: #40545d; --accent: #a2e7d3; --accent-deep: #baefdf;
    --accent-soft: #244741; --on-accent: #102923; --bar: #142632; --focus: #f3ca82;
  }
}
.mathematics {
  --accent: #345b96; --accent-deep: #244a81; --accent-soft: #e5eefb; --on-accent: #fff;
}
@media (prefers-color-scheme: dark) {
  .mathematics { --accent: #aecafa; --accent-deep: #c8dcfa; --accent-soft: #2b3e5d; --on-accent: #172f56; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--text); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; }
h1 { font: 500 clamp(2.4rem, 5.8vw, 4.15rem)/1.02 Georgia, serif; letter-spacing: -.047em; }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.62rem); font-weight: 680; letter-spacing: -.025em; }
h3 { font-size: 1.05rem; font-weight: 680; }
p + p, h2 + p, h3 + p { margin-top: .55rem; }
a { color: var(--accent); text-underline-offset: 4px; }
button, select, textarea, input { font: inherit; }
button, input[type=range], summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; left: 10px; top: 10px; transform: translateY(-150%); background: var(--paper); padding: .7rem; z-index: 10; }
.skip-link:focus { transform: translateY(0); }
.platform-wrap { max-width: 1360px; margin: 0 auto; padding-inline: clamp(16px, 4.5vw, 62px); }
.platform-bar { background: var(--bar); color: var(--bar-text); }
.platform-bar > div { min-height: 69px; display: flex; justify-content: space-between; align-items: center; gap: .7rem; }
.platform-brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #80a8ac; border-radius: 8px; color: #b9e9da; font: 650 1.14rem Georgia, serif; }
.platform-start { min-height: calc(100vh - 69px); padding-block: clamp(42px, 8vw, 112px); }
.platform-intro { max-width: 680px; margin-bottom: clamp(24px, 4vw, 43px); }
.platform-intro p, .math-heading p { margin-top: .85rem; color: var(--muted); max-width: 66ch; }
.course-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; max-width: 990px; }
.course-choice { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(22px, 3.4vw, 36px); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--rad); background: var(--paper); }
.choice-top { align-self: stretch; display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.15rem; }
.course-code, .course-symbol { color: var(--accent); background: var(--accent-soft); border-radius: 8px; }
.course-code { padding: .27rem .6rem; font-size: .9rem; font-weight: 695; letter-spacing: .035em; }
.course-symbol { display: grid; place-items: center; width: 46px; height: 46px; font: 1.55rem Georgia, serif; }
.course-symbol.integral { font-size: 2rem; }
.course-choice p { color: var(--muted); margin-bottom: 1.3rem; }
.course-choice .p-button { margin-top: auto; }
.p-button { display: inline-flex; align-items: center; justify-content: center; padding: .53rem .85rem; gap: .45rem; min-height: 42px; font-size: .94rem; font-weight: 650; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--text); text-decoration: none; }
.p-button:hover { border-color: var(--accent); background: var(--soft); }
.p-button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.p-button.primary:hover { background: var(--accent-deep); }
.p-button.quiet { background: transparent; color: var(--bar-text); border-color: #8097a3; }
.p-button.quiet:hover { background: #294754; }
.p-button:disabled { cursor: default; opacity: .55; }
.math-layout { display: grid; grid-template-columns: minmax(185px, 220px) minmax(0, 1fr); gap: clamp(18px, 3vw, 43px); padding-block: clamp(23px, 4vw, 48px); }
.math-sidebar { border-right: 1px solid var(--line); padding-right: 16px; }
.math-course-label { display: grid; gap: .12rem; margin: .25rem 0 1rem; }
.math-course-label strong { color: var(--accent); font-size: .88rem; letter-spacing: .08em; }
.math-course-label span { font-weight: 690; }
small, .muted { color: var(--muted); }
.math-sidebar nav { display: grid; gap: 4px; }
.math-sidebar nav a { background: transparent; color: var(--text); text-decoration: none; padding: .45rem .63rem; border-radius: 8px; font-size: .94rem; }
.math-sidebar nav a:hover { background: var(--soft); }
.math-sidebar nav a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 670; }
.math-main, .panel { min-width: 0; }
.math-main:focus-visible { outline: none; }
.math-heading { margin-bottom: 1.2rem; }
.math-heading h1 { font-size: clamp(2.25rem, 4.5vw, 3.5rem); }
.math-hero { padding: clamp(22px, 4vw, 42px); border-radius: var(--rad); background: #23436b; color: #f8fbff; }
.math-hero p { max-width: 59ch; margin: .9rem 0 1.2rem; color: #dce9fc; }
.math-hero .p-button { background: #deebfb; color: #183455; border-color: #deebfb; }
.math-hero .p-button:hover { background: #f0f6ff; }
.math-home-grid, .equations-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-top: .85rem; }
.panel { padding: clamp(16px, 2.4vw, 24px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--rad); }
.panel + .panel { margin-top: .85rem; }
.math-home-grid .panel { margin-top: 0; }
a.panel { display: block; text-decoration: none; color: var(--text); }
a.panel:hover { border-color: var(--accent); }
a.panel h2 { font-size: 1.16rem; }
.panel h3:not(:first-child) { margin-top: .9rem; }
.empty-note { color: var(--muted); }
.math-block { overflow: auto hidden; max-width: 100%; padding: .22rem .35rem; min-height: 2.2rem; color: var(--text); }
.math-block > .katex { display: block; width: max-content; min-width: 100%; }
.math-block math { font-size: 1.12em; }
.math-block + p { margin-top: .65rem; }
.equation-tile { background: var(--soft); border-radius: 9px; padding: .65rem; min-width: 0; }
.equation-tile h3 { font-size: .93rem; margin-bottom: .3rem; }
.math-label { display: grid; gap: .4rem; font-weight: 650; margin-top: .7rem; }
.math-label input:not([type=range]), .math-label textarea, .math-label select {
  width: 100%; min-width: 0; padding: .53rem .68rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--text);
}
.math-label textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; font-weight: 450; }
.math-editor { margin-block: .8rem; }
.syntax-buttons, .math-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-block: .7rem; }
.syntax-buttons .p-button { padding: .34rem .5rem; min-height: 38px; }
.syntax-help { font-size: .9rem; color: var(--muted); }
.answer-preview { padding: .35rem; border-radius: 8px; background: var(--soft); min-height: 2.55rem; }
.math-list { list-style: none; padding: 0; margin: .85rem 0 0; }
.math-list > li { display: flex; align-items: center; justify-content: space-between; gap: .65rem; border-bottom: 1px solid var(--line); padding: .65rem 0; }
.math-list > li:last-child { border-bottom: 0; }
.math-list p { color: var(--muted); font-size: .9rem; }
.graph { width: 100%; max-width: 750px; height: auto; display: block; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); margin-block: .65rem; }
.math-range { width: 100%; accent-color: var(--accent); }
.math-progress { display: flex; flex-wrap: wrap; gap: .65rem 1.2rem; margin-top: .75rem; color: var(--muted); }
.math-progress strong { color: var(--accent); }
.math-source { color: var(--muted); font-size: .9rem; margin-top: .7rem; }
.book-back { margin-bottom: .63rem; color: var(--muted); font-size: .94rem; }
.book-reading { padding: clamp(18px, 4.1vw, 42px); }
.book-reading h2 { margin-top: 2rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.book-reading p, .book-demo p { max-width: 77ch; }
.book-reading > p { line-height: 1.73; }
.book-reading .math-block { margin-top: .42rem; border-radius: 7px; background: var(--soft); padding: .5rem .7rem; }
.book-reading .math-block + .math-block { margin-top: .25rem; }
.book-modes { margin: .55rem 0 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.book-section { margin: 1.45rem 0; }
.book-section h2 { margin-top: 0; }
.book-section ol { padding-inline-start: 1.55rem; }
.book-section li + li { margin-top: .4rem; }
.book-start { padding: .9rem 1rem; border-inline-start: 3px solid var(--accent); background: var(--soft); border-radius: 0 8px 8px 0; }
.book-notation { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .55rem; margin: .65rem 0; }
.book-notation > div { min-width: 0; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 8px; }
.book-notation dt { font-weight: 675; overflow: auto hidden; padding-block: .14rem; }
.book-notation dd { margin: .3rem 0 0; color: var(--muted); }
.book-example { min-width: 0; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px; margin: .75rem 0; }
.book-example h3 { margin: .25rem 0 .5rem; }
.book-example-level { color: var(--muted); font-size: .86rem; }
.book-example-actions { margin: .72rem 0; }
.book-steps > li { padding: .35rem 0 .65rem .15rem; }
.book-steps h4 { margin: .3rem 0; }
.book-hint { padding: .6rem .8rem; border-inline-start: 3px solid var(--accent); background: var(--soft); border-radius: 6px; }
.book-choice .p-button { text-align: start; white-space: normal; }
.book-supplement { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: .65rem .85rem; margin-top: .8rem; }
.book-supplement p { margin-top: .24rem; }
.book-search { margin-bottom: .85rem; }
.book-search .math-label { margin-top: 0; }
.source-list { margin-block: .7rem; padding-left: 1.2rem; overflow-wrap: anywhere; }
.source-list li + li { margin-top: .22rem; }
.book-neighbors { justify-content: space-between; margin-top: 1rem; }
.book-demo { border-radius: var(--rad); background: var(--soft); margin-top: 1.7rem; padding: clamp(12px, 2.4vw, 22px); }
.book-demo h2 { padding: 0; margin: 0; border: 0; }
.demo-controls { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.demo-controls > label { flex: 1 1 180px; }
.demo-graph { max-width: none; }
.book-demo output { display: block; min-height: 2rem; font-weight: 625; color: var(--text); }
.solution-step { margin-top: .7rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 8px; }
.solution-step summary { font-weight: 650; }
.bank-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .15rem .8rem; }
.bank-filters .math-label { min-width: 0; }
.module-fragments { min-width: 0; margin: .8rem 0; }
.fragment-zoom { display: flex; align-items: center; gap: .35rem; min-height: 34px; color: var(--muted); font-size: .88rem; }
.fragment-zoom input { accent-color: var(--accent); }
.fragment-scroll { display: grid; gap: .4rem; overflow-x: auto; }
.module-fragments img { display: block; width: auto; max-width: min(100%, 47rem); height: auto; border: 1px solid var(--line); border-radius: 7px; background: white; }
.module-fragments:has(input:checked) .fragment-scroll { display: block; }
.module-fragments:has(input:checked) img { max-width: none; margin-bottom: .4rem; }
.exam-options { min-width: 0; margin: .9rem 0; padding: .65rem .75rem; border-radius: 8px; border: 1px solid var(--line); }
.exam-options legend { padding: 0 .3rem; font-weight: 650; }
.exam-options p { margin: 0 0 .38rem; color: var(--muted); }
.exam-options > div { display: flex; flex-wrap: wrap; gap: .35rem 1.2rem; }
.exam-options label, .exam-check { display: inline-flex; min-height: 37px; align-items: center; gap: .42rem; }
.exam-generator input[type=checkbox] { accent-color: var(--accent); width: 1.03rem; height: 1.03rem; flex: 0 0 auto; }
.exam-generator .exam-check { display: flex; margin: .45rem 0; }
.exam-generator [hidden] { display: none; }
.bank-filters select { min-width: 0; width: 100%; }
.bank-results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 1.1rem; }
.bank-results-head p { margin: 0; font-weight: 650; }
.bank-results-list > li > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.bank-row-actions { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: end; flex: 0 0 auto; max-width: 45%; }
.bank-pagination { align-items: center; justify-content: center; }
.bank-continue .math-list { margin-top: .35rem; }
.bank-nav { margin: .75rem 0 1rem; }
.bank-task .math-block { margin: .45rem 0; background: var(--soft); border-radius: 8px; }
.bank-options { display: grid; gap: .45rem; min-width: 0; padding: .75rem; border: 1px solid var(--line); border-radius: 8px; }
.bank-options label { display: flex; align-items: start; gap: .6rem; cursor: pointer; min-height: 36px; }
.bank-options input { accent-color: var(--accent); margin: .25rem 0 0 .1rem; width: 1.12rem; height: 1.12rem; flex: 0 0 auto; }
.bank-options span { overflow-wrap: anywhere; }
.bank-response { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .8rem; }
.bank-method { color: var(--muted); font-size: .94rem; }
.bank-feedback, .bank-hint { border: 1px solid var(--line); background: var(--soft); border-radius: 8px; padding: .66rem .85rem; margin: .65rem 0; }
.bank-feedback[data-result="correct"] { border-color: var(--accent); }
.bank-feedback[data-result="incorrect"] { border-inline-start: .25rem solid #bc713a; }
.bank-hint h3 { margin-top: 0; }
.bank-skill { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.bank-skill .math-actions { margin: 0; }
.bank-skill button[aria-pressed="true"], [data-action="exercise-bookmark"][aria-pressed="true"] { background: var(--soft); border-color: var(--accent); }
.platform-notice { position: fixed; bottom: 12px; right: 12px; z-index: 5; max-width: min(440px, calc(100% - 24px)); background: var(--bar); color: var(--bar-text); padding: .7rem .95rem; border-radius: 8px; box-shadow: 0 4px 14px #0004; }
@media (max-width: 760px) {
  .math-layout { display: block; }
  .math-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 .75rem; margin-bottom: 1.05rem; }
  .math-course-label { grid-template-columns: auto auto 1fr; align-items: baseline; justify-content: start; gap: .6rem; }
  .math-sidebar nav { display: flex; flex-wrap: wrap; gap: .2rem; }
  .math-sidebar nav a { font-size: .9rem; padding: .34rem .48rem; }
}
@media (max-width: 490px) {
  .bank-row-actions { max-width: 100%; justify-content: start; }
  .course-options, .math-home-grid, .equations-grid { grid-template-columns: minmax(0, 1fr); }
  .math-course-label { grid-template-columns: auto auto; }
  .math-course-label small { grid-column: 1 / -1; }
  .math-list > li { align-items: start; flex-wrap: wrap; }
}

/* 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); }
}

.mathematics.math-reading .math-layout { display: block; max-width: 1560px; }
.mathematics.math-reading .study-menu { display: inline-flex; }
.mathematics.math-reading .math-sidebar { display: none; }
.mathematics.math-reading.mobile-menu-open .math-sidebar {
  display: block; position: fixed; z-index: 5; inset: var(--study-header) auto auto 0;
  width: min(310px, calc(100vw - 24px)); max-height: calc(100dvh - var(--study-header));
  overflow: auto; overscroll-behavior: contain; padding: var(--s-4);
  border: 1px solid var(--line); border-radius: 0 0 12px 0; background: var(--paper); box-shadow: 0 16px 36px #0b21312e;
}
.math-reader {
  --reader-font: 1.06rem;
  --reader-line: 1.7;
  --reader-measure: 71ch;
  --reader-gap: clamp(16px, 2vw, 32px);
  min-width: 0;
}
.math-reader[data-reader-scale="small"] { --reader-font: .96rem; }
.math-reader[data-reader-scale="large"] { --reader-font: 1.24rem; }
.math-reader .math-reader-toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--s-2) var(--s-4); padding-bottom: var(--s-3); border-bottom: 1px solid var(--line); margin-bottom: var(--s-4);
}
.math-reader .math-reader-toolbar .math-actions { gap: var(--s-2); margin: 0; }
.math-reader .reader-settings-menu { margin: 0; max-width: 100%; }
.math-reader .reader-settings-menu > summary { cursor: pointer; color: var(--accent); font-size: .88rem; font-weight: 720; padding: 8px 0; }
.math-reader .reader-settings-menu[open] > summary { margin-bottom: var(--s-2); }
.math-reader .math-reader-toolbar :is(button, select) { min-height: 38px; }
.math-reader .math-reader-toolbar button[aria-pressed="true"],
.math-reader .reader-example-bar button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.math-reader .reader-scale { display: flex; align-items: center; gap: var(--s-2); margin: 0; color: var(--muted); font-size: .86rem; }
.math-reader .reader-scale select { width: auto; }

.math-reader .reader-content { min-width: 0; }
.math-reader :is(.reader-contents,.reader-on-page) {
  margin: 0; min-width: 0; padding: 0 var(--s-3); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
}
.math-reader :is(.reader-contents,.reader-on-page) > summary { padding: var(--s-3) 0; font-weight: 720; cursor: pointer; }
.math-reader :is(.reader-contents,.reader-on-page) nav { display: block; margin: 0; padding: 0 0 var(--s-3); }
.math-reader :is(.reader-contents,.reader-on-page) nav ul { margin: 0; padding: 0; list-style: none; }
.math-reader :is(.reader-contents,.reader-on-page) nav a {
  display: block; padding: 6px 8px; border-radius: 6px; color: inherit; text-decoration: none;
  overflow-wrap: anywhere; line-height: 1.35; font-size: .88rem;
}
.math-reader :is(.reader-contents,.reader-on-page) nav a:hover { text-decoration: underline; background: var(--soft); }
.math-reader :is(.reader-contents,.reader-on-page) nav a[aria-current] {
  background: var(--accent-soft); color: var(--accent); font-weight: 720; box-shadow: inset 3px 0 var(--accent);
}
.math-reader .reader-search-link { color: var(--accent); font-weight: 700; margin-bottom: var(--s-2); }
.math-reader .reader-module { border-top: 1px solid var(--line); padding: 2px 0; }
.math-reader .reader-module > summary { padding: var(--s-2) 0; cursor: pointer; font-size: .9rem; }
.math-reader .reader-module > summary span { font-weight: 700; }
.math-reader .reader-module > summary small { display: block; margin-inline-start: var(--s-4); color: var(--muted); font-size: .76rem; }
.math-reader .reader-module > ul { padding-inline-start: var(--s-2); }
.math-reader .reader-subchapter { margin: 4px 0 8px; padding-inline-start: 10px; border-inline-start: 1px solid var(--line); font-size: .79rem; color: var(--muted); }
.math-reader .reader-subchapter > summary { padding: 3px 0; cursor: pointer; }
.math-reader .reader-outline-example { padding-inline-start: 10px; }
.math-reader .reader-on-page .reader-outline-example a { font-size: .81rem; }
.math-reader .reader-read-mark { color: var(--accent); font-weight: 750; }
.reader-progress-label { display: grid; gap: var(--s-1); font-size: .8rem; color: var(--muted); }
.reader-progress-label progress { width: 100%; height: .55rem; accent-color: var(--accent); }
.math-reader #reader-progress { margin: 0 var(--s-1) var(--s-3); }
.mathematics .reader-start { display: grid; justify-items: start; gap: var(--s-3); }
.mathematics .reader-start .reader-progress-label { width: min(320px,100%); }
.mathematics .reader-start details { max-width: 100%; }

.math-reader .reader-crumbs { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-2); }
.math-reader .reader-crumbs .book-back { margin: 0; }
.math-reader .reader-content > .math-heading { margin: var(--s-3) 0 var(--s-6); }
.math-reader .reader-content h1 { font-size: clamp(2.05rem, 4vw, 3.65rem); }
.math-reader .book-reading {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; min-width: 0;
  padding: clamp(14px, 3.25vw, 40px); font-size: var(--reader-font); line-height: var(--reader-line);
}
.math-reader .book-reading :is(p, ol, ul, dd) { max-width: var(--reader-measure); }
.math-reader .book-reading .book-modes { margin: 0 0 var(--s-6); gap: var(--s-2); flex-wrap: wrap; }
.math-reader .book-reading .book-modes button { font-size: .86rem; }
.math-reader .book-section + .book-section { margin-top: clamp(24px, 4vw, 44px); }
.math-reader .book-section > h2 { margin: 0 0 var(--s-2); }
.math-reader .book-case summary { overflow-wrap: anywhere; scroll-margin-top: calc(var(--study-header) + 16px); }
.math-reader .book-case-body { min-width: 0; padding-block: var(--s-1); }
.math-reader .book-case-source { font-size: .86rem; overflow-wrap: anywhere; }
.math-reader .book-case-links { margin-block-start: var(--s-3); }
.math-reader .reader-definitions { border-inline-start: 3px solid var(--accent); padding: var(--s-4); border-radius: 0 8px 8px 0; background: var(--accent-soft); }
.math-reader .reader-derivation { margin-block: var(--s-4); }
.math-reader .book-notation { grid-template-columns: minmax(0,1fr); gap: 0; }
.math-reader .book-notation > div {
  display: grid; grid-template-columns: minmax(0,.42fr) minmax(0,1fr); align-items: baseline; gap: var(--s-4);
  padding: var(--s-3); border: 0; border-block-end: 1px solid var(--line); border-radius: 0; background: transparent;
}
.math-reader .book-notation .notation-wide {
  grid-template-columns: minmax(0,1fr); gap: var(--s-2); margin: var(--s-2) 0;
  border: 0; border-radius: 8px; background: var(--soft);
}
.math-reader .book-notation dt { min-width: 0; max-width: 100%; overflow-x: auto; }
.math-reader .book-notation dd { margin: 0; }
.math-reader [data-reader-scroll]:focus-visible { outline-offset: -3px; }
.math-reader .book-example { margin-block: var(--s-4); padding: var(--s-4); border: 0; border-inline-start: 3px solid var(--accent); background: var(--soft); }
.math-reader .reader-example-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-2); }
.math-reader .reader-example-bar p { margin: 0; }
.math-reader .reader-example-bar button { font-size: .82rem; }
.math-reader .book-example h3 { margin: 0 0 var(--s-3); }
.math-reader .reader-mathlab { min-width: 0; }
.math-reader [data-reader-anchor] { scroll-margin-top: calc(var(--study-header) + 16px); }
.math-reader .reader-followup { border-top: 1px solid var(--line); margin-top: var(--s-8); padding: var(--s-4) 0 0; }
.math-reader .reader-followup > h2 { font: 550 clamp(1.3rem, 2.1vw, 1.8rem)/1.22 var(--study-serif); }
.math-reader .reader-neighbors { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--s-3); margin-top: var(--s-8); }
.math-reader .reader-neighbors a {
  display: grid; gap: var(--s-1); padding: var(--s-3); border: 1px solid var(--line);
  border-radius: 8px; background: var(--paper); text-decoration: none; overflow-wrap: anywhere;
}
.math-reader .reader-neighbors a:hover { border-color: var(--accent); }
.math-reader .reader-neighbors small { color: var(--muted); }
.math-reader .reader-neighbors strong { color: var(--accent); }
.math-reader .book-starter {
  padding: var(--s-4); border-block: 1px solid var(--line); border-inline-start: 3px solid var(--accent);
}
.math-reader .book-starter :is(h3,.book-example-level) { margin-block: 0 var(--s-2); }
.math-reader .book-method-check { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.math-reader .book-prerequisites { padding-inline-start: var(--s-6); }
.math-reader .book-guide dl { display: grid; gap: var(--s-3); margin-block: var(--s-3) 0; }
.math-reader .book-guide dl > div { padding-block-start: var(--s-3); border-top: 1px solid var(--line); }
.math-reader .book-guide dt { font-size: .88em; color: var(--muted); }
.math-reader .book-guide dd { margin-inline-start: 0; }
.math-reader .book-guide dd a { font-weight: 720; }
.math-reader .book-guide dd p { margin-block: var(--s-1) 0; }
.math-reader .book-practice-path {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,13rem),1fr)); gap: var(--s-3);
  list-style: none; margin: var(--s-3) 0; padding: 0;
}
.math-reader .book-practice-path > li {
  min-width: 0; padding: var(--s-3); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: 8px; background: var(--paper);
}
.math-reader .book-practice-path h3 { margin: 0 0 var(--s-2); font-size: 1.02rem; }
.math-reader :is(.book-example-actions,.book-practice-path) :is(button,a) { max-width: 100%; white-space: normal; }
.math-reader .book-practice-path :is(button,a) { margin-block: var(--s-1); }
.math-reader .book-practice-suggestion { border-inline-start: 3px solid var(--accent); padding-inline: var(--s-3); }
.mathematics .book-support-dialog {
  width: min(650px,calc(100% - 24px)); max-height: min(720px,90dvh);
  margin: auto; padding: clamp(16px,3vw,32px); border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); background: var(--paper);
}
.mathematics .book-support-dialog::backdrop { background: #10182090; }
.mathematics .book-support-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.mathematics .book-support-dialog [hidden] { display: none; }
.mathematics .book-support-dialog .book-example-level { margin-block: 0; }

@media (min-width: 1280px) {
  .math-reader[data-reader-layout="wide"] { max-width: 1200px; margin-inline: auto; }
}
.math-reader[data-reader-layout="focus"] { max-width: 910px; margin-inline: auto; }
@media (max-width: 600px) {
  .math-reader .math-reader-toolbar { gap: var(--s-2); }
  .math-reader .reader-settings-menu { flex-basis: 100%; }
  .math-reader .math-reader-toolbar .math-actions { flex-wrap: wrap; }
  .math-reader .math-reader-toolbar button { padding-inline: var(--s-2); font-size: .83rem; }
  .math-reader .book-reading .book-modes button { max-width: 100%; white-space: normal; }
  .math-reader .book-notation > div { grid-template-columns: minmax(0,1fr); gap: var(--s-2); }
  .math-reader .reader-neighbors { gap: var(--s-2); }
  .math-reader .reader-neighbors a { padding: var(--s-2); }
}

/* 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; }
}

.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); }

.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; }
}

.registered-course .registered-reading { max-width: 76ch; }
.registered-course .registered-reading h2 { margin-top: var(--s-4); }
.registered-course .registered-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.registered-course .registered-form > label { min-width: min(100%, 10rem); flex: 1 1 10rem; }
.registered-course label :is(input,select) { display: block; width: 100%; }
.registered-course textarea { display: block; width: 100%; }
.registered-course .pre-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.registered-course .math-block { max-width: 100%; overflow: auto; }
.studio-course.registry-course .studio-cover { display: none; }
.studio-course.registry-course { grid-template-columns: minmax(0,1fr); }
.studio-course.registry-course .studio-course-copy { background: var(--paper); }

.study-shell .local-course-editor { max-width: 62rem; padding-block: 24px 48px; }
.local-course-editor .panel { margin-block: 16px; }
.local-course-editor .local-fields { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 12px; }
.local-course-editor label { display: grid; gap: 4px; min-width: 0; }
.local-course-editor :is(input,textarea,select) { max-width: 100%; }
.local-course-editor fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.local-course-editor .local-file-list { margin-block: 12px; padding: 0; list-style: none; }
.local-course-editor .local-file-list li { border-top: 1px solid var(--line); padding-block: 8px; overflow-wrap: anywhere; }
.local-course-editor .local-file-list label { grid-template-columns: minmax(0, 1fr) minmax(9rem, 0.6fr); align-items: center; }
.local-course-editor .local-file-list label span { min-width: 0; }
.local-course-editor .local-editor-row { border-top: 1px solid var(--line); padding-block: 8px; }
.local-course-editor .local-editor-row .math-actions { margin-block: 4px 0; }
.local-course-editor .local-feedback { margin-block: 8px; }
.local-course-editor .local-feedback:empty { display: none; }
.local-course-editor .local-report { border-inline-start: 4px solid var(--accent); }
.local-course-editor dialog { max-width: min(94vw, 35rem); }
.local-course-shelf { margin-block: 16px; }
.local-course-shelf .math-list p { margin: 4px 0 0; }
.study-shell .local-source-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
@media (max-width: 560px) {
  .local-course-editor .local-fields, .local-course-editor .local-file-list label { grid-template-columns: 1fr; }
  .study-shell .dashboard-section-heading .min-course-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .local-course-editor :is(.p-button, select, summary) { min-height: 44px; }
}

.local-ai-panel h2 { margin-block-start: 0; }
.local-ai-panel :is([data-book-status],.local-file-list p):empty { display: none; }
.local-ai-panel [data-book-status] { border-inline-start: 3px solid var(--accent); padding-inline-start: 12px; }
.local-book-content { max-width: 100%; }
.local-book-content > p, .local-book-section > p, .local-book-content > section > p { line-height: 1.72; max-width: 68ch; }
.local-book-content section { margin-block: 36px; border-block-start: 1px solid var(--line); padding-block-start: 16px; }
.local-book-content .local-book-idea, .local-book-intro { font-size: 1.09em; }
.local-book-content .local-book-label { color: var(--muted); font-size: .88em; margin-block: 16px; }
.local-book-figure,
.local-book-example,
.local-book-mistake {
  margin: 20px 0;
  padding: clamp(12px,2.4vw,24px);
  border: 1px solid var(--line);
  border-radius: var(--surface-radius);
  background: var(--study-nav);
}
.local-book-figure { break-inside: avoid; scroll-margin-block-start: calc(var(--study-header,64px) + 12px); }
.local-registered-course .platform-brand small { white-space: nowrap; }
.local-book-section h2 { margin-block-start: 0; }
.local-book-figure-button { display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; background: transparent; }
.local-book-figure-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.local-book-figure-button img { display: block; inline-size: 100%; block-size: auto; border-radius: 6px; background: var(--paper); }
.local-book-figure figcaption { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 10px; color: var(--muted); }
.local-book-figure p:last-child { margin-block-end: 0; }
.local-book-example, .local-book-mistake { border-inline-start: 3px solid var(--accent); }
.local-book-example h3, .local-book-mistake h3 { margin-block-start: 0; }
.local-book-review { border-inline-start: 3px solid var(--accent); padding-inline-start: 10px; }
.local-book-dialog { width: min(94vw,1120px); max-height: 92dvh; overflow: auto; padding: 12px; }
.local-book-dialog form { display: flex; justify-content: flex-end; padding-block-end: 8px; }
.local-book-dialog img { display: block; width: 100%; height: auto; }
.local-book-content :is(p,li) { overflow-wrap: anywhere; }
.local-book-content math[display="block"] { overflow-x: auto; max-width: 100%; }

.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%; }

.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)); }

.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; }

.exam-part-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 12px;
  margin-block: 12px;
}
.exam-part-list > div {
  padding-inline-start: 12px;
  border-inline-start: 2px solid currentColor;
  min-width: 0;
}
.exam-part-list h3 { margin: 0 0 4px; font-size: 1rem; }
.exam-part-list p { margin: 0; }
.exam-part-list .archive-questions { margin-top: 6px; }
.exam-format-form .math-label { max-width: 28rem; }

.course-picker.study-shell.studio-start {
  background:
    radial-gradient(ellipse at 4% 2%, light-dark(#eee0fc,#332444) 0%, transparent 36%),
    radial-gradient(ellipse at 98% 24%, light-dark(#e0f0ef,#223b43) 0%, transparent 38%),
    var(--studio-canvas);
}
.course-picker.study-shell.studio-start :is(.platform-bar > div,.platform-start.study-dashboard) { max-width: 1330px; }
.course-picker.study-shell.studio-start .platform-start.study-dashboard { padding-top: clamp(24px,4vw,48px); }
.study-dashboard {
  --dashboard-line: light-dark(#d5d0dc,#4c465b);
  --dashboard-surface: light-dark(#fffcf8,#262331);
  --dashboard-link: light-dark(#403674,#dfd4ff);
  --dashboard-gap: clamp(16px,2.1vw,28px);
}
.study-dashboard :is(section, main)[id], #studieoversikt { scroll-margin-top: calc(var(--study-header,72px) + 10px); }
.dashboard-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 16px;
}
.dashboard-jumps { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.dashboard-jumps a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-underline-offset: .22em;
  color: var(--dashboard-link);
  font-size: .9rem;
  font-weight: 640;
}
.dashboard-lower {
  display: grid;
  grid-template-columns: minmax(0,1.3fr) minmax(0,1fr);
  gap: var(--dashboard-gap);
}
.dashboard-focus {
  --focus-glow: light-dark(#ddd3fa,#58427b);
  --focus-text: light-dark(#2d2248,#f2eaff);
  --focus-muted: light-dark(#4e3e68,#e2d4f7);
  display: grid;
  align-content: space-between;
  justify-items: start;
  gap: 20px;
  min-width: 0;
  padding: clamp(16px,2.4vw,28px);
  border: 1px solid var(--dashboard-line);
  border-radius: 14px;
  color: var(--focus-text);
  background:
    radial-gradient(ellipse at 93% 15%, var(--focus-glow), transparent 67%),
    var(--dashboard-surface);
}
.dashboard-focus[data-course="BB1160"] {
  --focus-glow: light-dark(#f7cbbb,#693e4d);
  --focus-text: light-dark(#3e2732,#fff2ef);
  --focus-muted: light-dark(#634450,#f2d1d1);
}
.dashboard-focus[data-course="SF1625"] { --focus-glow: light-dark(#cfd7ff,#3c477e); }
.dashboard-focus[hidden] { display: none; }
.dashboard-focus[data-study-resume] {
  border-inline-start: 4px solid var(--accent);
}
.dashboard-resume-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 750;
  color: var(--focus-text);
}
.dashboard-focus h2 {
  margin: 0;
  max-width: 30ch;
  font-size: clamp(1.42rem,2.75vw,2.16rem);
  line-height: 1.15;
  letter-spacing: -.034em;
  overflow-wrap: anywhere;
}
.dashboard-focus p { max-width: 50ch; margin: 8px 0 0; color: var(--focus-muted); }
.dashboard-focus .dashboard-eyebrow { margin: 0 0 8px; font-size: .875rem; font-weight: 650; }
.dashboard-focus[data-study-resume] .dashboard-eyebrow { margin: 7px 0 0; }
.dashboard-focus .dashboard-eyebrow:empty { display: none; }
.dashboard-focus .p-button { min-height: 42px; }
.dashboard-snapshot, .dashboard-panel {
  min-width: 0;
  padding: clamp(16px,2.1vw,24px);
  border: 1px solid var(--dashboard-line);
  border-radius: 14px;
  background: var(--dashboard-surface);
}
.dashboard-history { padding-block: 0 12px; }
.dashboard-history:not([open]) { padding-bottom: 0; }
.dashboard-history > summary { cursor: pointer; min-height: 48px; padding-block: 11px; font-weight: 720; }
.dashboard-history .dashboard-snapshot { margin-bottom: 12px; }
.dashboard-snapshot h2, .dashboard-panel h2, .dashboard-section-heading h2 {
  margin: 0;
  line-height: 1.2;
  font-size: clamp(1.16rem,2vw,1.55rem);
  letter-spacing: -.023em;
}
.dashboard-snapshot[hidden], .dashboard-metrics > [hidden], .dashboard-filters[hidden],
.dashboard-empty-link[hidden] { display: none; }
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  margin-top: 12px;
}
.dashboard-metrics > * {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--dashboard-line);
  border-radius: 7px;
  color: inherit;
}
.dashboard-metrics { gap: 7px; }
.dashboard-metrics strong { color: var(--studio-ink); line-height: 1; font-size: 1.55rem; font-variant-numeric: tabular-nums; }
.dashboard-metrics span span, .dashboard-metrics a span { color: var(--studio-muted); font-size: .875rem; }
.dashboard-metrics a { text-decoration: none; }
.dashboard-metrics a span { text-decoration: underline; text-decoration-color: var(--dashboard-link); text-underline-offset: .25em; }
.dashboard-metrics a:hover { background: color-mix(in srgb,var(--dashboard-link) 8%,transparent); }
.dashboard-courses { margin-bottom: var(--dashboard-gap); }
.dashboard-guide { margin-bottom: var(--dashboard-gap); padding-block: 0; }
.dashboard-guide summary { cursor: pointer; min-height: 48px; padding-block: 11px; font-weight: 720; }
.dashboard-study-order {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,16rem),1fr));
  gap: 16px 30px;
  margin: 0 0 17px;
  padding-inline-start: 20px;
}
.dashboard-study-order li { padding-inline-start: 3px; }
.dashboard-study-order li::marker { color: var(--dashboard-link); font-weight: 700; }
.dashboard-study-order p { margin: 4px 0 0; color: var(--studio-muted); max-width: 49ch; }
.dashboard-metrics [data-dashboard-zero] strong { font-size: 1rem; line-height: 1.2; }
.dashboard-course-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: var(--dashboard-gap);
}
.course-picker.study-shell.studio-start .study-dashboard .studio-course {
  grid-template-areas: "art" "copy";
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: clamp(84px,11vw,134px) 1fr;
  align-items: stretch;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--studio-trim,var(--dashboard-line));
  border-radius: 14px;
  background: var(--studio-tint,var(--dashboard-surface));
}
.course-picker.study-shell.studio-start .study-dashboard .registry-course { grid-template: "copy" 1fr / minmax(0,1fr); min-height: auto; }
.studio-start .study-dashboard .studio-course .studio-cover { border-radius: 0; }
.studio-start .study-dashboard .biology .studio-cover { background-position: center 42%; }
.studio-start .study-dashboard .mathematics .studio-cover { background-position: center 61%; }
.studio-start .study-dashboard .studio-course-copy { padding: clamp(14px,2vw,24px); }
.study-dashboard .studio-course h3 a { justify-content: start; min-height: 32px; width: fit-content; }
.study-dashboard .studio-course h3 { margin-bottom: 5px; }
.dashboard-course-intro { color: var(--studio-muted); margin: 0; font-size: .94rem; line-height: 1.45; }
.study-dashboard .studio-inline { gap: 3px 14px; margin-top: 12px; }
.study-dashboard .studio-inline a { display: inline-flex; min-height: 36px; align-items: center; font-size: .875rem; }
.dashboard-lower { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); align-items: start; }
.dashboard-filters {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px 12px;
  margin-top: 12px;
}
.dashboard-filters label {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: .875rem;
  font-weight: 650;
}
.dashboard-filters select { width: 100%; min-width: 0; min-height: 42px; padding: 4px 6px; font-size: .875rem; }
.dashboard-status { color: var(--studio-muted); font-size: .875rem; margin: 12px 0 0; }
.dashboard-empty-link { display: inline-flex; min-height: 44px; align-items: center; }
.dashboard-panel .dashboard-list { list-style: none; margin: 12px 0 0; padding: 0; }
.dashboard-panel .dashboard-list:empty { display: none; }
.dashboard-panel .dashboard-activity-row, .dashboard-bookmark-row {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 0;
  padding: 10px 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--dashboard-line);
  border-radius: 0;
  box-shadow: none;
}
.dashboard-bookmark-row { align-items: start; justify-content: start; gap: 6px 10px; }
.dashboard-row-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 7px; color: var(--studio-muted); margin: 0; font-size: .875rem; }
.dashboard-course-label {
  align-self: baseline;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--dashboard-link);
  background: light-dark(#eae1f7,#46365d);
  font: 650 .77rem/1.5 var(--studio-mono);
}
.dashboard-course-label[data-course="BB1160"] { color: light-dark(#742e27,#ffdad2); background: light-dark(#f8e0db,#593a42); }
.dashboard-course-label[data-course="SF1625"] { color: light-dark(#393275,#e3e1ff); background: light-dark(#e7e5fb,#41406c); }
.dashboard-row-link { font-weight: 650; color: var(--dashboard-link); overflow-wrap: anywhere; text-underline-offset: .22em; }
.dashboard-activity-row time { flex: 0 0 auto; color: var(--studio-muted); font-size: .875rem; }
.dashboard-panel [data-dashboard-more] { margin-top: 10px; }
.dashboard-panel [data-dashboard-more][hidden] { display: none; }
.dashboard-footer { margin-top: 22px; color: var(--studio-muted); font-size: .875rem; }
.dashboard-storage p { max-width: 65ch; margin: 4px 0 10px; }
.dashboard-storage summary { cursor: pointer; min-height: 44px; padding-block: 10px; font-weight: 700; }

@media (max-width: 780px) {
  .dashboard-lower, .dashboard-course-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 480px) {
  .dashboard-panel .dashboard-activity-row { flex-direction: column; align-items: start; }
  .dashboard-section-heading { align-items: center; gap: 8px; }
}

.study-dashboard .dashboard-focus {
  border-radius: 20px;
  padding: clamp(20px,4vw,48px);
}
.dashboard-focus .dashboard-kicker {
  margin: 0 0 10px;
  font-size: .9rem;
  font-weight: 700;
}
.dashboard-empty {
  margin-bottom: var(--dashboard-gap);
  grid-template-columns: minmax(0,1.42fr) minmax(0,1fr);
  gap: clamp(20px,5vw,70px);
  align-items: center;
  background:
    radial-gradient(ellipse at 91% 9%, light-dark(#cfc2f4,#4d3d74), transparent 68%),
    radial-gradient(ellipse at 8% 95%, light-dark(#f6e1de,#53313e), transparent 64%),
    var(--dashboard-surface);
}
.dashboard-intro-copy h2, .dashboard-plan-shelf h1 {
  margin: 0;
  max-width: 17ch;
  font-size: clamp(1.7rem,3.8vw,3rem);
  letter-spacing: -.065em;
  line-height: 1.04;
  text-wrap: balance;
}
.dashboard-first-actions, .dashboard-plan-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.dashboard-first-actions .p-button, .dashboard-plan-actions .p-button { min-height: 44px; }
.dashboard-test-modes { display: grid; gap: 8px; max-width: 46ch; margin: 14px 0 0; }
.dashboard-test-modes dt { font-weight: 700; }
.dashboard-test-modes dd { margin: 1px 0 0; color: var(--focus-muted); }
.dashboard-site-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: var(--dashboard-gap);
  padding: clamp(16px,2.4vw,24px);
  border: 1px solid var(--dashboard-line);
  border-radius: 14px;
  background: var(--dashboard-surface);
  color: var(--studio-ink);
}
.dashboard-site-intro h1 { font-size: clamp(1.9rem,4vw,3.2rem); }
.dashboard-site-intro h2 { font-size: 1.15rem; }
.dashboard-site-intro .dashboard-site-purpose { margin-top: 6px; font-weight: 650; }
.dashboard-site-intro [data-site-intro] { max-width: 68ch; margin-top: 6px; color: var(--studio-muted); }
.dashboard-site-intro .p-button { min-height: 44px; }
.study-dashboard:not(.dashboard-has-plan,.dashboard-has-resume) .dashboard-site-intro h2,
:is(.dashboard-has-plan,.dashboard-has-resume) .dashboard-site-intro h1 { display: none; }
.dashboard-journey-start { margin-top: 18px; border-top: 1px solid var(--dashboard-line); padding-top: 12px; }
.dashboard-journey-start p { margin: 3px 0 0; font-size: .9rem; }
.dashboard-journey-start a { display: inline-flex; align-items: center; min-height: 44px; margin-inline-end: 14px; font-size: .9rem; }
.course-start-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.course-start-actions a { min-height: 44px; }
.dashboard-example {
  min-width: 0;
  padding: clamp(16px,2.4vw,28px);
  border: 1px solid var(--dashboard-line);
  border-radius: 16px;
  background: light-dark(#fbf8ff,#2b253e);
  box-shadow: 0 16px 30px light-dark(#37215d17,#19102460);
}
.dashboard-example .dashboard-example-label {
  margin: 0 0 8px;
  color: var(--focus-muted);
  font-size: .9rem;
  font-weight: 720;
}
.dashboard-example h2 { font-size: clamp(1.35rem,2.7vw,2.15rem); }
.dashboard-example ol {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.dashboard-example li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 7px 0;
  border-top: 1px solid var(--dashboard-line);
}
.dashboard-example li strong { white-space: nowrap; color: var(--focus-muted); font-size: .875rem; }
.dashboard-example details { margin-top: 8px; border-top: 1px solid var(--dashboard-line); }
.dashboard-example summary { min-height: 44px; padding-block: 10px; cursor: pointer; font-weight: 700; }
.course-start-meta > span,
.course-start-meta > strong { display: block; }
.study-dashboard .dashboard-resume-label {
  margin: 0 0 10px;
  font-size: clamp(1.7rem,3vw,2.8rem);
  line-height: 1.1;
  letter-spacing: -.046em;
}
.dashboard-focus[data-study-resume] { margin-bottom: var(--dashboard-gap); }
.dashboard-plan-shelf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: clamp(16px,3vw,32px);
  margin-bottom: var(--dashboard-gap);
  border: 1px solid var(--dashboard-line);
  border-radius: 18px;
  background: light-dark(#ede5fc,#392d4e);
  color: var(--studio-ink);
}
.dashboard-plan-shelf[hidden], :is(.dashboard-has-plan,.dashboard-has-resume) .dashboard-empty,
.dashboard-has-resume .dashboard-plan-shelf h1, .study-dashboard:not(.dashboard-has-resume) .dashboard-plan-shelf h2,
.dashboard-plan-actions [hidden] { display: none; }
.dashboard-plan-shelf h1 { font-size: clamp(1.9rem,4.6vw,3.8rem); max-width: 24ch; }
.dashboard-plan-shelf h2, .dashboard-plan-shelf p { margin: 0; }
.dashboard-plan-shelf p { color: var(--studio-muted); margin-top: 4px; }
.dashboard-plan-shelf [data-plan-evidence] { font-weight: 650; color: var(--studio-ink); }
.dashboard-plan-shelf .dashboard-next-label {
  margin: 0 0 8px;
  color: var(--studio-ink);
  font-weight: 700;
}
.dashboard-plan-actions { margin-top: 0; }
.dashboard-last-pass { flex-basis: 100%; padding-top: 8px; border-top: 1px solid var(--dashboard-line); }
.dashboard-plan-shelf[data-course="BB1160"] { background: light-dark(#fae9e3,#483138); }
.dashboard-plan-shelf[data-course="SF1625"] { background: light-dark(#ececff,#333355); }
.course-start-meta { margin: 8px 0 16px; color: var(--studio-muted); }
.course-start-meta strong { margin-bottom: 4px; color: var(--studio-ink); font-size: .9rem; }
.course-shortcuts { margin-top: 12px; border-top: 1px solid var(--dashboard-line); }
.course-shortcuts summary { cursor: pointer; min-height: 44px; padding-block: 10px; font-weight: 650; color: var(--studio-ink); }
.study-dashboard .course-shortcuts .studio-inline { margin-top: 0; }
.study-dashboard .course-start-button { min-height: 44px; }
.studio-start .biology .course-start-button {
  --accent: light-dark(#7d302e,#ffb5a3);
  --accent-deep: light-dark(#692627,#ffc9ba);
  --on-accent: light-dark(#fff9f6,#3d1d25);
}
.studio-start .mathematics .course-start-button {
  --accent: light-dark(#403c98,#bebfff);
  --accent-deep: light-dark(#342c80,#d1d1ff);
  --on-accent: light-dark(#fff,#21184f);
}

.start-diagnosis {
  --diagnosis-accent: light-dark(#514394,#c3afff);
  --accent: var(--diagnosis-accent);
  --accent-deep: color-mix(in srgb,var(--diagnosis-accent) 87%,var(--dashboard-surface));
  --on-accent: light-dark(#fff,#201731);
  width: min(45rem,calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: clamp(16px,3.5vw,32px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--dashboard-line);
  border-radius: 20px;
  color: var(--studio-ink);
  background: var(--dashboard-surface);
  box-shadow: 0 20px 70px #17112444;
}
.start-diagnosis::backdrop { background: #161223a8; }
.start-diagnosis[data-course="BB1160"] { --diagnosis-accent: light-dark(#803b39,#ffbaa9); }
.start-diagnosis[data-course="SF1625"] { --diagnosis-accent: light-dark(#3e3a8b,#bdbeff); }
.start-diagnosis header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px 16px;
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  padding-bottom: 6px;
  background: var(--dashboard-surface);
}
.start-diagnosis h2 { margin: 2px 0 8px; font-size: clamp(1.35rem,4vw,1.9rem); line-height: 1.13; }
.start-diagnosis h3 { margin: 16px 0 6px; font-size: 1.1rem; line-height: 1.22; }
.start-diagnosis :is(.p-button, summary) { min-height: 44px; }
.start-diagnosis :focus-visible { outline: 2px solid var(--diagnosis-accent); outline-offset: 3px; }
.diagnosis-position { margin: 6px 0; color: var(--diagnosis-accent); font-weight: 700; font-size: .92rem; }
.diagnosis-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap: 12px; }
.diagnosis-choice { display: flex; flex-direction: column; align-items: start; padding: 14px; border: 1px solid var(--dashboard-line); border-radius: 12px; }
.diagnosis-choice:first-child { border-color: var(--diagnosis-accent); }
.diagnosis-choice h3 { margin-top: 0; }
.diagnosis-choice > p:not(.diagnosis-position) { margin-top: 0; flex: 1; }
.diagnosis-choice > button + button { margin-top: 8px; }
.diagnosis-coverage { margin-top: 6px; font-size: .9rem; }
.diagnosis-coverage summary { cursor: pointer; padding-block: 10px; }
.diagnosis-coverage ul { margin: 0 0 4px; padding-inline-start: 20px; }
.start-diagnosis progress { display: block; inline-size: 100%; block-size: 8px; accent-color: var(--diagnosis-accent); margin: 0 0 18px; }
.diagnosis-form fieldset { display: grid; min-inline-size: 0; gap: 8px; padding: 0; margin: 0; border: 0; }
.diagnosis-form legend { font-weight: 700; max-width: 100%; padding: 0; margin: 0 0 10px; overflow-wrap: anywhere; }
.diagnosis-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--dashboard-line);
  border-radius: 10px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.diagnosis-option input { flex: none; accent-color: var(--diagnosis-accent); }
.diagnosis-option:has(:checked) {
  border-color: var(--diagnosis-accent);
  background: color-mix(in srgb,var(--diagnosis-accent) 11%,var(--dashboard-surface));
}
.diagnosis-form .study-certainty {
  display: flex;
  margin-top: 12px;
}
.diagnosis-form .study-certainty legend { margin-bottom: 0; }
.diagnosis-form .study-certainty input { accent-color: var(--diagnosis-accent); }
.diagnosis-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.diagnosis-actions .primary { margin-inline-start: auto; }
.diagnosis-note { color: var(--studio-muted); font-size: .91rem; margin-block: 10px; }
.diagnosis-save { color: var(--diagnosis-accent); margin-block: 12px 0; font-size: .91rem; }
.diagnosis-save:empty { margin: 0; }
.diagnosis-focus {
  border: 1px solid var(--dashboard-line);
  border-inline-start: 4px solid var(--diagnosis-accent);
  padding: 12px clamp(12px,2vw,20px);
  border-radius: 12px;
  background: color-mix(in srgb,var(--diagnosis-accent) 7%,var(--dashboard-surface));
}
.diagnosis-focus h3 { font-size: 1.26rem; margin-top: 0; }
.diagnosis-focus p { margin: 0; color: var(--studio-muted); }
.diagnosis-steps, .diagnosis-areas { list-style: none; padding: 0; margin: 10px 0 0; }
.diagnosis-steps li {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding-block: 8px;
  border-top: 1px solid var(--dashboard-line);
}
.diagnosis-steps li > div { grid-column: 2; }
.diagnosis-steps li[aria-current="step"] > div > strong { color: var(--diagnosis-accent); }
.diagnosis-steps p { font-size: .9rem; }
.diagnosis-duration { align-self: start; color: var(--diagnosis-accent); font-weight: 700; white-space: nowrap; font-size: .875rem; }
.diagnosis-plan-markers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.diagnosis-plan-markers .diagnosis-note { flex-basis: 100%; margin: 0; order: 1; }
.diagnosis-recommendation {
  margin: 8px 0 16px;
  padding: clamp(16px,4vw,24px);
  border: 1px solid var(--dashboard-line);
  border-inline-start: 4px solid var(--studio-accent, currentColor);
  border-radius: 12px;
}
.diagnosis-recommendation .primary { min-height: 44px; }
.diagnosis-recommendation p { max-width: 62ch; }
.diagnosis-plan-details { margin: 0 0 16px; }
.diagnosis-plan-details[open] > summary { margin-bottom: 12px; }
.study-result-questions .p-button { margin: 4px 8px 4px 0; }
.study-feature-guide { padding: 8px 0 16px; }
.study-feature-guide dl { display: grid; gap: 12px 24px; grid-template-columns: repeat(auto-fit,minmax(min(100%,17rem),1fr)); }
.study-feature-guide dt { font-weight: 700; }
.study-feature-guide dd { margin: 4px 0 0; max-width: 52ch; }
.diagnosis-recommendation h3 { margin-top: 8px; font-size: clamp(1.2rem,4vw,1.55rem); }
.diagnosis-recommendation > .p-button { margin-top: 6px; }
.diagnosis-summary { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit,minmax(min(100%,11rem),1fr)); margin: 0 0 16px; }
.diagnosis-summary > div { min-width: 0; border-top: 1px solid var(--dashboard-line); padding-top: 6px; }
.diagnosis-summary dt { font-weight: 700; }
.diagnosis-summary dd { margin: 4px 0 0; color: var(--studio-muted); overflow-wrap: anywhere; }
.start-diagnosis [data-study-recall] { scroll-margin-top: 80px; }
.diagnosis-follow-up { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--dashboard-line); }
.diagnosis-follow-up .diagnosis-actions { margin-top: 10px; }
.diagnosis-comparison { padding-block: 12px; margin-block: 12px; border-block: 1px solid var(--dashboard-line); }
.diagnosis-comparison h3 { margin: 0 0 4px; }
.diagnosis-comparison ul { margin-block: 8px 0; }
.diagnosis-areas li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding-block: 5px;
  border-top: 1px solid var(--dashboard-line);
  font-size: .94rem;
}
.diagnosis-areas li > div:first-child { flex: 1 1 17rem; min-width: 0; }
.diagnosis-area-score { display: flex; align-items: start; flex-wrap: wrap; gap: 4px 8px; }
.diagnosis-area-status {
  padding: 2px 6px; border-radius: 5px;
  background: light-dark(#eeeef0,#323741); color: light-dark(#424955,#e4e9f2);
}
.diagnosis-area-status[data-area-status="stable"] { background: light-dark(#dff1e8,#214239); color: light-dark(#164637,#c4f4dc); }
.diagnosis-area-status[data-area-status="review"] { background: light-dark(#fff0cc,#483717); color: light-dark(#67460b,#ffe0a2); }
.diagnosis-area-status[data-area-status="gap"] { background: light-dark(#fae3e3,#522a31); color: light-dark(#772631,#ffd4da); }
.diagnosis-area-links { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-block: 6px; }
.diagnosis-area-links a { min-height: 44px; align-content: center; }
.diagnosis-feedback { margin-block: 12px; border-block: 1px solid var(--dashboard-line); }
.diagnosis-feedback summary { cursor: pointer; padding-block: 9px; font-weight: 650; }
.diagnosis-feedback li { margin-bottom: 12px; }
.diagnosis-feedback p { margin: 4px 0; }
.diagnosis-priorities:empty { display: none; }
.diagnosis-priorities p { margin: 8px 0; }
.diagnosis-areas li p { margin: 2px 0 0; color: var(--studio-muted); overflow-wrap: anywhere; }
.diagnosis-focus .diagnosis-practice-evidence { margin: 8px 0; font-weight: 650; color: var(--diagnosis-accent); }
.diagnosis-feedback { overflow-wrap: anywhere; }

@media (max-width: 680px) {
  .dashboard-empty { grid-template-columns: minmax(0,1fr); }
  .dashboard-example { padding: 14px; }
}
@media (max-width: 370px) {
  .dashboard-first-actions { display: grid; }
}
@media (max-width: 460px) {
  .diagnosis-steps li { grid-template-columns: auto minmax(0,1fr); }
  .diagnosis-steps .p-button { grid-column: 2; justify-self: start; }
  .diagnosis-actions .primary { margin-inline-start: 0; }
}

.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); }
}
