/* Edge-to-edge chapters. Only the document scrolls, never an inset frame. */
:root { --reader-header-height: 56px; --reader-toolbar-height: 86px; scroll-padding-top: var(--reader-header-height); scroll-padding-bottom: var(--reader-toolbar-height); }
.glance-page { --reader-surface: #fcf8f0; --reader-ink: #0b2133; --reader-rule: #0b213326; background: var(--reader-surface); }
.glance-page[data-reader-tone="dark"] { --reader-surface: #0b2133; --reader-ink: #f4ead7; --reader-rule: #f4ead733; }
.glance-main { padding: var(--reader-header-height) 0 var(--reader-toolbar-height); }
.reader-topline { position: fixed; z-index: 20; inset: 0 0 auto; max-width: none; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: env(safe-area-inset-top, 0px) 0; padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right)); color: var(--reader-ink); background: var(--reader-surface); border-bottom: 1px solid var(--reader-rule); }
.reader-topline a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 0.85rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.reader-topline a:hover { text-decoration: underline; text-underline-offset: 4px; }
.reader-topline h1 { margin: 0 auto 0 0; font: 500 0.85rem/1.4 var(--body); letter-spacing: 0.08em; text-transform: uppercase; }
.reader-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; max-width: 100%; margin-left: auto; }
/* Text enlargement may need an extra control row. The reader measures this
   fixed bar, so wrapping never places a chapter underneath it. */
.reader-topline { flex-wrap: wrap; }
.reading-mode-button { max-width: 100%; }
.book-region.shell { max-width: none; padding: 0; }
.reading-mode-button { min-height: 44px; padding: 8px 14px; color: inherit; background: transparent; border: 1px solid var(--reader-rule); border-radius: 0; font: 500 0.85rem var(--body); cursor: pointer; touch-action: manipulation; }
.fullscreen-button { display: inline-flex; align-items: center; gap: 8px; }
.fullscreen-button[hidden] { display: none; }
.reading-mode-button:hover,
.reading-mode-button[aria-pressed="true"] { color: var(--reader-surface); background: var(--reader-ink); border-color: var(--reader-ink); }
.book-toolbar { position: fixed; inset: auto 0 0; z-index: 20; grid-template-columns: 1fr minmax(0, 390px) 1fr; gap: 20px; margin: 0; padding: 8px max(24px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); color: var(--reader-ink); background: var(--reader-surface); border: 0; }
.book-button { min-height: 48px; min-width: 100px; border-width: 1px; border-radius: 0; font-family: var(--body); font-weight: 600; touch-action: manipulation; }
.book-toolbar .book-button { width: auto; min-width: 100px; color: inherit; background: transparent; border-color: var(--reader-rule); }
.book-button-prev { justify-self: start; }
.book-button-next { justify-self: end; }
.book-button:disabled { opacity: 0.6; cursor: default; }
.page-picker { width: 100%; min-width: 0; justify-self: center; }
.page-picker label { display: block; text-align: center; font-size: 0.68rem; letter-spacing: 0.12em; line-height: 1.4; }
.page-picker select { display: block; width: 100%; min-height: 44px; padding: 4px 30px 4px 12px; color: inherit; background: var(--reader-surface); border: 0; border-radius: 0; font: 500 1rem var(--body); text-align: center; cursor: pointer; }
.reader-position { position: absolute; inset: 0 0 auto; }
.page-status { color: #52616a; font-size: 0.76rem; font-weight: 500; letter-spacing: 0; text-align: left; text-transform: none; white-space: normal; overflow: visible; }
.reader-position .progress-track { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--reader-rule); border-radius: 0; }
.progress-track span { background: linear-gradient(90deg, var(--copper), var(--orange)); border-radius: 0; }
.flipbook { min-height: 0; margin: 0; overflow: clip; border: 0; border-radius: 0; box-shadow: none; background: var(--reader-surface); touch-action: pan-y pinch-zoom; scroll-margin-top: 0; }
.flipbook:focus-visible { outline-offset: -3px; }
.book-spine { display: none; }
.book-page,
.js .flipbook .book-page { position: relative; inset: auto; min-height: calc(100svh - var(--reader-header-height) - var(--reader-toolbar-height)); height: auto; padding: clamp(28px, 4vh, 56px) max(clamp(24px, 5vw, 90px), calc((100% - 1240px) / 2)); overflow: visible; align-content: center; gap: clamp(20px, 3vh, 32px); box-shadow: none; scroll-margin-top: 0; }
.js .flipbook .book-page { display: none; }
.js .flipbook .book-page.is-active { display: grid; }
.js .flipbook .book-page.is-leaving { position: absolute; inset: 0; display: grid; min-height: 0; height: 100%; overflow: hidden; animation-duration: 320ms; }
.page-heading h2,
.cover-copy h2,
.mosaic-copy h2 { font-size: clamp(2rem, 3.6vw, 3.35rem); max-width: 26ch; }
.page-lead { font-size: clamp(1rem, 1.5vw, 1.2rem); line-height: 1.55; }
.folio { display: none; }
.cover-page .folio { color: #d5dce0; }
.cover-page { grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr); align-items: center; }
.cover-image-wrap,
.cover-image-wrap .artwork-link { width: 100%; height: auto; }
.cover-image-wrap img { width: auto; max-width: 100%; height: auto; max-height: min(62svh, 660px); aspect-ratio: auto 2 / 3; object-fit: contain; }
.cover-copy .gesture-hint { margin-top: 24px; font: 400 0.9rem/1.5 var(--body); letter-spacing: 0; text-transform: none; }
.cover-copy .reader-start-button { width: auto; margin-top: 12px; padding: 12px 24px; color: var(--ink); background: var(--cream); border-color: var(--cream); }
.cover-copy .reader-start-button span { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
.no-js .reader-start-button { display: none; }
.page-grid h3,
.note-panel h3,
.culture-list h3,
.conversation-flow h3,
.everyday-grid h3,
.learning-layout h3,
.split-principles h3,
.action-columns h3 { font: 600 clamp(1rem, 1.5vw, 1.22rem)/1.25 var(--body); letter-spacing: -0.02em; text-transform: none; }
.page-grid section,
.culture-list section,
.conversation-flow section,
.everyday-grid section,
.split-principles section,
.action-columns section { padding: 20px; }
.learning-ring { width: min(100%, 210px); max-width: 210px; margin-inline: auto; }
.reader-economy-links { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.reader-economy-links p { max-width: 75ch; margin: 0; line-height: 1.6; }
.reader-economy-links .page-link { margin: 0; }
.mosaic-page { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); align-items: center; }
.mosaic-map { border: 0; border-radius: 0; box-shadow: none; }
.mosaic-map img { width: 100%; height: auto; aspect-ratio: auto 2400 / 1669; object-fit: contain; }
.book-footer-controls { grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 16px; margin-top: 16px; }
.book-footer-controls .book-button { width: 100%; max-width: 320px; min-width: 0; min-height: 68px; justify-self: start; justify-content: flex-start; padding: 12px 18px; text-align: left; }
.book-footer-controls .book-button:last-child { justify-self: end; }
.book-footer-controls .book-button:last-child { justify-content: flex-end; text-align: right; }
.reader-turn-copy { display: grid; gap: 3px; min-width: 0; }
.reader-turn-copy small { display: block; font-size: 0.78rem; font-weight: 400; line-height: 1.35; white-space: normal; }
.book-footer-controls .book-button span:not([aria-hidden="true"]) { position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; }
.book-footer-controls p { order: initial; align-self: center; font-size: 0.8rem; }
.reader-help { display: flex; justify-content: space-between; align-items: start; gap: 24px; margin-top: 24px; }
.reader-help p { max-width: 72ch; margin: 0; color: #596771; font-size: 0.8rem; line-height: 1.7; }
.reader-help > a { flex-shrink: 0; display: inline-flex; align-items: center; min-height: 44px; color: var(--copper-dark); font-size: 0.9rem; font-weight: 650; text-underline-offset: 4px; }

/* The list option also provides a straightforward, accessible reading fallback. */
.is-list-view .flipbook { display: grid; gap: 0; overflow: visible; border: 0; border-radius: 0; box-shadow: none; background: transparent; touch-action: auto; }
.js .is-list-view .flipbook .book-page { position: relative; inset: auto; display: grid; min-height: 0; height: auto; animation: none; transform: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; scroll-margin-top: 0; }
.is-list-view .book-spine,
.is-list-view .book-footer-controls { display: none; }
.no-js .reader-position { display: none; }
.no-js .flipbook .book-page { min-height: 0; }
.no-js .reader-options { display: none; }
.no-js .glance-main { padding-block: 0; }
.no-js .reader-topline { position: static; }
.no-js { scroll-padding: 0; }
.no-js .flipbook { gap: 0; }
.no-js .flipbook .book-page { border: 0; border-radius: 0; box-shadow: none; }
.js .glance-page:not(.reader-list-mode) .site-footer,
.js .glance-page:not(.reader-list-mode) .back-to-top { display: none; }
.reader-list-mode .site-footer { margin-bottom: var(--reader-toolbar-height); }
.reader-list-mode .back-to-top { bottom: calc(var(--reader-toolbar-height) + 12px); }

/* Tablet reading: keep diagrams legible and give prose a useful line length. */
@media (max-width: 1120px) {
  .page-grid.three-up,
  .culture-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .page-grid.three-up section { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; padding: 18px 22px; }
  .page-grid.three-up .idea-icon { grid-row: 1 / 3; }
  .page-grid.three-up h3,
  .page-grid.three-up p { grid-column: 2; margin: 0; }
  .page-grid.three-up h3 { margin-bottom: 6px; }
  .culture-list section { grid-template-columns: 34px minmax(0, 1fr); padding: 18px 22px; }
  .culture-list h3 { margin-block: 0 6px; }
  .mosaic-page { grid-template-columns: minmax(0, 1fr); }
  .mosaic-map { max-width: 820px; margin-inline: auto; }
  .mosaic-copy > p { max-width: 72ch; }
  .mosaic-map { width: 100%; }
  .mosaic-map figcaption { font-size: 0.82rem; line-height: 1.5; }
  .glance-page .back-to-top { width: 48px; height: 48px; padding: 0; }
  .glance-page .back-to-top span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
}

@media (max-width: 900px) {
  .cover-page { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); }
  .conversation-flow { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .conversation-flow section { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 0 14px; }
  .conversation-flow section > span { grid-row: 1 / 3; padding-top: 3px; }
  .conversation-flow h3,
  .conversation-flow p { grid-column: 2; margin: 0; }
  .conversation-flow h3 { margin-bottom: 6px; }
  .conversation-flow section:not(:last-child)::after { content: none; }
  .pathway { grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; }
  .pathway li { padding-inline: 8px; }
  .learning-layout { grid-template-columns: minmax(160px, 0.5fr) minmax(0, 1fr); gap: 24px; }
  .reader-help { display: grid; gap: 12px; }
}
@media (max-width: 720px) {
  .reader-topline { min-height: 52px; gap: 12px; padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); }
  .reader-topline h1 { font-size: 0.72rem; letter-spacing: 0; }
  .reader-options { gap: 6px; }
  .fullscreen-button { width: 44px; justify-content: center; padding: 0; }
  .fullscreen-button span { display: none; }
  .book-toolbar { grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 8px; padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); }
  .book-toolbar .book-button { min-width: 48px; width: 48px; padding: 0; }
  .reader-position { gap: 12px; }
  .page-status { font-size: 0.72rem; }
  .book-page,
  .js .flipbook .book-page { padding: 28px max(24px, env(safe-area-inset-right)) 32px max(24px, env(safe-area-inset-left)); }
  .cover-page,
  .mosaic-page { grid-template-columns: minmax(0, 1fr); }
  .cover-copy { order: -1; }
  .cover-image-wrap img { max-width: 100%; max-height: 44svh; }
  .page-heading h2,
  .cover-copy h2,
  .mosaic-copy h2 { font-size: clamp(1.8rem, 7vw, 2.7rem); }
  .page-grid section,
  .culture-list section,
  .conversation-flow section,
  .everyday-grid section,
  .split-principles section,
  .action-columns section { padding: 16px; }
  .learning-ring { max-width: 170px; }
  .learning-layout { grid-template-columns: minmax(0, 1fr); }
  .pathway { grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 0; overflow: visible; }
  .pathway li { min-height: 0; grid-template-columns: 20px 90px minmax(0, 1fr); align-items: center; gap: 12px; padding: 14px 16px; text-align: left; }
  .pathway li:not(:last-child)::after { content: none; }
  .book-footer-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .book-footer-controls p { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .book-footer-controls .book-button { padding-inline: 12px; }
  .glance-page .back-to-top { width: 44px; height: 44px; min-height: 44px; padding: 0; }
  .glance-page .back-to-top span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
}
/* Landscape tablets have room for columns, not tall stacks of panels. */
@media (min-width: 900px) and (max-width: 1120px) and (orientation: landscape) {
  .page-grid.three-up,
  .culture-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-grid.three-up section { display: block; padding: 18px; }
  .page-grid.three-up h3 { margin-top: 8px; }
  .culture-list section { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .mosaic-page { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
}
/* Keep controls compact on short landscape screens. */
@media screen and (max-height: 600px) {
  .book-toolbar { padding-block: 8px max(8px, env(safe-area-inset-bottom)); }
  .reader-position { gap: 12px; }
  .js .flipbook .book-page { padding-block: 24px; }
}
@media (hover: none) {
  .book-button:hover:not(:disabled) { color: var(--white); background: var(--navy); border-color: var(--navy); }
  .cover-copy .reader-start-button:hover { color: var(--ink); background: var(--cream); border-color: var(--cream); }
  .book-button:active:not(:disabled) { color: var(--ink); background: var(--amber); border-color: var(--amber); }
}
@media (max-width: 420px) {
  .reader-topline h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .glance-page .brand { gap: 8px; }
  .glance-page .brand-copy strong { font-size: 0.9rem; }
  .glance-page .brand-copy small { font-size: 0.5rem; letter-spacing: 0.06em; }
  .glance-page .header-inner { gap: 10px; }
  .reading-mode-button { padding-inline: 10px; font-size: 0.8rem; }
  .page-picker select { padding-right: 18px; padding-left: 4px; }
  .pathway li { grid-template-columns: 20px minmax(0, 1fr); gap: 4px 12px; }
  .pathway li small { grid-column: 2; }
  .book-page,
  .js .flipbook .book-page { padding-inline: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .flipbook .book-page.is-leaving { animation: none; }
}
@media print {
  .glance-main { padding: 0; }
  .book-toolbar { display: none !important; }
  .reader-topline,
  .reader-start-button,
  .reader-help,
  .reader-position { display: none !important; }
  .js .flipbook .book-page { display: grid; position: relative; inset: auto; min-height: 0; overflow: visible; animation: none; transform: none; break-after: page; }
}
