/* Histology keeps its study layout; Lumus owns the type, colors and controls. */
:root {
  --atlas-header-height: 80px;
  --atlas-image-surface: #fff;
}

body { font-family: var(--lx-font-histology); line-height: var(--lx-histology-line-height); }
h1, h2, h3, h4 { font-family: var(--lx-font-histology-heading); text-wrap: balance; }
button, input, select, textarea { font-family: var(--lx-font-ui); }
:is(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--lx-accent);
  outline-offset: 4px;
}
input, select, textarea { accent-color: var(--lx-accent); caret-color: var(--lx-accent); }
input::placeholder, textarea::placeholder { color: var(--lx-muted); opacity: 1; }
button, .index a, .lesson-actions a {
  transition: background-color var(--lx-duration), color var(--lx-duration), border-color var(--lx-duration);
}
button, .quiet, .spell-primary, .spell-panel :is(select, input), .mock-settings-bottom select,
#mock-answer, .quickfind input, .image-report :is(input, select, textarea) {
  border-radius: var(--lx-radius);
  min-height: 44px;
}
button:disabled { transition: none; }
.quiet { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 9px 14px; }
.quiet:hover:enabled { background: var(--lx-surface); border-color: var(--lx-accent); color: var(--lx-accent); }
.spell-primary { color: var(--lx-on-accent); }
.spell-primary:hover:enabled { background: var(--lx-text); border-color: var(--lx-text); }
.atlas-site-header { margin: 0; display: block; }
.atlas-site-header .lx-container { width: min(1440px, calc(100% - 72px)); }
.atlas-site-header .lx-header-inner { min-height: var(--atlas-header-height); }
.atlas-site-header a { color: var(--lx-text); }
.back-to-lumus { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; font-size: 13px; }
.back-to-lumus:hover { color: var(--lx-accent); }
.back-to-lumus .lx-icon { width: 17px; height: 17px; }
.shell { width: min(1440px, calc(100% - 72px)); margin-inline: auto; grid-template-columns: 208px minmax(0, 1fr); gap: 40px; min-height: calc(100vh - var(--atlas-header-height)); }
.sidebar { top: var(--atlas-header-height); height: calc(100vh - var(--atlas-header-height)); background: transparent; color: var(--lx-text); padding: 44px 24px 24px 0; border-right: 1px solid var(--lx-rule); }
.sidebar-heading h2 { font-size: 14px; font-weight: 600; color: var(--lx-muted); margin-bottom: 16px; }
.chapter-hint { display: none; }
.sidebar nav a { border: 0; border-radius: 0; padding: 12px 10px; margin: 0; font-size: 14px; color: var(--lx-muted); gap: 12px; }
.sidebar nav a:hover { color: var(--lx-accent); background: var(--lx-surface); }
.sidebar nav a.active { border-left: 0; background: var(--lx-surface); color: var(--lx-accent); box-shadow: inset 1px 0 var(--lx-accent); font-weight: 600; }
.sidebar .count { opacity: 1; color: var(--lx-muted); font-variant-numeric: tabular-nums; }
.navlabel { letter-spacing: 0; color: var(--lx-muted); margin: 24px 10px 6px; }
.sidefoot { line-height: 1.8; color: var(--lx-muted); padding-top: 32px; }
.sidefoot p { color: var(--lx-text); margin-bottom: 8px; font-size: 12px; }
.workspace { padding: 42px 0 24px; margin: 0; max-width: 1120px; }
.page-heading { margin-bottom: 28px; align-items: center; }
.page-heading h1 { font-size: clamp(28px, 2.5vw, 36px); font-weight: 600; line-height: 1.35; letter-spacing: -0.025em; margin: 0; }
.page-heading p { font-size: 14px; color: var(--lx-muted); margin: 10px 0 0; }
.page-heading button { flex-shrink: 0; }
.tabs { gap: 12px 24px; border-color: var(--lx-rule); margin-bottom: 28px; }
.tabs a { min-height: 44px; padding: 10px 0 12px; font-size: 14px; border-bottom-width: 1px; }
.tabs a:hover { color: var(--lx-accent); }
.tabs a.active { color: var(--lx-accent); }
.quickfind { margin-bottom: 40px; }
.quickfind label { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.quickfind label span { margin: 0; }
.quickfind input { max-width: 680px; font-size: 16px; padding: 11px 14px; }
#find-results { border-radius: var(--lx-radius); }
#find-results a { min-height: 44px; border-radius: 6px; }
#find-results a:hover { background: var(--lx-canvas); border-color: var(--lx-accent); }
main { scroll-margin-top: calc(var(--atlas-header-height) + 24px); }
.lead { padding: 0; border: 0; margin-bottom: 28px; }
.lead h2 { font-size: clamp(25px, 2.2vw, 30px); line-height: 1.45; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 10px; }
.lead p { max-width: 72ch; }
.lead .section-meta { font-size: 13px; color: var(--lx-muted); margin: 0 0 14px; }
.kicker { display: none; }
.guide { background: transparent; border: 0; border-block: 1px solid var(--lx-rule); border-radius: 0; padding: 20px 0; margin-bottom: 24px; }
.guide strong { color: var(--lx-text); font-size: 15px; }
.guide ol { padding-left: 24px; margin-top: 10px; }
.guide li + li { margin-top: 5px; }
.index { margin-block: 24px 32px; gap: 8px; }
.index a { border-radius: 6px; min-height: 44px; display: inline-flex; align-items: center; padding: 8px 12px; font-size: 13px; background: transparent; }
.index a:hover { background: var(--lx-surface); border-color: var(--lx-accent); }
.card { border-radius: var(--lx-radius); box-shadow: none; margin-bottom: 32px; scroll-margin-top: calc(var(--atlas-header-height) + 24px); }
.cardhead { padding: 22px 24px 18px; }
.cardhead .tag { white-space: normal; max-width: 15em; font-weight: 400; }
.answer { color: var(--lx-text); font-size: 21px; line-height: 1.5; }
.tag, .badge, .reader-course-badge, .mock-level { border-radius: 5px; }
.tag { background: var(--lx-canvas); color: var(--lx-muted); }
.cardbody { grid-template-columns: minmax(240px, 0.95fr) minmax(280px, 1.1fr); }
.visual { padding: 20px; background: var(--lx-surface); }
.imagebutton { background: var(--atlas-image-surface); border-radius: 6px; }
.imagebutton img { background: var(--atlas-image-surface); }
.evidence { padding: 20px 24px 24px; }
.evidence dt { color: var(--lx-muted); letter-spacing: 0; font-size: 12px; font-weight: 600; margin-top: 20px; }
.evidence dd { font-size: 16px; }
.relatedimage { background: var(--lx-canvas); color: var(--lx-muted); border-radius: 5px; }
.warning { background: var(--lx-warning-surface); color: var(--lx-warning); border-left: 1px solid var(--lx-warning); }
.note { border-left: 1px solid var(--lx-rule); }
.callout, .sourceslist, .coursecard, .tablewrap { border-radius: var(--lx-radius); }
.callout, .sourceslist { overflow-wrap: anywhere; }
.tablewrap { max-width: 100%; }
.tablewrap table { min-width: 640px; }
.table-scroll-hint { display: none; }
th { background: var(--lx-canvas); color: var(--lx-text); font-weight: 600; }
td, th { padding: 16px 18px; }
.glossary td:nth-child(2) { color: var(--lx-text); }
.compareblock, .vocabgroup { margin-bottom: 40px; }
.lesson-actions a { background: transparent; color: var(--lx-accent); border-color: var(--lx-control-line); border-radius: var(--lx-radius); font-size: 14px; min-height: 44px; font-weight: 600; }
.lesson-actions a:hover { background: var(--lx-surface); outline: none; border-color: var(--lx-accent); }
.lesson-actions a:focus-visible { outline: 2px solid var(--lx-accent); outline-offset: 4px; }
.mock-panel, .spell-panel { background: var(--lx-surface); border-radius: var(--lx-radius); padding: 28px; }
.spell-panel { max-width: none; }
.mock-topic-option { background: transparent; border-color: var(--lx-rule); border-radius: 9px; padding: 14px 16px; min-height: 76px; }
.mock-topic-option:hover { border-color: var(--lx-accent); }
.mock-topic-option:has(input:checked) { background: var(--lx-canvas); border-color: var(--lx-accent); }
.mock-topic-option:focus-within { outline: 2px solid var(--lx-accent); outline-offset: 3px; }
.mock-topic-option small { color: var(--lx-muted); }
.mock-topic-option input, .spell-panel .mock-topic-option input { accent-color: var(--lx-accent); min-height: 20px; border-radius: 3px; }
.mock-settings-bottom { grid-template-columns: 150px minmax(0, 1fr) auto; }
.mock-image-button, .mock-review-image, .report-image { background: var(--atlas-image-surface); }
.spell-clock { background: var(--lx-canvas); color: var(--lx-text); border-radius: 9px; font-variant-numeric: tabular-nums; }
.spell-clock.urgent { color: var(--lx-error); background: var(--lx-error-surface); }
.spell-score { font-variant-numeric: tabular-nums; }
.spell-feedback { border: 1px solid var(--lx-rule); border-radius: 9px; background: var(--lx-canvas); }
.spell-feedback.correct { border-color: var(--lx-success); background: var(--lx-success-surface); }
.spell-feedback.correct h4 { color: var(--lx-success); }
.spell-feedback.incorrect { border-color: var(--lx-error); background: var(--lx-error-surface); }
.spell-feedback.incorrect h4 { color: var(--lx-error); }
.spell-standard { color: var(--lx-text); }
.spell-typed { font-family: var(--lx-font-histology); }
.spell-panel input, #mock-answer { font-size: 18px; }
dialog, .image-report { background: var(--lx-surface); color: var(--lx-text); border-color: var(--lx-control-line); border-radius: var(--lx-radius); }
dialog::backdrop, .image-report::backdrop { background: rgb(45 43 37 / 78%); }
.image-report :is(input, select, textarea) { background: var(--lx-surface); color: var(--lx-text); border-color: var(--lx-control-line); font-size: 16px; }
.report-toolbar { gap: 16px; }
.report-toolbar .quiet { flex-shrink: 0; }
#report-status { color: var(--lx-error); }
.atlas-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-top: 48px; padding-block: 20px; }
.atlas-footer a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--lx-muted); text-decoration: none; white-space: nowrap; }
.atlas-footer a:hover { color: var(--lx-accent); }
.atlas-footer p { margin: 0; max-width: 68ch; }
.skip { position: fixed; top: 12px; left: 18px; transform: translateY(-200%); background: var(--lx-accent); color: var(--lx-on-accent); }
.skip:focus { top: 12px; transform: translateY(0); }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 180px minmax(0, 1fr); gap: 28px; }
  .sidebar { padding-right: 18px; }
  .cardbody { grid-template-columns: 1fr; }
  .visual { border-right: 0; border-bottom: 1px solid var(--lx-rule); }
  .mock-settings-bottom { grid-template-columns: 150px minmax(0, 1fr); }
  .mock-settings-bottom > .spell-primary { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 759px) {
  :root { --atlas-header-height: 64px; }
  .atlas-site-header .lx-container, .shell { width: calc(100% - 36px); }
  .atlas-site-header .lx-header-inner { flex-wrap: nowrap; padding-top: 0; gap: 12px; }
  .atlas-site-header .lx-brand-group { width: auto; gap: 12px; }
  .atlas-site-header .lx-site-name { padding-left: 12px; }
  .back-to-lumus { font-size: 12px; gap: 5px; flex-shrink: 0; }
  .back-to-lumus .lx-icon { width: 15px; height: 15px; }
  .shell { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--lx-rule); padding: 20px 0 16px; display: block; }
  .sidebar-heading { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
  .sidebar-heading h2 { margin: 0 0 8px; font-size: 13px; }
  .chapter-hint { display: block; color: var(--lx-muted); font-size: 11px; }
  .sidebar nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; }
  .sidebar nav::before { content: none; }
  .sidebar nav a { flex-shrink: 0; max-width: 175px; padding: 10px 12px; min-height: 44px; font-size: 13px; border-radius: 6px; line-height: 1.5; }
  .sidebar nav a.active { box-shadow: inset 0 -1px var(--lx-accent); }
  .navlabel, .sidefoot, .sidebar .count { display: none; }
  .workspace { padding: 28px 0 20px; }
  .page-heading { margin-bottom: 24px; gap: 12px; }
  .page-heading h1 { font-size: 28px; }
  .page-heading p { font-size: 13px; margin-top: 8px; }
  .page-heading .quiet { font-size: 12px; padding: 9px 10px; gap: 5px; }
  .page-heading .lx-icon { width: 16px; height: 16px; }
  .tabs { gap: 0 20px; margin-bottom: 24px; }
  .tabs a { font-size: 13px; padding-block: 10px; }
  .quickfind { margin-bottom: 32px; }
  .quickfind label { font-size: 13px; gap: 4px 12px; }
  .lead h2 { font-size: 25px; }
  .lead p { font-size: 16px; }
  .guide { font-size: 15px; padding-block: 18px; }
  .index { gap: 7px; margin-bottom: 28px; }
  .index a { padding: 8px 10px; font-size: 12px; }
  .cardhead { padding: 18px; flex-direction: column; gap: 10px; }
  .cardhead .tag { max-width: none; }
  .answer { font-size: 20px; }
  .visual { padding: 14px; }
  .evidence { padding: 18px; }
  .table-scroll-hint { display: block; color: var(--lx-muted); font-size: 12px; margin-bottom: 8px; }
  .mock-panel, .spell-panel { padding: 18px 16px; }
  .mock-topic-grid { grid-template-columns: 1fr; }
  .mock-settings-bottom { grid-template-columns: 1fr; }
  .mock-settings-bottom > .spell-primary { width: 100%; }
  .mock-question-head h3 { font-size: 17px; }
  .mock-run-top .quiet { font-size: 12px; }
  .mock-selection-actions { flex-wrap: wrap; }
  .spell-feedback { padding: 16px; }
  .spell-actions { gap: 10px; }
  .image-report { padding: 16px; }
  .image-report .report-toolbar h2 { font-size: 18px; }
  .atlas-footer { margin-top: 32px; }
  .atlas-footer p { font-size: 12px; }
}

@media (max-width: 359px) {
  .atlas-site-header .lx-site-name { font-size: 12px; }
  .back-to-lumus span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .back-to-lumus { justify-content: center; min-width: 44px; }
  .page-heading h1 { font-size: 25px; }
}

@media print {
  .atlas-site-header, .atlas-footer, .page-heading, .table-scroll-hint { display: none; }
  .shell { display: block; width: 100%; }
  .workspace { max-width: none; padding: 0; }
  .cardbody { grid-template-columns: 40% 60%; }
  .card, .callout, .tablewrap { background: #fff; }
  .tablewrap { overflow: visible; }
  .tablewrap table { min-width: 0; }
}
