@font-face {
  font-family: "Literata";
  src: url("/assets/literata-regular-core.86141dbe88.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+20-7D, U+A0, U+A3, U+A7, U+A9, U+B0, U+B7, U+BD, U+C0, U+C6, U+D7, U+E6, U+E9, U+EB, U+F6, U+113, U+14D, U+393, U+395, U+39A-39B, U+3A0, U+3A7, U+3A9, U+3AD, U+3AF, U+3B1-3C9, U+1F04, U+1F10, U+1F30, U+1F7A, U+1FB3, U+1FC6, U+1FE5-1FE6, U+2010, U+2013-2015, U+2018-2019, U+201C-201D, U+2026, U+2191, U+2193, U+2212, U+25A0;
}

@font-face {
  font-family: "Literata";
  src: url("/assets/literata-regular-ext.32afef12ed.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+A1-A2, U+A4-A6, U+A8, U+AA-AF, U+B1-B6, U+B8-BC, U+BE-BF, U+C1-C5, U+C7-D6, U+D8-E5, U+E7-E8, U+EA, U+EC-F5, U+F7-112, U+114-14C, U+14E-17E;
}

@font-face {
  font-family: "Literata";
  src: url("/assets/literata-medium-core.e69f9306ea.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+20-7D, U+A0, U+A3, U+A7, U+A9, U+B0, U+B7, U+BD, U+C0, U+C6, U+D7, U+E6, U+E9, U+EB, U+F6, U+113, U+14D, U+393, U+395, U+39A-39B, U+3A0, U+3A7, U+3A9, U+3AD, U+3AF, U+3B1-3C9, U+1F04, U+1F10, U+1F30, U+1F7A, U+1FB3, U+1FC6, U+1FE5-1FE6, U+2010, U+2013-2015, U+2018-2019, U+201C-201D, U+2026, U+2191, U+2193, U+2212, U+25A0;
}

@font-face {
  font-family: "Literata";
  src: url("/assets/literata-medium-ext.2f1015c6f0.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+A1-A2, U+A4-A6, U+A8, U+AA-AF, U+B1-B6, U+B8-BC, U+BE-BF, U+C1-C5, U+C7-D6, U+D8-E5, U+E7-E8, U+EA, U+EC-F5, U+F7-112, U+114-14C, U+14E-17E;
}

@font-face {
  font-family: "Literata";
  src: url("/assets/literata-italic-core.2b442a2541.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+20-7D, U+A0, U+A3, U+A7, U+A9, U+B0, U+B7, U+BD, U+C0, U+C6, U+D7, U+E6, U+E9, U+EB, U+F6, U+113, U+14D, U+393, U+395, U+39A-39B, U+3A0, U+3A7, U+3A9, U+3AD, U+3AF, U+3B1-3C9, U+1F04, U+1F10, U+1F30, U+1F7A, U+1FB3, U+1FC6, U+1FE5-1FE6, U+2010, U+2013-2015, U+2018-2019, U+201C-201D, U+2026, U+2191, U+2193, U+2212, U+25A0;
}

@font-face {
  font-family: "Literata";
  src: url("/assets/literata-italic-ext.d0424e3381.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+A1-A2, U+A4-A6, U+A8, U+AA-AF, U+B1-B6, U+B8-BC, U+BE-BF, U+C1-C5, U+C7-D6, U+D8-E5, U+E7-E8, U+EA, U+EC-F5, U+F7-112, U+114-14C, U+14E-17E;
}

/*
  The website's base, layout and component styles (web §7 and §8).

  Colours, radii and faces are variables from the generated themes.<hash>.css
  (lib/site-palette.mjs, the native app's colours and corners) and extras.css;
  nothing here names a colour of its own except shadows, the forced-colours fallbacks
  and the screens' neutral outline. The pages sit on the reading page (--page) with
  the reader's ink: --r-ink for text, --r-ink-2 for quieter text, --r-accent for
  links. Light and dark follow the device.
  Breakpoints are 600 and 1100 px (themes.json web.breakpoints), written in rem so a
  larger default text size reaches the narrower layout sooner.

  The look is the native app's (apps/ios/Found/Design): warm paper, ink, and
  hairlines doing the separating. The "accent" is ink, so the primary action, links,
  focus and the current item are all ink; links are underlined. Headings are
  Literata Medium; controls are the system font at 600, in capsules. Corners: sheets
  28 px (--r-sheet), cards 22 (--r-card), rows and fields 16 (--r-row), small fields
  12 (--r-s), buttons and chips capsules (--r-pill). Nothing loops except a spinner.
*/

:root {
  color-scheme: light dark;

  --gutter: 20px;
  --header-h: 60px;
  --hairline: 1px;
  --grid-gap: 32px;

  /* Type scale (web.type in themes.json, with the steps between). */
  --text-caption: 0.8125rem;
  --text-small: 0.9375rem;
  --text-body: 1.0625rem;
  --text-lede: 1.1875rem;
  --text-h3: 1.1875rem;
  --text-h3-article: 1.375rem;
  --text-h2: 1.5rem;
  --text-title: 1.875rem;
  --text-hero: 2.125rem;
  --text-ui: 0.9375rem;

  /* Shadows for things that float (popovers, the picker, toasts): a hairline ring
     and one soft drop, never heavy elevation. */
  --shadow-float: 0 0 0 1px rgba(30, 38, 34, 0.07), 0 16px 40px -12px rgba(30, 38, 34, 0.18), 0 2px 6px rgba(30, 38, 34, 0.04);

  /* Vertical rhythm between the big pieces of a page. */
  --space-hero: 48px;
  --space-figure: 48px;
  --space-section: 88px;
  --space-article: 40px;
  --space-end: 96px;

  /* Motion (web §10.3; the animate skill's curves). */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

@media (min-width: 37.5rem) {
  :root {
    --gutter: 40px;
    --header-h: 72px;
    --text-lede: 1.3125rem;
    --text-h3: 1.3125rem;
    --text-h3-article: 1.5rem;
    --text-h2: 1.75rem;
    --text-title: 2.25rem;
    --text-hero: 2.75rem;
    --space-hero: 80px;
    --space-figure: 64px;
    --space-section: 120px;
    --space-article: 64px;
    --space-end: 128px;
  }
}

@media (min-width: 68.75rem) {
  :root {
    --gutter: clamp(40px, 5.6vw, 80px);
    --text-h2: 1.875rem;
    --text-title: 2.5rem;
    --text-hero: 3.25rem;
    --space-hero: 112px;
    --space-figure: 80px;
    --space-section: 152px;
    --space-article: 96px;
    --space-end: 160px;
  }
}

@media (min-resolution: 2dppx) {
  :root {
    --hairline: 0.5px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --shadow-float: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 40px -8px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--r-ink);
  font-family: var(--font-ui);
  font-size: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

main {
  display: block;
  flex: 1 0 auto;
  padding-block-end: var(--space-end);
}

main:focus {
  outline: none;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
figure,
blockquote {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

strong {
  font-weight: 600;
}

a {
  color: var(--r-accent);
  text-decoration-line: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: auto;
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    text-decoration-thickness: 2px;
  }
}

::selection {
  background: var(--r-accent-soft);
}

[id] {
  scroll-margin-top: 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Controls that need a script are hidden until boot.js swaps no-js for js (web §10.1). */
.no-js [data-js-only] {
  display: none !important;
}

/* And script-free fallbacks are hidden once it has. */
.js [data-no-js-only] {
  display: none !important;
}

/* The hidden attribute wins over a class's display (join.js hides W14's buttons). */
[hidden] {
  display: none !important;
}

.icon {
  display: block;
  flex: none;
  width: 22px;
  height: 22px;
}

.icon-small {
  width: 18px;
  height: 18px;
}

/* Focus (web §7.5): a gap in the surface colour, then the accent. The transparent
   outline keeps a ring in forced-colours mode, where box-shadow is dropped. */

:where(a, button, summary, input):focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--ring-gap, var(--page)), 0 0 0 6px var(--ring, var(--r-accent));
}

:where(p, li, dd) > a:focus-visible {
  border-radius: 2px;
}

/* Layout: content up to 1280 px, centred beyond 1440 (web §7.2). */

.wrap {
  width: 100%;
  max-width: calc(1280px + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

/* Skip link (web §8.1) */

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: 12px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 18px;
  border-radius: var(--r-pill);
  background: var(--r-ink);
  color: var(--page);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Buttons */

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 22px;
  border: 0;
  border-radius: var(--r-pill);
  font: inherit;
  font-size: var(--text-ui);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 150ms ease;
}

.button:active {
  transform: scale(0.97);
}

.button-primary {
  background: var(--btn);
  color: var(--on-btn);
}

.button-secondary {
  background: var(--sheet);
  color: var(--r-ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* Its edge is a box-shadow, which would hide the shared focus ring, so the ring is
   drawn beside it. */
.button-secondary:focus-visible {
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 0 0 3px var(--ring-gap, var(--page)), 0 0 0 6px var(--ring, var(--r-accent));
}

@media (hover: hover) and (pointer: fine) {
  .button-primary:hover {
    background: color-mix(in oklab, var(--btn) 88%, var(--r-ink));
  }

  .button-secondary:hover {
    background: var(--hover);
  }
}

/* Loading (Spectrum's Loading Button, docs/design/spectrum-ui.md §3.2): while a
   request is on its way the button keeps its place and width, shows a spinner
   before its label, and says so to screen readers with aria-busy. It stays
   focusable (aria-disabled, not disabled), so focus never drops to the page. */
.button[aria-busy="true"] {
  cursor: progress;
}

.button[aria-busy="true"]:active {
  transform: none;
}

.button-label {
  display: inline-block;
}

/* The spinner: an arc on a faint ring, in the text colour. It's the one thing on
   the site that loops, and only while something is loading. */
.spinner {
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in oklab, currentColor 22%, transparent);
  border-block-start-color: currentColor;
  border-radius: 50%;
  animation: spin 650ms linear infinite;
}

.spinner-large {
  width: 22px;
  height: 22px;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* Text states (Spectrum's Text States, written fresh from its behaviour notes in
   docs/design/spectrum-ui-source/text-states/NOTES.md): a label swapping in place
   leaves upwards and blurs out, then the new one rises in. ui.js's swapText()
   drives the classes; the duration and distance are here. */
.text-swap {
  display: inline-block;
  transition: opacity 150ms ease-in-out, transform 150ms ease-in-out, filter 150ms ease-in-out;
}

.text-swap.is-leaving {
  opacity: 0;
  transform: translateY(-4px);
  filter: blur(2px);
}

.text-swap.is-entering {
  opacity: 0;
  transform: translateY(4px);
  filter: blur(2px);
  transition: none;
}

.button-small {
  min-height: 36px;
  padding: 6px 16px;
  font-size: 0.875rem;
}

/* A 36 px button still gets a 44 px target. */
.button-small::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

.button-medium {
  min-height: 44px;
}

.button-block {
  display: flex;
  width: 100%;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--r-ink);
  cursor: pointer;
  transition: background-color 150ms ease;
}

.icon-link .icon {
  width: 20px;
  height: 20px;
}

@media (hover: hover) and (pointer: fine) {
  .icon-link:hover {
    background: var(--hover);
  }
}

/* Header (web §8.2) */

.site-header {
  position: relative;
  z-index: 10;
  background: var(--page);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  min-width: 0;
  color: var(--r-ink);
  font-family: var(--font-title);
  font-size: 1.1875rem;
  font-weight: var(--title-weight);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  flex: none;
  width: 26px;
  height: 26px;
}

.main-nav {
  display: none;
}

/* The header's links: quiet words, with the current section resting on a soft
   pill (Spectrum's Tree Nav and Command Search share the idea). No movement: the
   pill is where you are, and hover only tints. */
.main-nav ul {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a,
.account-link {
  position: relative;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  min-height: 34px;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  color: var(--r-ink-2);
  font-size: var(--text-ui);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}

/* A 44 px target around the words. */
.main-nav a::after,
.account-link::after {
  content: "";
  position: absolute;
  inset: -5px 0;
}

.main-nav a[aria-current],
.account-link[aria-current] {
  background: var(--hover);
  color: var(--r-ink);
}

@media (hover: hover) and (pointer: fine) {
  .main-nav a:hover,
  .account-link:hover {
    background: var(--hover);
    color: var(--r-ink);
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
}

.theme-anchor {
  position: relative;
  display: flex;
}

.theme-button {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--r-ink-2);
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 150ms ease, color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .theme-button:hover {
    background: var(--hover);
    color: var(--r-ink);
  }
}

.theme-button[aria-expanded="true"] {
  background: var(--hover);
  color: var(--r-ink);
}

.theme-button::after {
  content: "";
  position: absolute;
  inset: -4px;
}

.theme-button:active {
  transform: scale(0.96);
}

.theme-button .icon {
  width: 19px;
  height: 19px;
}

.get-app {
  display: none;
}

/* "Sign in" (lib/accounts.mjs): a quiet link drawn like the main navigation's (above),
   beside Get the app on wider screens; phones have it in the menu. account.js turns
   the slot into the account menu on the account pages. */
.account-slot {
  display: none;
  align-items: center;
}

/* With no phone menu to open the sheet from, the button stays in the header and
   opens the popover at every width. */
.no-menu .theme-button {
  display: inline-flex;
}

@media (min-width: 37.5rem) {
  .header-bar {
    gap: 16px;
  }

  .header-actions {
    gap: 8px;
  }

  .brand {
    font-size: 1.25rem;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .main-nav {
    display: block;
    margin-inline-start: 16px;
  }

  .theme-button,
  .get-app,
  .account-slot {
    display: inline-flex;
  }

  .search-link,
  .menu {
    display: none;
  }
}

@media (min-width: 68.75rem) {
  .main-nav ul {
    gap: 4px;
  }
}

/* Phone menu (web §8.3): a disclosure that works without a script. */

.menu > summary {
  list-style: none;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu-panel {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px max(var(--gutter), env(safe-area-inset-right)) 32px max(var(--gutter), env(safe-area-inset-left));
  background: var(--page);
  border-block-start: var(--hairline) solid var(--r-line);
}

.menu-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding-block: 8px;
  border-block-end: var(--hairline) solid var(--r-line);
  color: var(--r-ink);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.menu-list a[aria-current] {
  color: var(--r-accent);
}

.menu-chevron {
  width: 16px;
  height: 16px;
  color: var(--r-ink-2);
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

nav + .menu-actions {
  padding-block-start: 20px;
}

/* The text panel (W13, web §9.13): a popover under the header button on tablet and
   desktop, a bottom sheet from the phone menu. */

.theme-panel {
  --ring-gap: var(--sheet);
  --ring: var(--r-accent);
  position: absolute;
  inset: auto;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 30;
  width: 360px;
  max-width: calc(100vw - 2 * var(--gutter));
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--r-card);
  background: var(--sheet);
  color: var(--r-ink);
  box-shadow: var(--shadow-float);
  transform-origin: top right;
}

.theme-panel[open] {
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}

@starting-style {
  .theme-panel[open] {
    opacity: 0;
    transform: scale(0.98);
  }
}

.theme-panel-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.theme-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.theme-panel-title {
  font-size: var(--text-ui);
  font-weight: 600;
  line-height: 1.3;
}

.theme-panel-close,
.sheet-grabber {
  display: none;
}

.theme-panel-note {
  color: var(--r-ink-2);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.theme-panel-rule {
  padding-block-start: 10px;
  border-block-start: var(--hairline) solid var(--r-line);
  font-size: 0.75rem;
}

/* The sheet, opened as a modal dialog from the phone menu. */

.theme-panel.is-sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: none;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: 0 0 0 0.5px var(--r-line);
  transform-origin: bottom center;
}

.theme-panel.is-sheet[open] {
  transition: transform 240ms var(--ease-drawer);
}

@starting-style {
  .theme-panel.is-sheet[open] {
    opacity: 1;
    transform: translateY(100%);
  }
}

.theme-panel.is-sheet::backdrop {
  background: rgba(0, 0, 0, 0.32);
  transition: opacity 200ms ease-out;
}

@starting-style {
  .theme-panel.is-sheet[open]::backdrop {
    opacity: 0;
  }
}

.theme-panel.is-sheet .theme-panel-body {
  gap: 14px;
  padding: 10px max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.theme-panel.is-sheet .sheet-grabber {
  display: block;
  align-self: center;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--r-line);
}

.theme-panel.is-sheet .theme-panel-title {
  font-size: 1.1875rem;
}

.theme-panel.is-sheet .theme-panel-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--r-surface-2);
  color: var(--r-ink-2);
  cursor: pointer;
}

.theme-panel.is-sheet .theme-panel-close .icon {
  width: 16px;
  height: 16px;
}

.theme-panel.is-sheet .theme-panel-note {
  font-size: 0.9375rem;
}


/* Page furniture shared by the home page and articles */

.eyebrow {
  color: var(--r-ink-2);
  font-size: var(--text-small);
  font-weight: 500;
  line-height: 1.4;
}

.lede {
  color: var(--r-ink-2);
  font-size: var(--text-lede);
  line-height: 1.5;
  text-wrap: pretty;
}

/* The app's own screens: no device frame, just the screen's corners and a hairline
   so a light screen still has an edge on a light page (better-ui, image outlines).
   The corner radii are the screens' own, as a share of their width and height. */

.screen {
  display: block;
  width: 100%;
  height: auto;
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
}

.screen-tablet {
  border-radius: 3.05% / 4.4%;
}

@media (prefers-color-scheme: dark) {
  .screen {
    outline-color: rgba(255, 255, 255, 0.1);
  }
}

/* The twelve-column grid the article pages use on wide screens: headings in the
   first four columns, text from the fifth. */

.article {
  --columns: repeat(12, minmax(0, 1fr));
}

/* W1 Home (web §9.1); the rest of it is in home.css. */

.hero-title {
  max-width: 13em;
  font-family: var(--font-display);
  font-size: calc(var(--text-hero) + var(--hero-extra));
  font-weight: var(--display-weight);
  line-height: 1.08;
  letter-spacing: var(--title-tracking);
}

.availability,
.badges {
  margin-block-start: 20px;
}

.availability {
  color: var(--r-ink-2);
  font-size: var(--text-small);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.badge-note {
  color: var(--r-ink-2);
  font-size: var(--text-caption);
}

/* Apple's badge, drawn from the self-hosted official artwork (build.mjs adds the URL
   only when apple.appStoreUrl is set, with the artwork's own aspect ratio); at
   least 40 px high, with the row's gaps as clear space (web §9.1). */
.app-store-badge {
  display: block;
  height: 40px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* Verse numbers sit raised without opening up the line above. */
.vnum {
  position: relative;
  top: -0.45em;
  margin-inline: 0.1em 0.2em;
  color: var(--vnum);
  font-family: var(--font-ui);
  font-size: 0.6em;
  font-variant-numeric: tabular-nums;
  line-height: 0;
  vertical-align: baseline;
}

.vstart {
  white-space: nowrap;
}

.vstart:first-child .vnum {
  margin-inline-start: 0;
}

/* Article template (web §9.14): the Markdown pages, /licences, the 404 page, /join
   and /open. */

.article {
  padding-block-start: var(--space-article);
}

.article-head > * + * {
  margin-block-start: 16px;
}

/* Page titles and headings are centred, each over its own part: on a wide screen the
   head and the text are two columns, so each centres in its own. */
.article-head {
  text-align: center;
}

.article-head .lede {
  margin-inline: auto;
}

.page-title {
  max-width: 16em;
  margin-inline: auto;
  text-align: center;
  text-wrap: balance;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--display-weight);
  line-height: 1.1;
  letter-spacing: var(--title-tracking);
}

.article-head .meta {
  color: var(--r-ink-2);
  font-size: var(--text-small);
}

/* About 66 characters a line at the body size. */
.article-text {
  max-width: 36rem;
  margin-block-start: 24px;
  margin-inline: auto;
  line-height: 1.6;
}

.article-text > * + * {
  margin-block-start: 18px;
}

.article-text > .lede + * {
  margin-block-start: 32px;
}

.article-text h2 {
  text-align: center;
  text-wrap: balance;
  font-family: var(--font-display);
  font-size: var(--text-h3-article);
  font-weight: var(--display-weight);
  line-height: 1.25;
  letter-spacing: var(--title-tracking);
}

.article-text > h2 {
  margin-block-start: 52px;
}

.article-text > h3 {
  margin-block-start: 36px;
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.4;
}

.article-text > h4 {
  margin-block-start: 28px;
  font-weight: 600;
  line-height: 1.4;
}

.article-text > :is(h2, h3, h4) + * {
  margin-block-start: 10px;
}

.article-text ul[role="list"] {
  padding: 0;
  list-style: none;
}

.article-text ul[role="list"] > li {
  position: relative;
  padding-inline-start: 20px;
}

.article-text ul[role="list"] > li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--r-ink-2);
}

.article-text li + li {
  margin-block-start: 8px;
}

.article-text ul ul {
  margin-block-start: 8px;
}

.article-text ol {
  padding-inline-start: 1.4em;
}

.article-text ol > li::marker {
  color: var(--r-ink-2);
  font-variant-numeric: tabular-nums;
}

.article-text .note {
  color: var(--r-ink-2);
  font-size: var(--text-small);
  line-height: 1.5;
}

/* The short version at the top of the legal pages: a plain section, no box. */
.summary > * + * {
  margin-block-start: 10px;
}

/* Contents list on the long pages */

.toc h2 {
  color: var(--r-ink-2);
  font-family: var(--font-ui);
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0;
}

.toc ol {
  margin-block-start: 8px;
  font-size: var(--text-small);
  line-height: 1.5;
}

.toc li + li {
  margin-block-start: 2px;
}

.toc a {
  display: inline-block;
  padding-block: 3px;
}

/* Buttons at the end of an article: a column on phones, a row from tablets. */

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-text > .actions {
  margin-block-start: 32px;
}

@media (min-width: 37.5rem) {
  .actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (min-width: 68.75rem) {
  .article {
    display: grid;
    grid-template-columns: var(--columns);
    column-gap: var(--grid-gap);
    align-items: start;
  }

  .article-head {
    grid-column: 1 / span 4;
  }

  .article-text {
    grid-column: 5 / span 8;
    margin-block-start: 0;
    /* The lede's first line sits level with the title's. */
    padding-block-start: 0.45em;
  }
}

/* W14 invite page: the line that replaces the buttons when the link has no usable
   code, or when copying fails. */

.join-problem {
  font-weight: 600;
}

/* Trading details */

.details {
  display: grid;
  grid-template-columns: 1fr;
}

.details dt {
  margin-block-start: 16px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
  font-weight: 600;
}

.details dt:first-child {
  margin-block-start: 0;
}

.details dd {
  margin: 2px 0 0;
}

@media (min-width: 37.5rem) {
  .details {
    grid-template-columns: minmax(9rem, max-content) 1fr;
    column-gap: 24px;
  }

  .details dt,
  .details dd {
    margin-block-start: 0;
    padding-block: 10px;
    border-block-start: var(--hairline) solid var(--r-line);
  }

  .details dt:first-child,
  .details dt:first-child + dd {
    border-block-start: 0;
  }
}

/* Footer (web §8.4): the name, two lines and the live pages, under one hairline
   that runs the width of the content, not the window. */

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-block: 28px max(40px, env(safe-area-inset-bottom));
  border-block-start: var(--hairline) solid var(--r-line);
}

.footer-about {
  color: var(--r-ink-2);
  font-size: var(--text-caption);
  line-height: 1.6;
}

.footer-name {
  margin-block-end: 4px;
  color: var(--r-ink);
  font-family: var(--font-title);
  font-size: var(--text-body);
  font-weight: var(--title-weight);
  line-height: 1.3;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Each link gets a 32 px row, so a tap lands on it. */
.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--r-ink-2);
  font-size: var(--text-caption);
  text-decoration: none;
}

.footer-nav a[aria-current] {
  color: var(--r-ink);
}

@media (hover: hover) and (pointer: fine) {
  .footer-nav a:hover {
    color: var(--r-ink);
    text-decoration-line: underline;
  }
}

@media (min-width: 37.5rem) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    gap: 40px;
  }

  /* Level with the footer's name. */
  .footer-nav {
    margin-block-start: -4px;
  }

  .footer-nav ul {
    justify-content: flex-end;
  }
}

/* Reduced motion (web §10.3): no slide or scale, only fades. */

@media (prefers-reduced-motion: reduce) {
  .button,
  .theme-button {
    transition: background-color 150ms ease;
  }

  /* The spinner still says "working", without turning: a slow fade instead. */
  .spinner {
    animation: spinner-fade 1.2s ease-in-out infinite alternate;
  }

  .text-swap,
  .text-swap.is-leaving {
    transition: none;
    transform: none;
    filter: none;
  }

  .button:active,
  .theme-button:active {
    transform: none;
  }

  .theme-panel[open],
  .theme-panel.is-sheet[open] {
    transition: opacity 150ms ease-out;
  }

  @starting-style {
    .theme-panel[open],
    .theme-panel.is-sheet[open] {
      opacity: 0;
      transform: none;
    }
  }
}

@keyframes spinner-fade {
  from {
    opacity: 1;
  }

  to {
    opacity: 0.35;
  }
}

/* Forced colours: keep edges where the design relies on fills and shadows. */

@media (forced-colors: active) {
  .button,
  .theme-button,
  .theme-panel {
    border: 1px solid CanvasText;
  }

  .article-text ul[role="list"] > li::before {
    forced-color-adjust: none;
    background: CanvasText;
  }

  .main-nav a[aria-current] {
    text-decoration: underline;
  }

  .spinner {
    forced-color-adjust: none;
    border-color: transparent;
    border-block-start-color: CanvasText;
  }
}

@media print {
  .skip-link,
  .site-header,
  .site-footer,
  .toc {
    display: none;
  }

  body {
    background: none;
    color: #000;
  }

  a {
    color: inherit;
  }
}

/* Page titles and headings are centred, each over its own part (see .article-head). */
.plans-head,
.plan-head,
.dv-head,
.dv-section-title,
.dv-title,
.dv-aside-title,
.plan-month-title,
.verse-ref {
  text-align: center;
}

.plans-head .lede,
.plan-head .lede,
.dv-head .lede {
  margin-inline: auto;
}

/*
  Values that aren't colours from lib/site-palette.mjs: the brand mark's dark cover,
  the card shadow, title tracking and the danger button's text. Colours the palette
  holds are never copied here: they reach the page through the generated
  themes.<hash>.css.
*/

:root {
  /* Cards rest on the page with a hairline, no shadow, as in the app. */
  --focal-shadow: none;
  /* Link colour on the focal card: ink, like every link. */
  --card-link: var(--accent);
  /* Literata Medium headings, tracked in a touch. */
  --title-tracking: -0.012em;
  --hero-extra: 0px;
  /* Text on the danger button: white in light mode. */
  --on-danger: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* White on the dark-mode red (#F58B84) is too faint, so the page colour,
       as Studio does (design-handoff/tokens/studio-palette.json onDanger). */
    --on-danger: #1D1A17;
  }

  /* The brand mark's cover on dark grounds: the kit's on-dark green
     (docs/branding/mark/USAGE.md, "Cover on dark"; lib/brand-mark.mjs). */
  .mark-cover {
    fill: #3C7560;
  }
}

/* The sign-in marks for W15 and /sign-in, self-hosted (web §9.16; build.mjs). */
.signin .signin-logo-google {
  display: block;
  background: url("/assets/sign-in-google.fc6f20c2f9.svg") center / contain no-repeat;
}

/* src/styles/account.css */
/*
  The account menu (src/scripts/account.js), which replaces the header's "Sign in"
  link on the groups pages when someone is signed in. On tablet and desktop it's a
  quiet "Account" button, like the main navigation's links, opening a small panel in
  the text panel's popover's material; on phones its rows join the phone menu's list.
*/

.account-menu {
  position: relative;
  display: flex;
}

.account-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--r-ink-2);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

/* A small chevron drawn in the text's colour, turned over while the panel is open. */
.account-button::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-block-start: -3px;
  border-block-end: 1.5px solid currentColor;
  border-inline-end: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 150ms var(--ease-out);
}

.account-button[aria-expanded="true"] {
  color: var(--r-ink);
}

.account-button[aria-expanded="true"]::after {
  margin-block-start: 3px;
  transform: rotate(225deg);
}

/* Signed in with a name: the person's avatar and name (account.js), the name cut short
   with an ellipsis if it's long; the panel says it in full. */
.account-button.has-person {
  gap: 8px;
}

.account-name {
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .account-button:hover {
    color: var(--r-ink);
  }
}

.account-panel {
  --ring-gap: var(--sheet);
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 30;
  width: max-content;
  min-width: 220px;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 8px;
  border-radius: var(--r-card);
  background: var(--sheet);
  color: var(--r-ink);
  box-shadow: 0 0 0 0.5px var(--r-line), 0 24px 50px rgba(0, 0, 0, 0.2);
  transform-origin: top right;
}

.account-panel:not([hidden]) {
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}

@starting-style {
  .account-panel:not([hidden]) {
    opacity: 0;
    transform: scale(0.98);
  }
}

.account-who {
  padding: 8px 12px 6px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.account-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Rows: 44 px high, their corners concentric with the panel's (18 − 8). */
.account-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--r-s);
  background: none;
  color: var(--r-ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .account-item:hover {
    background: var(--r-surface-2);
  }
}

.account-item[aria-disabled="true"],
.menu-list-button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.55;
}

/* "Sign out" in the phone menu: a row like the menu's links, without the chevron. */
.menu-list .menu-list-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 8px 0;
  border: 0;
  border-block-end: var(--hairline) solid var(--r-line);
  background: none;
  color: var(--r-ink);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--display-weight);
  line-height: 1.2;
  text-align: start;
  cursor: pointer;
}

/* Avatars (avatar.js), here and on the groups pages: drawn in light and dark, one shown
   with the device's setting. A hairline ring keeps a pale avatar off a pale page. */
.avatar {
  display: block;
  flex: none;
  border-radius: 50%;
  box-shadow: 0 0 0 1px oklch(0 0 0 / 0.1);
}

.avatar-dark {
  display: none;
}

.avatar-blank {
  fill: var(--r-surface-2);
}

@media (prefers-color-scheme: dark) {
  .avatar {
    box-shadow: 0 0 0 1px oklch(1 0 0 / 0.1);
  }

  .avatar-light {
    display: none;
  }

  .avatar-dark {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-button::after,
  .account-panel:not([hidden]) {
    transition: none;
  }
}

@media (forced-colors: active) {
  .account-panel {
    border: 1px solid CanvasText;
  }
}

/* src/styles/app.css */
/* The app (/app, lib/pages/app.mjs). Every heading is centred over its own part. Screens sit inside
   Apple's own device frames, and nothing is laid over a device (CLAUDE.md 6.15).

   The story at the top has two forms from one markup. Plain (phones, Reduce Motion, no script): the
   headline, then each part as words over its own phone. Live (.is-live, added by app-story.js on wide
   screens): one pinned stage, the phones stacked into one, words on the left, an index on the right;
   the script moves them with transform and opacity only. */

.app-page {
  padding-block-end: var(--space-end);
}

/* The live story's stage runs the window's full width (below); this keeps a classic scroll bar's
   few pixels from adding a sideways scroll. On main, which is window-wide, and clip rather than
   hidden, so the stage can still stick. */
main:has(.app-page) {
  overflow-x: clip;
}

.app-part,
.app-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.app-title {
  max-width: 14em;
  margin-inline: auto;
  text-wrap: balance;
}

.app-lede {
  max-width: 34em;
  margin: 16px auto 0;
}

.app-get {
  justify-content: center;
}

.app-part {
  margin-block-start: var(--space-section);
}

.app-part-title {
  max-width: 18em;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--display-weight);
  line-height: 1.15;
  letter-spacing: var(--title-tracking);
  text-wrap: balance;
}

.app-part-text {
  max-width: 34em;
  margin-block-start: 14px;
  color: var(--r-ink-2);
  font-size: var(--text-lede);
  line-height: 1.55;
  text-wrap: pretty;
}

/* ---- A screen in its device frame ----------------------------------------------------------
   The numbers are each Apple bezel's size and its screen's place inside it, in the bezel's pixels,
   so the screen lands exactly in the cut-out; the radius matches the bezel's inner corner. */

.device {
  position: relative;
  margin: 0;
  min-width: 0;
}

.device picture {
  display: contents;
}

.device-screen {
  position: absolute;
  overflow: hidden;
  background: #000;
  /* Its own layer, so the corner clip holds while the screen inside moves. */
  isolation: isolate;
}

.device-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.device-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

/* iPhone 18 Pro: 1350 × 2760, screen 1206 × 2622 at 72, 69, corner 188. */
.device-iphone {
  aspect-ratio: 1350 / 2760;
}

.device-iphone .device-screen {
  left: 5.3333%;
  top: 2.5%;
  width: 89.3333%;
  height: 95%;
  border-radius: 15.59% / 7.17%;
}

/* iPad Pro 13-inch, landscape: 3000 × 2300, screen 2752 × 2064 at 124, 118, corner 58. */
.device-ipad {
  aspect-ratio: 3000 / 2300;
}

.device-ipad .device-screen {
  left: 4.1333%;
  top: 5.1304%;
  width: 91.7333%;
  height: 89.7391%;
  border-radius: 2.11% / 2.81%;
}

/* iPhone Duo, open and upright (stood half open, like a laptop): the landscape bezel turned a quarter,
   2247 × 3093, screen 2007 × 2853 at 120, 120. */
.device-duo-stand {
  aspect-ratio: 2247 / 3093;
}

.device-duo-stand .device-screen {
  left: 5.3405%;
  top: 3.8797%;
  width: 89.3191%;
  height: 92.2405%;
  border-radius: 8.02% / 5.64%;
}

/* iPhone Duo, open, landscape: 3093 × 2247, screen 2853 × 2007 at 120, 120, corner 161. */
.device-duo {
  aspect-ratio: 3093 / 2247;
}

.device-duo .device-screen {
  left: 3.8797%;
  top: 5.3405%;
  width: 92.2405%;
  height: 89.3191%;
  border-radius: 5.64% / 8.02%;
}

/* ---- The story, plain ---------------------------------------------------------------------- */

.story-head {
  padding-block-start: var(--space-hero);
  text-align: center;
}

.story-sides,
.story-index {
  display: none;
}

.story-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.story-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-block-start: var(--space-section);
  text-align: center;
}

.story-step:first-child {
  margin-block-start: var(--space-figure);
}

.story-label {
  color: var(--r-ink-2);
  font-size: var(--text-small);
  font-weight: 600;
}

.story-title {
  max-width: 18em;
  margin: 6px auto 0;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--display-weight);
  line-height: 1.15;
  letter-spacing: var(--title-tracking);
  text-wrap: balance;
}

.story-text {
  max-width: 32em;
  margin: 14px auto 0;
  color: var(--r-ink-2);
  font-size: var(--text-lede);
  line-height: 1.55;
  text-wrap: pretty;
}

.story-phone {
  width: clamp(200px, 62vw, 290px);
  margin-block-start: 28px;
}

/* ---- The story, live (wide screens with motion) --------------------------------------------- */

.story.is-live {
  /* app-story.js sets the height: the scroll the story takes, plus one window. */
  position: relative;
}

.story.is-live .story-stage {
  position: sticky;
  top: 0;
  /* Out of the page column to the window's edges, so the outer phones leave at the window's edge
     rather than being cut at the column's. Everything inside is placed from the middle. */
  margin-inline: calc(50% - 50vw);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.story.is-live .story-head {
  position: absolute;
  inset-inline: 0;
  top: calc(var(--header-h) + 5vh);
  padding: 0 var(--gutter);
  will-change: transform, opacity;
}

/* The phone column: every phone, the outer ones included, stands in the same place and height. */
.story.is-live .story-phone,
.story.is-live .story-side {
  position: absolute;
  top: var(--pin-top);
  left: 50%;
  height: var(--phone-h);
  width: auto;
  margin: 0;
  transform-origin: 50% 0;
  will-change: transform;
}

.story.is-live {
  --pin-top: calc(var(--header-h) + 20px);
  /* The phone fills the window under the header, up to a size that still looks like a phone. */
  --phone-h: min(calc(100dvh - var(--pin-top) - 28px), 820px);
  /* Half the phone's width (1350 / 2760 of its height), plus the gap the words and index keep from it. */
  --phone-reach: calc(var(--phone-h) * 0.2446 + 44px);
}

.story.is-live .story-sides {
  display: block;
}

.story.is-live .story-step {
  display: block;
  margin: 0;
}

.story.is-live .story-step .device-screen {
  will-change: transform;
}

/* Each later phone's screen waits below its cut-out until its turn, then slides up as a sheet over
   the one beneath, so its own cut-out is see-through until then. */
.story.is-live .story-step:not(:first-child) .device-screen {
  background: transparent;
}

.story.is-live .device-img.is-moving {
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.2);
}

.story.is-live .story-words {
  position: absolute;
  top: 50%;
  left: max(var(--gutter), calc(50% - 560px));
  right: calc(50% + var(--phone-reach));
  max-width: 25rem;
  text-align: start;
  opacity: 0;
  will-change: transform, opacity;
}

.story.is-live .story-title {
  margin-inline: 0;
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
}

.story.is-live .story-text {
  margin-inline: 0;
}

.story.is-live .story-index {
  display: flex;
  position: absolute;
  top: 50%;
  left: calc(50% + var(--phone-reach));
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0 0 0 18px;
  border-inline-start: var(--hairline) solid var(--r-line);
  list-style: none;
  translate: 0 -50%;
  opacity: 0;
  will-change: opacity;
}

.story-index li {
  color: var(--r-ink-2);
  font-size: var(--text-small);
  opacity: 0.55;
  transition: opacity 240ms var(--ease-out), color 240ms var(--ease-out);
}

.story-index li.is-current {
  color: var(--r-ink);
  font-weight: 600;
  opacity: 1;
}

/* ---- iPad and iPhone Duo ------------------------------------------------------------------ */

.app-ipads {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  width: 100%;
  margin-block-start: 36px;
  perspective: 1600px;
}

.app-ipad-main {
  width: min(100%, 860px);
}

.app-ipad-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 32px);
  width: min(100%, 860px);
}

.app-duo {
  width: min(100%, 900px);
  margin-block-start: 36px;
  perspective: 1600px;
}

.app-duo-stand {
  width: min(100%, 460px);
}

/* Rising into view, once: a little low and tipped back, then flat. app-story.js adds .is-in. */
.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(48px) rotateX(10deg) scale(0.97);
  transform-origin: 50% 100%;
  transition:
    opacity 700ms var(--ease-out),
    transform 900ms var(--ease-out);
}

.reveal-ready .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---- The smaller things -------------------------------------------------------------------- */

.app-also {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 40px;
  width: 100%;
  max-width: 52rem;
  margin: 28px 0 0;
  text-align: start;
}

.app-also > div {
  padding-block: 16px;
  border-block-start: var(--hairline) solid var(--r-line);
}

.app-also dt {
  font-weight: 600;
}

.app-also dd {
  margin: 4px 0 0;
  color: var(--r-ink-2);
  line-height: 1.5;
}

@media (min-width: 48rem) {
  .app-also {
    grid-template-columns: 1fr 1fr;
  }
}

.app-end {
  margin-block-start: var(--space-section);
  padding-block-start: 40px;
  border-block-start: var(--hairline) solid var(--r-line);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-ready .reveal {
    transform: none;
    transition: opacity 300ms ease;
  }
}

/* src/styles/blog.css */
/* The blog and the pages for search (lib/pages/blog.mjs). A post is the article template with a
   few parts of its own: screens in their device frames, the questions, a closing box and the
   lists of what to read next. Frames come from app.css (.device); nothing is laid over a device. */

.post .eyebrow a {
  color: inherit;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .post .eyebrow a:hover {
    text-decoration: underline;
  }
}

/* A screen in its frame, centred in the text column. */
.post-shot {
  margin-block: 32px;
  margin-inline: auto;
}

.post-shot-iphone {
  width: min(100%, 280px);
}

.post-shot-ipad,
.post-shot-duo {
  width: 100%;
}

.post-shot-duo-stand {
  width: min(100%, 400px);
}

/* The closing box: what Found is, in a line, and where to go next. */
.post-cta {
  margin-block-start: 56px;
  padding: 28px 24px;
  border: var(--hairline) solid var(--r-line);
  border-radius: 20px;
  text-align: center;
}

.article-text .post-cta h2 {
  margin: 0;
}

.post-cta p {
  max-width: 30em;
  margin: 10px auto 0;
  color: var(--r-ink-2);
}

.post-cta .badges,
.post-cta .actions {
  justify-content: center;
  margin-block-start: 20px;
}

/* What to read next: two short lists. */
.post-more {
  margin-block-start: 48px;
  padding-block-start: 8px;
  border-block-start: var(--hairline) solid var(--r-line);
}

.article-text .post-more ul[role="list"] > li::before {
  content: none;
}

.article-text .post-more ul[role="list"] > li {
  padding-inline-start: 0;
}

/* The index. Headings are centred over their own part; the cards are rows of words. */
.blog-index {
  padding-block: var(--space-article) var(--space-end);
}

.blog-head {
  text-align: center;
}

.blog-head .lede {
  max-width: 34em;
  margin: 16px auto 0;
}

.blog-part {
  max-width: 52rem;
  margin: var(--space-section) auto 0;
}

.blog-part-title {
  font-family: var(--font-display);
  font-size: var(--text-h3-article);
  font-weight: var(--display-weight);
  letter-spacing: var(--title-tracking);
  text-align: center;
}

.post-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 40px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .post-list {
    grid-template-columns: 1fr 1fr;
  }
}

.post-card {
  display: block;
  height: 100%;
  padding-block: 18px;
  border-block-start: var(--hairline) solid var(--r-line);
  color: inherit;
  text-decoration: none;
}

.post-card-title {
  display: block;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

.post-card-text {
  display: block;
  margin-block-start: 6px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
  line-height: 1.5;
}

@media (hover: hover) and (pointer: fine) {
  .post-card:hover .post-card-title {
    text-decoration: underline;
  }
}

/* The app page's questions reuse its index of smaller things. */
.app-questions dd {
  text-wrap: pretty;
}

/* src/styles/delete-account.css */
/*
  W15 Delete your account (web §9.16). The article template, with a form and the
  three sign-in buttons. No boxes around the text and no coloured bars: messages are
  plain lines, errors sit under their field in the danger colour (4.5:1 or more on
  every page colour, checked by check.mjs), and the only filled shapes are buttons
  and fields.
*/

.w15 [data-w15-title]:focus {
  /* Focus lands here when the state changes, for screen readers; it isn't a control. */
  outline: none;
}

.w15-message {
  font-weight: 600;
}

.w15-panel > * + * {
  margin-block-start: 18px;
}

.w15-panel > h2 {
  margin-block-start: 40px;
}

.w15-panel > h2:first-child {
  margin-block-start: 0;
}

.w15-panel > h2 + * {
  margin-block-start: 10px;
}

.w15-panel > .actions {
  margin-block-start: 32px;
}

/* The three ways in: one column, one size, at every width (web §9.16). */

.w15-providers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--r-b);
  font: inherit;
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform 120ms var(--ease-out), background-color 150ms ease;
}

.signin:active {
  transform: scale(0.98);
}

.signin-logo {
  display: none;
  flex: none;
}

/* Apple: black with white text on light pages, white with black text on dark ones,
   in the system font (Apple's guidelines). The logo is Apple's own artwork, drawn as
   a mask in the label's colour (build.mjs). */
.signin-apple {
  background: #000000;
  color: #FFFFFF;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
}

.signin-logo-apple {
  height: 1.15em;
  margin-block-start: -0.15em;
}

/* Google's light and dark styles, with its standard "G" never recoloured (Google's
   sign-in branding guidelines). */
.signin-google {
  background: #FFFFFF;
  color: #1F1F1F;
  box-shadow: inset 0 0 0 1px #747775;
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  font-weight: 500;
}

.signin-logo-google {
  width: 1.125rem;
  height: 1.125rem;
}

/* Email follows the theme: the site's secondary button. */
.signin-email {
  background: transparent;
  color: var(--r-ink);
  box-shadow: inset 0 0 0 1px var(--r-line);
}

@media (prefers-color-scheme: dark) {
  .signin-apple {
    background: #FFFFFF;
    color: #000000;
  }

  .signin-google {
    background: #131314;
    color: #E3E3E3;
    box-shadow: inset 0 0 0 1px #8E918F;
  }
}

/* The focus ring of web §7.5, kept beside the edges these draw with box-shadow. */
.signin-google:focus-visible {
  box-shadow: inset 0 0 0 1px #747775, 0 0 0 3px var(--page), 0 0 0 6px var(--r-accent);
}

.signin-email:focus-visible {
  box-shadow: inset 0 0 0 1px var(--r-line), 0 0 0 3px var(--page), 0 0 0 6px var(--r-accent);
}

@media (prefers-color-scheme: dark) {
  .signin-google:focus-visible {
    box-shadow: inset 0 0 0 1px #8E918F, 0 0 0 3px var(--page), 0 0 0 6px var(--r-accent);
  }
}

@media (hover: hover) and (pointer: fine) {
  .signin-email:hover {
    background: var(--r-surface-2);
  }
}

/* Fields: labels above, 52 px high, 17 px text so iOS Safari doesn't zoom. The
   edge is the quieter ink, so a field stands out at 3:1 or more on every page. */

.w15-form > * + * {
  margin-block-start: 20px;
}

.w15-form > .actions {
  margin-block-start: 28px;
}

.field-label {
  display: block;
  color: var(--r-ink);
  font-size: var(--text-small);
  font-weight: 600;
  line-height: 1.4;
}

.field-input {
  display: block;
  width: 100%;
  max-width: 400px;
  min-height: 52px;
  margin-block-start: 6px;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--r-row);
  background: var(--page);
  box-shadow: inset 0 0 0 1px var(--r-ink-2);
  color: var(--r-ink);
  font: inherit;
  font-size: var(--text-body);
  line-height: 1.3;
}

.field-input[aria-invalid="true"] {
  box-shadow: inset 0 0 0 2px var(--danger);
}

.field-input:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: inset 0 0 0 1px var(--r-ink-2), 0 0 0 3px var(--page), 0 0 0 6px var(--r-accent);
}

.field-input[aria-invalid="true"]:focus-visible {
  box-shadow: inset 0 0 0 2px var(--danger), 0 0 0 3px var(--page), 0 0 0 6px var(--r-accent);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-block-start: 6px;
}

.field-row .field-input {
  flex: 1 1 14rem;
  margin-block-start: 0;
}

.field-code {
  max-width: 12rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2em;
}

.field-error {
  margin-block-start: 6px;
  color: var(--danger);
  font-size: var(--text-small);
  font-weight: 600;
  line-height: 1.45;
}

/* Text buttons: links in look, buttons in kind, with a 44 px row to tap. */

.text-button,
.field-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--r-accent);
  font: inherit;
  font-size: var(--text-body);
  text-align: start;
  text-decoration-line: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.field-toggle {
  font-size: var(--text-small);
}

@media (hover: hover) and (pointer: fine) {
  .text-button:hover,
  .field-toggle:hover {
    text-decoration-thickness: 2px;
  }
}

.w15-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-block-start: 24px;
}

.w15-links .note {
  margin-block: 8px;
}

.w15-hint {
  margin-block-end: 4px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
}

/* Unavailable for now (a request on its way, or the wait before a new code):
   still focusable, so its reason is read out. */
.w15 [aria-disabled="true"] {
  cursor: default;
  opacity: 0.55;
}

.w15 .button[aria-disabled="true"]:active,
.w15 .signin[aria-disabled="true"]:active {
  transform: none;
}

/* The danger button (web §7.1): text on --danger is checked at 4.5:1. */
.button-danger {
  background: var(--danger);
  color: var(--on-danger);
}

@media (hover: hover) and (pointer: fine) {
  .button-danger:hover {
    background: color-mix(in oklab, var(--danger) 88%, var(--r-ink));
  }
}

/* "What goes": crosses in place of the dots, as the app's A9 draws them. */
.article-text ul.w15-goes > li::before {
  content: none;
}

.w15-cross {
  position: absolute;
  inset-inline-start: 0;
  top: 0.38em;
  width: 14px;
  height: 14px;
  color: var(--r-ink-2);
}

@media (prefers-reduced-motion: reduce) {
  .signin {
    transition: background-color 150ms ease;
  }

  .signin:active {
    transform: none;
  }
}

@media (forced-colors: active) {
  .signin,
  .field-input {
    border: 1px solid CanvasText;
  }

  .field-input[aria-invalid="true"] {
    border-width: 2px;
  }
}

/* src/styles/devotionals.css */
/*
  W10 devotionals (web §9.10), lib/pages/devotionals.mjs. Spurgeon's reading set
  like Scripture in the reader; lists separated by hairlines, never boxed.
*/

.dv {
  padding-block-start: var(--space-article);
}

.dv-head .lede {
  max-width: 36rem;
  margin-block-start: 16px;
}

.dv-section {
  margin-block-start: 56px;
  margin-inline: auto;
}

.dv-section-title {
  font-family: var(--font-display);
  font-size: var(--text-h3-article);
  font-weight: var(--display-weight);
  line-height: 1.2;
}

.dv-section-title + * {
  margin-block-start: 16px;
}

/* Today, on /devotionals */
.dv-today {
  margin-block-start: 48px;
}

.dv-today-list {
  width: fit-content;
  margin: 16px auto 0;
  padding: 0;
  list-style: none;
}

.dv-today-list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 48px;
  padding-block: 12px;
  border-block-end: var(--hairline) solid var(--r-line);
  color: var(--r-ink);
  font-size: var(--text-lede);
  text-decoration: none;
}

.dv-slot {
  color: var(--r-ink-2);
}

/* The twelve months: chips in a row that wraps, centred under the centred title.
   Each month a capsule on the raised sheet with a hairline edge. */
.dv-months ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dv-months a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 16px;
  border-radius: var(--r-pill);
  background: var(--sheet);
  box-shadow: inset 0 0 0 var(--hairline) var(--line-strong);
  color: var(--r-ink);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.dv-months a[aria-current] {
  background: var(--r-ink);
  box-shadow: none;
  color: var(--page);
}

.dv-month .dv-months {
  margin-block-start: 28px;
}

@media (hover: hover) and (pointer: fine) {
  .dv-today-list a:hover [data-today-ref],
  .dv-day-readings a:hover {
    text-decoration: underline;
  }

  .dv-months a:not([aria-current]):hover {
    text-decoration: none;
    background: var(--hover);
  }
}

/* About these readings */
.dv-about {
  max-width: 36rem;
  line-height: 1.6;
}

.dv-about h3 {
  margin-block-start: 28px;
  font-size: var(--text-body);
  font-weight: 600;
}

.dv-about h3 + p {
  margin-block-start: 6px;
}

/* A month: one row a day, the date then morning and evening. */
.dv-days {
  max-width: 51rem;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  border-block-start: var(--hairline) solid var(--r-line);
}

.dv-day {
  display: flex;
  gap: 16px;
  padding-block: 14px;
  border-block-end: var(--hairline) solid var(--r-line);
  scroll-margin-block: 96px;
}

.dv-day-date {
  display: flex;
  flex-direction: column;
  flex: none;
  width: 52px;
}

.dv-day-n {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--display-weight);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.dv-day-weekday,
.dv-today-mark {
  color: var(--r-ink-2);
  font-size: 0.75rem;
  line-height: 1.4;
}

.dv-today-mark {
  color: var(--r-accent);
  font-weight: 600;
}

.dv-day-readings {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dv-day-readings li {
  min-height: 28px;
}

.dv-day-readings a {
  color: var(--r-accent);
  text-decoration: none;
}

.dv-day-readings a .dv-slot,
.dv-today-list .dv-slot {
  color: var(--r-ink-2);
}

.dv-today-list [data-today-ref] {
  color: var(--r-accent);
}

/* Published series on /devotionals: a name and a line each, as the home page lists. */
.dv-series {
  display: grid;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dv-series a {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--display-weight);
  line-height: 1.25;
}

.dv-series p {
  max-width: 36rem;
  margin-block-start: 6px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
  line-height: 1.5;
  text-wrap: pretty;
}

.dv-series-list {
  margin-block-start: 32px;
}

/* A reading */
.dv-reading {
  display: grid;
  gap: 64px;
}

.dv-article {
  max-width: 42.5rem;
}

.dv-when {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.dv-date {
  color: var(--r-ink-2);
  font-size: 0.875rem;
}

/* Morning and evening: two links drawn as a segmented control. */
.dv-switch ul {
  display: flex;
  gap: 3px;
  margin: 0;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--r-surface-2);
  list-style: none;
}

.dv-switch a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 30px;
  padding-inline: 14px;
  border-radius: var(--r-pill);
  color: var(--r-ink-2);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

/* 30 px drawn, 44 px to tap. */
.dv-switch a::after {
  content: "";
  position: absolute;
  inset: -7px 0;
}

.dv-switch a[aria-current] {
  background: var(--seg-on);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  color: var(--r-ink);
  font-weight: 600;
}

.dv-title {
  margin-block-start: 20px;
}

.dv-byline {
  margin-block-start: 12px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
}

.dv-byline cite {
  font-style: normal;
}

.dv-verse {
  margin: 32px 0 0;
  color: var(--scripture);
  font-family: var(--font-scripture);
  /* Text size from the text panel (reader.css --text-scale), as on chapters. */
  font-size: calc(1.25rem * var(--text-scale, 1));
  line-height: 1.5;
  text-wrap: pretty;
}

.dv-verse .nd {
  font-variant-caps: all-small-caps;
}

.dv-verse-ref {
  margin-block-start: 10px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
}

.dv-small {
  color: var(--r-ink-2);
  font-size: var(--text-caption);
  line-height: 1.5;
}

.dv-verse-ref + .dv-small {
  margin-block-start: 6px;
}

.dv-text {
  margin-block-start: 32px;
  color: var(--scripture);
  font-family: var(--font-scripture);
  font-size: calc(1.1875rem * var(--text-scale, 1));
  line-height: 1.7;
  hanging-punctuation: first;
}

.dv-text p + p {
  margin-block-start: 1em;
}

.dv-note {
  margin-block-start: 28px;
  font-size: var(--text-small);
}

.dv-note-label {
  color: var(--r-ink-2);
  font-weight: 600;
}

.dv-note [data-source-text] {
  margin-block-start: 4px;
  font-family: var(--font-scripture);
}

.dv-source {
  margin-block-start: 40px;
}

.dv-aside > * + * {
  margin-block-start: 32px;
}

.dv-aside-title {
  color: var(--r-ink-2);
  font-size: 0.875rem;
  font-weight: 600;
}

.dv-aside-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.dv-aside-list a {
  display: flex;
  flex-direction: column;
  padding-block: 10px;
  border-block-start: var(--hairline) solid var(--r-line);
  color: var(--r-ink);
  text-decoration: none;
}

.dv-past-date {
  color: var(--r-ink-2);
  font-size: var(--text-caption);
}

.dv-past-ref {
  font-weight: 600;
}

.dv-aside-more {
  font-size: var(--text-small);
  font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
  .dv-aside-list a:hover .dv-past-ref {
    text-decoration: underline;
  }
}

@media (min-width: 68.75rem) {
  .dv-reading {
    grid-template-columns: minmax(0, 680px) 300px;
    column-gap: 72px;
    align-items: start;
  }

  .dv-text {
    font-size: calc(var(--scripture-size-desktop) * var(--text-scale, 1));
  }

  .dv-aside {
    padding-block-start: 64px;
  }
}

@media print {
  .dv-aside,
  .dv-switch,
  .dv-months {
    display: none;
  }
}

/* src/styles/groups.css */
/*
  /groups and /groups/group (lib/pages/groups.mjs, src/scripts/groups.js). The article
  template, with the group's parts as plain sections: space between them, hairlines
  only between the groups in the list, no cards around text. The chapter grid and the
  week's bars are the app's G4 and R5, drawn with the site's own colours.
*/

/* Lists that carry their own layout, not the article's dots. */
.article-text ul.groups-list[role="list"] > li,
.article-text ul.group-passages[role="list"] > li,
.article-text ul.group-people[role="list"] > li,
.article-text ul.group-results[role="list"] > li,
.article-text ul.group-requests[role="list"] > li,
.article-text ul.group-received-list[role="list"] > li,
.article-text ul.group-suggested-list[role="list"] > li,
.article-text ul.group-milestones[role="list"] > li,
.article-text ul.group-milestone-names[role="list"] > li,
.article-text ul.group-about[role="list"] > li,
.group-report-next > li {
  padding-inline-start: 0;
}

.article-text ul.groups-list[role="list"] > li::before,
.article-text ul.group-passages[role="list"] > li::before,
.article-text ul.group-people[role="list"] > li::before,
.article-text ul.group-results[role="list"] > li::before,
.article-text ul.group-requests[role="list"] > li::before,
.article-text ul.group-received-list[role="list"] > li::before,
.article-text ul.group-suggested-list[role="list"] > li::before,
.article-text ul.group-milestones[role="list"] > li::before,
.article-text ul.group-about[role="list"] > li::before {
  content: none;
}

.article-text ul.groups-list[role="list"] > li + li,
.article-text ul.group-passages[role="list"] > li + li,
.article-text ul.group-people[role="list"] > li + li,
.article-text ul.group-results[role="list"] > li + li,
.article-text ul.group-requests[role="list"] > li + li,
.article-text ul.group-received-list[role="list"] > li + li,
.article-text ul.group-suggested-list[role="list"] > li + li,
.article-text ul.group-milestones[role="list"] > li + li,
.article-text ul.group-milestone-names[role="list"] > li + li,
.article-text ul.group-about[role="list"] > li + li {
  margin-block-start: 0;
}

/* /groups */

.groups-list {
  border-block-start: var(--hairline) solid var(--r-line);
}

.groups-item {
  display: grid;
  gap: 4px;
  padding-block: 20px;
  border-block-end: var(--hairline) solid var(--r-line);
}

/* A group's name in the list is a row's title, not a heading over a part. */
.article-text .groups-name {
  margin: 0;
  text-align: start;
}

.groups-name a {
  color: var(--r-ink);
  text-decoration-color: var(--r-line);
}

@media (hover: hover) and (pointer: fine) {
  .groups-name a:hover {
    text-decoration-color: currentColor;
  }
}

.groups-line {
  margin-block-start: 2px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
  font-weight: 600;
}

.groups-meta {
  color: var(--r-ink-2);
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
}

.groups-section > h2 + * {
  margin-block-start: 10px;
}

/* Both pages: the parts stack with the same space between whichever are showing (a
   flex gap skips hidden parts, where sibling margins wouldn't). */

.article-text.groups,
.article-text.group {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.article-text.groups > * + *,
.article-text.group > * + * {
  margin-block-start: 0;
}

.article-text.groups > .groups-message + .actions,
.article-text.group > .groups-message + .actions {
  margin-block-start: -12px;
}

/* /groups/group: one part on a phone; side by side with room, the reading in one and
   the people in the other, each with its headings centred over it. */

.group-parts,
.group-part {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.group-part:empty {
  display: none;
}

@media (min-width: 60rem) {
  .article:has(.group-parts) {
    display: block;
    max-width: 62rem;
    margin-inline: auto;
  }

  .article:has(.group-parts) .article-text {
    max-width: none;
    margin-block-start: 24px;
    padding-block-start: 0;
  }

  .group-parts {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 56px;
    align-items: start;
  }
}

.group-back {
  font-weight: 600;
}

.group-back a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.article-head > .group-meta + .group-meta {
  margin-block-start: 4px;
}

.group-meta {
  font-variant-numeric: tabular-nums;
}

.group-section > * + * {
  margin-block-start: 12px;
}

/* A heading stays centred over its own part, with its caption under it. */
.group-section-head {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.group-caption {
  color: var(--r-ink-2);
  font-size: var(--text-small);
  line-height: 1.45;
  text-wrap: pretty;
}

/* Today's reading: short lines under a centred heading, so they centre with it. */

[data-group-today],
.group-together-part {
  text-align: center;
}

.group-section .actions {
  justify-content: center;
}

.group-section .group-request-actions {
  justify-content: flex-start;
}

.group-day {
  color: var(--r-ink-2);
  font-size: var(--text-small);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.group-passages {
  display: grid;
  gap: 2px;
}

.group-passages li {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: var(--display-weight);
  line-height: 1.2;
  letter-spacing: var(--title-tracking);
}

.article-text .group-passages + .group-caption {
  margin-block-start: 4px;
}

.article-text .group-tick {
  margin-block-start: 20px;
}

.group-tick-status {
  font-weight: 600;
  text-align: center;
}

/* The status line sits just after today's reading, outside it, so it outlasts the
   reading when the last day is marked. Under the reading it keeps the reading's own
   12px; empty, it takes no room (its negative margin cancels the column's gap), but
   stays rendered: a live region that's display: none isn't reliably announced when
   its words arrive. */
.group-part > [data-group-today]:not([hidden]) + .group-tick-status {
  margin-block-start: -28px;
}

.group-part > .group-tick-status:empty,
.group-part > [data-group-today]:not([hidden]) + .group-tick-status:empty {
  margin-block-start: -40px;
}

/* R5's chapter grid: coloured by the group's days, never by who has read what. */

.group-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.group-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  border-radius: var(--r-row);
  color: var(--r-ink-2);
  font-size: var(--text-caption);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1.5px var(--r-line);
}

/* Contrast is symmetric, so the page's colour on the accent reads as well as the accent on the page. */
.group-cell.is-reached {
  background: var(--r-accent);
  color: var(--page);
  box-shadow: none;
}

.group-cell.is-today {
  background: var(--r-accent-soft);
  color: var(--r-accent);
  box-shadow: inset 0 0 0 2px var(--r-accent);
}

@media (forced-colors: active) {
  .group-cell {
    border: 1px solid CanvasText;
  }

  .group-cell.is-reached {
    forced-color-adjust: none;
    background: CanvasText;
    color: Canvas;
  }

  .group-cell.is-today {
    border-width: 3px;
  }
}

/* Together */

.group-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px 10px;
  font-weight: 600;
}

.group-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: var(--display-weight);
  line-height: 1;
  letter-spacing: var(--title-tracking);
  font-variant-numeric: tabular-nums;
}

/* The week: the group's count each day, the way G4 draws it. Days still to come, and
   days nobody has read yet, rest on a thin line. */
.group-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  max-width: 24rem;
  margin-inline: auto;
}

.group-day-column {
  display: grid;
  grid-template-rows: 34px auto;
  gap: 6px;
}

.group-bar {
  align-self: end;
  display: block;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--r-line);
}

.group-bar:not([data-level="0"]) {
  background: var(--r-accent);
}

.group-bar[data-level="1"] { height: 5px; }
.group-bar[data-level="2"] { height: 9px; }
.group-bar[data-level="3"] { height: 13px; }
.group-bar[data-level="4"] { height: 17px; }
.group-bar[data-level="5"] { height: 21px; }
.group-bar[data-level="6"] { height: 26px; }
.group-bar[data-level="7"] { height: 30px; }
.group-bar[data-level="8"] { height: 34px; }

.group-initial {
  color: var(--r-ink-2);
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: center;
}

@media (forced-colors: active) {
  .group-bar:not([data-level="0"]) {
    forced-color-adjust: none;
    background: CanvasText;
  }
}

/* People: who read today in a row, the members one to a line. */

.group-people {
  display: grid;
  gap: 6px;
}

.group-people-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.group-person-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The avatar beside a name (avatar.js; account.css draws it). */
.group-avatar {
  width: 24px;
  height: 24px;
}

.group-person {
  font-weight: 600;
}


.group-tag {
  color: var(--r-ink-2);
}

/* Between readings: the vote, and the owner's part of it. Rows and hairlines, no cards. */

.group-results {
  border-block-start: var(--hairline) solid var(--r-line);
}

.group-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 10px;
  border-block-end: var(--hairline) solid var(--r-line);
}

.group-result.is-chosen .group-result-label {
  font-weight: 600;
}

.group-result-count {
  color: var(--r-ink-2);
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
}

.group-between-line,
[data-between-body],
[data-between-note],
.group-finished,
.group-section-note {
  text-align: center;
}

.group-vote > * + *,
.group-form > * + * {
  margin-block-start: 12px;
}

.group-form {
  padding-block-start: 8px;
}

.group-form h3 {
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.group-form select.field-input {
  width: 100%;
  appearance: auto;
}

.group-form .field-row {
  align-items: center;
}

.group-suggested-list {
  border-block-start: var(--hairline) solid var(--r-line);
}

.group-suggested {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-block-end: var(--hairline) solid var(--r-line);
}

.group-suggested .text-button {
  font-size: var(--text-small);
}

/* A list to choose one from, or a switch with its reason: the same row. */

.group-choices {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-block-start: var(--hairline) solid var(--r-line);
}

.group-choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  padding-block: 12px;
  cursor: pointer;
}

.group-choices .group-choice {
  border-block-end: var(--hairline) solid var(--r-line);
}

.group-choice input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--r-accent);
}

.group-choice-words {
  display: grid;
  gap: 2px;
}

.group-choice-title {
  font-weight: 600;
  line-height: 1.35;
}

.group-choice-sub {
  color: var(--r-ink-2);
  font-size: var(--text-small);
  line-height: 1.45;
}

/* Encouragements and requests */

.group-received-list {
  display: grid;
  gap: 14px;
}

.article-text .group-received-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--display-weight);
  line-height: 1.25;
}

.article-text .group-received-text + .group-caption {
  margin-block-start: 2px;
}

.article-text .group-received-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.group-received-meta .group-avatar {
  flex: none;
}

.group-about {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

/* Milestones shown to a group: names and hairlines, as the rest of the page. */

.group-milestones-part > * + * {
  margin-block-start: 8px;
}

.group-milestones-part + .group-milestones-part {
  margin-block-start: 20px;
}

.group-milestones {
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.article-text .group-milestones-member h4 {
  margin: 0;
  font-size: 1rem;
}

/* A plain run of names that wraps like a sentence, each still a list item. */
.article-text ul.group-milestone-names[role="list"] {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  margin-block-start: 4px;
  padding: 0;
  color: var(--r-ink-2);
  font-size: var(--text-small);
  line-height: 1.45;
  list-style: none;
}

.article-text ul.group-milestone-names[role="list"] > li::before {
  content: none;
}

.article-text ul.group-milestone-names[role="list"] > li:not(:last-child)::after {
  content: "\00a0·\00a0";
}

.group-requests {
  display: grid;
  gap: 16px;
}

.group-request > * + * {
  margin-block-start: 8px;
}

.group-church-url {
  overflow-wrap: anywhere;
  font-size: var(--text-small);
  text-align: center;
}

.group-request-line {
  font-weight: 600;
}

.group-person-item:has(.group-person-options) {
  justify-content: flex-start;
}

.group-person-options {
  margin-inline-start: auto;
  font-size: var(--text-small);
}

/* The sheets (reader.css draws the dialog). */

.group-sheet > * + * {
  margin-block-start: 12px;
}

.group-sheet-actions {
  justify-content: flex-end;
}

.group-options-list {
  display: grid;
  border-block-start: var(--hairline) solid var(--r-line);
}

.group-option {
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 12px 0;
  border: 0;
  border-block-end: var(--hairline) solid var(--r-line);
  background: none;
  color: var(--r-ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.group-option:focus-visible {
  outline: 2px solid var(--r-accent);
  outline-offset: 2px;
}

.group-report-next {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.group-options li {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: var(--display-weight);
  line-height: 1.2;
}

.group-finished {
  color: var(--r-ink-2);
}

/* Loading a list or a group: the message with a spinner before it (groups.js sets
   data-loading only while it waits; a problem takes it off). */
.groups-message[data-loading] {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--r-ink-2);
}

.groups-message[data-loading]::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in oklab, currentColor 22%, transparent);
  border-block-start-color: currentColor;
  border-radius: 50%;
  animation: spin 650ms linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .groups-message[data-loading]::before {
    animation: spinner-fade 1.2s ease-in-out infinite alternate;
  }
}

/* Starting a group, joining, the age check and a group's path. */

.group-flow-parts {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.group-flow-actions {
  justify-content: center;
}

.group-flow h2,
.group-shared-part h3 {
  text-align: center;
}

.article-text .groups-name {
  text-wrap: balance;
}

.group-join-name {
  font-size: var(--text-large, 1.25rem);
  font-weight: 700;
  text-align: center;
}

.group-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.group-range .field {
  margin: 0;
}

.group-verse-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.group-verse-row .field {
  margin: 0;
}

.group-verse-row .button {
  grid-column: 1 / -1;
  justify-self: center;
}

/* A selection's book, across the whole row of the chapter grid. */
.group-grid-book {
  grid-column: 1 / -1;
  padding-block-start: 8px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
  font-weight: 600;
}

.group-grid-book:first-child {
  padding-block-start: 0;
}

.group-shared-part > * + * {
  margin-block-start: 10px;
}

.group-shared-part + .group-shared-part {
  margin-block-start: 24px;
}

.group-questions,
.group-reflections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-text ul.group-questions[role="list"] > li,
.article-text ul.group-reflections[role="list"] > li {
  margin-block-start: 0;
  padding-inline-start: 0;
}

.article-text ul.group-questions[role="list"] > li::before,
.article-text ul.group-reflections[role="list"] > li::before {
  content: none;
}

.group-reflection-who {
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-text .group-reflection-body {
  margin-block-start: 4px;
}

.article-text .group-reflection-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-block-start: 4px;
}

.group-options-list a.group-option {
  color: inherit;
  text-decoration: none;
}

.article-text .groups-walk-sub {
  margin-block-start: 8px;
  text-align: center;
}

.groups-start .field {
  margin: 0;
}

.groups-start .groups-walk-sub + .field {
  margin-block-start: 24px;
}

.groups-start .actions {
  justify-content: center;
}

/* src/styles/home.css */
/*
  W1 Home (web §9.1), lib/pages/home.mjs: a way to start reading first, today's
  devotional beside it, then quiet links and one line about the app. No boxes,
  no badges piled up: type, space and a hairline or two.
*/

.home-start {
  display: grid;
  gap: 56px;
  padding-block-start: var(--space-hero);
}

.home-lede {
  max-width: 36rem;
  margin-block-start: 20px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block-start: 32px;
}

.home-actions .button {
  padding-inline: 24px;
}

/* John 1:1–5 beside the start, set as the reader sets Scripture. */
.home-passage {
  max-width: 34rem;
  margin: 0;
}

.home-passage-text {
  margin: 0;
  color: var(--scripture);
  font-family: var(--font-scripture);
  font-size: var(--scripture-size-phone);
  line-height: var(--scripture-leading);
}

.home-passage figcaption {
  margin-block-start: 14px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
}

/* Today's devotional: a raised card on the page, as the app's reading card is
   (SheetRaised, 22 px corners, a hairline edge). */
.home-today {
  max-width: 34rem;
  padding: 24px;
  border-radius: var(--r-card);
  background: var(--sheet);
  box-shadow: 0 0 0 var(--hairline) var(--r-line);
}

.home-today-label,
.home-today-meta,
.home-today-note {
  color: var(--r-ink-2);
  font-size: var(--text-small);
}

.home-today-label {
  font-weight: 500;
}

.home-today-title {
  margin-block-start: 8px;
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: var(--title-weight);
  line-height: 1.2;
}

.home-today-verse {
  margin: 14px 0 0;
  color: var(--scripture);
  font-family: var(--font-scripture);
  font-size: 1.25rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.home-today-meta {
  margin-block-start: 8px;
}

.home-today-text {
  margin-block-start: 14px;
  color: var(--r-ink-2);
  line-height: 1.55;
  text-wrap: pretty;
}

.home-today-link {
  margin-block-start: 14px;
  font-size: var(--text-ui);
  font-weight: 500;
}

.home-today-note {
  margin-block-start: 20px;
  font-size: var(--text-caption);
}

/*
  The verse of the day, under the way in: a hairline, a small label, then the
  verse set as Scripture. Hidden until home.js has the visitor's verse.
*/
.home-verse {
  max-width: 34rem;
  margin-block-start: 40px;
  padding-block-start: 20px;
  border-block-start: var(--hairline) solid var(--r-line);
}

.home-verse-label,
.home-verse-meta {
  color: var(--r-ink-2);
  font-size: var(--text-small);
}

.home-verse-label {
  font-family: inherit;
  font-weight: 500;
}

.home-verse-text {
  margin: 12px 0 0;
  color: var(--scripture);
  font-family: var(--font-scripture);
  font-size: 1.25rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.home-verse-meta {
  margin-block-start: 8px;
}

.home-verse-link {
  margin-block-start: 12px;
  font-size: var(--text-ui);
  font-weight: 500;
}

.home-today .nd,
.home-verse .nd,
.home-passage .nd {
  font-variant-caps: all-small-caps;
}

/* Plans, devotionals and search: three rows in one raised card, as the app groups
   its rows, each a name and a line, the whole row the link. */
.home-more {
  max-width: 46rem;
  margin-block-start: var(--space-figure);
  padding-inline: 20px;
  border-radius: var(--r-card);
  background: var(--sheet);
  box-shadow: 0 0 0 var(--hairline) var(--r-line);
}

.home-more ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-more li + li {
  border-block-start: var(--hairline) solid var(--r-line);
}

.home-more a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 16px;
  padding-block: 14px;
  color: var(--r-ink);
  text-decoration: none;
}

.home-more-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: var(--display-weight);
  line-height: 1.3;
}

.home-more-text {
  grid-column: 1;
  margin-block-start: 2px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
  line-height: 1.45;
  text-wrap: pretty;
}

.home-more-chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 16px;
  height: 16px;
  color: var(--r-ink-2);
  transition: translate 150ms var(--ease-out), color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .home-more a:hover .home-more-name {
    color: var(--r-accent);
  }

  .home-more a:hover .home-more-chevron {
    color: var(--r-ink);
    translate: 2px 0;
  }
}

@media (min-width: 37.5rem) {
  .home-more a {
    grid-template-columns: 11rem 1fr auto;
    padding-block: 16px;
  }

  .home-more-text {
    grid-column: 2;
    margin-block-start: 0;
  }

  .home-more-chevron {
    grid-column: 3;
    grid-row: 1;
  }
}

/* The app, once. */
.home-app {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-block-start: var(--space-figure);
  padding-block-start: 20px;
  border-block-start: var(--hairline) solid var(--r-line);
  color: var(--r-ink-2);
  font-size: var(--text-small);
}

.home-figure {
  max-width: 64rem;
  margin: var(--space-section) 0 0;
}

/* Before the web reader: Today on iPhone, in its frame, under the passage. */
.home-figure-phone .device {
  width: min(100%, 280px);
  margin-inline: auto;
}

.home-figure figcaption {
  margin-block-start: 14px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
  line-height: 1.45;
}

@media (min-width: 37.5rem) {
  .home-passage-text {
    font-size: var(--scripture-size-desktop);
  }

  .home-today-title {
    font-size: 1.875rem;
  }

  .home-today-verse,
  .home-verse-text {
    font-size: 1.4375rem;
  }

}

@media (min-width: 68.75rem) {
  .home-start {
    grid-template-columns: minmax(0, 620fr) minmax(380px, 480fr);
    column-gap: clamp(48px, 5vw, 96px);
    align-items: center;
  }
}

/* The link to /app, under the line that says when the app is coming. */
.home-app-link {
  margin-block-start: 10px;
  font-size: var(--text-small);
}

/* src/styles/plans.css */
/*
  W11 plans (web §9.11), lib/pages/plans.mjs. A list of plans, each a raised card
  as the app shows a plan, and for each plan one row a day, hairlines between them.
*/

.plans,
.plan {
  padding-block-start: var(--space-article);
}

.plans-head .lede,
.plan-head .lede {
  max-width: 36rem;
  margin-block-start: 16px;
}

/* /plans */
.plans-list {
  display: grid;
  gap: 16px;
  max-width: 51rem;
  margin: 48px auto 0;
  padding: 0;
  list-style: none;
}

.plans-item {
  display: grid;
  gap: 6px;
  padding: 24px;
  border-radius: var(--r-card);
  background: var(--sheet);
  box-shadow: 0 0 0 var(--hairline) var(--r-line);
}

.plans-title {
  font-family: var(--font-display);
  font-size: var(--text-h3-article);
  font-weight: var(--display-weight);
  line-height: 1.2;
  letter-spacing: var(--title-tracking);
}

.plans-title a {
  color: var(--r-ink);
  text-decoration-color: var(--r-line);
}

.plans-length {
  color: var(--r-ink-2);
  font-size: var(--text-caption);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.plans-description {
  max-width: 36rem;
  color: var(--r-ink-2);
  line-height: 1.5;
  text-wrap: pretty;
}

@media (hover: hover) and (pointer: fine) {
  .plans-title a:hover {
    text-decoration-color: currentColor;
  }
}

/* A plan */
.plan {
  display: grid;
  gap: 40px;
}

.plan-head {
  max-width: 32.5rem;
}

.plan-back {
  font-weight: 600;
}

.plan-back a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.plan-meta {
  margin-block-start: 12px;
  color: var(--r-ink-2);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.plan-head .page-title {
  margin-block-start: 8px;
  line-height: 1.05;
}

.plan-list {
  max-width: 37.5rem;
}

.plan-days {
  margin: 0;
  padding: 0;
  list-style: none;
  border-block-start: var(--hairline) solid var(--r-line);
}

.plan-days li {
  border-block-end: var(--hairline) solid var(--r-line);
}

.plan-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding-block: 10px;
  color: var(--r-ink);
  text-decoration: none;
}

.plan-day {
  flex: none;
  width: 4.5rem;
  color: var(--r-ink-2);
  font-size: var(--text-caption);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.plan-passages {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.4;
}

a.plan-row .plan-passages {
  color: var(--r-accent);
}

.plan-time {
  flex: none;
  color: var(--r-ink-2);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.plan-chevron {
  width: 14px;
  height: 14px;
  color: var(--r-ink-2);
}

@media (hover: hover) and (pointer: fine) {
  a.plan-row:hover .plan-passages {
    text-decoration: underline;
  }
}

.plan-month + .plan-month {
  margin-block-start: 40px;
}

.plan-month-title {
  margin-block-end: 8px;
  font-family: var(--font-display);
  font-size: var(--text-h3-article);
  font-weight: var(--display-weight);
  line-height: 1.2;
}

@media (min-width: 68.75rem) {
  .plan {
    grid-template-columns: minmax(0, 520px) minmax(0, 600px);
    column-gap: 64px;
    align-items: start;
  }

  .plan-head {
    position: sticky;
    top: 24px;
  }
}

/* src/styles/reader.css */
/*
  The web reader (web §9.2 to §9.7, §9.12, §9.13): the books page, chapter grids,
  chapter pages with their toolbar, footnotes, verse actions, commentary and compare,
  the commentary pages, and the text size and width settings.

  Joined after site.css and extras.css, so it uses their tokens and components. Every
  rule is scoped to the reader's own classes or to body.reader, because other
  features' stylesheets are joined into the same file.
*/

:root {
  --bar-h: 56px;
  --read-width: 100%;
  --text-scale: 1;
}

@media (min-width: 37.5rem) {
  :root {
    --bar-h: 64px;
    --read-width: 640px;
  }
}

@media (min-width: 68.75rem) {
  :root {
    --read-width: 680px;
  }
}

/* W13 text size: seven steps of about 1.5 px at the desktop size, step 3 the
   theme's own (default, pending Patrick: decisions 2.56, Q25). */
:root[data-size="1"] { --text-scale: 0.857; }
:root[data-size="2"] { --text-scale: 0.929; }
:root[data-size="4"] { --text-scale: 1.071; }
:root[data-size="5"] { --text-scale: 1.143; }
:root[data-size="6"] { --text-scale: 1.238; }
:root[data-size="7"] { --text-scale: 1.333; }

/* W13 width: 560, 680, 800 on desktop and 520, 640, 760 on tablet; on phones Narrow
   adds 12 px a side and Wide takes 8 off (same decision). */
@media (min-width: 37.5rem) {
  :root[data-width="narrow"] { --read-width: 520px; }
  :root[data-width="wide"] { --read-width: 760px; }
}

@media (min-width: 68.75rem) {
  :root[data-width="narrow"] { --read-width: 560px; }
  :root[data-width="wide"] { --read-width: 800px; }
}

/* The reader's icons: drawn in the text colour, stroked as the design source does. */
.ri {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ri-thin {
  stroke-width: 1.8;
}

/* ------------------------------------------------------------------------ */
/* Shared controls */

.tr-switch {
  display: inline-flex;
  flex: none;
  gap: 2px;
  height: 36px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--r-surface-2);
}

.tr-switch a {
  display: inline-flex;
  align-items: center;
  padding-inline: 9px;
  border-radius: var(--r-pill);
  color: var(--r-ink-2);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.tr-switch a[aria-current] {
  background: var(--seg-on);
  color: var(--r-ink);
  font-weight: 600;
  box-shadow: 0 0 0 0.5px rgba(25, 24, 22, 0.08), 0 1px 2px rgba(25, 24, 22, 0.1);
}

@media (min-width: 37.5rem) {
  .tr-switch a {
    padding-inline: 12px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .tr-switch a:not([aria-current]):hover {
    color: var(--r-ink);
  }
}

.round-button {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--r-ink-2);
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 150ms ease, color 150ms ease;
}

.round-button::after {
  content: "";
  position: absolute;
  inset: -4px;
}

@media (hover: hover) and (pointer: fine) {
  a.round-button:hover,
  button.round-button:hover {
    background: var(--hover);
    color: var(--r-ink);
  }
}

.round-button:active {
  transform: scale(0.96);
}

.round-button .icon {
  width: 19px;
  height: 19px;
}

.round-button .icon-step {
  width: 18px;
  height: 18px;
}

.round-button.is-empty {
  opacity: 0.3;
  cursor: default;
}

.back-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  min-height: 44px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
  font-weight: 500;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .back-link:hover {
    color: var(--r-ink);
  }
}

.back-link .icon {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------------------ */
/* W2 books (/bible, /bible/webbe): Tree Nav, ported from Spectrum UI's tree-nav
   (Apache-2.0; modified for Found: plain CSS, no spring, no icons). Each testament
   is a column of quiet rows on a hairline rail. Pointing at a row tints it and puts
   a small diamond on the rail beside it; nothing slides. */

.bible-page {
  padding-block-start: 32px;
}

.bible-head > * + * {
  margin-block-start: 8px;
}

.bible-lede {
  color: var(--r-ink-2);
  font-size: var(--text-small);
}

.testaments {
  display: grid;
  gap: 40px;
  margin-block-start: 32px;
}

.testament-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-block-end: 12px;
  color: var(--r-ink);
  font-size: var(--text-ui);
  font-weight: 600;
  line-height: 1.4;
}

.testament-count {
  color: var(--r-ink-2);
  font-size: 0.8125rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.book-list {
  columns: 2;
  column-gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.book-list li {
  break-inside: avoid;
  /* The rail: each row's edge, so every column has its own unbroken line. */
  border-inline-start: 1px solid var(--line);
}

.book-list a,
.book-off {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
  margin-inline-start: 6px;
  padding-inline: 10px 8px;
  border-radius: var(--r-s);
  color: var(--r-ink);
  font-size: var(--text-ui);
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 150ms ease;
}

/* The marker: a small diamond centred on the rail. */
.book-list a::before {
  content: "";
  position: absolute;
  inset-inline-start: -10px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  background: var(--r-accent);
  opacity: 0;
  transform: translateY(-50%) rotate(45deg) scale(0.6);
  transition: opacity 150ms ease, transform 150ms var(--ease-out);
}

.book-list a:focus-visible::before {
  opacity: 1;
  transform: translateY(-50%) rotate(45deg);
}

@media (hover: hover) and (pointer: fine) {
  .book-list a,
  .book-off {
    min-height: 34px;
  }

  .book-list a:hover {
    background: var(--hover);
  }

  .book-list a:hover::before {
    opacity: 1;
    transform: translateY(-50%) rotate(45deg);
  }
}

.book-off,
.chapter-off {
  color: var(--r-ink-2);
}

@media (min-width: 37.5rem) {
  .bible-page {
    padding-block-start: 56px;
  }

  .testaments {
    margin-block-start: 40px;
  }

  .book-list {
    columns: 3;
    column-gap: 24px;
  }
}

@media (min-width: 68.75rem) {
  .bible-page {
    padding-block-start: 72px;
  }

  .testaments {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 56px;
  }

  .testament-nt .book-list {
    columns: 2;
  }
}

/* W2 chapters of a book: kept for links into a book and for browsers without a
   script. The book list goes straight to chapter 1, and on a chapter the passage
   picker chooses. Small square cells, a hairline each. */

.grid-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-block-start: 24px;
}

.grid-page .page-title {
  margin-block-start: 4px;
}

.grid-meta {
  color: var(--r-ink-2);
  font-size: var(--text-small);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  max-width: 640px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.chapter-grid a,
.chapter-off {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: var(--r-s);
  background: var(--sheet);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--r-ink);
  font-size: var(--text-ui);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.chapter-off {
  background: transparent;
  font-weight: 400;
}

.chapter-grid a:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--page), 0 0 0 4px var(--r-accent);
}

@media (hover: hover) and (pointer: fine) {
  .chapter-grid a:hover {
    background: var(--hover);
  }
}

.start-button {
  align-self: flex-start;
  margin-block-start: 16px;
}

@media (min-width: 37.5rem) {
  .grid-page {
    padding-block-start: 40px;
  }

  .chapter-grid {
    grid-template-columns: repeat(auto-fill, 48px);
  }
}

@media (min-width: 68.75rem) {
  .grid-page {
    padding-block-start: 56px;
  }

  .chapter-grid {
    grid-template-columns: repeat(10, 48px);
  }
}

/* ------------------------------------------------------------------------ */
/* W3 chapter pages */

.reader .site-header {
  border-block-end: var(--hairline) solid var(--r-line);
}

.reader-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--page);
  border-block-end: var(--hairline) solid var(--r-line);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .reader-bar {
    background: var(--r-glass);
    -webkit-backdrop-filter: saturate(1.4) blur(16px);
    backdrop-filter: saturate(1.4) blur(16px);
  }
}

.reader-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--bar-h);
  max-width: calc(1280px + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.reader-bar-inner > .tr-switch {
  margin-inline-end: auto;
}

.passage-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding-inline: 12px 10px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--r-surface-2);
  color: var(--r-ink);
  font: inherit;
  font-size: var(--text-ui);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, transform 140ms var(--ease-out);
}

.passage-button:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .passage-button:hover {
    background: var(--hover);
  }
}

.passage-button[aria-expanded="true"] {
  background: var(--hover);
}

.passage-button .icon-down {
  width: 14px;
  height: 14px;
  color: var(--r-ink-2);
}

.aa-button[aria-expanded="true"] {
  background: var(--hover);
  color: var(--r-ink);
}

.step-button {
  display: none;
}

@media (min-width: 37.5rem) {
  .step-button {
    display: inline-flex;
  }
}

/* On a phone the bar can't hold everything at full width: a long book name gives way, with
   the chapter's title right under it, and Aa stays in the phone menu. */
.passage-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-bar-inner > .passage-button {
  flex: 0 1 auto;
  min-width: 0;
}

.reader-bar-inner > .tr-switch,
.reader-bar-inner > .round-button {
  flex: none;
}

.passage-button .icon-down {
  flex: none;
}

@media (max-width: 27rem) {
  .reader-bar-inner > .aa-button {
    display: none;
  }
}

/* Second translation: on shows as a filled button, with its name on the label. */
.parallel-button.is-on {
  background: var(--r-surface-2);
  color: var(--r-ink);
}

.parallel-button[aria-busy="true"] {
  opacity: 0.6;
}

.parallel-panel {
  --ring-gap: var(--sheet);
  --ring: var(--r-accent);
  position: fixed;
  inset: var(--parallel-top, 64px) var(--parallel-end, 16px) auto auto;
  width: min(280px, calc(100vw - 2 * var(--gutter)));
  margin: 0;
  padding: 12px;
  border: 0;
  border-radius: var(--r-card);
  background: var(--sheet);
  color: var(--r-ink);
  box-shadow: var(--shadow-float);
  transform-origin: top right;
}

.parallel-panel:popover-open {
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}

@starting-style {
  .parallel-panel:popover-open {
    opacity: 0;
    transform: scale(0.98);
  }
}

.parallel-choice {
  display: grid;
  gap: 8px;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.parallel-title {
  padding: 0;
  color: var(--r-ink-2);
  font-size: var(--text-small);
  font-weight: 600;
}

/* The "Choose a verse" button: hidden until it has keyboard focus (web §9.5). */
.choose-verse:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.choose-verse {
  flex: none;
  height: 36px;
  padding-inline: 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--r-surface-2);
  color: var(--r-ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
}

.reader-body {
  position: relative;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.chapter {
  max-width: var(--read-width);
  margin-inline: auto;
  padding-block-start: 22px;
  color: var(--scripture);
  font-family: var(--font-scripture);
  font-size: calc(var(--scripture-size-phone) * var(--text-scale));
  line-height: var(--scripture-leading);
  overflow-wrap: break-word;
}

:root[data-width="narrow"] .chapter {
  padding-inline: 12px;
}

:root[data-width="wide"] .chapter {
  margin-inline: -8px;
}

.chapter-title {
  margin-block-end: 10px;
  text-align: center;
  color: var(--r-ink);
  font-family: var(--font-title);
  font-size: var(--chapter-title-phone);
  font-weight: var(--title-weight);
  line-height: 1.05;
  letter-spacing: var(--chapter-title-tracking);
}

.chapter [id] {
  scroll-margin-top: calc(var(--bar-h) + 16px);
}

/* Prose blocks (layoutPassage kinds p, m, pi, pc, li) */
.chapter :is(p.p, p.m, p.m1, p.m2, p.pi1, p.pi2, p.pi3, p.pc, p.li1, p.li2, p.li3) {
  margin-block: 0 14px;
}

.chapter :is(.m1, .pi1, .li1) {
  padding-inline-start: 1.5em;
}

.chapter :is(.m2, .pi2, .li2) {
  padding-inline-start: 3em;
}

.chapter :is(.pi3, .li3) {
  padding-inline-start: 4.5em;
}

.chapter .pc {
  text-align: center;
}

/* Headings and the small lines around them */
.chapter :is(h2, h3) {
  margin-block: 22px 8px;
  color: var(--r-ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.chapter .chapter-title + :is(h2, h3) {
  margin-block-start: 14px;
}

.chapter h2.ms {
  margin-block-start: 30px;
  letter-spacing: 0.02em;
}

.chapter :is(p.r, p.mr, p.qa, p.sp) {
  margin-block: 0 8px;
  color: var(--r-ink-2);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.45;
}

.chapter h2 + :is(p.r, p.mr) {
  margin-block-start: -4px;
}

.chapter p.qa,
.chapter p.sp {
  margin-block-start: 14px;
  font-weight: 600;
}

/* Psalm titles, and verse text set as a title */
.chapter p.d {
  margin-block: 0 6px;
  color: var(--r-ink-2);
  font-family: var(--font-scripture);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.5;
}

/* Two translations together (src/scripts/reader.js). Under a verse, the second text is a
   quieter line. In two columns (.is-columns, set when the chapter has the room) the chapter
   is a grid: blocks step aside, so each verse's lines are grid items, and the script numbers
   their rows (--r) and how many the second column's cell spans (--n). */
.pv {
  display: block;
  margin-block: 4px 12px;
  color: var(--r-ink-2);
  font-size: 0.875em;
  line-height: 1.5;
  text-indent: 0;
  cursor: auto;
}

.pv .vn {
  margin-inline-end: 3px;
}

.pv-missing,
.pv-gap {
  color: var(--r-ink-2);
  font-family: var(--font-ui);
  font-size: var(--text-small);
  line-height: 1.45;
  text-wrap: pretty;
}

.pv-gap {
  display: block;
  margin-block: 8px 4px;
}

.pv-title {
  margin-block-start: 0;
  font-style: italic;
}

.pv-head {
  display: flex;
  justify-content: center;
  margin-block: 0 16px;
  color: var(--r-ink-2);
  font-family: var(--font-ui);
  font-size: var(--text-small);
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}

.pv-head-main,
.pv-head-other {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .pv {
    transition: opacity 200ms var(--ease-out);
  }

  @starting-style {
    .pv {
      opacity: 0;
    }
  }
}

.chapter.is-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 40px;
  max-width: min(100%, calc(var(--read-width) * 1.8));
  margin-inline: auto;
  padding-inline: 0;
}

.reader-body.has-panel .chapter.is-columns {
  max-width: none;
  margin-inline: 0;
}

.chapter.is-columns > * {
  grid-column: 1 / -1;
  grid-row: var(--r);
  min-width: 0;
}

.chapter.is-columns > .pv-flat {
  display: contents;
}

.chapter.is-columns > .pv-flat > .v,
.chapter.is-columns > .pv-flat > .pv-gap,
.chapter.is-columns > p.d:has(+ .pv-title) {
  grid-column: 1;
  grid-row: var(--r);
  min-width: 0;
}

.chapter.is-columns > .pv-flat > .v {
  display: block;
}

.chapter.is-columns > .pv-flat > .v.pv-end {
  margin-block-end: 12px;
}

.chapter.is-columns > .pv-flat > .pv,
.chapter.is-columns > .pv-title {
  grid-column: 2;
  grid-row: var(--r) / span var(--n, 1);
  min-width: 0;
}

.chapter.is-columns > .pv-flat > .pv {
  margin-block: 0 12px;
  color: var(--scripture);
  font-size: 1em;
  line-height: var(--scripture-leading);
}

.chapter.is-columns > .pv-flat > .pv-missing {
  color: var(--r-ink-2);
  font-size: var(--text-small);
  line-height: 1.45;
}

.chapter.is-columns > .pv-flat > .pv-gap {
  margin-block: 0 12px;
}

.chapter.is-columns > .pv-title {
  margin-block-end: 12px;
  color: inherit;
  font-size: inherit;
}

/* The poetry indents belonged to the blocks, which have stepped aside. */
.chapter.is-columns > :is(.q1, .q2, .q3, .q4, .qr, .qc) > .v {
  padding-inline-start: 22px;
  line-height: 1.55;
}

.chapter.is-columns > .q2 > .v {
  padding-inline-start: 50px;
}

.chapter.is-columns > .q3 > .v {
  padding-inline-start: 78px;
}

.chapter.is-columns > .q4 > .v {
  padding-inline-start: 106px;
}

.chapter.is-columns > .qr > .v {
  text-align: end;
}

.chapter.is-columns > .qc > .v {
  text-align: center;
}

.chapter.is-columns > :is(.q1, .q2, .q3, .q4).qv > .v:first-child {
  text-indent: -22px;
}

.chapter.is-columns .pv-head {
  display: grid;
  grid-template-columns: subgrid;
  margin-block-end: 20px;
  text-align: start;
}

.chapter.is-columns .pv-head-main,
.chapter.is-columns .pv-head-other {
  display: block;
}

.chapter.is-columns .pv-head-under {
  display: none;
}

/* Poetry: every line's words start at its level's indent, and a verse number hangs
   in the 22 px before it (WebReader line 54). */
.chapter :is(.q1, .q2, .q3, .q4, .qr, .qc) {
  padding-inline-start: 22px;
  line-height: 1.55;
}

.chapter :is(.q1, .q2, .q3, .q4).qv {
  text-indent: -22px;
}

.chapter .q2 {
  padding-inline-start: 50px;
}

.chapter .q3 {
  padding-inline-start: 78px;
}

.chapter .q4 {
  padding-inline-start: 106px;
}

.chapter .qr {
  text-align: end;
}

.chapter .qc {
  text-align: center;
}

.chapter :is(.q1, .q2, .q3, .q4, .qr, .qc).vs {
  margin-block-start: 10px;
}

.chapter :is(.q1, .q2, .q3, .q4) .vn {
  display: inline-block;
  width: 22px;
  margin: 0;
  text-indent: 0;
}

.chapter :is(.q1, .q2, .q3, .q4, .qr, .qc):last-of-type,
.chapter .stanza + .footnote {
  margin-block-end: 14px;
}

.chapter .stanza {
  height: 14px;
}

/* Verse numbers: raised without opening up the line, and left out of a copy. */
.chapter .vn {
  position: relative;
  top: -0.5em;
  margin-inline-end: 3px;
  color: var(--vnum);
  font-family: var(--font-ui);
  font-size: 0.55em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 0;
  vertical-align: baseline;
  user-select: none;
  -webkit-user-select: none;
}

/* The divine name: a capital, then small capitals (web §7.3). */
.nd {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.04em;
}

/* A verse someone linked to (#v16) and a selected verse (WebReader line 228). */
.chapter .v {
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

/* Your highlights, from /you's list (src/scripts/verse-marks.js), in the app's colours
   (themes.json highlights, purple from theme/extras.ts). The tint sits behind the words, so
   it reads on every theme. A selected verse or a #v link draws over it. */
.chapter .v[data-hl] {
  background: color-mix(in srgb, var(--hl) 30%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--hl) 30%, transparent);
}

.chapter .v[data-hl="yellow"] { --hl: #ffcd3c; }
.chapter .v[data-hl="green"] { --hl: #46c88c; }
.chapter .v[data-hl="blue"] { --hl: #5096ff; }
.chapter .v[data-hl="pink"] { --hl: #ff64a0; }
.chapter .v[data-hl="purple"] { --hl: #9b7be0; }

.chapter .v:target,
.chapter .v.is-target {
  background: var(--r-accent-soft);
  box-shadow: 0 0 0 3px var(--r-accent-soft);
}

.chapter .v.is-selected {
  background: var(--r-accent-soft);
  box-shadow: 0 0 0 3px var(--r-accent-soft);
  text-decoration-line: underline;
  text-decoration-color: var(--r-accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.js .chapter .v {
  cursor: pointer;
}

/* Footnote callers: small, raised, with a 24 × 24 target. */
.chapter .fn {
  position: relative;
  top: -0.5em;
  margin: 0 0 0 1px;
  padding: 0 3px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--r-accent);
  font-family: var(--font-ui);
  font-size: 0.6em;
  font-weight: 600;
  line-height: 1;
  text-indent: 0;
  vertical-align: baseline;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.chapter .fn::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
}

.chapter .fn.is-open {
  background: var(--r-accent-soft);
}

/* W4: the footnote is a popover; without a script the browser centres it. */
.footnote {
  --ring-gap: var(--sheet);
  width: min(340px, calc(100vw - 2 * var(--gutter)));
  margin: auto;
  padding: 10px 6px 16px 18px;
  border: 0;
  border-radius: var(--r-card);
  background: var(--sheet);
  color: var(--r-ink);
  box-shadow: 0 0 0 0.5px var(--r-line), 0 18px 40px rgba(0, 0, 0, 0.18);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  font-style: normal;
  line-height: 1.5;
  text-align: start;
  text-indent: 0;
}

.footnote:popover-open {
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}

@starting-style {
  .footnote:popover-open {
    opacity: 0;
    transform: scale(0.98);
  }
}

.js .footnote {
  position: fixed;
  inset: var(--fn-top, 50%) auto auto var(--fn-left, 50%);
  width: var(--fn-width, min(340px, calc(100vw - 2 * var(--gutter))));
  margin: 0;
}

.footnote:focus,
.sheet-title:focus {
  outline: none;
}

.footnote-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.footnote-title {
  color: var(--r-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
}

.footnote-close,
.sheet-close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--r-ink-2);
  cursor: pointer;
}

.footnote-close .icon-close {
  width: 16px;
  height: 16px;
}

.footnote-text {
  padding-inline-end: 12px;
}

/* Browsers without popovers show each note after its paragraph. */
@supports not selector(:popover-open) {
  .footnote,
  .js .footnote {
    position: static;
    width: auto;
    margin: 0 0 14px;
    padding: 8px 0;
    box-shadow: none;
    background: transparent;
    font-size: 0.9375rem;
  }

  .footnote-close {
    display: none;
  }
}

/* End of the chapter */

.chapter-foot {
  max-width: var(--read-width);
  margin: 40px auto 0;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  box-sizing: content-box;
  color: var(--r-ink-2);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.chapter-end {
  display: grid;
  gap: 0 24px;
  margin-block-end: 28px;
}

.chapter-end a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-block: 14px;
  border-block-start: var(--hairline) solid var(--r-line);
  color: var(--r-ink);
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: var(--title-weight);
  line-height: 1.25;
  text-decoration: none;
}

.chapter-end-label {
  color: var(--r-ink-2);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
  .chapter-end a:hover {
    color: var(--r-accent);
  }
}

@media (min-width: 37.5rem) {
  .chapter-end {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chapter-end .chapter-next {
    grid-column: 2;
    text-align: end;
  }
}

.chapter-hint {
  margin-block-end: 20px;
  color: var(--r-ink-2);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  text-align: center;
}

.chapter-commentary {
  margin-block-end: 10px;
}

.chapter-source {
  font-size: 0.8125rem;
}

/* Phone previous and next: glass pills over the page (WebReader lines 128 to 133). */

.pills {
  position: fixed;
  inset-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right));
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 4;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding-inline: 14px 16px;
  border-radius: var(--r-pill);
  background: var(--r-glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 0 0 0.5px var(--r-line), 0 6px 18px rgba(0, 0, 0, 0.08);
  color: var(--r-ink);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  pointer-events: auto;
}

.pill-next {
  padding-inline: 16px 14px;
}

.pill .icon {
  width: 16px;
  height: 16px;
}

/* Room for the last lines and the footer to scroll clear of the pills. */
.reader .site-footer {
  padding-block-end: 72px;
}

:root:has(dialog:modal) .pills,
:root:has(.verse-actions:not([hidden])) .pills,
:root:has(.listen-bar:not([hidden])) .pills {
  display: none;
}

/* Listen (listen.js): the voice's controls float over the page, and the verse being
   read carries a quiet mark. The same soft colour as a selected verse's. */
.listen-bar {
  position: fixed;
  inset-inline: 0;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  max-width: calc(100vw - 32px);
  margin-inline: auto;
  padding: 8px;
  border-radius: 999px;
  background: var(--page);
  box-shadow: 0 0 0 var(--hairline) var(--r-line), 0 8px 24px rgb(0 0 0 / 0.12);
}

.v.is-speaking {
  background: var(--r-accent-soft);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

@media (forced-colors: active) {
  .v.is-speaking {
    outline: 1px solid Highlight;
  }
}

@media (min-width: 37.5rem) {
  .pills {
    display: none;
  }

  .reader .site-footer {
    padding-block-end: 0;
  }
}

/* ------------------------------------------------------------------------ */
/* W5 verse actions: a floating toolbar on tablet and desktop */

.verse-actions {
  --ring-gap: var(--sheet);
  position: absolute;
  z-index: 3;
  display: flex;
  gap: 2px;
  padding: 6px;
  border-radius: var(--r-card);
  background: var(--sheet);
  box-shadow: 0 0 0 0.5px var(--r-line), 0 18px 40px rgba(0, 0, 0, 0.18);
  font-family: var(--font-ui);
}

.verse-actions:not([hidden]) {
  animation: reader-pop 150ms var(--ease-out);
}

.verse-action {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 64px;
  min-height: 56px;
  padding: 6px 4px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--r-ink);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.verse-action .icon {
  width: 20px;
  height: 20px;
}

@media (hover: hover) and (pointer: fine) {
  .verse-action:hover {
    background: var(--r-surface-2);
  }
}

@keyframes reader-pop {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
}

/* Sheets (phone verse actions; commentary and compare below desktop; the passage
   picker; Choose a verse): modal dialogs from the bottom. */

.reader-sheet {
  --ring-gap: var(--sheet);
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: none;
  max-height: calc(100dvh - 40px);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--sheet);
  color: var(--r-ink);
  font-family: var(--font-ui);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
}

.reader-sheet[open] {
  transition: transform 240ms var(--ease-drawer);
}

@starting-style {
  .reader-sheet[open] {
    transform: translateY(100%);
  }
}

.reader-sheet::backdrop {
  background: rgba(0, 0, 0, 0.28);
  transition: opacity 200ms ease-out;
}

@starting-style {
  .reader-sheet[open]::backdrop {
    opacity: 0;
  }
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.sheet-grip {
  align-self: center;
  width: 40px;
  height: 5px;
  margin-block-end: 4px;
  border-radius: 3px;
  background: var(--r-line);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.sheet-close::before {
  content: "";
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--r-surface-2);
}

.sheet-close {
  position: relative;
  margin: -4px -4px -4px 0;
  color: var(--r-ink);
}

.sheet-close .icon {
  position: relative;
  width: 16px;
  height: 16px;
}

@media (min-width: 37.5rem) {
  .reader-sheet:not(.is-centred) .sheet-body {
    max-width: calc(680px + 2 * var(--gutter));
    margin-inline: auto;
  }
}

.verse-actions .verse-action {
  white-space: nowrap;
}

.reader-sheet .verse-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.verse-actions-row .verse-action {
  flex: 1 1 56px;
  min-width: 56px;
}

/* On tablets and desktops the picker and Choose a verse sit in the middle. */
@media (min-width: 37.5rem) {
  .reader-sheet.is-centred {
    inset: 0;
    width: min(600px, calc(100vw - 2 * var(--gutter)));
    max-height: min(720px, calc(100dvh - 80px));
    margin: auto;
    border-radius: var(--r-sheet);
    box-shadow: 0 0 0 0.5px var(--r-line), 0 24px 50px rgba(0, 0, 0, 0.2);
  }

  .reader-sheet.is-centred[open] {
    transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
  }

  @starting-style {
    .reader-sheet.is-centred[open] {
      opacity: 0;
      transform: scale(0.98);
    }
  }

  .reader-sheet.is-centred .sheet-grip {
    display: none;
  }

  .reader-sheet.is-small {
    width: min(360px, calc(100vw - 2 * var(--gutter)));
  }
}

/* W6 and W7: the desktop panel (an aside) and the sheet share their contents. */

.reader-panel {
  --ring-gap: var(--sheet);
  position: sticky;
  top: var(--bar-h);
  align-self: start;
  height: calc(100vh - var(--bar-h));
  height: calc(100dvh - var(--bar-h));
  margin-inline-end: calc(-1 * max(var(--gutter), env(safe-area-inset-right)));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--sheet);
  border-inline-start: var(--hairline) solid var(--r-line);
  color: var(--r-ink);
  font-family: var(--font-ui);
}

.reader-panel .sheet-body {
  gap: 14px;
  padding: 24px 28px 40px;
}

.reader-panel .sheet-grip {
  display: none;
}

.reader-body.has-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  column-gap: 40px;
}

.reader-body.has-panel .chapter {
  width: 100%;
  max-width: min(var(--read-width), 640px);
  margin-inline: 0;
}

.panel-ref {
  color: var(--r-ink-2);
  font-size: 0.875rem;
}

.author-switch {
  display: flex;
  gap: 3px;
  min-inline-size: 0;
  height: 40px;
  margin: 0;
  padding: 3px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--r-surface-2);
}

.author-switch label {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  color: var(--r-ink-2);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.author-switch input,
.width-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.author-switch label:has(input:checked),
.width-switch label:has(input:checked) {
  background: var(--seg-on);
  color: var(--r-ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.author-switch label:has(input:focus-visible),
.width-switch label:has(input:focus-visible) {
  box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--r-accent);
}

.panel-meta {
  color: var(--r-ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.45;
}

.panel-note,
.compare-text {
  color: var(--scripture);
  font-family: var(--font-scripture);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.panel-more {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--r-accent);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.panel-more-quiet {
  color: var(--r-ink-2);
  font-weight: 500;
}

.panel-note-body {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

.panel-note-body p:focus {
  outline: none;
}

.panel-caveat {
  color: var(--r-ink-2);
  font-size: 0.75rem;
  line-height: 1.5;
}

.panel-status {
  color: var(--r-ink-2);
  font-size: 0.9375rem;
}

/* Compare: each translation under its name, no boxes around Scripture. */
.compare-item + .compare-item {
  padding-block-start: 14px;
  border-block-start: var(--hairline) solid var(--r-line);
}

.compare-label {
  margin-block-end: 4px;
  color: var(--r-accent);
  font-size: 0.8125rem;
  font-weight: 600;
}

.compare-text {
  line-height: 1.55;
}

.compare-missing {
  color: var(--r-ink-2);
  font-size: 0.9375rem;
  line-height: 1.5;
}

@media (min-width: 68.75rem) {
  .panel-note,
  .compare-text {
    font-size: 1.125rem;
  }
}

/* The passage picker is in ui.css. */

/* Choose a verse */

.choose-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choose-form label {
  font-size: 0.875rem;
  font-weight: 600;
}

.choose-form input {
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--r-surface-2);
  color: var(--r-ink);
  font: inherit;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.choose-error {
  color: var(--r-ink);
  font-size: 0.875rem;
}

.choose-actions {
  display: flex;
  gap: 10px;
}

/* W13 text size and width, in the text panel on every page (lib/chrome.mjs). */

.text-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.text-setting {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.text-setting-label {
  flex: none;
  width: 70px;
  font-size: 0.875rem;
  font-weight: 600;
}

.size-a {
  flex: none;
  font-size: 0.875rem;
  line-height: 1;
}

.size-a-large {
  font-size: 1.25rem;
}

.size-range {
  --fill: 33.3%;
  flex: 1 1 auto;
  min-width: 0;
  height: 24px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.size-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(var(--r-accent) 0 0) 0 / var(--fill) 100% no-repeat, var(--r-surface-2);
}

.size-range::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(var(--r-accent) 0 0) 0 / var(--fill) 100% no-repeat, var(--r-surface-2);
}

.size-range::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -10px;
  border: 0;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  -webkit-appearance: none;
  appearance: none;
}

.size-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.size-range:focus-visible {
  outline: none;
  box-shadow: none;
}

.size-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--sheet), 0 0 0 6px var(--r-accent);
}

.size-range:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--sheet), 0 0 0 6px var(--r-accent);
}

.width-switch {
  display: flex;
  flex: 1 1 auto;
  gap: 3px;
  height: 36px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--r-surface-2);
}

.width-switch label {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  color: var(--r-ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

/* The panel, opened from the toolbar's Aa, sits under that button. */
.theme-panel.at-toolbar:not(.is-sheet) {
  position: fixed;
  inset: var(--panel-top, 80px) var(--panel-end, 20px) auto auto;
}

/* ------------------------------------------------------------------------ */
/* Commentary pages */

.commentary-entries {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.commentary-entry h2 {
  font-family: var(--font-display);
  font-size: var(--text-h3-article);
  font-weight: var(--display-weight);
  line-height: 1.2;
}

.commentary-text {
  margin-block-start: 12px;
  color: var(--scripture);
  font-family: var(--font-scripture);
  font-size: calc(1.125rem * var(--text-scale));
  line-height: 1.65;
}

.commentary-text p + p {
  margin-block-start: 0.9em;
}

.commentary-notes {
  margin-block-start: 20px;
  color: var(--r-ink-2);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.commentary-notes h3 {
  margin-block-end: 6px;
  color: var(--r-ink);
  font-size: 0.9375rem;
  font-weight: 600;
}

.commentary-notes p + p {
  margin-block-start: 0.7em;
}

.commentary-source {
  margin-block-start: 14px;
  color: var(--r-ink-2);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.commentary-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-block-start: 56px;
  padding-block-start: 20px;
  border-block-start: var(--hairline) solid var(--r-line);
}

.commentary-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-weight: 600;
}

.commentary-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  padding: 0;
  list-style: none;
}

.article-text .commentary-chapters > li {
  margin: 0;
  padding: 0;
}

.article-text .commentary-chapters > li::before {
  content: none;
}

/* ------------------------------------------------------------------------ */
/* Larger screens */

@media (min-width: 37.5rem) {
  .chapter {
    padding-block-start: 40px;
    font-size: calc(var(--scripture-size-desktop) * var(--text-scale));
  }

  .chapter-title {
    margin-block-end: 18px;
    font-size: var(--chapter-title-desktop);
  }

  .chapter :is(h2, h3) {
    font-size: 1.0625rem;
  }
}

/* Reduced motion (web §10.3): fades only. */

@media (prefers-reduced-motion: reduce) {
  .round-button {
    transition: background-color 150ms ease;
  }

  .round-button:active {
    transform: none;
  }

  .footnote:popover-open,
  .reader-sheet[open],
  .reader-sheet.is-centred[open] {
    transition: opacity 150ms ease-out;
  }

  @starting-style {
    .footnote:popover-open,
    .reader-sheet[open],
    .reader-sheet.is-centred[open] {
      opacity: 0;
      transform: none;
    }
  }

  .verse-actions:not([hidden]) {
    animation: none;
  }

  .book-list a::before,
  .book-list a:focus-visible::before {
    transform: translateY(-50%) rotate(45deg);
    transition: opacity 150ms ease;
  }

  .passage-button:active {
    transform: none;
  }

  .chapter .v {
    transition: none;
  }

  .parallel-panel:popover-open {
    transition: opacity 150ms var(--ease-out);
    transform: none;
  }
}

@media (forced-colors: active) {
  .chapter .v[data-hl] {
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-underline-offset: 4px;
  }

  .parallel-panel,
  .round-button,
  .passage-button,
  .tr-switch,
  .pill,
  .footnote,
  .verse-actions,
  .reader-sheet,
  .chapter-grid a,
  .author-switch,
  .width-switch {
    border: 1px solid CanvasText;
  }

  .tr-switch a[aria-current],
  .author-switch label:has(input:checked),
  .width-switch label:has(input:checked) {
    outline: 2px solid Highlight;
  }

  .chapter .v:target,
  .chapter .v.is-target,
  .chapter .v.is-selected {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }
}

@media print {
  .reader-bar,
  .pills,
  .chapter-foot,
  .verse-actions,
  .footnote {
    display: none;
  }

  .chapter .fn {
    display: none;
  }
}

/* src/styles/search.css */
/*
  W9 Search (web §9.9; WebPage.dc.html lines 105 to 136). One calm column up to
  820 px. The field is the one filled shape; results are a plain list with
  hairlines, Scripture in the reading face, matches marked in the accent's soft tint.
*/

.search {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 820px;
  margin-inline: auto;
  padding-block-start: var(--space-article);
}

.search > .page-title {
  margin-block-end: 6px;
}

.search-no-script {
  max-width: 36rem;
  color: var(--r-ink-2);
  font-size: var(--text-lede);
  line-height: 1.5;
  text-wrap: pretty;
}

/* The field: 56 high, a 2 px ring in the line colour, the accent once it has text
   or focus. The ring is the focus indicator, so the input's own ring is off. */

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding-inline: 16px 13px;
  border-radius: var(--r-b);
  background: var(--sheet);
  box-shadow: inset 0 0 0 2px var(--r-line);
  color: var(--r-ink-2);
  transition: box-shadow 150ms ease;
}

.search-box:focus-within,
.search-box:has(.search-input:not(:placeholder-shown)) {
  box-shadow: inset 0 0 0 2px var(--r-accent);
}

.search-box:focus-within {
  outline: 2px solid transparent;
}

.search-icon {
  flex: none;
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--r-ink);
  font: inherit;
  font-size: 1.125rem;
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: var(--r-ink-2);
  opacity: 1;
}

.search-input:focus,
.search-input:focus-visible {
  outline: none;
  box-shadow: none;
}

.search-input::-webkit-search-decoration {
  -webkit-appearance: none;
}

.search-translation {
  position: relative;
  flex: none;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--r-surface-2);
  color: var(--r-ink);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}

/* A 44 px target around the 30 px chip. */
.search-translation::after {
  content: "";
  position: absolute;
  inset: -7px -4px;
}

.search-translation:focus-visible {
  --ring-gap: var(--sheet);
}

/* Empty: one line of help, then five searches to try. */

.search-empty {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.search-empty p {
  max-width: 36rem;
  color: var(--r-ink-2);
  font-size: 1rem;
  line-height: 1.5;
}

.search-empty strong {
  color: var(--r-ink);
}

.search-tries {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-try {
  position: relative;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--r-line);
  color: var(--r-ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.search-try::after {
  content: "";
  position: absolute;
  inset: -2px 0;
}

@media (hover: hover) and (pointer: fine) {
  .search-try:hover {
    background: var(--r-surface-2);
  }
}

.search-output:empty {
  display: none;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.search-results:empty {
  display: none;
}

/* "Go to": the one control that answers a reference, so it has an edge. */

.search-target {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-block-end: 10px;
}

.search-go {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--r-m);
  background: var(--sheet);
  box-shadow: inset 0 0 0 1px var(--r-line);
  color: var(--r-ink);
  text-decoration: none;
  transition: background-color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .search-go:hover {
    background: var(--r-surface-2);
  }
}

.search-go-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.search-go-label {
  color: var(--r-ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
}

.search-go-title {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: var(--display-weight);
  line-height: 1.2;
  letter-spacing: var(--title-tracking);
}

.search-go-line {
  overflow: hidden;
  color: var(--r-ink-2);
  font-family: var(--font-scripture);
  font-size: 1rem;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-go-chevron {
  width: 18px;
  height: 18px;
}

.search-hint {
  color: var(--r-ink-2);
  font-size: 0.875rem;
}

/* The hint is for keyboards. On a touch screen the card is plainly the thing to tap,
   and "Press Return" reads oddly. */
@media (pointer: coarse) {
  .search-hint {
    display: none;
  }
}

/* Results: a summary, then a section per book. */

.search-summary {
  color: var(--r-ink-2);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.search-book {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.search-book h2 {
  color: var(--r-ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.search-hits {
  align-self: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-hits li + li {
  border-block-start: var(--hairline) solid var(--r-line);
}

.search-hit {
  display: block;
  padding-block: 12px;
  color: var(--r-ink);
  text-decoration: none;
}

.search-hit:focus-visible {
  border-radius: var(--r-s);
}

.search-hit-ref {
  display: block;
  color: var(--r-accent);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

.search-hit-text {
  display: block;
  max-width: 40rem;
  color: var(--scripture);
  font-family: var(--font-scripture);
  font-size: 1.0625rem;
  line-height: 1.5;
}

@media (hover: hover) and (pointer: fine) {
  .search-hit:hover .search-hit-ref {
    text-decoration: underline;
    text-underline-offset: 0.18em;
  }
}

.search mark {
  padding: 0 2px;
  border-radius: 4px;
  background: var(--r-accent-soft);
  color: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.search-more {
  position: relative;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--r-accent);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .search-more:hover {
    text-decoration: underline;
    text-underline-offset: 0.18em;
  }
}

.search-more-books {
  align-self: flex-start;
}

/* Nothing found: centred, quiet, words only. */

.search-none {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-block-start: 30px;
  text-align: center;
}

.search-none-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--display-weight);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.search-none p {
  max-width: 420px;
  color: var(--r-ink-2);
  font-size: 1rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.search-none a {
  font-weight: 600;
}

.search-error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.search-error p {
  max-width: 36rem;
  color: var(--r-ink-2);
}

@media (prefers-reduced-motion: reduce) {
  .search-box,
  .search-try,
  .search-go {
    transition: none;
  }
}

@media (forced-colors: active) {
  .search-box,
  .search-go,
  .search-try,
  .search-translation {
    border: 1px solid CanvasText;
  }

  .search-box:focus-within {
    outline: 2px solid Highlight;
  }

  .search mark {
    forced-color-adjust: none;
    background: Mark;
    color: MarkText;
  }
}

/* src/styles/sign-in.css */
/*
  /sign-in (lib/pages/sign-in.mjs). One centred column, about 376 px, one step at a
  time: the address, then the password or a code. The look is Spectrum UI's Login
  Card (Apache-2.0), modified for Found: no card around it, real labels, each step's
  field a pill with its submit as a round button at the trailing edge, other ways in
  as full-width neutral pills under a hairline "or". Errors sit under their field in
  the danger colour. Anything that waits shows a spinner (src/scripts/ui.js setBusy).
*/

.sign-in {
  max-width: 23.5rem;
  margin-inline: auto;
  padding-block-start: var(--space-article);
}

/* The heading and lede, centred over the column. */
.sign-in-head {
  text-align: center;
}

.sign-in-title {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: var(--title-tracking);
  text-wrap: balance;
}

[data-sign-in] [data-sign-in-title]:focus {
  /* Focus lands here when the state changes, for screen readers; it isn't a control. */
  outline: none;
}

/* The lede, and on the password and code steps the address with Change beside it. */
.sign-in-lede {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 6px;
  margin-block-start: 8px;
  color: var(--r-ink-2);
  font-size: var(--text-ui);
  line-height: 1.5;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.sign-in-change .text-button {
  min-height: 0;
  padding-block: 10px;
  margin-block: -10px;
  font-size: var(--text-ui);
}

.sign-in-message {
  margin-block-start: 16px;
  font-size: var(--text-ui);
  font-weight: 500;
  line-height: 1.5;
  text-wrap: pretty;
}

/* The steps */

.sign-in-panel {
  margin-block-start: 32px;
  font-size: var(--text-ui);
  line-height: 1.5;
}

.sign-in-panel > * + * {
  margin-block-start: 12px;
}

.sign-in-panel > p + .button {
  margin-block-start: 24px;
}

.sign-in-form > * + * {
  margin-block-start: 20px;
}

.sign-in .field-label {
  margin-inline-start: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* A step's field: a pill, its submit a round button inside the trailing edge. */
.pill-field {
  position: relative;
  margin-block-start: 8px;
}

.sign-in .pill-input {
  max-width: none;
  min-height: 52px;
  margin: 0;
  padding: 12px 60px 12px 20px;
  border-radius: 999px;
  background: var(--sheet);
  box-shadow: inset 0 0 0 1px var(--field-edge);
  /* 17 px: iOS Safari doesn't zoom into it. */
  font-size: var(--text-body);
  transition: box-shadow 150ms ease;
}

.sign-in .pill-input::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.sign-in .pill-field-toggle .pill-input {
  padding-inline-end: 118px;
}

.sign-in .field-code {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.24em;
}

.sign-in .field-code::placeholder {
  letter-spacing: 0.24em;
}

/* One ring: the edge turns to the accent on focus, or the danger colour after an
   error, with a soft halo of the same colour. */
.sign-in .pill-input:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: inset 0 0 0 1.5px var(--r-accent), 0 0 0 4px color-mix(in oklab, var(--r-accent) 20%, transparent);
}

.sign-in .pill-input[aria-invalid="true"] {
  box-shadow: inset 0 0 0 1.5px var(--danger);
}

.sign-in .pill-input[aria-invalid="true"]:focus-visible {
  box-shadow: inset 0 0 0 1.5px var(--danger), 0 0 0 4px color-mix(in oklab, var(--danger) 20%, transparent);
}

.pill-submit {
  position: absolute;
  inset-inline-end: 6px;
  top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--btn);
  color: var(--on-btn);
  cursor: pointer;
  transition: scale 140ms var(--ease-out), background-color 150ms ease;
}

.pill-submit:active {
  scale: 0.94;
}

.pill-submit:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--r-accent);
}

@media (hover: hover) and (pointer: fine) {
  .pill-submit:hover {
    background: color-mix(in oklab, var(--btn) 88%, var(--r-ink));
  }
}

.pill-arrow {
  width: 18px;
  height: 18px;
}

/* Busy: the arrow gives way to the spinner, in the same place. */
.pill-submit .spinner {
  display: none;
}

.pill-submit[aria-busy="true"] {
  cursor: progress;
}

.pill-submit[aria-busy="true"]:active {
  scale: 1;
}

.pill-submit[aria-busy="true"] .spinner {
  display: block;
}

.pill-submit[aria-busy="true"] .pill-arrow {
  display: none;
}

/* Show / Hide inside the password field, before the round button. */
.field-toggle-inline {
  position: absolute;
  inset-block: 8px;
  inset-inline-end: 52px;
  min-width: 56px;
  padding-inline: 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--r-ink-2);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .field-toggle-inline:hover {
    background: var(--hover);
    color: var(--r-ink);
  }
}

.sign-in .field-error {
  margin-inline-start: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

.sign-in-forgotten {
  margin-block-start: 4px;
  margin-inline-start: 4px;
  font-size: 0.875rem;
}

/* Other ways in, and every button under a step: full-width neutral pills. */
.sign-in .pill-button,
.sign-in .signin {
  min-height: 48px;
  border-radius: 999px;
  font-size: var(--text-ui);
  font-weight: 500;
}

/* A spinner inside a pill or a text button appears only while it works. */
.pill-button .spinner,
.text-button .spinner,
.signin .spinner {
  display: none;
}

.pill-button[aria-busy="true"] .spinner,
.signin[aria-busy="true"] .spinner {
  display: block;
}

.text-button[aria-busy="true"] .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-inline-end: 8px;
}

.signin[aria-busy="true"] .signin-logo {
  display: none;
}

.text-button[aria-busy="true"] {
  cursor: progress;
  text-decoration-line: none;
}

/* Apple and Google: one column, one size, as on /delete-account. */
.sign-in-providers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* "or", with a hairline either side. */
.sign-in-panel > .sign-in-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-block: 20px;
  color: var(--r-ink-2);
  font-size: 0.8125rem;
}

.sign-in-or::before,
.sign-in-or::after {
  content: "";
  flex: 1;
  border-block-start: 1px solid var(--line);
}

/* Send a new code, with the wait before it, centred under the buttons. */
.sign-in-panel > .sign-in-resend {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-block-start: 12px;
  text-align: center;
}

.sign-in-resend .text-button {
  font-size: var(--text-ui);
}

.sign-in-hint {
  color: var(--r-ink-2);
  font-size: 0.875rem;
}

.sign-in-note {
  color: var(--r-ink-2);
  font-size: 0.875rem;
  text-align: center;
  text-wrap: pretty;
}

.sign-in-panel > .sign-in-note {
  margin-block-start: 28px;
}

.sign-in-panel > .sign-in-privacy {
  margin-block-start: 8px;
}

/* "Signing you in": the spinner, centred, while the account is checked. */
.sign-in-wait {
  display: flex;
  justify-content: center;
  padding-block: 8px 24px;
  color: var(--r-ink-2);
}

/* Unavailable for now (a sign-in on its way, or the wait before a new code): still
   focusable, so its reason is read out. A busy button keeps its full colour, since
   its spinner says why it can't be pressed again. */
[data-sign-in] [aria-disabled="true"]:not([aria-busy="true"]) {
  cursor: default;
  opacity: 0.55;
}

[data-sign-in] .button[aria-disabled="true"]:active,
[data-sign-in] .signin[aria-disabled="true"]:active {
  transform: none;
}

/* A new step rises into place and clears a light blur. Never on page load: sign-in.js
   sets data-moved after the first change. */
[data-sign-in][data-moved] .sign-in-panel:not([hidden]) {
  animation: sign-in-step 260ms var(--ease-out);
}

@keyframes sign-in-step {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-sign-in][data-moved] .sign-in-panel:not([hidden]) {
    animation: sign-in-fade 200ms ease-out;
  }

  .pill-submit,
  .pill-submit:active {
    scale: 1;
    transition: background-color 150ms ease;
  }
}

@keyframes sign-in-fade {
  from {
    opacity: 0;
  }
}

@media (forced-colors: active) {
  .sign-in .pill-input,
  .pill-submit {
    border: 1px solid CanvasText;
  }
}

/* src/styles/ui.css */
/*
  Shared pieces drawn by src/scripts/ui.js and src/scripts/picker.js: the toast stack
  and the passage picker. Ported from Spectrum UI and modified for Found (Toast
  Stack is beUI's, MIT; Command Search is Spectrum's own, Apache-2.0; notices on
  /licences): plain CSS on the site's tokens, transitions instead of springs.
*/

/* ------------------------------------------------------------------------ */
/* Toasts: bottom centre on phones, bottom right from 768 px. A new one rises 22 px
   and clears a blur; a leaving one slides 32 px aside, faster; the rest close up
   (ui.js's FLIP). */

.toaster {
  position: fixed;
  inset: auto auto max(16px, env(safe-area-inset-bottom)) 50%;
  z-index: 60;
  width: min(380px, calc(100vw - 32px));
  max-width: none;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: var(--r-ink);
  pointer-events: none;
  transform: translateX(-50%);
}

/* Above the reader's previous and next pills on phones. */
.reader .toaster {
  bottom: calc(80px + env(safe-area-inset-bottom));
}

.toast-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toast {
  --ring-gap: var(--sheet);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 10px 11px 12px;
  border-radius: var(--r-row);
  background: var(--sheet);
  box-shadow: var(--shadow-float);
  font-family: var(--font-ui);
  pointer-events: auto;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  transition:
    opacity 260ms var(--ease-out),
    transform 260ms var(--ease-out),
    filter 260ms var(--ease-out),
    translate 220ms var(--ease-out);
}

@starting-style {
  .toast {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
    filter: blur(10px);
  }
}

.toast.is-leaving {
  opacity: 0;
  transform: translateX(32px) scale(0.96);
  filter: blur(8px);
  transition-duration: 180ms;
}

.toast.is-leaving[data-exit="left"] {
  transform: translateX(-32px) scale(0.96);
}

.toast.is-dragging {
  cursor: grabbing;
  transition: none;
}

/* The status: a small round mark beside the words. */
.toast-dot {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-block-start: 1px;
  border-radius: 50%;
  background: var(--r-surface-2);
  color: var(--r-ink-2);
}

.toast[data-status="success"] .toast-dot {
  background: color-mix(in oklab, var(--success) 14%, var(--sheet));
  color: var(--success);
}

.toast[data-status="error"] .toast-dot {
  background: color-mix(in oklab, var(--danger) 14%, var(--sheet));
  color: var(--danger);
}

.toast:is([data-status="info"], [data-status="loading"]) .toast-dot {
  background: var(--r-accent-soft);
  color: var(--r-accent);
}

.toast-glyph {
  width: 13px;
  height: 13px;
}

.spinner-toast {
  width: 13px;
  height: 13px;
  border-width: 1.75px;
}

.toast-body {
  flex: 1;
  min-width: 0;
  padding-block: 1px;
}

.toast-title {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.43;
  letter-spacing: -0.005em;
}

.toast-description {
  margin-block-start: 1px;
  color: var(--r-ink-2);
  font-size: 0.8125rem;
  line-height: 1.4;
  text-wrap: pretty;
}

.toast-action {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-block-start: 8px;
  padding-inline: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--r-surface-2);
  color: var(--r-ink);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.toast-close {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--r-ink-2);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

/* A 40 px target round the 26 px mark. */
.toast-close::after {
  content: "";
  position: absolute;
  inset: -7px;
}

@media (hover: hover) and (pointer: fine) {
  .toast-close:hover,
  .toast-action:hover {
    background: var(--hover);
    color: var(--r-ink);
  }
}

@media (min-width: 48rem) {
  .toaster,
  .reader .toaster {
    inset: auto max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) auto;
    transform: none;
  }
}

/* ------------------------------------------------------------------------ */
/* The passage picker (picker.js): a sheet on phones, a panel under the passage
   button from 600 px. A search field, the books in two groups with the active
   row tinted in the accent's soft colour, then a book's chapters. */

.picker {
  --ring-gap: var(--sheet);
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: none;
  height: min(86dvh, 720px);
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--sheet);
  color: var(--r-ink);
  font-family: var(--font-ui);
  box-shadow: var(--shadow-float);
}

.picker[open] {
  transition: transform 260ms var(--ease-drawer);
}

@starting-style {
  .picker[open] {
    transform: translateY(100%);
  }
}

.picker::backdrop {
  background: rgba(0, 0, 0, 0.32);
  transition: opacity 200ms ease-out;
}

@starting-style {
  .picker[open]::backdrop {
    opacity: 0;
  }
}

.picker-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-block-start: 8px;
}

.picker .sheet-grip {
  flex: none;
  align-self: center;
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--line-strong);
}

.picker-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px max(14px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
}

.picker-title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
}

.picker-title:focus {
  outline: none;
}

.picker-close {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--r-surface-2);
  color: var(--r-ink-2);
  cursor: pointer;
}

.picker-close::after {
  content: "";
  position: absolute;
  inset: -6px;
}

.picker-close .icon {
  width: 15px;
  height: 15px;
}

.picker-search {
  position: relative;
  flex: none;
  margin: 12px max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left));
}

.picker-glass {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  width: 17px;
  height: 17px;
  color: var(--r-ink-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.picker-input {
  width: 100%;
  height: 44px;
  padding: 0 12px 0 38px;
  border: 0;
  border-radius: var(--r-s);
  background: var(--r-surface-2);
  color: var(--r-ink);
  font: inherit;
  /* 16 px, so iOS doesn't zoom into the field. */
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
}

.picker-input::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.picker-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.picker-input:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--r-accent);
}

.picker-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.picker-books-view {
  padding: 2px max(8px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  scroll-padding-block: 36px 8px;
}

.picker-group-label {
  padding: 12px 12px 4px;
  color: var(--r-ink-2);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

.picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-inline: 12px;
  border-radius: var(--r-s);
  font-size: var(--text-ui);
  line-height: 1.25;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.picker-option[aria-selected="true"] {
  background: var(--r-accent-soft);
}

.picker-option mark {
  background: none;
  color: var(--r-accent);
  font-weight: 600;
}

.picker-option.is-go {
  font-weight: 500;
}

/* The book open now: a diamond, as on the books page's rail. */
.picker-option.is-current .picker-option-name::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-end: 9px;
  border-radius: 1px;
  background: var(--r-accent);
  vertical-align: 0.15em;
  transform: rotate(45deg);
}

.picker-option-note {
  margin-inline-start: auto;
  color: var(--r-ink-2);
  font-size: 0.75rem;
}

.picker-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 36px 24px;
  color: var(--r-ink-2);
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: center;
  text-wrap: pretty;
}

.picker-empty-title {
  color: var(--r-ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* A book's chapters */

.picker-chapters-view {
  padding: 0 max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  /* Keeps a cell that takes focus clear of the sticky head, ring included. */
  scroll-padding-block: 58px 8px;
}

.picker-chapters-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-block: 10px 8px;
  background: var(--sheet);
}

.picker-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  margin-inline-start: -6px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--r-ink-2);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.picker-back .icon {
  width: 16px;
  height: 16px;
}

.picker-book {
  margin-inline-start: 4px;
  font-family: var(--font-title);
  font-size: 1.125rem;
  font-weight: var(--title-weight);
  line-height: 1.2;
}

.picker-book:focus {
  outline: none;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  margin: 0;
  /* Room for the first row's focus ring, which the opaque sticky head would
     otherwise paint over. */
  padding: 4px 0 0;
  list-style: none;
}

.picker-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: var(--r-s);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--r-ink);
  font-size: var(--text-ui);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background-color 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.picker-grid a[aria-current] {
  background: var(--btn);
  color: var(--on-btn);
  box-shadow: none;
}

/* The cells draw their edge with a shadow, so the focus ring is drawn here too. */
.picker-grid a:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--r-accent);
}

@media (hover: hover) and (pointer: fine) {
  .picker-back:hover,
  .picker-grid a:not([aria-current]):hover {
    background: var(--hover);
    color: var(--r-ink);
  }
}

/* Keyboard hints, for keyboards: hidden on touch screens. */
.picker-foot {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .picker-foot {
    display: flex;
    flex: none;
    gap: 16px;
    padding: 9px 14px;
    border-block-start: 1px solid var(--line);
    color: var(--r-ink-2);
    font-size: 0.75rem;
    line-height: 1.4;
  }

  .picker[data-view="chapters"] .picker-foot span:first-child {
    display: none;
  }
}

.picker-foot kbd {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  margin-inline-end: 3px;
  padding-inline: 4px;
  border-radius: 4px;
  background: var(--r-surface-2);
  box-shadow: inset 0 -1px 0 var(--line-strong);
  color: var(--r-ink-2);
  font: 500 0.6875rem/18px var(--font-ui);
  text-align: center;
}

/* Tablets and desktops: a panel under the passage button. */
@media (min-width: 37.5rem) {
  .picker.is-anchored {
    inset: var(--picker-top, 120px) auto auto var(--picker-left, 24px);
    width: 400px;
    height: auto;
    max-height: min(480px, calc(100dvh - var(--picker-top, 120px) - 24px));
    border-radius: var(--r-card);
    transform-origin: top left;
  }

  .picker.is-anchored[open] {
    transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
  }

  @starting-style {
    .picker.is-anchored[open] {
      opacity: 0;
      transform: translateY(-4px) scale(0.98);
    }
  }

  .picker.is-anchored::backdrop {
    background: rgba(0, 0, 0, 0.04);
  }

  .picker.is-anchored .picker-body {
    max-height: inherit;
    padding-block-start: 0;
  }

  /* The field is the panel's top edge, as in a command menu; the title still names it. */
  .picker.is-anchored :is(.sheet-grip, .picker-head) {
    display: none;
  }

  .picker.is-anchored .picker-search {
    margin: 0;
    border-block-end: 1px solid var(--line);
  }

  .picker.is-anchored .picker-glass {
    inset-inline-start: 16px;
  }

  .picker.is-anchored .picker-input {
    height: 50px;
    padding-inline-start: 42px;
    border-radius: var(--r-card) var(--r-card) 0 0;
    background: transparent;
    font-size: var(--text-ui);
  }

  .picker.is-anchored .picker-input:focus-visible {
    box-shadow: none;
  }

  .picker.is-anchored .picker-books-view {
    padding: 4px 6px 8px;
  }

  .picker.is-anchored .picker-option {
    min-height: 36px;
    padding-inline: 10px;
  }

  .picker.is-anchored .picker-chapters-view {
    padding: 0 14px 14px;
  }

  .picker.is-anchored .picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  }
}

@media (prefers-color-scheme: dark) {
  .picker.is-anchored::backdrop {
    background: rgba(0, 0, 0, 0.24);
  }
}

/* ------------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity 200ms ease-out;
  }

  @starting-style {
    .toast {
      opacity: 0;
      transform: none;
      filter: none;
    }
  }

  .toast.is-leaving,
  .toast.is-leaving[data-exit="left"] {
    transform: none;
    filter: none;
  }

  .picker[open],
  .picker.is-anchored[open] {
    transition: opacity 150ms ease-out;
  }

  @starting-style {
    .picker[open],
    .picker.is-anchored[open] {
      opacity: 0;
      transform: none;
    }
  }
}

@media (forced-colors: active) {
  .toast,
  .picker,
  .picker-grid a {
    border: 1px solid CanvasText;
  }

  .picker-option[aria-selected="true"] {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}

/* src/styles/verses.css */
/*
  W8 verse page (web §9.8; WebPage.dc.html lines 96 to 103, w08-verse-page.png):
  the reference, the verse large in the Scripture face, two buttons, and the WEBBE
  text behind "Compare". Nothing around it. The design centres it in the space under
  the header; it sits a fixed way down instead, so opening "Compare" moves nothing.
*/

.verse-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding-block-start: calc(var(--space-hero) * 1.5);
  text-align: center;
}

/* The h1 is the reference, set small as in the design: the verse is the focus. */
.verse-ref {
  color: var(--r-accent);
  font-family: var(--font-ui);
  font-size: var(--text-small);
  font-weight: 600;
  line-height: 1.4;
}

.verse-text {
  max-width: 820px;
  color: var(--scripture);
  font-family: var(--font-scripture);
  font-size: 1.75rem;
  line-height: 1.35;
  text-wrap: pretty;
}

/* Long passages (over about 220 characters) a step smaller, so they stay a quotation. */
.verse-text-long {
  font-size: 1.5rem;
}

.verse-text .nd,
.verse-compare-text .nd {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.04em;
}

.verse-page .verse-actions {
  position: static;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-block-start: 6px;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.verse-compare {
  max-width: 640px;
  color: var(--r-ink-2);
  font-size: var(--text-small);
}

.verse-compare > summary {
  display: inline-block;
  padding: 11px 8px;
  line-height: 22px;
  border-radius: var(--r-s);
  cursor: pointer;
  list-style: none;
}

.verse-compare > summary::-webkit-details-marker {
  display: none;
}

.verse-compare-label {
  color: var(--r-accent);
  font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
  .verse-compare > summary:hover .verse-compare-label {
    text-decoration-line: underline;
    text-decoration-thickness: from-font;
    text-underline-offset: 0.18em;
  }
}

.verse-compare-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-block: 10px 0;
}

.verse-compare-text {
  color: var(--scripture);
  font-family: var(--font-scripture);
  font-size: 1.1875rem;
  line-height: 1.55;
  text-wrap: pretty;
}

@media (min-width: 37.5rem) {
  .verse-text {
    font-size: 2.375rem;
  }

  .verse-text-long {
    font-size: 1.875rem;
  }
}

@media (min-width: 68.75rem) {
  .verse-text {
    font-size: 3rem;
  }

  .verse-text-long {
    font-size: 2.25rem;
  }
}

/* src/styles/you.css */
/*
  /you (lib/pages/you.mjs, src/scripts/you.js). The article template with one section at a
  time: the person's own words in a plain list, hairlines between rows, no cards around
  text. The section switch wraps instead of scrolling, so a phone sees every section.
*/

.you-nav {
  margin-block-end: 32px;
}

.article-text ul.you-tabs[role="list"] {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.article-text ul.you-tabs[role="list"] > li {
  margin: 0;
  padding: 0;
}

.article-text ul.you-tabs[role="list"] > li::before {
  content: none;
}

.you-tab {
  min-height: 44px;
  padding: 8px 14px;
  border: var(--hairline) solid var(--r-line);
  border-radius: 999px;
  background: none;
  color: var(--r-ink-2);
  font: inherit;
  font-size: var(--text-small);
  cursor: pointer;
}

.you-tab[aria-current="true"] {
  border-color: var(--r-ink);
  background: var(--r-ink);
  color: var(--page);
}

@media (hover: hover) and (pointer: fine) {
  .you-tab:not([aria-current="true"]):hover {
    border-color: var(--r-ink-2);
    color: var(--r-ink);
  }
}

.you-section h2:focus,
.you-editor .sheet-title:focus {
  outline: none;
}

.you-empty {
  color: var(--r-ink-2);
  text-align: center;
  text-wrap: pretty;
}

.you-section .actions:empty {
  display: none;
}

.you-skipped {
  margin-block-end: 16px;
  text-align: center;
}

.you-lock {
  justify-content: center;
  margin-block-start: 40px;
}

/* The rows. */

.sync-list:not(:empty) {
  border-block-start: var(--hairline) solid var(--r-line);
}

.article-text ul.sync-list[role="list"] > li {
  display: grid;
  gap: 4px;
  padding-inline-start: 0;
  padding-block: 16px;
  border-block-end: var(--hairline) solid var(--r-line);
}

.article-text ul.sync-list[role="list"] > li + li {
  margin-block-start: 0;
}

.article-text ul.sync-list[role="list"] > li::before {
  content: none;
}

.article-text .sync-list p {
  margin: 0;
}

.sync-head {
  font-weight: 600;
}

.sync-body,
.sync-sub {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sync-sub {
  color: var(--r-ink-2);
}

.group-section .you-row-actions {
  flex-direction: row;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-start: 8px;
}

.you-dot {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-inline-end: 0.45em;
  border-radius: 50%;
  outline: 1px solid var(--r-line);
}

.you-dot-yellow { background: #f2d24b; }
.you-dot-green { background: #8fd19e; }
.you-dot-blue { background: #8fc1ec; }
.you-dot-purple { background: #c3a6ec; }
.you-dot-pink { background: #f2a6c6; }

/* The form, in the reader's sheet. */

.you-editor .sign-in-form {
  display: grid;
  gap: 16px;
}

.you-editor .sign-in-form > [hidden] {
  display: none;
}

.you-editor .spinner {
  display: none;
}

.you-editor [aria-busy="true"] .spinner {
  display: inline-block;
}

.you-editor .field-input {
  max-width: none;
}

.you-row-actions [aria-busy="true"] {
  opacity: 0.6;
}

.you-textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
  font-size: max(16px, var(--text-body));
}

.you-verse {
  display: grid;
  gap: 4px;
}

.you-verse-text {
  color: var(--r-ink-2);
  font-family: var(--font-scripture, inherit);
  line-height: 1.55;
}

.you-colours {
  margin: 0;
  padding: 0;
  border: 0;
}

.you-colours .width-switch {
  flex-wrap: wrap;
  height: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .you-tab {
    transition: border-color 120ms ease, color 120ms ease;
  }
}

/* Memory practice (src/scripts/you-practice.js): the steps in the page's own column, with the
   verse in the reading face and no card around it. */

.you-practice-start {
  display: grid;
  gap: 8px;
  margin-block-end: 24px;
  text-align: center;
}

.article-text .you-practice-start p {
  margin: 0;
}

.you-practice-start .actions {
  justify-content: center;
  margin-block-start: 4px;
}

.you-practice-start [hidden] {
  display: none;
}

.you-practice-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-block-end: 32px;
}

.you-progress {
  flex: 1 1 auto;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--r-surface-2);
}

.you-progress[hidden] {
  display: none;
}

.you-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--r-ink-2);
  transform: scaleX(var(--done, 0));
  transform-origin: left center;
}

.you-practice-step {
  display: grid;
  gap: 20px;
}

.you-practice-head {
  display: grid;
  gap: 4px;
  text-align: center;
}

.article-text .you-practice-head :is(p, h2) {
  margin: 0;
}

.you-practice-head h2 {
  text-wrap: balance;
}

.you-practice-head h2:focus {
  outline: none;
}

.you-practice-label {
  color: var(--r-ink-2);
  font-size: var(--text-small);
}

.you-practice-verse {
  display: grid;
  gap: 12px;
}

.you-practice-text,
.article-text .you-practice-text p {
  margin: 0;
  color: var(--scripture);
  font-family: var(--font-scripture, inherit);
  font-size: 1.125rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.article-text .you-practice-text p + p {
  margin-block-start: 8px;
}

.article-text .you-practice-ref,
.article-text .you-practice-hint {
  margin: 0;
  color: var(--r-ink-2);
  font-size: var(--text-small);
  text-align: center;
  text-wrap: pretty;
}

.you-practice-hint:empty {
  display: none;
}

.you-practice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.you-practice-actions .button[hidden],
.you-practice-step [hidden] {
  display: none;
}

.you-gaps {
  line-height: 2.1;
}

.you-gap {
  display: inline-block;
  min-width: 4.5em;
  min-height: 1.6em;
  padding-inline: 8px;
  border-radius: var(--r-s);
  background: var(--r-surface-2);
  line-height: 1.5;
  text-align: center;
  vertical-align: baseline;
}

.you-gap.is-active {
  outline: 2px solid var(--r-ink-2);
  outline-offset: -2px;
  background: none;
}

.you-gap.is-filled {
  font-weight: 600;
}

.you-gap.is-slip {
  text-decoration-line: underline;
  text-underline-offset: 3px;
}

.you-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.you-chip {
  min-height: 44px;
  padding: 8px 16px;
  border: var(--hairline) solid var(--r-line);
  border-radius: 999px;
  background: none;
  color: var(--r-ink);
  font: inherit;
  cursor: pointer;
}

.you-chip[aria-pressed="true"] {
  border-color: var(--r-ink);
  background: var(--r-ink);
  color: var(--page);
}

.you-chip.is-used {
  color: var(--r-ink-2);
  text-decoration-line: line-through;
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .you-chip:not(.is-used, [aria-pressed="true"]):hover {
    border-color: var(--r-ink-2);
  }
}

.you-gap-field .field-input {
  max-width: none;
}

.you-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.you-tile {
  min-width: 40px;
  min-height: 44px;
  padding-inline: 8px;
  border: 0;
  border-radius: var(--r-row);
  background: var(--r-surface-2);
  color: var(--scripture);
  font-family: var(--font-scripture, inherit);
  font-size: 1.125rem;
  cursor: pointer;
}

.you-tile.is-shown {
  background: none;
  font-weight: 600;
  cursor: default;
}

.you-answer {
  font-family: var(--font-scripture, inherit);
}

.you-left-out {
  text-decoration-line: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.you-stages {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.you-stage-bars {
  display: flex;
  gap: 8px;
}

.you-stage-bars span {
  width: 40px;
  height: 8px;
  border-radius: 999px;
  background: var(--r-surface-2);
}

.you-stage-bars .is-on {
  background: var(--r-ink-2);
}

@media (prefers-reduced-motion: no-preference) {
  .you-practice-step {
    transition: opacity 200ms var(--ease-out);
  }

  @starting-style {
    .you-practice-step {
      opacity: 0;
    }
  }

  .you-progress span {
    transition: transform 200ms var(--ease-out);
  }
}

@media (forced-colors: active) {
  .you-chip,
  .you-tile,
  .you-gap {
    border: 1px solid CanvasText;
  }
}

/* The recovery code is 28 characters with its dashes, wider than a six-digit code. */
[data-you-code] {
  width: 100%;
  max-width: 30rem;
  letter-spacing: 0.08em;
}
