/* A quiet, consistent frame for the task, with detail available on demand. */
.boot-splash, .auth-progress-overlay {
  background: var(--surface, #fff); color: var(--ink, #182638);
}
.boot-splash-inner { gap: 16px; }
.boot-logo-loader { width: 76px; height: 76px; margin-bottom: 4px; }
.boot-splash .boot-splash-mark { width: 60px; height: 60px; box-shadow: none; }
.boot-splash-title { font: 700 19px/1.4 var(--sans); letter-spacing: -.02em; }
.boot-progress-label { color: var(--muted); font: 400 14px/1.5 var(--sans); }
.boot-splash .boot-progress-ring { box-shadow: none; }
.boot-splash .boot-progress-ring::after { background: var(--surface); box-shadow: none; inset: 3px; }
.auth-progress-overlay .boot-progress-ring::after { display: none; }
.auth-progress-overlay .boot-progress-ring {
  background: transparent; border: 3px solid var(--line); border-top-color: var(--blue);
  animation: studio-loading 1s linear infinite;
}
.auth-progress-complete .boot-progress-ring { animation: none; border-color: var(--line); }
@keyframes studio-loading { to { transform: rotate(360deg); } }

.view:not(#practice-view) { max-width: 1184px; }
.page-heading { margin-bottom: 24px; }
.page-heading h1 { margin-bottom: 8px; text-wrap: balance; }
.page-heading p { max-width: 65ch; }
.topbar .profile-badge { border-color: transparent; background: transparent; padding-inline: 8px; }
.topbar .profile-badge:hover { border-color: var(--line); background: var(--surface-2); }
.topbar .profile-badge #profile-initials { background: var(--surface-2); color: var(--blue); }
.topbar .search-box { background: var(--paper); border-color: var(--line); }

/* Keep account actions visible and separate from family progress sharing. */
.account-sign-out { min-height: 44px; white-space: nowrap; font-weight: 700; }
.topbar .topbar-sign-out { flex: 0 0 auto; margin: 0; padding: 10px 14px; border-color: var(--blue); color: var(--blue); background: var(--surface); gap: 8px; }
.topbar .topbar-sign-out:hover { background: var(--blue-soft); }
body.theme-dark .topbar .topbar-sign-out { color: var(--ink); border-color: var(--blue); }
.topbar .topbar-sign-out svg { width: 17px; height: 17px; }
.settings-account-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-color: var(--blue); }
.settings-account-details { min-width: 0; }
.settings-account-details p { margin-bottom: 0; overflow-wrap: anywhere; }
.settings-account-card .settings-actions { margin: 0; flex: 0 0 auto; }
.settings-card h2 { font: 700 18px/1.3 var(--sans); letter-spacing: -.015em; }
.book-toc-panel .panel-header, .book-mobile-toolbar { background: var(--surface); }
.book-mobile-intro { background: var(--blue-soft); color: var(--ink); font-weight: 600; }
.book-mobile-intro svg { color: var(--blue); }
.book-mobile-toolbar { padding: 16px; box-shadow: none; }
.book-page-controls :is(.button, .text-input) { min-height: 44px; }
.mobile-pdf-stage { background: var(--surface-2); box-shadow: none; }
@media (max-width: 420px) {
  .book-mobile-toolbar { padding: 12px; }
  .book-page-controls { gap: 6px; }
  .book-page-controls .button { padding-inline: 8px; }
  .book-page-controls .text-input { width: 50px; }
}
@media (max-width: 700px) {
  body .topbar { gap: 8px; padding-inline: 12px; }
  .topbar-context { flex: 1 1 auto; min-width: 0; }
  .topbar #command-palette-button { display: none; }
  .topbar .search-box { display: none; }
  .topbar .topbar-sign-out { padding-inline: 12px; font-size: 14px; }
  .topbar:has(.focus-chip:not([hidden])) { flex-wrap: wrap; padding-block: 8px; row-gap: 6px; }
  .topbar .focus-chip { order: 1; flex: 1 0 100%; justify-content: center; }
  .settings-account-card { align-items: stretch; flex-direction: column; gap: 16px; }
  .settings-account-card .settings-actions { flex: initial; }
}
.question-panel, .panel { box-shadow: 0 2px 8px rgba(20, 36, 58, .025); }
.choice { border-color: var(--line); background: var(--surface); }
.choice:hover { border-color: var(--blue); background: var(--surface-2); }
.choice.selected { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }

.home-quiet { gap: 24px; }
.home-quiet-head { margin-bottom: 0; }
.home-quiet-head h1 { margin: 8px 0; font-size: clamp(28px, 3vw, 36px); }
.dashboard-greeting { color: var(--muted); font-size: 14px; font-weight: 500; }
.home-strip { padding: 18px 22px; margin-bottom: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.home-strip-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); width: 100%; gap: clamp(8px, 2.5vw, 24px); }
.home-strip-stats > div { min-width: 0; padding: 0; }
.home-strip-stats > div + div { border-inline-start: 1px solid var(--line); padding-inline-start: clamp(8px, 2.5vw, 24px); }
.home-strip-stats strong { font-size: 30px; color: var(--ink); font-variant-numeric: tabular-nums; }
.dashboard-study-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 24px; margin-bottom: 0; }
.next-best { display: flex; flex-direction: column; align-items: start; padding: 28px; margin: 0; border: 1px solid var(--line); border-radius: 14px; }
.next-best > small { text-transform: none; letter-spacing: 0; font-size: 13px; }
.next-best > strong { margin-top: 18px; font-size: 27px; line-height: 1.25; }
.next-best > p { margin: 12px 0 24px; max-width: 44ch; font-size: 15px; }
.next-best .next-best-actions { display: flex; flex-direction: column; align-items: start; align-self: stretch; gap: 6px; margin-top: auto; }
.next-best .next-best-actions .text-button { font-size: 12px; padding-inline: 0; color: var(--muted); }
.study-paths { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.study-path { display: grid; grid-template-columns: 38px minmax(0,1fr) 20px; gap: 4px 14px; border: 0; border-radius: 0; padding: 22px; flex: 1; align-content: center; }
.study-path + .study-path { border-top: 1px solid var(--line); }
.study-path:hover { background: var(--surface-2); box-shadow: none; }
.study-path-icon { grid-column: 1; grid-row: 1/3; background: var(--blue-soft); align-self: center; }
.study-path strong { grid-column: 2; font-size: 16px; }
.study-path-copy { grid-column: 2; font-size: 13px; line-height: 1.5; }
.study-path-link { grid-column: 3; grid-row: 1/3; align-self: center; font-size: 0; margin: 0; }
.study-path-link svg { width: 18px; height: 18px; }
.home-more { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 20px; }
.home-more > summary { padding: 18px 0; font-size: 14px; min-height: 52px; }

.adaptive-welcome { max-width: none; padding: 36px; background: linear-gradient(125deg, var(--blue-soft), var(--surface) 68%); }
.adaptive-welcome-icon { background: var(--surface); border: 1px solid var(--line); }
.adaptive-welcome h2 { margin-top: 14px; font-size: 28px; max-width: 25ch; line-height: 1.3; }
.adaptive-welcome p { max-width: 62ch; margin-block: 14px 26px; }
.adaptive-simple-actions { border-top: 1px solid var(--line); padding-top: 20px; gap: 10px; }
.adaptive-simple-actions [data-hint] { margin-right: auto; border-color: transparent; }
.adaptive-simple-actions [data-adaptive-submit]:disabled { border-color: var(--line); }
.adaptive-question-panel .question-meta .tag:not(.tei-badge) { padding: 0; background: transparent; }
.adaptive-question-panel .question-meta .tag:not(.tei-badge) + .tag:not(.tei-badge)::before { content: "·"; margin-right: 8px; color: var(--muted); }
.practice-coach > summary { min-height: 52px; }

/* Study controls: task first, display preferences on request. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.button, .icon-button, .collection-button, summary, .choice { touch-action: manipulation; }
:where(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.question-panel :where(button, input, select, textarea, summary) { scroll-margin-block: 100px 24px; }
:is(#practice-view, #adaptive-view) .question-panel .question-meta { gap: 8px 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.question-panel .question-meta .tag:not(.tei-badge):not(.bookmark-tag) { background: transparent; border: 0; padding: 0; color: var(--muted); font-size: 12px; }
.question-context { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.question-panel .question-meta .attempt-tag { margin-left: auto; }
#practice-view .question-meta .bookmark-tag:nth-child(n) { border-color: var(--line); min-height: 44px; background: transparent; }
/* One answer component across practice, adaptive, and timed tests. Keep geometry
   identical when selecting so long answers do not rewrap or move the page. */
:is(#practice-view, #adaptive-view, #tests-view) .choice-list { gap: 10px; }
:is(#practice-view, #adaptive-view, #tests-view) .choice:nth-child(n) { display: grid; grid-template-columns: 32px minmax(0,1fr); min-height: 64px; padding: 15px 18px; gap: 4px 14px; align-items: center; border: 1px solid var(--control-line, var(--line)); border-radius: 10px; background: var(--surface); box-shadow: none; transform: none; }
:is(#practice-view, #adaptive-view, #tests-view) .choice:nth-child(n):hover:not(:disabled) { border-color: var(--blue); background: var(--surface-2); }
:is(#practice-view, #adaptive-view, #tests-view) .choice:nth-child(n).selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
:is(#practice-view, #adaptive-view, #tests-view) .choice .choice-label { display: grid; place-items: center; grid-column: 1; grid-row: 1; width: 32px; height: 32px; margin: 0; padding: 0; border: 1px solid var(--muted); border-radius: 50%; color: var(--ink); background: transparent; font: 650 13px/1 var(--sans); text-align: center; letter-spacing: 0; }
:is(#practice-view, #adaptive-view, #tests-view) .choice.selected .choice-label { color: #fff; background: var(--blue); border-color: var(--blue); }
body.theme-dark :is(#practice-view, #adaptive-view, #tests-view) .choice.selected:not(.correct):not(.incorrect) .choice-label { color: #14243a; }
:is(#practice-view, #adaptive-view, #tests-view) .choice .choice-value { grid-column: 2; min-width: 0; font-size: max(16px, calc(var(--question-size) - 5px)); line-height: 1.6; overflow-wrap: anywhere; }
:is(#practice-view, #adaptive-view, #tests-view) .choice .choice-result { grid-column: 2; min-width: 0; margin: 0; text-align: left; font: 600 12px/1.4 var(--sans); }
:is(#practice-view, #adaptive-view, #tests-view) .choice:nth-child(n).correct { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
:is(#practice-view, #adaptive-view, #tests-view) .choice.correct .choice-label { color: var(--green); background: var(--surface); border-color: var(--green); }
:is(#practice-view, #adaptive-view, #tests-view) .choice:nth-child(n).incorrect { opacity: 1; border-color: var(--coral); background: var(--coral-soft); box-shadow: none; }
:is(#practice-view, #adaptive-view, #tests-view) .choice.incorrect .choice-label { color: var(--coral); background: var(--surface); border-color: var(--coral); }
:is(#practice-view, #adaptive-view, #tests-view) .choice.eliminated::after { display: none; }
:is(#practice-view, #adaptive-view, #tests-view) .choice.eliminated .choice-value { text-decoration: line-through; text-decoration-thickness: 1px; }
:is(#practice-view, #adaptive-view) .question-stem { max-width: 72ch; }
:is(#practice-view, #adaptive-view) .tei-multi-option { min-width: 0; overflow-wrap: anywhere; transform: none; }
:is(#practice-view, #adaptive-view) .tei-multi-option::before { display: grid; place-items: center; line-height: 1; }
/* Keep prose and inline math in one text flow beside the checkbox. */
.tei-multi-option > .tei-multi-label { display: block; flex: 1 1 0%; min-width: 0; text-align: left; overflow-wrap: normal; word-break: normal; }
.question-feedback { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 14px 0; margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.question-feedback > svg { flex: 0 0 18px; width: 18px; height: 18px; }
.question-feedback.correct { color: var(--green); font-weight: 600; }
.question-feedback.retry, .question-feedback.review { color: var(--ink); }
#practice-view .question-actions, #adaptive-view .question-actions { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 0; }
.question-actions .button { min-height: 46px; }
.practice-reading-bar { align-items: start; }
.reading-options { margin-left: auto; font-size: 13px; }
.reading-options > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; min-height: 44px; color: var(--muted); }
.reading-options > summary::-webkit-details-marker { display: none; }
.reading-options > summary svg { width: 16px; height: 16px; }
.reading-options[open] > summary { color: var(--ink); }
.reading-options-body { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-block: 6px 10px; }
.practice-reading-bar .question-position { padding-block: 13px; }
.practice-coach > summary { color: var(--ink); font-size: 14px; }
.practice-coach > summary span { color: var(--muted); font-size: 12px; font-weight: 400; }
.practice-coach .coach-actions [data-hint] { display: none; }
.diagnostic-intro { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; padding: clamp(22px, 5vw, 44px); border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(130deg, var(--blue-soft), var(--surface) 65%); }
.diagnostic-intro-copy { min-width: 0; }
.diagnostic-intro h1 { margin: 8px 0 12px; font: 700 clamp(28px, 4vw, 42px)/1.12 var(--sans); letter-spacing: -.035em; }
.diagnostic-intro p { max-width: 50ch; margin: 0 0 16px; color: var(--muted); line-height: 1.6; }
.diagnostic-intro .diagnostic-format { color: var(--ink); font-size: 14px; font-weight: 650; margin-bottom: 20px; }
.diagnostic-intro .classroom-share { display: inline-flex; align-items: center; gap: 8px; margin: 0; min-height: 44px; padding: 0; color: var(--blue); font-size: 14px; white-space: normal; }
.diagnostic-next { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0; margin-top: 8px; }
.diagnostic-next h2 { margin: 0 0 6px; font-size: 16px; }
.diagnostic-next p { margin: 0; color: var(--muted); font-size: 14px; }
.diagnostic-next .button { flex-shrink: 0; white-space: nowrap; }
.test-library-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; font-size: 13px; }
.test-library-bar .collection-button { min-height: 44px; display: flex; align-items: center; gap: 8px; }
.test-library-bar .collection-button > span { font-size: 11px; border-radius: 20px; padding: 2px 6px; background: var(--surface-2); color: var(--muted); }
.test-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.test-card { display: flex; flex-direction: column; align-items: start; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.test-card.in-progress { border-color: var(--blue); }
.test-card-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.test-card .test-letter { width: 44px; height: 44px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font: 700 18px var(--sans); box-shadow: none; }
.test-card h2 { margin: 0 0 4px; font-size: 19px; }
.test-card-heading p { margin: 0; font-size: 13px; color: var(--muted); }
.test-card-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.test-card-status svg { width: 16px; height: 16px; }
.test-card-status.completed { color: var(--ink); }
.test-card .button { margin-top: auto; width: 100%; justify-content: space-between; min-height: 46px; }
.test-progress { display: block; width: 100%; height: 4px; border: 0; border-radius: 4px; background: var(--surface-2); color: var(--blue); margin: -6px 0 20px; }
.test-progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 4px; }
.test-progress::-webkit-progress-value { background: var(--blue); border-radius: 4px; }
.test-progress::-moz-progress-bar { background: var(--blue); border-radius: 4px; }
.mistake-summary { background: var(--surface); box-shadow: none; border: 1px solid var(--line); border-radius: 14px; padding: 16px clamp(12px, 3vw, 22px); margin-bottom: 24px; }
#review-view .mistake-summary { grid-template-columns: repeat(3, minmax(0,1fr)); gap: clamp(8px, 2.5vw, 24px); }
#review-view .mistake-summary > div { background: transparent; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
#review-view .mistake-summary > div + div { border-inline-start: 1px solid var(--line); padding-inline-start: clamp(8px, 2.5vw, 24px); }
#review-view .mistake-summary small { font-size: 12px; text-transform: none; letter-spacing: 0; }
.mistake-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.review-heading > div { width: 100%; }
.review-title-row { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px; }
.review-options > summary { display: flex; gap: 8px; align-items: center; min-height: 44px; cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; }
.review-options > summary::-webkit-details-marker { display: none; }
.review-options > summary svg { width: 16px; height: 16px; }
.review-options .button { margin-block: 8px; }
.mistake-topic-card[class] { border: 1px solid var(--line); border-radius: 14px; box-shadow: none; background: var(--surface); }
.mistake-topic-card > header { padding: 20px; background: transparent; }
.mistake-topic-card > header strong { font-size: 18px; }
.mistake-topic-card[class] .mistake-count-pill { background: var(--surface-2); color: var(--muted); }
#review-view .mistake-item-list { padding: 0; gap: 0; }
#review-view .mistake-item { align-items: start; padding: 20px; gap: 12px; margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
#review-view .mistake-item.due { background: transparent; border-left: 3px solid var(--blue); padding-left: 17px; }
.mistake-item-copy { min-width: 0; flex: 1; }
.mistake-item-copy strong { font-size: 14px; line-height: 1.5; }
.mistake-item-copy small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mistake-preview { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 12px 0 0; font-size: 14px; line-height: 1.7; color: var(--muted); }
.mistake-preview mjx-container { font-size: 100% !important; }
.mistake-more > summary { min-height: 48px; padding: 15px 20px; color: var(--blue); cursor: pointer; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.mistake-item .button { min-height: 44px; flex-shrink: 0; }

body.public-landing-mode #dashboard-view {
  --landing-width: min(1120px, calc(100% - clamp(32px, 10vw, 140px)));
  max-width: none;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}
body.public-landing-mode:not(.high-contrast) {
  --paper: #f8f5ef;
  --surface: #fffdf8;
  --surface-2: #efe9e1;
  --ink: #282231;
  --muted: #605766;
  --line: #dcd2d7;
  --blue: #55377f;
  --blue-soft: #eee5f4;
  --green: #405742;
}
body.public-landing-mode.theme-dark:not(.high-contrast) {
  --paper: #211b28;
  --surface: #2c2333;
  --surface-2: #362b3e;
  --ink: #f8f1fa;
  --muted: #d2c3d6;
  --line: #62516b;
  --blue: #dcc0fa;
  --blue-soft: #392849;
  --green: #bbd4b7;
}
.public-nav, .public-hero-content, #dashboard-view > :is(.public-section, .public-extras), .public-footer > * { width: var(--landing-width); margin-inline: auto; }
.public-nav { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 20px; min-height: 76px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.public-brand { display: flex; align-items: center; gap: 10px; }
.public-brand strong { font-size: 15px; }
.public-nav .brand-mark { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 8px; box-shadow: none; }
.public-nav-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0 clamp(10px, 2vw, 24px); }
.public-hero .text-button, .public-about-actions .text-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: 0; padding: 0; color: var(--blue); text-underline-offset: 4px; }
.public-nav .text-button { color: var(--ink); text-decoration: none; }
.public-nav .text-button:hover { color: var(--blue); text-decoration: underline; }
#dashboard-view .public-nav .button { min-height: 44px; border-color: var(--line); }
.public-hero-content { display: grid; grid-template-columns: minmax(0, 1.23fr) minmax(0, 1fr); gap: clamp(26px, 6vw, 100px); align-items: center; padding-block: clamp(32px, 4.7vw, 72px); }
.public-intro h1 { max-width: 12ch; margin: 0 0 17px; font: 600 clamp(44px, 6.4vw, 92px)/.98 "Source Serif 4", Georgia, serif; letter-spacing: -.045em; }
.public-intro > p { max-width: 42ch; margin: 0; color: var(--muted); font-size: clamp(16px, 1.53vw, 19px); line-height: 1.55; }
.public-cta-row { align-items: center; gap: 4px 20px; margin-top: 24px; }
.public-cta-row .button { min-height: 50px; }
.public-hero-book { margin: 0; text-align: center; }
.public-hero-book > img { display: block; width: min(76%, 280px); height: auto; margin-inline: auto; border-radius: 2px 4px 4px 2px; box-shadow: 0 2px 4px #211a2824, 5px 12px 22px #211a2828; }
.public-hero-book figcaption { margin-top: 12px; }
.public-hero-book svg { width: 15px; height: 15px; }
#dashboard-view :is(.public-hero, .public-section, .public-extras, .public-footer) :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
#dashboard-view :is(.public-hero, .public-section, .public-extras) .button:not(.secondary):not(:disabled) { color: var(--surface); background: var(--blue); border-color: var(--blue); }
#dashboard-view :is(.public-hero, .public-section, .public-extras) .button:not(.secondary):not(:disabled):hover { color: var(--surface); background: color-mix(in srgb, var(--blue) 85%, var(--ink)); border-color: var(--blue); }
#dashboard-view :is(.public-hero, .public-section, .public-extras) .button.secondary:not(:disabled):hover { color: var(--blue); background: var(--blue-soft); border-color: var(--blue); }
#dashboard-view > .public-section { border-top: 1px solid var(--line); }
#dashboard-view :is(.section-heading, .studio-pricing-heading, .book-preview-copy, .public-about-copy) h2 { font: 600 clamp(27px, 3.2vw, 40px)/1.12 "Source Serif 4", Georgia, serif; letter-spacing: -.025em; }
.landing-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px clamp(24px, 4vw, 56px); margin: 0; padding-inline-start: 22px; }
.landing-steps li { padding-inline-start: 4px; }
.landing-steps li::marker { color: var(--blue); font-weight: 700; }
.landing-steps h3 { font-size: 17px; }
.landing-steps p { margin: 5px 0 0; color: var(--muted); font-size: 15px; }
.book-preview-copy p { margin: 0 0 16px; }
.book-sample-details > summary svg { width: 18px; height: 18px; float: right; }
.book-sample-details[open] > summary svg { transform: rotate(180deg); }
#dashboard-view .public-about-card { grid-template-columns: minmax(110px, 180px) minmax(0, 1fr); gap: clamp(16px, 4vw, 42px); padding: 0; border: 0; background: transparent; }
#dashboard-view .public-about-photo { border-color: var(--line); border-radius: 10px; box-shadow: none; }
#dashboard-view .public-about-actions { align-items: center; gap: 8px 18px; }
#dashboard-view .daily-warmup, #dashboard-view .daily-warmup aside { border: 1px solid var(--line); background: var(--surface); box-shadow: none; }
#dashboard-view .daily-warmup aside { background: var(--blue-soft); }
#dashboard-view .sample-report :is(.readiness-hero, .readiness-summary-grid, .parent-summary-box) { background: var(--blue-soft); border-color: var(--line); color: var(--ink); }
#dashboard-view .sample-report .readiness-hero :is(.eyebrow, strong), #dashboard-view .sample-report :is(.parent-summary-box, .study-plan-grid) strong, #dashboard-view .sample-report .readiness-topic-row em { color: var(--blue); }
#dashboard-view .sample-report .readiness-hero p { color: var(--muted); }
#dashboard-view .sample-report .readiness-topic-row em { background: var(--blue-soft); border-color: var(--line); }
#dashboard-view .public-extras :is(.tei-feature, .tool-preview-card) { border: 1px solid var(--line); box-shadow: none; background: var(--surface); }
#dashboard-view .book-page-thumb figcaption { color: var(--ink); }
body.theme-dark #dashboard-view .book-page-thumb { background: var(--surface); }
.public-section { padding-block: 36px; }
.studio-pricing.public-section { margin-block: 0; }
.public-footer .parent-trust { background: var(--surface); box-shadow: none; }
.public-section .section-heading h2 { font-size: clamp(25px, 3vw, 32px); max-width: 32ch; }
.studio-plan { border-radius: 14px; box-shadow: none; }
.plan-footer { min-height: 126px; margin-top: auto; }
.plan-footer .button { margin-top: 0; }
.plan-footer .plan-fine-print { margin: 12px 0 0; }
.plan-footer .plan-next-price { margin: 8px 0 0; }
#dashboard-view .plan-footer { min-height: 0; }
.sample-report-details, .book-sample-details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sample-report-details > summary, .book-sample-details > summary { padding: 18px 22px; min-height: 52px; cursor: pointer; color: var(--ink); font-weight: 600; font-size: 15px; }
.sample-report-details > summary { list-style: none; }
.sample-report-details > summary::-webkit-details-marker { display: none; }
.sample-report-details > summary svg { width: 18px; height: 18px; vertical-align: middle; float: right; transition: transform .15s ease; }
.sample-report-details[open] > summary svg { transform: rotate(180deg); }
.sample-report-details[open] > summary, .book-sample-details[open] > summary { border-bottom: 1px solid var(--line); }
.sample-report-details .readiness-report { border: 0; box-shadow: none; margin: 0; }
.book-sample-details .book-preview-gallery { padding: 20px; }
.steps-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.step-card { box-shadow: none; border-radius: 12px; }
.feature-proof-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.feature-proof-card { padding: 22px; }

@media (min-width: 1101px) {
  body:not(.public-landing-mode):not(.practice-focus-mode) .app-shell { grid-template-columns: 244px minmax(0,1fr); }
  .sidebar .brand strong { font-size: 16px; }
  .topbar { padding-inline: 28px; gap: 20px; }
}
@media (max-width: 900px) {
  .dashboard-study-grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .next-best { padding: 24px; }
  .study-path { padding: 18px 22px; }
  .public-nav-actions { gap: 4px; }
}
@media (max-width: 600px) {
  #command-palette-button { display: none; }
  .question-panel input, .question-panel select, .reading-options .select { font-size: 16px !important; }
  :is(#practice-view, #adaptive-view) .question-panel .question-meta { margin-bottom: 20px; padding-bottom: 14px; }
  #practice-view .question-meta { display: grid; grid-template-columns: minmax(0,1fr) 44px; gap: 10px 12px; }
  #practice-view .question-context { grid-column: 1; grid-row: 1; }
  #practice-view .question-meta .attempt-tag:nth-child(n) { margin-left: 0; grid-column: 1; grid-row: 2; }
  #practice-view .question-meta .bookmark-tag:nth-child(n) { grid-column: 2; grid-row: 1/3; align-self: start; padding: 0; width: 44px; justify-content: center; }
  :is(#practice-view, #adaptive-view, #tests-view) .choice:nth-child(n) { padding: 13px 12px; min-height: 62px; gap: 4px 12px; }
  .question-feedback { font-size: 13px; min-height: 72px; }
  .practice-reading-bar .question-position { flex-basis: auto; font-size: 12px; }
  #practice-view .question-meta .tag.attempt-tag:nth-child(n)::before { content: none; }
  .reading-options > summary { font-size: 12px; }
  .reading-options[open] { width: 100%; }
  .reading-options-body { gap: 12px; }
  .reading-options-body label { width: 100%; }
  .reading-options-body .select { flex: 1; min-height: 44px; }
  .practice-coach > summary span { display: none; }
  .diagnostic-next { align-items: start; flex-direction: column; gap: 16px; }
  .test-library-bar > .muted { display: none; }
  .test-library-bar .practice-collections { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
  .test-library-bar .collection-button { padding: 10px 6px; font-size: 12px; justify-content: center; gap: 4px; }
  .test-card-grid { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .test-card { padding: 20px; }
  #review-view .mistake-item { flex-wrap: wrap; }
  .mistake-item-copy { flex-basis: 100%; }
  .mistake-item .button { margin-left: auto; }
  .view:not(#practice-view) { padding: 24px 16px; }
  .home-quiet-head { gap: 16px; margin-bottom: 0; }
  .home-quiet-actions { width: 100%; }
  .home-quiet-actions .button { width: 100%; justify-content: center; }
  .home-strip-stats { gap: 12px; }
  .home-strip-stats small { font-size: 11px; line-height: 1.4; }
  .home-strip-stats strong { font-size: 26px; }
  .next-best > strong { font-size: 24px; }
  .next-best .next-best-actions { flex-direction: column; align-items: stretch; }
  .next-best .next-best-actions .button { justify-content: center; }
  .next-best .next-best-actions .text-button { text-align: center; }
  .adaptive-welcome { padding: 24px; }
  .adaptive-welcome h2 { font-size: 25px; }
  .adaptive-welcome .button { width: 100%; justify-content: center; }
  .adaptive-simple-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .adaptive-simple-actions [data-hint] { grid-column: 1/-1; margin: 0; justify-self: start; }
  .adaptive-simple-actions .button { justify-content: center; }
  .public-section { padding-block: 28px; }
  .plan-footer { min-height: 0; }
  .steps-grid, .feature-proof-grid { grid-template-columns: minmax(0,1fr); }
  .sample-report-details > summary, .book-sample-details > summary { padding: 16px; }
}
@media (max-width: 700px) {
  .public-nav { min-height: 0; }
  .public-hero-content { grid-template-columns: minmax(0, 1fr); }
  .public-hero-book > img { width: min(54%, 176px); }
  .public-nav-actions { column-gap: 15px; }
  .public-nav .text-button { font-size: 13px; }
  .landing-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 440px) {
  .public-nav-actions { justify-content: space-between; width: 100%; }
  .public-cta-row { display: grid; justify-items: start; }
  #dashboard-view .public-about-card { grid-template-columns: minmax(0, 1fr); }
  #dashboard-view .public-about-photo { width: 112px; }
  .diagnostic-intro-copy > .button { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-progress-overlay .boot-progress-ring { animation: none; }
  .boot-splash { transition: none; }
}

.mobile-study-nav { display: none; }
.active-practice-filters .filter-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: 500 12px/1.4 var(--sans); cursor: pointer; }
.active-practice-filters .filter-chip > span { background: transparent; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
.active-practice-filters .filter-chip svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--muted); }
.active-practice-filters .filter-chip:hover { border-color: var(--blue); }
.practice-search { grid-column: 1 / -1; display: grid; gap: 6px; }
.practice-search > label { color: var(--ink); font-size: 14px; font-weight: 650; }
.practice-search-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.practice-search-controls > .button { min-height: 44px; }
.adaptive-session-actions { display: flex; align-items: center; gap: 12px; }
#adaptive-view .adaptive-session-actions .button { width: auto; }
:is(#studio-plans, #access-plans) { scroll-margin-block-start: 84px; }
.command-palette-empty { margin: 0; padding: 0 16px 16px; }
.review-library-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.review-library-bar .collection-button { min-height: 44px; gap: 8px; }
.review-library-bar .collection-button > span { font-size: 12px; color: var(--muted); }
.review-clear-today { border: 1px solid var(--line); border-radius: 14px; padding: 28px; background: var(--surface); }
.review-clear-today h2 { font-size: 22px; margin: 0 0 12px; }
.review-clear-today p { line-height: 1.65; max-width: 55ch; margin-bottom: 20px; }
.review-context-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; background: var(--surface); margin: 0 0 20px; }
.review-context-bar > span { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.review-context-bar .text-button { font-size: 13px; min-height: 44px; display: flex; align-items: center; gap: 8px; }
.review-context-bar svg { width: 16px; height: 16px; }
@media (max-width: 768px) {
  body.has-mobile-study-nav #main-content { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .mobile-study-nav:not([hidden]) { display: flex; position: fixed; inset: auto 0 0; z-index: 60; border-top: 1px solid var(--line); background: var(--surface); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .mobile-study-nav > button { flex: 1; min-width: 0; min-height: 54px; padding: 6px 2px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font: 600 11px/1.2 var(--sans); cursor: pointer; touch-action: manipulation; }
  .mobile-study-nav > button svg { width: 20px; height: 20px; stroke-width: 1.8; }
  .mobile-study-nav > button[aria-current="page"] { color: var(--blue); background: var(--surface-2); }
  .mobile-study-nav > button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
  body.mobile-keyboard-open .mobile-study-nav, body.sidebar-open .mobile-study-nav, body.modal-open .mobile-study-nav { display: none; }
  body.has-mobile-study-nav #toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .review-heading { align-items: stretch; }
  .review-heading > .button { justify-content: center; }
  .review-context-bar { gap: 4px; padding: 8px 12px; }
  .review-clear-today { padding: 20px; }
}

/* Calendar planning is a quiet, separate workspace, with no third-party embeds. */
.planner-layout { display: grid; grid-template-columns: minmax(280px,.85fr) minmax(0,1.15fr); gap: 24px; align-items: start; }
.planner-card { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 28px; min-width: 0; }
.planner-card h2 { font: 700 21px/1.3 var(--sans); margin: 0 0 12px; letter-spacing: -.025em; }
.planner-card p { font-size: 14px; line-height: 1.65; }
.planner-form { display: grid; gap: 20px; margin-top: 24px; }
.planner-form label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; }
.planner-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.planner-form .text-input, .planner-form .select { width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; font: 400 16px/1.4 var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.planner-days { border: 0; padding: 0; margin: 0; min-width: 0; }
.planner-days legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 10px; }
.planner-days > div { display: flex; gap: 6px; flex-wrap: wrap; }
.planner-days label { position: relative; cursor: pointer; }
.planner-days input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.planner-days span { display: grid; place-items: center; min-height: 44px; min-width: 44px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); }
.planner-days input:checked + span { color: var(--blue); border-color: var(--blue); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--blue); }
.planner-days input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 3px; }
.planner-options { border-top: 1px solid var(--line); padding-top: 16px; }
.planner-options summary, .planner-import summary { cursor: pointer; font-size: 13px; font-weight: 600; min-height: 44px; padding-block: 10px; }
.planner-options label { margin-top: 12px; }
.planner-options small { color: var(--muted); font-weight: 400; }
.planner-form .planner-check { display: flex; flex-direction: row; align-items: center; min-height: 44px; gap: 10px; }
.planner-check input { width: 18px; height: 18px; accent-color: var(--blue); }
.planner-timezone, .planner-local { font-size: 12px !important; line-height: 1.6; color: var(--muted); margin: 0; }
.planner-status { font-size: 13px; color: var(--ink); margin: 0; }
.planner-status:empty { display: none; }
.planner-preview-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; justify-content: space-between; }
.planner-preview-head > span { color: var(--muted); font-size: 12px; }
.planner-sessions { list-style: none; margin: 20px 0; padding: 0; max-height: 480px; overflow-y: auto; scrollbar-gutter: stable; }
.planner-sessions li { display: flex; align-items: center; gap: 14px; padding: 17px 0; border-top: 1px solid var(--line); }
.planner-sessions li > div { display: grid; gap: 5px; min-width: 0; }
.planner-sessions strong { font-size: 14px; line-height: 1.4; }
.planner-sessions time { color: var(--muted); font-size: 12px; line-height: 1.5; }
.planner-sessions .text-button { margin-left: auto; min-height: 44px; padding: 8px; font-size: 13px; flex-shrink: 0; }
.planner-session-symbol { color: var(--blue); width: 20px; flex-shrink: 0; }
.planner-session-symbol svg { width: 18px; height: 18px; }
.planner-export { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 14px; }
.planner-export .button { min-height: 48px; font-size: 13px; }
.planner-import { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 10px; }
.planner-import p { font-size: 13px; }
.planner-empty { padding: 28px 4px; }
.planner-empty > strong { font-size: 20px; display: block; margin-block: 16px 8px; }
.planner-empty-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; color: var(--blue); background: var(--surface-2); }
.planner-recipe-list { display: grid; gap: 12px; color: var(--muted); font-size: 13px; margin-top: 24px; }
.planner-recipe-list span::before { content: "—"; margin-right: 12px; color: var(--blue); }
.planner-share { margin-top: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.planner-share > summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; padding: 20px 24px; min-height: 64px; }
.planner-share > summary > span { display: flex; gap: 12px; align-items: center; font-size: 14px; font-weight: 600; }
.planner-share > summary small { color: var(--muted); font-size: 12px; }
.planner-share > summary svg { width: 18px; height: 18px; color: var(--blue); }
.planner-share > div { padding: 0 24px 24px; }
.planner-share p { font-size: 14px; line-height: 1.7; }
.planner-share .parent-snapshot { max-height: 340px; white-space: pre-wrap; overflow: auto; overflow-wrap: anywhere; }
.planner-share .planner-status { margin-top: 14px; }
.planned-next { display: flex; align-items: center; gap: 20px; justify-content: space-between; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin: 16px 0 24px; }
.planned-next > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.planned-next small { color: var(--muted); font-size: 12px; }
.planned-next strong { font-size: 14px; }
.planned-next span { color: var(--muted); font-size: 12px; }
.planned-next .text-button { flex-shrink: 0; min-height: 44px; font-size: 13px; }
.dashboard-plan-link { margin-top: 20px; }
.dashboard-plan-link .text-button { min-height: 44px; display: flex; gap: 8px; font-size: 13px; }
@media (max-width: 1000px) { .planner-layout { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 600px) {
  .planner-layout { gap: 16px; }
  .planner-card { padding: 20px; border-radius: 12px; }
  .planner-fields { gap: 10px; }
  .planner-days > div { gap: 6px; }
  .planner-days span { min-width: 44px; }
  .planner-form > .button, .planner-export .button { width: 100%; justify-content: center; }
  .planner-sessions { max-height: none; overflow: visible; }
  .planner-sessions li { gap: 10px; }
  .planner-share > summary { padding: 18px; }
  .planner-share > summary small { display: none; }
  .planner-share > div { padding: 0 18px 18px; }
  .planned-next { padding: 12px 16px; gap: 12px; }
  .planned-next > div { display: grid; gap: 6px; }
}

/* Requested help stays one click away; completed questions have an active
   solution action instead of a disabled check button. */
.adaptive-simple-actions [data-view-hints] { margin-right: auto; border-color: transparent; }
.question-help-actions { align-items: center; justify-content: space-between; gap: 12px; }
.practice-coach .question-help-actions [data-hint] { display: inline-flex; }
.question-help-actions [data-return-answer] { margin-left: auto; min-height: 44px; }
.practice-coach .requested-hints li, .practice-coach [data-worked-solution], .question-stem { scroll-margin-block: 100px 90px; }
.practice-coach .requested-hints p, .practice-coach .solution-steps { max-width: 68ch; }
.question-feedback { min-height: 54px; }
@media (max-width: 600px) {
  .question-feedback { min-height: 58px; }
  #adaptive-view .adaptive-simple-actions.is-complete > [data-adaptive-next] { grid-row: 1; }
  .question-help-actions .button, .question-help-actions .text-button { padding-inline: 10px; font-size: 13px; }
}

/* Personal notebook: secondary tools live outside the question workspace. */
#notebook-view { max-width: 1040px; }
.notebook-tabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.notebook-tabs .collection-button { min-height: 46px; }
.notebook-tabs [aria-pressed="true"] { color: var(--blue); background: var(--blue-soft); border-color: var(--blue); }
.notebook-storage { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 16px 0 0; max-width: 78ch; }
.notebook-status { font-size: 13px; color: var(--ink); min-height: 24px; margin-block: 8px 16px; }
.notebook-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin-bottom: 18px; }
.notebook-toolbar > label:first-child { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.notebook-toolbar .select { min-width: 220px; }
.notebook-archive-toggle { display: flex; gap: 8px; align-items: center; min-height: 46px; font-size: 13px; }
.notebook-toolbar > button { margin-left: auto; }
.notebook-editor, .notebook-starters { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 22px; margin-bottom: 18px; }
.notebook-editor > summary, .notebook-starters > summary { min-height: 54px; display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 14px; font-weight: 600; list-style: none; }
.notebook-editor > summary svg { width: 18px; height: 18px; }
.notebook-editor form { display: grid; gap: 16px; padding: 8px 0 22px; }
.notebook-editor label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; }
.notebook-editor .text-input, .notebook-editor .select, .notebook-app textarea { width: 100%; min-width: 0; font-size: 16px; }
.notebook-editor textarea { resize: vertical; line-height: 1.7; }
.notebook-editor small { color: var(--muted); font-size: 12px; }
.notebook-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.notebook-starters p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.notebook-starters > div { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 20px; }
.notebook-items { display: grid; gap: 16px; }
.notebook-item, .notebook-app, .notebook-empty, .notebook-draft-notice { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; min-width: 0; }
.notebook-item-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.notebook-item-head > span { font-size: 12px; color: var(--muted); }
.notebook-item-head > div { display: flex; gap: 14px; }
.notebook-item .text-button { min-height: 44px; font-size: 13px; }
.notebook-item h2, .notebook-app h2, .notebook-empty h2 { font-size: 19px; line-height: 1.5; margin: 0 0 12px; letter-spacing: -.015em; overflow-wrap: anywhere; }
.notebook-note-body, .notebook-recall-back { font-size: 16px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch; }
.notebook-answer { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 18px; }
.notebook-answer > summary { cursor: pointer; min-height: 44px; padding-block: 10px; font-size: 14px; color: var(--blue); }
.notebook-answer > div { font-size: 16px; line-height: 1.8; padding: 14px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.notebook-empty p, .notebook-draft-notice p { color: var(--muted); line-height: 1.7; max-width: 62ch; margin-bottom: 0; }
.notebook-draft-notice { margin-bottom: 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.notebook-draft-notice p { margin: 0; }
.notebook-app-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.notebook-app-symbol { display: grid; place-items: center; width: 40px; height: 40px; color: var(--blue); background: var(--blue-soft); border-radius: 10px; margin-bottom: 18px; }
.notebook-app-symbol svg { width: 20px; height: 20px; }
.notebook-app p { font-size: 14px; line-height: 1.7; color: var(--muted); }
.notebook-app details { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 8px; }
.notebook-app summary { min-height: 44px; padding-block: 12px; font-size: 13px; cursor: pointer; }
.notebook-app details a { color: var(--blue); }
.notebook-app-note { font-size: 12px !important; margin-top: 20px; }
#quizlet-preview, #notebook-import-preview { padding-top: 16px; }
#quizlet-preview label { display: grid; gap: 10px; font-size: 13px; }
.notebook-session:not([hidden]) { border: 2px solid var(--blue); border-radius: 14px; background: var(--surface); padding: 28px; margin-top: 24px; scroll-margin-block: 96px; }
.notebook-session-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.notebook-session h2 { font-size: 23px; line-height: 1.6; margin-bottom: 24px; overflow-wrap: anywhere; }
.notebook-session .notebook-recall-back { border-top: 1px solid var(--line); padding-top: 18px; margin-bottom: 24px; }
.question-help-actions { flex-wrap: wrap; }
.question-help-actions [data-notebook-takeaway] { min-height: 44px; font-size: 13px; }
@media (max-width: 700px) {
  .notebook-app-grid { grid-template-columns: minmax(0,1fr); }
  .notebook-tabs { gap: 6px; }
  .notebook-tabs .collection-button { flex: 1; justify-content: center; font-size: 12px; gap: 6px; padding-inline: 8px; }
  .notebook-tabs svg { width: 16px; height: 16px; }
  .notebook-item, .notebook-app, .notebook-empty { padding: 20px; }
  .notebook-editor, .notebook-starters { padding-inline: 18px; }
  .notebook-toolbar .select { min-width: 0; width: 100%; }
  .notebook-toolbar > label:first-child { flex: 1; }
  .notebook-toolbar > button { width: 100%; margin: 0; justify-content: center; }
  .notebook-session:not([hidden]) { padding: 20px; }
  .notebook-session h2 { font-size: 20px; }
}

.notebook-editor > summary::after, .notebook-starters > summary::after { content: "⌄"; margin-left: auto; font-size: 18px; color: var(--muted); }
.notebook-editor[open] > summary::after, .notebook-starters[open] > summary::after { transform: rotate(180deg); }

/* Phone study layout: keep the question in reach and the controls tappable. */
@media (max-width: 760px) {
  .page-heading,
  .hero-actions {
    align-items: stretch;
  }
  .page-heading .action-cluster,
  .page-heading .hero-actions,
  .hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    gap: 8px;
  }
  .page-heading .button,
  .hero-actions .button {
    width: 100%;
    justify-content: center;
  }
  .exam-question {
    min-height: 0;
  }
  .exam-topbar {
    position: sticky;
    top: 66px;
    z-index: 8;
    display: grid;
    gap: 8px;
    margin: 0 -12px 12px;
    padding: 8px 12px 10px;
    background: color-mix(in srgb, var(--paper) 94%, white);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 18px rgba(19, 32, 51, .04);
  }
  .exam-topbar h1 {
    margin: 2px 0 0;
    font-size: 22px;
    line-height: 1.15;
  }
  .exam-topbar .exam-status {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 8px;
    align-items: center;
  }
  .exam-topbar .exam-status > span {
    grid-column: 1 / 3;
    grid-row: 1;
  }
  .exam-topbar .exam-status > strong {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    min-width: 92px;
  }
  .exam-topbar .exam-status > .button {
    grid-row: 2;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding-inline: 6px;
    justify-content: center;
    font-size: clamp(11px, 3vw, 13px);
    white-space: nowrap;
    gap: 4px;
  }
  .exam-topbar .exam-status > .button svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
  }
  .exam-layout .question-actions {
    position: sticky;
    bottom: 0;
    z-index: 7;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 16px -18px 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 96%, white);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 22px rgba(19, 32, 51, .06);
  }
  .exam-layout .question-actions [data-exit-exam] {
    display: none;
  }
  .exam-layout .question-actions .button {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    white-space: nowrap;
  }
  body.mobile-keyboard-open .exam-layout .question-actions {
    position: static;
    margin-inline: 0;
    box-shadow: none;
    background: transparent;
  }
  .question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  .question-meta .flag-tag,
  .question-meta .bookmark-tag {
    margin-left: 0;
    min-height: 36px;
  }
  .native-visual img,
  .native-visual svg,
  .tei-graph-wrap svg,
  .tei-hotspot-visual svg {
    max-width: 100%;
    max-height: min(46vh, 420px);
    height: auto;
  }
  :is(.question-stem, .choice, .diagnostic-choice) :is(mjx-container[display="true"], mjx-container.math-scroll) {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .command-palette-card,
  .app-modal-card {
    width: min(100% - 20px, 520px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
  }
}
@media (max-width: 380px) {
  .exam-topbar h1 { font-size: 20px; }
  .exam-topbar .exam-status > .button { font-size: 11px; padding-inline: 4px; }
}

/* Keep the primary response action on its own row on narrow screens. */
:is(.practice-question-actions, .adaptive-simple-actions) > .action-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
@media (max-width: 700px) {
  :is(#practice-view, #adaptive-view) :is(.practice-question-actions, .adaptive-simple-actions) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  :is(.practice-question-actions, .adaptive-simple-actions) > .button { justify-content: center; min-height: 48px; }
  :is(.practice-question-actions, .adaptive-simple-actions) > .action-cluster > .button {
    flex: 0 1 auto;
    min-height: 44px;
    padding-inline: 8px;
    border-color: transparent;
    background: transparent;
    font-size: 14px;
  }
  :is(.practice-question-actions, .adaptive-simple-actions) > .action-cluster > .button:hover { background: var(--surface-2); }
}

/* Mathematical response menus use the same layout as the original fields. */
.tei-interval-field { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 800; min-width: 0; }
.tei-coordinate-field { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tei-interval-field .tei-math-choice, .tei-coordinate-field .tei-math-choice { margin: 0; min-width: 0; width: 100%; }
.tei-interval-field .tei-math-choice > summary, .tei-coordinate-field .tei-math-choice > summary { width: 100%; }
/* Math glyph spacing follows TeX even inside uppercase UI labels. */
.question-panel mjx-container, .review-question mjx-container, .tei-answer-card mjx-container { letter-spacing: normal; word-spacing: normal; text-transform: none; }

.tei-interval-field .tei-math-option { display: flex; align-items: center; gap: .65rem; }
.tei-coordinate-entry .tei-math-options { display: grid; gap: .25rem; padding: .5rem; }
.tei-coordinate-field { flex: 1 1 0; }

/* Keep save status and its manual action together on small screens. */
.progress-save-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; width: min(calc(100% - 32px), 1124px); margin: 12px auto 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.progress-save-bar[hidden], .progress-conflict[hidden] { display: none; }
.progress-save-copy { min-width: 0; }
.progress-save-copy strong { font-size: 14px; }
.progress-save-copy p { margin: 2px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.progress-save-bar button { min-height: 44px; white-space: normal; }
.progress-save-bar > button { padding-inline: 12px; font-size: 13px; }
.progress-conflict { grid-column: 1/-1; border-top: 1px solid var(--line); padding-top: 12px; }
.progress-conflict p { margin: 0 0 12px; }
@media (max-width: 600px) {
  .progress-save-bar { padding: 8px 10px; gap: 8px; }
  .progress-conflict .action-cluster, .progress-conflict button { width: 100%; }
  .progress-conflict .action-cluster { flex-direction: column; align-items: stretch; }
}
#exam-timer, #focus-chip-time { font-variant-numeric: tabular-nums; }

/* Show the public introduction while the workspace scripts load. */
html[data-public-startup] body.auth-restoring { background: var(--paper); overflow: auto; }
html[data-public-startup] body.auth-restoring .app-shell { opacity: 1; pointer-events: auto; }
html[data-public-startup] #boot-splash { display: none; }

/* Keep diagrams on a white drawing surface in every theme. */
figure.native-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: min(100%, 640px);
  margin-inline: auto;
  padding: clamp(8px, 2vw, 16px);
  border: 1px solid #d4deeb;
  border-radius: 12px;
  background: #fff;
}
.native-visual > :is(img, svg) {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: min(64dvh, 490px);
  height: auto;
  min-height: 0;
  object-fit: contain;
}
.adaptive-inline-visual > svg { width: min(100%, 510px); }
.native-visual .diagram-expand {
  align-self: end;
  min-height: 40px;
  margin: 0;
  padding: 4px 6px;
  color: #21549b;
  text-underline-offset: 3px;
}
:is(.tei-graph-wrap, .tei-hotspot-visual, .tei-numberline-multi, .tei-interval-select) > svg {
  border-color: #d4deeb;
  background: #fff;
}
.diagram-reader { width: min(950px, calc(100vw - 20px)); padding: clamp(10px, 2vw, 20px); }
.diagram-reader-head { margin-bottom: .65rem; }
.diagram-reader-stage {
  max-height: 68dvh;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #d4deeb;
  border-radius: 8px;
  background: #fff;
}
.diagram-reader-stage > img {
  display: block;
  width: 100%;
  max-height: 67dvh;
  height: auto;
  object-fit: contain;
}
.diagram-reader-stage.zoomed > img { width: var(--diagram-zoom); max-width: none; max-height: none; }
.diagram-reader-controls { display: flex; justify-content: center; gap: .5rem; margin-top: .6rem; }
.diagram-reader-controls .button { min-width: 44px; min-height: 44px; }

body.math-exam-active :is(.topbar .search-box, #progress-save-bar, #study-music-button, #mobile-menu, #command-palette-button, #settings-topbar-button, #profile-badge, #topbar-sign-out) { display: none !important; }
body.math-exam-active .app-shell { display: block; }
body.math-exam-active #main-content { min-width: 0; }
body.math-exam-active .topbar { display: none; }
body.math-exam-active .exam-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 16px;
  margin: 0 0 16px;
  padding: 12px 0;
  background: var(--paper);
}
body.math-exam-active .exam-topbar h1 { margin: 0; font-size: clamp(18px, 2.2vw, 26px); }
body.math-exam-active .exam-status { display: flex; flex-flow: row wrap; align-items: center; gap: 6px; width: auto; }
.exam-clock { display: flex; align-items: center; gap: 4px; }
.exam-clock strong { padding: 5px 7px; border-radius: 6px; background: var(--ink); color: var(--paper); font-variant-numeric: tabular-nums; }
.exam-clock strong.urgent { background: var(--coral-soft); color: var(--coral); }
body.math-exam-active .exam-status .button {
  width: auto;
  min-height: 44px;
  padding-inline: 8px;
  font-size: 13px;
  white-space: nowrap;
}
.exam-position { white-space: nowrap; margin-inline-end: 4px; font-weight: 650; }
[data-toggle-exam-clock] svg { display: none; width: 17px; height: 17px; }
.exam-save-menu { position: relative; margin-inline-start: auto; }
.exam-save-menu > summary { display: flex; justify-content: center; list-style: none; }
.exam-save-menu > summary::-webkit-details-marker { display: none; }
.exam-save-menu > summary svg { width: 14px; height: 14px; }
.exam-save-menu[open] > summary svg { transform: rotate(180deg); }
.exam-save-actions {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  display: grid;
  gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}
.exam-save-actions .button { justify-content: flex-start; }
body.math-exam-active .question-panel :where(button, input, select, textarea, summary) { scroll-margin-top: 126px; }
@media (max-width: 740px) {
  body.math-exam-active .exam-topbar { grid-template-columns: minmax(0, 1fr); padding-block: 8px; }
  body.math-exam-active .exam-status .button { padding-inline: 6px; font-size: 12px; }
  .exam-position { margin-inline-end: 0; }
}
@media (max-width: 380px) {
  body.math-exam-active .exam-status { gap: 4px; }
  .exam-save-menu > summary { gap: 3px; }
  body.math-exam-active .exam-status [data-toggle-exam-clock][aria-expanded="true"] { width: 44px; }
  .exam-status [data-toggle-exam-clock][aria-expanded="true"] svg { display: block; }
  [data-toggle-exam-clock][aria-expanded="true"] span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media print { .exam-save-menu { display: none; } }
.social-auth-options:not([hidden]) { display: flex; flex-wrap: wrap; gap: .55rem; }
.social-auth-options small { flex-basis: 100%; }
.settings-account-card .social-auth-options { flex-basis: 100%; }
.auth-card {
  --auth-paper: #211b27;
  --auth-ink: #faf5f0;
  --auth-muted: #d0c6d1;
  --auth-line: #75677c;
  --auth-action: #f2c77c;
  width: min(100%, 540px);
  margin: 0 auto 36px;
  padding: clamp(18px, 5vw, 40px);
  border: 1px solid var(--auth-line);
  border-radius: 22px;
  background: var(--auth-paper);
  color: var(--auth-ink);
  color-scheme: dark;
}
.auth-card-header { text-align: center; }
.auth-card-header h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.13; text-wrap: balance; }
.auth-card-header p { max-width: 38ch; margin: 10px auto 0; color: var(--auth-muted); font-size: 15px; }
.auth-social { margin-top: 24px; }
.auth-social h2 { margin: 0 0 12px; color: var(--auth-muted); text-align: center; font-size: 14px; font-weight: 600; }
.auth-provider-row, .auth-provider-row .social-auth-options:not([hidden]) { display: flex; flex-wrap: wrap; justify-content: center; align-items: start; gap: 8px; }
.auth-provider-row .social-auth-options:not([hidden]) { display: contents; }
.auth-provider-row .google-sign-in-controls:has(.google-link-form) { flex-basis: 100%; }
.auth-provider-row .google-sign-in-controls:not(:has(.google-button-host)) { max-width: 100%; color: var(--auth-muted); font-size: 14px; }
.auth-provider-row .google-sign-in-controls:has(.google-button-host) { display: contents; }
.auth-provider-row .google-sign-in-controls p:not(:empty) { flex-basis: 100%; color: var(--auth-muted); }
.auth-provider-row .google-sign-in-controls p:empty { display: none; }
.provider-sign-in-button {
  position: relative;
  display: grid;
  grid-template-rows: 36px 14px;
  align-content: center;
  place-items: center;
  gap: 4px;
  flex: 0 0 62px;
  width: 62px;
  height: 64px;
  padding: 0 2px;
  border: 1px solid #e9e3ec;
  border-radius: 10px;
  background: #fff;
  color: #352d3d;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.provider-sign-in-button img { width: 22px; height: 22px; padding: 0; background: transparent; object-fit: contain; }
.google-button-host .google-provider-control { position: absolute; inset: 0; display: grid; justify-items: center; align-content: start; padding-top: 1px; }
.google-provider-control iframe { color-scheme: normal; clip-path: inset(4px 14px round 4px); }
.google-button-host .provider-sign-in-label { grid-row: 2; }
.google-button-host:focus-within { outline: 2px solid var(--auth-action); outline-offset: 3px; }
.provider-sign-in-button:hover:not(:disabled), .google-button-host:hover { background: #fff; border-color: var(--auth-action); box-shadow: 0 0 0 2px #f2c77c33; }
.provider-sign-in-button:disabled { opacity: .65; cursor: wait; }
.auth-card :focus-visible { outline: 2px solid var(--auth-action); outline-offset: 3px; }
.auth-card label { color: var(--auth-ink); font-size: 14px; }
.auth-card .text-input { background: #ffffff08; border-color: var(--auth-line); color: var(--auth-ink); min-height: 48px; }
.auth-card .consent-check { display: flex; align-items: start; gap: 8px; color: var(--auth-muted); font-size: 13px; font-weight: 400; line-height: 1.45; }
.auth-card .consent-check input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--auth-action); }
.auth-card .auth-google-consent { margin-top: 12px; }
.auth-card .auth-divider { margin: 19px 0 15px; color: var(--auth-muted); font-size: 12px; text-transform: none; letter-spacing: 0; }
.auth-card .auth-divider::before, .auth-card .auth-divider::after { background: var(--auth-line); }
.auth-card #sign-in-form { margin-top: 20px; }
.auth-card .auth-submit:not(:disabled) { min-height: 48px; margin-top: 2px; background: var(--auth-action); border-color: var(--auth-action); color: #241a17; }
.auth-card .auth-submit:not(:disabled):hover { background: #ffdc9f; border-color: #ffdc9f; }
.auth-card .auth-disclosure { margin-top: 12px; border-top: 1px solid var(--auth-line); }
.auth-card .auth-disclosure summary { min-height: 44px; padding-block: 11px; color: var(--auth-ink); font-size: 14px; font-weight: 650; cursor: pointer; }
.auth-card .auth-disclosure p { margin: 0 0 4px; color: var(--auth-muted); font-size: 13px; }
.auth-card-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin-top: 6px; }
.auth-card-footer a, .auth-card .text-button { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 0; margin: 0; color: var(--auth-action); font-size: 13px; text-underline-offset: 3px; }
.auth-card :is(.google-link-form, .auth-disclosure[open] form) { margin-block: 6px 12px; }
.classroom-share img { flex: none; }

.assignment-card { padding: clamp(16px, 3vw, 28px); margin-block-end: 16px; }
.assignment-card h2 { margin: 0 0 12px; font-size: 1.15rem; }
.assignment-form { max-width: 45rem; }
.assignment-form > button { justify-self: start; }
.assignment-form .text-input { min-inline-size: 0; }
.assignment-form label.consent-check { color: var(--text, inherit); }
.assignment-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.assignment-actions [data-assignment-timer] { font-variant-numeric: tabular-nums; }
.assignment-list, .assignment-topics { list-style: none; padding: 0; margin: 0; }
.assignment-list li { padding-block: 10px; border-block-end: 1px solid var(--line); }
.assignment-list li:last-child { border-block-end: 0; }
.assignment-list small { display: block; color: var(--muted); margin-block-start: 2px; }
.assignment-topics li { display: flex; justify-content: space-between; gap: 12px; max-width: 28rem; padding: 4px 0; }
.assignment-form fieldset { display: grid; gap: 8px; min-inline-size: 0; padding: 0; border: 0; margin: 0; }
.assignment-form .assignment-choice {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.assignment-choice:has(input:checked) { border-color: var(--accent, #2458a8); }
.assignment-choice:focus-within { outline: 2px solid var(--accent, #2458a8); outline-offset: 2px; }
.assignment-review { padding-block: 12px; border-block-end: 1px solid var(--line); }
.assignment-review summary { font-weight: 650; cursor: pointer; }
.assignment-status:empty { display: none; }
body.math-exam-active .exam-tool-button { min-height: 44px; }
body.math-exam-active .question-actions { flex-wrap: wrap; gap: .75rem; }
body.math-exam-active .question-actions > .button { min-height: 48px; }

/* Preserve the math baseline. Scroll only display math or an inline formula
   that exceeds the line. Its punctuation stays inside the same scroll box. */
mjx-container:not([display="true"]):not(.math-scroll) {
  vertical-align: baseline;
  overflow: visible;
}
:is(mjx-container[display="true"], .math-scroll) {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}
.math-scroll { margin: .35em 0; }
/* Keep punctuation and the formula on the same line. */
.math-nowrap { white-space: nowrap; }
/* Grid items default to min-width: auto and would stretch to fit an unbreakable formula. */
.solution-steps > li, .requested-hints li, .tei-answer-breakdown > li { min-width: 0; }

.retail-review-panel { margin: 20px 0; }
.retail-review-panel .panel-header small { display: block; }
.retail-review-panel h3 { margin: 22px 0 10px; font-size: 14px; }
.retail-review-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.retail-review-details p { margin: 4px 0; }
.retail-order-number { font: 600 17px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; user-select: all; }
.retail-review-flags { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; color: var(--coral); font-size: 12px; }
.retail-review-flags li { display: flex; gap: 6px; align-items: flex-start; }
.retail-review-flags svg { width: 15px; height: 15px; flex: none; }
.retail-review-status { margin: 18px 0; }
.retail-review-status strong { display: flex; gap: 8px; align-items: center; }
.retail-review-status svg { width: 16px; height: 16px; }
@media (max-width: 720px) { .retail-review-item { grid-template-columns: 1fr; } }
