/* ==========================================================
   Svjedočanstvo — stilovi
   ========================================================== */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --paper: #f3eee6;
  --ink: #26221e;
  --ink-2: #5f574e;
  --ink-3: #8a8177;
  --line: #e6ded2;
  --accent: #2c5a98;
  --accent-ink: #ffffff;
  --gold: #a5803f;
  --ivona: #a6435a;
  --ivan: #2c5a98;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 8px 24px rgba(40, 30, 20, .08);

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --scale: 1;
  --fs: calc(1.125rem * var(--scale));
  --measure: 40rem;
  --bar-h: 56px;
  color-scheme: light;
}

@media (min-width: 900px) {
  :root { --fs: calc(1.1875rem * var(--scale)); }
}

:root[data-size="1"] { --scale: .92; }
:root[data-size="3"] { --scale: 1.1; }
:root[data-size="4"] { --scale: 1.22; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131518;
    --surface: #1b1e22;
    --paper: #1d2126;
    --ink: #ebe5db;
    --ink-2: #b1a99d;
    --ink-3: #847d73;
    --line: #2d3238;
    --accent: #8fb4ea;
    --accent-ink: #0f1c2e;
    --gold: #d4b27a;
    --ivona: #ec9fb0;
    --ivan: #8fb4ea;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131518;
  --surface: #1b1e22;
  --paper: #1d2126;
  --ink: #ebe5db;
  --ink-2: #b1a99d;
  --ink-3: #847d73;
  --line: #2d3238;
  --accent: #8fb4ea;
  --accent-ink: #0f1c2e;
  --gold: #d4b27a;
  --ivona: #ec9fb0;
  --ivan: #8fb4ea;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs);
  line-height: 1.72;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 600; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 8px; font-family: var(--sans); font-size: 14px; }
.skip:focus { top: 12px; }

/* ---------- top bar ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60;
  background: var(--gold); transform-origin: 0 50%; transform: scaleX(0);
}
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}
.bar-title {
  flex: 1; min-width: 0;
  font-size: 15px; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink);
  text-decoration: none;
}
.bar-title span { color: var(--ink-3); font-weight: 500; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 40px; height: 40px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--ink);
}
.icon-btn:hover { background: var(--paper); }
.icon-btn svg { width: 20px; height: 20px; flex: none; }
.icon-btn .lbl { display: none; }
@media (min-width: 640px) { .icon-btn .lbl { display: inline; } }

.langs {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
}
.langs a {
  min-width: 38px; height: 32px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; text-decoration: none;
  font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--ink-2);
}
.langs a:hover { color: var(--ink); }
.langs a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* settings popover */
.settings {
  position: fixed; z-index: 70; top: calc(var(--bar-h) + 6px); right: 12px;
  width: min(300px, calc(100vw - 24px));
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  padding: 16px; font-family: var(--sans); font-size: 14px;
}
.settings[hidden] { display: none; }
.settings h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.settings .row { display: flex; gap: 6px; margin-bottom: 16px; }
.settings .row:last-child { margin-bottom: 0; }
.settings .row button {
  flex: 1; height: 40px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); font-weight: 500;
}
.settings .row button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.settings .size-a { font-family: var(--serif); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - var(--bar-h));
  display: grid; align-items: end;
  color: #fff;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; margin: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 25, 55, 0) 30%, rgba(10, 22, 45, .55) 62%, rgba(8, 16, 32, .86) 100%);
}
.hero-media figcaption { display: none; }
.hero-text { position: relative; z-index: 1; padding: 32px 20px 40px; max-width: 40rem; }
.eyebrow {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: #f1d7a3; margin: 0 0 14px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.3rem, 9vw, 4.5rem); line-height: 1.04; letter-spacing: -.015em;
  margin: 0 0 16px; text-wrap: balance;
}
.byline { font-family: var(--sans); font-size: 16px; font-weight: 500; margin: 0 0 22px; opacity: .92; }
.hero blockquote {
  margin: 0 0 26px; padding: 0 0 0 16px; border-left: 2px solid #f1d7a3;
  font-style: italic; font-size: 1.02em; line-height: 1.55; opacity: .95;
}
.hero blockquote cite { display: block; margin-top: 6px; font-family: var(--sans); font-style: normal; font-size: 13px; opacity: .8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 999px;
  font-family: var(--sans); font-size: 15px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: #fff; color: #142540; }
.btn-primary:hover { background: #f1ece3; }
.btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.06); }
.btn-ghost:hover { background: rgba(255,255,255,.14); }
.meta { margin: 18px 0 0; font-family: var(--sans); font-size: 13px; opacity: .78; }

@media (min-width: 900px) {
  .hero {
    color: var(--ink);
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    align-items: center; gap: clamp(32px, 5vw, 80px);
    max-width: 1240px; margin: 0 auto;
    padding: clamp(32px, 6vh, 72px) clamp(24px, 4vw, 48px);
    min-height: calc(100vh - var(--bar-h));
    overflow: visible;
  }
  .hero-text { order: 1; padding: 0; }
  .hero-media { order: 2; position: relative; inset: auto; justify-self: center; width: 100%; max-width: 440px; }
  .hero-media img { height: auto; aspect-ratio: 9 / 14; max-height: calc(100vh - var(--bar-h) - 120px); border-radius: 28px; box-shadow: var(--shadow); }
  .hero-media::after { display: none; }
  .hero-media figcaption { display: block; margin-top: 10px; text-align: center; font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); }
  .eyebrow { color: var(--gold); }
  .hero blockquote { border-color: var(--gold); color: var(--ink-2); }
  .byline { color: var(--ink-2); }
  .btn-primary { background: var(--accent); color: var(--accent-ink); }
  .btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
  .btn-ghost { color: var(--ink); border-color: var(--line); background: var(--surface); }
  .btn-ghost:hover { background: var(--paper); }
  .meta { color: var(--ink-3); opacity: 1; }
}

/* ---------- layout ---------- */
.layout { position: relative; }
.story { max-width: calc(var(--measure) + 40px); margin: 0 auto; padding: 8px 20px 40px; }

@media (min-width: 1200px) {
  .layout {
    display: grid;
    grid-template-columns: 280px minmax(0, var(--measure));
    justify-content: center; gap: 72px;
    padding: 0 32px;
  }
  .story { padding: 8px 0 40px; margin: 0; max-width: none; }
}

/* ---------- table of contents ---------- */
.toc {
  font-family: var(--sans); font-size: 14.5px;
  position: fixed; z-index: 80; top: 0; bottom: 0; left: 0;
  width: min(360px, 88vw);
  background: var(--surface); border-right: 1px solid var(--line);
  transform: translateX(-102%); transition: transform .28s ease;
  display: flex; flex-direction: column;
  visibility: hidden;
}
.toc.open { transform: none; visibility: visible; box-shadow: var(--shadow); }
.toc-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px 20px; border-bottom: 1px solid var(--line); }
.toc-head h2 { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.toc-list { overflow-y: auto; padding: 8px 8px 32px; flex: 1; overscroll-behavior: contain; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc .part { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); padding: 18px 12px 6px; }
.toc a {
  display: grid; grid-template-columns: 26px 1fr; gap: 4px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; line-height: 1.35;
}
.toc a:hover { background: var(--paper); color: var(--ink); }
.toc a .n { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12.5px; padding-top: 1px; }
.toc a .d { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.toc a.active { background: color-mix(in srgb, var(--accent) 11%, transparent); color: var(--ink); }
.toc a.active .n { color: var(--accent); }
.scrim { position: fixed; inset: 0; z-index: 75; background: rgba(10, 12, 16, .45); opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.show { opacity: 1; pointer-events: auto; }

@media (min-width: 1200px) {
  .toc {
    position: sticky; top: calc(var(--bar-h) + 24px); bottom: auto; z-index: 1;
    height: calc(100vh - var(--bar-h) - 48px);
    width: auto; transform: none; visibility: visible;
    background: transparent; border: 0;
    margin-top: 56px;
  }
  .toc.open { box-shadow: none; }
  .toc-head { border: 0; padding: 0 12px 4px; }
  .toc-head .icon-btn { display: none; }
  .toc-list { padding: 0 0 32px; scrollbar-width: thin; }
  .scrim { display: none; }
  .bar .js-toc-btn { display: none; }
}

/* ---------- story typography ---------- */
.story p { margin: 0 0 1.1em; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
@media (min-width: 900px) { .story p { hyphens: manual; -webkit-hyphens: manual; } }

.note {
  font-family: var(--sans); font-size: .8em; line-height: 1.6; color: var(--ink-2);
  background: var(--paper); border-radius: 14px; padding: 14px 18px; margin: 32px 0 8px;
}
.note strong { color: var(--ink); }

.part-title {
  text-align: center; margin: 72px 0 8px;
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--gold);
}
.part-title span { display: block; font-family: var(--serif); font-size: clamp(1.7rem, 5vw, 2.3rem); letter-spacing: -.01em; text-transform: none; color: var(--ink); font-weight: 600; margin-top: 6px; }

.ch { padding-top: 40px; }
.ch + .ch { margin-top: 24px; }
.ch-head { margin: 0 0 28px; padding-top: 36px; position: relative; text-align: center; }
.ch-head::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 15px; height: 15px; transform: translateX(-50%);
  background: var(--gold);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15'%3E%3Cpath d='M6.5 0h2v4.5H13v2H8.5V15h-2V6.5H2v-2h4.5z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15'%3E%3Cpath d='M6.5 0h2v4.5H13v2H8.5V15h-2V6.5H2v-2h4.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ch-num { display: block; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.ch h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.55rem, 5.2vw, 2.15rem); line-height: 1.18; letter-spacing: -.01em;
  margin: 0; text-wrap: balance;
}
.ch-sub { display: block; margin-top: 6px; font-style: italic; color: var(--ink-2); font-size: .95em; }
.ch-date { display: inline-block; margin-top: 12px; font-family: var(--sans); font-size: 13px; color: var(--ink-3); }
.ch h3 { font-family: var(--serif); font-weight: 600; font-size: 1.25em; margin: 1.8em 0 .6em; }

.first::first-letter {
  float: left; font-size: 3.6em; line-height: .86; font-weight: 600;
  padding: .06em .1em 0 0; color: var(--gold);
}

/* speaker tags */
.who {
  display: inline-block; vertical-align: .14em;
  font-family: var(--sans); font-size: .64em; font-weight: 700; line-height: 1;
  letter-spacing: .1em; text-transform: uppercase;
  padding: .42em .7em .38em; margin-right: .55em; border-radius: 999px;
}
.who.ivona { color: var(--ivona); background: color-mix(in srgb, var(--ivona) 12%, transparent); }
.who.ivan { color: var(--ivan); background: color-mix(in srgb, var(--ivan) 12%, transparent); }

/* scripture & quotes */
.scripture {
  margin: 1.8em 0; padding: 1.2em 1.4em;
  background: var(--paper); border-left: 3px solid var(--gold); border-radius: 0 14px 14px 0;
  font-style: italic; line-height: 1.65;
}
.scripture p { margin: 0 0 .6em !important; }
.scripture p:last-of-type { margin-bottom: 0 !important; }
.scripture cite, .verse cite { display: block; margin-top: .7em; font-family: var(--sans); font-style: normal; font-size: .72em; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.scripture .t { display: block; font-style: normal; font-weight: 600; margin-bottom: .4em; }

.epigraph { text-align: center; margin: 0 auto 2em; max-width: 32rem; font-style: italic; color: var(--ink-2); font-size: 1.05em; line-height: 1.55; }
.epigraph cite { display: block; margin-top: .5em; font-family: var(--sans); font-style: normal; font-size: .7em; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 600; }

.psalm { margin: 0 0 2em; padding: 1.4em 1.4em 1.2em; background: var(--paper); border-radius: 18px; }
.psalm h3 { margin: 0 0 .8em; font-family: var(--sans); font-size: .7em; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.psalm p { margin: 0 0 .55em !important; font-style: italic; line-height: 1.6; padding-left: 1.4em; text-indent: -1.4em; }
/* 2.25em × .62 ≈ 1.4em of the verse text, so wrapped lines align with the first */
.psalm sup { font-family: var(--sans); font-style: normal; font-size: .62em; font-weight: 600; color: var(--gold); display: inline-block; width: 2.25em; text-indent: 0; vertical-align: .35em; }

.prayer {
  margin: 2em 0; padding: 1.8em 1.2em;
  text-align: center; font-style: italic; line-height: 1.75;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.prayer p { margin: 0 !important; }
.prayer .amen { margin-top: .6em !important; font-style: normal; font-weight: 600; letter-spacing: .04em; }

.mail {
  margin: 1.4em 0 1.8em; padding: 1.1em 1.3em;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  font-style: italic; font-size: .95em;
}
.mail p { margin: 0 0 .5em !important; }
.mail ul { margin: 0; padding-left: 1.2em; }
.mail li { margin: .25em 0; }
.mail li::marker { color: var(--gold); }

.pull { font-size: 1.12em; font-style: italic; text-align: center; color: var(--ink); margin: 1.6em auto !important; max-width: 30rem; line-height: 1.5; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin: -0.2em 0 1.4em; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-family: var(--sans); font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink);
  line-height: 1.3;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip svg { width: 18px; height: 18px; color: #e0302a; flex: none; }

/* ---------- figures ---------- */
figure { margin: 2em 0; }
figcaption { margin-top: 10px; font-family: var(--sans); font-size: 13.5px; line-height: 1.5; color: var(--ink-3); text-align: center; }
.zoom { cursor: zoom-in; display: block; padding: 0; border: 0; background: none; width: 100%; }
.shot img, .wide img { border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.shot { max-width: 300px; margin-left: auto; margin-right: auto; }
.shot.sm { max-width: 260px; }
.shots { display: flex; gap: 14px; justify-content: center; align-items: flex-start; flex-wrap: nowrap; }
.shots .zoom { flex: 1 1 0; max-width: 260px; }
.shots + figcaption { margin-top: 12px; }
.wide img { width: 100%; }
.doc img { border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.doc .zoom + .zoom { margin-top: 10px; }

.exchange { display: grid; gap: 18px; margin: 2em 0; }
.exchange .letter {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  padding: 1.2em 1.3em; font-size: .95em;
}
.exchange .letter h4 { margin: 0 0 .8em; font-family: var(--sans); font-size: .68em; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.exchange .letter p { margin: 0 0 .6em !important; font-style: italic; }
.exchange .letter p.ref { font-style: normal; font-family: var(--sans); font-size: .75em; color: var(--ink-3); margin-top: -.3em !important; }
.exchange .letter p:last-child { margin-bottom: 0 !important; }
.exchange .pics { display: flex; gap: 12px; justify-content: center; }
.exchange .pics .zoom { max-width: 220px; flex: 1 1 0; }
.exchange .pics img { border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (min-width: 720px) {
  .exchange .pair { display: grid; grid-template-columns: 1fr 200px; gap: 20px; align-items: start; }
  .exchange .pair.two { grid-template-columns: 1fr 300px; }
}

/* ---------- testimonies of others ---------- */
.witness { border-top: 1px solid var(--line); }
.witness .ch-head { text-align: left; padding-top: 0; }
.witness .ch-head::before { display: none; }
.witness .ch-num { margin-bottom: 4px; }
.dateline { display: block; font-family: var(--sans); font-size: .72em; font-weight: 600; letter-spacing: .08em; color: var(--gold); margin: 1.6em 0 .4em; }

/* ---------- closing / footer ---------- */
.closing { text-align: center; margin: 64px 0 0; padding: 40px 0 0; border-top: 1px solid var(--line); }
.closing p { margin: 0 auto 1em; max-width: 32rem; }
.closing .sig { font-family: var(--sans); font-size: 14px; color: var(--ink-3); }
.closing .btn { margin-top: 8px; }
.closing .btn-primary { background: var(--accent); color: var(--accent-ink); }
.foot {
  margin-top: 56px; padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-family: var(--sans); font-size: 13px; color: var(--ink-3); text-align: center;
}
.foot nav { display: flex; gap: 16px; justify-content: center; margin-bottom: 10px; }
.foot a { color: var(--ink-2); }

.totop {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow);
  cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.totop.show { opacity: 1; transform: none; pointer-events: auto; }
.totop svg { width: 20px; height: 20px; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 90;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--bg);
  font-family: var(--sans); font-size: 14px; padding: 10px 10px 10px 18px; border-radius: 999px; box-shadow: var(--shadow);
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: inherit; font-weight: 600; }
.toast button { border: 0; background: transparent; color: inherit; opacity: .7; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; }

/* ---------- lightbox ---------- */
.lb {
  border: 0; padding: 0; margin: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
  background: rgba(8, 10, 14, .94);
}
.lb::backdrop { background: rgba(8, 10, 14, .94); }
.lb[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 56px 12px 16px; }
.lb img { max-width: 100%; max-height: calc(100vh - 140px); width: auto; height: auto; min-height: 0; border-radius: 10px; }
.lb .cap { margin: 0; max-width: 60ch; color: #e8e3da; font-family: var(--sans); font-size: 13.5px; line-height: 1.45; text-align: center; }
.lb .cap:empty { display: none; }
.lb .x {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.lb .x svg { width: 22px; height: 22px; }

@media print {
  .bar, .progress, .toc, .scrim, .totop, .toast, .hero-actions, .settings { display: none !important; }
  .hero { color: #000; min-height: 0; }
  .hero-media { display: none; }
  body { background: #fff; color: #000; font-size: 12pt; }
}
