/*
 * AI Fundamentals reader v5.
 * ImageGen supplies one continuous page frame. CSS positions the finished
 * artwork and the live, accessible title, controls, headings and book copy.
 */

#reader.on {
  padding: 0;
  place-items: start center;
  overflow: hidden;
  background: #fffdfb;
}

#reader .book--reference-zine {
  --ink: #11183b;
  --violet: #7040d0;
  --cyan: #18bdd5;
  position: relative;
  width: 100dvw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fffdfb;
  box-shadow: none;
  color: var(--ink);
}

.book--reference-zine .reader-pop-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: auto;
  overflow: hidden;
  border: 0;
  background: none;
  pointer-events: none;
}
.book--reference-zine .reader-page-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.book--reference-zine .reader-pop-frame::before { content: none; }
.book--reference-zine .reader-motif { filter: drop-shadow(3px 5px 0 rgba(55, 32, 105, .18)); }
.book--reference-zine .reader-motif-cursor { top: 3.5%; left: 2.1%; width: 5.3%; }
.book--reference-zine .reader-motif-lightning { top: 23%; left: 1.8%; width: 4.3%; }
.book--reference-zine .reader-motif-star { top: 45%; right: auto; bottom: auto; left: 5.1%; width: 3.2%; }
.book--reference-zine .reader-motif-cassette { top: 51%; left: -.6%; width: 12.5%; }
.book--reference-zine .reader-motif-computer { bottom: 3%; left: 1.1%; width: 10.5%; }
.book--reference-zine .reader-motif-star-right { right: 1.1%; bottom: 17%; width: 5.5%; }
.book--reference-zine .reader-motif-star-right-small { right: 4.4%; bottom: 31%; width: 2.9%; }

.book--reference-zine > .band,
.book--reference-zine > .body,
.book--reference-zine > .correction-desk { position: relative; z-index: 3; }
.book--reference-zine > .band { z-index: 20; }

.book--reference-zine .band {
  display: grid;
  flex-shrink: 0;
  min-height: 190px;
  padding: 38px 58px 18px max(184px, calc(13vw + 24px));
  grid-template-columns: minmax(500px, 1fr) auto;
  align-items: center;
  gap: 28px;
  border: 0;
  background: transparent;
  color: #0f1744;
}
.book--reference-zine .band > div:first-child { width: auto; min-width: 0; flex: 1 1 auto; }
.book--reference-zine .band .m { display: none; }
.book--reference-zine .band .t {
  display: flex;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  align-items: baseline;
  gap: 12px;
  border: 0;
  color: #11163f;
  font-family: 'Jost', system-ui, sans-serif;
  font-size: clamp(72px, 6.2vw, 92px);
  font-weight: 950;
  line-height: .96;
  letter-spacing: -.065em;
  text-shadow: none;
  white-space: nowrap;
}
.book--reference-zine .band .t:not(:has(.reader-title-lead)) { font-size: 48px; letter-spacing: -.035em; }
.book--reference-zine .reader-title-lead { font-size: 1.22em; line-height: .9; letter-spacing: -.09em; transform: none; }
.book--reference-zine .reader-title-name {
  position: relative;
  padding: 0 5px 15px 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: .68em;
  font-weight: 800;
  letter-spacing: -.045em;
}
.book--reference-zine .reader-title-name::after {
  content: none;
}
.book--reference-zine .reader-title-brush {
  position: absolute;
  right: 0;
  bottom: -20px;
  left: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 25px;
  object-fit: fill;
  pointer-events: none;
}
.book--reference-zine .reader-title-number {
  padding-bottom: 2px;
  color: #6f3ac9;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1em;
  font-weight: 800;
  letter-spacing: -.04em;
}

.book--reference-zine .reader-actions {
  display: flex;
  width: auto;
  min-width: 510px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin: 18px 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.book--reference-zine .reader-actions > * { flex: 0 0 auto; white-space: nowrap; }
.book--reference-zine .reader-save-book,
.book--reference-zine .reader-top,
.book--reference-zine .band button:not(.puffy-btn) {
  min-height: 44px;
  margin: 0;
  padding: 8px 11px;
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font: 850 11px/1.1 'Jost', system-ui, sans-serif;
  letter-spacing: .015em;
  text-transform: none;
}
.book--reference-zine .reader-save-book {
  width: 48px;
  padding: 4px;
  gap: 0;
  border: 2px solid #372080;
  border-radius: 10px;
  background: #fff;
  box-shadow: 4px 4px 0 #18c6d8;
}
.book--reference-zine .reader-save-book img { width: 35px; height: 35px; }
.book--reference-zine .reader-save-book span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.book--reference-zine .reader-top { min-width: 70px; border-right: 1px solid #bfc3d3; border-left: 1px solid #bfc3d3; text-transform: uppercase; }
.book--reference-zine .band #reader-close { padding: 11px 16px; border: 2px solid #18c6d8; border-radius: 9px; background: #fff; }
.book--reference-zine .band #reader-report { padding: 11px 5px; color: #303858; font-size: 11px; }
.book--reference-zine .band .reader-actions .reader-save-book { margin-left: auto; }
.book--reference-zine .band .reader-actions > .reader-save-book,
.book--reference-zine .band .reader-actions > .reader-top {
  height: 44px;
  border: 1px solid #7a59bd;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}
.book--reference-zine .band .reader-actions > .reader-save-book { width: 44px; padding: 4px; }

.book--reference-zine .reader-contents { position: relative; inset: auto; z-index: 25; margin: 0; }
.book--reference-zine .reader-contents > summary {
  display: flex;
  width: auto;
  min-height: 42px;
  padding: 9px 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid #7a59bd;
  border-radius: 8px;
  background: rgba(255, 255, 255, .97);
  color: #5e36b2;
  box-shadow: none;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  writing-mode: horizontal-tb;
  transform: none;
}
.book--reference-zine .reader-contents > summary::before,
.book--reference-zine .reader-contents > summary::after { content: none; }
.book--reference-zine .reader-contents-label { font-weight: 950; }
.book--reference-zine .reader-contents > summary:hover { background: #f5f1ff; outline: 0; }
.book--reference-zine .reader-contents > summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.book--reference-zine .reader-contents-panel {
  display: none;
  height: 100%;
  padding: 30px 116px 70px 236px;
  overflow: auto;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  scroll-padding-top: 24px;
}
.book--reference-zine.contents-open .reader-contents-panel { display: block; }
.book--reference-zine.contents-open .txt { display: none; }
.book--reference-zine .reader-contents-heading {
  max-width: 920px;
  margin: 0 auto 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--cyan);
  color: #28345a;
  font: 900 18px/1.2 'Jost', system-ui, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.book--reference-zine .reader-contents-panel:focus { outline: 0; }
.book--reference-zine .reader-contents-panel > * { max-width: 920px; margin-right: auto; margin-left: 0; }
.book--reference-zine .reader-contents-panel a,
.book--reference-zine .reader-toc-group > summary { white-space: normal; overflow-wrap: anywhere; }
.book--reference-zine .reader-contents-panel a {
  display: flex;
  gap: 12px;
  padding: 11px 12px;
  color: #263654;
  text-decoration: none;
  font: 700 16px/1.38 'Jost', system-ui, sans-serif;
}
.book--reference-zine .reader-contents-panel .reader-toc-group { border-top: 1px solid #d8d2e8; }
.book--reference-zine .reader-contents-panel .reader-toc-group:first-child { border-top: 0; }
.book--reference-zine .reader-contents-panel .reader-toc-group > summary {
  min-height: 48px;
  padding: 12px;
  color: #263654;
  font: 850 16px/1.35 'Jost', system-ui, sans-serif;
}
.book--reference-zine .reader-contents-panel .toc-key { flex-basis: 32px; font-size: 14px; }
.book--reference-zine .reader-contents-panel .reader-toc-children { padding: 0 0 12px 38px; }
.book--reference-zine .reader-contents-panel .reader-toc-children a { border-left: 2px solid #d8d2e8; font-size: 16px; line-height: 1.4; }
.book--reference-zine .reader-contents-panel a:hover,
.book--reference-zine .reader-contents-panel a:focus-visible,
.book--reference-zine .reader-contents-panel a[aria-current='location'] { background: #f0ebfb; color: var(--ink); outline: 2px solid var(--cyan); outline-offset: -2px; }

.book--reference-zine .body {
  position: relative;
  display: block;
  flex: 1 1 0;
  height: calc(100dvh - 190px);
  min-height: 0;
  overflow: hidden;
  background: transparent;
}
.book--reference-zine .toc { display: none !important; }
.book--reference-zine .txt {
  height: 100%;
  /* The baked-in computer extends to x=280 of the 1487px frame. A 19%
     rail plus 24px clearance protects every scroll position. With centered
     object-fit:cover, horizontal cropping can only reduce that left extent. */
  padding: 6px 116px 80px calc(19vw + 24px);
  overflow: auto;
  background: rgba(255, 255, 255, .08);
  color: #1b2345;
  font-size: 19px;
  line-height: 1.62;
  scroll-padding-top: 20px;
}
.book--reference-zine .txt h1[tabindex='-1']:focus,
.book--reference-zine .txt h2[tabindex='-1']:focus,
.book--reference-zine .txt h3[tabindex='-1']:focus { outline: 0; }

.book--reference-zine .txt > .eyebrow:first-child,
.book--reference-zine .txt > h1:nth-child(2),
.book--reference-zine .txt > .lede:nth-child(3) { display: none; }
.book--reference-zine .txt section[data-source-block='preface-why-this-book-matters'] { position: relative; max-width: 1130px; margin: 0 auto; }
.book--reference-zine .txt .reader-preface-heading {
  position: relative;
  width: calc(100% - 285px);
  min-height: 136px;
  margin: 0 0 8px;
  padding: 10px 0 14px 158px;
  border: 0;
  color: var(--ink);
  font: 950 47px/1.09 'Jost', system-ui, sans-serif;
  letter-spacing: .015em;
  text-transform: uppercase;
}
.book--reference-zine .txt .reader-preface-heading::before {
  content: '01';
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  width: 128px;
  height: 128px;
  place-items: center;
  background: url('/assets/library-reader/preface-burst-v1.png') center / contain no-repeat;
  color: #fff;
  font: 850 43px/1 'Playfair Display', Georgia, serif;
}
.book--reference-zine .txt .reader-preface-heading > .reader-inline-save { display: none; }
.book--reference-zine .txt .reader-preface-heading::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -5px;
  left: 158px;
  height: 35px;
  background: url('/assets/library-reader/section-cyan-brush-v1.png') center / 100% 100% no-repeat;
}
.book--reference-zine .reader-preface-divider {
  position: absolute;
  top: 0;
  left: 118px;
  display: block;
  width: 25px;
  height: 140px;
  background: url('/assets/library-reader/preface-divider-v1.png') center / contain no-repeat;
}
.book--reference-zine .reader-preface-kicker,
.book--reference-zine .reader-preface-title { display: block; }
.book--reference-zine .txt .reader-preface-intro { max-width: 700px; margin-right: 330px; }
.book--reference-zine .reader-preface-aside {
  position: absolute;
  top: 4px;
  right: 0;
  display: grid;
  width: 285px;
  gap: 24px;
}
.book--reference-zine .reader-preface-card {
  margin: 0;
  padding: 18px;
  border: 2px solid;
  border-radius: 16px;
  background: rgba(255, 255, 255, .88);
  color: #151c44;
  box-shadow: none;
}
.book--reference-zine .reader-preface-card-label { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.book--reference-zine .reader-preface-card-label img { width: 42px; height: 44px; object-fit: contain; }
.book--reference-zine .reader-preface-card b { display: block; margin: 0; font: 950 12px/1.2 'Jost', system-ui, sans-serif; letter-spacing: .12em; }
.book--reference-zine .reader-preface-card p { margin: 0; font-size: 17px; line-height: 1.42; }
.book--reference-zine .reader-preface-card-why { min-height: 176px; border-color: var(--cyan); background: rgba(238, 253, 255, .9); }
.book--reference-zine .reader-preface-card-why b { color: #0aaec4; }
.book--reference-zine .reader-preface-card-job { min-height: 300px; border-color: var(--violet); background: rgba(247, 243, 255, .92); }
.book--reference-zine .reader-preface-card-job b { color: var(--violet); }
.book--reference-zine .txt section[data-source-block='preface-why-this-book-matters'] > h2:not(.reader-preface-heading) { clear: both; margin-top: 45px; }

#reader.on ~ .puffy-picker {
  width: min(360px, calc(100dvw - 24px)) !important;
  padding: 12px !important;
  border: 1px solid #9d8bc6 !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, .99) !important;
  box-shadow: 0 18px 45px rgba(11, 20, 52, .24) !important;
}
#reader.on ~ .puffy-picker .puffy-picker-head { margin-bottom: 8px; padding-bottom: 8px; }
#reader.on ~ .puffy-picker .puffy-picker-head b { font-size: 15px; }
#reader.on ~ .puffy-picker .puffy-picker-head span { font-size: 10.5px; line-height: 1.35; }
#reader.on ~ .puffy-picker .puffy-card-required-actions { gap: 8px; }
#reader.on ~ .puffy-picker .puffy-card-required-actions a,
#reader.on ~ .puffy-picker .puffy-card-required-actions button {
  min-height: 36px !important;
  padding: 7px 10px !important;
  border: 1px solid #7a689e !important;
  border-radius: 8px !important;
  background: #f7f3ff !important;
  color: var(--ink) !important;
  box-shadow: none !important;
  font-size: 11px !important;
  letter-spacing: .01em !important;
  text-transform: none !important;
}
#reader.on ~ .puffy-picker .puffy-card-required-actions a { border-color: #5e36b2 !important; background: #5e36b2 !important; color: #fff !important; }

/* Medium desktop: preserve the approved hierarchy without shrinking the page into a poster. */
@media (min-width: 821px) and (max-width: 1199px) {
  #reader .book--reference-zine { background: #fffdfb; }
  .book--reference-zine .reader-motif-cursor { width: 54px; }
  .book--reference-zine .reader-motif-lightning { width: 42px; }
  .book--reference-zine .reader-motif-cassette { width: 105px; }
  .book--reference-zine .reader-motif-computer { width: 92px; }
  .book--reference-zine .reader-motif-star { left: 48px; width: 28px; }
  .book--reference-zine .reader-motif-star-right { width: 45px; }
  .book--reference-zine .reader-motif-star-right-small { width: 25px; }
  .book--reference-zine .band { min-height: 170px; padding: 20px 24px 12px calc(9dvh + 24px); grid-template-columns: 1fr; grid-template-rows: auto auto; gap: 5px; align-items: start; }
  .book--reference-zine .band .t { font-size: 61px; line-height: .98; gap: 8px; }
  .book--reference-zine .band .t:not(:has(.reader-title-lead)) { font-size: 40px; }
  .book--reference-zine .reader-title-name { padding-bottom: 10px; }
  .book--reference-zine .reader-title-name::after { height: 25px; }
  .book--reference-zine .reader-actions { position: static; width: 100%; min-width: 0; margin: 3px 0 0; justify-content: flex-end; }
  .book--reference-zine .reader-contents { position: relative; inset: auto; }
  .book--reference-zine .body { height: calc(100dvh - 170px); }
  .book--reference-zine .txt { padding: 6px 34px 76px calc(9dvh + 24px); font-size: 17px; line-height: 1.58; }
  .book--reference-zine .txt .reader-preface-heading { width: calc(100% - 214px); min-height: 92px; margin-bottom: 7px; padding: 4px 0 8px 100px; font-size: 31px; }
  .book--reference-zine .txt .reader-preface-heading::before { width: 92px; height: 92px; font-size: 31px; }
  .book--reference-zine .txt .reader-preface-heading::after { left: 112px; width: calc(100% - 112px); height: 24px; }
  .book--reference-zine .reader-preface-divider { left: 86px; width: 18px; height: 102px; }
  .book--reference-zine .txt .reader-preface-intro { max-width: none; margin-right: 232px; }
  .book--reference-zine .reader-preface-aside { width: 204px; gap: 12px; }
  .book--reference-zine .reader-preface-card { padding: 13px; border-width: 2px; border-radius: 14px; }
  .book--reference-zine .reader-preface-card-label img { width: 32px; height: 34px; }
  .book--reference-zine .reader-preface-card b { font-size: 10px; }
  .book--reference-zine .reader-preface-card p { font-size: 14px; line-height: 1.4; }
  .book--reference-zine .reader-preface-card-why { min-height: 132px; }
  .book--reference-zine .reader-preface-card-job { min-height: 210px; }
}

/* Keep the controls out of the title when the protected margin leaves less
   horizontal room. This changes only header layout, not book typography. */
@media (min-width: 1200px) and (max-width: 1499px) {
  .book--reference-zine .band { grid-template-columns: 1fr; gap: 12px; padding-top: 24px; }
  .book--reference-zine .reader-actions { min-width: 0; justify-content: flex-end; }
}

/* Preserve the complete portrait rail at every window ratio. Full-height,
   intrinsic-width raster; any horizontal excess is blank paper, never motifs.
   Do not use cover here: it vertically crops the computer in wider panes. */
@media (max-width: 1199px) {
  .book--reference-zine .reader-page-art { width: auto; max-width: none; height: 100%; object-fit: contain; object-position: left top; }
  .book--reference-zine .reader-pop-frame { background: #f8f8f8; }
}

/* Mobile keeps the same visual vocabulary, with the controls and contents always reachable. */
@media (max-width: 820px) {
  #reader.on { place-items: center; background: #fff; }
  #reader .book--reference-zine {
    width: 100dvw;
    height: 100dvh;
    max-width: none;
    background: #fffdfb;
    box-shadow: none;
  }
  .book--reference-zine .reader-pop-frame { display: block; }
  /* The approved-family portrait rasters keep their coloured rail and motifs
     inside x=149 at heights1659/1660. Reserve9dvh plus a16px reading gap.
     Geometry is height-based because the full frame is never cover-cropped. */
  .book--reference-zine .band { display: grid; min-height: 126px; padding: 10px 10px 9px 40px; grid-template-columns: 1fr; gap: 5px; border-bottom: 3px solid var(--cyan); background: rgba(255, 253, 251, .96); }
  .book--reference-zine .band .t { font-size: clamp(31px, 9vw, 42px); line-height: .98; gap: 6px; }
  .book--reference-zine .band .t:not(:has(.reader-title-lead)) { font-size: 25px; line-height: 1; white-space: normal; }
  .book--reference-zine .reader-title-name { padding-bottom: 7px; font-size: .8em; }
  .book--reference-zine .reader-title-name::after { bottom: -4px; height: 19px; }
  .book--reference-zine .reader-title-number { font-size: .82em; }
  .book--reference-zine .reader-actions { width: 100%; min-width: 0; flex: 0 0 auto; margin: 0; justify-content: flex-start; gap: 3px; }
  .book--reference-zine .reader-save-book { width: 40px; height: 40px; min-height: 40px; }
  .book--reference-zine .reader-save-book img { width: 29px; height: 29px; }
  .book--reference-zine .reader-top { min-width: 52px; padding: 7px 6px; }
  .book--reference-zine .band #reader-close { margin-left: 0; padding: 8px 9px; }
  .book--reference-zine .band #reader-report { display: none; }
  .book--reference-zine .reader-contents { position: relative; inset: auto; order: 0; }
  .book--reference-zine .reader-contents > summary { min-height: 40px; padding: 7px 9px; letter-spacing: .03em; text-transform: none; }
  .book--reference-zine .body { height: calc(100dvh - 126px); }
  .book--reference-zine .reader-contents-panel { padding: 22px 18px 48px 48px; background: rgba(255, 255, 255, .97); }
  .book--reference-zine .reader-contents-heading { margin-bottom: 12px; font-size: 17px; }
  .book--reference-zine .reader-contents-panel a,
  .book--reference-zine .reader-contents-panel .reader-toc-group > summary { font-size: 16px; }
  .book--reference-zine .reader-contents-panel .reader-toc-children { padding-left: 28px; }
  .book--reference-zine .reader-contents-panel .reader-toc-children a { font-size: 16px; }
  .book--reference-zine .txt { height: 100%; padding: 20px 16px 70px calc(9dvh + 16px); font-size: 16px; line-height: 1.62; }
  .book--reference-zine .txt h2[data-source-block^='chapter-'],
  .book--reference-zine .txt h2[data-source-block^='part-'] { margin-left: 0; margin-right: 0; }
  .book--reference-zine .txt .reader-preface-heading { width: 100%; min-height: 78px; margin-bottom: 5px; padding: 5px 0 9px 76px; font-size: clamp(24px, 7.2vw, 32px); }
  .book--reference-zine .txt .reader-preface-heading::before { width: 64px; height: 64px; font-size: 22px; }
  .book--reference-zine .txt .reader-preface-heading::after { bottom: -2px; left: 72px; width: calc(100% - 72px); height: 19px; }
  .book--reference-zine .reader-preface-divider { display: none; }
  .book--reference-zine .txt .reader-preface-intro { max-width: none; margin-right: 0; }
  .book--reference-zine .reader-preface-aside { position: static; width: auto; margin: 22px 0 30px; gap: 12px; }
  .book--reference-zine .reader-preface-card { min-height: 0; padding: 15px 16px; border-width: 2px; border-radius: 13px; }
  .book--reference-zine .reader-preface-card-label img { width: 38px; height: 40px; }
  .book--reference-zine .reader-preface-card b { font-size: 10px; }
  .book--reference-zine .reader-preface-card p { font-size: 16px; }
}

/* The ImageGen artwork is the continuous page frame; all typography remains
   live so its scale and rhythm can follow the approved design responsively. */

@media (max-width: 420px) {
  .book--reference-zine .band { min-height: 122px; padding-left: 38px; }
  .book--reference-zine .band .reader-actions { width: calc(100% + 28px); margin-left: -28px; }
  .book--reference-zine .reader-contents > summary { min-height: 44px; }
  .book--reference-zine .band .t { font-size: 32px; }
  .book--reference-zine .body { height: calc(100dvh - 122px); }
  .book--reference-zine .txt { padding: 18px 14px 70px calc(9dvh + 16px); }
  .book--reference-zine .txt .reader-preface-heading { padding: 66px 0 9px; padding-right: 0 !important; font-size: 23px; }
  .book--reference-zine .txt .reader-preface-heading::before { width: 57px; height: 57px; font-size: 20px; }
  .book--reference-zine .txt .reader-preface-heading::after { left: 0; width: 100%; }
}

/* Display only the title area of the unchanged approved ImageGen reference.
   No retyped letters, synthetic rotation, or reconstructed underline. */
.book--reference-zine .band .t:has(.reader-title-art) { display: block; padding: 0; }
.reader-title-art {
  position: relative;
  display: block;
  width: min(100%, 650px);
  aspect-ratio: 650 / 155;
  overflow: hidden;
  clip-path: polygon(0 18%, 14% 0, 100% 0, 100% 100%, 0 100%);
}
.reader-title-art > img {
  position: absolute;
  display: block;
  width: 228.769231%;
  max-width: none;
  height: auto;
  left: -30.153846%;
  top: -38.709677%;
  margin: 0;
}
@media (max-width: 820px) {
  .reader-title-art { width: min(100%, 500px); }
}

@media (prefers-reduced-motion: reduce) {
  .book--reference-zine *,
  .book--reference-zine *::before,
  .book--reference-zine *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Companion editions use authored ImageGen lettering, not retyped approximations.
   The viewports trim empty paper only; every glyph and underline stays visible. */
.book--reference-zine .band .t:has(.reader-companion-title) { display: block; padding: 0; }
.reader-companion-title { display: block; position: relative; width: min(100%,650px); aspect-ratio: 2090/480; overflow: hidden; mix-blend-mode: multiply; }
.reader-companion-title > img { position: absolute; display: block; max-width: none; width: 103.9234%; height: auto; left: -1.9139%; top: -25%; }
[data-reader-edition="answers"] .reader-companion-title { aspect-ratio: 1880/720; }
[data-reader-edition="answers"] .reader-companion-title > img { width:104.8404%; left:-2.1277%; top:-5.5556%; }
[data-reader-edition="dictionary"] .reader-companion-title { aspect-ratio:1700/530; }
[data-reader-edition="dictionary"] .reader-companion-title > img { width:104.3529%; left:-2.3529%; top:-37.7358%; }
#reader .book[data-reader-edition="working"] { --edition-ink:#087787; --edition-edge:#15bce0; }
#reader .book[data-reader-edition="answers"] { --edition-ink:#a32170; --edition-edge:#f254a9; }
#reader .book[data-reader-edition="dictionary"] { --edition-ink:#2457c7; --edition-edge:#2457e6; }
#reader .book[data-reader-edition]:not([data-reader-edition="fundamentals"]) .reader-contents > summary,
#reader .book[data-reader-edition]:not([data-reader-edition="fundamentals"]) .band .reader-top,
#reader .book[data-reader-edition]:not([data-reader-edition="fundamentals"]) .band .reader-save-book { border-color:var(--edition-edge); color:var(--edition-ink); }
@media(max-width:820px){ .reader-companion-title{width:min(100%,500px)} }
@media(min-width:821px){
  .book--reference-zine .band:has(.reader-companion-title){mix-blend-mode:multiply;}
}
@media(max-width:420px){
  /* On the narrowest phones a save target gets a small row of its own,
     rather than squeezing ordinary heading words beside a 44px control. */
  .book--reference-zine .txt .reader-save-heading:not(.reader-preface-heading){padding-right:0!important;padding-top:44px;}
}
