/* app.css - the public app's screens. Tokens live in core.css; the rules are in DESIGN.md.
   Primary layout: iPad landscape (1180×820); portrait works too.
   Touch targets ≥ 64px; session text ≥ 28px; no text under 19px; forest green for all
   normal-size text. */

html, body { height: 100%; }
body { font-size: 22px; line-height: 1.6; -webkit-tap-highlight-color: transparent; }
#app { height: 100dvh; }
.screen { height: 100%; display: flex; flex-direction: column; padding: 16px 24px; gap: 14px; }
/* Secondary text stays forest green (DESIGN.md): it's set apart by size, not a lighter grey. */
.muted { color: var(--ink); }
.small { font-size: 19px; }
.big-text { font-size: var(--text-session); line-height: 1.65; }
h1, h2 { font-weight: 700; line-height: 1.3; margin: 0; }
h1:focus, h2:focus { outline: none; }
/* The scrolling card is focusable so keyboard users can scroll it; ring only for keyboard focus. */
.card:focus:not(:focus-visible) { outline: none; }
/* Visible to screen readers only (e.g. each screen's main heading). */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.pill {
  min-height: var(--touch); padding: 0 26px; border-radius: 999px;
  border: 2px solid var(--control-border); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 22px; font-weight: 700;
}
.pill.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pill.selected { background: var(--highlight); border-color: var(--ink); color: var(--ink); }
.pill.big { min-height: 76px; font-size: 26px; }
.pill:disabled { opacity: 0.4; cursor: default; }
.pill.attention { box-shadow: 0 0 0 6px var(--highlight); }
.round {
  width: 104px; height: 104px; border-radius: 50%; border: none; flex: none;
  background: var(--primary); color: var(--on-primary); display: grid; place-items: center;
}
/* Paused: yellow, so "tap to resume" stands out; the outline keeps its edge visible on cream. */
.round.is-paused { background: var(--highlight); color: var(--ink); box-shadow: inset 0 0 0 3px var(--ink); }
.round:disabled { background: var(--tag); color: var(--ink); opacity: 0.6; cursor: default; }
.icon { display: inline-grid; place-items: center; width: 30px; height: 30px; }
.icon svg { width: 100%; height: 100%; fill: currentColor; }
.round .icon { width: 48px; height: 48px; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
.select {
  min-height: var(--touch); border-radius: 14px; border: 2px solid var(--control-border);
  background: var(--surface); padding: 0 16px; font-size: 22px;
}

/* ---------- Home ---------- */
.home { justify-content: center; align-items: center; gap: 36px; }
.welcome { font-size: 64px; }
.tiles { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 24px; width: 100%; max-width: 1100px; }
.tiles.three { grid-template-columns: repeat(3, 1fr); }
.tile {
  min-height: 260px; border-radius: 28px; border: 2px solid var(--control-border);
  background: var(--surface); color: var(--ink); padding: 28px; text-align: left;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
}
.tile.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.tile-title { font-size: 34px; font-weight: 700; line-height: 1.25; }
.tile-sub { font-size: 21px; line-height: 1.5; }
.aide-link { color: var(--ink); font-size: 20px; padding: 14px 20px; min-height: 48px; }
.tap-to-start { justify-content: center; align-items: center; }
.tap-to-start .tile { min-width: 420px; align-items: center; justify-content: center; text-align: center; }

/* ---------- Top bar / card / bottom bar (session layout) ---------- */
.topbar { display: flex; align-items: center; gap: 16px; min-height: 76px; }
.topbar .day, .topbar .screen-title { margin: 0; }
.topbar .day { margin-left: auto; font-size: 22px; white-space: nowrap; }
.screen-title { font-size: 30px; font-weight: 700; line-height: 1.3; flex: 1; text-align: center; }
.steps { list-style: none; display: flex; gap: 8px; margin: 0 auto; padding: 0; flex-wrap: wrap; justify-content: center; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.steps li + li::before { content: '→'; color: var(--ink); }
.step-pill { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 2px solid transparent; }
.steps li.current .step-pill { color: var(--ink); border-color: var(--ink); background: var(--highlight); font-weight: 700; }
.steps li.done .step-pill { color: var(--ink); }
.steps li.done .icon { color: var(--ink); width: 24px; height: 24px; }
.card {
  flex: 1; min-height: 0; overflow: auto; background: var(--surface);
  border: 2px solid var(--line); border-radius: 24px; padding: 28px 40px;
}
.bottombar { display: flex; align-items: center; gap: 16px; min-height: 112px; }
.bottombar .round { margin: 0 auto; }
.bottombar > .pill:last-child { margin-left: auto; }

/* Study runner: big Back / Next arrows on either side of the card, as tall as the card.
   Older testers had trouble finding small buttons in the bottom bar. */
.stage-row { flex: 1; min-height: 0; display: flex; align-items: stretch; gap: 16px; }
.side-arrow {
  flex: none; width: 112px; padding: 0; border-radius: 24px;
  border: 3px solid var(--control-border); background: var(--surface); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 22px; font-weight: 700;
}
.side-arrow .icon { width: 72px; height: 72px; }
.side-arrow.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.side-arrow:disabled { opacity: 0.3; cursor: default; }
.side-arrow.attention { box-shadow: 0 0 0 6px var(--highlight); }
/* The module panel: the scrolling card with a control bar joined to its bottom
   (Again · Pause · the module's tools). Used in a study and in Sing a Hymn. */
.module-panel {
  flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 2px solid var(--line); border-radius: 24px;
}
.module-panel > .card { border: none; border-radius: 0; }
.module-panel > .card:focus-visible { outline-offset: -4px; } /* the panel clips outside rings */
.panel-bar {
  /* Sing again · Pause · Show sheet music: the two side buttons share the space equally. */
  container-type: inline-size;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  gap: 16px; padding: 12px 16px; background: var(--bg); border-top: 2px solid var(--line);
}
.panel-bar .round { width: 88px; height: 88px; }
.panel-bar .round .icon { width: 42px; height: 42px; }
.panel-tools { display: flex; gap: 16px; min-width: 0; }
.panel-tools > * { flex: 1; }
/* Side controls (ui.js roundControl): as tall as Pause, fully rounded ends, icon + word inside,
   all with the same outlined paper look. */
.ctl {
  width: 100%; min-width: 0; height: 88px; border-radius: 44px; padding: 0 18px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 3px solid var(--control-border); background: var(--surface); color: var(--ink);
  font-size: 22px; font-weight: 700; line-height: 1.1; text-align: center;
}
.ctl-circle { display: grid; place-items: center; flex: none; }
.ctl-circle .icon { width: 34px; height: 34px; }
.ctl:disabled { opacity: 0.4; cursor: default; }
/* A narrow bar (portrait phone, small window): each side button becomes a circle the size
   of Pause with its word underneath. */
@container (max-width: 520px) {
  .ctl {
    height: auto; padding: 0; border: none; background: none; border-radius: 0;
    flex-direction: column; gap: 4px; font-size: 19px;
  }
  .ctl-circle {
    width: 80px; height: 80px; border-radius: 50%;
    border: 3px solid var(--control-border); background: var(--surface);
  }
  .ctl:focus-visible { outline: none; }
  .ctl:focus-visible .ctl-circle { outline: 4px solid var(--focus); outline-offset: 3px; }
}

/* ---------- Hymn ---------- */
.hymn-panel .title, .reading-panel .title { font-size: 40px; }
.verse-label { font-size: 22px; margin: 4px 0 12px; min-height: 1.4em; }
.lyrics .lyric-line { font-size: 32px; }
.row { display: flex; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- Scripture / prayer ---------- */
.badge {
  display: inline-block; background: var(--tag); color: var(--ink); border-radius: 999px;
  padding: 4px 14px; font-size: 19px; font-weight: 700; margin: 6px 0 12px;
}
.read-line { font-size: var(--text-session); line-height: 1.65; margin: 0 0 14px; padding: 4px 10px; border-radius: 10px; }
.read-line.reading { background: var(--highlight); }
.vnum { font-size: 0.68em; font-weight: 700; } /* 19px: the smallest tablet text */
.reading-panel.centered { text-align: center; max-width: 900px; margin: 0 auto; }
.attribution { margin-top: 20px; }

/* ---------- Finished ---------- */
.done { justify-content: center; }
.done-card { flex: none; text-align: center; padding: 36px; }
.done-card h1 { font-size: 44px; margin-bottom: 12px; }
.aide-notes { margin-top: 18px; border-top: 2px solid var(--line); padding-top: 14px; }
.thumbs { display: flex; gap: 20px; justify-content: center; }
/* Thumbs up / down (ui.js thumbButtons): circles; the chosen one is filled. */
.thumb {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 3px solid var(--control-border); background: var(--surface); color: var(--ink);
}
.thumb .icon { width: 34px; height: 34px; }
.thumb[aria-pressed="true"] { background: var(--highlight); border-color: var(--ink); color: var(--ink); }
.done .tile { min-height: 150px; }
.done .tiles { max-width: none; }

/* ---------- Sing a Hymn ---------- */
.hymn-grid { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 16px; min-height: 0; }
.hymn-tile {
  border-radius: 20px; border: 2px solid var(--control-border); background: var(--surface); color: var(--ink);
  padding: 16px 20px; text-align: left; display: flex; flex-direction: column; gap: 6px; min-height: 120px;
}
.hymn-tile-title { font-size: 25px; font-weight: 700; line-height: 1.3; }
.hymn-tile-line { font-size: 19px; line-height: 1.5; }
.tag { align-self: flex-start; margin-top: auto; background: var(--tag); color: var(--ink); border-radius: 999px; padding: 2px 12px; font-size: 19px; font-weight: 700; }

/* ---------- Aide tools ---------- */
.aide-card section { padding: 16px 0; border-bottom: 2px solid var(--line); }
.aide-card section:last-child { border-bottom: none; }
.aide-card h2 { font-size: 28px; margin-bottom: 12px; }
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; margin-bottom: 16px; }
.day-btn { min-height: var(--touch); border-radius: 14px; border: 2px solid var(--control-border); background: var(--surface); font-size: 24px; font-weight: 700; }
.day-btn.selected { background: var(--highlight); border-color: var(--ink); color: var(--ink); }
.choice-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.slider { width: min(520px, 100%); height: var(--touch); }

/* ---------- Read the Bible ---------- */
.picker { display: flex; gap: 10px; margin: 0 auto; }
.read-bar { align-items: center; }
.music-options { display: flex; flex-direction: column; gap: 4px; font-size: 19px; line-height: 1.4; }
.switch { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.switch input { width: 28px; height: 28px; }
.read-bar .round { margin: 0 0 0 auto; width: 88px; height: 88px; }

/* ---------- Messages & dialogs ---------- */
.message { justify-content: center; align-items: center; text-align: center; }
.dialog { border: none; border-radius: 24px; padding: 32px; max-width: 560px; background: var(--surface); color: var(--ink); }
.dialog::backdrop { background: var(--backdrop); }
.dialog { border: 2px solid var(--line); }
.dialog p { font-size: 24px; line-height: 1.6; margin: 0 0 24px; }
.dialog-buttons { display: flex; gap: 16px; justify-content: flex-end; }

/* ---------- Choose a Study ---------- */
/* 3 wide; each row is half the visible area (so 6 cards fill a screen) and extra rows scroll.
   A few plans keep that size at the top instead of stretching. */
.study-grid {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start;
  grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: max(170px, calc((100% - 16px) / 2)); gap: 16px;
  padding: 4px; margin: -4px; /* room for the focus ring and tile borders inside the scroller */
}
.study-grid:focus:not(:focus-visible) { outline: none; }
.study-tile {
  border-radius: 20px; border: 2px solid var(--control-border); background: var(--surface); color: var(--ink);
  padding: 18px 22px; text-align: left; display: flex; flex-direction: column; gap: 6px; min-height: 150px;
}
.study-tile-title { font-size: 26px; font-weight: 700; line-height: 1.3; }
.study-tile-desc { font-size: 19px; line-height: 1.5; }
.study-tile-meta { font-size: 19px; color: var(--ink); margin-top: auto; }
.tags { display: flex; gap: 8px; }
.tag.quiet { background: var(--surface); color: var(--ink); border: 2px solid var(--control-border); }

/* ---------- Study runner: "Part 2 of 6" + progress bar ---------- */
.where-box { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.where { margin: 0; font-size: 22px; font-weight: 700; color: var(--ink); }
.progress { display: flex; gap: 4px; width: min(420px, 100%); }
.progress span { flex: 1; height: 10px; border-radius: 5px; background: var(--tag); }
.progress span.done { background: var(--control-border); }
.progress span.now { background: var(--primary); }
.plan-name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Quiz (gentle: the answer is shown, nothing is scored) ---------- */
.quiz-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 18px 0; }
.quiz-choice {
  min-height: 88px; border-radius: 18px; border: 2px solid var(--control-border); background: var(--surface);
  font-size: var(--text-session); line-height: 1.4; padding: 10px 18px; color: var(--ink);
}
.quiz-choice.picked { border-color: var(--ink); border-width: 3px; }
.quiz-choice.answer { background: var(--highlight); border-color: var(--ink); border-width: 3px; }
.quiz-reveal { font-size: var(--text-session); line-height: 1.6; min-height: 1.6em; margin: 0 0 12px; }

/* ---------- Finish the Line ---------- */
.finish-line { font-size: 34px; line-height: 1.6; margin: 18px 0; }
.finish-blank { color: var(--ink-soft); letter-spacing: 4px; }
.finish-blank.revealed { color: var(--ink); background: var(--highlight); border-radius: 8px; padding: 0 6px; letter-spacing: normal; }

/* ---------- Small aide controls (kept modest; aides, not residents) ---------- */
.aide-row { margin-top: 24px; padding-top: 12px; border-top: 2px solid var(--line); }

/* ---------- Portrait (e.g. 820×1180) and small screens ---------- */
@media (orientation: portrait), (max-width: 900px) {
  .tiles, .tiles.three { grid-template-columns: 1fr; }
  .tile { min-height: 150px; }
  .hymn-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; overflow: auto; }
  .study-grid { grid-auto-rows: max(170px, calc((100% - 32px) / 3)); } /* portrait: 3 rows fill the screen */
  .quiz-choices { grid-template-columns: 1fr; }
  .plan-name { display: none; }
  .topbar { flex-wrap: wrap; }
  .steps { order: 3; width: 100%; }
  .card { padding: 22px 24px; }
  .panel-bar { gap: 10px; padding: 10px 12px; }
  .bottombar { flex-wrap: wrap; gap: 12px; }
  .bottombar .round { width: 92px; height: 92px; }
  .stage-row { gap: 10px; }
  .side-arrow { width: 84px; font-size: 19px; }
  .side-arrow .icon { width: 56px; height: 56px; }
}
/* Phones: one card per row. */
@media (max-width: 600px) {
  .study-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(150px, auto); }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ---------- Study plan page (#/plan/<id>) ---------- */
.plan-card { display: flex; flex-direction: column; gap: 18px; }
.plan-desc { font-size: 24px; line-height: 1.6; margin: 0; }
.continue { align-self: flex-start; }
.study-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.study-row {
  width: 100%; min-height: 88px; display: flex; align-items: center; gap: 18px; text-align: left;
  padding: 14px 20px; border-radius: 18px; border: 2px solid var(--control-border);
  background: var(--surface); color: var(--ink);
}
/* Next up: a forest outline with a yellow ring, the same "press this next" signal as .attention. */
.study-row.next { border-color: var(--ink); border-width: 3px; box-shadow: 0 0 0 5px var(--highlight); }
.study-row:disabled { opacity: 0.5; cursor: default; }
.study-num {
  flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); border: 2px solid var(--control-border); font-size: 22px; font-weight: 700;
}
.study-row.done .study-num { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.study-row.done .study-num .icon { width: 30px; height: 30px; }
.study-row-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.study-row-title { font-size: 25px; font-weight: 700; line-height: 1.3; }
.study-row-meta { font-size: 19px; }
.mini-progress { display: flex; gap: 4px; flex-wrap: wrap; }
.mini-progress span { width: 14px; height: 8px; border-radius: 4px; background: var(--tag); }
.mini-progress span.done { background: var(--primary); }
.link-button {
  align-self: flex-start; background: none; border: none; color: var(--ink); text-decoration: underline;
  font-size: 20px; padding: 12px 4px; min-height: 48px;
}

/* ---------- Read-aloud switch in the study top bar (off by default) ---------- */
.voice-toggle { white-space: nowrap; font-size: 19px; }
.voice-toggle.on { background: var(--highlight); border-color: var(--ink); color: var(--ink); }

/* ---------- Home: four tiles + Aide tools in the corner ---------- */
.home { position: relative; }
.tiles.four { grid-template-columns: repeat(2, 1fr); max-width: 980px; }
.tiles.four .tile { min-height: 200px; }
.aide-link.corner { position: absolute; top: 12px; right: 16px; }

/* ---------- AI: "Added for you" / "Picked for you" (soft yellow), reasons ---------- */
.tag.added {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 0;
  background: var(--highlight); color: var(--ink); border: 2px solid var(--ink);
}
.tag.added .icon { width: 20px; height: 20px; }
.reason { font-size: 19px; line-height: 1.5; border-left: 4px solid var(--highlight); padding-left: 10px; }

/* ---------- My Day ---------- */
.day-row {
  display: flex; align-items: center; gap: 18px; min-height: 88px; padding: 14px 20px;
  border-radius: 18px; border: 2px solid var(--line); background: var(--surface);
}
.day-row.suggested { border: 3px dashed var(--ink); }
.day-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.day-row .thumbs { justify-content: flex-end; }

/* ---------- Games ---------- */
.game-grid {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 16px; align-content: start;
  grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px; margin: -4px;
}
.game-tile {
  min-height: 200px; border-radius: 24px; border: 2px solid var(--control-border); background: var(--surface);
  color: var(--ink); padding: 22px 26px; text-align: left; display: flex; flex-direction: column; gap: 8px;
}
.game-tile.picked { grid-column: 1 / -1; min-height: 150px; border: 3px solid var(--ink); box-shadow: 0 0 0 5px var(--highlight); }
.game-tile:disabled { cursor: default; }
.game-tile-icon { font-size: 44px; line-height: 1; font-weight: 700; }
.game-tile-title { font-size: 30px; font-weight: 700; line-height: 1.3; margin-top: auto; }
.game-tile-sub { font-size: 20px; line-height: 1.5; }
.game .title { font-size: 34px; margin-bottom: 12px; }
.game-ref { border-top: 2px solid var(--line); padding-top: 12px; }
.game-screen .bottombar { min-height: 96px; }
.ctl.game-ctl { font-size: 19px; }

/* Word search */
.ws-wrap { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.ws-grid { display: grid; gap: 6px; width: min(560px, 100%); }
.ws-cell {
  aspect-ratio: 1; min-width: 56px; min-height: 56px; border-radius: 12px; border: 2px solid var(--control-border);
  background: var(--surface); color: var(--ink); font-size: 30px; font-weight: 700; padding: 0;
}
.ws-bank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: var(--text-session); font-weight: 700; }

@media (orientation: portrait), (max-width: 900px) {
  .tiles.four { grid-template-columns: 1fr; }
  .tiles.four .tile { min-height: 130px; }
  .game-grid { grid-template-columns: minmax(0, 1fr); }
  .day-row { flex-wrap: wrap; }
  .day-row-side { flex-direction: row; align-items: center; width: 100%; justify-content: flex-start; }
}
.route-slot { display: contents; }

/* ---------- Games (real) ---------- */
.game-status { font-size: var(--text-session); line-height: 1.5; margin: 0 0 16px; min-height: 1.5em; }
.ws-side { display: flex; flex-direction: column; gap: 8px; }
.ws-bank-title { margin: 0; font-weight: 700; }
.ws-bank li { padding: 2px 10px; border-radius: 8px; }
.ws-bank li.found { background: var(--tag); }
.ws-grid { width: min(620px, 100%); }
.ws-cell { min-width: 64px; min-height: 64px; }
.ws-cell.picked { background: var(--highlight); border: 3px solid var(--ink); }
.ws-cell.found { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.ws-cell.hint { box-shadow: inset 0 0 0 4px var(--ink); background: var(--highlight); }
.ws-passage { margin-top: 18px; border-top: 2px solid var(--line); padding-top: 12px; }

.cw-wrap { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.cw-grid { display: grid; gap: 3px; flex: none; max-width: 100%; }
.cw-cell {
  position: relative; aspect-ratio: 1; display: grid; place-items: center; min-width: 0;
  border: 2px solid var(--ink); background: var(--surface); font-size: 26px; font-weight: 700; border-radius: 4px;
}
.cw-cell.block { border-color: transparent; background: transparent; }
.cw-cell.now { background: var(--highlight); }
.cw-num { position: absolute; top: 1px; left: 4px; font-size: 13px; font-weight: 700; line-height: 1; }
.cw-side { flex: 1; min-width: 300px; display: flex; flex-direction: column; gap: 16px; }
.cw-answer { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cw-label { font-size: 24px; font-weight: 700; }
.cw-input {
  min-height: var(--touch); width: 12ch; font-size: 30px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase;
  border: 2px solid var(--control-border); border-radius: 14px; padding: 0 14px; background: var(--surface);
}
.cw-clues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cw-clue {
  width: 100%; min-height: var(--touch); text-align: left; padding: 10px 16px; border-radius: 14px;
  border: 2px solid var(--control-border); background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1.5;
}
.cw-clue.now { border: 3px solid var(--ink); background: var(--highlight); }

.trivia-q { font-size: 30px; font-weight: 700; line-height: 1.5; margin: 0 0 8px; }
.verse-card { margin: 12px 0; padding: 12px 18px; border-left: 6px solid var(--highlight); background: var(--surface); border-radius: 8px; }
.verse-card .read-line { margin: 0 0 6px; }
.quiz-reveal p { margin: 0; }

/* A big calm spinner (stops spinning with Reduce Motion). */
.calm-loading { display: flex; align-items: center; gap: 20px; font-size: var(--text-session); padding: 24px 0; }
.spinner {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  border: 8px solid var(--tag); border-top-color: var(--primary); animation: spin 1.4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ---------- Welcome: "How are you feeling today?" ---------- */
.welcome-screen { gap: 24px; }
.mood-question { font-size: 36px; font-weight: 700; margin: 0; text-align: center; }
.mood-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; width: 100%; max-width: 1120px; }
.mood-tile {
  min-height: 230px; border-radius: 28px; border: 2px solid var(--control-border); background: var(--surface); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 18px 10px;
}
.mood-tile:hover { border-color: var(--ink); }
.mood-face { display: inline-grid; width: 110px; height: 110px; }
.mood-face svg { width: 100%; height: 100%; }
.mood-face.small { width: 40px; height: 40px; }
.mood-label { font-size: 24px; font-weight: 700; line-height: 1.3; text-align: center; min-height: 2.6em; display: grid; place-items: center; }
.skip-mood { align-self: center; }
.pill.corner-left { position: absolute; top: 12px; left: 16px; }

/* ---------- Chosen for you: verse across the top, four big buttons, Engage further ---------- */
.mood-chip { display: inline-flex; align-items: center; gap: 10px; }
.verse-day { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; padding: 22px 36px; }
.verse-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.verse-head .tag.added { margin: 0; }
.verse-day .title { font-size: 34px; }
.verse-day .read-line { font-size: 30px; line-height: 1.6; margin: 0 0 8px; }
.today-picks { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pick-tile {
  min-height: 150px; border-radius: 24px; border: 3px solid var(--control-border); background: var(--surface); color: var(--ink);
  padding: 16px 18px; text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 8px;
}
.pick-tile:hover { border-color: var(--ink); }
/* The one word is what an older eye reads first; the detail underneath is the fine print. */
.pick-word { display: flex; align-items: center; gap: 12px; font-size: 36px; font-weight: 700; line-height: 1.15; }
.pick-word .icon { width: 40px; height: 40px; flex: none; }
.pick-detail { font-size: 20px; line-height: 1.4; }
.today .engage { flex: none; align-self: stretch; min-height: 80px; font-size: 28px; }
.today .engage .icon { width: 36px; height: 36px; }

@media (orientation: portrait), (max-width: 900px) {
  .mood-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mood-tile { min-height: 170px; }
  .mood-face { width: 84px; height: 84px; }
  .today-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pick-tile { min-height: 130px; }
}
.more-below {
  position: sticky; bottom: -22px; margin: 0 -36px -22px; padding: 10px 36px; text-align: center;
  background: var(--highlight); color: var(--ink); font-size: 22px; font-weight: 700;
}

/* ---------- "Gloo AI used / skipped" badge (ui.js aiMark): small and quiet ---------- */
.ai-mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  border: 2px solid var(--ink); background: var(--surface); color: var(--ink); vertical-align: middle;
}
.ai-mark.used { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.ai-mark svg { width: 18px; height: 18px; fill: currentColor; }
.verse-head .title .ai-mark { position: relative; top: -3px; margin-left: 6px; }
.picked-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-day { display: inline-flex; align-items: center; gap: 10px; }
.trivia-source { display: flex; align-items: center; gap: 10px; font-size: 19px; margin: 0 0 8px; }
.tiles.two { grid-template-columns: repeat(2, 1fr); max-width: 980px; margin: auto; }
.worship .tiles.two .tile { min-height: 260px; }
.prayer-screen .card { display: flex; flex-direction: column; justify-content: center; }
.prayer-screen .bottombar { justify-content: space-between; }
/* "Read aloud" buttons next to every passage and prayer (ui.js readAloudButton) */
.read-btn .icon { width: 28px; height: 28px; }
.read-btn[aria-pressed="true"] { background: var(--highlight); border-color: var(--ink); }
.verse-head .read-btn { margin-left: 8px; }
.verse-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.verse-card-foot p { margin: 0; }
.ws-passage .read-btn { margin-bottom: 10px; }
/* Prayers: 3 x 2 tiles that fill the screen (like the hymn grid's 3 x 3). */
.prayer-grid { grid-template-rows: repeat(2, 1fr); }
@media (orientation: portrait), (max-width: 900px) { .prayer-grid { grid-template-rows: none; } }

/* ---------- Evergreen branding ---------- */
/* The page is a column: the brand bar (on most screens), then the current screen. */
body { display: flex; flex-direction: column; height: 100dvh; }
#app { flex: 1; min-height: 0; height: auto; display: flex; flex-direction: column; }
#app .screen { flex: 1; min-height: 0; height: auto; }
/* A thin forest-green bar with the white wordmark in the middle. */
.brandbar { flex: none; display: flex; justify-content: center; align-items: center; height: 44px; background: var(--primary); }
.brandbar img { height: 26px; width: auto; display: block; }
body[data-brand="page"] .brandbar { display: none; }
/* The color wordmark at the top center of Welcome and Engage further. */
.brand-logo { height: 64px; width: auto; display: block; }
.home .brand-logo { margin: 0 auto -12px; }
@media (orientation: portrait), (max-width: 900px) { .brand-logo { height: 52px; } }

/* ---------- Top bars: left | centre | right, with equal sides so the title is centred on
   the screen whatever the buttons on either side are. (Was a flex row: the title drifted.) */
.topbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  column-gap: 16px;
}
.topbar > :first-child { justify-self: start; }
.topbar > :nth-child(2) { justify-self: center; text-align: center; }
.topbar > :nth-child(3) { justify-self: end; text-align: right; }
.topbar .day { margin-left: 0; }
.topbar .screen-title { flex: none; max-width: 56vw; }
.topbar-right { display: flex; align-items: center; gap: 16px; min-width: 0; }
.session .where-box { width: min(420px, 40vw); }
@media (orientation: portrait), (max-width: 900px) {
  .topbar .screen-title { max-width: 46vw; font-size: 26px; }
}
/* My Day under the brand bar: tighter spacing so a 2-3 verse passage still fits without
   scrolling (text stays >= 28px). */
.today { gap: 10px; padding-top: 8px; }
.today .topbar { min-height: 64px; }
.verse-day { padding: 14px 32px; }
.pick-tile { min-height: 118px; padding: 12px 18px; }
.today .engage { min-height: 68px; }
.verse-day .read-line { line-height: 1.5; margin: 0 0 4px; }
.verse-day .attribution { margin-top: 8px; }
/* "Work in progress" (games still being finished): quiet, readable, not alarming. */
.tag.wip { display: inline-block; vertical-align: middle; margin: 0 0 0 10px; font-size: 19px; font-weight: 700;
  background: var(--surface); color: var(--ink); border: 2px dashed var(--ink); padding: 0 10px; }
