:root {
  --paper: #f5eedf;
  --surface: #fffaf0;
  --ink: #172436;
  --muted: #596575;
  --line: #d8c9aa;
  --blue: #243b61;
  --red: #7c3343;
  --ochre: #a56f2d;
  --green: #49665a;
  --violet: #62517d;
  --pale-blue: #e8edf4;
  --pale-red: #f3e4e6;
  --pale-green: #e7eee9;
  --font-reading: Georgia, "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-scale: 1;
  --radius-sm: .75rem;
  --radius-lg: 1.5rem;
  --shadow: 0 .65rem 2rem rgb(27 39 51 / .10);
  --sidebar: 18rem;
  --topbar: 4.5rem;
  --reading: 68ch;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 1rem); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: calc(18px * var(--font-scale))/1.62 var(--font-reading);
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-underline-offset: .18em; }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-reading); }
.eyebrow, nav, button, label, summary, table { font-family: var(--font-ui); }
h1 { margin: 0 0 1rem; font-size: clamp(2.15rem, 5vw, 4rem); line-height: 1.03; letter-spacing: -.035em; }
h2 { margin: 2.8rem 0 1rem; font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 1.15; letter-spacing: -.02em; }
h3 { margin: 2rem 0 .75rem; font-size: 1.28rem; line-height: 1.25; }
p { margin: 0 0 1.15rem; }
ul, ol { padding-left: 1.35rem; }
li + li { margin-top: .55rem; }
button { min-height: 44px; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: .5rem; left: .5rem; padding: .7rem 1rem; background: var(--ink); color: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40; height: var(--topbar);
  display: flex; align-items: center; gap: .8rem;
  padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right));
  background: rgb(245 238 223 / .97); background: color-mix(in srgb, var(--paper) 92%, transparent); border-top: .34rem solid var(--ochre);
  border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; color: var(--ink); text-decoration: none; font-family: var(--font-ui); }
.brand strong, .brand small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand strong { font-size: 1rem; line-height: 1.1; }
.brand small { color: var(--muted); font-size: .72rem; margin-top: .18rem; }
.brand-mark { position: relative; width: 2.3rem; height: 1.5rem; flex: none; }
.brand-mark i { position: absolute; left: 0; right: 0; height: 3px; border-radius: 9px; transform-origin: left center; }
.brand-mark i:nth-child(1) { top: .25rem; background: var(--red); transform: rotate(8deg); }
.brand-mark i:nth-child(2) { top: .7rem; background: var(--blue); transform: rotate(-7deg); }
.brand-mark i:nth-child(3) { top: 1.1rem; background: var(--green); transform: rotate(5deg); }
.top-actions { display: flex; gap: .35rem; align-items: center; margin-left: auto; }
.icon-button, .text-button, .primary-button, .secondary-button, .danger-button {
  border: 0; border-radius: 999px; cursor: pointer; font-weight: 750; transition: transform .16s ease, background .16s ease;
}
.icon-button { min-width: 44px; padding: .4rem .7rem; background: transparent; color: var(--ink); font-size: 1.1rem; }
.text-button { padding: .55rem .8rem; background: transparent; color: var(--ink); font-size: .88rem; }
.primary-button { padding: .75rem 1.1rem; background: var(--ink); color: #fff; }
.secondary-button { padding: .66rem 1rem; background: var(--pale-blue); color: var(--blue); }
.danger-button { padding: .7rem 1rem; background: var(--pale-red); color: #6f2634; }
button:active { transform: translateY(1px); }

.sidebar {
  position: fixed; z-index: 30; top: var(--topbar); bottom: 0; left: 0; width: var(--sidebar);
  background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
}
.sidebar-inner { padding: 1.1rem .8rem 3rem; }
.progress-card { margin: .35rem .25rem 1.2rem; padding: 1rem; border-radius: var(--radius-lg); background: var(--ink); color: #fff; }
.progress-card strong { display: block; font: 750 1.05rem/1.25 var(--font-ui); margin: .25rem 0 .7rem; }
.progress-card .eyebrow { color: #d6dce1; }
.progress-card .secondary-button { width: 100%; margin-top: .8rem; background: #fff; color: var(--ink); }
.progress-track { height: .5rem; border-radius: 999px; background: rgb(255 255 255 / .18); overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--ochre); transition: width .35s ease; }
.nav-link { display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: .6rem; min-height: 48px; padding: .5rem .65rem; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-size: .9rem; line-height: 1.2; }
.nav-link span { color: var(--muted); font-size: .72rem; font-weight: 800; }
.nav-link:hover { background: var(--paper); }
.nav-link.active { background: var(--pale-blue); color: var(--blue); font-weight: 800; }
.nav-link.complete::after { content: "✓"; color: var(--green); font-weight: 900; }
.sidebar-note { margin: 1.5rem .75rem; color: var(--muted); font-size: .78rem; line-height: 1.45; }

main { margin-left: var(--sidebar); padding-top: var(--topbar); min-height: 100vh; }
.page { width: min(100% - 2rem, 78rem); margin: 0 auto; padding: clamp(2rem, 5vw, 5.5rem) 0 6rem; }
.reading-column { width: min(100%, var(--reading)); margin-inline: auto; }
.eyebrow { display: inline-block; color: var(--ochre); font-size: .74rem; line-height: 1.2; letter-spacing: .12em; text-transform: uppercase; font-weight: 850; }
.lede { font-size: clamp(1.14rem, 2vw, 1.42rem); line-height: 1.5; color: #32414d; }
.lesson-hero { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(18rem,.9fr); gap: clamp(2rem,5vw,5rem); align-items: center; }
.hero-copy .question { margin: 1.4rem 0 1.6rem; padding-left: 1rem; border-left: .35rem solid var(--red); font-size: 1.16rem; font-weight: 650; }
.hero-image { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.hero-image picture, .hero-image img { display: block; width: 100%; height: 100%; }
.hero-image img { aspect-ratio: 16 / 9; object-fit: cover; object-position: 52% center; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.home-section { margin-top: 5rem; }
.thesis-strip { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: clamp(1.2rem,3vw,2rem); border: 1px solid var(--line); border-left: .5rem solid var(--red); border-radius: var(--radius-lg); background: var(--surface); }
.thesis-strip h2 { margin: .25rem 0 .65rem; }
.thesis-strip p { max-width: 65ch; margin: 0; }
.home-section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.home-section-head h2 { margin: 0; }
.timeline-image, .concept-map { display: block; width: 100%; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.lesson-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.lesson-card { display: flex; flex-direction: column; min-height: 15rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: 0 .2rem .9rem rgb(27 39 51 / .04); }
.lesson-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.lesson-card h3 { margin: .7rem 0; font-size: 1.2rem; }
.lesson-card p { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.lesson-card .card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; color: var(--blue); font-family: var(--font-ui); font-size: .84rem; font-weight: 800; }
.lesson-card.complete .card-status::before { content: "Completata · "; color: var(--green); }

.lesson-header { width: min(100%, 73rem); margin: 0 auto 3rem; }
.lesson-header .question-banner { margin-top: 1.7rem; padding: 1.25rem 1.4rem; border-radius: var(--radius-lg); background: var(--ink); color: #fff; }
.question-banner .eyebrow { color: #e8c79f; }
.question-banner p { margin: .35rem 0 0; font-size: 1.25rem; line-height: 1.45; }
.lesson-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2rem auto; width: min(100%, var(--reading)); }
.meta-card { padding: 1rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.meta-card h2 { margin: 0 0 .7rem; font-size: 1rem; }
.meta-card ul { margin: 0; font-size: .9rem; line-height: 1.48; }
.world-scene { width: min(100%, 76rem); margin: 2.6rem auto 3.4rem; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.world-scene-image { position: relative; background: #d7cec0; aspect-ratio: 3 / 2; overflow: hidden; }
.world-scene-image::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18); }
.world-scene-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.world-scene figcaption { padding: clamp(1rem, 3vw, 1.65rem); }
.world-scene h2 { margin: .25rem 0 .75rem; font-size: clamp(1.45rem, 3vw, 2rem); }
.scene-status { margin: 0; color: var(--muted); font-family: var(--font-ui); font-size: .9rem; }
.world-scene details { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.scene-evidence { display: grid; grid-template-columns: 9.5rem 1fr; gap: .5rem 1rem; margin: .9rem 0 0; }
.scene-evidence dt { color: var(--red); font-family: var(--font-ui); font-weight: 850; }
.scene-evidence dd { margin: 0; }
.section-anchor { scroll-margin-top: calc(var(--topbar) + 1.2rem); }
.lesson-section { width: min(100%, var(--reading)); margin: 0 auto; }
.lesson-section p { hyphens: auto; }
.lesson-section h2 { padding-top: .25rem; border-top: 1px solid var(--line); }
.bridge { margin: 2.5rem 0; padding: 1.2rem 1.35rem; border-left: .45rem solid var(--ochre); background: #f2e8da; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.bridge strong { display: block; font-family: var(--font-ui); color: #74420f; margin-bottom: .35rem; }
.tools-row { display: flex; align-items: center; gap: .55rem; margin: 1rem 0 2rem; flex-wrap: wrap; }
.tools-row button { font-size: .84rem; }

.map-panel { width: min(100%, 76rem); margin: 3rem auto; padding: clamp(1rem, 3vw, 1.6rem); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.map-panel h2 { margin-top: .2rem; }
.map-panel figcaption { margin-top: .75rem; color: var(--muted); font-size: .86rem; }
.map-open { margin-top: .8rem; }
.long-description { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .7rem; }
summary { cursor: pointer; color: var(--blue); font-weight: 800; }
details[open] summary { margin-bottom: .7rem; }

.study-grid { width: min(100%, 76rem); margin: 3rem auto; display: grid; grid-template-columns: 1.1fr .9fr; gap: 1rem; }
.study-card { padding: 1.25rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.study-card h2 { margin-top: 0; font-size: 1.45rem; }
.study-card ul { margin-bottom: 0; }
.vocab { width: 100%; border-collapse: collapse; font-size: .9rem; }
.vocab th, .vocab td { padding: .65rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.vocab th { color: var(--blue); }
.lab-card { width: min(100%, var(--reading)); margin: 3rem auto; padding: 1.5rem; border-radius: var(--radius-lg); background: var(--pale-green); border-left: .5rem solid var(--green); }
.lab-card h2 { margin-top: 0; }
.label-detail { display: grid; grid-template-columns: 9rem 1fr; gap: .35rem 1rem; }
.label-detail dt { font-family: var(--font-ui); font-weight: 800; color: var(--green); }
.label-detail dd { margin: 0 0 .7rem; }
.connections { width: min(100%, var(--reading)); margin: 2rem auto; }

.notes-card { width: min(100%, var(--reading)); margin: 3rem auto; padding: 1.4rem; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); }
.notes-card h2 { margin-top: 0; }
.notes-card textarea { width: 100%; min-height: 10rem; resize: vertical; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); line-height: 1.55; }
.save-state { display: inline-block; min-height: 1.5rem; color: var(--green); font: 700 .82rem/1.4 var(--font-ui); }

.quiz { width: min(100%, 76rem); margin: 4rem auto; padding: clamp(1.1rem,3vw,2rem); border-radius: var(--radius-lg); background: var(--ink); color: #fff; }
.quiz h2 { margin-top: 0; }
.quiz-intro { color: #dfe5e8; }
.quiz-history { margin: 1rem 0; padding: .8rem 1rem; border: 1px solid rgb(255 255 255 / .25); border-radius: var(--radius-sm); }
.quiz-history summary { color: #fff3ce; }
.quiz-history ol { margin-bottom: 0; color: #e8edf4; font-size: .88rem; }
.quiz-question { margin: 1.35rem 0; padding: 1.1rem; border: 1px solid rgb(255 255 255 / .18); border-radius: var(--radius-sm); }
.quiz-question legend { padding: 0 .25rem; font: 800 1rem/1.4 var(--font-ui); }
.quiz-option { display: grid; grid-template-columns: 1.2rem 1fr; gap: .65rem; align-items: start; margin: .65rem 0; padding: .55rem .65rem; border-radius: .55rem; cursor: pointer; }
.quiz-option:hover { background: rgb(255 255 255 / .08); }
.quiz-option input { margin-top: .35rem; accent-color: var(--ochre); }
.quiz .primary-button { background: #fff; color: var(--ink); }
.quiz-results { margin-top: 1.2rem; padding: 1.1rem; border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.score-line { display: flex; flex-wrap: wrap; gap: .7rem 1.4rem; align-items: baseline; font-family: var(--font-ui); }
.score-line strong { font-size: 1.55rem; }
.answer-feedback { margin: 1rem 0; padding: .9rem 1rem; border-left: .4rem solid var(--green); background: var(--pale-green); border-radius: 0 .6rem .6rem 0; }
.answer-feedback.wrong { border-color: var(--red); background: var(--pale-red); }
.answer-feedback h3 { margin: 0 0 .35rem; font-size: 1rem; }
.recovery-box { margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.recovery-box p { margin-bottom: .45rem; }
.reentry { margin-top: 1rem; padding: .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.reentry legend { padding: 0 .35rem; font-family: var(--font-ui); }
.reentry .quiz-option { border: 1px solid transparent; }
.reentry .quiz-option:hover, .reentry .quiz-option:focus-within { border-color: var(--ochre); background: var(--paper); }
.reentry-status { min-height: 1.5rem; margin: .65rem 0 0; color: var(--red); font: 800 .88rem/1.4 var(--font-ui); }
.reentry-status.ok { color: var(--green); }
.retest-button { margin-top: .8rem; }

.deep-dive-card { width: min(100%, 76rem); margin: 3rem auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; border: 1px solid #c9a56e; border-left: .55rem solid var(--ochre); border-radius: var(--radius-lg); padding: clamp(1.15rem, 3vw, 1.65rem); background: linear-gradient(135deg, #fff9ed, #efe1cd); box-shadow: 0 .5rem 1.8rem rgb(86 57 29 / .09); }
.deep-dive-card h2 { margin: .25rem 0 .55rem; font-size: clamp(1.35rem, 3vw, 1.85rem); }
.deep-dive-card p { max-width: 52rem; margin: 0; color: var(--muted); }
.deep-dive-actions { display: grid; gap: .7rem; min-width: 15rem; }
.deep-dive-link { white-space: nowrap; }

.lesson-footer { width: min(100%, 76rem); margin: 4rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.complete-button.done { background: var(--green); }
.pager { display: flex; gap: .6rem; flex-wrap: wrap; }

.notebook-layout { display: grid; grid-template-columns: minmax(0,1fr) 18rem; gap: 2rem; }
.notebook-entry { margin-bottom: 1rem; padding: 1.2rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.notebook-entry h2 { margin-top: 0; font-size: 1.3rem; }
.notebook-entry pre { margin: 0; white-space: pre-wrap; font: inherit; }
.quote-item { margin: .6rem 0; padding: .7rem 1rem; border-left: .3rem solid var(--red); background: var(--pale-red); }
.notebook-tools { position: sticky; top: calc(var(--topbar) + 1rem); height: max-content; padding: 1rem; border-radius: var(--radius-lg); background: var(--ink); color: #fff; }
.notebook-tools h2 { margin-top: 0; font-size: 1.2rem; }
.notebook-tools button { width: 100%; margin-top: .6rem; }
.empty-state { padding: 2rem; border: 1px dashed var(--line); border-radius: var(--radius-lg); color: var(--muted); text-align: center; }

.sources-card { margin: 1.5rem 0; padding: clamp(1.1rem, 2.4vw, 1.7rem); border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--surface), var(--pale-blue)); box-shadow: var(--shadow); }
.sources-card h2 { margin: .35rem 0 1rem; font-size: 1.35rem; }
.sources-card ol { margin: 0; padding-left: 1.35rem; }
.sources-card li { margin: .75rem 0; padding-left: .2rem; }
.sources-card a { color: var(--blue); font-weight: 800; }
.sources-card span { display: block; margin-top: .2rem; color: var(--muted); font-size: .83rem; line-height: 1.45; }

.app-dialog { width: min(44rem, calc(100% - 1.5rem)); max-height: min(46rem, calc(100vh - 2rem)); border: 0; border-radius: var(--radius-lg); padding: 0; background: var(--paper); color: var(--ink); box-shadow: 0 2rem 6rem rgb(0 0 0 / .28); }
.app-dialog::backdrop, .map-dialog::backdrop { background: rgb(27 39 51 / .72); backdrop-filter: blur(4px); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: .25rem 0 0; font-size: 1.35rem; }
.search-field { display: block; padding: 1rem 1.25rem 0; }
.search-field input { width: 100%; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); }
.search-results { padding: 1rem 1.25rem 1.5rem; }
.search-result { display: block; padding: .85rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.search-result strong { font-family: var(--font-ui); }
.search-result p { margin: .3rem 0 0; color: var(--muted); font-size: .87rem; line-height: 1.45; }
.compact-dialog { width: min(34rem, calc(100% - 1.5rem)); }
.settings-group { margin: 1rem 1.25rem; border: 0; padding: 0; }
.settings-group legend { font-family: var(--font-ui); font-weight: 800; margin-bottom: .55rem; }
.segmented { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.segmented button { border: 0; border-right: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .78rem; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--ink); color: #fff; }
.toggle-row { display: flex; align-items: center; gap: .7rem; margin: 1.2rem 1.25rem; }
.toggle-row input { width: 1.3rem; height: 1.3rem; accent-color: var(--green); }
.compact-dialog .danger-button { margin: 0 1.25rem 1.3rem; width: calc(100% - 2.5rem); }
.install-steps { padding: 1rem 1.4rem 1.4rem; }
.install-steps ol { margin-top: 0; }
.map-dialog { width: min(96vw, 92rem); max-height: 94vh; border: 0; border-radius: var(--radius-lg); padding: 0; background: var(--paper); color: var(--ink); }
.map-stage { overflow: auto; padding: 1rem; background: #ddd6ca; }
.map-stage img { display: block; width: max(100%, 70rem); margin: auto; background: var(--paper); }
.map-dialog .long-description { margin: 1rem 1.25rem 1.5rem; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 2rem); padding: .75rem 1rem; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: var(--shadow); font-family: var(--font-ui); font-size: .85rem; }
.network-status { position: fixed; z-index: 90; right: 1rem; bottom: 1rem; padding: .45rem .75rem; border-radius: 999px; background: var(--violet); color: #fff; font-family: var(--font-ui); font-size: .75rem; }
.scrim { position: fixed; z-index: 25; inset: var(--topbar) 0 0 0; background: rgb(27 39 51 / .55); }
.high-contrast { --paper:#fff; --surface:#fff; --ink:#000; --muted:#333; --line:#666; --blue:#004f71; --red:#7a0024; --ochre:#854800; --green:#005e50; --violet:#4b2f69; --pale-blue:#e6f3f8; --pale-red:#f9e7ed; --pale-green:#e4f4ee; }

@media (max-width: 1100px) {
  .sidebar { transform: translateX(-101%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  main { margin-left: 0; }
  .menu-button { display: inline-flex; }
  .lesson-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (min-width: 1101px) { .menu-button { display: none; } }
@media (max-width: 760px) {
  :root { --topbar: 4.2rem; }
  .brand small { display: none; }
  #searchButton { min-width: 44px; width: 44px; overflow: hidden; white-space: nowrap; font-size: 0; }
  #searchButton::before { content: "⌕"; font-size: 1.35rem; line-height: 1; }
  .topbar { gap: .3rem; }
  .page { width: min(100% - 1.2rem, 78rem); padding-top: 2rem; }
  .lesson-hero { grid-template-columns: 1fr; }
  .hero-image { order: -1; }
  .thesis-strip { align-items: stretch; flex-direction: column; }
  .lesson-grid, .study-grid, .lesson-meta, .notebook-layout { grid-template-columns: 1fr; }
  .deep-dive-card { grid-template-columns: 1fr; align-items: start; }
  .deep-dive-actions { width: 100%; min-width: 0; }
  .deep-dive-link { width: 100%; white-space: normal; }
  .scene-evidence { grid-template-columns: 1fr; }
  .scene-evidence dd { margin-bottom: .65rem; }
  .lesson-card { min-height: 12rem; }
  .label-detail { grid-template-columns: 1fr; }
  .label-detail dd { margin-bottom: 1rem; }
  .lesson-footer { align-items: stretch; flex-direction: column; }
  .pager { justify-content: space-between; }
  .notebook-tools { position: static; }
  .vocab { font-size: .8rem; }
  .vocab th, .vocab td { padding: .45rem; }
  .segmented { grid-template-columns: 1fr; border-radius: var(--radius-sm); }
  .segmented button { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media print {
  .topbar, .sidebar, .tools-row, .quiz, .notes-card, .lesson-footer, .network-status { display: none !important; }
  main { margin: 0; padding: 0; }
  .page { width: 100%; padding: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .map-panel, .study-card, .lab-card, .world-scene { box-shadow: none; break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
