/*
 * The page defaults and components the App and the Website share. Every value is a
 * setting from tokens.css. Each component here is on the App's Style Guide (a test
 * checks); page layout belongs to each program's own CSS.
 */

/* Page defaults. A word longer than its line, as some Languages' are, breaks
   rather than making the page wider than the window; where every word fits,
   nothing moves. */

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  font-weight: var(--weight-regular);
  line-height: var(--line-height-0);
  overflow-wrap: break-word;
}

/* Dark mode, as a visitor chooses it on the Website (#82): the page's root says
   light or dark, and every light-dark() colour follows. Without either, it follows
   the device. */
:root[data-mode='light'] {
  color-scheme: light;
}

:root[data-mode='dark'] {
  color-scheme: dark;
}

/* Headings sit one golden step lower than the old site's ratio would put them:
   the page title at step 2, a section's heading at step 1 and a small heading at
   step 0, in bold, each at its step's line height. */
h1,
h2,
h3 {
  font-weight: var(--weight-bold);
}

h1 {
  font-size: var(--step-2);
  line-height: var(--line-height-2);
}

h2 {
  font-size: var(--step-1);
  line-height: var(--line-height-1);
}

h3 {
  font-size: var(--step-0);
  line-height: var(--line-height-0);
}

a {
  color: var(--color-accent);
}

@media (hover: hover) {
  a:hover {
    color: var(--color-accent-strong);
  }
}

/* A link in a line of words is underlined, so that more than its colour says
   it is one. A link that stands on its own, such as a breadcrumb's, a list's
   or a Reference over verses (.plain-link), is said to be one by where it
   stands, so it is underlined only while pointed at. */
.plain-link,
.breadcrumb a,
.data-table td a,
.word-links a,
.page-menu a,
.passage-reference a {
  text-decoration: none;
}

@media (hover: hover) {
  .plain-link:hover,
  .breadcrumb a:hover,
  .data-table td a:hover,
  .word-links a:hover,
  .page-menu a:hover,
  .passage-reference a:hover {
    text-decoration: underline;
  }
}

/* Standing on its own, it is a finger's least target tall, however short its
   words. */
.plain-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-target-min);
}

:focus-visible {
  outline: var(--width-focus) solid var(--color-accent);
  outline-offset: var(--width-focus);
}

/* A field, a list to choose from and a search's button show focus in their own
   border, doubled in the words' colour, rather than in the accent's ring: a
   browser shows a field's focus at every tap or click, where a red ring reads as
   an error. */
:is(.input, .search-field input, .search-field .button):focus-visible {
  outline: none;
  border-color: var(--color-text);
  box-shadow: 0 0 0 var(--width-border) var(--color-text);
}

/* A field with an error keeps the error's colour. */
.input[aria-invalid='true']:focus-visible {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 var(--width-border) var(--color-danger);
}

progress {
  width: 100%;
  accent-color: var(--color-accent);
}

/* Text. */

.intro {
  max-width: var(--width-measure);
  color: var(--color-muted);
}

.muted {
  color: var(--color-muted);
}

.note {
  color: var(--color-muted);
  font-size: var(--step--1);
  line-height: var(--line-height--1);
}

.error {
  color: var(--color-danger);
}

.warning {
  color: var(--color-warning);
}

.back-link {
  display: inline-block;
  color: var(--color-muted);
  text-decoration: none;
}

@media (hover: hover) {
  .back-link:hover {
    color: var(--color-accent);
  }
}

/* A breadcrumb: the pages above this one, each a link, then this page's own
   name, which isn't, with a › between. Its links reach out to a finger's
   target, however short their words, such as a letter's. */
.breadcrumb {
  color: var(--color-muted);
  font-size: var(--step--1);
  line-height: var(--line-height--1);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li + li::before {
  content: "›" / "";
}

.breadcrumb :is(a, [aria-current='page']) {
  padding-inline: var(--space-2);
}

.breadcrumb a {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: var(--size-target-min);
  min-height: var(--size-target-min);
  color: var(--color-accent);
}

.breadcrumb a::after {
  position: absolute;
  inset: var(--inset-target) 0;
  content: "";
}

/* Buttons: a plain button, and the primary one that does the screen's main job. */

.button {
  padding: var(--space-2) var(--space-6);
  border: var(--width-border) solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-weight: var(--weight-medium);
  cursor: pointer;
}

/* A link's own hover colour must not show through. */
@media (hover: hover) {
  .button:hover:not(:disabled, [aria-disabled='true']) {
    background: var(--color-hover);
    color: var(--color-text);
  }
}

/* A link that looks like a button, such as one that opens the preview. */
a.button {
  display: inline-block;
  text-decoration: none;
}

/* A button that looks like a link, inside a line of text, such as a share card's
   Delete in the Media Library. */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

@media (hover: hover) {
  .link-button:hover:not(:disabled) {
    color: var(--color-accent-strong);
  }
}

.link-button:disabled {
  opacity: var(--opacity-disabled);
  cursor: default;
}

.button.primary {
  border-color: var(--color-accent-fill);
  background: var(--color-accent-fill);
  color: var(--color-on-accent);
}

@media (hover: hover) {
  .button.primary:hover:not(:disabled, [aria-disabled='true']) {
    border-color: var(--color-accent-fill-strong);
    background: var(--color-accent-fill-strong);
    color: var(--color-on-accent);
  }
}

/* A button that destroys something, such as Delete. */
.button.danger {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

/* Pointed at, it fills with the danger colour, its words the page's colour. */
@media (hover: hover) {
  .button.danger:hover:not(:disabled, [aria-disabled='true']) {
    background: var(--color-danger);
    color: var(--color-bg);
  }
}

/* A button pressed most, such as Menu or the Passage screen's Accept, is as tall
   as a finger needs. On a phone its sides are closer to its words, so that a row
   of them, such as the Passage screen's four with their keys, fits across. */
.button.large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--size-target);
}

@media (width < 48rem) {
  .button.large {
    gap: var(--space-1);
    padding-inline: var(--space-2);
  }
}

/* The key that does what a button does, shown in it: Accept, then Enter; ←, then
   Previous. */
.button:has(kbd) {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.button kbd {
  padding: 0 var(--space-1);
  border: var(--width-border) solid currentColor;
  border-radius: var(--radius-inset);
  font-family: var(--font-ui);
  font-size: var(--step--2);
  line-height: var(--line-height--2);
  font-weight: var(--weight-medium);
}

/* On a narrow phone a button leaves its key out, to fit; the key still works. */
@media (width < 24rem) {
  .button kbd {
    display: none;
  }
}

/* A button that stays focusable while it does nothing, such as Next on the last Passage, is aria-disabled. */
.button:is(:disabled, [aria-disabled='true']) {
  opacity: var(--opacity-disabled);
  cursor: default;
}

/* A button that shows only an icon, such as the Website's settings gear, its name
   in its aria-label. It is drawn as tall as a chip, so an invisible ::after
   reaches out to --size-target. */

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--size-chip);
  height: var(--size-chip);
  padding: 0;
  border: var(--width-border) solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}

.icon-button::after {
  position: absolute;
  inset: var(--inset-target);
  content: "";
}

.icon-button[aria-expanded='true'] {
  border-color: var(--color-border);
  background: var(--color-hover);
}

@media (hover: hover) {
  .icon-button:hover {
    border-color: var(--color-border);
    background: var(--color-hover);
  }
}

.icon-button svg {
  width: var(--step-1);
  height: var(--step-1);
}

/* A panel that drops from a button, such as the settings under the gear: it lies
   over the page, its end edge (the right, or the left in a right-to-left
   Language) under the button's, which sits in .dropdown. Its small labels name
   what follows them. */

.dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: 100%;
  inset-inline-end: 0;
  z-index: 10;
  display: grid;
  gap: var(--space-2);
  width: var(--width-sidebar);
  margin-top: var(--space-2);
  padding: var(--space-4);
  border: var(--width-border) solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-2);
}

.dropdown-panel[hidden] {
  display: none;
}

.dropdown-label {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--step--1);
  line-height: var(--line-height--1);
  font-weight: var(--weight-medium);
}

/* A menu that drops from an icon button, such as the Website's ☰ on a phone
   (#514): a disclosure (details), so that it opens, and its links work, without
   JavaScript. Its button (the summary) is pressed while it is open; its panel
   holds a row a finger can hit for each link, in words alone, none set apart
   for the page it is on; then, under a rule, a row that does something rather
   than leads somewhere, such as Settings, with its icon. A menu may drop from a
   segment of a segmented row instead (.segment-menu). */

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

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

.menu[open] > .icon-button {
  border-color: var(--color-border);
  background: var(--color-hover);
}

.menu > .dropdown-panel {
  gap: 0;
  padding: var(--space-2);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--size-target);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--color-text);
  font: inherit;
  font-weight: var(--weight-bold);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.menu-item svg {
  flex: none;
  width: var(--step-1);
  height: var(--step-1);
  color: var(--color-muted);
}

@media (hover: hover) {
  .menu-item:hover {
    background: var(--color-hover);
  }
}

/* The Website languages' menu, which drops from the globe beside the
   Website's gear (ADR 0035): a menu (.menu) under a small label, a row a
   finger can hit for each Website language, in its own name and script, as
   wide as the widest within the sidebar's width; the current one
   (aria-current) filled and ticked, as a chosen theme is. */
.language-menu > .dropdown-panel {
  width: max-content;
  max-width: var(--width-sidebar);
}

.language-menu .dropdown-label {
  padding: var(--space-1) var(--space-3) var(--space-2);
}

.language-menu .menu-item[aria-current='true'] {
  background: var(--color-accent-soft);
}

/* The tick is seen, not read: aria-current says the same. */
.language-menu .menu-item[aria-current='true']::after {
  margin-inline-start: auto;
  color: var(--color-accent);
  content: "✓" / "";
}

/* A rule: a thin line across its box that sets one group of things apart from
   the next, as a menu's links are from its actions, or a tapped word's
   Meanings are from each other (#806). */
.rule {
  width: 100%;
  height: var(--width-border);
  margin: var(--space-2) 0;
  border: 0;
  background: var(--color-border);
}

/* The visitor's settings under the Website's gear: wide enough for a Translation's
   full name, within the window, the list of Translations set apart from the
   themes as they are from dark mode. */
.settings-panel {
  width: min(var(--width-actions), 100vw - var(--space-4) - var(--space-4));
}

.settings-panel > select.input {
  margin-bottom: var(--space-2);
}

/* Theme choices: a button per theme, with a swatch that carries the theme's
   data-theme and so is drawn in its own colours, light ones even in dark mode,
   where two reds would look alike; the chosen one is pressed and ticked. */

.theme-choices {
  display: grid;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.theme-choice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--size-chip);
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

@media (hover: hover) {
  .theme-choice:hover {
    background: var(--color-hover);
  }
}

.theme-choice[aria-pressed='true'] {
  background: var(--color-accent-soft);
  font-weight: var(--weight-medium);
}

/* The tick is seen, not read: aria-pressed says the same. */
.theme-choice[aria-pressed='true']::after {
  margin-left: auto;
  color: var(--color-accent);
  content: "✓" / "";
}

.theme-swatch {
  flex: none;
  color-scheme: light;
  width: var(--space-6);
  height: var(--space-6);
  border-radius: var(--radius-pill);
  background: var(--color-accent-fill);
}

/* A row of buttons of which one is pressed, such as the Translations; or of links
   of which one is the current page, such as a Topic's Translations on the Website.
   The border's colour shows between them, as their dividers. Too wide for the
   window, they wrap, each row as wide as the window. */

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--width-border);
  max-width: 100%;
  border: var(--width-border) solid var(--color-border);
  border-radius: var(--radius-control);
  overflow: hidden;
  background: var(--color-border);
}

/* A row a script hides, such as Red letters' on a page in no Translation. */
.segmented[hidden] {
  display: none;
}

.segmented :is(button, a, input, .segment-menu) {
  flex: auto;
}

.segmented :is(button, a, summary) {
  padding: var(--space-1) var(--space-3);
  border: none;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* A box to type a number in, beside the button that uses it, such as the place
   to move a Passage to. */
.segmented input {
  width: var(--space-12);
  padding: var(--space-1) var(--space-2);
  border: none;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  text-align: center;
}

@media (hover: hover) {
  .segmented :is(button, a, summary):hover {
    background: var(--color-hover);
    color: var(--color-text);
  }
}

/* As specific as :hover, and after it, so a pressed button stays pressed. */
.segmented :is(button[aria-pressed='true'], a[aria-current='page'], summary[aria-current='true']) {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: var(--weight-medium);
}

.segmented button:disabled {
  background: var(--color-surface);
  color: var(--color-muted);
  opacity: var(--opacity-disabled);
  cursor: default;
}

/* A segment of a row of links that is no link, such as a Dictionary with no
   Counterpart in a Dictionary article's row: greyed as a disabled button is. */
.segmented [aria-disabled='true'] {
  flex: auto;
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface);
  color: var(--color-muted);
  opacity: var(--opacity-disabled);
  cursor: default;
}

/* A segmented control whose choices each show a small picture before their
   name, such as the Harmony's Four columns and One column (#757): each choice
   a finger's height, its picture as tall as an icon button's. */
.segmented-icons :is(button, a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--size-target);
}

.segmented-icons svg {
  flex: none;
  width: var(--step-1);
  height: var(--step-1);
}

/* The row's own edges would cut a focus ring outside a segment: it is inside. */
.segmented :is(button, a, summary):focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 var(--width-focus) var(--color-accent);
}

/* The row of the four Dictionaries before a Dictionary article's heading
   (ADR 0030): a segmented row of links, each segment as wide as the widest and
   at least a target tall, its name centred in it. Narrower than the narrow
   breakpoint, the segments' sides are closer, so that the four fit at 320px. */
.dictionary-row {
  display: inline-grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
}

.dictionary-row > :is(a, [aria-disabled='true']),
.dictionary-row > .segment-menu > summary {
  display: grid;
  place-items: center;
  min-height: var(--size-target);
}

/* A menu's segment carries a caret too (.segment-menu): its sides are closer
   still, so that the four fit at 320px with one of them a menu's, each as wide
   as the widest. */
@media (width < 24rem) {
  .dictionary-row > :is(a, [aria-disabled='true']) {
    padding-inline: var(--space-2);
  }

  .dictionary-row > .segment-menu > summary {
    padding-inline: var(--space-1);
  }
}

/* A segment of a segmented row that opens a menu of links (#708), such as a
   Dictionary's in a Dictionary article's row where it has several articles on
   the subject: a menu (.menu), a disclosure, so that it opens, and its links
   work, without JavaScript. Its segment (the summary) is a segment as the
   row's others are (.segmented's), filled as the current one is where it is
   the current one (aria-current), with a small chevron after its words, a
   list's caret, which turns up while the menu is open. The menu drops under
   the row, over the page: from a segment in the row's start half, its start
   edge under the row's start; from one in its end half, which the page marks
   (.segment-menu-end), its end edge under the row's end; never wider than the
   row, so that it stays within the window as the row does. Under the row's first or last
   segment, that edge is the segment's own. It holds a small label, then a row
   a finger can hit for each link, in the row's words, the page's own filled
   as the row's current segment is (.segmented's). A row holding one lets the
   menu show outside it, so its end segments round their own outer corners. */

.segmented:has(> .segment-menu) {
  position: relative;
  overflow: visible;
}

.segmented:has(> .segment-menu) > :first-child,
.segmented:has(> .segment-menu) > :first-child > summary {
  border-start-start-radius: var(--radius-control);
  border-end-start-radius: var(--radius-control);
}

.segmented:has(> .segment-menu) > :last-child,
.segmented:has(> .segment-menu) > :last-child > summary {
  border-start-end-radius: var(--radius-control);
  border-end-end-radius: var(--radius-control);
}

/* Its segment fills it; where the row lays the segment out as a grid, its
   words and caret sit side by side in the middle. */
.segment-menu {
  display: grid;
}

.segment-menu > summary {
  grid-auto-flow: column;
  justify-content: center;
}

/* The chevron is a list's caret (select.input's) after the words, muted, or
   the current segment's colour where it is current. */
.segment-menu-caret {
  display: inline-block;
  vertical-align: middle;
  width: calc(var(--size-caret) + var(--size-caret));
  height: var(--size-caret);
  background-image: var(--gradient-caret-left), var(--gradient-caret-right);
  background-position: left center, right center;
  background-size: var(--size-caret) var(--size-caret);
  background-repeat: no-repeat;
  margin-inline-start: var(--space-1);
  color: var(--color-muted);
  transition: transform var(--duration-zoom);
}

.segment-menu > [aria-current='true'] > .segment-menu-caret {
  color: inherit;
}

.segment-menu[open] .segment-menu-caret {
  transform: var(--turn-over);
}

@media (prefers-reduced-motion: reduce) {
  .segment-menu-caret {
    transition: none;
  }
}

.segment-menu > .dropdown-panel {
  inset-inline: 0 auto;
  width: max-content;
  max-width: 100%;
  text-align: start;
}

.segment-menu-end > .dropdown-panel {
  inset-inline: auto 0;
}

.segment-menu .dropdown-label {
  padding: var(--space-1) var(--space-3) var(--space-2);
}

/* A sample of Bible text, framed, set as the Bible text is and cut to three
   lines, such as the verse being read over the Text size slider. */

.size-sample {
  padding: var(--space-3) var(--space-4);
  border: var(--width-border) solid var(--color-border);
  border-radius: var(--radius-inset);
  background: var(--color-surface);
}

.size-sample .scripture {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* A slider over a few sizes, such as the Website's Text size, between a small A
   and a large one. It is drawn here, not left to the browser, so that it looks
   the same everywhere and the marks under it sit under its stops
   (tokens.css): the track is filled up to the thumb, which the script places
   with --size-slider-at, its stop's share of the track (0 to 1). Under it is a
   mark at each stop, the default's taller, with a button back to it, in the
   wording's colour and bold while it is chosen (aria-pressed). In a
   right-to-left Language, the smallest stop is on the right. */

.size-slider {
  --size-slider-at: 0;
  --size-slider-towards: to right;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: var(--space-3);
  font-family: var(--font-scripture);
}

.size-slider:dir(rtl) {
  --size-slider-towards: to left;
}

.size-slider-smaller {
  font-size: var(--step--1);
  line-height: var(--line-height-tight);
}

.size-slider-larger {
  font-size: var(--step-2);
  line-height: var(--line-height-tight);
}

.size-slider input {
  --size-slider-stop: calc(var(--inset-slider-stop) + (100% - var(--size-slider-thumb)) * var(--size-slider-at));
  --size-slider-track: linear-gradient(var(--size-slider-towards), var(--color-accent-fill) var(--size-slider-stop), var(--color-border-strong) var(--size-slider-stop));
  appearance: none;
  width: 100%;
  min-width: 0;
  height: var(--size-target-min);
  margin: 0;
  background: transparent;
  cursor: pointer;
}

/* Each browser's parts are named apart, since a rule naming another's is dropped
   whole. */
.size-slider input::-webkit-slider-runnable-track {
  height: var(--height-slider-track);
  border-radius: var(--radius-pill);
  background: var(--size-slider-track);
}

.size-slider input::-moz-range-track {
  height: var(--height-slider-track);
  border-radius: var(--radius-pill);
  background: var(--size-slider-track);
}

.size-slider input::-webkit-slider-thumb {
  appearance: none;
  width: var(--size-slider-thumb);
  height: var(--size-slider-thumb);
  margin-top: var(--inset-slider-thumb);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent-fill);
  box-shadow: var(--shadow-1);
}

.size-slider input::-moz-range-thumb {
  width: var(--size-slider-thumb);
  height: var(--size-slider-thumb);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent-fill);
  box-shadow: var(--shadow-1);
}

.size-slider-marks {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  padding-inline: var(--inset-slider-mark);
}

/* A stop's mark is as wide as its line, and what hangs from it, the default's
   button, is centred under it. */
.size-slider-marks > * {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--width-focus);
}

.size-slider-marks > ::before {
  width: 100%;
  height: var(--space-x5);
  background: var(--color-border-strong);
  content: "";
}

.size-slider-marks > .size-slider-default::before {
  height: var(--space-x4);
  background: var(--color-muted);
}

.size-slider-default button {
  flex: none;
  min-height: var(--size-target-min);
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  line-height: var(--line-height--1);
  white-space: nowrap;
  cursor: pointer;
}

@media (hover: hover) {
  .size-slider-default button:hover {
    background: var(--color-hover);
  }
}

.size-slider-default button[aria-pressed='true'] {
  color: var(--color-text);
  font-weight: var(--weight-bold);
}

.badge {
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-hover);
  color: var(--color-muted);
  font-size: var(--step--1);
  line-height: var(--line-height--1);
  /* A pill wraps whole onto the next line, even with no space before it, as when
     Vue drops the line break between a name and its badges. */
  display: inline-block;
  white-space: nowrap;
}

/* A badge that wants the Editor's eye. */
.badge.attention {
  color: var(--color-warning);
  font-weight: var(--weight-medium);
}

/* A card that reports something, such as how the last Publish went. Its defaults for
   what it holds are :where()d, so a component inside it keeps its own look. */

.panel {
  max-width: var(--width-measure);
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface);
  border: var(--width-border) solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-1);
}

:where(.panel) h2 {
  margin: 0 0 var(--space-2);
}

:where(.panel) p {
  margin: var(--space-2) 0 0;
}

:where(.panel) > :first-child {
  margin-top: 0;
}

.panel.failed {
  border-color: var(--color-danger);
}

.panel.failed h2 {
  color: var(--color-danger);
}

/* A banner under a screen's heading, such as an import's progress or why it
   stopped: a panel with its words, and its buttons beside them as they fit. */

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-6);
}

.banner p {
  margin: 0;
}

/* A bar at the window's foot over a long list, such as the Topic screen's note on
   its last change to the Rank order: a raised panel
   that stays in view while the list is on screen, clear of a phone's home bar,
   its words and buttons wrapping. */

.foot-bar {
  position: sticky;
  bottom: calc(var(--space-4) + var(--inset-safe-bottom));
  max-width: var(--width-measure);
  margin-top: var(--space-4);
}

.foot-bar > .panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  box-shadow: var(--shadow-2);
}

.foot-bar > .panel p {
  margin: 0;
}

/* A workbench screen's bar of actions at the window's foot, below a desktop,
   such as the Passage screen's (ActionBar.vue): its sides the screen's, clear
   of a phone's home bar, a status line over a row of buttons. Centred, as the
   Reference resources screen's is, its lines and its one row are centred,
   closer to the screen's sides. */

.action-bar {
  position: fixed;
  inset: auto var(--inset-safe-right) 0 var(--inset-safe-left);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8) calc(var(--space-3) + var(--inset-safe-bottom));
  background: var(--color-surface);
  border-top: var(--width-border) solid var(--color-border);
  box-shadow: var(--shadow-2);
}

.action-bar.centred {
  align-items: center;
  padding-inline: var(--space-4);
  text-align: center;
}

@media (width < 48rem) {
  .action-bar {
    padding-inline: var(--space-4);
  }
}

/* What a screen shows when there is nothing to list. */

.empty {
  max-width: var(--width-measure);
  padding: var(--space-8);
  border: var(--width-border) dashed var(--color-border);
  border-radius: var(--radius-card);
  text-align: center;
}

:where(.empty) h2 {
  margin: 0 0 var(--space-2);
}

:where(.empty) p {
  margin: 0;
  color: var(--color-muted);
}

/* A pop-up over the screen, such as the photo picker or a Proposal's verses: a
   card over the dimmed screen, which Escape closes. Each sets its own size from a
   tablet up; on a phone it fills the window. */

.dialog {
  padding: var(--space-6);
  border: var(--width-border) solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-2);
}

.dialog::backdrop {
  background: var(--color-backdrop);
}

@media (width < 48rem) {
  dialog.dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: var(--space-4);
    border: none;
    border-radius: 0;
  }
}

/* A sheet: a pop-up of a few choices about one thing, such as Share's for a
   Passage (#145). On a phone it rises from the foot of the screen, only as tall
   as it needs, with a handle at its top; from a tablet up it is a small pop-up,
   the measure wide. Its head holds its title and its Close. */

.sheet {
  width: var(--width-measure);
  max-width: 100%;
}

@media (width < 48rem) {
  dialog.dialog.sheet {
    height: fit-content;
    margin-block: auto 0;
    padding-top: var(--space-6);
    padding-bottom: calc(var(--space-4) + var(--inset-safe-bottom));
    border-radius: var(--radius-card) var(--radius-card) 0 0;
  }

  dialog.sheet::before {
    position: absolute;
    top: var(--space-2);
    inset-inline: 0;
    width: var(--space-8);
    height: var(--space-1);
    margin-inline: auto;
    border-radius: var(--radius-pill);
    background: var(--color-border-strong);
    content: "";
  }

  .sheet[open] {
    animation: sheet-rise var(--duration-zoom) ease-out;
  }
}

@keyframes sheet-rise {
  from {
    transform: translateY(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet[open] {
    animation: none;
  }
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.dialog-head h2 {
  margin: 0;
  font-size: var(--step-1);
  line-height: var(--line-height-tight);
}

/* A Verse preview (#736): the verses of a reference in a text, such as a
   Dictionary article's, over the dimmed page, which a tap on the reference
   opens (the Website's verse-preview.js). Its head holds the Reference, in
   bold, and its Close. Its verses are set as the Bible's text, at its size
   (so they follow Text size), as the Verse panel's cross-references draw
   them, and scroll inside it with no scrollbar, fading at an edge where more
   are hidden (data-more-above, data-more-below). Below a rule at its foot is
   the Read link. It is only as tall as its verses need, at most
   --height-verse-panel-narrow and never past the window.

   From a tablet up it is a card --width-verse-preview wide, which its script
   places beside the reference (data-side): below or above it, its arrow
   pointing at it, or over the text, with none; always --space-4 from the
   window's edges and from the reference, the card's scroll margin, which the
   script reads. On a phone it is a sheet that rises from the foot of the
   window, over a bar there, with a handle at its top, and the page under it
   stays where it is. The reference it is open for is tinted
   (.verse-preview-current). */

.verse-preview {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: var(--width-verse-preview);
  max-width: 100%;
  max-height: min(var(--height-verse-panel-narrow), calc(100vh - var(--space-4) - var(--space-4)));
  margin: 0;
  padding: 0;
  border: var(--width-border) solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-2);
  font-family: var(--font-ui);
  scroll-margin: var(--space-4);
}

/* Open over the page where it already is, then placed by its script; its
   arrow stands out over its edge. */
dialog.verse-preview {
  position: absolute;
  inset: auto;
  overflow: visible;
}

dialog.verse-preview:not([open]) {
  display: none;
}

dialog.verse-preview::backdrop {
  background: var(--color-backdrop);
}

/* It takes the focus itself as it opens. */
.verse-preview:focus {
  outline: none;
}

.verse-preview:focus-visible {
  outline: var(--width-focus) solid var(--color-accent);
}

.verse-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-2) 0;
  padding-inline: var(--space-4) var(--space-2);
}

.verse-preview-title {
  margin: 0;
  font-size: var(--step-0);
  font-weight: var(--weight-bold);
  line-height: var(--line-height-tight);
  overflow-wrap: anywhere;
}

.verse-preview-close {
  flex: none;
}

.verse-preview-verses {
  min-height: 0;
  padding-block: var(--space-2) 0;
  padding-inline: var(--space-4);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.verse-preview-verses::-webkit-scrollbar {
  display: none;
}

.verse-preview-verses:focus-visible {
  outline: var(--width-focus) solid var(--color-accent);
  outline-offset: var(--offset-focus-inside);
}

.verse-preview-verses[data-more-below] {
  mask-image: var(--gradient-fade-bottom);
}

.verse-preview-verses[data-more-above] {
  mask-image: var(--gradient-fade-top);
}

.verse-preview-verses[data-more-above][data-more-below] {
  mask-image: var(--gradient-fade-both);
}

/* Its lines start at the start, however narrow the card, and a verse's
   number is as the Bible's text sets it (.verse-number). */
.verse-preview-verses .scripture {
  text-align: start;
}

.verse-preview-verses .scripture sup {
  font-size: var(--step-scripture-verse);
  font-weight: var(--weight-bold);
  line-height: 0;
}

/* Each run of verses after the first, as of a reference to verses 3 and 5–7,
   a little apart. */
.verse-preview-verses > * + .cross-reference-preview {
  margin-block-start: var(--space-3);
}

/* What it says besides the verses, each a line of its own: a verse the
   Translation leaves out, a book it doesn't include, or, muted, that the
   verses are loading or couldn't be. */
.verse-preview-verses > p {
  margin: var(--space-2) 0 0;
  font-size: var(--step--1);
  line-height: var(--line-height--1);
}

/* With nothing at its foot, such as a heading's notes with no link under
   them, its middle ends --space-4 clear of the card's bottom edge. */
.verse-preview-verses:has(+ .verse-preview-foot[hidden]) {
  padding-block-end: var(--space-4);
}

.verse-preview-foot {
  margin-block-start: var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-4);
  border-block-start: var(--width-border) solid var(--color-border);
}

.verse-preview-read {
  display: inline-block;
  min-height: var(--size-target-min);
  font-weight: var(--weight-medium);
}

/* The arrow, behind the card's words, the card's border running into it. */
.verse-preview-arrow {
  position: absolute;
  z-index: -1;
  display: none;
  box-sizing: border-box;
  width: var(--size-arrow);
  height: var(--size-arrow);
  border: var(--width-border) solid var(--color-border);
  background: var(--color-surface);
  transform: var(--turn-point);
}

.verse-preview[data-side='below'] .verse-preview-arrow {
  top: var(--inset-arrow);
  display: block;
  border-right-color: transparent;
  border-bottom-color: transparent;
}

.verse-preview[data-side='above'] .verse-preview-arrow {
  bottom: var(--inset-arrow);
  display: block;
  border-top-color: transparent;
  border-left-color: transparent;
}

.verse-preview-current {
  border-radius: var(--radius-control);
  background: var(--color-highlight);
  box-shadow: 0 0 0 var(--space-1) var(--color-highlight);
}

@media (width < 48rem) {
  dialog.verse-preview {
    position: fixed;
    inset: auto 0 0;
    width: auto;
    max-width: none;
    max-height: var(--height-verse-panel-narrow);
    padding-block: var(--space-3) var(--inset-safe-bottom);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
  }

  dialog.verse-preview::before {
    position: absolute;
    top: var(--space-2);
    inset-inline: 0;
    width: var(--space-8);
    height: var(--space-1);
    margin-inline: auto;
    border-radius: var(--radius-pill);
    background: var(--color-border-strong);
    content: "";
  }

  dialog.verse-preview[open] {
    animation: sheet-rise var(--duration-zoom) ease-out;
  }

  /* The page under the sheet stays where it is. */
  :root:has(dialog.verse-preview[open]) {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog.verse-preview[open] {
    animation: none;
  }
}

/* A heading with notes behind it (#754), such as an Epistle division's, a
   Part's or an Event's on a Chronological page: what is printed under the heading stands out of the
   reading, and a tap on the heading opens it in the Verse preview's card
   (the Website's heading-notes.js), its notes set as text there
   (.verse-preview-notes) and the link under them at its foot. The heading is
   a fold's summary: bold, with a mark after its words in the Theme's colour
   that says it opens, in a span with its last word or date that keeps
   together (.note-heading-end), so that it never stands on a line alone. The
   span wraps inside only when it is longer than a line, as a heading in a
   Language written without spaces is, all of it the span. Without a script,
   the fold opens its notes under it, set in from a rule. */
.note-heading > summary {
  display: block;
  min-height: var(--size-target-min);
  list-style: none;
  cursor: pointer;
}

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

.note-heading > summary:focus-visible {
  border-radius: var(--radius-control);
  outline: var(--width-focus) solid var(--color-accent);
}

.note-heading-words {
  font-weight: var(--weight-bold);
}

@media (hover: hover) {
  .note-heading > summary:hover :is(.note-heading-words, .note-heading-words .note-heading-end) {
    text-decoration: underline;
  }
}

.note-heading-end {
  display: inline-block;
  max-width: 100%;
}

.note-heading-mark {
  display: inline-block;
  margin-inline-start: var(--space-1);
  color: var(--color-accent);
  vertical-align: middle;
}

.note-heading-mark svg {
  display: block;
  width: var(--step-0);
  height: var(--step-0);
}

.note-heading-note {
  margin-block: var(--space-2) var(--space-4);
  padding-inline-start: var(--space-4);
  border-inline-start: var(--width-border) solid var(--color-border-strong);
  font-family: var(--font-ui);
  text-align: start;
}

.note-heading-note p,
.verse-preview-notes > p {
  margin: var(--space-2) 0 0;
  font-size: var(--step-0);
  line-height: var(--line-height-0);
}

.note-heading-note p:first-child,
.verse-preview-notes > p:first-child {
  margin-block-start: 0;
}

/* A list under a heading's notes, such as the groups of a Part of the
   Gospels' Events (#755), set as the notes are. */
.note-heading-note .bullets,
.verse-preview-notes > .bullets {
  margin: var(--space-2) 0 0;
  font-size: var(--step-0);
  line-height: var(--line-height-0);
}

.note-heading-read a {
  display: inline-block;
  min-height: var(--size-target-min);
  font-weight: var(--weight-medium);
}

/* Previous and Next in words (#754), at the foot of a page of a series, such
   as the Chronological pages: each names the page it leads to, Previous at
   the start and Next at the end, over a muted word saying which it is, and
   wraps, however long the name. */
.pager {
  display: flex;
  gap: var(--space-4);
  margin-block-start: var(--space-12);
  padding-block-start: var(--space-4);
  border-block-start: var(--width-border) solid var(--color-border);
  font-family: var(--font-ui);
}

.pager a {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  min-height: var(--size-target-min);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.pager-next {
  align-items: flex-end;
  text-align: end;
}

.pager-name {
  font-weight: var(--weight-medium);
}

@media (hover: hover) {
  .pager a:hover .pager-name {
    text-decoration: underline;
  }
}

/* A picture shown as a shared link's preview shows it, such as a Passage card in
   Share's sheet: the picture, then the link's title and its site. */
.share-preview {
  margin: 0;
  overflow: hidden;
  border: var(--width-border) solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.share-preview img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ratio-photo);
}

.share-preview figcaption {
  display: grid;
  padding: var(--space-2) var(--space-3);
  font-size: var(--step--1);
  line-height: var(--line-height--1);
}

.share-preview figcaption span {
  color: var(--color-muted);
}

/* The ways to send something, side by side, sharing the width equally; one that
   doesn't fit goes to a line of its own. Each names its way with an icon. Under
   them, once one is used, a note says what it did and what to do next, such as
   where to paste a copied link, after a check; or, in the danger colour, that
   it couldn't. */
.share-choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.share-choices .button {
  flex: 1 1 0;
  gap: var(--space-2);
}

.share-choices svg {
  width: var(--step-1);
  height: var(--step-1);
}

.share-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
}

.share-note svg {
  flex: none;
  width: var(--step-1);
  height: calc(var(--step-0) * var(--line-height-0));
  color: var(--color-success);
}

.share-note.failed {
  color: var(--color-danger);
}

/* A choice just done, such as Copy link, turns green with a check for a moment. */
.share-choices .button.done {
  border-color: var(--color-success);
  background: var(--color-surface);
  color: var(--color-success);
}

/* A whole row that opens something, such as a Proposal on the Research screen:
   as tall as a finger needs, it takes the hover colour, and its words sit in a
   line that wraps. */

.row-button {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-3);
  width: 100%;
  min-height: var(--size-target);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

@media (hover: hover) {
  .row-button:hover {
    background: var(--color-hover);
  }
}

/* A disclosure that opens more of a report, such as a Language's readiness or a
   Names list's verses: its summary is a line to tap, never too small. */
.disclosure > summary {
  min-height: var(--size-target-min);
  padding-block: var(--space-2);
  cursor: pointer;
}

/* A table of records, such as the Topics. */

.data-table {
  width: 100%;
  max-width: var(--width-measure);
  border-collapse: separate;
  border-spacing: 0;
  background: var(--color-surface);
  border: var(--width-border) solid var(--color-border);
  border-radius: var(--radius-card);
}

.data-table th,
.data-table td {
  padding: var(--space-2) var(--space-4);
  border-bottom: var(--width-border) solid var(--color-border);
  text-align: left;
}

.data-table th {
  color: var(--color-muted);
  font-size: var(--step--1);
  line-height: var(--line-height--1);
  font-weight: var(--weight-medium);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

@media (hover: hover) {
  .data-table tbody tr:hover {
    background: var(--color-hover);
  }
}

.data-table .number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* A link in a cell, such as a Topic's name, is never too small to tap, however
   short its words. */
.data-table td a {
  display: inline-block;
  min-width: var(--size-target-min);
  color: var(--color-text);
}

@media (hover: hover) {
  .data-table td a:hover {
    color: var(--color-accent);
  }
}

/* A link that looks like a button that looks like a link, such as a Backup's
   Download, keeps that look in a table. */
.data-table td a.link-button {
  color: var(--color-accent);
  text-decoration: underline;
}

@media (hover: hover) {
  .data-table td a.link-button:hover {
    color: var(--color-accent-strong);
  }
}

/* A column the table can be sorted by: its heading is a button, and the column it
   is sorted by has aria-sort. */
.data-table .sort {
  min-height: var(--size-target-min);
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.data-table th[aria-sort] .sort {
  color: var(--color-text);
}

@media (hover: hover) {
  .data-table .sort:hover {
    color: var(--color-text);
  }
}

/* The row's actions, such as Edit and Delete, at its end. */
.data-table .actions {
  white-space: nowrap;
  text-align: right;
}

.data-table .actions > :is(a, button) {
  display: inline-block;
}

.data-table .actions > * + * {
  margin-left: var(--space-3);
}

/* Narrower than a tablet, each row is a card: its first cell its heading, every
   other cell labelled with its column's name, which the cell carries in
   data-label, such as "Search Volume 1,200", and the row's actions at its foot.
   An empty cell is left out. A row that says more about the row above it, such
   as a question about restoring a Backup, is a .detail row: it has no card of its
   own. A header that sorts the table becomes a row of its sort buttons above the
   cards; any other header is left out. */
@media (width < 48rem) {
  .data-table,
  .data-table :is(thead, tbody, tr, th, td) {
    display: block;
  }

  .data-table {
    border: none;
    background: none;
  }

  .data-table thead:not(:has(.sort)) {
    display: none;
  }

  .data-table thead tr {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
  }

  .data-table th {
    padding: 0;
    border: none;
  }

  .data-table .sort {
    padding: var(--space-1) var(--space-3);
    border: var(--width-border) solid var(--color-border);
    border-radius: var(--radius-control);
    background: var(--color-surface);
    color: var(--color-text);
  }

  .data-table th[aria-sort] .sort {
    background: var(--color-accent-soft);
    color: var(--color-accent);
  }

  .data-table tbody {
    display: grid;
    gap: var(--space-3);
  }

  .data-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-4);
    border: var(--width-border) solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
  }

  .data-table tbody tr.detail {
    padding: 0;
    border: none;
    background: none;
  }

  .data-table td {
    padding: 0;
    border: none;
  }

  .data-table tr:not(.detail) td:first-child {
    font-weight: var(--weight-bold);
  }

  .data-table td:first-child :is(.badge, .muted, .note) {
    font-weight: var(--weight-regular);
  }

  .data-table td:empty {
    display: none;
  }

  .data-table td[data-label]::before {
    margin-right: var(--space-2);
    color: var(--color-muted);
    font-size: var(--step--1);
    line-height: var(--line-height--1);
    font-weight: var(--weight-regular);
    content: attr(data-label);
  }

  .data-table .number {
    text-align: left;
  }

  .data-table .actions {
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: var(--width-border) solid var(--color-border);
    white-space: normal;
    text-align: left;
  }
}

/* A form's field: its label (or, for a group of controls, its legend) over its
   control, with a note or an error under it. */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
}

.field > :is(label, legend) {
  padding: 0;
  font-weight: var(--weight-medium);
}

:where(.field) p {
  margin: 0;
}

/* A box to type in, or to choose from a list in. */
.input {
  padding: var(--space-2) var(--space-3);
  border: var(--width-border) solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.input[aria-invalid='true'] {
  border-color: var(--color-danger);
}

/* A list to choose from draws its own caret, a chevron in its words' colour, as
   far from its right edge as its words are from its left: the browser's own
   would sit against the border, whatever the padding. */
select.input {
  appearance: none;
  padding-right: calc(var(--space-2) + var(--size-caret) + var(--size-caret) + var(--space-3));
  background-image: var(--gradient-caret-left), var(--gradient-caret-right);
  background-position: right calc(var(--space-3) + var(--size-caret)) center, right var(--space-3) center;
  background-size: var(--size-caret) var(--size-caret);
  background-repeat: no-repeat;
}

/* A box to tick, with its label beside it. */
.checkbox {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-weight: var(--weight-medium);
}

.checkbox input {
  accent-color: var(--color-accent);
}

/* A row of boxes to tick (#675), such as the Dictionary page's choice of
   Dictionaries: its boxes in one centred line that wraps where it must, and
   nothing else to see, the group named by a legend for a screen reader alone
   (.visually-hidden, #729). Each label is a finger's height, so that the whole
   of it is the target, beside a box of the smallest target's size; a box that
   can't be changed is greyed as the browser greys a disabled one. */

.checkbox-row {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
}

.checkbox-row-boxes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 var(--space-4);
}

.checkbox-row .checkbox {
  align-items: center;
  min-height: var(--size-target);
  cursor: pointer;
}

.checkbox-row .checkbox input {
  width: var(--size-target-min);
  height: var(--size-target-min);
  margin: 0;
  cursor: inherit;
}

.checkbox-row .checkbox:has(input:disabled) {
  cursor: default;
}

/* A search: its field, and its button beside it, of one height that a finger can
   tap. */

.search-field {
  display: flex;
  gap: var(--space-2);
  min-height: var(--size-target);
}

.search-field input {
  flex: 1;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border: var(--width-border) solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.search-field input::placeholder {
  color: var(--color-muted);
}

/* Chips: a pill per Topic, such as the App's Similar Topics, its words a step
   below the body's. A chip is drawn smaller than a finger needs, about 35px tall
   on a phone, so an invisible ::after reaches out to --size-target; the gap
   between rows keeps those reaches apart. Pointing at a chip turns its words
   the accent colour, as links do; its border and fill stay as they are. */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: var(--size-chip);
  padding: 0 var(--space-3);
  border: var(--width-border) solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: var(--step--1);
  line-height: var(--line-height-tight);
  text-decoration: none;
  cursor: pointer;
}

.chip::after {
  position: absolute;
  inset: var(--inset-target) 0;
  content: "";
}

@media (hover: hover) {
  .chip:hover {
    color: var(--color-accent);
  }
}

/* Word links: links set as centred lines of words, such as the homepage's Groups'
   Topics, at the body's size, with a grey dot between one and the next on the
   same line. A script marks each link that follows another on its line
   (.word-link-after); only those have a dot, in the gap before them, so that no
   line starts or ends with one, and without the script there are none. A short
   word still reaches --size-target-min each way. Pointing at a link turns its
   words the accent colour, underlined. */

.word-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--step-0);
  line-height: var(--line-height-0);
}

.word-links li {
  position: relative;
}

.word-link-after::before {
  position: absolute;
  inset-inline-end: 100%;
  width: var(--space-4);
  color: var(--color-muted);
  text-align: center;
  content: "·";
}

.word-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--size-target-min);
  min-height: var(--size-target-min);
  color: var(--color-text);
  text-underline-offset: var(--space-1);
}

@media (hover: hover) {
  .word-links a:hover {
    color: var(--color-accent);
  }
}

/* A photo card: a Topic's name over its photo's darkened foot, all one link, such
   as the homepage's "Most Searched Topics". It is 3 × 2 unless its layout gives it a
   height, and its name keeps its size against the card. Pointing at it zooms its
   photo a little; the name stays white. */

.photo-card {
  position: relative;
  display: block;
  overflow: hidden;
  height: 100%;
  aspect-ratio: var(--ratio-card);
  border-radius: var(--radius-card);
  background: var(--color-hover);
  color: var(--color-on-photo);
  text-decoration: none;
  container-type: inline-size;
}

@media (hover: hover) {
  .photo-card:hover {
    color: var(--color-on-photo);
  }
}

.photo-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-zoom);
}

@media (hover: hover) {
  .photo-card:hover img {
    transform: var(--zoom-photo);
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-card img {
    transition: none;
  }
}

.photo-card-name {
  position: absolute;
  inset: auto 0 0;
  padding: var(--space-8) var(--space-3) var(--space-3);
  background: var(--gradient-photo-foot);
  font-size: var(--text-on-card);
  font-weight: var(--weight-bold);
  line-height: var(--line-height-tight);
  text-shadow: var(--shadow-text);
}

/* Folder tabs: the open tab joined to a white panel under it, whose contents
   start as far below the tab as they are from the panel's sides; the others
   outlined on the tint they sit on, such as a band of --color-accent-soft. A tab
   is a control, and the panel a card whose corner under the first tab is square.
   Pointing at a closed tab turns its words the accent colour; its border stays
   as it is. */

.folder-tab-list {
  display: flex;
  align-items: flex-end;
  gap: var(--space-1);
}

.folder-tab {
  position: relative;
  min-height: var(--size-target);
  padding: var(--space-2) var(--space-4);
  border: var(--width-border) solid var(--color-border-strong);
  border-bottom: 0;
  border-radius: var(--radius-control) var(--radius-control) 0 0;
  background: var(--color-surface-faint);
  color: var(--color-text);
  font: inherit;
  font-weight: var(--weight-bold);
  line-height: var(--line-height-tight);
  cursor: pointer;
}

@media (hover: hover) {
  .folder-tab:hover {
    color: var(--color-accent);
  }
}

/* The open tab sits over the panel's top border, joining the two. */
.folder-tab[aria-selected='true'],
.folder-tab[aria-selected='true']:hover {
  z-index: 1;
  top: var(--width-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.folder-tab-panel {
  padding: var(--space-4);
  border: var(--width-border) solid var(--color-border-strong);
  border-radius: 0 var(--radius-card) var(--radius-card) var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-1);
}

@media (width >= 48rem) {
  .folder-tab-panel {
    padding: var(--space-6);
  }
}

/* Folder tabs that fill a phone's width, such as the homepage's search: each tab
   as wide as the others and all of one height, their words on two lines where
   they must, reaching both ends, so the panel's top corners are square. A tab
   may name itself at length from the tablet width up, and briefly on a phone. */
.folder-tab-short {
  display: none;
}

@media (width < 48rem) {
  .folder-tabs.fill .folder-tab-list {
    align-items: stretch;
  }

  .folder-tabs.fill .folder-tab {
    flex: 1;
    padding-inline: var(--space-2);
  }

  .folder-tabs.fill .folder-tab-panel {
    border-radius: 0 0 var(--radius-card) var(--radius-card);
  }

  .folder-tab-long {
    display: none;
  }

  .folder-tab-short {
    display: inline;
  }
}

/* Small capitals, such as a Period's name over its title. */
.small-caps {
  font-variant-caps: all-small-caps;
  letter-spacing: var(--tracking-small-caps);
}

/* A time line: one line running down the page, with a filled point on it for
   each of the eras it lists, an open point for each of their parts, and a
   short tick for each heading a part folds open to, such as the Chronological
   Bible's contents page. Each row (.timeline-row) holds its date
   (.timeline-when), its point or tick, and its words (.timeline-body). From
   the timeline breakpoint (525px) up the dates sit in a margin to the line's
   left; below it the margin goes, and each date follows its words, muted
   (.timeline-when-inline). A part's fold is a <details class="timeline-fold">
   whose summary is its row, with an arrow; a part with nothing inside is a
   row that is a link, drawn as the folds are. A heading over the rows after
   it, such as a Portion, is .timeline-label, and those rows,
   .timeline-grouped, stand in from it; a lesser row under a heading, such as
   an Epistle division that starts a page, is .timeline-minor. A row shows at
   most two lines; a screen reader reads it whole. Its links are in the
   text's colour, underlined. The one row a visitor is shown they stopped at,
   such as where the Chronological Bible's Continue leads, is .timeline-here:
   highlighted, with a line under it saying so (.timeline-line). */
.timeline,
.timeline ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline {
  --timeline-when: 0px;
  position: relative;
}

@media (width >= 32.8125rem) {
  .timeline {
    --timeline-when: var(--width-timeline-when);
  }
}

/* The line, down the middle of the points' column. */
.timeline::before {
  position: absolute;
  inset-block: 0;
  left: calc(var(--timeline-when) + var(--inset-timeline-line));
  width: var(--width-focus);
  background: var(--color-border-strong);
  content: '';
  transform: translateX(var(--shift-half));
}

.timeline-row {
  display: grid;
  grid-template-columns: var(--timeline-when) var(--width-timeline-mark) minmax(0, 1fr);
  align-items: baseline;
}

.timeline-row > .timeline-when {
  grid-column: 1;
}

.timeline-row > :is(.timeline-point, .timeline-tick) {
  grid-column: 2;
  align-self: stretch;
}

.timeline-row > .timeline-body {
  grid-column: 3;
  line-height: var(--line-height-0);
}

.timeline-when {
  padding-inline-end: var(--space-3);
  color: var(--color-muted);
  font-size: var(--step--1);
  line-height: var(--line-height--1);
  text-align: end;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.timeline-when-inline {
  color: var(--color-muted);
  font-size: var(--step--1);
  line-height: var(--line-height--1);
  font-variant-numeric: tabular-nums;
}

@media (width >= 32.8125rem) {
  .timeline-when-inline {
    display: none;
  }
}

@media (width < 32.8125rem) {
  .timeline-when {
    display: none;
  }
}

/* A point, centred on the line level with its row's first line. */
.timeline-point,
.timeline-tick {
  position: relative;
}

.timeline-point::before,
.timeline-tick::before {
  position: absolute;
  top: var(--inset-timeline-point);
  inset-inline: 0;
  width: var(--space-3);
  height: var(--space-3);
  margin-inline: auto;
  border: var(--width-focus) solid var(--color-accent);
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  content: '';
  transform: translateY(var(--shift-half));
}

.timeline-point-filled::before {
  width: var(--space-4);
  height: var(--space-4);
  background: var(--color-accent);
}

.timeline-tick::before {
  inset-inline: var(--inset-timeline-line) auto;
  width: var(--space-2);
  height: var(--width-focus);
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--color-border-strong);
}

/* An era: its date in the accent colour, its name in the heading's size,
   under its label where it has one, the date and the point level with its
   first line. */
.timeline > li + li {
  margin-top: var(--space-6);
}

.timeline-era-row {
  margin-bottom: var(--space-3);
}

.timeline-era-row > .timeline-when {
  color: var(--color-accent);
  font-weight: var(--weight-bold);
}

.timeline-era-row > .timeline-point::before {
  top: var(--inset-timeline-era);
}

.timeline-era-row:has(.small-caps) > .timeline-point::before {
  top: var(--inset-timeline-label);
}

.timeline-era-row > .timeline-body {
  padding-inline-start: var(--width-timeline-arrow);
}

.timeline-title {
  margin: 0;
  font-size: var(--step-1);
  line-height: var(--line-height-tight);
}

.timeline-title > .small-caps {
  display: block;
  color: var(--color-accent);
  font-size: var(--step-0);
  line-height: var(--line-height-tight);
}

.timeline-era-row .timeline-when-inline {
  display: block;
}

@media (width >= 32.8125rem) {
  .timeline-era-row .timeline-when-inline {
    display: none;
  }
}

/* A part's row, a fold or a link drawn as a fold, its words after its
   arrow's place. */
.timeline-fold > summary {
  list-style: none;
  cursor: pointer;
}

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

.timeline-fold > summary,
.timeline-parts > li > .timeline-row {
  min-height: var(--size-target);
  padding-block: var(--space-1);
  border-radius: var(--radius-control);
}

.timeline-parts > li > a.timeline-row {
  color: inherit;
  text-decoration: none;
}

@media (hover: hover) {
  .timeline-fold > summary:hover,
  .timeline-parts > li > a.timeline-row:hover {
    background: var(--color-hover);
  }
}

.timeline-fold > summary:focus-visible,
.timeline-parts > li > a.timeline-row:focus-visible {
  outline: var(--width-focus) solid var(--color-accent);
}

.timeline-parts .timeline-body {
  padding-inline-start: var(--width-timeline-arrow);
}

.timeline-name {
  font-weight: var(--weight-medium);
}

.timeline-chevron {
  display: inline-block;
  width: var(--width-timeline-arrow);
  margin-inline-start: var(--inset-timeline-arrow);
  color: var(--color-accent);
}

.timeline-chevron::before {
  content: '▸';
}

.timeline-fold[open] > summary .timeline-chevron::before {
  content: '▾';
}

/* The headings a part folds open to. */
.timeline-items {
  padding-block: var(--space-1) var(--space-3);
}

.timeline-items > li {
  padding-block: var(--space-1);
}

.timeline-items a {
  display: -webkit-box;
  min-height: var(--size-target-min);
  overflow: hidden;
  color: var(--color-text);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (hover: hover) {
  .timeline-items a:hover {
    color: var(--color-accent-strong);
  }
}

.timeline-here {
  background: var(--color-highlight);
  border-radius: var(--radius-control);
}

.timeline-line {
  display: block;
  color: var(--color-muted);
  font-size: var(--step--1);
  line-height: var(--line-height--1);
}

.timeline-label > .timeline-body {
  padding-top: var(--space-3);
  font-weight: var(--weight-bold);
}

.timeline-label a {
  text-decoration: none;
}

.timeline-grouped > .timeline-body {
  padding-inline-start: calc(var(--width-timeline-arrow) + var(--space-4));
}

.timeline-label > .timeline-tick::before {
  display: none;
}

.timeline-minor > .timeline-body {
  font-size: var(--step--1);
  line-height: var(--line-height--1);
}

.timeline-minor a {
  color: var(--color-muted);
}

/* An accordion: a row per part, such as the homepage's Groups, each with its name,
   a count and a chevron, and the open row's contents directly under it. A closed
   row is a control, and an open one a card. */

.accordion {
  display: grid;
  gap: var(--space-2);
}

.accordion-item {
  overflow: hidden;
  border: var(--width-border) solid var(--color-border-strong);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  box-shadow: var(--shadow-1);
}

.accordion-item:has([aria-expanded='true']) {
  border-radius: var(--radius-card);
}

:where(.accordion-item) h3 {
  margin: 0;
}

.accordion-button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--size-target);
  padding: var(--space-2) var(--space-4);
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-weight: var(--weight-bold);
  line-height: var(--line-height-tight);
  text-align: left;
  cursor: pointer;
}

@media (hover: hover) {
  .accordion-button:hover {
    background: var(--color-hover);
  }
}

/* The row clips its corners, so its focus ring is drawn inside it. */
.accordion-button:focus-visible {
  box-shadow: inset 0 0 0 var(--width-focus) var(--color-accent);
}

.accordion-name {
  flex: 1;
}

.accordion-count {
  color: var(--color-muted);
  font-size: var(--step--1);
  font-weight: var(--weight-regular);
  line-height: var(--line-height-tight);
  font-variant-numeric: tabular-nums;
}

.accordion-chevron {
  width: var(--space-6);
  color: var(--color-accent);
  font-size: var(--step-2);
  line-height: var(--line-height-tight);
  text-align: center;
}

.accordion-chevron::before {
  content: "▸";
}

[aria-expanded='true'] > .accordion-chevron::before {
  content: "▾";
}

/* A fold within a fold, such as a field of About [Book] in the Guide, has a
   hollow arrow. */
.accordion-chevron-hollow {
  color: transparent;
  -webkit-text-stroke: var(--width-border) var(--color-accent);
}

.accordion-panel {
  padding: var(--space-3) var(--space-4) var(--space-4);
}

/* Bullets: a list each of whose lines (.bullet) starts with a grey bullet,
   such as the Guide's Topics, Spurgeon Sermons and Outline sections. The
   bullet sits --bullet-at in from the line's start, which the list may set,
   so that a tint behind the line, such as a chosen Topic's, holds it too.
   Its words follow it, and a wrapped line hangs after it, as does a line that
   goes with one (.bullet-hang), such as a chosen Topic's stops. A screen
   reader doesn't read the bullet, as it doesn't a list's. */
.bullets {
  --bullet-at: 0px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bullet,
.bullet-hang {
  padding-inline-start: calc(var(--bullet-at) + var(--space-3));
}

.bullet {
  position: relative;
}

.bullet::before {
  position: absolute;
  inset-inline-start: var(--bullet-at);
  color: var(--color-muted);
  font-style: normal;
  content: '•' / '';
}

/* An index by letter, such as the Topics by letter: two rows of 13 at every
   width (#729), each letter wide enough to tap. One letter may be the current
   page's, and a letter with nothing under it links nowhere. Below a tablet the
   gaps between letters close, as 13 wouldn't fit with them at every width, and
   below the narrow breakpoint the index reaches out over the page's side
   margins (--inset-gutter), so that each letter stays at least the smallest
   target wide: just over 24px at 320px. */

.letter-index {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: var(--space-1);
}

@media (width < 48rem) {
  .letter-index {
    column-gap: 0;
  }
}

@media (width < 24rem) {
  .letter-index {
    margin-inline: var(--inset-gutter);
  }
}

.letter-index :is(a, span) {
  padding: var(--space-1) 0;
  border-radius: var(--radius-control);
  font-weight: var(--weight-medium);
  text-align: center;
  text-decoration: none;
}

@media (hover: hover) {
  .letter-index a:hover {
    background: var(--color-hover);
  }
}

.letter-index a[aria-current='page'] {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.letter-index span {
  color: var(--color-muted);
  opacity: var(--opacity-disabled);
}

/* The Website's list of Topics, each name centred in its column. A short name
   is still wide enough to tap. */

.topic-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.topic-list a {
  display: inline-block;
  min-width: var(--size-target-min);
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* The Dictionary page's list of articles (#731): a line for each, the whole
   line its link, under a thin rule, the title at its start and its
   Dictionary's short name at its end, small and muted, never underlined. The
   names in a column line up, each title taking the rest of the line. A
   bracketed part of a title (.article-list-qualifier), such as "(Lutheran
   Doctrine)", is in the name's smaller size, and a title that wraps indents
   its later lines. One column, then two from the tablet breakpoint, filled
   row by row, so that two lines side by side share a height and their rules
   line up. Under the pointer the line lights up and its title is
   underlined. */

.article-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (width >= 48rem) {
  .article-list {
    grid-template-columns: minmax(0, 1fr) auto var(--space-3) minmax(0, 1fr) auto;
  }

  .article-list > li:nth-child(odd) {
    grid-column: 1 / span 2;
  }

  .article-list > li:nth-child(even) {
    grid-column: 4 / span 2;
  }
}

.article-list > li {
  display: grid;
  grid-column: span 2;
  grid-template-columns: subgrid;
  border-bottom: var(--width-border) solid var(--color-border);
}

.article-list a {
  display: grid;
  grid-column: span 2;
  grid-template-columns: subgrid;
  align-items: baseline;
  min-height: var(--size-target-min);
  padding-block: var(--space-2);
  text-decoration: none;
}

.article-list-title {
  padding-inline-start: var(--indent-hanging);
  overflow-wrap: anywhere;
  text-indent: var(--indent-hanging-first);
}

.article-list-qualifier {
  font-size: var(--step--1);
  line-height: var(--line-height--1);
}

.article-list-label {
  justify-self: end;
  color: var(--color-muted);
  font-size: var(--step--1);
  line-height: var(--line-height--1);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

@media (hover: hover) {
  .article-list a:hover {
    background: var(--color-hover);
  }

  .article-list a:hover .article-list-title {
    text-decoration: underline;
  }
}

/* Passages and Bible text, as on the old site: the Reference in Yantramanav, then
   the verses in PT Serif, justified, with small bold verse numbers. */

.passages {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The Passage a Passage link opens its Topic's page at (#143): tinted as the
   verses a chapter page is opened at are, the tint reaching a little past its
   words without moving them. */
.passage.linked {
  border-radius: var(--radius-control);
  background: var(--color-highlight);
  box-shadow: 0 0 0 var(--space-3) var(--color-highlight);
}

.passage-reference {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--step-scripture-reference);
  font-weight: var(--weight-bold);
  line-height: var(--line-height-tight);
}

/* A Reference that opens its Passage, as in the App's list of a Topic's Passages. */
.passage-reference a {
  color: inherit;
}

@media (hover: hover) {
  .passage-reference a:hover {
    color: var(--color-accent);
  }
}

/* A Passage with its actions, as on the Website's Topic pages (#144): Read in
   context, Share and Copy, as icons on its Reference's line, at its right,
   centred on it. Its Reference is a button that shows them: where it and the
   icons don't fit across, as for the longest
   References on the narrowest phones, the icons drop to a line of their own under
   it, at the left. The Reference grows to fill its line, which puts the icons at
   the right beside it and at the left under it; a negative margin lines the first
   icon's symbol up with the Reference's first letter. The Passage itself is
   never tinted or marked: with a mouse the icons are always laid out, unseen
   until the Passage is pointed at or focused, or chosen from the keyboard, so
   nothing moves; by touch only the chosen Passage shows them, at a finger's
   size, and its line grows to hold them. */
.passage:has(> .passage-actions) {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: var(--space-3);
}

.passage:has(> .passage-actions) > :not(.passage-reference, .passage-actions) {
  flex: 1 0 100%;
}

.passage:has(> .passage-actions) > .passage-reference {
  flex: 1 0 auto;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* The Reference's button is never under a control's least height, even where
   its line is (a phone's 23px). */
.passage-select {
  max-width: 100%;
  min-height: var(--size-target-min);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  vertical-align: top;
}

.passage-actions {
  display: flex;
  flex: 0 0 auto;
  gap: var(--space-1);
}

.passage-actions .icon-button {
  color: var(--color-muted);
}

@media (hover: hover) {
  .passage-actions {
    margin-block: var(--inset-reference-chip);
    margin-inline-start: var(--inset-icon-chip);
    transition: opacity var(--duration-zoom);
  }

  .passage:not(:hover, :focus-within, .chosen) > .passage-actions {
    opacity: 0;
  }

  .passage-actions .icon-button:hover {
    color: var(--color-accent);
  }
}

@media (hover: none) {
  .passage-actions {
    display: none;
  }

  .passage.chosen > .passage-actions {
    display: flex;
    margin-top: var(--inset-reference-target);
    margin-inline-start: var(--inset-icon-target);
  }

  .passage-actions .icon-button {
    width: var(--size-target);
    height: var(--size-target);
    color: var(--color-text);
  }
}

/* An action just done, such as Copy, turns green with a check for a moment. */
.passage-actions .icon-button.done,
.passage-actions .icon-button.done:hover {
  color: var(--color-success);
}

@media (prefers-reduced-motion: reduce) {
  .passage-actions {
    transition: none;
  }
}

/* A rail: a thin strip in the place of something that has nothing to show
   there, such as a Gospel that tells nothing of an Event in the Harmony's
   columns (#757): as wide as a finger's target, tinted as a surface with a
   fine border, its name written down it, muted, clear of its top. It is no
   control, and a screen reader skips it (aria-hidden). Its words run down,
   so its inline padding is at its top and foot. */
.rail {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: var(--size-target);
  padding-inline: var(--space-3);
  border: var(--width-border) solid var(--color-border);
  border-radius: var(--radius-inset);
  background: var(--color-surface);
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  line-height: var(--line-height--1);
  writing-mode: vertical-rl;
  white-space: nowrap;
}

/* Words for a screen reader alone, such as what a Passage's Copy has done, or
   the legend of the Dictionary page's choice (#729), whose padding the browser
   would otherwise keep. */
.visually-hidden {
  position: absolute;
  width: var(--size-unseen);
  height: var(--size-unseen);
  padding: 0;
  overflow: hidden;
  clip-path: inset(100%);
  white-space: nowrap;
}

/* A word wider than its line, as a long Tamil word is in a phone's window,
   breaks between its letters, never inside a letter with its signs, rather than
   widen the page. Any other word wraps as it always has. */
.scripture {
  margin: 0;
  font-family: var(--font-scripture);
  font-size: var(--step-scripture);
  line-height: var(--line-height-scripture);
  text-align: var(--align-scripture);
  overflow-wrap: anywhere;
}

/* The Related Topics beside a Passage. */
.related-topics {
  margin: var(--space-2) 0 0;
  color: var(--color-muted);
  font-size: var(--step--1);
  line-height: var(--line-height--1);
}

.verse-number {
  font-size: var(--step-scripture-verse);
  font-weight: var(--weight-bold);
  line-height: 0;
  vertical-align: super;
}

/* Each source line contains its verse fragments, so a paragraph can continue
   across verses in either layout. Character spans add no extra whitespace. */
.source-line {
  display: block;
}

.source-line:is([data-paragraph], [data-space], [data-kind='title']) {
  margin-block-start: var(--space-2);
}

/* A title, such as a Psalm's "A Psalm of David." or an acrostic's "ALEPH",
   starts at the left edge of the line after it (past a second title, such as
   "BOOK I" over a Psalm's), so that it lines up with the verse it heads. */
.source-line[data-kind='title'] {
  text-align: start;
}

.source-line:is([data-style='q1'], [data-style='li1']),
.source-line[data-kind='title']:has(
  + :is([data-style='q1'], [data-style='li1']),
  + [data-kind='title'] + :is([data-style='q1'], [data-style='li1'])
) {
  padding-inline-start: var(--space-3);
  text-align: start;
}

.source-line:is([data-style='q2'], [data-style='li2']),
.source-line[data-kind='title']:has(
  + :is([data-style='q2'], [data-style='li2']),
  + [data-kind='title'] + :is([data-style='q2'], [data-style='li2'])
) {
  padding-inline-start: var(--space-4);
  text-align: start;
}

.source-line[data-style='q3'] {
  padding-inline-start: var(--space-8);
  text-align: start;
}

.source-line[data-style='qr'] {
  text-align: end;
}

.source-line:is([data-style='pc'], [data-style='qc']):not([data-kind='title']) {
  text-align: center;
}

.source-line:is([data-style='pmo'], [data-style='pi1'], [data-style='mi']) {
  padding-inline: var(--space-3);
}

/* An imported article's text, such as a Dictionary article's (#317), as the
   Website shows it and the App's screens show it: in the Bible text's serif, at
   its size and line height, with its headings and tables in the site's font. A
   list item's paragraphs sit closer than the article's, and a quotation is set
   in from a rule. A table scrolls sideways in its own box, never the page. */
.article-text {
  font-family: var(--font-scripture);
  font-size: var(--step-scripture);
  line-height: var(--line-height-scripture);
  overflow-wrap: break-word;
}

.article-text :is(h2, h3) {
  font-family: var(--font-ui);
}

.article-text h2 {
  margin: var(--space-8) 0 var(--space-2);
}

.article-text h3 {
  margin: var(--space-6) 0 var(--space-2);
}

.article-text [id] {
  scroll-margin-top: var(--space-4);
}

.article-text li + li {
  margin-top: var(--space-2);
}

.article-text li > p {
  margin: 0;
}

.article-text li > p + p {
  margin-top: var(--space-2);
}

.article-text blockquote {
  margin: var(--space-4) 0;
  padding-inline-start: var(--space-4);
  border-inline-start: var(--space-1) solid var(--color-border-strong);
}

/* A text set as a printed book is, with .article-text, such as a sermon's
   (#519), as the Spurgeon Gems editions set it: each of its paragraphs (one
   at its top, or in a block at its top, such as a split paragraph's parts)
   starts its first line indented, with no space between them, its lines
   justified as Bible text's are, so ragged from 127% Text size. A hymn or
   poem in it is .book-hymn; headings, lists and quotations keep
   .article-text's. What it holds is :where()d, so that a page can set a block
   of its own otherwise. */
:where(.book-text) > p,
:where(.book-text) > div > p {
  margin: 0;
  text-indent: var(--indent-paragraph);
  text-align: var(--align-scripture);
}

/* A hymn or poem set apart from the prose of a text set as a book, and a
   sermon's text line (#521), as the Spurgeon Gems editions set them:
   centred, in bold italics in the text's colour, with a line of the text's
   height above and below, not indented, each line its own and one too long
   for the column wrapping centred. Italics on part of one show upright, as
   print sets emphasis inside italics. */
.book-hymn {
  margin-block: var(--line-height-scripture);
  text-indent: 0;
  text-align: center;
  font-style: italic;
  font-weight: var(--weight-bold);
}

.book-hymn em {
  font-style: normal;
}

.article-table {
  overflow-x: auto;
  margin: var(--space-4) 0;
  font-family: var(--font-ui);
}

.article-table table {
  border-collapse: collapse;
  font-size: var(--step--1);
  line-height: var(--line-height--1);
}

.article-table :is(td, th) {
  padding: var(--space-1) var(--space-2);
  border: var(--width-border) solid var(--color-border);
  text-align: start;
  vertical-align: top;
}

.article-table p {
  margin: 0;
}

/* A Head in a text set as a book (.book-text), one of a sermon's numbered
   divisions (#522): its first line starts at the text's edge, not indented,
   and its numeral (.book-head-numeral), bold, in the Theme's accent colour,
   hangs outside the text's left edge, in the page's margin. A page with no
   margin for it gives the text room on its left (--width-head-numeral).
   Arriving at a Head from a menu tints it for a moment
   (.book-head-arrived, which the menu sets each time). */
.book-head {
  position: relative;
  text-indent: 0;
}

.book-head-numeral {
  position: absolute;
  inset-inline-end: 100%;
  margin-inline-end: var(--space-2);
  color: var(--color-accent);
  font-weight: var(--weight-bold);
  white-space: nowrap;
}

.book-head-arrived {
  border-radius: var(--radius-control);
  animation: book-head-arrive var(--duration-arrive) ease-out;
}

@keyframes book-head-arrive {
  from {
    background-color: var(--color-highlight);
  }

  to {
    background-color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-head-arrived {
    animation-timing-function: step-end;
  }
}

/* A menu of the places in a long page, such as a Dictionary article's In
   this article or a sermon's In this sermon: each place a link at least a
   finger's least target tall, whose lines sit closer than the links do, so
   that a wrapped line reads as the same place. */
.page-menu a {
  display: block;
  min-height: var(--size-target-min);
  padding-block: var(--space-1);
  line-height: var(--line-height-tight);
  overflow-wrap: anywhere;
}

/* A text's Heads drawn to scale in a page's menu (.page-menu), such as a
   sermon's In this sermon (#522): each entry, "Introduction" then each Head
   by its numeral (.heads-list-numeral), bold in the Theme's accent, and its
   title, in the text's colour, as tall as its share of the text's words (its
   flex-grow), but never less than a finger's least target, and the list at
   least --height-heads-list tall in all. Beside the entries a rail, each
   entry's start a mark on it, fills as the reader goes: an entry passed
   (.heads-list-passed) wholly, and the one being read, its link
   aria-current, in bold, as far down as --heads-list-read says. */
.heads-list {
  display: flex;
  flex-direction: column;
  min-height: var(--height-heads-list);
  margin: 0;
  padding: 0;
  list-style: none;
}

.heads-list > li {
  --heads-list-read: 0px;
  display: grid;
  grid-template-columns: var(--space-3) minmax(0, 1fr);
  column-gap: var(--space-3);
  flex-basis: var(--size-target-min);
}

.heads-list > li.heads-list-passed {
  --heads-list-read: 100%;
}

.heads-list > li::before,
.heads-list > li::after {
  content: '';
  grid-row: 1;
  grid-column: 1;
}

.heads-list > li::before {
  justify-self: center;
  width: var(--space-1);
  background: linear-gradient(var(--color-accent) var(--heads-list-read), var(--color-border) var(--heads-list-read));
}

.heads-list > li::after {
  z-index: 1;
  align-self: start;
  height: var(--space-3);
  margin-top: var(--space-2);
  border: var(--width-border) solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-bg);
}

.heads-list > :is(li.heads-list-passed, li:has(> [aria-current]))::after {
  border-color: var(--color-accent);
  background: var(--color-accent);
}

.heads-list a {
  grid-row: 1;
  grid-column: 2;
  color: var(--color-text);
}

.heads-list > li + li > a {
  border-top: var(--width-border) solid var(--color-border);
}

.heads-list a[aria-current] {
  font-weight: var(--weight-bold);
}

.heads-list-numeral {
  color: var(--color-accent);
  font-weight: var(--weight-bold);
}

/* What a change to some words drops, struck through, and adds, underlined,
   such as the source's words that the Editor's correction changed. */
.change-marks del {
  color: var(--color-danger);
  text-decoration: line-through;
}

.change-marks ins {
  background: var(--color-highlight);
  text-decoration: underline;
  text-decoration-color: var(--color-success);
}

/* The heading over a section of Bible text, such as "Jesus and Nicodemus", with
   its Reference beside it. */
.section-heading {
  margin: 0 0 var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  font-weight: var(--weight-bold);
  line-height: var(--line-height-tight);
}

.section-heading .muted {
  font-weight: var(--weight-regular);
}

/* Hebrew set apart in other text, such as the letter that starts each of Psalm
   119's Section headings ("א Aleph") there and in the Outline, in the face
   that has its script. */
bdi[lang='he'] {
  font-family: var(--font-original);
}

/* Bible text whose verses the Editor clicks to choose, such as a Passage's: the
   chosen verses in the text's colour and the rest muted. The verses as saved are
   bold, and verses of another of the Topic's Passages are underlined, as is the
   key that says so. */
.verse-picker .verse {
  color: var(--color-muted);
  border-radius: var(--radius-control);
  cursor: pointer;
}

@media (hover: hover) {
  .verse-picker .verse:hover {
    background: var(--color-hover);
  }
}

.verse-picker .verse[aria-pressed='true'] {
  color: var(--color-text);
}

.verse-picker .verse.saved {
  font-weight: var(--weight-bold);
}

.verse-picker .other {
  text-decoration: underline dotted var(--color-accent);
  text-underline-offset: var(--space-1);
}

/* Before the first verse of each run in another of the Topic's Passages, that
   Passage's place in Rank order and its Reference, such as "#4 · Philippians
   4:6–7", small and muted, in one piece that justified text never stretches. */
.verse-picker .other-label {
  display: inline-block;
  margin-right: var(--space-1);
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  line-height: var(--line-height-tight);
  white-space: nowrap;
}

/* A verse the Translation leaves out. */
.verse-picker .verse.missing {
  font-style: italic;
}

.source-small-caps {
  font-variant-caps: small-caps;
}

/* Red letters (#779): the words of Jesus a run of Scripture carries, red only
   where the reader has chosen Red, which marks the page's root. A Dotted
   word's underline keeps the Theme's colour. */
[data-red-letters="red"] .red-letters {
  color: var(--color-red-letters);
}

/* Script faces are selected at the text's own language boundary. Browser font
   fallback retains complete combining clusters; ordinary Latin stays in the
   established families. Font files are fetched only when matching text is used. */
:lang(de), :lang(pl), :lang(ru), :lang(vi), :lang(yo), :lang(ha) {
  --font-scripture: var(--font-scripture-latin);
  --font-ui: var(--font-ui-latin);
}
:lang(hi) {
  --font-scripture: var(--font-scripture-hi);
  --font-ui: var(--font-ui-hi);
}
:lang(ta) {
  --font-scripture: var(--font-scripture-ta);
  --font-ui: var(--font-ui-ta);
}
:lang(te) {
  --font-scripture: var(--font-scripture-te);
  --font-ui: var(--font-ui-te);
}
:lang(bn) {
  --font-scripture: var(--font-scripture-bn);
  --font-ui: var(--font-ui-bn);
}
:lang(ml) {
  --font-scripture: var(--font-scripture-ml);
  --font-ui: var(--font-ui-ml);
}
:lang(ar) {
  --font-scripture: var(--font-scripture-ar);
  --font-ui: var(--font-ui-ar);
}
:lang(zh-Hans) {
  --font-scripture: var(--font-scripture-zh);
  --font-ui: var(--font-ui-zh);
}
:lang(ja) {
  --font-scripture: var(--font-scripture-ja);
  --font-ui: var(--font-ui-ja);
}
:lang(ko) {
  --font-scripture: var(--font-scripture-ko);
  --font-ui: var(--font-ui-ko);
}

:lang(ar), :lang(ml) {
  --line-height-scripture: var(--line-height-scripture-marks);
  --line-height-tight: var(--line-height-tight-marks);
}

[lang] { font-family: var(--font-ui); }
/* The generic language boundary must not replace Scripture's role, nor an
   article's. */
.scripture[lang], .article-text[lang] { font-family: var(--font-scripture); }

/* These source families have no italic outlines. Keep semantic emphasis and
   make it visibly bold, without pretending an artificial slant is an italic. */
:is(:lang(ar), :lang(hi), :lang(te), :lang(bn), :lang(ml), :lang(zh-Hans), :lang(ja), :lang(ko)) :is(em, i),
:is(em, i):is(:lang(ar), :lang(hi), :lang(te), :lang(bn), :lang(ml), :lang(zh-Hans), :lang(ja), :lang(ko)) {
  font-style: normal;
  font-weight: var(--weight-bold);
}

.scripture:lang(ar) { direction: rtl; }

/* Original words in a BSB tap (ADR 0027), after the language rules above,
   so that their face wins over [lang]'s. Its first row (#566's approved tap,
   variant B): its Original words in their own letters, a step larger than
   the rows' text, in the face that has their script, Hebrew right to left
   (set by dir) at the height its points and accents need; then a muted dot
   and their English letters, muted and slanted, in the rows' face. Its Parts
   row, under its letters (#576's approved tap, variant A): a line for each
   Hebrew or Aramaic word in its parts, read left to right, each part's
   letters in the letters' face, then its gloss in the rows', the parts
   between muted dots. */
.word-original {
  font-family: var(--font-original);
  font-size: var(--step-0);
}
.word-original:is([lang="hbo"], [lang="arc"]) {
  line-height: var(--line-height-tight-marks);
}
.word-letters-dot,
.word-transliteration,
.word-parts-dot {
  color: var(--color-muted);
}
.word-parts-word {
  display: block;
}
