/* Communion '27 · America: the print template for the two church packs, in Jasper and Gold.
   US Letter, read by pastors and printed on office printers; also readable on screen.

   tools/build_pack.py wraps each pack page (pack/sections/...) in this template. The classes a pack page may use
   are listed in README "Writing a pack page"; this file styles exactly those, plus the cover and the contents.
   The build adds the page-box words (pack name, DRAFT) in a small <style> block of its own.

   The design, for paper: white paper (never a tinted page), deep jasper ink, one green accent, gold hairlines,
   Instrument Serif for titles and Scripture, Figtree for text, softly rounded corners. Editorial and calm: large
   serif titles, generous margins, thin rules. Nothing prints as a heavy dark box (office printers, toner): the
   one band of deep jasper is on the cover. Tints are kept very pale so they survive a black-and-white copier as a faint
   grey at most, and every line a person writes on is printed in a mid green that a copier keeps. */

:root {
  /* Jasper and Gold, the website's look since 26 Nov 2026 (the jasper block of site/assets/css/tokens.css), set for
     white paper (Shane, 27 Nov: "make sure the brochures are done"). On the site the look is light on a dark
     ground; a printed page is the other way round, so its deep jasper green is the ink, and its bright green and
     gold are deepened until they read on white. A printed page wears no look switch: the values live here. */
  --ink: #063A2E;           /* the deep jasper (--dark-bg): titles, text, the band on the cover */
  --ink-2: #3E5A53;         /* secondary text, and the edge of anything written in */
  --accent: #0B7A5E;        /* jasper green (--accent #19D3A2), deepened to read on white: the one accent */
  --gold: #9C7415;          /* gold (--accent-2 #F2C14E), deepened for small marks and numbers on white */
  --line: #D3E4DE;          /* pale jade: decoration only */
  --screen: #E6EEEB;        /* the screen behind the sheets */
  --on-dark: #F3F0E8;       /* ivory (--on-dark): words on the green band */
  --on-dark-2: #B4C9C1;     /* --on-dark-2: quieter words on the green band */
  --danger: #A3182F;        /* a warning */
  --radius: 3px;            /* --radius */
  --radius-lg: 6px;         /* --radius-lg */
  --display: "Instrument Serif", "Didot", "Bodoni 72", "Times New Roman", serif;   /* --font-display */
  --text: "Figtree", "Segoe UI", system-ui, sans-serif;                            /* --font-text */
  --scripture: "Instrument Serif", "Didot", Georgia, serif;                         /* --font-scripture */

  /* Paper only, made from the colours above: tints a printer lays down as a whisper, never a block. */
  --paper: #FFFFFF;
  --tint: #F3F8F6;          /* the faintest jade: a key point, words to read aloud */
  --tint-accent: #E9F4F0;   /* a key point's wash */
  --hairline: #DCC48A;      /* gold, lightened: rules between rows */
  --write: #3E5A53;         /* lines and boxes people write in (--ink-2: a copier keeps it) */
  --accent-line: #A9D8C7;   /* green, lightened: the edge of a key point */
  --highlight: #FBE4C9;     /* span.tbc in the draft build: a warm marker, read as "not settled" */
}

/* Print what is on screen: tints and check boxes included. */
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); background: var(--paper);
  font-family: var(--text); font-size: 1rem; line-height: 1.46;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-kerning: normal;
}

/* ---------- Pages ---------- */
/* Generous margins; the running heads sit in the top margin above a gold hairline drawn by the box itself. */
@page {
  size: letter;
  margin: 0.74in 0.85in 0.74in;
  @top-left { font-family: "Figtree", Arial, sans-serif; font-weight: 600; font-size: 6.6pt; letter-spacing: 0.26em; color: #063A2E; vertical-align: bottom; padding-bottom: 0.17in; }
  @top-right { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: 9.5pt; color: #0B7A5E; vertical-align: bottom; padding-bottom: 0.15in; }
  @bottom-left { font-family: "Figtree", Arial, sans-serif; font-size: 6.8pt; color: #3E5A53; vertical-align: top; padding-top: 0.2in; white-space: nowrap; }
  @bottom-center { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: 9.5pt; color: #0B7A5E; vertical-align: top; padding-top: 0.17in; white-space: nowrap; }
  @bottom-right { content: counter(page); font-family: "Instrument Serif", Georgia, serif; font-size: 11pt; color: #063A2E; vertical-align: top; padding-top: 0.15in; }
}
/* (A page-margin box cannot read a custom property in every printing browser, so the six colours above are
   written out: they are --ink, --accent and --ink-2 from the list at the top.) */
@page cover {
  margin: 0;
  @top-left { content: none; } @top-right { content: none; }
  @bottom-left { content: none; } @bottom-center { content: none; } @bottom-right { content: none; }
}

@media print {
  html { font-size: 9.9pt; }
  .screen-only { display: none !important; }
  .pack-main > section + section, .doc { break-before: page; }
  .single .doc { break-before: auto; }
  .page-break { break-before: page; page-break-before: always; height: 0; margin: 0; border: 0; }
}
@media screen {
  html { font-size: 16px; background: var(--screen); }
  body { background: var(--screen); }
  .print-only { display: none !important; }
  .pack-main { padding: 24px 12px 64px; }
  .pack-main > section {
    max-width: 8.5in; margin: 0 auto 28px; border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(6, 58, 46, 0.08), 0 12px 32px rgba(6, 58, 46, 0.10);
  }
  .pack-main > section:not(.cover) { background: var(--paper); padding: clamp(22px, 7vw, 0.85in); }
  .doc .page-break { height: 0; border-top: 1px dashed var(--hairline); margin: 28px 0; }
}

/* ---------- Screen bar (not printed) ---------- */
.pack-bar {
  position: sticky; top: 0; z-index: 5; background: var(--ink); color: var(--on-dark);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 10px clamp(16px, 3vw, 28px);
  font-size: 0.95rem;
}
.pack-bar a, .pack-bar button {
  color: var(--on-dark); font: inherit; font-weight: 500; text-decoration: none; background: none; border: 0; cursor: pointer;
  padding: 6px 2px; border-bottom: 1px solid transparent;
}
.pack-bar a:hover, .pack-bar button:hover { border-bottom-color: var(--on-dark-2); }
.pack-bar .home { font-family: var(--display); font-size: 1.3rem; font-weight: 400; margin-right: auto; padding: 2px; }
.pack-bar .home span { color: var(--on-dark-2); font-style: italic; }
.pack-bar .pill { background: var(--on-dark); color: var(--ink); border-radius: var(--radius); padding: 6px 14px; font-weight: 600; }
.pack-bar .pill:hover { background: var(--screen); border-bottom-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pack-bar :focus-visible { outline-color: var(--on-dark); }
/* The bar stays at the top of the screen, so whatever the browser brings into view there (a link reached with
   Shift+Tab, a #part of a pack opened from the contents) must stop below it, never under it. --pack-bar is the
   bar's height: guessed here for one row, and measured exactly by site/assets/js/pack.js as the bar wraps. Nothing else in this file sets a scroll margin, so the two never add. */
:root { --pack-bar: 56px; }
/* On a phone the bar wraps to three or four rows, almost a third of a small screen, so there it stays at the top
   of the page and scrolls away with it instead of riding along; nothing then needs to stop below it. */
@media screen and (max-width: 640px) {
  .pack-bar { position: static; }
  :root { --pack-bar: 0px; }
}
@media screen { html { scroll-padding-top: calc(var(--pack-bar) + 16px); } }
/* Words only a screen reader meets (the pack's name after "Read online", for a list of the page's links). */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.draft-note {
  max-width: 8.5in; margin: 18px auto 0; padding: 10px 14px; border-radius: var(--radius); font-size: 0.95rem;
  background: var(--paper); color: var(--ink); border: 1px solid var(--hairline);
}

/* ---------- Cover ---------- */
/* White paper, the wordmark in deep jasper, one band of deep jasper for the pack's name, Philippians 3:10 below it. */
.cover {
  page: cover; position: relative; overflow: hidden; color: var(--ink); background: var(--paper);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
@media print { .cover { width: 8.5in; height: 11in; padding: 0.72in 0 0.55in; } }
@media screen { .cover { min-height: min(11in, 135vw); padding: clamp(36px, 8vw, 0.72in) 0 clamp(24px, 6vw, 0.55in); background: var(--paper); } }
/* A thin gold frame inside the page edge: the one ornament. */
.cover::before {
  content: ""; position: absolute; inset: 0.32in; border: 0.6pt solid var(--hairline); border-radius: var(--radius-lg);
  pointer-events: none;
}
.cover > * { position: relative; }
.cover-jesus {
  margin: 0; font-family: var(--text); font-weight: 600; font-size: 0.74rem;
  letter-spacing: 0.5em; margin-right: -0.5em; color: var(--accent); text-transform: uppercase;
}
.cover-draft {
  position: absolute; top: 0.52in; right: 0.58in; font-family: var(--text); font-weight: 600; font-size: 0.66rem;
  letter-spacing: 0.3em; color: var(--accent); border: 0.75pt solid var(--accent); padding: 3px 6px 2px 9px;
  border-radius: var(--radius);
}
.cover-cross { width: 1.3in; height: auto; margin: 0.5in 0 0.34in; overflow: visible; }
.cover-cross .halo-0 { stop-color: var(--screen); stop-opacity: 1; }
.cover-cross .halo-1 { stop-color: var(--screen); stop-opacity: 0; }
.cover-cross .beam-0 { stop-color: var(--hairline); }
.cover-cross .beam-1 { stop-color: var(--gold); }
.cover-cross .ray { stroke: var(--hairline); stroke-width: 0.5; }
.cover-wordmark { margin: 0; display: inline-flex; flex-direction: column; align-items: stretch; font-family: var(--display); font-weight: 400; line-height: 0.92; }
.cover-wordmark .wm-name { font-size: 5.3rem; letter-spacing: -0.005em; white-space: nowrap; color: var(--ink); }
.cover-wordmark .wm-year { color: var(--accent); font-style: italic; }
.cover-wordmark .wm-place {
  display: flex; align-items: center; gap: 1.1em; margin-top: 0.62em; font-family: var(--text); font-size: 0.84rem;
  font-weight: 600; letter-spacing: 0.7em; color: var(--gold); text-transform: uppercase;
}
.cover-wordmark .wm-place::before, .cover-wordmark .wm-place::after { content: ""; flex: 1 1 auto; height: 0; border-top: 0.6pt solid var(--hairline); }
.cover-wordmark .wm-place span { margin-right: -0.7em; }
.cover-three { margin: 0.44in 0 0; font-family: var(--display); font-style: italic; font-size: 1.42rem; color: var(--ink); }
.cover-date {
  margin: 0.1in 0 0; font-family: var(--text); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.3em;
  margin-right: -0.3em; text-transform: uppercase; color: var(--ink-2);
}
/* The one band of deep jasper: the pack's name. It stops just inside the gold frame rather than running off the
   page: most office printers cannot print the outer quarter inch, so a full-bleed band would come out with
   ragged white edges or shrink the page to fit. Inset, it prints the same on every printer. */
.cover-band {
  align-self: stretch; margin: 0.5in 0.44in 0; padding: 0.46in 0.5in 0.44in; background: var(--ink); color: var(--on-dark);
  border-radius: var(--radius);
}
.cover-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 3.5rem; line-height: 1; color: var(--on-dark); letter-spacing: -0.005em; }
.cover-sub { margin: 0.13in 0 0; font-family: var(--display); font-style: italic; font-size: 1.36rem; line-height: 1.25; color: var(--on-dark-2); }
.cover-verse { margin: auto 0; max-width: 5.3in; padding: 0 0.3in; }
.cover-verse p { margin: 0 0 0.1in; font-family: var(--scripture); font-style: italic; font-size: 1.42rem; line-height: 1.32; color: var(--ink); text-wrap: balance; }
.cover-verse .lord { font-size: 0.82em; letter-spacing: 0.06em; font-style: normal; }
.cover-verse cite {
  font-style: normal; font-family: var(--text); font-weight: 600; font-size: 0.64rem; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--accent);
}
.cover-foot {
  align-self: stretch; margin: 0 0.72in; padding-top: 0.13in; border-top: 0.6pt solid var(--hairline);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4pt 16pt; font-size: 0.78rem; color: var(--ink-2);
}
.cover-foot strong { color: var(--ink); font-weight: 600; }

/* ---------- Contents ---------- */
.contents h1 { margin-bottom: 0.14in; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li {
  display: grid; grid-template-columns: 0.42in 1fr 0.42in; column-gap: 0.06in; align-items: baseline;
  padding: 0.028in 0 0.032in; border-bottom: 0.5pt solid var(--line); break-inside: avoid;
}
.toc .n { font-family: var(--display); font-size: 1.05rem; color: var(--gold); font-variant-numeric: lining-nums; }
.toc .t { display: flex; align-items: baseline; gap: 6pt; min-width: 0; }
.toc .t a { font-weight: 600; font-size: 0.98rem; color: var(--ink); text-decoration: none; }
.toc .t::after { content: ""; flex: 1 1 auto; border-bottom: 0.75pt dotted var(--hairline); transform: translateY(-3pt); min-width: 0.3in; }
.toc .p { text-align: right; font-family: var(--display); font-size: 1.15rem; color: var(--ink); font-variant-numeric: tabular-nums lining-nums; }
.toc .p.pending { visibility: hidden; }
.toc .s { grid-column: 2 / 4; font-size: 0.8rem; color: var(--ink-2); line-height: 1.26; margin-top: 0; }
.toc-group {
  margin: 0.24in 0 0.02in; font-family: var(--text); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--accent); break-after: avoid;
}
.toc-group:first-of-type { margin-top: 0; }
.toc-note { margin: 0.1in 0 0; font-size: 0.84rem; color: var(--ink-2); }
.toc-empty { padding: 0.3in; text-align: center; color: var(--ink-2); border: 0.75pt dashed var(--hairline); border-radius: var(--radius); }

/* ---------- The documents ---------- */
/* Two lines at least at the foot of a page and at the head of the next. (Three each would let a four-line
   paragraph break 3 + 1, because the browser cannot keep both rules and gives up on them.) */
.doc, .contents { orphans: 2; widows: 2; }
.doc h1, .contents h1 {
  margin: 0 0 0.16in; font-family: var(--display); font-weight: 400; font-size: 3.05rem;
  line-height: 1.02; letter-spacing: -0.008em; color: var(--ink); text-wrap: balance;
}
.kicker {
  display: flex; align-items: center; gap: 9pt; margin: 0 0 0.14in;
  font-family: var(--text); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent);
}
.kicker::before { content: ""; width: 0.36in; height: 0; border-top: 0.75pt solid var(--gold); flex: none; }
.doc h2 {
  margin: 0.22in 0 0.06in; font-family: var(--display); font-weight: 400; font-size: 1.72rem;
  line-height: 1.08; color: var(--ink); text-wrap: balance;
}
.doc h3 { margin: 0.12in 0 0.03in; font-family: var(--text); font-weight: 700; font-size: 1.02rem; line-height: 1.25; color: var(--ink); }
.doc h2, .doc h3, .doc h4, .kicker, .toc-group { break-after: avoid; page-break-after: avoid; }
.doc h2 + *, .doc h3 + * { break-before: avoid; }
/* Every table sits in div.table-scroll (written by tools/build_pack.py: the box that scrolls a wide table on a
   phone). On paper that box does not exist (display: contents), so the table is laid out as if the wrapper were
   not there; the rules below that follow a heading into a table name both shapes, since a selector still sees
   the wrapper in the page's tree. */
@media print { .table-scroll { display: contents; } }
.doc :is(h2, h3) + .table-scroll > table { break-before: avoid; }
/* A heading followed by a list or a table takes at least two of its items or rows with it to the page it lands on. */
.doc :is(h2, h3) + :is(ul, ol) > li:first-child,
.doc :is(h2, h3) + table > tbody > tr:first-child,
.doc :is(h2, h3) + .table-scroll > table > tbody > tr:first-child { break-after: avoid; }
/* A one-line introduction under a heading belongs to what it introduces: the heading and its intro go to the
   next page with the list, table or columns rather than sit alone at the foot of this one. The two rules above
   are repeated for that shape, so the first two items or rows still come along. Only an intro that leads into
   one of those: an answer paragraph under a question (the Questions pages) may still break after itself, since
   holding every one of those back pushed whole answers onto a new page and cost the Partner Pack a page. */
.doc :is(h2, h3) + p:has(+ :is(ul, ol, table, .table-scroll, .cols-2, .cols-3, .cards)) { break-after: avoid; page-break-after: avoid; }
.doc :is(h2, h3) + p + :is(ul, ol) > li:first-child,
.doc :is(h2, h3) + p + table > tbody > tr:first-child,
.doc :is(h2, h3) + p + .table-scroll > table > tbody > tr:first-child { break-after: avoid; }
/* A list never leaves its last item alone at the head of a page, and a short checklist (six items or fewer)
   stays whole: it is read and ticked as one piece. */
.doc :is(ul, ol) > li:last-child:not(:first-child) { break-before: avoid; }
.doc ul.checklist:not(:has(> li:nth-child(7))) { break-inside: avoid; }
.doc h4 { margin: 0.12in 0 0.04in; font-size: 1rem; font-weight: 600; }
.doc p { margin: 0 0 0.09in; }
.doc .lead { font-family: var(--text); font-weight: 400; font-size: 1.18rem; line-height: 1.48; color: var(--ink); margin-bottom: 0.17in; }
.doc ul, .doc ol { margin: 0 0 0.1in; padding-left: 0.22in; }
.doc li { margin-bottom: 0.035in; }
.doc li::marker { color: var(--accent); }
.doc ol > li::marker { font-weight: 600; }
.doc a { color: inherit; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 0.6pt; text-underline-offset: 2pt; }
.doc strong { font-weight: 700; color: var(--ink); }
.doc em { font-style: italic; }
.small { font-size: 0.84rem; color: var(--ink-2); line-height: 1.42; }
.nowrap { white-space: nowrap; }
@media print {
  .doc a { text-decoration: none; }
  .doc a[data-show]::after { content: " (" attr(data-show) ")"; font-size: 0.9em; color: var(--ink-2); }
  .doc a[data-page]::after { content: " (page " attr(data-page) ")"; font-size: 0.9em; color: var(--ink-2); white-space: nowrap; }
}

/* Scripture (King James Version): the serif, larger, with a gold hairline beside it. */
.scripture { margin: 0.17in 0 0.19in; padding: 0.02in 0 0.02in 0.22in; border-left: 0.75pt solid var(--gold); break-inside: avoid; }
.scripture p { margin: 0 0 0.05in; font-family: var(--scripture); font-style: italic; font-size: 1.42rem; line-height: 1.3; color: var(--ink); }
.scripture cite {
  display: block; font-style: normal; font-family: var(--text); font-weight: 600; font-size: 0.68rem;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent);
}
.lord { font-size: 0.84em; letter-spacing: 0.05em; font-style: normal; }

/* Callouts: a note, a key point, a practical tip. Hairlines and the faintest wash, never a solid block. */
.callout {
  margin: 0.15in 0; padding: 0.11in 0.16in 0.12in; border: 0.6pt solid var(--line); border-left: 2pt solid var(--gold);
  border-radius: var(--radius); background: var(--paper); break-inside: avoid;
}
.callout.key { border-color: var(--accent-line); border-left-color: var(--accent); background: var(--tint-accent); }
.callout.tip { border-left-color: var(--gold); background: var(--tint); }
.callout > :last-child { margin-bottom: 0; }
.callout h3, .callout h4 { margin-top: 0; }

/* Checklists print with check boxes. */
ul.checklist { list-style: none; padding-left: 0; }
ul.checklist > li { position: relative; padding-left: 0.28in; margin-bottom: 0.045in; break-inside: avoid; }
ul.checklist > li::before {
  content: ""; position: absolute; left: 0; top: 0.14em; width: 0.15in; height: 0.15in;
  border: 0.9pt solid var(--write); border-radius: 2px; background: var(--paper);
}

/* Cards: two or three across, white with a hairline and a fine green rule on top. */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.12in; margin: 0.11in 0 0.15in; }
.cards:has(> .card:only-child) { grid-template-columns: minmax(0, 1fr); }
.cards:has(> .card:last-child:nth-child(2)),
.cards:has(> .card:last-child:nth-child(4)),
.cards:has(> .card:last-child:nth-child(8)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  border: 0.6pt solid var(--hairline); border-top: 1.5pt solid var(--accent); border-radius: var(--radius);
  padding: 0.085in 0.12in 0.095in; background: var(--paper); break-inside: avoid;
}
.card h3 { margin: 0 0 0.05in; font-family: var(--display); font-weight: 400; font-size: 1.32rem; line-height: 1.1; }
.card p { font-size: 0.9rem; line-height: 1.45; margin-bottom: 0.045in; }
.card > :last-child { margin-bottom: 0; }

/* Columns. */
.cols-2, .cols-3 { display: grid; gap: 0.24in; margin: 0.1in 0 0.14in; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 > div > :first-child, .cols-3 > div > :first-child { margin-top: 0; }
/* A column that holds words to read aloud keeps its heading with them: the words never break, so the whole column
   moves to the next page rather than leave its heading alone at the foot of this one. */
.cols-2 > div:has(> .script), .cols-3 > div:has(> .script) { break-inside: avoid; }
/* A block of columns without read-aloud words is short in every pack page (a few headed paragraphs side by
   side), so it moves whole rather than leave a line or two of one column alone on the next page. */
.cols-2:not(:has(.script)), .cols-3:not(:has(.script)) { break-inside: avoid; }

/* Tables: no filled header (toner); a deep jasper rule under the header, gold hairlines between rows. */
.doc table { width: 100%; border-collapse: collapse; margin: 0.1in 0 0.17in; font-size: 0.9rem; line-height: 1.38; }
.doc thead { display: table-header-group; }
.doc tr { break-inside: avoid; }
/* A short table (eight rows or fewer: a plan, a week of the prayer guide, a timeline) is read as one piece and
   never splits. A longer table may break between rows, but never leaves its last row alone on the next page. */
.doc table:not(:has(> tbody > tr:nth-child(9))) { break-inside: avoid; }
.doc tbody > tr:last-child:not(:first-child) { break-before: avoid; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.05in 0.08in; border-bottom: 0.5pt solid var(--line); }
.doc thead th {
  background: none; color: var(--accent); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  border-bottom: 1pt solid var(--ink); padding-top: 0.02in; padding-bottom: 0.05in; vertical-align: bottom;
}
.doc tbody th { font-weight: 700; color: var(--ink); }
/* An empty cell is a place to write: room for a line of handwriting and a mid green line to write on. */
.doc td:empty { height: 0.46in; }
.doc tbody tr:last-child td, .doc tbody tr:last-child th { border-bottom-color: var(--hairline); }
.doc tbody td:empty { border-bottom: 0.8pt solid var(--write); }
/* Timelines have fixed columns, so the weeks of the prayer guide line up page after page and a short time
   ("2:30 pm") does not take a wide column from the words beside it. The first column is the time or date; a
   table with four columns (the prayer guide: date, day, reading, prayer) also fixes its narrow day and reading
   columns; the columns left over share the rest.
   On a phone (640px and narrower) they are laid out by their words instead: fixed inches there left the prayer
   guide's prayers a sliver, and the columns of a scrolling table cannot be widened cell by cell. */
@media print, screen and (min-width: 641px) {
  .doc table.timeline { table-layout: fixed; }
  .doc table.timeline th:first-child { width: 1.22in; }
  .doc table.timeline:has(> thead th:nth-child(4)) th:first-child { width: 0.98in; }
  .doc table.timeline:has(> thead th:nth-child(4)) th:nth-child(2) { width: 0.5in; }
  .doc table.timeline:has(> thead th:nth-child(4)) th:nth-child(3) { width: 1.4in; }
}
/* On a wide screen the words are larger than on paper (16px against 9.9pt) in columns of the same inches, so the
   prayer guide's day column is widened to hold "Gather" (it ran into the reading beside it). */
@media screen and (min-width: 641px) {
  .doc table.timeline:has(> thead th:nth-child(4)) th:nth-child(2) { width: 4rem; }
}
.doc table.timeline tbody td:first-child, .doc table.timeline tbody th:first-child {
  position: relative; font-weight: 700; color: var(--ink);
  border-right: 0.75pt solid var(--gold); padding-right: 0.14in;
}
.doc table.timeline tbody td:first-child::after, .doc table.timeline tbody th:first-child::after {
  content: ""; position: absolute; right: -0.042in; top: 0.09in; width: 0.07in; height: 0.07in; border-radius: 50%;
  background: var(--paper); border: 0.9pt solid var(--accent);
}
.doc table.timeline td:nth-child(2) { padding-left: 0.16in; }

/* Words to read aloud or paste: a dashed gold frame on the faintest wash. */
.script {
  margin: 0.12in 0 0.17in; padding: 0.12in 0.17in; border: 0.75pt dashed var(--gold); border-radius: var(--radius);
  background: var(--tint); font-size: 0.98rem; line-height: 1.5; break-inside: avoid;
}
.script > :last-child { margin-bottom: 0; }
.script h3, .script h4 {
  font-family: var(--text); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); margin-top: 0;
}

/* Printed forms: fill-in lines, boxes, check boxes, signatures. Room to write with a pen: every line has about a
   third of an inch of clear space above it, and the lines and boxes are printed dark enough to write against. */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.05in 0.28in; margin: 0.06in 0 0.14in; }
.field {
  display: flex; flex-direction: column; justify-content: flex-start; min-height: 0.56in;
  border-bottom: 0.8pt solid var(--write); padding-bottom: 0.02in; break-inside: avoid;
}
.field.wide { grid-column: 1 / -1; }
/* A short run of lines (up to four) stays together on one page; a long form may break between its lines. */
.fields:not(:has(> :nth-child(5))) { break-inside: avoid; }
/* A record filled in at the scene (a heading, a line of instructions, check boxes, lines and a signature: the
   incident record) starts on a page of its own, so it can be copied as one sheet and nobody signs on a page apart
   from what they wrote. (Keeping it whole with break-avoid rules alone did not hold in the printing browser.) */
.doc h2:has(+ p + .choices + .fields + .signature) { break-before: page; }
.field.tall { min-height: 1.3in; border: 0.8pt solid var(--write); border-radius: var(--radius); padding: 0.06in 0.09in; margin-top: 0.06in; }
.field .label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-2); line-height: 1.25; }
.field .hint { font-size: 0.72rem; font-style: italic; color: var(--ink-2); line-height: 1.25; }
.field .choices { margin-top: 0.06in; }
.field:has(> .choices) { border-bottom: 0; min-height: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 0.07in 0.24in; margin: 0.06in 0 0.14in; break-inside: avoid; }
.choices > .label { flex: 1 0 100%; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-2); }
.choice { display: inline-flex; align-items: flex-start; gap: 0.07in; line-height: 1.3; }
.choice::before {
  content: ""; flex: none; width: 0.15in; height: 0.15in; margin-top: 0.01in;
  border: 0.9pt solid var(--write); border-radius: 2px; background: var(--paper);
}
.signature { display: grid; grid-template-columns: 2fr 1fr; gap: 0.1in 0.3in; margin: 0.26in 0 0.16in; break-inside: avoid; }
.signature:has(> .field:last-child:nth-child(3)) { grid-template-columns: 2fr 1.4fr 1fr; }
.signature .field { min-height: 0.72in; }

/* Details awaiting a decision (span.tbc). Draft: a warm marker with a green underline, explained by the legend on
   every draft page ("highlighted: awaiting decision", in the footer and on the contents page). There are hundreds
   of these, so no label is repeated on each. Final: plain text. */
.is-draft .tbc {
  background: var(--highlight); box-shadow: inset 0 -1pt 0 var(--accent); padding: 0 1.2pt; border-radius: 1.5pt;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.is-draft .tbc .tbc { background: none; box-shadow: none; padding: 0; }
.tbc-legend {
  display: inline-block; margin: 0 0 0.16in; padding: 0.06in 0.12in; border: 0.6pt solid var(--hairline);
  border-radius: var(--radius); background: var(--paper); font-size: 0.84rem; color: var(--ink);
}
.tbc-legend .tbc { font-weight: 600; }
.is-final .tbc-legend { display: none; }
.cover .tbc { color: inherit; }
.is-final .tbc { background: none; box-shadow: none; padding: 0; }

/* ---------- The pack library (site/pack/index.html): both packs and every document, on screen ---------- */
.library { background: var(--screen); }
.library .pack-bar .here { border-bottom-color: var(--on-dark-2); }
.lib-main { max-width: 1080px; margin: 0 auto; padding: clamp(28px, 6vw, 64px) 16px 56px; }
.lib-hero { max-width: 44rem; margin: 0 0 clamp(24px, 4vw, 40px); }
.lib-hero h1 { margin: 0 0 14px; font-family: var(--display); font-weight: 400; font-size: clamp(2.5rem, 7vw, 4.2rem); line-height: 1; color: var(--ink); }
.lib-hero .lead { font-size: 1.15rem; line-height: 1.55; margin: 0 0 10px; }
.lib-hero .note { font-size: 0.95rem; color: var(--ink-2); margin: 0; }
.lib-grid { display: grid; gap: clamp(16px, 3vw, 28px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.lib-pack { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(20px, 4vw, 32px); }
.lib-pack h2 { margin: 0 0 8px; font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 4vw, 2.3rem); line-height: 1.05; color: var(--ink); }
.lib-pack > p { margin: 0 0 12px; line-height: 1.55; }
.lib-pack .meta { font-size: 0.88rem; color: var(--ink-2); }
.lib-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 6px; }
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: var(--radius);
  font: inherit; font-weight: 600; text-decoration: none; border: 1px solid var(--ink);
}
.btn-solid { background: var(--ink); color: var(--on-dark); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--screen); }
.pack-docs { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.pack-docs li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pack-docs .grp { display: block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.pack-docs a { font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.pack-docs .sum { display: block; font-size: 0.9rem; color: var(--ink-2); line-height: 1.45; margin-top: 2px; }
.lib-foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 22px 16px 40px; text-align: center; font-size: 0.9rem; color: var(--ink-2); }
.lib-foot p { margin: 4px 0; }
.lib-foot a { color: var(--ink); }
.lib-foot .jesus { font-weight: 600; letter-spacing: 0.4em; text-transform: uppercase; font-size: 0.72rem; color: var(--accent); }

/* Narrow screens: one column, and a table wider than the phone scrolls sideways inside its own box
   (div.table-scroll). The table itself stays a table, so a screen reader still reads its rows and columns; when it
   overflows, pack.js makes the box a named region with a tab stop, so a keyboard can scroll it too, and its focus
   ring is drawn just inside the box (a ring outside would be cut off by the page's own edge). */
@media screen and (max-width: 640px) {
  .cards, .cols-2, .cols-3, .fields, .signature, .cards:has(> .card:last-child:nth-child(2)),
  .cards:has(> .card:last-child:nth-child(4)), .cards:has(> .card:last-child:nth-child(8)),
  .signature:has(> .field:last-child:nth-child(3)) { grid-template-columns: minmax(0, 1fr); }
  .table-scroll { overflow-x: auto; margin: 0.1in 0 0.17in; border-radius: var(--radius); }
  .table-scroll > table { margin: 0; }
  .table-scroll:focus-visible { outline-offset: -2px; }
  /* A short range in a table ("4 to 6", written as span.nw by tools/build_pack.py) stays on one line rather than
     stack a word a line; on paper the columns are wide enough already, so the PDF is untouched. */
  .doc .nw { white-space: nowrap; }
  .doc h1, .contents h1 { font-size: 2.3rem; }
  .cover::before { inset: 10px; }
  .cover { padding-top: 58px; }
  .cover-wordmark .wm-name { font-size: clamp(2.6rem, 14vw, 4.9rem); }
  .cover-wordmark .wm-place { font-size: clamp(0.62rem, 2.6vw, 0.84rem); letter-spacing: 0.5em; }
  .cover-wordmark .wm-place span { margin-right: -0.5em; }
  .cover-band { padding: 26px 22px; }
  .cover-title { font-size: clamp(2rem, 10vw, 3.5rem); }
  .cover-sub { font-size: 1.1rem; }
  .cover-jesus { font-size: 0.68rem; letter-spacing: 0.32em; margin-right: -0.32em; }
  .cover-date { font-size: 0.68rem; letter-spacing: 0.16em; margin-right: -0.16em; padding: 0 16px; }
  .cover-three { font-size: 1.15rem; padding: 0 16px; }
  .cover-draft { top: 18px; right: 18px; }
  .cover-cross { width: 0.9in; margin: 0.3in 0 0.2in; }
  .cover-verse { margin-top: 0.4in; }
  .cover-verse p { font-size: 1.2rem; }
  .cover-foot { margin: 0.3in 22px 0; }
  .toc li { grid-template-columns: 0.36in 1fr 0.34in; }
}
/* A small phone (400px and narrower): the sheet comes nearer the screen's edge (22px from it to the words, not 34)
   and the cells give up half their side padding, so the prayer guide's four columns and the run sheet's three fit
   the screen rather than scroll it. */
@media screen and (max-width: 400px) {
  .pack-main { padding-left: 6px; padding-right: 6px; }
  .pack-main > section:not(.cover) { padding-left: 16px; padding-right: 16px; }
  .doc th, .doc td { padding-left: 0.04in; padding-right: 0.04in; }
  .doc table.timeline tbody :is(td, th):first-child { padding-right: 0.08in; }
  .doc table.timeline td:nth-child(2) { padding-left: 0.09in; }
  /* A long word in a narrow column ("conversation") may break with a hyphen rather than push the table wide. */
  .doc td { -webkit-hyphens: auto; hyphens: auto; }
}
/* The narrowest phones (360px and below) set tables a touch smaller (13.6px, from 14.4), the last few pixels the
   road to Good Friday's three columns need to fit. */
@media screen and (max-width: 360px) {
  .doc table { font-size: 0.85rem; }
}
