/* app.css - the public app's screens. Tokens live in core.css.
   Primary layout: iPad landscape (1180×820); portrait works too.
   Touch targets ≥ 64px; session text ≥ 28px. */

html, body { height: 100%; }
body { font-size: 22px; line-height: 1.4; -webkit-tap-highlight-color: transparent; }
#app { height: 100dvh; }
.screen { height: 100%; display: flex; flex-direction: column; padding: 16px 24px; gap: 14px; }
.muted { color: var(--muted); }
.small { font-size: 17px; }
.big-text { font-size: var(--text-session); font-family: var(--font-read); }
h1, h2 { font-family: var(--font-read); font-weight: 600; 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(--accent); border-color: var(--accent); color: #fff; }
.pill.selected { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.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(--accent); color: #fff; display: grid; place-items: center;
}
.round.is-paused { background: var(--ink); }
.round:disabled { background: var(--border); color: var(--muted); 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(--accent); 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(--accent); color: #fff; border-color: var(--accent); }
.tile-title { font-family: var(--font-read); font-size: 38px; font-weight: 600; line-height: 1.15; }
.tile-sub { font-size: 21px; opacity: 0.85; }
.aide-link { color: var(--muted); font-size: 19px; 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; color: var(--muted); white-space: nowrap; }
.screen-title { font-family: var(--font-read); font-size: 30px; font-weight: 600; 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; color: var(--muted); font-size: 20px; }
.steps li + li::before { content: '→'; color: var(--border-strong); }
.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(--accent); border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.steps li.done .step-pill { color: var(--ink); }
.steps li.done .icon { color: var(--accent); width: 24px; height: 24px; }
.card {
  flex: 1; min-height: 0; overflow: auto; background: var(--surface);
  border: 1px solid var(--border); 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; }

/* ---------- Hymn ---------- */
.hymn-panel .title, .reading-panel .title { font-size: 40px; }
.verse-label { color: var(--muted); 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(--accent-soft); color: var(--accent); border-radius: 999px;
  padding: 4px 14px; font-size: 19px; font-weight: 700; margin: 6px 0 12px;
}
.read-line { font-family: var(--font-read); font-size: var(--text-session); line-height: 1.5; margin: 0 0 14px; padding: 4px 10px; border-radius: 10px; }
.read-line.reading { background: var(--highlight); }
.vnum { color: var(--muted); font-size: 0.55em; }
.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: 46px; margin-bottom: 12px; }
.aide-notes { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.note-buttons { display: flex; gap: 16px; justify-content: center; }
.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-family: var(--font-read); font-size: 27px; font-weight: 600; line-height: 1.2; }
.hymn-tile-line { color: var(--muted); font-size: 19px; }
.tag { align-self: flex-start; margin-top: auto; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 12px; font-size: 17px; font-weight: 700; }

/* ---------- Aide tools ---------- */
.aide-card section { padding: 16px 0; border-bottom: 1px solid var(--border); }
.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(--accent); border-color: var(--accent); color: #fff; }
.choice-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.slider { width: min(520px, 100%); height: var(--touch); accent-color: var(--accent); }

/* ---------- 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; }
.switch { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.switch input { width: 28px; height: 28px; accent-color: var(--accent); }
.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: rgb(34 30 25 / 0.45); }
.dialog p { font-size: 24px; margin: 0 0 24px; }
.dialog-buttons { display: flex; gap: 16px; justify-content: flex-end; }

/* ---------- 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; }
  .topbar { flex-wrap: wrap; }
  .steps { order: 3; width: 100%; }
  .card { padding: 22px 24px; }
  .bottombar { flex-wrap: wrap; gap: 12px; }
  .bottombar .round { width: 92px; height: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
