/* Marston 1928 reader. Continuous scroll, one chapter in view, nothing measured.
   Built for _pm/_boss/orders/DISC_MARSTON.md. HTML is generated by _tools/marston/build_reader.py. */

@font-face { font-family: "Literata WT"; src: url("fonts/Literata-Roman.woff2?v=20260924c") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata WT"; src: url("fonts/Literata-Italic.woff2?v=20260924c") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans WT"; src: url("fonts/SourceSans3-Roman.woff2?v=20260924c") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans WT"; src: url("fonts/SourceSans3-Italic.woff2?v=20260924c") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

:root {
  --paper: #FBF9F4;
  --paper-2: #F3EFE6;
  --ink: #1E1C19;
  --ink-2: #57514A;
  --ink-3: #857D72;
  --rule: #E4DED3;
  --accent: #A8412F;
  --accent-ink: #FFFFFF;
  --mark: #F3DFA6;
  --flash: rgba(168, 65, 47, 0.10);
  --shadow: 0 1px 0 rgba(30, 28, 25, 0.06), 0 12px 32px rgba(30, 28, 25, 0.10);
  --wght: 400;
  --serif: "Literata WT", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: "Source Sans WT", "Segoe UI", system-ui, sans-serif;
  --ui: var(--sans);
  --body: var(--serif);
  --fs: 1.25rem;
  --measure: 34em;
  --lh: 1.62;
  --bar-h: 3.25rem;
  color-scheme: light;
}
html[data-theme="sepia"] {
  --paper: #F2E8D5;
  --paper-2: #E9DDC5;
  --ink: #33291F;
  --ink-2: #63533F;
  --ink-3: #8C7A62;
  --rule: #DCCCB0;
  --accent: #9A3D26;
  --mark: #E8C77F;
  --flash: rgba(154, 61, 38, 0.12);
}
html[data-theme="dark"] {
  --paper: #18141C;
  --paper-2: #221D27;
  --ink: #DDD6CB;
  --ink-2: #A69E93;
  --ink-3: #7F776E;
  --rule: #2F2935;
  --accent: #E8927F;
  --accent-ink: #18141C;
  --mark: #5B4A1F;
  --flash: rgba(232, 146, 127, 0.12);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.45);
  --wght: 370;
  color-scheme: dark;
}
html[data-size="1"] { --fs: 1rem; }
html[data-size="2"] { --fs: 1.125rem; }
html[data-size="3"] { --fs: 1.25rem; }
html[data-size="4"] { --fs: 1.4375rem; }
html[data-size="5"] { --fs: 1.6875rem; }
html[data-measure="narrow"] { --measure: 30em; }
html[data-measure="standard"] { --measure: 34em; }
html[data-measure="wide"] { --measure: 38em; }
html[data-font="sans"] { --body: var(--sans); --measure-adj: 1.04; }
@media (max-width: 30rem) {
  html:not([data-size]) , html[data-size="3"] { --fs: 1.1875rem; }
  html[data-size="4"] { --fs: 1.3125rem; }
  html[data-size="5"] { --fs: 1.5rem; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + var(--fs) * var(--lh)); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-variation-settings: "wght" var(--wght);
  font-weight: var(--wght);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden]:not([hidden="until-found"]) { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.skip { position: absolute; left: 0.75rem; top: -4rem; z-index: 60; background: var(--ink); color: var(--paper); padding: 0.75rem 1rem; font-family: var(--ui); }
.skip:focus { top: 0.75rem; }

/* ---------- Top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 40;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 0.25rem;
  padding: 0 max(0.5rem, env(safe-area-inset-right)) 0 max(0.5rem, env(safe-area-inset-left));
  background: var(--paper);
  font-family: var(--ui);
  font-variation-settings: normal; font-weight: 400;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.bar.scrolled { border-bottom-color: var(--rule); }
.bar-home { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; height: 2.75rem; color: var(--ink-2); text-decoration: none; border-radius: 0.5rem; }
.bar-home svg { width: 1.375rem; height: 1.375rem; }
.bar-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; line-height: 1.2; padding: 0 0.25rem; }
.bar-book { font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.bar-chapter { font-family: var(--serif); font-size: 0.9375rem; line-height: 1.15; color: var(--ink); }
.bar-sub { display: none; font-size: 0.75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) { .bar-book, .bar-chapter .t, .bar-meta { display: none; } html.js .bar-sub { display: block; } .bar-chapter .roman { color: var(--ink); font-size: 1rem; letter-spacing: 0.04em; } }
@media (max-width: 30rem) { .bar-home { display: none; } .bar { padding-left: 0.25rem; } }
.drawer-home { display: flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; margin: 1.25rem 0 0; color: var(--ink-2); text-decoration: none; font-size: 0.9375rem; }
.drawer-home svg { width: 1.25rem; height: 1.25rem; }
@media (max-width: 30rem) { .bar-meta .pg-now { display: none; } }
.bar-chapter .roman { font-variant-caps: all-small-caps; letter-spacing: 0.06em; color: var(--ink-2); margin-right: 0.35em; white-space: nowrap; }
.bar-meta { font-size: 0.8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; padding: 0 0.375rem; }
.bar-meta .pg-now { color: var(--ink-3); margin-right: 0.5rem; }
.ibtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  min-width: 2.75rem; height: 2.75rem; padding: 0 0.5rem;
  background: transparent; border: 0; border-radius: 0.5rem; cursor: pointer;
  color: var(--ink-2); text-decoration: none; font-size: 0.875rem;
}
.ibtn:hover { background: var(--paper-2); color: var(--ink); }
.ibtn[aria-expanded="true"] { color: var(--accent); background: var(--paper-2); }
.ibtn svg { width: 1.25rem; height: 1.25rem; flex: none; }
.ibtn .lbl { display: none; }
@media (min-width: 64rem) { .ibtn .lbl { display: inline; } .ibtn { padding: 0 0.75rem; } }
.bar-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; pointer-events: none; }
.bar-progress i { display: block; height: 100%; width: 0; background: var(--accent); transform-origin: left; }
.nojs-only { }
html.js .nojs-only { display: none !important; }
html:not(.js) .js-only { display: none !important; }

/* ---------- Layout ---------- */
.page {
  display: grid;
  grid-template-columns: minmax(1rem, 1fr) minmax(0, var(--measure)) minmax(1rem, 1fr);
  font-size: var(--fs);
  line-height: var(--lh);
  padding-bottom: 6rem;
}
.page > * { grid-column: 2; min-width: 0; }
@media (min-width: 48rem) {
  .page { grid-template-columns: minmax(4.5rem, 1fr) minmax(0, var(--measure)) minmax(4.5rem, 1fr); }
}

/* ---------- Title page ---------- */
.titlepage { text-align: center; padding: 4.5rem 0 3.5rem; }
.titlepage .tp-series { font-family: var(--serif); font-size: 0.72em; letter-spacing: 0.08em; font-variant-caps: all-small-caps; color: var(--ink-3); margin: 0 0 2.75rem; line-height: 1.5; }
.titlepage h1 { font-weight: 400; font-size: clamp(2.1rem, 1.2rem + 4.2vw, 3.6rem); line-height: 1.08; letter-spacing: 0.02em; font-variant-caps: small-caps; margin: 0; font-variation-settings: "wght" calc(var(--wght) - 20), "opsz" 72; text-wrap: balance; }
.titlepage .tp-author { margin: 1.6rem 0 0; font-size: 1em; font-style: italic; color: var(--ink-2); }
.titlepage .tp-imprint { margin: 3.25rem 0 0; font-size: 0.78em; line-height: 1.6; color: var(--ink-2); font-variant-numeric: oldstyle-nums; }
.titlepage .tp-note { margin: 2.75rem auto 0; max-width: 28em; font-family: var(--ui); font-size: 0.8125rem; line-height: 1.55; color: var(--ink-3); text-wrap: pretty; }
.titlepage .tp-begin { display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: 1.75rem; padding: 0 1.25rem; font-family: var(--ui); font-size: 0.9375rem; color: var(--accent); text-decoration: none; border: 1px solid var(--rule); border-radius: 999px; }
.titlepage .tp-begin:hover { border-color: var(--accent); }

/* ---------- Contents (no-JS inline copy and the drawer share this) ---------- */
.toc { font-family: var(--serif); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc > ol > li { border-top: 1px solid var(--rule); }
.toc a.toc-ch { display: grid; grid-template-columns: 3.25rem 1fr auto; align-items: baseline; gap: 0.5rem; min-height: 2.75rem; padding: 0.625rem 0.25rem; text-decoration: none; line-height: 1.35; }
.toc a.toc-ch .n { font-variant-caps: all-small-caps; letter-spacing: 0.06em; color: var(--ink-3); }
.toc a.toc-ch .p { font-family: var(--ui); font-size: 0.8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.toc a.toc-ch[aria-current="true"] { color: var(--accent); }
.toc ol ol { padding: 0 0 0.625rem 3.75rem; }
.toc ol ol a { display: block; padding: 0.375rem 0; min-height: 2.75rem; font-size: 0.875em; font-style: italic; color: var(--ink-2); text-decoration: none; line-height: 1.35; display: flex; align-items: center; }
.toc a:hover { color: var(--accent); }
.contents-inline { margin: 0 0 4rem; font-size: 0.95em; }
.contents-inline h2 { font-size: 0.8em; font-variant-caps: all-small-caps; letter-spacing: 0.1em; color: var(--ink-3); font-weight: 400; }

/* ---------- Chapters ---------- */
.chapter { padding-top: 3.5rem; }
html.js .chapter[hidden="until-found"], html.js .chapter[hidden] { display: none; }
@supports selector(:is(a)) { html.js .chapter[hidden="until-found"] { display: block; content-visibility: hidden; } }
html:not(.js) .chapter + .chapter { border-top: 1px solid var(--rule); margin-top: 3rem; }
.chapter-head { text-align: center; margin: 0 0 2.75em; }
.chapter-label { margin: 0 0 0.75rem; font-size: 0.8em; letter-spacing: 0.14em; font-variant-caps: all-small-caps; color: var(--accent); }
.chapter-head h2 { margin: 0; font-weight: 400; font-size: clamp(1.75rem, 1.1rem + 2.6vw, 2.6rem); line-height: 1.15; letter-spacing: 0.015em; font-variant-caps: small-caps; font-variation-settings: "wght" var(--wght), "opsz" 60; text-wrap: balance; }
.chapter-head .ch-pages { margin: 0.9rem 0 0; font-family: var(--ui); font-size: 0.8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.chapter p { margin: 0; text-indent: 1.5em; hanging-punctuation: first allow-end; text-wrap: pretty; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; font-variant-numeric: oldstyle-nums proportional-nums; position: relative; }
.chapter p.first, .chapter h3 + p, .chapter .chapter-head + p { text-indent: 0; }
.chapter p.first .lead { font-variant-caps: small-caps; letter-spacing: 0.04em; }
.chapter h3 { margin: 2.2em 0 0.55em; font-size: 1em; line-height: 1.35; font-style: italic; font-weight: 400; font-variation-settings: "wght" calc(var(--wght) + 60); text-wrap: balance; position: relative; }
.chapter em, .chapter i { font-style: italic; }
.flash { animation: flash 2.4s ease-out 1; }
@keyframes flash { 0%, 35% { background: var(--flash); box-shadow: -0.5rem 0 0 var(--flash), 0.5rem 0 0 var(--flash); } 100% { background: transparent; box-shadow: none; } }

/* tables, lists, verse and figures printed in the 1928 edition */
.table-wrap { position: relative; margin: 1.6em 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 0.86em; line-height: 1.45; font-variant-numeric: oldstyle-nums; }
.table-wrap caption { caption-side: top; text-align: left; font-style: italic; padding: 0 0 0.6em; color: var(--ink); }
.table-wrap th { text-align: left; font-weight: 400; font-style: italic; color: var(--ink-2); padding: 0.35em 0.75em 0.45em 0; border-bottom: 1px solid var(--rule); vertical-align: bottom; }
.table-wrap td { padding: 0.5em 0.75em 0.5em 0; vertical-align: top; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap td:first-child { width: 34%; }
.plain-list { list-style: none; margin: 1em 0; padding: 0 0 0 1.5em; position: relative; }
.plain-list li { margin: 0 0 0.25em; text-indent: -1.5em; padding-left: 0; overflow-wrap: break-word; }
.verse { margin: 1.4em 0 1.4em 1.5em; padding: 0; position: relative; }
.verse p { text-indent: 0 !important; margin: 0 0 0.9em; font-style: italic; }
.fig { margin: 2em 0; position: relative; }
.fig img { display: block; width: 100%; height: auto; max-width: 34rem; margin: 0 auto; mix-blend-mode: multiply; }
html[data-theme="dark"] .fig img { filter: invert(0.86) sepia(0.12); mix-blend-mode: screen; }
.fig figcaption { margin: 0.8em auto 0; max-width: 34rem; font-size: 0.84em; line-height: 1.5; color: var(--ink-2); text-align: left; }

/* footnote references */
sup.fnref { font-size: 0.72em; line-height: 0; vertical-align: 0.42em; font-variant-numeric: lining-nums; }
sup.fnref a { text-decoration: none; color: var(--accent); padding: 0 0.12em; position: relative; }
sup.fnref a::after { content: ""; position: absolute; inset: -0.9rem -0.6rem; }

/* 1928 page markers */
.pg { font-family: var(--ui); font-style: normal; font-size: 0.6875rem; letter-spacing: 0.02em; color: var(--ink-3); font-variant-numeric: tabular-nums; user-select: none; -webkit-user-select: none; text-indent: 0; font-weight: 400; font-variation-settings: normal; }
.pg::before { content: attr(data-page); }
@media (min-width: 48rem) {
  .pg { position: absolute; left: -4rem; width: 3rem; text-align: right; line-height: calc(var(--fs) * var(--lh) / 0.6875); margin-top: 0; }
  .pg::after { content: ""; }
}
@media (max-width: 47.99rem) {
  .pg { display: inline-block; padding: 0 0.3em; margin: 0 0.1em; border-radius: 0.25em; background: var(--paper-2); line-height: 1.4; vertical-align: 0.12em; text-indent: 0; }
}

/* paragraph link (desktop hover) */
.plink { position: absolute; z-index: 30; width: 2.75rem; height: 2.75rem; display: none; align-items: center; justify-content: center; color: var(--ink-3); background: transparent; border: 0; border-radius: 0.5rem; cursor: pointer; text-indent: 0; }
.plink svg { width: 1rem; height: 1rem; }
html.js .plink:not([hidden]) { display: inline-flex; }
.plink:hover { color: var(--accent); }

/* notes */
.notes { margin: 3.5em 0 0; padding-top: 1.25em; border-top: 1px solid var(--rule); font-size: 0.84em; line-height: 1.55; color: var(--ink-2); }
.notes h3 { margin: 0 0 0.9em; font-style: normal; font-size: 0.9em; letter-spacing: 0.12em; font-variant-caps: all-small-caps; color: var(--ink-3); }
.notes ol { margin: 0; padding: 0; list-style: none; counter-reset: none; }
.notes li { display: grid; grid-template-columns: 2rem 1fr; gap: 0.25rem; margin: 0 0 0.75em; }
.notes li .fnno { color: var(--accent); font-variant-numeric: lining-nums; }
.notes li .fnpage { font-family: var(--ui); font-size: 0.8125rem; color: var(--ink-3); margin-left: 0.4em; white-space: nowrap; }
.notes a.fnback { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; margin: -0.8rem 0 -0.8rem 0.1rem; vertical-align: middle; color: var(--accent); text-decoration: none; font-family: var(--ui); font-size: 0.8125rem; }

/* chapter end navigation */
.chapter-end { margin: 4em 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; font-family: var(--ui); }
.chapter-end a { display: flex; flex-direction: column; gap: 0.25rem; min-height: 4.5rem; padding: 1rem 1.125rem; border: 1px solid var(--rule); border-radius: 0.75rem; text-decoration: none; }
.chapter-end a:hover { border-color: var(--accent); }
.chapter-end .k { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.chapter-end .t { font-family: var(--serif); font-size: 1.0625rem; line-height: 1.3; color: var(--ink); }
.chapter-end .next { text-align: right; grid-column: 2; }
.chapter-end .prev { grid-column: 1; }
@media (max-width: 36rem) { .chapter-end { grid-template-columns: 1fr; } .chapter-end .next, .chapter-end .prev { grid-column: 1; } .chapter-end .next { order: -1; } }

/* ---------- Drawers and sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 45; background: rgba(20, 16, 22, 0.32); opacity: 0; transition: opacity 0.2s ease; }
.scrim.open { opacity: 1; }
.drawer {
  position: fixed; z-index: 50; top: 0; bottom: 0; left: 0;
  width: min(24rem, 100vw); background: var(--paper); box-shadow: var(--shadow);
  display: flex; flex-direction: column; font-family: var(--ui);
  transform: translateX(-102%); transition: transform 0.24s ease; visibility: hidden;
}
.drawer.right { left: auto; right: 0; transform: translateX(102%); }
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.375rem 0.5rem 0.375rem 1.25rem; min-height: var(--bar-h); border-bottom: 1px solid var(--rule); }
.drawer-head h2 { margin: 0; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0.5rem 1.25rem 2rem; font-size: 1.0625rem; }
@media (max-width: 40rem) {
  .drawer.sheet { top: auto; left: 0; right: 0; width: 100%; max-height: 86vh; max-height: 86dvh; border-radius: 1rem 1rem 0 0; transform: translateY(102%); }
  .drawer.sheet.open { transform: none; }
}

/* insights rail: docked beside the text on wide screens, the text column recenters */
@media (min-width: 75rem) {
  .drawer.rail { top: var(--bar-h); width: 22rem; box-shadow: none; border-left: 1px solid var(--rule); transition: transform 0.24s ease; }
  html.rail-open .page { padding-right: 22rem; }
  html.rail-open .bar { padding-right: max(0.5rem, env(safe-area-inset-right)); }
}

/* settings */
.set-group { border: 0; margin: 0 0 1.5rem; padding: 0; min-width: 0; }
.set-group legend { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding: 0; margin: 0 0 0.625rem; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; border: 1px solid var(--rule); border-radius: 0.625rem; overflow: hidden; }
.seg label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 0.25rem; cursor: pointer; font-size: 0.9375rem; color: var(--ink-2); text-align: center; }
.seg label + label { border-left: 1px solid var(--rule); }
.seg input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg input:checked + span { color: var(--accent-ink); }
.seg label:has(input:checked) { background: var(--accent); color: var(--accent-ink); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -4px; }
.seg .swatch { display: inline-block; width: 0.875rem; height: 0.875rem; border-radius: 50%; margin-right: 0.4rem; border: 1px solid rgba(0,0,0,0.2); }
.seg .sz { font-family: var(--serif); }
.set-note { font-size: 0.8125rem; color: var(--ink-3); line-height: 1.5; margin: 0.5rem 0 0; }

/* search */
.search-form { display: flex; gap: 0.5rem; align-items: center; margin: 0.75rem 0 0.25rem; }
.search-form input { flex: 1; min-width: 0; min-height: 2.75rem; padding: 0 0.875rem; font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper-2); border: 1px solid var(--rule); border-radius: 0.625rem; }
.search-form input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.search-count { font-size: 0.8125rem; color: var(--ink-3); margin: 0.375rem 0 0.75rem; min-height: 1.25rem; }
.results { list-style: none; margin: 0; padding: 0; }
.results li + li { border-top: 1px solid var(--rule); }
.results a { display: block; padding: 0.75rem 0.125rem; text-decoration: none; min-height: 2.75rem; }
.results .r-ch { display: block; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.2rem; }
.results .r-snip { display: block; font-family: var(--serif); font-size: 0.9375rem; line-height: 1.45; color: var(--ink-2); }
.results mark, ::highlight(wt-search) { background: var(--mark); color: var(--ink); border-radius: 2px; }
.results a:hover .r-snip { color: var(--ink); }
.search-more { margin: 1rem 0; }

/* toast */
.toast { position: fixed; z-index: 55; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translate(-50%, 1rem); opacity: 0; visibility: hidden; display: flex; align-items: center; gap: 0.25rem; max-width: calc(100vw - 2rem); padding: 0.25rem 0.25rem 0.25rem 1rem; background: var(--ink); color: var(--paper); border-radius: 0.75rem; font-family: var(--ui); font-size: 0.9375rem; box-shadow: var(--shadow); transition: opacity 0.2s ease, transform 0.2s ease; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast .ibtn { color: var(--paper); }
.toast .ibtn:hover { background: rgba(255,255,255,0.12); color: var(--paper); }

/* selection toolbar */
.seltools { position: absolute; z-index: 35; display: flex; gap: 0.125rem; padding: 0.25rem; background: var(--ink); color: var(--paper); border-radius: 0.75rem; box-shadow: var(--shadow); font-family: var(--ui); }
.seltools .ibtn { color: var(--paper); font-size: 0.875rem; }
.seltools .ibtn .lbl { display: inline; }
.seltools .ibtn:hover { background: rgba(255,255,255,0.12); color: var(--paper); }

/* ---------- Insights ---------- */
.ins-mark { position: absolute; right: -3.25rem; top: 0; width: 2.75rem; height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; cursor: pointer; text-indent: 0; color: var(--accent); }
.ins-mark i { display: block; width: 0.625rem; height: 0.625rem; border-radius: 50%; border: 2px solid currentColor; background: var(--paper); }
.ins-mark[aria-expanded="true"] i, .ins-mark:hover i { background: currentColor; }
@media (max-width: 47.99rem) {
  .ins-mark { position: relative; right: auto; top: auto; width: 2.75rem; height: 1.5rem; vertical-align: -0.2em; margin: -0.625rem 0; }
  .ins-mark::after { content: ""; position: absolute; inset: -0.625rem 0; }
}
.ins-card { padding: 1rem 0; border-top: 1px solid var(--rule); }
.ins-card:first-child { border-top: 0; }
.ins-card h3 { margin: 0 0 0.375rem; font-family: var(--serif); font-size: 1.125rem; font-weight: 500; line-height: 1.3; }
.ins-card .ins-anchor { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: 0.8125rem; color: var(--ink-3); text-decoration: none; }
.ins-card p { margin: 0 0 0.5rem; font-size: 0.9688rem; line-height: 1.55; color: var(--ink-2); }
.ins-card .ins-tag { display: inline-block; font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.25rem; }
.ins-card.active h3 { color: var(--accent); }
.ins-locked { padding: 1.25rem 0 0; }
.ins-locked p { margin: 0 0 0.75rem; font-size: 0.9688rem; line-height: 1.55; color: var(--ink-2); }
.ins-locked a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--accent); font-weight: 600; text-decoration: none; }
.ins-demo { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin: 0.75rem 0 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .bar, .drawer, .scrim, .toast, .seltools, .chapter-end, .plink, .ins-mark { display: none !important; }
  html.js .chapter[hidden="until-found"], html.js .chapter[hidden] { display: block !important; content-visibility: visible !important; }
  body { background: #fff; color: #000; }
}
