/* Academic study workspace. Layout and presentation only. */
body { font-size: var(--type-body); line-height: var(--leading-body); letter-spacing: 0; }
h1, h2, h3, .lesson-title, .question-text, #cards-prompt { font-family: var(--font-reading); font-weight: var(--weight-normal); letter-spacing: -.015em; }
h1, .page-title h2 { font-size: var(--type-title); }
h2, h3 { font-size: var(--type-section); }
strong, b { font-weight: var(--weight-emphasis); }
p, li { line-height: var(--leading-body); }
button, select, input, textarea { font-family: var(--font); }
button, summary, .attach-button, .dictate-button, .field-mic, .case-back { min-height: var(--tap-target); }
.app button, .app summary, .case-focus button, .case-focus summary { min-height: var(--tap-target); min-width: var(--tap-target); }
button, a, summary, label.attach-button { transition: background-color var(--motion), color var(--motion), border-color var(--motion); }
button, .primary, .secondary, .quiet-button, .chip { font-weight: var(--weight-emphasis); }
.primary, .primary.big, .primary.small, .secondary, .quiet-button, .chip { border-radius: var(--radius-sm); min-height: var(--tap-target); white-space: normal; }
.primary.big { min-height: 52px; padding: var(--space-2) var(--space-3); }
.primary { background: var(--primary); color: var(--primary-ink); box-shadow: none; }
.primary:hover:not(:disabled) { background: var(--primary-hover); }
.secondary, .quiet-button, .inline-button { background: transparent; color: var(--ink); border-color: transparent; box-shadow: none; text-decoration: none; }
.secondary:hover:not(:disabled), .quiet-button:hover:not(:disabled), .inline-button:hover:not(:disabled), summary:hover { background: var(--surface-2); color: var(--ink); }
a { color: var(--accent-text); text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
textarea:focus-visible, input:focus-visible, select:focus-visible { outline-offset: 2px; }
svg { stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.line-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; flex: 0 0 auto; }
.fine, .quiet, .top-sub { font-size: var(--type-small); line-height: 1.6; color: var(--muted); }
.eyebrow, .lesson-eyebrow, .lesson-label, .read-key, .side-label { font-family: var(--font); font-size: var(--type-label); line-height: 1.5; font-weight: 600; letter-spacing: .065em; text-transform: uppercase; }
.tag, .badge { font-size: var(--type-label); font-weight: 400; white-space: normal; }
.app, .focused-session .app { grid-template-columns: 216px minmax(0, 1fr); }
main, .focused-session main { width: 100%; max-width: 1184px; margin-inline: auto; padding: var(--space-4) var(--space-5) var(--space-6); }
.sidebar, .focused-session .sidebar { padding: var(--space-4) var(--space-2); align-items: stretch; gap: var(--space-5); }
.brand, .focused-session .brand { padding: 0 var(--space-1); }
.brand-text, .focused-session .brand-text { display: flex; }
.brand-text strong { font-family: var(--font-reading); font-weight: 600; font-size: 18px; }
.brand-text small { font-size: 12px; }
.brand-mark { background: var(--ink); color: var(--bg); border-radius: var(--radius-sm); }
.nav-list, .focused-session .nav-list { gap: var(--space-1); }
.nav, .focused-session .nav { justify-content: flex-start; padding: 8px 12px; color: var(--side-muted); min-height: 48px; font-size: var(--type-small); }
.nav-label, .focused-session .nav-label { display: block; }
.nav.active { background: var(--side-2); color: var(--ink); }
.nav:hover { background: var(--side-2); }
.nav.active::before { display: none; }
.sidebar-bottom, .focused-session .sidebar-bottom { display: flex; }
.side-links a, .side-label, .version { color: var(--side-muted); }
.side-links a { display: flex; align-items: center; min-height: 44px; }
.side-links { gap: 0; }
.topbar, .focused-session .topbar { margin-bottom: var(--space-4); align-items: center; }
.greeting, .focused-session .greeting { font-size: var(--type-title); font-weight: 400; }
.top-sub, .focused-session .top-sub { margin-top: 8px; font-size: var(--type-small); }
.status-pill { border: 0; background: transparent; padding: 0; font-size: var(--type-label); }
.save-status { min-height: 44px; }
.study-now { padding: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; margin: 0; }
.study-now-meta { margin-bottom: var(--space-2); gap: var(--space-2); }
.study-now-meta .eyebrow { color: var(--muted); }
.study-now-status { color: var(--accent-text); background: var(--teal-soft); border: 0; padding: 4px 12px; font-size: var(--type-label); }
.study-now-title { font-size: var(--type-title); line-height: 1.3; font-weight: 400; max-width: var(--reading-width); }
.study-now-description { font-size: var(--type-body); line-height: 1.6; margin-top: var(--space-2); max-width: 62ch; }
.study-now-actions { gap: var(--space-3); margin-top: var(--space-3); }
.study-now-hint { margin: var(--space-2) 0 0; }
.study-now-hint:empty { display: none; }
.study-time { border: 0; padding-top: var(--space-3); margin-top: 0; gap: var(--space-2); }
.study-time label { font-size: var(--type-label); color: var(--muted); }
.study-time select { min-height: 44px; background: var(--surface-2); border: 0; border-radius: var(--radius-sm); font-size: var(--type-small); }
.review-home { padding: var(--space-3) 0; margin: 0; border: 0; border-radius: 0; background: transparent; gap: var(--space-2); }
.review-home .eyebrow { display: none; }
.review-home p { font-size: var(--type-small); }
.review-home p:empty { display: none; }
.focus-step-bar { padding: var(--space-2) 0; margin: 0 0 var(--space-1); border: 0; background: transparent; border-radius: 0; }
.focus-step-line { gap: var(--space-2); font-size: var(--type-small); align-items: center; }
.focus-step-line .step-estimate { color: var(--muted); font-size: var(--type-label); }
.step-percent { margin-left: auto; color: var(--accent-text); font-size: var(--type-small); font-variant-numeric: tabular-nums; }
.focus-step-line > .quiet-button { margin-left: 0; font-size: var(--type-small); padding-inline: 8px; min-height: 44px; }
.focus-progress { height: 4px; background: var(--line-soft); margin-top: var(--space-1); border-radius: 12px; overflow: hidden; }
.focus-progress-fill { height: 100%; display: block; background: var(--accent); transition: width var(--motion); border-radius: inherit; }
.study-advanced { margin: 0 0 var(--space-4); border: 0; background: transparent; border-radius: 0; }
.study-advanced > summary { padding: 8px 0; color: var(--muted); font-size: var(--type-small); display: flex; align-items: center; gap: 8px; }
.study-advanced > summary::before { content: '+'; font-size: 20px; font-weight: 400; }
.study-advanced[open] > summary::before { content: '−'; }
.study-advanced > summary::marker { content: ''; }
.study-advanced[open] { padding-bottom: var(--space-2); border-bottom: 1px solid var(--line-soft); }
.study-advanced .curriculum-path, .study-advanced .plan, .study-advanced .balance { background: transparent; border: 0; box-shadow: none; padding: var(--space-3) 0; margin: 0; }
.curriculum-path-description, .plan-sub, .readiness-focus strong, .readiness-recommendation p { font-size: var(--type-body); }
.readiness-skill { background: transparent; border: 0; border-left: 2px solid var(--line); border-radius: 0; padding: 8px 16px; }
.readiness-skill p, .readiness-evidence-link, .curriculum-path .fine { font-size: var(--type-small); }
.study-columns, .focused-session .study-columns { display: flex; flex-direction: column; gap: var(--space-4); }
.conversation-panel, .focused-session .conversation-panel { width: 100%; max-width: var(--reading-width); margin: 0 auto; background: transparent; border: 0; box-shadow: none; overflow: visible; }
.panel-heading, .focused-session .panel-heading { padding: 0 0 var(--space-2); border: 0; background: transparent; position: static; }
.panel-heading > h2 { display: none; }
.session-controls, .focused-session .session-controls { width: 100%; flex-wrap: wrap; gap: 8px; }
.session-controls #working { margin-right: auto; font-size: var(--type-small); }
.session-controls button { font-size: var(--type-small); }
.focused-study, .answered-questions { width: 100%; max-width: var(--reading-width); margin: 0 auto var(--space-4); }
.drill-card { padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.drill-card .drill-question { font-family: var(--font-reading); font-weight: 400; font-size: clamp(24px, 2.5vw, 28px); line-height: 1.5; letter-spacing: -.01em; margin: var(--space-3) 0; }
.drill-card textarea, #image-lab-input { font-size: var(--type-body); line-height: 1.6; border: 1px solid var(--field-line); background: var(--surface); }
.drill-your-answer, .drill-explanation, .drill-reference, .answer-reference, .answer-row-question, .answer-row details { font-size: var(--type-body); line-height: 1.6; }
.drill-verdict { font-size: var(--type-body); color: var(--accent-text); }
.drill-shortcuts, .drill-due, .answer-due { font-size: var(--type-label); }
.drill-help { background: transparent; border: 0; padding: 0; margin-top: var(--space-2); }
.answer-row { padding: var(--space-3) 0; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; background: transparent; }
.answered-questions > h3 { font-size: var(--type-section); margin: 0 0 var(--space-2); }
.conversation-history, .focused-session .conversation-history { width: 100%; max-width: var(--reading-width); margin: 0 auto var(--space-3); border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.conversation-history > summary { font-size: var(--type-body); color: var(--ink); padding: var(--space-2) 0; font-weight: 600; }
.messages, .focused-session .messages { padding: var(--space-2) 0 var(--space-3); height: auto; min-height: 0; max-height: none; overflow: visible; background: transparent; gap: var(--space-4); }
.message { font-size: var(--type-body); line-height: 1.6; width: 100%; max-width: var(--reading-width); }
.message.assistant { padding: var(--space-3); background: var(--surface); border: 0; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; box-shadow: none; }
.message-label { display: flex; align-items: center; gap: 8px; font-family: var(--font); font-size: var(--type-label); letter-spacing: 0; font-weight: 600; margin-bottom: var(--space-3); }
.message.assistant .message-label { color: var(--muted); }
.agent-mark { background: transparent; color: var(--accent-text); }
.turn-time { margin-left: auto; font-size: var(--type-label); font-weight: 400; color: var(--muted); }
.message.user, .message.user-read { align-self: flex-end; width: auto; max-width: 88%; padding: var(--space-2) var(--space-3); background: var(--user-bubble); color: var(--user-ink); border: 0; border-radius: var(--radius) var(--radius) 4px var(--radius); box-shadow: none; }
.message.user .message-label { display: block; color: var(--user-ink); margin-bottom: 8px; }
.message.user p, .message.user h3, .message.user strong, .message.user-read p, .message.user-read .read-key, .message.user-read .lesson-label { color: var(--user-ink); }
.message.user-read .read-card { background: transparent; border: 0; padding: 0; box-shadow: none; color: inherit; }
.read-card-top { gap: var(--space-2); align-items: flex-start; }
.message.user-read .tag { color: var(--user-ink); background: transparent; border-color: var(--field-line); }
.read-field { display: block; padding: var(--space-2) 0 0; border: 0; }
.read-field p { font-family: var(--font-reading); font-size: var(--type-reading); line-height: 1.6; }
.lesson { font-size: var(--type-body); }
.lesson p, .lesson li { font-size: var(--type-body); line-height: 1.65; }
.lesson p { margin: 0 0 var(--space-2); }
.lesson-title { font-size: 24px; line-height: 1.45; font-weight: 400; }
.lesson-head { margin-bottom: var(--space-3); }
.lesson-label, .lesson-subhead { color: var(--ink); font-family: var(--font); font-size: var(--type-small); font-weight: 600; text-transform: none; letter-spacing: 0; }
.lesson-subhead { margin: 0 0 8px; }
.feedback-chunk { margin: var(--space-3) 0; }
.feedback-chunk > :last-child { margin-bottom: 0; }
.feedback-chunk:first-child { margin-top: 0; }
.feedback-chunk.example { padding: var(--space-3); background: var(--surface-2); border-radius: var(--radius-sm); }
.lesson-point, .lesson-list-wrap { margin: var(--space-3) 0; padding: 0; background: transparent; border: 0; }
.lesson-list { padding-left: var(--space-3); margin: 8px 0; }
.lesson-list li + li { margin-top: 8px; }
.lesson-callout { padding: var(--space-2) var(--space-3); border: 0; border-left: 2px solid var(--accent); border-radius: 0; background: var(--teal-soft); margin-block: var(--space-3); }
.lesson-question, .lesson-question.active, .feedback-chunk.repair { padding: var(--space-3); margin: var(--space-3) 0 0; border: 0; border-radius: var(--radius-sm); background: var(--teal-soft); box-shadow: none; }
.lesson-question .question-text { font-family: var(--font-reading); font-size: 20px; line-height: 1.6; }
.lesson-question .question-actions { padding-top: var(--space-2); }
.verdict { background: transparent; border: 0; padding: 0; color: var(--ink); }
.lesson-source { margin: var(--space-3) 0; }
.source-card { background: transparent; border: 0; border-radius: 0; border-top: 1px solid var(--line-soft); padding: var(--space-2) 0; box-shadow: none; min-height: 44px; }
.source-icon { background: transparent; }
.source-title { font-size: var(--type-small); }
.turn-event { font-size: var(--type-small); color: var(--muted); }
.composer, .focused-session .composer { position: relative; bottom: auto; z-index: 10; width: 100%; max-width: var(--reading-width); margin: var(--space-2) auto; padding: var(--space-2); border: 1px solid var(--composer-line); border-radius: var(--radius); background: var(--composer-bg); box-shadow: none; }
.conversation-panel:has(.conversation-history[open]) .composer { position: sticky; bottom: var(--space-2); }
.composer:focus-within { border-color: var(--focus); box-shadow: none; }
.composer-prompt { margin: 0 0 var(--space-1); gap: var(--space-1); }
.composer-prompt strong { font-size: var(--type-small); font-weight: 600; }
.composer-prompt small { display: block; font-size: var(--type-label); }
.composer-spark { display: none; }
.composer textarea { font-size: var(--type-body); line-height: 1.6; min-height: 96px; max-height: 220px; padding: 8px 0; border-radius: 0; resize: vertical; }
.composer textarea::placeholder { color: var(--muted); }
.composer textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.composer-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 0; padding: 0; margin-top: var(--space-1); }
.composer-bottom .send-button { min-height: 44px; margin-left: auto; }
.attach-button, .dictate-button { min-width: 44px; min-height: 44px; padding: 8px; border: 0; background: transparent; border-radius: var(--radius-sm); font-size: var(--type-small); color: var(--muted); }
.attach-button .btn-text { display: inline; }
.attach-button:hover, .dictate-button:hover { background: var(--surface-2); }
.composer:has(#attachment:focus-visible) .attach-button { outline: 3px solid var(--focus); outline-offset: 2px; }
.learning-rail, .focused-session .learning-rail { display: block; width: 100%; max-width: var(--reading-width); margin-inline: auto; }
.session-summary { border-top: 1px solid var(--line-soft); }
.session-summary > summary { display: flex; align-items: center; color: var(--muted); font-size: var(--type-small); cursor: pointer; }
.session-summary > .rail-card { border: 0; padding: var(--space-2) 0; background: transparent; box-shadow: none; }
.pending-card { background: var(--amber-bg); border: 0; box-shadow: none; }
.case-focus { background: var(--bg); }
.case-top { color: var(--ink); background: var(--surface); border-color: var(--line-soft); padding: var(--space-2) var(--space-4); }
.case-tag { font-family: var(--font); font-size: var(--type-label); letter-spacing: .025em; color: var(--accent-text); }
.case-back { background: transparent; color: var(--ink); border-color: transparent; }
.case-back:hover { background: var(--surface-2); }
.case-body { width: 100%; max-width: 1280px; margin-inline: auto; gap: var(--space-4); grid-template-columns: minmax(240px, .65fr) minmax(0, 1.35fr); align-items: start; padding: var(--space-4); }
.case-info { padding: var(--space-3); background: var(--surface-2); color: var(--ink); border-radius: var(--radius); gap: var(--space-3); }
.case-info h2 { font-size: 28px; line-height: 1.35; font-weight: 400; letter-spacing: -.01em; }
.case-info p, .case-info .case-warn, .viewer-toolbar, .viewer-note { font-size: var(--type-body); color: var(--muted); }
.viewer-toolbar { font-size: var(--type-small); flex-wrap: wrap; }
.viewer-toolbar a { color: var(--accent-text); }
.case-info .case-link { font-size: var(--type-body); background: var(--primary); color: var(--primary-ink) !important; padding: var(--space-2); }
.case-link:hover { background: var(--primary-hover); text-decoration: none; }
.case-info .case-warn { border: 0; padding: 0; font-size: var(--type-small); }
.case-form { width: 100%; max-width: var(--reading-width); padding: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.case-form h2 { font-size: var(--type-title); line-height: 1.35; font-weight: 400; }
.case-form h3 { font-size: var(--type-section); font-weight: 400; }
.case-prompt { margin-bottom: var(--space-4); padding-bottom: var(--space-3); border-bottom: 1px solid var(--line-soft); }
.case-form #clinical-context { font-family: var(--font-reading); font-size: var(--type-reading); line-height: 1.6; color: var(--ink); margin-bottom: 0; }
.case-field { padding-block: var(--space-3); }
.case-field + .case-field { padding-top: 0; }
.case-field-head { margin: 0 0 var(--space-1); align-items: center; }
.case-field-head label { font-size: var(--type-label); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.case-form textarea { font-family: var(--font-reading); font-size: var(--type-reading); line-height: 1.6; padding: var(--space-2); border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--surface); }
.field-mic { display: inline-flex; align-items: center; gap: 8px; font-size: var(--type-small); background: transparent; border: 0; color: var(--muted); }
.check { min-height: 44px; font-size: var(--type-small); }
.segmented label { min-height: 44px; }
.case-reminder, .case-hint-text { border: 0; background: var(--teal-soft); }
.case-actions { border-top: 1px solid var(--line-soft); padding-top: var(--space-3); margin-top: var(--space-3); }
.walkthrough-copy, .walkthrough-copy p, .walkthrough-copy li { font-size: var(--type-body); line-height: 1.6; }
.walkthrough-reporting, .walkthrough-look { background: var(--teal-soft); border: 0; }
.review-dashboard, .review-browse, .cards-settings, .dm-summary, .dm-list, .dm-detail, .rail-card, .change-card, .image-lab { box-shadow: none; border-radius: var(--radius); }
.review-dashboard { background: var(--surface); padding: var(--space-4); }
.review-stats span { font-size: var(--type-small); }
.review-browse, .cards-settings { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; padding: var(--space-3) 0; }
.review-card-row strong { font-size: var(--type-body); }
.review-card-row span, .dm-tile-stage { font-size: var(--type-label); }
.review-filters input, .review-filters select, .review-search input, #card-edit-form textarea, input, select { border-color: var(--field-line); }
.cards-dialog { max-width: var(--reading-width); border-radius: var(--radius); box-shadow: none; }
.cards-ratings button { min-height: 72px; font-weight: 400; }
.cards-ratings button[data-card-rating="Again"] { color: var(--amber-ink); background: var(--amber-bg); border-color: var(--amber-line); }
.cards-ratings button[data-card-rating="Hard"] { color: var(--ink); background: var(--surface-2); border-color: var(--line); }
.cards-ratings button[data-card-rating="Good"], .cards-ratings button[data-card-rating="Easy"] { color: var(--accent-text); background: var(--teal-soft); border-color: var(--line); }
.cards-ratings button:hover { outline: 2px solid var(--focus); outline-offset: 2px; }
.dm-bar { height: 6px; }
.dm-row { padding: var(--space-3) 0; }
.dm-tile { min-height: 48px; font-size: var(--type-small); border-color: transparent; background: transparent; }
.dm-tile:hover { background: var(--surface-2); filter: none; }
.dm-tile.selected { background: var(--teal-soft); border-color: var(--accent); }
.dm-summary-head h3 { font-size: var(--type-section); }
.notice { border: 0; background: var(--surface-2); font-size: var(--type-small); }
.toast { border: 0; box-shadow: none; background: var(--surface-2); color: var(--ink); }
.toast.error { background: var(--error-bg); color: var(--error); }
footer { font-size: var(--type-label); gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-6); }
@media (max-width: 1100px) and (min-width: 861px) {
  .app, .focused-session .app { grid-template-columns: 192px minmax(0, 1fr); }
  main, .focused-session main { padding-inline: var(--space-3); }
  .brand-text strong { font-size: 16px; }
  .case-body { padding: var(--space-3); gap: var(--space-3); }
  .case-form { padding: var(--space-3); }
}
@media (max-width: 860px) {
  .app, .focused-session .app { display: block; }
  main, .focused-session main { padding: calc(24px + env(safe-area-inset-top, 0px)) var(--space-2) calc(112px + env(safe-area-inset-bottom, 0px)); }
  .sidebar, .focused-session .sidebar { display: block; padding: 0; border: 0; background: transparent; }
  .brand, .focused-session .brand, .sidebar-bottom, .focused-session .sidebar-bottom { display: none; }
  .nav-list, .focused-session .nav-list { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding-top: 8px; }
  .nav, .focused-session .nav { min-height: 52px; padding: 4px 0; gap: 4px; justify-content: center; font-size: 11px; }
  .nav.active { background: var(--teal-soft); }
  .topbar, .focused-session .topbar { align-items: flex-start; gap: var(--space-1); margin-bottom: var(--space-3); }
  .greeting, .focused-session .greeting { font-size: 28px; }
  .topbar-status { align-items: flex-end; max-width: 35%; }
  .status-pill { font-size: 12px; white-space: normal; }
  .study-now { padding: var(--space-3); }
  .study-now-title { font-size: 28px; }
  .study-now-actions { align-items: stretch; gap: var(--space-2); }
  .study-now-meta { align-items: flex-start; flex-wrap: wrap; }
  .review-home { flex-direction: row; align-items: center; padding-block: var(--space-2); }
  .review-home button { flex-shrink: 0; font-size: var(--type-small); padding-inline: 8px; }
  .review-home p { font-size: var(--type-small); }
  .focus-step-line { gap: 8px; }
  .step-percent { margin-left: auto; }
  .focus-step-line .step-estimate { order: 3; }
  .focus-step-line > .quiet-button { order: 4; margin-left: auto; }
  .study-advanced { margin-bottom: var(--space-3); }
  .study-advanced > summary { font-size: var(--type-small); }
  .study-advanced > .curriculum-path, .study-advanced > .plan, .study-advanced > .balance { margin: 0; padding-inline: 0; }
  .drill-card, .case-form, .review-dashboard { padding: var(--space-3); }
  .drill-card .drill-question { font-size: 24px; }
  .drill-actions button { min-width: 0; }
  .message.assistant { padding: var(--space-2); }
  .message.user, .message.user-read { max-width: 94%; padding: var(--space-2); }
  .read-card-top { flex-direction: column; }
  .message-label { flex-wrap: wrap; }
  .lesson-question, .lesson-question.active, .feedback-chunk.example { padding: var(--space-2); }
  .composer, .focused-session .composer { margin: 8px 0; padding: var(--space-2); border-radius: var(--radius); }
  .conversation-panel:has(.conversation-history[open]) .composer { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .composer-prompt { display: flex; }
  .composer-prompt small { display: none; }
  .composer textarea { font-size: 16px; min-height: 96px; }
  .composer-bottom { display: flex; flex-wrap: wrap; gap: 4px; }
  .attach-button, .dictate-button { font-size: 13px; padding-inline: 4px; }
  #attachment-name:empty { display: none; }
  #attachment-name:not(:empty) { order: 5; width: 100%; overflow-wrap: anywhere; }
  .composer-bottom .send-button { padding-inline: 16px; }
  .case-top { padding: var(--space-2); }
  .case-body { display: flex; flex-direction: column; padding: var(--space-2); gap: var(--space-3); }
  .case-info, .case-form { width: 100%; max-width: var(--reading-width); margin-inline: auto; }
  .case-info h2 { font-size: 24px; }
  .case-info p { font-size: 16px; }
  .case-actions { gap: 8px; }
  .case-actions .primary { width: 100%; }
  .dm-summary-head h3 { display: block; }
  .dm-key .dm-legend { display: grid; }
  .cards-dialog { padding: var(--space-3); }
  .review-stats span { font-size: var(--type-label); }
  footer small { margin-left: 0; }
}
@media (max-width: 380px) {
  .topbar { flex-wrap: wrap; }
  .topbar-status { max-width: 100%; }
  .review-home { flex-wrap: wrap; gap: 0; }
  .study-now, .drill-card, .case-form { padding: var(--space-2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
/* A short study agenda and review list, with evidence available on demand. */
.learning-location { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 16px; }
.learning-location > div { display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; }
.learning-location .eyebrow { flex-basis:100%; }
.learning-location strong { font-size:20px; font-family:var(--font-reading); font-weight:600; }
.study-overview { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); gap:24px; margin:24px 0; }
.overview-panel { min-width:0; padding:24px; border:1px solid var(--line-soft); border-radius:16px; background:var(--surface); }
.overview-heading { display:flex; align-items:baseline; justify-content:space-between; gap:16px; margin-bottom:16px; }
.overview-heading h2 { margin:0; font-size:20px; font-weight:600; }
.overview-heading .fine { white-space:nowrap; }
.study-list { padding:0; margin:0; list-style:none; }
.study-list-row { display:flex; align-items:flex-start; gap:16px; min-height:64px; padding:16px 0; border-top:1px solid var(--line-soft); }
.study-list-row:first-child { border-top:0; }
.list-index { color:var(--muted); font-size:13px; padding-top:4px; font-variant-numeric:tabular-nums; }
.list-copy { display:flex; flex-direction:column; gap:4px; flex:1; min-width:0; }
.list-copy strong { font-size:16px; line-height:1.5; font-weight:400; overflow-wrap:anywhere; }
.list-copy .fine { font-size:13px; line-height:1.5; }
.list-status { color:var(--muted); font-size:12px; padding-top:4px; white-space:nowrap; }
.is-current .list-index,.is-current .list-status { color:var(--accent-text); }
.is-current .list-copy strong { font-weight:600; }
.list-empty { font-size:14px; line-height:1.6; color:var(--muted); padding:8px 0 16px; }
.recent-study { border:0; border-top:1px solid var(--line-soft); border-radius:0; padding-top:8px; margin-top:8px; }
.recent-study > summary { font-size:14px; color:var(--muted); padding:8px 0; }
#cards-home-summary { margin:0 0 8px; font-size:13px; }
#cards-home-open { margin-top:8px; padding-left:0; }
#study-advanced .curriculum-path { display:block; }
#study-advanced .curriculum-path-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }
#readiness-skills { display:block; margin-block:16px; }
#readiness-skills .readiness-skill { border:0; border-bottom:1px solid var(--line-soft); padding:0; border-radius:0; }
#readiness-skills .readiness-skill-head { min-height:48px; padding:12px 0; display:flex; align-items:center; justify-content:space-between; gap:16px; font-size:16px; }
#readiness-skills .readiness-skill-head::after { content:'+'; color:var(--muted); }
#readiness-skills .readiness-skill[open] .readiness-skill-head::after { content:'−'; }
#readiness-skills .readiness-skill-head strong { flex:1; font-weight:400; }
#readiness-skills .readiness-skill p { padding:0 0 16px; margin:0; font-size:14px; max-width:68ch; }
.readiness-links { border:0; padding:0; margin-top:16px; }
.readiness-links > summary { min-height:44px; font-size:14px; }
.readiness-evidence-link { display:block; padding:12px 0; border-top:1px solid var(--line-soft); text-decoration:none; overflow-wrap:anywhere; }
@media (max-width:1000px) { .study-overview { grid-template-columns:1fr; gap:16px; } }
@media (max-width:600px) {
  .learning-location { align-items:flex-start; }
  .learning-location > button { font-size:13px; max-width:120px; }
  .overview-panel { padding:16px; }
  .overview-heading { flex-wrap:wrap; gap:4px; }
  .study-list-row { gap:12px; }
  .list-status { font-size:11px; }
}

body.drill-open .study-overview { display:none; }

/* Teaching-first platform refresh. Colors live in design-tokens.css. */
h1,h2,h3,h4,.study-now-title,.case-info h2,.greeting {font-family:var(--font);font-weight:600;letter-spacing:-.025em;}
body {background:var(--bg);}
.sidebar {background:var(--side);border-right:1px solid var(--side-line);}
.brand-mark {background:var(--primary);color:var(--primary-ink);border:0;border-radius:12px;}
.nav.active {background:var(--blue-soft);color:var(--accent-text);border-radius:10px;}
.nav.active svg {color:var(--primary);}
.topbar {padding-block:20px;}
.study-now {padding:24px 28px;background:linear-gradient(115deg,var(--surface) 25%,var(--blue-soft));border-color:var(--line);position:relative;overflow:hidden;}
.study-now:before {content:'';position:absolute;inset:0 auto 0 0;width:4px;background:var(--primary);}
.study-now-title {font-size:clamp(24px,2.6vw,32px);font-weight:600;}
.study-now-actions {margin-top:16px;}
.study-now .primary {min-height:48px;padding-inline:24px;}
.study-now-status {background:var(--blue-soft);color:var(--accent-text);font-weight:600;}
.primary {background:var(--primary);color:var(--primary-ink);border-color:transparent;font-weight:600;}
.primary:hover {background:var(--primary-hover);}
.learning-location {padding:8px 0 16px;}
.learning-location strong {color:var(--accent-text);}
.overview-panel {padding:20px;border:1px solid var(--line);background:var(--surface);border-radius:var(--radius);}
.overview-heading h2 {font-size:18px;}
.study-list-row {padding:12px 0;}
.list-index {background:var(--blue-soft);color:var(--accent-text);border-radius:9px;font-weight:600;}
.study-list-row.is-current .list-status {color:var(--accent-text);background:var(--blue-soft);}
.focus-step-bar {border:0;background:transparent;padding-inline:0;}
.focus-progress-fill {background:var(--primary);}
.review-stats {gap:12px;}
.review-stats .stat {padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:12px;}
.review-stats strong {color:var(--accent-text);font-size:28px;}
#teaching-workspace {width:100%;max-width:1000px;margin:0 auto 24px;}
.teaching-panel {background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:28px;}
.teaching-panel h2 {font-size:26px;margin:8px 0 20px;line-height:1.3;}
.teaching-panel h3 {font-size:17px;margin:0 0 8px;}
.teaching-panel p {line-height:1.65;max-width:76ch;}
.teaching-heading,.teaching-actions {display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.teaching-heading {justify-content:space-between;}
.teaching-actions {margin:20px 0 8px;}
.teaching-source {display:block;margin-bottom:18px;}
.takeaway {display:flex;gap:16px;padding:18px 0;border-bottom:1px solid var(--line-soft);}
.takeaway-number {background:var(--blue-soft);color:var(--accent-text);width:36px;height:36px;border-radius:10px;display:grid;place-items:center;flex:none;font-weight:600;}
.takeaway p {margin:0;}
.teaching-section {padding:18px 0;border-bottom:1px solid var(--line-soft);}
.teaching-section h3 {color:var(--accent-text);}
.example-report {background:var(--surface-2);padding:20px;border-radius:10px;font:inherit;line-height:1.65;white-space:pre-wrap;}
.teaching-optional {margin-top:20px;padding-top:12px;border-top:1px solid var(--line);}
.teaching-optional pre,.revision-form pre {font:inherit;white-space:pre-wrap;}
.teaching-optional summary {cursor:pointer;min-height:44px;}
.card-preview {padding:20px 0;display:grid;gap:10px;border-bottom:1px solid var(--line);}
.card-preview label {font-weight:600;}
.card-preview button {justify-self:start;}
.revision-form {padding:24px 0;display:grid;gap:12px;}
.revision-form button {justify-self:start;}
#teaching-cards-dialog {max-width:720px;}
.teaching-active .study-overview {display:none;}
.teaching-active .study-now {padding:20px 24px;}
.case-feedback-active .study-now {border:0;background:transparent;padding:0;}
.case-feedback-active .study-now > :not(.study-now-meta) {display:none;}
.case-feedback-active .study-now-meta {margin-bottom:8px;}
.current-conversation {display:flex;flex-direction:column;gap:20px;width:100%;max-width:var(--reading-width);margin:0 auto 20px;}
.current-conversation.hidden {display:none;}
.current-conversation .message {margin:0;}
.conversation-history #messages {padding:12px 0;}
.conversation-history .answered-questions {padding-top:16px;}
.conversation-history #source-choice {margin:12px 0;}
.conversation-history .turn-collapsed > summary {font-size:14px;}
#study-working {max-width:var(--reading-width);margin:0 auto 12px;}
.case-teaching {border-top:3px solid var(--primary);box-shadow:0 8px 28px var(--shadow-color);}
.case-teaching h2 {font-weight:600;font-size:24px;max-width:42ch;margin:12px 0;}
.teaching-source-link {font-size:14px;white-space:nowrap;}
.case-verdict {display:inline-flex;align-items:center;padding:5px 10px;color:var(--accent-text);background:var(--blue-soft);border-radius:6px;font-size:13px;}
.case-feedback-tabs {display:flex;gap:6px;border-bottom:1px solid var(--line);margin-top:22px;}
.case-feedback-tabs button {flex:1;border:0;border-radius:6px 6px 0 0;background:transparent;color:var(--muted);padding:12px 8px;border-bottom:3px solid transparent;font-size:14px;}
.case-feedback-tabs button[aria-selected=true] {color:var(--accent-text);background:var(--blue-soft);border-bottom-color:var(--primary);}
.case-feedback-pane {padding:22px 0 4px;}
.case-feedback-pane[hidden] {display:none;}
.feedback-point {margin-bottom:18px;}
.feedback-point h3 {font-size:14px;color:var(--accent-text);margin-bottom:8px;}
.feedback-point p {margin:0 0 8px;line-height:1.6;}
.feedback-point > :last-child {margin-bottom:0;}
.feedback-priority {padding:18px;border:1px solid var(--line);background:var(--surface-2);border-radius:10px;}
.feedback-details {padding-top:4px;font-size:14px;}
.feedback-details > summary {color:var(--muted);cursor:pointer;display:list-item;padding:12px 0;}
.feedback-details[open] > summary {margin-bottom:12px;}
.case-feedback-actions {border-top:1px solid var(--line);padding-top:18px;margin-top:18px;gap:8px;}
.case-feedback-actions button {font-size:14px;}
.case-save-details {font-size:13px;color:var(--muted);border-top:1px solid var(--line-soft);margin-top:12px;}
.case-save-details summary {padding:12px 0;cursor:pointer;}
.case-save-details.needs-attention > summary {color:var(--warn);}
.case-save-details p {margin:0 0 10px;}
.report-submission {padding:8px 0;border-bottom:1px solid var(--line-soft);}
.report-submission > summary {cursor:pointer;padding:10px 0;font-weight:600;}
.original-report {font:inherit;font-size:15px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;}
.case-feedback-pane .example-report {margin:14px 0;overflow-wrap:anywhere;}
@media(max-width:600px){.case-teaching{padding:18px;}.case-teaching h2{font-size:21px;}.case-feedback-tabs{gap:0;}.case-feedback-tabs button{font-size:13px;padding:12px 4px;}.feedback-priority{padding:14px;}.case-feedback-actions{display:grid;grid-template-columns:1fr 1fr;}.case-feedback-actions .primary{grid-column:1/-1;}.case-feedback-actions button:last-child{grid-column:1/-1;}.case-verdict{font-size:12px;}}
.settings-libraries {padding:20px;background:var(--surface);border-radius:var(--radius);margin-bottom:24px;}
.settings-libraries .side-links {display:flex;gap:16px;flex-wrap:wrap;}
.case-body {grid-template-columns:minmax(300px,1fr) minmax(360px,1.15fr);gap:24px;}
.case-info {background:var(--surface);color:var(--ink);padding:28px;border:1px solid var(--line);position:sticky;top:24px;}
.case-info h2 {color:var(--ink);font-weight:600;}
.case-info p,.case-info .case-warn,.case-info .viewer-toolbar,.case-info .viewer-note {color:var(--muted);}
.case-info a {color:var(--accent-text);}
.case-info .case-link {background:var(--primary);color:var(--primary-ink)!important;border:0;min-height:56px;}
.external-study-guide {padding:28px 0;}
.walkthrough-checklist {display:flex;flex-direction:column;gap:6px;padding:12px 12px 12px 32px;background:var(--surface-2);border-radius:12px;font-size:14px;}
.walkthrough-checklist li {padding:4px 8px;color:var(--muted);}
.walkthrough-checklist .current {background:var(--blue-soft);color:var(--accent-text);font-weight:600;border-radius:6px;}
.walkthrough-checklist .done {color:var(--ok);}
.search-pattern {padding:12px 0;}
.search-pattern summary {min-height:44px;cursor:pointer;}
.search-pattern li {margin-bottom:12px;}
button,a,summary {transition:background-color var(--motion),color var(--motion),border-color var(--motion);}
:focus-visible {outline:3px solid var(--focus);outline-offset:3px;}
@media(max-width:860px){.case-body{display:flex;flex-direction:column;}.case-info{position:static;width:100%;}.teaching-panel{padding:20px;}.teaching-panel h2{font-size:23px;}.teaching-actions{gap:8px;}.teaching-actions button{flex:1 1 150px;}.study-now{padding:20px;}.takeaway{gap:12px;}}
@media(prefers-reduced-motion:reduce){button,a,summary{transition:none;}}

/* Reading room: compact study surface, separate planning, on-demand tutor. */
.app, .focused-session .app {grid-template-columns:208px minmax(0,1fr);}
main, .focused-session main {max-width:1240px;padding:24px 40px 56px;}
.sidebar, .focused-session .sidebar {background:var(--side);border-color:var(--side-line);padding:28px 14px;}
.brand, .brand:hover, .brand-text strong {color:var(--side-ink);}
.brand-text small {color:var(--side-muted);}
.brand-mark {background:transparent;color:var(--accent-text);border:1px solid var(--side-line);border-radius:8px;}
.brand-mark svg {width:29px;height:29px;fill:none;stroke:currentColor;stroke-width:1.3;}
.nav.active, .nav.active:hover {background:var(--side-2);color:var(--side-ink);border-radius:7px;}
.nav.active svg {color:var(--accent-text);}
.nav:hover {color:var(--side-ink);}
.side-label {font-size:10px;letter-spacing:.08em;}
.topbar, .focused-session .topbar {padding:0 0 18px;margin-bottom:20px;border-bottom:1px solid var(--line);}
.greeting, .focused-session .greeting {font-size:26px;line-height:1.25;}
.top-sub, .focused-session .top-sub {margin-top:4px;}
.topbar-status {gap:4px;}
.save-status {font-size:12px;min-height:28px!important;padding:0 4px;}
.eyebrow, .lesson-eyebrow, .lesson-label, .read-key, .case-step-bar, .list-index, .step-estimate {font-family:var(--mono);font-variant-numeric:tabular-nums;font-size:11px;letter-spacing:.06em;}
.home-resume {display:flex;justify-content:space-between;gap:32px;padding:28px;background:var(--surface);border:1px solid var(--line);border-top:3px solid var(--primary);border-radius:var(--radius);}
.home-resume h2 {margin:8px 0;font-size:26px;}
.home-resume p {margin:0 0 20px;max-width:60ch;color:var(--muted);}
.home-resume .study-time {flex-shrink:0;align-self:end;padding:0;display:flex;flex-direction:column;align-items:start;gap:8px;}
#tab-home .study-overview {display:grid;margin:24px 0;}
#tab-home .learning-rail {max-width:none;margin:0;}
.study-tools {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;}
.study-tools .eyebrow {color:var(--muted);}
.study-tools .eyebrow > span:first-child {color:var(--field-line);padding:0 8px;}
.tutor-launch {display:flex;align-items:center;gap:8px;border:1px solid var(--line);background:var(--surface);font-size:13px;padding:8px 12px;flex-shrink:0;}
.tutor-launch svg {width:17px;height:17px;}
.study-now {padding:24px 28px;background:var(--surface);border-radius:var(--radius);margin:0 0 20px;}
.study-now:before {display:none;}
.study-now-title {font-size:clamp(23px,2.2vw,28px);}
.study-now-meta {margin-bottom:10px;}
.study-now-status {background:transparent;padding:0;color:var(--muted);font-size:12px;}
.study-now-meta .eyebrow {font-size:10px;}
.study-now .study-now-hint {font-size:13px;}
.study-now.workspace-redundant {display:none;}
.focus-step-bar {margin:0 0 14px;padding:0;}
.focus-step-line {justify-content:flex-start;gap:12px;}
.focus-step-line strong {font-size:12px;font-weight:400;color:var(--muted);}
.focus-step-line .quiet-button {margin-left:auto;font-size:12px;}
.study-columns, .focused-session .study-columns {gap:16px;}
.conversation-panel, .focused-session .conversation-panel {max-width:none;}
#teaching-workspace, #focused-study {max-width:var(--reading-width);margin-inline:auto;}
#tab-study .panel-heading {max-width:var(--reading-width);margin:4px auto 0;width:100%;}
.session-controls {justify-content:flex-end;}
.session-controls button {font-size:12px;color:var(--muted);}
.session-controls #back-step-main {margin-right:auto;}
.teaching-panel, .drill-card {border-radius:var(--radius);box-shadow:0 2px 5px var(--shadow-color);}
.case-teaching {border-top:2px solid var(--primary);}
.case-teaching h2 {font-size:24px;}
.feedback-priority {border-radius:6px;border-left:3px solid var(--accent);}
.example-report {border:1px solid var(--line);border-radius:6px;background:var(--surface-2);}
.case-info {background:var(--side);color:var(--side-ink);border-radius:var(--radius);}
.case-info h2, .case-info h3, .case-info p, .case-info .fine, .case-info .case-role-tag {color:var(--side-ink);}
.case-info .eyebrow, .case-info .case-step-bar {color:var(--muted);}
.case-info a {color:var(--accent-text);}
.case-info .case-warn, .case-info .case-reminder {background:var(--side-2);border-color:var(--side-line);color:var(--side-ink);}
.case-info .secondary {color:var(--side-ink);}
.case-form textarea {border-radius:6px;}
.case-form > label, .case-form legend {font-size:13px;font-weight:600;}
#study-working {max-width:var(--reading-width);margin:0 auto 16px;font-size:13px;}
/* The desktop drawer leaves the study usable; mobile uses the native modal. */
.tutor-drawer {position:fixed;inset:0 0 0 auto;width:400px;max-width:100%;height:100dvh;max-height:100dvh;margin:0;padding:24px;border:0;border-left:1px solid var(--line);border-radius:0;background:var(--surface);color:var(--ink);box-shadow:-12px 0 40px var(--shadow-color);z-index:65;overflow:hidden;}
.tutor-drawer:not([open]) {display:none;}
.tutor-drawer[open] {display:flex;flex-direction:column;gap:16px;}
.tutor-heading {display:flex;justify-content:space-between;align-items:center;gap:12px;flex-shrink:0;}
.tutor-heading h2 {font-size:21px;margin:4px 0 0;}
.tutor-heading button {font-size:26px;min-width:44px;min-height:44px;}
.tutor-context {margin:0;font-size:12px;color:var(--muted);border-bottom:1px solid var(--line);padding-bottom:14px;}
.tutor-conversation {flex:1;min-height:40px;overflow-y:auto;overscroll-behavior:contain;}
.tutor-conversation .current-conversation {gap:16px;}
.tutor-conversation .message {padding:0;}
.tutor-conversation .message.user {padding:12px;border-radius:7px;}
.tutor-conversation .lesson-title {font-size:20px;}
.tutor-conversation .lesson-prose, .tutor-conversation .message p {font-size:14px;}
#tutor-drawer #chat-form:not(.hidden) {display:block;}
.tutor-drawer .composer {flex-shrink:0;position:static;margin:0;width:100%;padding:12px;border:1px solid var(--field-line);border-radius:8px;background:var(--surface);}
.tutor-drawer .composer textarea {font-size:16px;max-height:180px;}
.tutor-drawer .composer-bottom {gap:4px;}
.tutor-drawer .attach-button, .tutor-drawer .dictate-button {font-size:12px;gap:4px;}
.tutor-drawer .send-button {font-size:13px;padding:10px;}
.tutor-drawer::backdrop {background:var(--backdrop);}
#tutor-error {margin:0;font-size:13px;flex-shrink:0;}
#tab-home .session-summary .rail-card {display:block;}
@media(min-width:1280px) {body.tutor-open .app {margin-right:400px;}body.tutor-open main {padding-inline:28px;}}
@media(min-width:861px) and (max-width:1279px) {body.tutor-open .app {margin-right:380px;grid-template-columns:76px minmax(0,1fr);}body.tutor-open .brand-text,body.tutor-open .nav-label,body.tutor-open .sidebar-bottom {display:none;}body.tutor-open .nav {justify-content:center;padding:8px;}body.tutor-open .sidebar {width:76px;padding-inline:10px;}body.tutor-open .brand {padding:0;}body.tutor-open main {padding-inline:20px;}.tutor-drawer {width:380px;}}
@media(max-width:860px) {
  .app, .focused-session .app {display:block;}
  main, .focused-session main {padding:calc(20px + env(safe-area-inset-top,0px)) 16px calc(100px + env(safe-area-inset-bottom,0px));}
  .sidebar, .focused-session .sidebar {padding:0;background:transparent;}
  .nav-list, .focused-session .nav-list {grid-template-columns:repeat(6,minmax(0,1fr));background:var(--side);border-color:var(--side-line);padding-inline:4px;}
  .nav, .focused-session .nav {font-size:10px;min-height:52px;padding:4px 0;color:var(--side-muted);}
  .nav svg {width:20px;height:20px;}
  .nav.active, .nav.active:hover {color:var(--side-ink);background:var(--side-2);}
  .topbar, .focused-session .topbar {margin-bottom:14px;padding:0 0 14px;align-items:center;}
  .greeting, .focused-session .greeting {font-size:24px;}
  .topbar-status {max-width:42%;}
  .top-sub {font-size:12px;}
  .status-pill, .save-status {font-size:10px;}
  .home-resume {padding:20px;flex-direction:column;gap:20px;}
  .home-resume .study-time {align-self:start;flex-direction:row;align-items:center;}
  .home-resume h2 {font-size:23px;}
  .study-tools {gap:8px;margin-bottom:12px;}
  .study-tools .eyebrow {font-size:10px;max-width:48%;}
  .study-tools .eyebrow > span:first-child {padding:0 2px;}
  .tutor-launch {font-size:12px;padding:8px;}
  .study-now {padding:20px;}
  .study-now-meta .eyebrow {display:none;}
  .study-now-title {font-size:23px;}
  .focus-step-line {flex-wrap:wrap;gap:4px 8px;}
  .focus-step-line .step-estimate {display:none;}
  .case-info {padding:20px;}
  .tutor-drawer {inset:auto 0 0;width:100%;height:85dvh;max-height:calc(100dvh - env(safe-area-inset-top,0px));border:0;border-top:1px solid var(--line);border-radius:16px 16px 0 0;padding:20px 16px max(16px,env(safe-area-inset-bottom,0px));}
  .tutor-open {overflow:hidden;}
}
@media(prefers-reduced-motion:reduce) {.tutor-drawer {scroll-behavior:auto;}}

/* Neutral reading room with restrained scanner-cyan accents. */
html {background:var(--bg);scrollbar-color:var(--field-line) var(--bg);}
body {background:var(--bg);}
::selection {background:var(--selection-bg);color:var(--selection-ink);}
h1,h2,h3,h4,.greeting,.study-now-title {color:var(--ink);}
.sidebar,.focused-session .sidebar {background:var(--side);border-right-color:var(--line);}
.brand-mark {color:var(--accent);border-color:var(--line);background:var(--surface-2);}
.nav.active,.nav.active:hover {background:var(--accent-soft);color:var(--accent-text);box-shadow:inset 2px 0 var(--accent);}
.nav.active svg {color:var(--accent);}
.nav:hover {background:var(--surface-2);}
.primary,.primary.big,.primary.small,.case-info .case-link {background:var(--primary);border:1px solid var(--primary);color:var(--primary-ink);box-shadow:none;}
.primary:hover:not(:disabled),.case-info .case-link:hover {background:var(--primary-hover);border-color:var(--primary-hover);}
.tutor-launch {background:var(--surface);border-color:var(--line);color:var(--accent-text);}
.tutor-launch:hover,.tutor-launch[aria-expanded=true] {background:var(--accent-soft);border-color:var(--accent);}
.home-resume,.study-now {position:relative;background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);}
.home-resume {overflow:hidden;border-top:2px solid var(--accent);isolation:isolate;}
.home-resume::after {content:'';position:absolute;z-index:-1;pointer-events:none;right:8%;top:-58px;width:220px;height:220px;border:1px solid var(--accent-glow);border-radius:50%;box-shadow:0 0 0 30px var(--accent-glow-soft),0 0 0 60px var(--accent-glow-soft);}
.study-time select {background:var(--surface-2);border:1px solid var(--line);}
.teaching-panel,.drill-card,.overview-panel,.review-dashboard,.case-form {background:var(--surface);border-color:var(--line);}
.case-teaching {border-top:2px solid var(--accent);}
.case-feedback-tabs button[aria-selected=true] {color:var(--accent-text);background:var(--accent-soft);border-bottom-color:var(--accent);}
.feedback-priority {background:var(--surface-2);border-color:var(--line);border-left-color:var(--accent);}
.feedback-point h3,.teaching-section h3 {color:var(--accent-text);}
.case-verdict,.takeaway-number,.list-index {background:var(--surface-2);color:var(--ink);border:1px solid var(--line);}
.example-report,.walkthrough-report-example pre {background:var(--surface-2);color:var(--ink);border-color:var(--line);}
input,select,textarea,.case-form textarea,.drill-card textarea,#image-lab-input {background:var(--surface);color:var(--ink);border-color:var(--field-line);caret-color:var(--accent);}
input::placeholder,textarea::placeholder {color:var(--muted);opacity:1;}
input[type=checkbox],input[type=radio] {accent-color:var(--accent);}
.case-info {background:var(--surface-2);border-color:var(--line);}
.case-info .case-link {color:var(--primary-ink)!important;}
.case-info .case-warn {background:transparent;color:var(--muted);}
#commit-status {background:var(--surface-2);color:var(--ink);border-color:var(--line);}
.case-info .viewer-toolbar,.case-info .viewer-note,.external-study-guide p {color:var(--muted);}
.tutor-drawer {background:var(--surface);border-color:var(--line);box-shadow:-12px 0 48px var(--shadow-deep);}
.tutor-drawer .composer {background:var(--surface-2);border-color:var(--field-line);}
.tutor-drawer .composer:focus-within {border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-glow);}
.tutor-drawer .composer textarea {background:transparent;}
.cards-dialog {background:var(--surface);border:1px solid var(--line);box-shadow:0 20px 70px var(--shadow-deep);}
.cards-ratings [data-card-rating=Good],.cards-ratings [data-card-rating=Easy] {background:var(--accent-soft);border-color:var(--accent);color:var(--ink);}
.cards-ratings [data-card-rating=Good] span,.cards-ratings [data-card-rating=Easy] span {color:var(--muted);}
.conn-dot.ready,.status-pill.ready .dot {background:var(--ok);}
.walkthrough-copy strong {color:var(--ink);background:transparent;}
@media(max-width:860px) {
  .sidebar,.focused-session .sidebar {background:transparent;}
  .nav-list,.focused-session .nav-list {background:var(--surface);border-top-color:var(--line);}
  .nav.active,.nav.active:hover {background:var(--accent-soft);box-shadow:inset 0 2px 0 var(--accent);color:var(--accent-text);}
  .home-resume::after {right:-70px;}
}
@media(forced-colors:active) {
  .home-resume::after {display:none;}
  .primary,.nav.active,.tutor-launch {border:1px solid ButtonText;}
  .case-feedback-tabs button[aria-selected=true] {border-bottom-color:Highlight;}
}
