:root {
  --bg: #fbf9f4;
  --surface: #ffffff;
  --border: #e3ded2;
  --text: #22201c;
  --muted: #6d675d;
  --accent: #8a5a2b;
  --accent-soft: #f3e8da;
  --mark: #ffe9a8;
  --mk-yellow: #fff0a8;
  --mk-green: #cdebc5;
  --mk-blue: #cfe2f7;
  --mk-pink: #f8d4e3;
  --radius: 10px;
  /* Reading size. Only the Bible text and the commentary use it, never the
     chrome -- making the buttons grow too would just eat the screen. */
  --read-size: 18px;
}
/* Dark either because the system asks for it and the reader has not said
   otherwise, or because the reader chose it outright. The two blocks say the
   same thing twice: plain CSS cannot share one set of declarations between a
   media query and a selector, and eight duplicated lines beat making the page
   depend on JavaScript to look right before JavaScript has run. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171614;
    --surface: #1f1e1b;
    --border: #35332e;
    --text: #e9e5dc;
    --muted: #9c968a;
    --accent: #d9a46a;
    --accent-soft: #2c2721;
    --mark: #5c4a1c;
    --mk-yellow: #5c4a1c;
    --mk-green: #2c4328;
    --mk-blue: #263b4f;
    --mk-pink: #4c2838;
  }
}
:root[data-theme="dark"] {
    --bg: #171614;
    --surface: #1f1e1b;
    --border: #35332e;
    --text: #e9e5dc;
    --muted: #9c968a;
    --accent: #d9a46a;
    --accent-soft: #2c2721;
    --mark: #5c4a1c;
    --mk-yellow: #5c4a1c;
    --mk-green: #2c4328;
    --mk-blue: #263b4f;
    --mk-pink: #4c2838;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 "Iowan Old Style", Georgia, "Noto Serif", serif;
}

header {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1rem;
}
.bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
h1 {
  margin: 0; font-size: 1.1rem; letter-spacing: .02em;
  font-weight: 600; flex: 1;
  /* NEVER let it break. `flex: 1; min-width: 0` used to let the title
     collapse so the tab row could stay on the same flex line, and at a
     phone's landscape width that squeezed "Bible Study Tool" into a 59px
     column -- three lines, 87px tall, where the tabs beside it are 39.
     The title paid for the nav's convenience with twice the nav's height.
     Wrapping the NAV instead is free: it already wraps well. */
  white-space: nowrap;
}
/* Wraps, because it has to: six tabs do not fit a phone on one line, and
   without this the last ones are simply cut in half at the right edge --
   which they already were at five. */
nav { display: flex; gap: .25rem; flex-wrap: wrap; }

.textsize { display: flex; gap: .25rem; align-items: baseline; }
.textsize button {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  border-radius: 8px; cursor: pointer; width: 2rem; height: 2rem;
  font-family: system-ui, sans-serif; font-weight: 600; line-height: 1; padding: 0;
}
.textsize button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.textsize button:disabled { opacity: .35; cursor: default; }
.textsize button:first-child { font-size: .78rem; }

/* The background cycler. Sized and bordered like the A/A buttons beside it,
   because it is the same kind of control in the same group. */
.theme {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  border-radius: 8px; cursor: pointer; width: 2rem; height: 2rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.theme:hover { border-color: var(--accent); color: var(--accent); }
.theme svg {
  width: 1.15rem; height: 1.15rem;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Which icon shows. Auto is the one that appears with NO data-pref at all --
   a reader in private mode, where localStorage throws, gets the default and
   its matching icon rather than an empty button. */
.theme .i-light, .theme .i-dark { display: none; }
:root[data-pref="light"] .theme .i-auto,
:root[data-pref="dark"]  .theme .i-auto { display: none; }
:root[data-pref="light"] .theme .i-light { display: block; }
:root[data-pref="dark"]  .theme .i-dark  { display: block; }

#bigger  { font-size: 1.05rem; }
.tab {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  padding: .4rem .85rem; border-radius: 999px; cursor: pointer; font: inherit;
  font-size: .9rem;
}
.tab.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.inputs { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.inputs input { flex: 1 1 14rem; min-width: 0; }
.combo { position: relative; flex: 1 1 14rem; min-width: 0; display: flex; }
/* The list is absolutely positioned, so it must never become a flex item of
   .combo -- without this it sits in flow as a bulleted list and stretches the
   input box to its own height. */
.combo > .suggest { position: absolute; }

.suggest {
  position: absolute; top: calc(100% + .25rem); left: 0; right: 0; z-index: 30;
  margin: 0; padding: .25rem; list-style: none;
  max-height: 17rem; overflow-y: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / .18);
  font-family: system-ui, sans-serif; font-size: .9rem;
}
.suggest li {
  display: flex; justify-content: space-between; align-items: baseline; gap: .75rem;
  padding: .45rem .6rem; border-radius: 6px; cursor: pointer;
}
.suggest li[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.suggest .alias { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.suggest li.note { color: var(--muted); font-style: italic; cursor: default; }
.suggest li.note[aria-selected="true"] { background: transparent; }
.suggest b { color: var(--accent); font-weight: 700; }
input, select, .inputs button {
  font: inherit; padding: .55rem .7rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text);
}
.inputs button {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
  cursor: pointer; font-weight: 600; padding-inline: 1.1rem;
}

main {
  max-width: 1100px; margin: 0 auto; padding: 1rem;
  display: grid; gap: 1rem; grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  main { grid-template-columns: 1.15fr 1fr; align-items: start; }
  .panel.wide { grid-column: 1 / -1; }
}

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.1rem;
}
.panel h2 {
  margin: 0 0 .75rem; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .09em; color: var(--muted); font-weight: 600;
  font-family: system-ui, sans-serif;
}
#passage-ref { color: var(--accent); font-size: .95rem; text-transform: none; letter-spacing: 0; }

.verse { margin: 0 0 .5rem; font-size: var(--read-size); }
.verse sup {
  color: var(--accent); font-weight: 700; font-size: .7em;
  margin-right: .3rem; font-family: system-ui, sans-serif;
}

.entry { border-top: 1px solid var(--border); padding-top: .8rem; margin-top: .8rem; }
.entry:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.entry-head {
  font-family: system-ui, sans-serif; font-size: .78rem;
  color: var(--muted); margin-bottom: .3rem;
}
.entry-head strong { color: var(--text); }
.entry-body { white-space: pre-wrap; font-size: var(--read-size); }

#dict-body { white-space: pre-wrap; font-size: var(--read-size); }
/* A dictionary entry is built from <p> and <h4> now, not one blob of text.
   pre-wrap stays, because single newlines INSIDE a paragraph are the
   source's own line breaks and are worth keeping. */
.entry-para { margin: 0 0 .7rem; }
.entry-head {
  margin: 1.5rem 0 .5rem;          /* more above than below: a heading
                                      belongs to what follows it */
  font-size: calc(var(--read-size) * 1.1);
  font-weight: 600; color: var(--accent);
}
.entry-head:first-child { margin-top: .2rem; }
#dict-body .key {
  font-family: system-ui, sans-serif; font-size: .8rem; letter-spacing: .06em;
  color: var(--accent); text-transform: uppercase; margin-bottom: .5rem;
}
/* A collapsed entry shows a few lines, not the ten this used to clamp to. The
   point of collapsing is that every source for the verse fits on one screen;
   a ten-line preview of Matthew Henry is most of a screen on its own.
   white-space goes back to normal because the preview is already flattened --
   pre-wrap would re-introduce the blank lines it just removed. */
.entry-body.preview { white-space: normal; color: var(--muted); }
.more {
  margin-top: .4rem; padding: .25rem .7rem; cursor: pointer;
  font: inherit; font-family: system-ui, sans-serif; font-size: .78rem;
  color: var(--accent); background: transparent;
  border: 1px solid var(--border); border-radius: 999px;
}
.more:hover { border-color: var(--accent); }

/* The filter row sits above the entries, where a reader decides whose note to
   read. It wraps rather than scrolling sideways: a chip you have to scroll to
   find is no more discoverable than the icon this replaced. */
.sources {
  display: flex; flex-wrap: wrap; gap: .4rem;
  margin-bottom: .9rem; padding-bottom: .8rem;
  border-bottom: 1px solid var(--border);
}
.chip {
  padding: .2rem .7rem; cursor: pointer;
  font: inherit; font-family: system-ui, sans-serif; font-size: .78rem;
  color: var(--text); background: transparent;
  border: 1px solid var(--border); border-radius: 999px;
}
.chip:hover { border-color: var(--accent); }
.chip.on {
  color: var(--bg); background: var(--accent); border-color: var(--accent);
}
/* Dimmed, not disabled: picking a source this verse does not cover is a
   standing choice, not a filter on the current screen. */
.chip.none-here { color: var(--muted); }
.chip.none-here.on { color: var(--bg); }
.solo-note {
  font-family: system-ui, sans-serif; font-size: .78rem; color: var(--muted);
  margin: 0 0 .8rem;
}

/* Interlinear: one card per Greek or Hebrew word. The row carries dir="rtl"
   for Hebrew, which also reverses the card order -- laid out left to right
   the sentence comes out backwards. */
.inter { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .8rem; }
/* Sticky, and that is the point: the commentary sits below the word cards,
   and a chapter of them runs to dozens of screens. Without the summary
   following the reader down, the way out is a scroll back to the top. */
.inter summary {
  /* Below the page header, which is sticky too -- at top:0 the two drew on
     top of each other. --header-h is measured in app.js because the header
     wraps to two rows on a narrow window. */
  position: sticky; top: var(--header-h, 0px); z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; font-family: system-ui, sans-serif; font-size: .78rem;
  color: var(--accent); background: var(--surface);
  padding: .35rem 0; margin-bottom: .6rem;
}
/* A chevron instead of the words "Show" and "Close": opening and closing a
   section is the most standardised control there is, and the arrow's
   direction carries the state. Drawn from two borders rather than a glyph so
   it does not depend on the font having one. The whole summary is clickable,
   so the chevron never has to be hit precisely. */
.inter-toggle {
  width: .5rem; height: .5rem; margin-right: .2rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-.15rem) rotate(45deg);
  transition: transform .15s ease;
}
.inter[open] .inter-toggle {
  transform: translateY(.1rem) rotate(-135deg);
}
.iv { margin-bottom: .7rem; }
.iv-n {
  font-family: system-ui, sans-serif; font-size: .7rem; color: var(--muted);
  margin-bottom: .2rem;
}
.iw-row { display: flex; flex-wrap: wrap; gap: .3rem .7rem; }
.iw {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: .05rem; padding: .2rem .3rem; text-align: start;
  /* `color: inherit` is load-bearing, not tidiness. A tappable word is a
     <button>, and a button does NOT inherit colour -- it defaults to
     `buttontext`, which is black. `font: inherit` alone left the Greek and
     Hebrew black on a dark background: invisible in dark mode, and close
     enough to the body colour in light mode that nobody caught it. Any new
     bare-looking button needs this line too. */
  font: inherit; color: inherit;
  background: transparent; border: 0; border-radius: 4px;
}
button.iw { cursor: pointer; }
button.iw:hover { background: var(--border); }
/* Every line of a word card is reading text, so all four follow
   --read-size. They were fixed rem, which meant the A/A buttons moved the
   passage and the commentary and left the Greek exactly where it was --
   and Flutter was scaling the Greek word but not the three lines under it,
   so the two clients disagreed as well.

   The multipliers reproduce the old rem sizes at the default 18px, so
   nothing moves for a reader who never touches the control: .93 was
   1.05rem, .60 was .68rem, .67 was .75rem, .59 was .66rem. */
.iw-orig { font-size: calc(var(--read-size) * .93); }
.iw-tr {
  font-family: system-ui, sans-serif; font-style: italic;
  font-size: calc(var(--read-size) * .60);
  color: var(--muted);
}
.iw-gloss {
  font-family: system-ui, sans-serif;
  font-size: calc(var(--read-size) * .67);
}
.iw-key {
  font-family: system-ui, sans-serif; color: var(--accent);
  font-size: calc(var(--read-size) * .59);
  white-space: pre;
}
/* The CC BY credit the interlinear licence requires. Not decoration. */

#lookup {
  width: min(44rem, 92vw); max-height: 86vh;
  /* No padding on top: the sticky header below carries it instead, so the
     header can sit flush against the scrollport edge with nothing showing
     through above it. */
  padding: 0 1.2rem 1.4rem;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
}
#lookup::backdrop { background: rgba(0, 0, 0, .55); }
/* Close follows the reader down the list. A concordance on a common word is
   several hundred rows, and with the header scrolled away the only way out
   was to scroll all the way back up to reach it. */
#lookup-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem 0 .6rem; margin-bottom: .6rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
/* Close and the A/A pair share the right-hand side of the sticky header. */
.lookup-head-tools { display: flex; align-items: center; gap: .6rem; flex: none; }

.lookup-article {
  white-space: pre-wrap; font: inherit;
  font-size: calc(var(--read-size) * .88);
  margin: 0; padding: .7rem; border-radius: 6px; background: var(--border);
}
/* The trigger for loading the next page. It has height so the observer has
   something to see, and no appearance: the reader should notice the list
   continuing, not a spinner. */
.lookup-end, .search-end { height: 1px; }

/* The same footer line in the concordance dialog and in the Search panel,
   which page the same way. */
.lookup-count, .search-count {
  font-family: system-ui, sans-serif; font-size: .78rem; color: var(--muted);
  margin: .8rem 0 .2rem;
}
/* Named buttons rather than bare arrows, for the same reason the commentary
   filter is a row of named chips: an arrow does not say where it lands, and
   at a book boundary that is exactly what the reader needs to know. */
.chapter-nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: .5rem; margin: .2rem 0 .8rem;
}
.chapter-nav:empty { display: none; }
#chapter-nav-bottom { margin: 1rem 0 .2rem; }
.chapter-step {
  padding: .3rem .8rem; cursor: pointer;
  font: inherit; font-family: system-ui, sans-serif; font-size: .82rem;
  color: var(--accent); background: transparent;
  border: 1px solid var(--border); border-radius: 999px;
}
.chapter-step:hover { border-color: var(--accent); }

/* Listen, in the gap the chapter row already has. Two buttons at most
   (Pause + Stop), which at 375px leaves room beside `< John 2` and
   `John 4 >` -- measured, not assumed. */
.listen-slot { display: flex; gap: .3rem; }
/* Listen, Pause and Resume share one box. Without this the first button
   changes width as the state changes -- "Resume" is wider than "Pause" --
   which slides Stop sideways under the reader's finger, so a second tap
   meant for Resume can land on Stop. A control must not move because of
   what it just did. */
.listen-slot .listen:first-child { min-width: 5.9rem; }
.listen {
  padding: .3rem .7rem; cursor: pointer;
  font: inherit; font-family: system-ui, sans-serif; font-size: .82rem;
  color: var(--accent); background: transparent;
  border: 1px solid var(--accent); border-radius: 999px;
  white-space: nowrap;
}
.listen:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
/* Stop is the way out, not the thing being offered, so it recedes. */
.listen-stop { color: var(--muted); border-color: var(--border); }
/* Speed sits between Pause and Stop and recedes like Stop does: it is a
   setting, not the thing being offered. */
.listen-speed {
  color: var(--muted); border-color: var(--border);
  padding-inline: .6rem;
  /* Wide enough for the widest of Slow/Normal/Fast, for the same reason
     Pause and Resume share a box: a label that changes width slides Stop
     sideways under the finger that is cycling the speed, and the next tap
     lands on it. */
  min-width: 4.6rem;
}
.listen-note {
  margin: 0 0 .6rem; font-family: system-ui, sans-serif; font-size: .8rem;
  color: var(--muted);
}

/* The reference and the listen control on one line.
 *
 * The title SHRINKS rather than wrapping, which is what makes this row one
 * line for every book in every state. Worst case measured at 375px:
 * "2 Thessalonians 2 - KJV" is 190px, Pause+Stop 157px, so while reading
 * the title gives up its tail. Idle it never has to: 190 + 94 fits.
 *
 * This is the second place tried. The first was the middle of the chapter
 * row, which looked free -- space-between already leaves a gap there -- but
 * `.chapter-nav` is a <nav>, so the bare `nav` rule that wraps the tab row
 * wraps it too, and the button pushed 26 of the 60 multi-chapter books onto
 * a second line. 32 pixels on nearly half the Bible is not a rounding
 * error on a phone. */
.passage-head {
  display: flex; align-items: baseline; gap: .5rem;
}
.passage-head #passage-ref {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.passage-head .listen-slot { flex: 0 0 auto; }

/* While it is reading, this row follows the reader down.
 *
 * Measured on a phone and it is not a nicety: the passage auto-scrolls to
 * keep the spoken verse in view, so within a few verses the row holding
 * Pause and Stop has left the screen and the only way to stop the voice is
 * to scroll back and hunt for it. That is exactly the bug the interlinear
 * header was pinned to fix, in the same shape -- a way IN that is one tap
 * and a way OUT that is a search.
 *
 * Pinned only while playing, so a reader who is not listening loses no
 * reading space at all. */
.passage-head.listening {
  position: sticky; top: var(--header-h, 0px); z-index: 5;
  background: var(--bg); padding: .3rem 0;
  justify-content: center;
}
/* While it is reading this row is a TRANSPORT bar, not a title, and the
   reference steps aside for it.
 *
 * Measured, after adding the speed control made three buttons: at 375px
 * the reference was crushed to 67 pixels -- "2 Thess..." and no more --
 * and at 260px the bar overflowed the row. Letting it shrink was enough
 * for two buttons and is not enough for three.
 *
 * Nothing is lost that the screen does not already show: the verse numbers
 * and the moving highlight are right there, and Stop brings the reference
 * straight back. */
.passage-head.listening #passage-ref { display: none; }

/* The verse being spoken. A background rather than a border, because the
   row must not change height as it moves down the chapter -- and the
   reader's own highlights are inline spans inside the verse, so they still
   paint on top of this. */
.verse.speaking { background: var(--accent-soft); border-radius: 6px; }

#about-body h3 {
  font-size: .9rem; color: var(--accent); margin: 1.4rem 0 .5rem;
}
#about-body h3:first-of-type { margin-top: .8rem; }
.about-intro { color: var(--muted); margin: 0; max-width: 46rem; }
.src { margin-bottom: .9rem; }
.src-name { font-size: .95rem; }
.src-author, .src-url {
  font-family: system-ui, sans-serif; font-size: .75rem; color: var(--muted);
}
.src-lic {
  font-family: system-ui, sans-serif; font-size: .78rem; color: var(--accent);
}
.src-attr { font-family: system-ui, sans-serif; font-size: .75rem; }

/* The privacy policy and the terms, folded under the sources. The marker is
   the browser's own triangle rather than the hand-drawn chevron the
   interlinear uses: that one had to sit in a sticky bar and be the whole tap
   target, this is an ordinary disclosure in a list of them. */
.legal { border-top: 1px solid var(--border); padding: .55rem 0; }
.legal summary {
  cursor: pointer; font-family: system-ui, sans-serif; font-size: .9rem;
  color: var(--accent);
}
.legal summary:hover { text-decoration: underline; }
.legal-updated {
  font-family: system-ui, sans-serif; font-size: .75rem; color: var(--muted);
  margin: 0 0 .5rem;
}
.legal-body { max-width: 46rem; padding: .4rem 0 .6rem; }

/* The feedback line in the About panel. The address sits beside the link
   rather than only behind it: a reader whose browser has no mail handler
   gets nothing at all from the link, and the address is the whole of what
   they need. Same reason the Flutter section prints it too. */
.feedback-to {
  font-family: system-ui, sans-serif; font-size: .8rem; color: var(--muted);
  margin: .3rem 0 0;
}
/* More space above than below: a heading belongs to what follows it -- the
   same rule the dictionary headings follow. */
.legal-body h4 {
  margin: 1.1rem 0 .3rem; font-family: system-ui, sans-serif;
  font-size: .85rem; color: var(--accent);
}
.legal-body h4:first-child { margin-top: .2rem; }
.legal-body p { margin: 0 0 .6rem; font-size: .9rem; line-height: 1.6; }
.src-notice {
  font-family: system-ui, sans-serif; font-size: .72rem; color: var(--muted);
  max-width: 46rem;
}
.src-url a { color: inherit; }

/* Floats over the passage while a selection is live. The Flutter app gets
   this for free from the Android selection toolbar; a web page has to put the
   action somewhere itself. */
/* Two actions now, so the pill is a group: the single button it used to be
   could keep its own padding, these need a divider between them. */
.sel-action {
  position: fixed; z-index: 50; display: flex;
  border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
  overflow: hidden;
}
.sel-action button {
  padding: .3rem .8rem; cursor: pointer;
  font: inherit; font-family: system-ui, sans-serif; font-size: .78rem;
  color: var(--bg); background: var(--accent); border: 0;
}
.sel-action button + button { border-left: 1px solid rgba(0, 0, 0, .25); }
.sel-action button[hidden] { display: none; }
/* `display: flex` above beats the UA's `[hidden] { display: none }` -- same
   specificity, author sheet wins -- so without this the bar sits at the foot
   of the page the whole time. It went unnoticed while it held two buttons
   and no page was short enough to show it. */
.sel-action[hidden] { display: none; }

/* The share card. The canvas is the real 1080x1350 image, shown at whatever
   width the dialog has: what you see is exactly the file that gets sent. */
#share {
  width: min(24rem, 90vw); padding: 1rem;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
}
#share::backdrop { background: rgba(0, 0, 0, .6); }
#share-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-bottom: .6rem; margin-bottom: .7rem;
  border-bottom: 1px solid var(--border);
}
#share-canvas {
  display: block; width: 100%; height: auto; border-radius: 8px;
  background: #1b2733;
}
/* Grow the card to the verses either side. The verse division is not the
   unit of meaning -- 12.6% of verses do not end a sentence -- so the card has
   to be able to run past one. */
.share-range {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  padding: .7rem .1rem 0;
}
.share-range button {
  padding: .25rem .7rem; cursor: pointer;
  font-family: system-ui, sans-serif; font-size: .75rem;
  color: var(--accent); background: none;
  border: 1px solid var(--accent); border-radius: 999px;
}
.share-range button.plain { color: var(--muted); border-color: var(--border); }
.share-range button[disabled] {
  color: var(--muted); border-color: var(--border); cursor: default;
}

/* Whole verse or just the words dragged. Shown only when the two differ --
   it is as much an explanation of why the selection grew as it is a choice. */
.share-scope { display: flex; gap: .4rem; padding: .7rem .1rem 0; }
.share-scope button {
  padding: .25rem .7rem; cursor: pointer;
  font-family: system-ui, sans-serif; font-size: .75rem;
  color: var(--text); background: none;
  border: 1px solid var(--border); border-radius: 999px;
}
.share-scope button[aria-selected="true"] {
  color: var(--bg); background: var(--accent); border-color: var(--accent);
}

.share-art {
  display: flex; gap: .4rem; overflow-x: auto; padding: .7rem .1rem .3rem;
}
.share-art button {
  flex: 0 0 auto; width: 44px; height: 55px; padding: 0; cursor: pointer;
  background: none; border: 1px solid var(--border); border-radius: 5px;
  overflow: hidden;
}
.share-art button[aria-selected="true"] {
  border-color: var(--accent); border-width: 3px;
}
.share-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.share-actions { display: flex; gap: .6rem; align-items: center; }
.share-actions button {
  flex: 1; padding: .5rem .3rem; cursor: pointer;
  /* Three buttons across 375px: let them shrink rather than wrap "Share
     image" onto two lines while the others stay on one. */
  font-family: system-ui, sans-serif; font-size: .8rem; white-space: nowrap;
}
.share-note {
  font-family: system-ui, sans-serif; font-size: .72rem; color: var(--muted);
  margin: .5rem 0 0;
}

.hit-gloss {
  font-family: system-ui, sans-serif; color: var(--accent);
  font-size: calc(var(--read-size) * .75);
  margin-left: .4rem;
}

.hit { border-top: 1px solid var(--border); padding: .7rem 0; }
.hit:first-child { border-top: 0; }
.hit a {
  color: var(--accent); text-decoration: none; font-weight: 600;
  font-family: system-ui, sans-serif;
  font-size: calc(var(--read-size) * .85);
}
.hit a:hover { text-decoration: underline; }
.hit p { margin: .2rem 0 0; font-size: var(--read-size); }
mark { background: var(--mark); color: inherit; padding: 0 .1em; border-radius: 2px; }

.empty { color: var(--muted); font-style: italic; }
.hidden { display: none !important; }

footer {
  max-width: 1100px; margin: 0 auto; padding: .5rem 1rem 2rem;
  color: var(--muted); font-size: .8rem; font-family: system-ui, sans-serif;
}

/* -------------------------------------------------------- reading plans */
/* A grid, because on a desktop six plans in one column leaves the right two
   thirds of the window empty. */
#plans-body { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
#plans-body:has(.days) { display: block; }

.plan {
  padding: .9rem 1rem; cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.plan:hover, .plan:focus-visible { border-color: var(--accent); outline: none; }
.plan h3 { margin: 0 0 .3rem; font-size: 1rem; color: var(--accent); }
.plan p { margin: 0; font-size: .88rem; }
.meta { color: var(--muted); font-size: .78rem; font-family: system-ui, sans-serif; }
.plan .meta { margin-top: .4rem; }

ol.days { margin: 0; padding: 0; list-style: none; }
ol.days li {
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  padding: .45rem 0; border-top: 1px solid var(--border);
}
ol.days li:first-child { border-top: 0; }
.day {
  min-width: 4.5rem; color: var(--muted);
  font-family: system-ui, sans-serif; font-size: .8rem;
}
.reading {
  padding: 0; cursor: pointer; font: inherit; font-size: var(--read-size);
  color: var(--accent); background: transparent; border: 0;
}
.reading:hover { text-decoration: underline; }
ol.days li .meta { margin-left: auto; }

.linkish {
  padding: 0; cursor: pointer; font: inherit; font-size: .85rem;
  color: var(--accent); background: transparent; border: 0;
}
.linkish:hover { text-decoration: underline; }
.plan.devotional { border-color: var(--accent); background: var(--accent-soft); }


/* ----------------------------------------------- highlights and notes
   The colour is a CSS variable per key, not a stored value, for the same
   reason markColors in the Flutter client stores a key: the two themes want
   different shades of "yellow", and a colour saved in one theme would be
   wrong in the other. Switching the theme re-paints every highlight with no
   re-render.

   `color: inherit` is load-bearing, the same trap the interlinear word
   buttons hit: without it a <mark> keeps the UA's black text and a dark
   highlight becomes black on dark brown. */
mark.mk {
  color: inherit;
  background: var(--mark);
  border-radius: 2px;
  padding: 0 .05em;
}
mark.mk-yellow { background: var(--mk-yellow); }
mark.mk-green  { background: var(--mk-green); }
mark.mk-blue   { background: var(--mk-blue); }
mark.mk-pink   { background: var(--mk-pink); }

/* The note is shown under its verse, not behind an icon. Somebody wrote it
   to read again. */
.verse-note {
  display: flex; gap: .5rem; align-items: flex-start;
  margin: .35rem 0 .8rem;
  padding: .45rem .7rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  font-family: system-ui, sans-serif;
  font-size: calc(var(--read-size) * .82);
  line-height: 1.5;
  cursor: pointer;
}
.verse-note:hover { filter: brightness(1.04); }
.verse-note .ico { color: var(--accent); flex: none; }

.sel-row { display: flex; }
.sel-row[hidden] { display: none; }
.sel-action .swatch {
  width: 1.5rem; height: 1.5rem; padding: 0; margin: .25rem;
  border-radius: 999px; border: 1px solid rgba(0, 0, 0, .3);
}
.sel-action .swatch.on { outline: 2px solid var(--bg); outline-offset: -4px; }
.sel-action .swatch-yellow { background: var(--mk-yellow); }
.sel-action .swatch-green  { background: var(--mk-green); }
.sel-action .swatch-blue   { background: var(--mk-blue); }
.sel-action .swatch-pink   { background: var(--mk-pink); }
.sel-action .swatch + .swatch { border-left: 1px solid rgba(0, 0, 0, .3); }

/* Writing a note. */
#note {
  width: min(30rem, 92vw); padding: 1rem;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
}
#note::backdrop { background: rgba(0, 0, 0, .6); }
#note h2 { margin: 0 0 .4rem; font-size: 1.05rem; }
#note-quote {
  margin: 0 0 .7rem; padding: .3rem 0 .3rem .7rem;
  border-left: 3px solid var(--border);
  color: var(--muted); font-size: .92rem;
}
#note textarea {
  width: 100%; padding: .6rem; font: inherit; font-size: .95rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; resize: vertical;
}
.note-actions { display: flex; align-items: center; gap: .5rem; margin-top: .8rem; }
.note-actions .spacer { flex: 1; }
.note-actions button {
  padding: .4rem .9rem; cursor: pointer; font: inherit; font-size: .9rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
}
.note-actions button.primary { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.note-actions button.danger { color: #b3261e; }
.note-actions button[hidden] { display: none; }

/* What a subscription adds. Borrows #note's dialog chrome -- same size,
   same backdrop -- because it is the same kind of small modal, and a second
   set of numbers for it would be a second set to keep in step. */
#paywall {
  width: min(30rem, 92vw); padding: 1rem;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
}
#paywall::backdrop { background: rgba(0, 0, 0, .6); }
#paywall h2 { margin: 0 0 .6rem; font-size: 1.05rem; }
#paywall p { margin: .4rem 0; }
.paywall-list { margin: .6rem 0; padding-left: 1.2rem; }
.paywall-list li { margin: .3rem 0; }
.paywall-note { color: var(--muted); font-size: .88rem; }

/* Hidden until the server says the paywall is on. `display: flex` would
   beat the UA's [hidden] rule, the way .sel-action's did, so this one is
   inline-block and needs no counterpart -- but say it anyway rather than
   leave the next edit to rediscover it. */
.plus {
  padding: .3rem .7rem; cursor: pointer;
  font: inherit; font-family: system-ui, sans-serif; font-size: .85rem;
  color: var(--accent); background: var(--surface);
  border: 1px solid var(--accent); border-radius: 999px;
}
.plus[hidden] { display: none; }

/* Support: a way to give that buys nothing. The tab-row button is always
   visible -- a way to give that nobody can find is a way to give nobody
   uses -- and the foot of the commentary mirrors _SupportFooter in the app,
   where a reader who has read the chapter through actually arrives. */
.support {
  padding: .3rem .7rem; cursor: pointer;
  font: inherit; font-family: system-ui, sans-serif; font-size: .85rem;
  color: var(--muted); background: transparent;
  border: 1px solid var(--border); border-radius: 999px;
}
.support:hover { color: var(--accent); border-color: var(--accent); }

/* The install line sits above the support button and must not compete with
   it: muted text, no border, no colour of its own. It is information, not a
   call to action -- the reader asked for Scripture, not for a download. */
.install-foot {
  margin: 1.6rem 0 0; padding: 0;
  font-family: system-ui, sans-serif; font-size: .85rem;
  color: var(--muted); text-align: center;
}
.install-foot a { color: var(--accent); }

.support-foot {
  display: block; width: 100%; margin: 1.6rem 0 .5rem;
  padding: .7rem; cursor: pointer;
  font: inherit; font-family: system-ui, sans-serif; font-size: .9rem;
  color: var(--accent); background: transparent;
  border: 1px solid var(--accent); border-radius: 8px;
}
.support-foot:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* Nothing asks for money until the app has given something first, and this
   is what actually hides them -- see `drawSupportAsks` in app.js.

   It has to be a selector and not the `hidden` attribute alone: an author
   `display` on an element beats the user agent's `[hidden]` rule, and
   `.support-foot` sets `display: block` eight lines up. That is how
   `.sel-action` once came to sit at the foot of every page, and how the
   marks file input had to be hidden with a rule of its own. `.support-ask[hidden]`
   outranks a single class, so it wins wherever it is used. */
.support-ask[hidden] { display: none; }

#support-dialog {
  width: min(32rem, 92vw); max-height: 86vh; padding: 1.4rem;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 12px;
}
#support-dialog::backdrop { background: rgba(0, 0, 0, .6); }
#support-dialog h2 { margin: .6rem 0 .8rem; font-size: 1.3rem; }
#support-dialog p { margin: 0 0 .7rem; line-height: 1.55; }
.support-heart { font-size: 1.8rem; color: var(--accent); line-height: 1; }
/* The maintainer speaking, before any of the app's own copy. Italic so it
   reads as a person rather than as more interface text. */
.support-note { font-style: italic; }
/* Said once, on a tinted strip, not shouted. */
.support-quiet {
  margin: 0 0 .6rem; padding: .7rem;
  font-size: .86rem; line-height: 1.45;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-radius: 8px;
}
/* Amounts only: no "most popular", nothing pre-selected, no counter of what
   other people gave. The reader knows their own circumstances. */
/* Each group of amounts carries its own heading and its own sentence, since
   both are on screen at once and the note under one must not read as if it
   applied to the other. */
.support-group {
  margin: 1.4rem 0 .5rem; font-size: .95rem;
  font-family: system-ui, sans-serif; color: var(--text);
}
.support-group:first-of-type { margin-top: 1rem; }
.support-group-note { margin-top: .5rem; }

.support-tiers { display: flex; flex-wrap: wrap; gap: .6rem; }
.support-tiers button {
  min-width: 6rem; padding: .8rem .9rem; cursor: pointer;
  font: inherit; font-size: 1.05rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
}
.support-tiers button:hover { border-color: var(--accent); color: var(--accent); }
.support-thanks {
  margin: 1.4rem 0 0; padding-top: 1rem; text-align: center;
  font-size: .9rem; color: var(--muted); line-height: 1.5;
  border-top: 1px solid var(--border);
}
.support-said { margin: .8rem 0 0; font-size: .88rem; color: var(--accent); }

/* The reader's plan, on the reading screen. Same job as _NextUpRow in the
   app: a plan behind a tab is a plan nobody remembers they started. */
.next-up {
  display: flex; align-items: center; gap: .6rem;
  margin: 0 0 .8rem; padding: .5rem .6rem;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-radius: 8px;
}
.next-up[hidden] { display: none; }
.next-up .what {
  flex: 1; min-width: 0; text-align: left;
  padding: 0; cursor: pointer; font: inherit; color: inherit;
  background: transparent; border: 0;
}
.next-up .what strong { display: block; font-size: .95rem; }
.next-up .what .meta { display: block; font-size: .78rem; color: var(--muted); }
.next-up .done {
  padding: .3rem .7rem; cursor: pointer; white-space: nowrap;
  font: inherit; font-size: .85rem; color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent); border-radius: 8px;
}

/* A finished day in the plan's day list. */
.days li.done .reading { text-decoration: line-through; color: var(--muted); }
.days .tick {
  margin-right: .4rem; padding: 0 .35rem; cursor: pointer;
  font: inherit; font-size: .9rem; color: var(--muted);
  background: transparent; border: 1px solid var(--border); border-radius: 4px;
}
.days li.done .tick { color: var(--accent); border-color: var(--accent); }

/* Export and import, above the filters. */
.marks-io { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.marks-io button {
  padding: .3rem .7rem; cursor: pointer;
  font: inherit; font-family: system-ui, sans-serif; font-size: .85rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
}
.marks-io button:hover { border-color: var(--accent); color: var(--accent); }
/* Not `hidden` on the element: an author `display` on a flex child would beat
   the UA's [hidden] rule, which is how .sel-action came to sit at the foot of
   every page. The input is never shown; the button clicks it. */
.marks-io input { display: none; }
/* A statement of fact, not an alarm: muted, no red, no icon. It is telling
   a reader where their own words are kept, which is information they are
   owed rather than a problem being reported at them. */
.marks-safety {
  margin: 0 0 .8rem; padding: .7rem .8rem;
  font-family: system-ui, sans-serif; font-size: .85rem; line-height: 1.5;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.marks-safety b { color: var(--text); }

/* Moving between days of the devotional. Rendered twice, above and below
   the reading, for the same reason the chapter nav is: the way in has to be
   visible the moment it opens, and a reader who has read it through is at
   the bottom. */
.devotional-nav {
  display: flex; flex-wrap: wrap; gap: .4rem .6rem;
  align-items: center; justify-content: center;
  margin: .4rem 0 .8rem;
  font-family: system-ui, sans-serif;
}
.devotional-nav:last-child { margin: 1rem 0 .4rem; }
.devotional-steps {
  display: flex; gap: .4rem; align-items: center;
  justify-content: space-between; width: 100%;
}
.devotional-mid { display: flex; gap: .4rem; align-items: center; }
.devotional-nav button {
  padding: .3rem .6rem; cursor: pointer;
  font: inherit; font-size: .85rem;
  color: var(--accent); background: none;
  border: 1px solid transparent; border-radius: 8px;
}
.devotional-nav button:hover {
  border-color: var(--border); background: var(--surface);
}
.devotional-pick {
  padding: .25rem .4rem;
  font: inherit; font-family: system-ui, sans-serif; font-size: .8rem;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
}
/* A select inherits neither, and the UA's black-on-white list is unreadable
   against the dark theme -- the same trap the interlinear word buttons and
   mark.mk hit. */
.devotional-pick option { color: var(--text); background: var(--bg); }

/* Sync, on the marks screen because that is where the question "what
   protects my notes" already gets answered. Folded while it is off: a
   reader who has not asked for it should not have to read about it, and the
   screen's own job is the list below. */
.sync-box { margin: 0 0 1rem; font-family: system-ui, sans-serif; font-size: .85rem; }
.sync-box .sync-off, .sync-box .sync-on {
  padding: .7rem .8rem; line-height: 1.5;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.sync-box summary { cursor: pointer; color: var(--text); font-weight: 600; }
.sync-box p { margin: .6rem 0 0; }
.sync-box b { color: var(--text); }
/* The one sentence a reader must not miss, so it is not merely bolded. */
.sync-fine { font-size: .8rem; }
.sync-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.sync-join { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.sync-box button {
  padding: .3rem .7rem; cursor: pointer;
  font: inherit; font-size: .85rem;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
}
.sync-box button:hover { border-color: var(--accent); color: var(--accent); }
/* Stop deletes the shared copy for good, so it does not look like Sync now. */
.sync-box button.sync-danger:hover { border-color: #c0392b; color: #c0392b; }
.sync-join input {
  flex: 1 1 15rem; min-width: 0; padding: .3rem .5rem;
  font-family: ui-monospace, monospace; font-size: .9rem;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
}
.sync-code-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
/* Monospace and selectable: it is a string to be copied, not prose. */
.sync-code {
  padding: .25rem .5rem;
  font-family: ui-monospace, monospace; font-size: .95rem;
  letter-spacing: .05em; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  user-select: all;
}
.sync-said { color: var(--text); }

/* What a source IS, when that is not obvious from the source. Muted and
   below the entry: it is a footnote about the material, not a warning
   about the reader's question. */
.source-note {
  margin: .8rem 0 0; padding: .6rem .7rem;
  font-family: system-ui, sans-serif; line-height: 1.5;
  font-size: calc(var(--read-size) * .8);
  color: var(--muted);
  border-left: 3px solid var(--border);
}
.marks-io-said { margin: 0 0 .9rem; font-size: .9rem; color: var(--muted); }
.marks-io-said[hidden] { display: none; }

/* The list of everything marked. */
.marks-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.marks-filters button {
  display: flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; cursor: pointer;
  font: inherit; font-family: system-ui, sans-serif; font-size: .85rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
}
.marks-filters button.on { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.marks-filters .dot {
  width: .85rem; height: .85rem; border-radius: 999px;
  border: 1px solid var(--border);
}
.mark-row {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .7rem 0; border-top: 1px solid var(--border);
}
.mark-row .dot { width: 1rem; height: 1rem; border-radius: 999px; flex: none; margin-top: .35rem; }
.mark-row .body { flex: 1; min-width: 0; }
/* The reference scales too, as the one in a concordance row does. The rule
   is not "references are chrome": a reference that LABELS a row of reading
   text belongs to it, which is why the verse number inside a verse scales as
   well, while the chrome labelling a SCREEN does not. At 30px words over a
   14px reference the row reads as a stylesheet that failed to load. */
.mark-row .ref {
  font-family: system-ui, sans-serif; color: var(--muted);
  font-size: calc(var(--read-size) * .85);
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
}
.mark-row .ref:hover { color: var(--accent); text-decoration: underline; }
.mark-row .words { margin: .15rem 0 0; font-size: var(--read-size); }
.mark-row .note {
  margin: .3rem 0 0; padding-left: .6rem;
  border-left: 3px solid var(--accent);
  font-family: system-ui, sans-serif;
  font-size: calc(var(--read-size) * .85);
}
.mark-row .drop {
  flex: none; padding: .2rem .5rem; cursor: pointer;
  font: inherit; font-size: .85rem; color: var(--muted);
  background: none; border: 1px solid transparent; border-radius: 8px;
}
.mark-row .drop:hover { color: #b3261e; border-color: var(--border); }

/* "Start from…": the picker for a reader who is already part-way through a
   plan. Drawn in place in the plans panel rather than as a dialog, because
   it is the same kind of drill-down the plan list and the devotional
   already are -- and it leaves no history entry, since Back must undo a
   navigation and not a chooser. */
.plan-said {
  margin: 0 0 .8rem; padding: .6rem .7rem;
  font-family: system-ui, sans-serif; font-size: .85rem; line-height: 1.5;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.days.picking { list-style: none; margin: 0; padding: 0; }
.days.picking li { margin: 0; }
.days.picking .pick-start {
  display: block; width: 100%; text-align: left;
  padding: .45rem .6rem; cursor: pointer;
  font: inherit; font-family: system-ui, sans-serif; font-size: .9rem;
  color: var(--text); background: none;
  border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
}
.days.picking .pick-start:hover { background: var(--surface); }
.days.picking .pick-start .day {
  display: inline-block; min-width: 5.5rem;
  color: var(--muted); font-size: .8rem;
}
/* Where the reader is now, so the list means something when it opens. */
.days.picking li.here .pick-start {
  background: var(--surface); font-weight: 600;
}
.start-from { margin-left: .6rem; font-size: .85rem; }

/* Following this plan, and the one click that changes it. Same size as
   Start from, beside it, and the state is in the WORDS rather than in a
   colour: "Follow this plan" against "Following - Stop". An icon alone
   could not say which of the two it meant, the way the interlinear
   chevron can. */
.follow { margin-left: .6rem; font-size: .85rem; }
.follow[data-on="true"] { color: var(--accent); font-weight: 600; }

/* The Listen control on the devotional, beside the date and source line.
   Same markup as the reading screen's slot, so Listen.draw() fills both
   and only the visible one matters. */
.devotional-listen { margin-left: .6rem; }


/* A phone held sideways: fold the chrome instead of scrolling it away.
   -----------------------------------------------------------------
   The Flutter client has done this all along at `_shortViewport` (500
   logical pixels of height) and the web never did, which left the two
   clients furthest apart in exactly the posture the feature was built
   for. Measured at 812x375 before this rule: the first verse began 293
   pixels down, leaving 82 of 375 to read in -- a third of one line.
   Flutter in the same posture leaves 259.

   This came from a review of a competing app asking for precisely it:
   "increase the reading space in LANDSCAPE as much as possible for
   convenient use in church service." People read standing up in a
   service, phone in one hand -- and a reader who has not installed the
   app is in a browser, which is this client.

   The problem sideways is HEIGHT, never width: there are 812 pixels
   across and nothing to spend them on. So the tab row and the reference
   field share one line, which is the same move `_modeSelector` makes.
   Note it is the opposite of the two-pane rule above, and deliberately
   so: two columns a few lines tall would be worse than one. */
@media (max-height: 500px) {
  header {
    padding: .3rem .6rem;
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  }
  /* The title goes. You know which site you are on. */
  header h1 { display: none; }
  .bar { flex: 0 1 auto; gap: .5rem; }
  header form.inputs { flex: 1 1 18rem; margin: 0; }
  .tab { padding: .25rem .55rem; font-size: .85rem; }
  .textsize button { width: 1.75rem; height: 1.75rem; }
  /* The passage's own header earns its place -- it carries Listen and the
     reference -- but not this much of it. */
  #passage-head { padding-top: .3rem; padding-bottom: .3rem; }
  main { padding-top: .4rem; }
  .panel { padding-top: .5rem; }
  /* The plan's Next up row is hidden sideways in the app for the same
     reason: it is the least urgent thing on a screen that has no room. */
  #next-up { display: none; }
}

/* A failure that does not take the reading away: a bar over the passage
   rather than a message in place of it. See showTrouble() in app.js --
   losing the connection mid-chapter must not cost the reader the chapter. */
.trouble {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 .75rem;
  padding: .5rem .75rem;
  border-radius: 6px;
  background: var(--mk-red, #5a2328);
  color: var(--fg);
}
.trouble span { flex: 1; }
.trouble button {
  flex: none;
  padding: .25rem .6rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: none;
  color: inherit;
  cursor: pointer;
}
