/* Reading Together, direction A: player first.
   Body type is Source Sans 3. Display type is Playfair Display. Labels are Poppins.
   Contrast checked against cream #f3efd7 and paper #fbf8ea:
   ink 14.5:1, muted 6.2:1, blue-text 5.9:1, orange-text 5.4:1.
   Brand blue #0173f4 is 3.8:1 on cream, so it carries only large type and icons.
   White on brand blue is 4.4:1, so the Play button uses the darker blue #0057b8, where white is 6.9:1. */

:root {
  --cream: #f3efd7;
  --paper: #fbf8ea;
  --tint: #ebe4c3;
  --rule: #cfc59c;
  --ink: #1c1d26;
  --muted: #5c5848;
  --blue: #0173f4;
  --blue-dark: #0057b8;
  --blue-text: #0057b8;
  --orange: #f66931;
  --orange-text: #a83d0e;
  --focus: #1c1d26;
  --on-blue: #fff;
  --play-hover: #004c9f;
  --play-shadow: #003f86;
  --disabled: #6b6655;
  --mini-bg: #1c1d26;
  --mini-fg: #fbf8ea;
  --mini-sub: #d9d4bd;
  --mini-track: #3a3b46;
  --mini-edge: #1c1d26;
  color-scheme: light;

  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --label: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;

  --gutter: 16px;
  --radius: 14px;
}

/* Dark theme. The page follows the device setting unless the visitor picks
   Light or Dark in the footer, which sets data-theme on the html element.
   Contrast checked against page #16140f and paper #211e17: ink 14.0:1,
   muted 7.8:1, blue 6.8:1, blue-text 8.5:1, orange-text 7.8:1. White on the
   Play button #1067d6 is 5.3:1. The two blocks below hold the same values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #16140f;
    --paper: #211e17;
    --tint: #2d291f;
    --rule: #4d4737;
    --ink: #f1ecd8;
    --muted: #b9b196;
    --blue: #5ea8ff;
    --blue-dark: #1067d6;
    --blue-text: #86bdff;
    --orange-text: #ff9668;
    --focus: #f1ecd8;
    --play-hover: #1a6fe0;
    --play-shadow: #083f86;
    --disabled: #948c75;
    --mini-bg: #2d291f;
    --mini-fg: #f1ecd8;
    --mini-sub: #b9b196;
    --mini-track: #4d4737;
    --mini-edge: #4d4737;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --cream: #16140f;
  --paper: #211e17;
  --tint: #2d291f;
  --rule: #4d4737;
  --ink: #f1ecd8;
  --muted: #b9b196;
  --blue: #5ea8ff;
  --blue-dark: #1067d6;
  --blue-text: #86bdff;
  --orange-text: #ff9668;
  --focus: #f1ecd8;
  --play-hover: #1a6fe0;
  --play-shadow: #083f86;
  --disabled: #948c75;
  --mini-bg: #2d291f;
  --mini-fg: #f1ecd8;
  --mini-sub: #b9b196;
  --mini-track: #4d4737;
  --mini-edge: #4d4737;
  color-scheme: dark;
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* The list of readings did not load: hide the parts that need it. */
body.is-unloaded .byline,
body.is-unloaded .daybar,
body.is-unloaded .back-today,
body.is-unloaded .day-side { display: none; }

body.has-mini { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--blue-text); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Masthead */

.masthead { border-bottom: 1px solid var(--rule); }

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-height: 44px;
  border-radius: 6px;
}

.brand-star { width: 24px; height: 24px; fill: var(--orange); flex: none; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }

.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(20px, 5.6vw, 26px);
  color: var(--blue);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-sub {
  font-family: var(--label);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange-text);
  margin-top: 3px;
  white-space: nowrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 13px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--label);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { background: var(--paper); }

main.wrap { padding-top: 16px; padding-bottom: 40px; }

/* Hero: the day and its player */

.hero {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 26px 18px 22px;
  text-align: center;
  /* The chapter title is sized against the card's own width. */
  container-type: inline-size;
}
/* A second hairline inside the first, like a printed bulletin frame. */
.hero::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--tint);
  border-radius: calc(var(--radius) - 5px);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--label);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange-text);
}
.eyebrow-star { width: 14px; height: 14px; fill: var(--orange); }

.day-date {
  margin-top: 6px;
  font-size: 20px;
  color: var(--ink);
}

.chapter {
  margin-top: 6px;
  font-family: var(--display);
  font-weight: 600;
  /* "2 Thessalonians" is about 7.1 em wide and must fit on one line, so the
     size stays under 14 percent of the card's inner width. */
  font-size: clamp(36px, 11vw, 84px);
  font-size: clamp(36px, 13cqi, 84px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--blue);
  text-wrap: balance;
}
.chapter:focus { outline: none; }
.chapter:focus-visible { outline: 3px solid var(--focus); }

.byline {
  margin-top: 8px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 19px;
  color: var(--muted);
}

/* Player */

.player { margin-top: 18px; }

.transport {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  gap: 4px;
}

.seal {
  position: relative;
  width: 176px;
  height: 176px;
  display: grid;
  place-items: center;
}
.seal-mark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: var(--orange);
  stroke: var(--orange);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.play-btn {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 0;
  background: var(--blue-dark);
  color: var(--on-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--play-shadow);
  transition: transform 120ms ease, background-color 120ms ease;
}
.play-btn:hover { background: var(--play-hover); }
.play-btn:active { transform: translateY(1px); box-shadow: none; }
.play-btn:focus-visible { outline-offset: 6px; }
.play-icon { width: 46px; height: 46px; fill: currentColor; }
.play-word {
  font-family: var(--label);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.1;
  /* Wide enough for "Resume", so the word never changes the layout. */
  min-width: 5em;
  text-align: center;
}
.player.is-loading .play-btn { cursor: progress; }

.side-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 72px;
  padding: 4px;
  background: none;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  color: var(--ink);
}
.side-icon {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  background: var(--paper);
}
.side-icon svg { width: 30px; height: 30px; fill: currentColor; }
.side-num {
  position: absolute;
  font-family: var(--label);
  font-weight: 600;
  font-size: 11px;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.side-speed {
  font-family: var(--label);
  font-weight: 600;
  font-size: 18px;
}
.side-cap {
  font-family: var(--label);
  font-weight: 500;
  font-size: 15px;
}
.side-btn:hover .side-icon { background: var(--tint); }

/* Speed panel: opens under the buttons when Speed is tapped. */
.speed-panel {
  max-width: 420px;
  margin: 12px auto 0;
  padding: 6px 14px 12px;
  background: var(--cream);
  border: 1.5px solid var(--rule);
  border-radius: 14px;
  text-align: left;
}
.speed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.speed-label { font-family: var(--label); font-weight: 500; font-size: 15px; color: var(--muted); }
.speed-now { margin-left: 6px; font-weight: 600; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.speed-done { margin-right: -8px; }
.speed-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.speed-presets .chip { background: var(--paper); font-weight: 600; font-size: 16px; }
.speed-presets .chip[aria-pressed="true"] { background: var(--ink); }
#speed-range { margin-top: 4px; }
/* The focus ring goes on the handle, so it does not cover the labels below. */
#speed-range:focus-visible { outline: none; }
#speed-range:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--focus); outline-offset: 2px; }
#speed-range:focus-visible::-moz-range-thumb { outline: 3px solid var(--focus); outline-offset: 2px; }
.speed-ends {
  display: flex;
  justify-content: space-between;
  margin-top: -8px;
  font-family: var(--label);
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.side-btn[aria-expanded="true"] .side-icon { background: var(--tint); }

/* Before the first play, only the big button shows. */
.player[data-state="idle"] .speed-panel { display: none; }
.player[data-state="idle"] .side-btn { visibility: hidden; }
/* Before the first play, only the big button shows, plus a quiet way to
   mark a day heard for people who listened in a podcast app. */
.player[data-state="idle"] .scrub,
.player[data-state="idle"] #read-link,
.player[data-state="idle"] #share { display: none; }
.player[data-state="idle"] .actions { display: flex; justify-content: center; margin-top: 6px; }
.player[data-state="idle"] #done-toggle { border-color: transparent; background: transparent; color: var(--muted); }
.player[data-state="idle"] #done-toggle .done-box { border-color: var(--muted); }
.player[data-state="idle"] #done-toggle[aria-pressed="true"] { color: var(--ink); }
.player[data-state="idle"] #done-toggle[aria-pressed="true"] .done-box { fill: var(--paper); background: var(--ink); border-color: var(--ink); }

.play-meta {
  margin-top: 4px;
  font-size: 18px;
  color: var(--muted);
  min-height: 27px;
}

.scrub { margin: 14px auto 0; max-width: 520px; }

input.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --pct: 0%;
}
input.range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 8px;
  background: linear-gradient(to right, var(--blue) var(--pct), var(--tint) var(--pct));
  border: 1px solid var(--rule);
}
input.range::-moz-range-track {
  height: 8px;
  border-radius: 8px;
  background: var(--tint);
  border: 1px solid var(--rule);
}
input.range::-moz-range-progress {
  height: 8px;
  border-radius: 8px;
  background: var(--blue);
}
input.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--blue-dark);
}
input.range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--blue-dark);
}
input.range:focus-visible { outline-offset: 0; }

.times {
  font-family: var(--label);
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  color: var(--muted);
  margin-top: -4px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 420px;
  margin: 16px auto 0;
}
.actions a.action { grid-column: 1 / -1; }
.action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-height: 48px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1.5px solid var(--rule);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.action svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.action:hover { border-color: var(--ink); }
a.action { color: var(--blue-text); border-color: var(--blue-text); }
#done-toggle .done-box {
  width: 22px; height: 22px;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  fill: transparent;
  padding: 1px;
}
#done-toggle[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
#done-toggle[aria-pressed="true"] .done-box {
  fill: var(--ink);
  background: var(--paper);
  border-color: var(--paper);
}

.notice:empty { display: none; }
.notice {
  margin: 16px auto 0;
  max-width: 520px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--cream);
  border: 1px solid var(--rule);
  font-size: 18px;
  text-align: left;
}
.notice.is-error { border-color: var(--orange-text); border-left-width: 5px; }
.notice .notice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.notice button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
}
.notice button.primary { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--on-blue); }

.missing { margin-top: 22px; }
.missing-text { font-size: 19px; max-width: 30ch; margin: 0 auto; }

/* Previous and next day */

.daybar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.day-step {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--rule);
  background: var(--paper);
  cursor: pointer;
  text-align: left;
}
.day-step.next { justify-content: flex-end; text-align: right; }
.day-step svg { width: 22px; height: 22px; fill: var(--ink); flex: none; }
.day-step:hover:not([aria-disabled="true"]) { border-color: var(--ink); }
.step-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.step-label {
  font-family: var(--label);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--muted);
}
.day-step strong {
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  overflow-wrap: break-word;
}
.step-sub { font-size: 18px; color: var(--muted); }
.day-step[aria-disabled="true"] {
  cursor: default;
  background: transparent;
  border-style: dashed;
}
.day-step[aria-disabled="true"] .step-label { color: var(--orange-text); }

.back-today { margin-top: 12px; text-align: center; }
.text-btn {
  min-height: 44px;
  padding: 0 12px;
  background: none;
  border: 0;
  color: var(--blue-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 18px;
}

/* Catch up */

.day-side { margin-top: 30px; }

.section-head { margin-bottom: 12px; }
.catchup h2, .books h2 {
  font-family: var(--display);
  font-size: 28px;
  color: var(--ink);
}
.section-note { color: var(--muted); font-size: 18px; margin-top: 2px; }

.week {
  list-style: none;
  margin: 0 calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 10px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding: 0 var(--gutter);
}
.week li { flex: none; scroll-snap-align: start; }
.day-card {
  position: relative;
  /* At least 150px, and wider when a title such as "1 Thessalonians" needs it. */
  width: min-content;
  min-width: 150px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 12px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--rule);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
}
.day-card:hover { border-color: var(--ink); }
.day-card[aria-current="true"] { border: 2.5px solid var(--blue-dark); padding: 11px 11px 9px; }
.card-day {
  font-family: var(--label);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange-text);
}
.card-date { font-size: 18px; color: var(--muted); }
.card-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.15;
  margin-top: 4px;
}
.card-state {
  font-family: var(--label);
  margin-top: auto;
  padding-top: 6px;
  font-size: 18px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-state svg { width: 18px; height: 18px; fill: var(--orange); }
.day-card.is-done .card-state { color: var(--ink); }

/* Progress */

.progress {
  margin-top: 22px;
  padding: 16px 0 0;
  border-top: 1px solid var(--rule);
}
.progress-count { font-size: 19px; }
.progress-count strong { font-size: 24px; color: var(--ink); }
.progress-streak { margin-top: 2px; font-size: 18px; }
.progress-note { margin-top: 6px; font-size: 18px; color: var(--muted); }

/* Past readings */

.past-head { padding: 8px 0 18px; }
.past-title {
  font-family: var(--display);
  font-size: clamp(38px, 11vw, 60px);
  color: var(--blue);
  line-height: 1.05;
}
.past-title:focus { outline: none; }
.past-intro { margin-top: 6px; color: var(--muted); }

.cal-panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 12px 18px;
}

.picker { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.years, .months { display: grid; gap: 6px; }
.years { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
.months { grid-template-columns: repeat(6, 1fr); }
.chip {
  min-height: 44px;
  padding: 0 6px;
  border-radius: 10px;
  border: 1.5px solid var(--rule);
  background: var(--cream);
  font-family: var(--label);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
}
.chip:hover:not(:disabled) { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip:disabled { cursor: default; color: var(--disabled); background: transparent; border-style: dashed; }

.cal-head {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  margin-top: 18px;
}
.cal-month {
  text-align: center;
  font-family: var(--display);
  font-size: 26px;
}
.icon-btn {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  background: var(--cream);
  cursor: pointer;
}
.icon-btn svg { width: 24px; height: 24px; fill: var(--ink); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }

.cal-weekdays, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.cal-weekdays {
  margin-top: 12px;
  font-family: var(--label);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.cal-grid { list-style: none; margin: 6px 0 0; padding: 0; }
.cal-grid li { min-width: 0; }
.cal-day {
  position: relative;
  width: 100%;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 2px 4px;
  border-radius: 10px;
  border: 1.5px solid var(--rule);
  background: var(--cream);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
button.cal-day:hover { border-color: var(--ink); }
.cal-num { font-family: var(--label); font-size: 18px; font-weight: 600; line-height: 1.1; }
.cal-title { display: none; }
.cal-mark { width: 14px; height: 14px; fill: var(--orange); margin-top: 3px; }
.cal-day.is-empty {
  cursor: default;
  background: transparent;
  border: 1.5px dashed transparent;
  color: var(--disabled);
}
.cal-day.is-empty .cal-num { font-weight: 400; }
.cal-day.is-gap { border-color: var(--rule); }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--orange); }
.cal-day[aria-current="true"] { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--on-blue); }
.cal-day[aria-current="true"] .cal-mark { fill: var(--on-blue); }

.cal-summary { margin-top: 14px; font-size: 18px; }
.cal-key { margin-top: 6px; font-size: 18px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cal-key svg { width: 14px; height: 14px; fill: var(--orange); flex: none; }

.books { margin-top: 30px; }
.book-group { margin-top: 16px; }
.book-group h3 {
  font-family: var(--label);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange-text);
  margin-bottom: 8px;
}
.book-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.book-btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--rule);
  background: var(--paper);
  font-family: var(--body);
  font-size: 18px;
  cursor: pointer;
}
.book-btn:hover { border-color: var(--ink); }
.book-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.chapters:empty { display: none; }
.chapters {
  margin-top: 18px;
  padding: 16px 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.chapters h3 { font-family: var(--display); font-size: 24px; }
.chapters p { color: var(--muted); margin-top: 2px; }
.chapter-grid {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
}
.ch-btn {
  position: relative;
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  border: 1.5px solid var(--rule);
  background: var(--cream);
  font-family: var(--label);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.ch-btn:hover:not(:disabled) { border-color: var(--ink); }
.ch-btn:disabled { cursor: default; background: transparent; border-style: dashed; color: var(--disabled); font-weight: 400; }
.ch-btn .ch-mark { position: absolute; top: 3px; right: 3px; width: 12px; height: 12px; fill: var(--orange); }
.ch-btn[aria-current="true"] { background: var(--blue-dark); color: var(--on-blue); border-color: var(--blue-dark); }
.ch-btn[aria-current="true"] .ch-mark { fill: var(--on-blue); }

/* Footer */

.footer { border-top: 1px solid var(--rule); padding: 26px 0 30px; }
.subscribe-label {
  font-family: var(--label);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.subscribe-links {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
}
.subscribe-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 18px;
  text-underline-offset: 3px;
}
.colophon { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; color: var(--muted); font-size: 18px; }
.colophon img { flex: none; filter: grayscale(1) brightness(2) contrast(2); mix-blend-mode: multiply; }
/* The logo is black on white. On the dark page it is inverted and blended the
   other way, so the white background drops out. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .colophon img { filter: grayscale(1) brightness(2) contrast(2) invert(1); mix-blend-mode: screen; }
}
:root[data-theme="dark"] .colophon img { filter: grayscale(1) brightness(2) contrast(2) invert(1); mix-blend-mode: screen; }

/* A link inside a sentence. The padding makes the tap area 44px tall and the
   negative margin keeps the line where it was. */
.text-link { display: inline-block; padding: 12px 0; margin: -12px 0; text-underline-offset: 3px; }

.esv-credit { margin-top: 16px; max-width: 70ch; font-size: 15px; line-height: 1.45; color: var(--muted); }

/* Light, dark or the device setting */
.theme { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 18px; }
.theme-label {
  font-family: var(--label);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.theme-options { display: flex; gap: 6px; }
.theme-options .chip { min-width: 76px; padding: 0 12px; }

/* Mini player, shown while the hero player is off screen */

.mini {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  background: var(--mini-bg);
  color: var(--mini-fg);
  border-top: 1px solid var(--mini-edge);
  padding-bottom: env(safe-area-inset-bottom);
}
.mini[hidden] { display: none; }
.mini-bar { height: 4px; background: var(--mini-track); }
.mini-bar span { display: block; height: 100%; width: 0; background: var(--orange); }
.mini-inner { display: flex; align-items: center; gap: 12px; min-height: 68px; }
.mini-play {
  width: 52px; height: 52px; flex: none;
  border-radius: 50%;
  border: 0;
  background: var(--blue);
  color: var(--on-blue);
  display: grid; place-items: center;
  cursor: pointer;
}
.mini-play svg { width: 26px; height: 26px; fill: currentColor; }
.mini-title {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  background: none;
  border: 0;
  color: var(--mini-fg);
  text-align: left;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 8px;
}
.mini-title strong { font-family: var(--display); font-size: 20px; }
.mini-title span { font-size: 18px; color: var(--mini-sub); font-variant-numeric: tabular-nums; }
.mini :focus-visible { outline-color: var(--mini-fg); }

/* Wider screens */

@media (max-width: 389px) {
  .hero { padding-left: 10px; padding-right: 10px; }
  .seal { width: 150px; height: 150px; }
  .play-btn { width: 118px; height: 118px; }
  .side-btn { min-width: 0; width: 68px; }
  .side-icon { width: 52px; height: 52px; }
  .brand-sub { letter-spacing: 0.1em; font-size: 11px; }
  .nav-link { padding: 0 11px; font-size: 14px; }
  .step-label { font-size: 12px; letter-spacing: 0.04em; }
  .daybar { gap: 8px; }
  .day-step { padding: 10px 6px; }
}

/* The narrowest phones, 320px wide. */
@media (max-width: 359px) {
  .masthead-inner { gap: 8px; }
  .brand { gap: 7px; }
  .brand-star { width: 20px; height: 20px; }
  .brand-name { font-size: 18px; }
  .brand-sub { font-size: 10px; letter-spacing: 0.08em; }
  .nav-link { padding: 0 9px; font-size: 13px; }
  .seal { width: 132px; height: 132px; }
  .play-btn { width: 104px; height: 104px; }
  .play-icon { width: 38px; height: 38px; }
  .play-word { font-size: 18px; }
  .side-btn { width: 60px; }
  .side-icon { width: 48px; height: 48px; }
  .side-speed { font-size: 16px; }
  .side-cap { font-size: 13px; }
}

/* On phones the arrow sits beside the small label, so a long title such as
   "2 Thessalonians 3" gets the whole width of the button. */
@media (max-width: 559px) {
  .day-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 4px;
    row-gap: 0;
    align-items: center;
    align-content: center;
  }
  .day-step .step-text { display: contents; }
  .day-step .step-text > * { grid-column: 1 / -1; min-width: 0; }
  .day-step .step-label { grid-column: 2; grid-row: 1; }
  .day-step.prev svg { grid-column: 1; grid-row: 1; }
  .day-step.next { grid-template-columns: minmax(0, 1fr) auto; }
  .day-step.next .step-label { grid-column: 1; }
  .day-step.next svg { grid-column: 2; grid-row: 1; }
  .day-step svg { width: 18px; height: 18px; }

  /* The calendar panel runs to the screen edges, so each of the seven day
     cells is at least 44px wide from 360px up. */
  .cal-panel {
    margin-left: calc(var(--gutter) * -1);
    margin-right: calc(var(--gutter) * -1);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 16px 8px 18px;
  }
}

@media (min-width: 560px) {
  :root { --gutter: 24px; }
  .hero { padding: 34px 28px 28px; }
  .cal-panel { padding: 22px 20px; }
  .months { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .months .chip { padding: 0; font-size: 14px; }
  .cal-day { min-height: 76px; }
  .cal-title {
    display: block;
    font-size: 13px;
    line-height: 1.2;
    margin-top: 3px;
    color: var(--muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cal-day[aria-current="true"] .cal-title { color: var(--on-blue); }
}

@media (min-width: 960px) {
  main.wrap { padding-top: 28px; }
  .day-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 36px;
    align-items: start;
  }
  .day-side { margin-top: 0; }
  .week {
    flex-direction: column;
    overflow: visible;
    margin: 0;
    padding: 0;
    gap: 8px;
  }
  .day-card {
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 96px 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    padding: 10px 14px;
  }
  .day-card[aria-current="true"] { padding: 9px 13px; }
  .card-day { grid-column: 1; grid-row: 1; }
  .card-date { grid-column: 1; grid-row: 2; }
  .card-title { grid-column: 2; grid-row: 1 / 3; margin: 0; }
  .card-state { grid-column: 3; grid-row: 1 / 3; margin: 0; padding: 0; }
  .hero { padding: 40px 40px 32px; }
  .past-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
  }
  .books { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
