/* Layout: a harbor keeper's logbook. Sticky top bar; a grouped page index at left; one reading
   column with framed read-aloud passages; a night-harbor hero band on the introduction page. */
:root {
  --bg: #eef2f1;
  --surface: #fbfcfc;
  --surface-2: #e3eae9;
  --line: #cdd8d7;
  --ink: #14232a;
  --muted: #52666c;
  --lamp: #93600f;
  --lamp-soft: rgba(147, 96, 15, 0.10);
  --sea: #2c6670;
  --stamp: #9a3a30;
  /* the hero band is always night, in either theme */
  --night: #0d161b;
  --night-2: #17252c;
  --night-ink: #e3eae9;
  --night-muted: #9aaeb3;
  --beam: #f0b85a;

  --display: "Fraunces", "Lora", Georgia, "Times New Roman", serif;
  --body: "Public Sans", "TeX Gyre Heros", "Liberation Sans", Arial, system-ui, sans-serif;
  --mono: "IBM Plex Mono", "DejaVu Sans Mono", ui-monospace, Menlo, monospace;

  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.55rem;
  --step-3: 2.1rem;
  --step-4: clamp(2.6rem, 6vw, 4.4rem);
  --measure: 68ch;
  --topbar-h: 56px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e161a; --surface: #142026; --surface-2: #1a2930; --line: #28393f;
    --ink: #dfe7e8; --muted: #90a3a8; --lamp: #f0b85a; --lamp-soft: rgba(240, 184, 90, 0.12);
    --sea: #86c2c8; --stamp: #e8968c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e161a; --surface: #142026; --surface-2: #1a2930; --line: #28393f;
  --ink: #dfe7e8; --muted: #90a3a8; --lamp: #f0b85a; --lamp-soft: rgba(240, 184, 90, 0.12);
  --sea: #86c2c8; --stamp: #e8968c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar-h) + 16px + env(safe-area-inset-top, 0px)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 30; background: var(--surface);
}
a { color: var(--sea); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--lamp); }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; border-radius: 3px; }
img, svg { max-width: 100%; }
.gutter {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 16px; min-height: var(--topbar-h);
  max-width: 1320px; margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font-family: var(--display); font-weight: 600; font-size: 1.12rem; letter-spacing: -0.005em; white-space: nowrap;
}
.brand svg { width: 26px; height: 26px; flex: none; color: var(--lamp); }
.brand:hover { color: var(--ink); }
.toplinks { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.toplinks a {
  color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  padding: 6px 10px; border-radius: 6px; white-space: nowrap;
}
.toplinks a:hover, .toplinks a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.toplinks a.sb { color: var(--ink); border: 1px solid var(--line); }
.menu-btn {
  margin-left: auto; display: none; align-items: center; gap: 8px;
  font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer;
}
.menu-btn svg { width: 16px; height: 16px; }
.menu-panel { border-top: 1px solid var(--line); background: var(--surface); max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
.menu-panel .navgroups { max-width: 1320px; margin: 0 auto; padding-block: 12px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 24px; }
@media (max-width: 1060px) {
  .toplinks { display: none; }
  .menu-btn { display: inline-flex; }
}

/* ---------- grouped navigation ---------- */
.navgroup h2 {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); margin: 14px 0 6px;
}
.navgroup ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.navgroup a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  text-decoration: none; color: var(--ink); font-size: 0.93rem; padding: 6px 10px; border-radius: 6px;
}
.navgroup a:hover { background: var(--surface-2); color: var(--ink); }
.navgroup a[aria-current="page"] { background: var(--lamp-soft); color: var(--ink); font-weight: 600; }
.navgroup .tag { font-family: var(--mono); font-size: 0.66rem; color: var(--muted); letter-spacing: 0.04em; }

/* ---------- content page layout ---------- */
.layout { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 40px; padding-block: 28px 64px; }
.sidebar { position: sticky; top: calc(var(--topbar-h) + 20px + env(safe-area-inset-top, 0px)); align-self: start; max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; padding-right: 4px; }
.sidebar .navgroup:first-child h2 { margin-top: 0; }
@media (max-width: 1060px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
}
.doc { display: grid; grid-template-columns: minmax(0, var(--measure)) 210px; gap: 48px; justify-content: start; }
.doc > * { min-width: 0; }
@media (max-width: 1260px) {
  .doc { grid-template-columns: minmax(0, var(--measure)); }
  .toc-side { display: none; }
}
@media (min-width: 1261px) {
  .toc-inline { display: none; }
}

/* page header */
.page-head { display: grid; gap: 10px; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.eyebrow-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.eyebrow {
  font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.stamp {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--stamp); border: 1.5px solid currentColor; border-radius: 3px; padding: 2px 7px 1px; transform: rotate(-2deg);
  display: inline-block; line-height: 1.4;
}
.stamp.safe { color: var(--sea); transform: none; }
.page-head h1 {
  font-family: var(--display); font-weight: 600; font-size: var(--step-3); line-height: 1.08; margin: 0;
  letter-spacing: -0.015em; text-wrap: balance;
}
.page-head .lede { margin: 0; color: var(--muted); font-size: 1.06rem; max-width: 60ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer;
  font: inherit; font-size: 0.9rem; font-weight: 600; line-height: 1.2;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px;
}
.btn:hover { border-color: var(--lamp); color: var(--ink); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn .size { font-family: var(--mono); font-size: 0.72rem; font-weight: 400; color: var(--muted); }
.btn.primary { background: var(--lamp); border-color: var(--lamp); color: var(--surface); }
.btn.primary .size { color: inherit; opacity: 0.8; }
.btn.primary:hover { filter: brightness(1.06); color: var(--surface); }
.btn.busy { opacity: 0.65; pointer-events: none; }

/* table of contents */
.toc-side { position: sticky; top: calc(var(--topbar-h) + 20px + env(safe-area-inset-top, 0px)); align-self: start; padding-top: 6px; }
.toc h2 { font-family: var(--mono); font-size: 0.7rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a { display: block; text-decoration: none; color: var(--muted); font-size: 0.86rem; line-height: 1.35; padding: 5px 0 5px 12px; margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--lamp); }
.toc-inline { margin: 18px 0 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.toc-inline ol { border-left: 0; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.toc-inline a { padding-left: 0; border-left: 0; }

/* ---------- prose ---------- */
.prose { font-size: 1.02rem; }
.prose > * { margin-block: 0 1em; }
.prose h2 {
  font-family: var(--display); font-weight: 600; font-size: var(--step-2); line-height: 1.2; letter-spacing: -0.01em;
  margin: 2.2em 0 0.7em; padding-top: 1.1em; border-top: 1px solid var(--line); text-wrap: balance;
}
.prose > h2:first-child { margin-top: 1.2em; border-top: 0; padding-top: 0; }
.prose h3 { font-family: var(--body); font-weight: 700; font-size: 1.04rem; margin: 1.8em 0 0.5em; letter-spacing: 0.005em; }
.prose p strong:first-child { font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-block: 0.3em; }
.prose li > ul, .prose li > ol { margin-top: 0.3em; }
.prose li::marker { color: var(--muted); }
.prose em { font-style: italic; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* read-aloud passages */
.prose blockquote {
  margin: 1.4em 0; padding: 16px 20px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  font-family: var(--display); font-size: 1.08rem; line-height: 1.55; font-style: italic;
  box-shadow: 0 1px 0 var(--line);
}
.prose blockquote::before {
  content: "Read aloud"; display: block; margin-bottom: 6px;
  font-family: var(--mono); font-style: normal; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--lamp);
}
.prose blockquote p { margin: 0 0 0.7em; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote + blockquote { margin-top: -0.6em; }
.prose blockquote + blockquote::before { content: none; }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.2em 0 1.4em; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.92rem; line-height: 1.45; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.prose tr:last-child td { border-bottom: 0; }
.prose th {
  font-family: var(--mono); font-weight: 500; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); background: var(--surface-2); white-space: nowrap;
}
.prose td { font-variant-numeric: tabular-nums; }
.prose table.sheet td:first-child { font-weight: 600; width: 38%; }
.prose table.sheet td { height: 2.4em; }

/* checklists */
.prose ul.checklist { list-style: none; padding-left: 0; }
.prose li.check { display: flex; gap: 10px; align-items: flex-start; }
.prose li.check .box { flex: none; width: 15px; height: 15px; margin-top: 0.3em; border: 1.5px solid var(--muted); border-radius: 3px; }

/* page footer navigation */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { display: grid; gap: 2px; text-decoration: none; color: var(--ink); padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
.pager a:hover { border-color: var(--lamp); color: var(--ink); }
.pager .dir { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.pager .t { font-family: var(--display); font-weight: 600; font-size: 1.08rem; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 520px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }

.site-foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.86rem; }
.site-foot .inner { max-width: 1320px; margin: 0 auto; padding-block: 22px 28px; display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }
.site-foot a { color: var(--muted); }

/* download status toast */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  max-width: min(92vw, 460px); z-index: 40;
  background: var(--ink); color: var(--bg); border-radius: 10px; padding: 10px 16px; font-size: 0.9rem; box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}

/* ---------- introduction page ---------- */
.hero { background: var(--night); color: var(--night-ink); position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 45%;
  background: linear-gradient(to top, rgba(154, 174, 179, 0.16), transparent);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding-block: 64px 72px;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 40px; align-items: center;
}
.hero .eyebrow { color: var(--night-muted); }
.hero h1 {
  font-family: var(--display); font-weight: 600; font-size: var(--step-4); line-height: 0.98; letter-spacing: -0.025em;
  margin: 14px 0 22px; text-wrap: balance;
}
.hero .lede { font-size: 1.16rem; line-height: 1.6; color: var(--night-ink); max-width: 56ch; margin: 0 0 14px; }
.hero .lede.second { color: var(--night-muted); font-size: 1.02rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero .btn { background: transparent; color: var(--night-ink); border-color: rgba(227, 234, 233, 0.32); }
.hero .btn:hover { border-color: var(--beam); color: var(--night-ink); }
.hero .btn.primary { background: var(--beam); border-color: var(--beam); color: var(--night); }
.hero .btn.primary:hover { color: var(--night); }
.light {
  position: relative; aspect-ratio: 1; width: min(100%, 360px); justify-self: center; max-width: 100%;
  display: grid; place-items: center;
}
.light .beam {
  position: absolute; inset: -40%; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 300deg, rgba(240, 184, 90, 0.05) 318deg, rgba(240, 184, 90, 0.34) 342deg, rgba(240, 184, 90, 0.05) 356deg, transparent 360deg);
  animation: sweep 16s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 18%, rgba(0,0,0,0.6) 45%, transparent 70%);
          mask: radial-gradient(circle, #000 18%, rgba(0,0,0,0.6) 45%, transparent 70%);
}
.light .glow { position: absolute; width: 46%; height: 46%; border-radius: 50%; background: radial-gradient(circle, rgba(240, 184, 90, 0.28), transparent 70%); }
.light svg.mark { position: relative; width: 44%; height: 44%; color: var(--beam); }
@keyframes sweep { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .light .beam { animation: none; transform: rotate(-30deg); } }
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); padding-block: 40px 48px; gap: 8px; }
  .light { width: 170px; order: -1; justify-self: start; }
}

.intro-main { max-width: 1180px; margin: 0 auto; padding-block: 8px 72px; display: grid; gap: 72px; }
.section-head { display: grid; gap: 6px; margin-bottom: 26px; max-width: 64ch; }
.section-head h2 { font-family: var(--display); font-weight: 600; font-size: var(--step-3); line-height: 1.1; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
.section-head p { margin: 0; color: var(--muted); }
.intro-main > section:first-child { padding-top: 56px; }

.plays { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.plays div { display: grid; gap: 6px; align-content: start; padding-top: 14px; border-top: 2px solid var(--ink); }
.plays h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: var(--step-1); }
.plays p { margin: 0; color: var(--muted); font-size: 0.97rem; }
@media (max-width: 900px) { .plays { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .plays { grid-template-columns: minmax(0, 1fr); } }

.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.case {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 18px; align-items: start;
  text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 2px 10px 10px 10px;
  padding: 20px 22px 20px; margin-top: 14px;
}
.case::before {
  /* the folder tab */
  content: attr(data-tab); position: absolute; left: -1px; top: -24px; height: 24px; padding: 4px 14px 0;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0;
  font-family: var(--mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); white-space: nowrap;
  max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis;
}
.case:hover { border-color: var(--lamp); color: var(--ink); }
.case:hover::before { border-color: var(--lamp); }
.case svg.mark { grid-row: span 3; width: 42px; height: 42px; color: var(--lamp); margin-top: 3px; }
.case h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.4rem; line-height: 1.2; }
.case p { margin: 0; color: var(--muted); font-style: italic; font-family: var(--display); font-size: 1.04rem; }
.case .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 8px; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.03em; }
.case.sealed { grid-column: 1 / -1; background: var(--night); color: var(--night-ink); border-color: var(--night); }
.case.sealed::before { background: var(--night); border-color: var(--night); color: var(--night-muted); }
.case.sealed:hover, .case.sealed:hover::before { border-color: var(--beam); color: var(--night-ink); }
.case.sealed svg.mark { color: var(--beam); }
.case.sealed p, .case.sealed .meta { color: var(--night-muted); }
.case.sealed .stamp { color: var(--beam); }
.order-note { margin: 22px 0 0; color: var(--muted); font-size: 0.95rem; max-width: 70ch; }
@media (max-width: 760px) { .cases { grid-template-columns: minmax(0, 1fr); } }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 28px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: 2px 12px; align-items: baseline; }
.steps li::before { content: counter(step); grid-row: span 2; font-family: var(--display); font-weight: 600; font-size: 1.9rem; line-height: 1; color: var(--lamp); }
.steps h3 { margin: 0; font-size: 1.02rem; font-weight: 700; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: minmax(0, 1fr); } }

.library { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.library h3 { margin: 0 0 4px; font-family: var(--mono); font-size: 0.72rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.library ul { list-style: none; margin: 0; padding: 0; }
.library li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.library li a.title { font-weight: 600; text-decoration: none; color: var(--ink); }
.library li a.title:hover { color: var(--lamp); }
.library li .desc { grid-column: 1; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.library li .pdf { grid-row: 1 / span 2; grid-column: 2; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer;
  text-decoration: none; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px;
}
.icon-btn:hover { color: var(--ink); border-color: var(--lamp); }
.icon-btn svg { width: 14px; height: 14px; }
@media (max-width: 960px) { .library { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

.files { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 28px; align-items: start; }
.bundle {
  background: var(--night); color: var(--night-ink); border-radius: 12px; padding: 26px; display: grid; gap: 12px;
}
.bundle h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: var(--step-2); line-height: 1.15; }
.bundle p { margin: 0; color: var(--night-muted); }
.bundle ul { margin: 0; padding-left: 1.1em; color: var(--night-muted); font-size: 0.93rem; }
.bundle .btn.primary { background: var(--beam); border-color: var(--beam); color: var(--night); justify-self: start; margin-top: 6px; }
.filelist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.filelist li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 2px 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.filelist .kind { grid-row: span 2; font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.06em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; text-align: center; padding: 6px 0; }
.filelist .name { font-weight: 600; }
.filelist .desc { grid-column: 2; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.filelist .btn { grid-row: 1 / span 2; grid-column: 3; }
.save-note { margin: 14px 0 0; font-size: 0.86rem; color: var(--muted); }
@media (max-width: 860px) { .files { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) {
  .filelist li { grid-template-columns: minmax(0, 1fr) auto; }
  .filelist .kind { display: none; }
  .filelist .desc { grid-column: 1; }
  .filelist .btn { grid-column: 2; }
}

/* ---------- print (also used to make the PDF versions) ---------- */
@media print {
  :root, :root[data-theme="dark"] {
    --bg: #ffffff; --surface: #ffffff; --surface-2: #eef2f1; --line: #c9d3d2; --ink: #111c21; --muted: #4c5f65;
    --lamp: #8a5a0e; --lamp-soft: transparent; --sea: #24575f; --stamp: #8f342b; color-scheme: light;
  }
  body { font-size: 10.5pt; line-height: 1.5; }
  body::before, .topbar, .sidebar, .toc-side, .toc-inline, .page-actions, .pager, .site-foot, .toast { display: none !important; }
  .layout { display: block; padding: 0; max-width: none; }
  .doc { display: block; }
  .gutter { padding-left: 0; padding-right: 0; }
  .page-head { border-bottom: 1.5pt solid var(--ink); padding-bottom: 10pt; }
  .page-head h1 { font-size: 24pt; }
  .prose { font-size: 10.5pt; }
  .prose h2 { break-after: avoid; font-size: 16pt; margin-top: 18pt; }
  .prose h2:not(:first-child) { break-before: auto; }
  .prose h3 { break-after: avoid; }
  .prose blockquote, .table-wrap, .prose tr, .prose li { break-inside: avoid; }
  .prose blockquote { box-shadow: none; }
  .table-wrap { overflow: visible; border-radius: 0; }
  a { color: inherit; text-decoration: none; }
}

/* blank character sheet download, inline in the prose */
.prose .sheet-dl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 4px 0 18px; }
.prose .sheet-dl .btn { text-decoration: none; }
.prose .sheet-dl > span { color: var(--muted); font-size: .95rem; }
@media print { .prose .sheet-dl { display: none !important; } }

/* the old song */
.song-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 40px; align-items: center;
  background: var(--night); color: var(--night-ink); border-radius: 16px; padding: 28px clamp(18px, 4vw, 36px); color-scheme: dark; }
.song-card .eyebrow { color: var(--beam); }
.song-text h2 { font-family: var(--display); font-weight: 600; font-size: var(--step-3); line-height: 1.1; margin: 6px 0 10px; }
.song-text p { margin: 0; color: var(--night-muted); max-width: 52ch; }
.song-play { display: grid; gap: 12px; justify-items: start; }
.song-play audio { width: 100%; }
.song-play .btn { background: transparent; color: var(--night-ink); border-color: var(--night-muted); }
.song-play .btn:hover { border-color: var(--beam); color: var(--beam); }
@media (max-width: 720px) { .song-card { grid-template-columns: 1fr; } }
