:root {
  --slate: #3b4f5c;
  --slate-dark: #18232a;
  --teal: #4c8480;
  --teal-soft: #7fa9a3;
  --sage: #a8c3b0;
  --cream: #f6f1e7;
  --sky: #c9d6e3;
  --peach: #f0b9a0;
  --mauve: #c9a4b5;
  --berry: #cf5182;
  --berry-deep: #a8386a;
  /* gold is intentionally not a font/UI color — it only ever appears as the
     textured artwork in img/ (divider, frame, arrow) */

  --bg: var(--slate-dark);
  --surface: #223038;
  --surface-2: #2b3b44;
  --ink: var(--cream);
  --ink-soft: #9fb2ba;
  --line: #34454e;
  --accent: var(--berry);
  --accent-soft: var(--mauve);
  --shadow: rgba(0, 0, 0, 0.4);

  --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-ui: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --radius: 18px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0;
}

button {
  font-family: var(--font-ui);
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  -webkit-appearance: none;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
}

/* ---------- Top bar ---------- */
.topbar {
  padding: calc(var(--safe-top) + 20px) 20px 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: var(--bg);
  color: var(--cream);
  position: relative;
  z-index: 3;
}
/* textured gold rule that closes off the wordmark, so the brand reads as its
   own zone rather than running into the date/time below it */
.topbar::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 8px;
  height: 7px;
  background: url("../img/divider.png") center / 100% 100% no-repeat;
  opacity: 0.9;
  pointer-events: none;
}
.topbar .brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.topbar .brand small {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.72;
  margin-top: 5px;
}
.back-btn {
  color: var(--cream);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.9;
}

.hero {
  color: var(--cream);
  padding: 22px 20px 34px;
  position: relative;
  overflow: hidden;
}
/* gold rule closes the date block, pairing with the one under the wordmark */
.hero::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 12px;
  height: 6px;
  background: url("../img/divider.png") center / 100% 100% no-repeat;
  opacity: 0.85;
  pointer-events: none;
}
/* the sky right now: Sun and Moon on a single line */
.hero .sky {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.sky-icon {
  flex: 0 0 auto;
  font-size: 1.05rem;
  color: var(--ink-soft);
}
.sky-sep {
  width: 1px;
  height: 0.9rem;
  background: var(--line);
  margin: 0 6px;
  flex: 0 0 auto;
}

/* ---------- Main scroll area ---------- */
main {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(84px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.section-label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 22px 20px 10px;
}

/* ---------- Session cards (Mind/Body/Soul) ---------- */
.cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 20px 20px;
  position: relative;
  z-index: 2;
}

.session-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 13px 15px;
  box-shadow: 0 10px 28px var(--shadow);
  border: 1px solid var(--line);
  display: flex;
  gap: 13px;
  align-items: center;
  text-align: left;
  width: 100%;
}
/* the label lives inside the coloured disc, so the card needs no icon row */
.session-card .glyph {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--cream);
  background: var(--teal);
}
.session-card.mind .glyph { background: var(--teal); }
.session-card.body .glyph { background: var(--slate); }
.session-card.soul .glyph { background: var(--berry); }
.session-card.draw .glyph {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 1.5rem;
  line-height: 1;        /* measured: centres the ∞ to within half a pixel */
}

.session-card .meta { flex: 1; min-width: 0; }

.session-card .row-a {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.session-card .hebrew {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.1;
  direction: rtl;
  flex: 0 0 auto;
}
.session-card .code {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  flex: 0 0 auto;
}
.session-card .window {
  font-size: 0.68rem;
  color: var(--ink-soft);
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}
.session-card .title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.25;
  margin-top: 3px;
}
.session-card .names {
  font-size: 0.76rem;
  margin-top: 2px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-card .names .angel { color: var(--ink-soft); }

.empty-soul {
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Index / list ---------- */
.idx-select {
  margin: 0 20px 6px;
  width: calc(100% - 40px);
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--ink);
}
.search-input {
  margin: 4px 20px 6px;
  width: calc(100% - 40px);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--ink);
}
.result-count {
  padding: 2px 20px 8px;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.build-stamp {
  padding: 4px 20px 28px;
  text-align: center;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  opacity: 0.5;
}

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 20px 20px;
}
.entry-row {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 8px 8px 14px;
  width: 100%;
}
.entry-row:has(.snippet) { align-items: flex-start; }
.entry-main {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 0;
}
.entry-row .row-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.entry-row .snippet {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.entry-row .snippet mark {
  background: rgba(207, 81, 130, 0.28);
  color: var(--ink);
  border-radius: 3px;
  padding: 0 2px;
}
.entry-row .num {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
}
.entry-row .hebrew {
  font-family: var(--font-display);
  font-size: 1.15rem;
  direction: rtl;
  flex: 0 0 auto;
  width: 44px;
  text-align: center;
}
.entry-row .info { flex: 1; min-width: 0; }
.entry-row .info .nm { font-size: 0.92rem; }
.entry-row .info .ang { font-size: 0.76rem; color: var(--ink-soft); }
/* ---------- Bookmarks & notes ---------- */
.bm-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 40px;          /* comfortable tap target */
  color: var(--ink-soft);
}
.entry-row:has(.snippet) .bm-btn { align-self: flex-start; padding-top: 4px; }
.entry-row .role {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--berry);
  margin-left: 6px;
}
.bm-btn.on { color: var(--berry); }
.bm-btn:active { opacity: 0.6; }
.bm-icon { display: block; }

.save-block {
  margin: 16px 20px 0;
}
.save-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.save-toggle.on {
  color: var(--berry);
  border-color: var(--berry);
}
.note-field {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  line-height: 1.5;
  min-height: 62px;
  /* Compact by default: the field grows to fit short notes, but a long one is
     capped here and scrolls inside itself. "More" lifts the cap. */
  max-height: 90px;
  overflow-y: auto;
  resize: none;
  -webkit-appearance: none;
  -webkit-overflow-scrolling: touch;
}
.note-field.expanded {
  max-height: none;
  overflow-y: hidden;
}
.note-field::placeholder { color: var(--ink-soft); opacity: 0.7; }

.note-toggle {
  display: block;
  margin: 6px 0 0 auto;
  padding: 4px 2px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.note-toggle:active { color: var(--berry); }
.note-field:focus {
  outline: none;
  border-color: var(--teal-soft);
}

/* ---------- Saved page ---------- */
.saved-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 20px 20px;
}
.saved-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 8px 14px 14px;
}
.saved-head {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
.saved-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 0;
}
.saved-open .hebrew {
  /* Fixed-width, centred column — same approach as the Index. Narrow triplets
     (ייי, ייל) are far slimmer than wide ones (אכא, שאה), so an auto width
     would shift the text column from card to card. */
  font-family: var(--font-display);
  font-size: 1.85rem;
  line-height: 1.1;
  direction: rtl;
  flex: 0 0 70px;
  width: 70px;
  text-align: center;
}
.saved-open .saved-id { min-width: 0; }
.saved-open .nm {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.saved-open .ang-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.2;
  margin-top: 3px;
}
.saved-open .attrs {
  display: block;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--ink-soft);
  margin-top: 4px;
}
.saved-card .note-field { margin-top: 12px; margin-right: 6px; width: calc(100% - 6px); }

.saved-empty { padding-top: 48px; }
.saved-empty .bm-icon {
  margin: 0 auto 14px;
  width: 34px;
  height: 34px;
  color: var(--ink-soft);
  opacity: 0.6;
}
.saved-empty p { margin: 0 0 6px; }
.saved-empty .dim {
  font-size: 0.82rem;
  opacity: 0.75;
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.5;
}
/* ---------- Backup ---------- */
.backup {
  margin: 8px 20px 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.backup-row {
  display: flex;
  gap: 10px;
}
.backup-btn {
  flex: 1;
  padding: 12px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}
.backup-btn.on {
  color: var(--berry);
  border-color: var(--berry);
}
.backup-panel {
  margin-top: 14px;
}
.backup-hint {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 10px;
}
.backup-text {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  resize: vertical;
  -webkit-appearance: none;
}
.backup-text:focus { outline: none; border-color: var(--teal-soft); }
.backup-file {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.backup-msg {
  margin-top: 9px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-soft);
  min-height: 1em;
}
.backup-msg.ok { color: var(--sage); }
.backup-msg.bad { color: var(--peach); }

.warn-note {
  margin: 0 20px 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

/* ---------- Detail view ---------- */
/* Flat elevated panels — the gold artwork does the work, not a gradient. */
.detail-hero, .angel-hero {
  position: relative;
  color: var(--cream);
  padding: 24px 20px 34px;
  text-align: center;
}
/* the angel block sits mid-page, so it gets a gold rule opening it as well */
.angel-hero { margin-top: 26px; padding-top: 34px; }

.detail-hero::after, .angel-hero::after, .angel-hero::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  height: 6px;
  background: url("../img/divider.png") center / 100% 100% no-repeat;
  opacity: 0.85;
  pointer-events: none;
}
.detail-hero::after, .angel-hero::after { bottom: 12px; }
.angel-hero::before { top: 0; }

/* hand-drawn gold lozenge sitting behind the headline element */
.framed {
  position: relative;
  display: block;
  padding: 30px 34px;
  margin: 10px auto 0;
  max-width: 340px;
}
.framed::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/frame.png") center / 100% 100% no-repeat;
  pointer-events: none;
}
.framed > * { position: relative; }

.detail-hero .hebrew-big {
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 19vw, 5.2rem);
  line-height: 1.05;
  direction: rtl;
}

.detail-hero .id-line {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  opacity: 0.8;
  padding: 0 16px;
  line-height: 1.4;
}

/* left-pointing arrow: the reading direction of the triplet above it.
   Deliberately about half the triplet's width. */
.rtl-arrow {
  display: block;
  width: clamp(52px, 16vw, 76px);
  height: auto;
  margin: 14px auto 0;
  opacity: 0.95;
}

.chant-label {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 22px;
}
.chant-guide {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  margin-top: 5px;
}

.angel-hero .angel-name-big {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 8vw, 2.4rem);
  line-height: 1.15;
}
.angel-hero .angel-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.45;
  margin-top: 12px;
  padding: 0 8px;
  opacity: 0.95;
}

.audio-box {
  margin: 22px 20px 0;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px var(--shadow);
  border: 1px solid var(--line);
  padding: 16px 18px;
  position: relative;
  z-index: 2;
}
.audio-box .label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.play-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--berry);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex: 0 0 auto;
}
.play-btn.playing { background: var(--berry-deep); }
.scrubber {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 4px;
  background: var(--surface-2);
  accent-color: var(--berry);
}
.audio-time {
  font-size: 0.7rem;
  color: var(--ink-soft);
  min-width: 34px;
  text-align: right;
}
.coming-soon {
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
  padding: 8px 0;
}

.detail-section {
  padding: 20px 20px 4px;
}
.detail-section h2 {
  font-size: 1.02rem;
  margin-bottom: 8px;
}
.detail-section p, .detail-section .body-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-line;
}
.verse {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.5;
  border-left: 3px solid var(--accent-soft);
  padding-left: 12px;
  color: var(--ink);
}
.verse-ref {
  display: block;
  margin-top: 6px;
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

/* ---------- Detail: when this Name rules ---------- */
.timing {
  margin: 8px 20px 4px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
/* the formal decan, given room rather than squeezed into a tile heading */
.timing-decan {
  font-family: var(--font-display);
  font-size: 1.02rem;
  text-align: center;
  padding: 13px 14px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.timing-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.timing-row:last-child { border-bottom: none; }
.t-label {
  flex: 0 0 46px;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 3px;
}
/* two columns of equal weight: the date/time, and the degrees beside it */
.t-cols {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: baseline;
  column-gap: 12px;
}
.t-cols.stack { row-gap: 7px; }
.t-a, .t-b {
  font-size: 0.95rem;
  line-height: 1.35;
}
.t-b { white-space: nowrap; }

/* zodiac glyphs run larger than surrounding text — ♑ ♍ ♏ are hard to tell
   apart at body size */
.zg {
  font-size: 1.35em;
  line-height: 1;
  vertical-align: -0.08em;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 20px 0;
}
.pill {
  background: var(--surface-2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.74rem;
  color: var(--ink);
}

/* ---------- Shuffle ---------- */
/* fills the space between the top bar and the tab bar, then distributes the
   card, the landed detail and the controls evenly down it */
.shuffle-page {
  min-height: calc(100dvh - 210px);
  padding: 18px 16px 8px;
  text-align: center;
  color: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 14px;
}
.shuffle-card {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: clamp(40px, 12vw, 62px) 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shuffle-card .hebrew-big {
  font-family: var(--font-display);
  font-size: clamp(4.6rem, 26vw, 7rem);
  line-height: 1.02;
  direction: rtl;
}
.shuffle-meta {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.shuffle-meta.visible { opacity: 1; }
.shuffle-meta .sh-id {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.shuffle-meta .sh-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-top: 7px;
  line-height: 1.25;
}
.shuffle-meta .sh-angel {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 5px;
}

.shuffle-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}
.sh-primary, .sh-secondary {
  flex: 1;
  padding: 17px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.sh-primary {
  background: var(--berry);
  color: var(--cream);
}
.sh-primary:active { background: var(--berry-deep); }
.sh-secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}
.sh-secondary:active { background: var(--surface-2); }

/* ---------- Ritual ---------- */
.ritual {
  padding: 30px 20px 20px;
  text-align: center;
}
/* the whole spiral is the play control */
.spiral-wrap {
  position: relative;
  width: min(78vw, 300px);
  aspect-ratio: 1;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.spiral {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 50%;
}
/* anti-clockwise: the Names read right to left */
.spiral-wrap.spinning .spiral {
  animation: slow-turn 120s linear infinite;
}
@keyframes slow-turn {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}
/* a bare gold triangle — no disc, since the spiral is the button */
.play-mark {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 26px;
}
.play-mark i {
  display: block;
  background: url("../img/gold-fill.png") center / cover no-repeat;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55));
}
.play-mark .tri {
  width: 22px;
  height: 26px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.play-mark .bar {
  width: 7px;
  height: 24px;
  border-radius: 1px;
  display: none;
}
.play-mark.playing .tri { display: none; }
.play-mark.playing .bar { display: block; }

.prayer-list {
  margin-top: 30px;
  text-align: left;
}
.prayer-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* buttons centre their text by default — a title that wraps would otherwise
     centre itself while the short ones sit left */
  text-align: left;
  gap: 12px;
  padding: 15px 4px;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
}
.prayer-list .prayer-toggle:last-of-type { border-bottom: 1px solid var(--line); }
.prayer-toggle .chev {
  font-size: 1.15rem;
  color: var(--ink-soft);
  flex: 0 0 auto;
}
.prayer-body {
  padding: 4px 4px 18px;
  border-bottom: 1px solid var(--line);
}
.prayer-body p {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--ink);
  margin: 0;
  white-space: pre-line;   /* the litanies are line-broken on purpose */
}

/* ---------- Bottom nav ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 8px 0 calc(8px + var(--safe-bottom));
  display: flex;
  z-index: 10;
}
.tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;         /* Apple's minimum touch target */
  gap: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
/* fixed box so every icon shares one baseline regardless of its artwork */
.tab .icon {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
}
.tab .icon svg { display: block; }
.tab.active { color: var(--accent); }

.hidden { display: none !important; }

.loading, .empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
