/* DrawNigh — illuminated manuscript: ink, parchment, gold */
:root {
  --ink: #171310;
  --ink-raised: #211b16;
  --ink-line: #352c22;
  --parchment: #e9dfc8;
  --parchment-dim: #b3a689;
  --gold: #c8a24a;
  --gold-bright: #e3c477;
  --ember: #d4703d;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  overflow: hidden;
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font-family: inherit; font-size: 1rem; }
::selection { background: rgba(200,162,74,.35); }

#app { display: flex; flex-direction: column; height: 100%; height: 100dvh; }

/* ---------- Header ---------- */
/* WEB BUILD — the call-banner buffer, carried from the v1.0.9 web build.
   Found by his sister, live: she could not tap the ⋮ button because her
   phone's ongoing-call banner was drawn on top of it. Inside a browser tab a
   call banner pushes the page down; for a Home-Screen web app it draws over
   the page without resizing anything, and env(safe-area-inset-top) does not
   move — there is no CSS signal to react to, so this is a fixed guess at the
   banner's height. 44px was not enough; a long WhatsApp call's banner is
   taller. 84px was. The Quick access block in Settings is the other half of
   that fix, and the half that needs no guess.
   v1.1.5 — one stylesheet for both builds now: the buffer applies to the
   website only (index.html carries class="is-web"); the add-on keeps 14px. */
header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--ink-line);
}
.is-web header { padding-top: 84px; }

/* The long press must not raise the phone's text-selection menu, and the
   button shows that it has armed. (Both builds since v1.1.5.) */
#btnListen { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#btnListen.arming { opacity: .55; }
.brand { font-size: 1.25rem; letter-spacing: .04em; color: var(--gold-bright); }
.brand .nigh { font-style: italic; }
.tagline { font-size: .72rem; color: var(--parchment-dim); letter-spacing: .06em; font-style: italic; }

/* ---------- Badges row ---------- */
.badges { display: flex; gap: 10px; padding: 10px 18px 0; flex-wrap: wrap; }
.badge {
  font-size: .85rem; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--ink-line); background: var(--ink-raised);
  color: var(--parchment); display: inline-flex; align-items: center; gap: 6px;
}
.badge .bar {
  width: 74px; height: 5px; border-radius: 3px; background: var(--ink-line);
  overflow: hidden; display: inline-block;
}
.badge .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); border-radius: 3px; }

/* ---------- Screens ---------- */
main { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.screen { display: none; padding: 16px 18px 28px; }
.screen.active { display: block; }
h2 { font-size: 1.05rem; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; font-weight: normal; margin: 14px 0 10px; }
h2:first-child { margin-top: 4px; }

/* ---------- Reader ---------- */
#screen-read { display: none; flex-direction: column; min-height: 100%; }
#screen-read.active { display: flex; }
.mode-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.chip-catchup {
  margin-left: auto;
  padding: 6px 14px; border-radius: 999px; font-size: .85rem;
  border: 1px dashed var(--gold); color: var(--gold-bright);
  background: rgba(200,162,74,.06);
}
.chip-catchup:hover { background: rgba(200,162,74,.14); }
.pill {
  padding: 6px 14px; border-radius: 999px; font-size: .85rem;
  border: 1px solid var(--ink-line); color: var(--parchment-dim);
}
.pill.on { border-color: var(--gold); color: var(--gold-bright); background: rgba(200,162,74,.08); }
/* v1.0.7: back on the main reading screen (it briefly lived inside the ⋮
   menu in v1.0.4–1.0.6). Hidden unless Book mode is on, same as before. */
#bookPicker { margin: 4px 0 2px; display: none; gap: 8px; }
#bookPicker.show { display: flex; }
#bookPicker select { min-width: 0; }
#bookSelect { flex: 2.4; }
#chapSelect, #verseSelect { flex: 1; }
/* v13.1: Catch up now names a verse, not just a chapter. Same three-across
   shape and proportions as the Read screen's jump row, so it reads familiar. */
.cu-row { display: flex; gap: 8px; }
.cu-row select { min-width: 0; }
#cuBook { flex: 2.4; }
#cuChapter, #cuVerse { flex: 1; }

#bookPicker select, .field select, .cu-row select, .field input {
  width: 100%; background: var(--ink-raised); color: var(--parchment);
  border: 1px solid var(--ink-line); border-radius: 8px; padding: 9px 10px;
}
.verse-stage {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 18px 2px; cursor: pointer; min-height: 40vh;
}
.verse-ref { color: var(--gold); font-size: .95rem; letter-spacing: .1em; margin-bottom: 14px; }
.verse-text { font-size: 1.55rem; line-height: 1.5; text-wrap: pretty; }
.verse-text .cap {
  float: left; font-size: 3.4em; line-height: .82; padding: .04em .09em 0 0;
  color: var(--gold-bright);
  text-shadow: 0 0 18px rgba(200,162,74,.35);
}
.verse-foot { margin-top: 16px; color: var(--parchment-dim); font-size: .8rem; font-style: italic; }
/* v1.0.3: the book line sits directly under the plan line, quieter than it. */
.verse-foot.book-foot { margin-top: 3px; opacity: .78; }

/* ---------- v1.0.4: ⋮ menu, prayer timer, badges ---------- */
.tagline-row { display: flex; align-items: baseline; gap: 8px; }
.dots-btn {
  position: relative; font-size: 1.15rem; line-height: 1; padding: 2px 4px;
  color: var(--parchment-dim); flex: none;
}
.dots-btn:hover { color: var(--gold-bright); }
/* The one signal the app ever gives that something is waiting. No banner, no
   toast, nothing over the verse — and it does NOT clear just from looking. */
.waiting-dot {
  position: absolute; top: 0; right: 0; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-bright); box-shadow: 0 0 6px rgba(200,162,74,.9);
}
.menu-item .waiting-dot { position: static; display: inline-block; margin-left: 7px; vertical-align: middle; }

.ref-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
/* v1.1.4 (NLT): the reference may now read "1 Thessalonians 5:23 · KJV + NLT",
   which is long. It wraps rather than squeezing the buttons beside it. */
.ref-row .verse-ref { margin-bottom: 0; flex: 1 1 auto; min-width: 0; }

/* ---------- v1.1.4 (NLT) ---------- */
/* The flip. Dashed, like the Catch-up chip: something to tap, not a label. */
.flip-btn {
  font: inherit; font-size: .95rem; letter-spacing: .1em; color: var(--gold);
  border: 1px dashed transparent; border-radius: 6px; padding: 0 4px;
}
.flip-btn:hover { border-color: var(--gold); color: var(--gold-bright); }
/* Chosen, but not here yet — and never drawn as though it were. */
.flip-btn.waiting { color: var(--parchment-dim); font-style: italic; letter-spacing: .04em; }
.cmp-btn { min-width: auto; padding: 4px 9px; }
/* In Random mode the name still shows — it just does not move. */
.flip-btn[disabled] { border-color: transparent; cursor: default; opacity: .85; }
.cmp-btn.on { background: var(--gold); color: #1a1408; border-color: var(--gold); }
.verse-text.waiting-text { font-size: 1.05rem; color: var(--parchment-dim); font-style: italic; }
/* The second reading, quieter than the one the flip put on top. */
/* Two readings fill the stage on their own, so it stops holding itself open —
   otherwise the buttons underneath are pushed further down than they need be. */
.verse-stage.two-up { min-height: 0; padding-top: 6px; }
.verse-alt { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ink-line); }
.verse-alt .alt-label {
  color: var(--gold); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; margin-bottom: 6px;
}
.verse-alt .alt-text { font-size: 1.12rem; line-height: 1.5; color: var(--parchment); text-wrap: pretty; }
/* The line that states what is true. Ember, so it is not read as Scripture. */
.nlt-line {
  margin-top: 14px; color: var(--ember); font-size: .82rem; font-style: italic;
  line-height: 1.5;
}
.nlt-tell { color: var(--gold-bright); font-style: normal; text-decoration: none; }
.nlt-tell-note { color: var(--parchment-dim); font-size: .76rem; font-style: normal; }
/* Decision 200: a small marker, and nothing more, beside a kept NLT verse. */
.nlt-mark {
  margin-left: 7px; padding: 1px 5px; border-radius: 4px; font-size: .62rem;
  letter-spacing: .1em; color: var(--ink); background: var(--gold);
  vertical-align: middle;
}
.pray-slot { flex: none; }
.pray-btn, .pray-stretch, .pray-cancel {
  font-size: .78rem; padding: 4px 9px; border-radius: 8px;
  border: 1px solid var(--ink-line); color: var(--parchment-dim);
}
.pray-btn:hover, .pray-stretch:hover, .pray-cancel:hover { color: var(--gold-bright); border-color: var(--gold); }
.pray-cancel { padding: 4px 8px; }
.pray-live { display: inline-flex; align-items: center; gap: 6px; }
/* v1.0.5: the countdown is itself the pause control — the biggest, easiest
   target in the row, and it says "Paused" in words rather than hinting. */
.pray-left {
  font-size: .85rem; color: var(--gold-bright); font-variant-numeric: tabular-nums;
  letter-spacing: .04em; padding: 4px 6px; border-radius: 8px; border: 1px solid transparent;
}
.pray-left:hover { border-color: var(--ink-line); }
.pray-left.paused { color: var(--parchment-dim); font-style: italic; letter-spacing: 0; }

/* Sheets slide up from the bottom — a thumb's distance on a phone. */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; z-index: 60; }
.sheet.show { display: flex; align-items: flex-end; }
.sheet-panel {
  width: 100%; max-height: 82vh; overflow-y: auto; background: var(--ink-raised);
  border-top: 1px solid var(--gold); border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
}
@media (min-width: 700px) { .sheet-panel { max-width: 720px; margin: 0 auto; border-radius: 16px; } }
/* v1.1.2, F13 — on a phone, docking to the bottom is the whole point (a
   thumb's distance from anywhere), so that stays exactly as it was. On a wide
   window a sheet squashed against the bottom edge read as disconnected from
   the reading screen above it. The ⋮ menu (.sheet-anchor) is its own separate
   case, already excluded, and is untouched by this rule. */
@media (min-width: 700px) {
  .sheet.show:not(.sheet-anchor) { align-items: center; }
}
/* v1.0.7: on a phone, every sheet slides up from the bottom — a thumb's
   distance from anywhere. On a wide desktop/laptop window that same bottom
   dock reads as disconnected from the small ⋮ button up in the corner, so
   the ⋮ menu specifically (not the fuller Badges sheet, which still wants
   room to breathe) drops instead from directly under the button it came
   from. header/main are themselves centered in a 720px column on wide
   screens (see the max-width rule below), so the button is NOT at the
   window's true right edge — top/right below are placeholders only;
   openMenu() in app.js measures the real button position and overrides
   them inline every time the menu opens. */
@media (min-width: 700px) {
  .sheet.sheet-anchor { background: transparent; }
  .sheet.sheet-anchor .sheet-panel {
    position: fixed; top: 54px; right: 18px;
    width: 300px; max-width: 300px; max-height: 70vh; margin: 0;
    border-radius: 12px; border: 1px solid var(--ink-line);
    box-shadow: 0 16px 40px rgba(0,0,0,.55);
  }
}
.menu-item {
  display: block; width: 100%; text-align: left; padding: 13px 4px; font-size: .98rem;
  color: var(--parchment); border-bottom: 1px solid var(--ink-line);
}
.menu-item.quiet { color: var(--parchment-dim); border-bottom: none; text-align: center; }

.badge-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
/* v1.1.1, finding F3 — the inscription and Close stay put while the rest of the
   sheet scrolls under them. The panel is the scroll container, so the head
   sticks to its top; the negative margins pull it out to the panel's edges so
   nothing shows through beside it, and the padding puts back what they took. */
.sheet-head {
  position: sticky; top: 0; z-index: 3;
  background: var(--ink-raised);
  margin: -16px -16px 0; padding: 16px 16px 6px;
  border-bottom: 1px solid var(--ink-line);
}
.rank-name { font-size: 1.3rem; color: var(--gold-bright); }
.badge-block { padding: 14px 0; border-top: 1px solid var(--ink-line); }
.badge-title { font-size: 1.02rem; color: var(--gold); }
/* 66 tiles: filled or empty, nothing more — cheap to draw, read at a glance. */
.tile-grid { display: grid; grid-template-columns: repeat(11, 1fr); gap: 5px; margin-top: 10px; }
@media (max-width: 400px) { .tile-grid { grid-template-columns: repeat(8, 1fr); } }
.tile {
  aspect-ratio: 1; border-radius: 5px; border: 1px solid var(--ink-line);
  font-size: .55rem; color: var(--parchment-dim); overflow: hidden; padding: 0;
}
.tile.on { background: rgba(200,162,74,.22); border-color: var(--gold); color: var(--gold-bright); }
.tile.done { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--ink); border-color: var(--gold-bright); }
.detail-card { border: 1px solid var(--gold); border-radius: 12px; padding: 14px; margin-top: 14px; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: .88rem; }
.detail-row span:last-child { color: var(--gold-bright); text-align: right; }
.reader-controls { display: flex; align-items: center; gap: 10px; padding: 6px 0 10px; }
.nav-btn {
  flex: 1; padding: 13px 0; border-radius: 12px; font-size: 1.05rem;
  border: 1px solid var(--ink-line); background: var(--ink-raised); color: var(--parchment);
}
.nav-btn.next { border-color: var(--gold); color: var(--gold-bright); background: rgba(200,162,74,.1); }
.nav-btn.next .next-wait { opacity: .55; font-size: .85em; margin-left: 2px; }  /* 345 */
.nav-btn:disabled { opacity: .35; }
.heart-btn { font-size: 1.5rem; padding: 8px 12px; color: var(--parchment-dim); }
.heart-btn.on { color: var(--ember); }

/* ---------- Books grid ---------- */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.book-card {
  text-align: left; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--ink-line); background: var(--ink-raised);
}
.book-card b { display: block; font-weight: normal; color: var(--parchment); }
.book-card span { font-size: .75rem; color: var(--parchment-dim); }
.book-card.started span { color: var(--gold); }

/* ---------- Plans ---------- */
.plan-card {
  border: 1px solid var(--ink-line); border-radius: 12px; background: var(--ink-raised);
  padding: 12px 14px; margin-bottom: 10px;
}
.plan-card.featured { border-color: var(--gold); }
.plan-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.plan-title b { font-weight: normal; font-size: 1.05rem; }
.star { color: var(--gold-bright); font-size: .8rem; letter-spacing: .05em; }
.plan-meta { font-size: .8rem; color: var(--parchment-dim); margin: 3px 0 8px; }
.progress { height: 7px; background: var(--ink-line); border-radius: 4px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); }
.plan-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.small-btn {
  font-size: .8rem; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--ink-line); color: var(--parchment);
}
.small-btn.gold { border-color: var(--gold); color: var(--gold-bright); }
.small-btn.danger { color: var(--ember); }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--parchment-dim); cursor: pointer; }
.toggle input { accent-color: var(--gold); width: 16px; height: 16px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: .82rem; color: var(--parchment-dim); margin-bottom: 5px; }
.calc {
  border: 1px dashed var(--gold); border-radius: 10px; padding: 11px 13px;
  font-size: .92rem; color: var(--gold-bright); margin: 12px 0; font-style: italic;
}
.wide-btn {
  width: 100%; padding: 13px; border-radius: 12px; font-size: 1rem;
  border: 1px solid var(--gold); color: var(--ink); background: linear-gradient(180deg, var(--gold-bright), var(--gold));
}
.wide-btn.quiet { background: none; color: var(--parchment); border-color: var(--ink-line); }
.checks { display: grid; grid-template-columns: 1fr; gap: 0 18px; max-height: 260px; overflow-y: auto; overflow-x: hidden; border: 1px solid var(--ink-line); border-radius: 10px; padding: 0 12px 10px; }
@media (min-width: 480px) { .checks { grid-template-columns: 1fr 1fr; } }
.check-col { min-width: 0; }
.check-col-title { position: sticky; top: 0; z-index: 1; background: var(--ink); color: var(--gold); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; padding: 10px 0 4px; margin-bottom: 6px; border-bottom: 1px solid var(--ink-line); }
.checks label { font-size: .85rem; display: flex; gap: 8px; align-items: center; padding: 2px 0; }
.checks input { accent-color: var(--gold); width: 15px; height: 15px; padding: 0; margin: 0; flex: none; }

/* ---------- Favorites ---------- */
.fav-row {
  display: flex; justify-content: space-between; gap: 10px; align-items: flex-start;
  padding: 11px 2px; border-bottom: 1px solid var(--ink-line); cursor: pointer;
}
.fav-row .ref { color: var(--gold); font-size: .85rem; }
.fav-row .txt { font-size: .95rem; color: var(--parchment); margin-top: 2px; }
.fav-row button { color: var(--ember); font-size: 1.1rem; padding: 2px 6px; }
.empty { color: var(--parchment-dim); font-style: italic; padding: 18px 0; }

/* ---------- Settings ---------- */
.setting { padding: 12px 0; border-bottom: 1px solid var(--ink-line); }
.setting .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.setting p { font-size: .8rem; color: var(--parchment-dim); margin-top: 4px; }
.setting select, .setting input[type=number] {
  background: var(--ink-raised); color: var(--parchment); border: 1px solid var(--ink-line);
  border-radius: 8px; padding: 7px 9px; width: 110px;
}
textarea {
  width: 100%; min-height: 74px; background: var(--ink-raised); color: var(--parchment);
  border: 1px solid var(--ink-line); border-radius: 10px; padding: 10px; font-family: monospace; font-size: .8rem;
}
.note { font-size: .78rem; color: var(--parchment-dim); font-style: italic; margin-top: 6px; }

/* ---------- Bottom nav ---------- */
nav {
  display: flex; border-top: 1px solid var(--ink-line); background: var(--ink-raised);
  padding-bottom: env(safe-area-inset-bottom);
}
nav button {
  flex: 1; padding: 10px 0 12px; font-size: .72rem; color: var(--parchment-dim);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
nav button .ico { font-size: 1.15rem; }
nav button.on { color: var(--gold-bright); }

/* ---------- Overlays (VOD / moment / dialogs) ----------
   v1.1.2: overlays now sit ABOVE sheets (.sheet is 60). Until this build no
   overlay was ever raised from inside an open sheet, so 50 was never wrong.
   Decision 126 opens the making overlay from inside the room, and Decision
   132 opens the filing prompt from the writing page — both inside the room
   sheet — and at 50 they opened silently BEHIND it, visible but dead to every
   tap. The same fix frees the one place v1.1.1 already had this: unsealing a
   category, which asks for the word from inside the room. An overlay is a
   modal question; nothing should ever cover one. */
.overlay {
  position: fixed; inset: 0; background: rgba(10,8,6,.82); display: none;
  align-items: center; justify-content: center; padding: 22px; z-index: 70;
}
.overlay.show { display: flex; }
.card {
  background: var(--ink-raised); border: 1px solid var(--gold); border-radius: 16px;
  padding: 22px 20px; max-width: 430px; width: 100%; max-height: 86vh; overflow-y: auto;
  box-shadow: 0 0 44px rgba(200,162,74,.18);
}
.card h3 { color: var(--gold); font-weight: normal; letter-spacing: .1em; text-transform: uppercase; font-size: .8rem; margin-bottom: 12px; }
.card .verse-text { font-size: 1.2rem; }
.card .verse-ref { margin: 10px 0 0; }
.card .actions { display: flex; gap: 8px; margin-top: 18px; }
.card .actions .nav-btn { padding: 11px 0; font-size: .95rem; }

@media (min-width: 700px) {
  main, header, .badges { max-width: 720px; margin-left: auto; margin-right: auto; width: 100%; }
  nav { justify-content: center; }
  nav button { max-width: 130px; }
}
@media (prefers-reduced-motion: no-preference) {
  .verse-text { animation: settle .35s ease; }
  @keyframes settle { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}


/* v13 — the translators' margin note, kept apart from Scripture */
.verse-note{
  margin-top:14px; padding:9px 12px; border-left:2px solid #4a3f30;
  color:#9d927c; font-size:13.5px; line-height:1.5; font-style:italic;
}

/* ============================================================
   v1.0.9
   ============================================================ */

/* ⚡ Gems of Light. Lightning sits beside the streak's flame as one family;
   a bulb beside a flame would read as two apps. It must not be confusable
   with 🔥 at a glance, which is why it is cooler and not orange. */
/* ⚡ is a colour emoji, so `color` cannot dim it — and an undimmed bolt beside
   a clearly-unlit ♥ reads as already marked. Struck, it comes to full colour. */
.gem-btn { filter: grayscale(1); opacity: .5; }
.gem-btn.on { filter: none; opacity: 1; text-shadow: 0 0 10px rgba(227,196,119,.55); }
.mark-hint {
  text-align: center; font-size: .78rem; color: var(--parchment-dim);
  font-style: italic; margin-top: 10px;
}
.mark-hint b { font-style: normal; color: var(--gold); }
.screen-note { font-size: .85rem; color: var(--parchment-dim); font-style: italic; margin: -6px 0 12px; }
.gem-filter { margin-bottom: 12px; }
.gem-mark { color: var(--gold-bright); margin-right: 6px; }
.fav-mark { color: var(--ember); margin-right: 6px; }

/* The inscription (Decision 88). Fixed at the head of the badges screen —
   not rotating, not dismissible. It is the frame, and everything under it
   is free to be plain and useful because this is stated first. */
.inscription {
  border: 1px solid var(--gold); border-radius: 12px;
  padding: 13px 15px; margin-bottom: 4px; text-align: center;
  background: rgba(200,162,74,.06);
}
.inscription-line { color: var(--gold-bright); letter-spacing: .13em; font-size: .92rem; }
.inscription-note {
  font-size: .78rem; color: var(--parchment-dim); font-style: italic; margin-top: 6px; line-height: 1.5;
}

/* A heading that opens its own full ladder (Decision 90). */
.ladder-open { background: none; border: 0; font-family: inherit; text-align: left; cursor: pointer; }
.ladder-open::after { content: " ›"; color: var(--parchment-dim); }
.ladder-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid var(--ink-line);
  font-size: .92rem; color: var(--parchment-dim);
}
.ladder-row:last-child { border-bottom: 0; }
.ladder-row.reached { color: var(--parchment); }
.ladder-row.here { color: var(--gold-bright); }
.ladder-row .n { font-variant-numeric: tabular-nums; }
.milestone-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0; font-size: .88rem; color: var(--parchment-dim);
  border-bottom: 1px solid var(--ink-line);
}
.milestone-row:last-child { border-bottom: 0; }
.milestone-row b { color: var(--parchment); font-weight: normal; }

/* Self-service plan controls (v15.1 §3.8). Both numbers on screen, because
   the whole point is seeing one move when you change the other. */
.plan-edit { margin-top: 10px; border-top: 1px solid var(--ink-line); padding-top: 10px; }
.plan-edit .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.plan-edit label { font-size: .82rem; color: var(--parchment-dim); }
.plan-edit input {
  width: 130px; padding: 6px 9px; border-radius: 8px;
  border: 1px solid var(--ink-line); background: var(--ink); color: var(--parchment);
  font-family: inherit; font-size: .9rem;
}
.plan-edit .effect { font-size: .82rem; color: var(--gold-bright); font-style: italic; margin-top: 8px; }
.well-meta { font-size: .92rem; color: var(--gold-bright); font-style: italic; }

/* ================= v1.1.0 ================= */

/* The season greets him with the verse of the day. A general feature — which
   is what stops it saying anything about a room. */
.season-line{
  margin:0 0 10px; padding:8px 12px; border-radius:10px;
  background:rgba(200,162,74,.08); border:1px solid rgba(200,162,74,.25);
  color:var(--gold-bright); font-size:.92rem; line-height:1.45;
}
.season-line .season-lbl{ display:block; font-size:.72rem; letter-spacing:.08em;
  text-transform:uppercase; opacity:.7; margin-bottom:2px; }
/* --ink is the near-black BACKGROUND, not a text colour: a first cut set the
   reminder in it and drew black text on a black card. The line was in the DOM,
   correct, and invisible — found in a screenshot, not by a check, exactly as
   the unlit ⚡ was in v1.0.9. */
.remind-line{ background:transparent; border-style:dashed; color:var(--parchment); opacity:.85; }

/* Reading aloud. It sits with the prayer timer because both belong to the
   verse on screen, not to the navigation. */
.listen-btn{ min-width:auto; padding:4px 10px; }
.listen-btn.on{ background:var(--gold); color:#1a1408; }
.audio-bar{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin-top:10px; padding:8px 12px; border-radius:10px;
  background:rgba(200,162,74,.07); border:1px solid rgba(200,162,74,.2);
  font-size:.9rem;
}
.audio-bar span{ flex:1 1 auto; }

/* The square. Drawn on a canvas, so nothing here builds markup. */
.square-wrap{
  display:flex; justify-content:center; align-items:center;
  margin:10px 0; padding:10px; border-radius:12px; background:#fff;
}
/* v1.1.4, Decision 156 — F35. The cap was 460px inside a panel that offers up
   to 688, so a version-40 square (177 modules) landed at roughly three screen
   pixels a module with dark screen going spare on both sides. A phone camera
   wants four or five. The square now takes the panel properly, and is still
   bounded by the shorter side of the window so it never overflows the sheet. */
.square-wrap canvas{ width:100%; max-width:min(92vw, 74vh, 680px); height:auto; image-rendering:pixelated; }
/* Tapping the square fills the screen — the most modules-per-inch obtainable
   without adding a square. Heading, buttons and the bottom bar all out of the
   way, white ground kept because that is what a scanner wants. */
.square-wrap.full{
  position:fixed; inset:0; z-index:200; margin:0; padding:0;
  border-radius:0; background:#fff;
}
.square-wrap.full canvas{ max-width:min(100vw, 100vh); width:min(100vw, 100vh); }
.square-wrap video{ width:100%; max-width:340px; border-radius:8px; background:#000; }

/* The Secret Place. Nothing in here counts, and nothing in here is a score. */
.room-season{ font-size:1rem; color:var(--gold-bright); line-height:1.4; }
.room-season .none{ opacity:.55; font-style:italic; }
/* v1.1.2, F14 — fixed chrome, never text a category name can reproduce. */
.room-season .season-label{ display:block; font-size:.7rem; letter-spacing:.08em; text-transform:uppercase; color:var(--gold); opacity:.8; margin-bottom:1px; }
.file-marks{ display:flex; flex-direction:column; gap:8px; margin:10px 0; }
.file-marks label{ display:flex; align-items:center; gap:8px; font-size:.92rem; cursor:pointer; }
.file-marks input{ width:auto; margin:0; }
/* v1.1.2, Decision 132 — the two ticks sit above the writing box itself now,
   unclaimed until touched; a little extra room keeps them from crowding it. */
.file-marks-top{ margin-bottom:12px; }
.knock-pad{
  margin:12px 0; padding:26px 12px; text-align:center; cursor:pointer;
  border:1px dashed rgba(200,162,74,.5); border-radius:12px;
  background:rgba(200,162,74,.05); color:var(--gold-bright); user-select:none;
}
.knock-pad.armed{ background:rgba(200,162,74,.14); }
.room-entry{
  padding:10px 0; border-bottom:1px solid rgba(255,255,255,.07);
}
.room-entry .when{ font-size:.76rem; opacity:.6; letter-spacing:.04em; }
.room-entry .title{ font-weight:600; margin:2px 0; }
.room-entry .body{ white-space:pre-wrap; line-height:1.5; font-size:.94rem; }
.room-entry .marks{ font-size:.76rem; opacity:.7; margin-top:4px; }
/* v1.1.3, Decision 133 — the heading is whatever names the letter: its title
   if it has one, otherwise its date. Centred either way, with the date
   dropping to a small line beneath when a title has taken its place. */
.room-entry .head{
  font-weight:600; font-size:1.04rem; text-align:center; margin:2px 0 1px;
}
.room-entry .sub{
  font-size:.74rem; opacity:.55; letter-spacing:.04em; text-align:center;
  margin-bottom:6px;
}
/* v1.1.3, Decision 134 — an edit is said quietly, never hidden. */
.room-entry .edited{ font-size:.72rem; opacity:.5; margin-top:6px; font-style:italic; }
/* v1.1.3, Decision 134 — editing on the letter itself, in the room's own look.
   No browser dialog ever touches a man's writing again. */
.room-entry.editing{ padding:12px 0; }
.room-entry .edit-title, .room-entry .edit-body{
  width:100%; box-sizing:border-box; margin:6px 0;
}
.room-entry .edit-body{ white-space:pre-wrap; line-height:1.5; resize:vertical; }
.room-entry .edit-tick{
  display:flex; gap:8px; align-items:flex-start;
  font-size:.8rem; opacity:.85; margin:6px 0;
}
.room-entry .edit-tick input{ margin-top:3px; flex:0 0 auto; }
.room-entry .edit-acts{ display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }
.room-cat{
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  padding:10px 0; border-bottom:1px solid rgba(255,255,255,.07); cursor:pointer;
}
.room-cat .nm{ font-weight:600; flex:1 1 auto; min-width:0; }
/* v1.1.4, Decision 147 — a row can now carry Rename, Seal and Open. They keep
   their order and Open always holds the last column; on a narrow phone they
   wrap rather than squeezing the name out of the row. */
.room-cat .small-btn{ flex:0 0 auto; }
@media (max-width: 420px){
  .room-cat{ flex-wrap:wrap; }
  .room-cat .nm{ flex:1 0 100%; }
}
/* v1.1.4, Decisions 174–177 — renaming happens on the row, in the room's own
   look, the same way Decision 134 put editing on the letter. */
.room-cat.renaming{ display:block; cursor:default; padding:12px 0; }
.room-cat.renaming .edit-title{ width:100%; box-sizing:border-box; margin:6px 0; }
.room-cat.renaming .edit-acts{ display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }
/* v1.1.4, Decision 166 — Edit, Filed as… and Seal in one row, in the same
   place on every letter. The room's rule is that a thing behaves the same way
   every time; a Seal that moves about is the same odd-one-out fault as F32. */
.room-entry .entry-acts{ display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }
#makePicker{ display:flex; gap:6px; margin:10px 0; }
#makePicker select{ flex:1 1 0; min-width:0; }


/* ---------- v1.1.1: The Secret Place ---------- */
/* The words of a verse, offered as chips. Shown on the word panel for every
   owner whatever shape he chose, so the panel never says which one it is. */
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.word-chips button {
  font-family: inherit; font-size: .86rem; line-height: 1;
  padding: 7px 9px; border-radius: 999px;
  border: 1px solid var(--ink-line); background: transparent;
  color: var(--parchment); cursor: pointer;
}
.word-chips button:hover, .word-chips button:focus { border-color: var(--gold); color: var(--gold-bright); }
/* Shown once, at the making, and never again. */
.reveal { border: 1px solid var(--gold); border-radius: 12px; padding: 14px 15px; background: rgba(200,162,74,.06); }
.reveal-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: .92rem; }
.reveal-row b { color: var(--gold-bright); letter-spacing: .04em; }
.reveal-note { font-size: .78rem; color: var(--parchment-dim); font-style: italic; margin-top: 8px; line-height: 1.5; }

/* ---------- v1.1.3, Decision 140: browsing the categories ---------- */
/* Type-ahead only finds what a man can already half-remember. The button
   beside the box opens the whole list, so a name he has entirely forgotten is
   still one tap away — and picking from it can never make a second category
   out of a typo. */
.cat-field{ display:flex; gap:6px; align-items:center; max-width:55%; }
.cat-field input{ flex:1 1 auto; min-width:0; }
.cat-field .small-btn{ flex:0 0 auto; }
/* v1.1.4, Decision 151 — tap-to-reveal on EVERY word box: the door, the
   making, the change-the-word screen and the backup box alike. Dots by
   default everywhere; the tap is the owner's own choice, which is what keeps
   it safe in a public place. One box behaving differently from the rest is
   the same odd-one-out fault as F32. */
.pin-field{ display:flex; gap:6px; align-items:center; width:100%; margin:6px 0; }
.pin-field input{ flex:1 1 auto; min-width:0; margin:0; }
.pin-field .small-btn{ flex:0 0 auto; }
.cat-picker{
  display:flex; flex-wrap:wrap; gap:6px;
  margin:8px 0 0; padding:8px 0 0;
  border-top:1px solid rgba(255,255,255,.07);
}
.cat-picker button{
  font:inherit; font-size:.82rem; cursor:pointer;
  background:rgba(255,255,255,.06); color:inherit;
  border:1px solid rgba(255,255,255,.14); border-radius:999px;
  padding:5px 11px;
}
.cat-picker button:hover{ background:rgba(255,255,255,.12); }
.cat-picker .none{ font-size:.8rem; opacity:.6; }

/* ---------- v1.1.3, Decisions 135 + 143: Back and Close, as a pair ---------- */
/* They belong together or a man reaches for one and finds the other. Never
   stacked, never at opposite ends of a screen. */
.head-pair{ display:flex; gap:8px; align-items:center; flex:0 0 auto; }

/* ---------- v1.1.3, Decision 139: every sheet keeps its head ---------- */
/* F27. v1.1.1 fixed this for the badges sheet alone (old finding F3) and the
   fix stayed where it was built, so the room's own settings scrolled its
   header and its Close clean off the top. Decision 139 makes it the rule
   rather than one screen's repair: ANY sheet with a Close button keeps that
   head, and that button, fixed while its content scrolls beneath.
   Written as a direct-child selector on purpose — the badges sheet nests its
   .badge-head inside .sheet-head, which is already sticky, and sticking both
   would leave the inner one floating a header's depth down the panel. */
.sheet-panel > .badge-head {
  position: sticky; top: 0; z-index: 3;
  background: var(--ink-raised);
  margin: -16px -16px 6px; padding: 16px 16px 8px;
  border-bottom: 1px solid var(--ink-line);
}

/* ---------- v1.1.5 ---------- */
/* Decision 223 — the title box sits at the top of the blank letter. */
.room-title {
  width: 100%; box-sizing: border-box; margin: 4px 0 8px; padding: 9px 11px;
  background: transparent; color: var(--parchment); font: inherit; font-size: 1.02rem;
  border: 1px solid var(--ink-line); border-radius: 8px;
}
/* Decision 235 — the spare key, large enough to copy by hand without error. */
.spare-words {
  margin: 12px 0; padding: 14px 12px; text-align: center; line-height: 1.7;
  font-size: 1.12rem; letter-spacing: .03em; color: var(--gold-bright);
  border: 1px dashed var(--gold); border-radius: 10px; word-spacing: .12em;
}
#spareOverlay .edit-tick { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 4px; }
#spareOverlay .edit-tick input { margin-top: 3px; flex: 0 0 auto; }
#spareDone[disabled] { opacity: .45; }

/* ---------- v1.1.6 ---------- */
/* Decision 257, F7 — the "a name you choose" box takes the room's dark
   colours: light writing on a dark box, like every other box in the room. */
.cat-field input {
  background: var(--ink); color: var(--parchment);
  border: 1px solid var(--ink-line); border-radius: 8px; padding: 7px 9px;
}
.cat-field input::placeholder { color: var(--parchment-dim); opacity: .8; }
/* Decision 257, F8 — the writing box uses the title box's own font. */
#roomBox { font-family: var(--serif); font-size: 1.02rem; line-height: 1.55; }
#roomBox::placeholder, .room-title::placeholder { color: var(--parchment-dim); opacity: .8; }

/* ---------- v1.1.8 — Tithe of the Day ---------- */
.is-web .ext-only { display: none !important; }
.tithe-motto { text-align: center; font-size: .72rem; letter-spacing: .22em; color: var(--gold); margin: 16px 0 12px; }
.tithe-today { display: flex; align-items: center; gap: 16px; }
.tithe-ring { width: 104px; height: 104px; flex: 0 0 104px; transform: rotate(-90deg); }
.tithe-ring circle { fill: none; stroke-width: 9; }
.tithe-ring .tr-bg { stroke: var(--ink-line); }
.tithe-ring .tr-fg { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .5s ease; }
.tithe-ring.kept .tr-fg { stroke: var(--gold-bright); }
.tithe-big { font-size: 1.25rem; color: var(--gold-bright); }
.tithe-nudge { text-align: center; font-style: italic; color: var(--gold-bright); margin: 12px 0 6px; font-size: 1.08rem; }
.tithe-nudge.kept { font-style: normal; color: #9fd29a; }
.tithe-lines { margin-top: 3px; }
.tithe-ask { border-color: var(--gold) !important; }
.tithe-list > div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--ink-line); font-size: .92rem; }
.tithe-list > div .dim { color: var(--parchment-dim); }
#badgeTithe { cursor: pointer; }
#badgeTithe.kept { border-color: var(--gold); color: var(--gold-bright); }
.pray-btn.medit-on { background: var(--gold); color: #1a1408; border-color: var(--gold); }
#titheAwayPick input, .setting input[type=time] { background: var(--ink-raised); color: var(--parchment); border: 1px solid var(--ink-line); border-radius: 8px; padding: 6px 8px; font: inherit; }

/* ---------- v1.1.8 test sitting (9 Nov 2026) ---------- */
/* F1 — the own-minutes box had "min" squeezed against its arrows. */
#titheAwayOwn { width: 92px; text-align: center; box-sizing: border-box; }
/* F2 — the ring and "TODAY" showed above the head when scrolled. Firefox
   sticks the head below the panel's top padding, leaving a strip for the
   content to slide through. This sheet starts its panel at the very top
   instead, so the head sits flush and covers everything beneath it. */
#titheSheet .sheet-panel { padding-top: 0; }
#titheSheet .sheet-panel > .badge-head { margin-top: 0; padding-top: 16px; }
/* F6 — the running prayer wears 🙏. */
.pray-mark { font-size: .95rem; line-height: 1; }
