/* Bible Today app. Colours and fonts come from main-book/src/common.py; keep the two in step. */

@font-face { font-family: "Crimson"; src: url(fonts/Crimson-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Crimson"; src: url(fonts/Crimson-Italic.woff) format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Crimson"; src: url(fonts/Crimson-SemiBold.woff) format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(fonts/Cormorant-Medium.woff) format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(fonts/Cormorant-SemiBold.woff) format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(fonts/Cormorant-MediumItalic.woff) format("woff"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Jost"; src: url(fonts/Jost-Light.woff) format("woff"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Jost"; src: url(fonts/Jost-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jost"; src: url(fonts/Jost-Medium.woff) format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Great Vibes"; src: url(fonts/GreatVibes-Regular.woff) format("woff"); font-display: swap; }

:root {
  /* the six-colour sequence (SEQ6) and their deep tones */
  --pink: #F7DFDC;    --pink-d: #BE7973;    --pink-m: #EBB0A9;
  --blush: #FBEDF3;   --blush-d: #B87896;   --blush-m: #E5AFC7;
  --lilac: #E8E6F9;   --lilac-d: #8886BB;   --lilac-m: #BCBAE6;
  --sky: #D1ECFA;     --sky-d: #3B95B7;     --sky-m: #88C7E3;
  --seafoam: #D0EEEA; --seafoam-d: #3C9A90; --seafoam-m: #85CBC2;
  --lime: #EEF0D9;    --lime-d: #8A9150;    --lime-m: #D2D7A6;

  --board: #F6EEE6;   --board-edge: #E2D3C5; --stitch: #9C8473;
  --paper: #FFFFFF;
  --neutral: #FFF9F4; --neutral-edge: #FCE4E5; --neutral-ink: #BF787E;
  --ink: #2E2A36;     --plum: #5E5470;       --muted: #8E8581;
  --line: #E6E0EC; --dot: #C9C1BC;    --rule: #EFE7E2;

  --serif: "Crimson", Georgia, serif;
  --display: "Cormorant", "Crimson", Georgia, serif;
  --sans: "Jost", system-ui, sans-serif;
  --script: "Great Vibes", cursive;

  --text-size: 19px;
  --radius: 14px;
  --gutter: 16px;
  --tone: var(--pink); --tone-d: var(--pink-d); --tone-m: var(--pink-m);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--board); color: var(--ink);
  font-family: var(--serif); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- the cover board around the page ---------- */
.board {
  min-height: 100dvh; max-width: 1280px; margin: 0 auto;
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  display: flex; flex-direction: column;
}
@media (min-width: 900px) {
  .board { padding-left: 32px; padding-right: 32px; }
  .board::before { /* dashed stitching, as on the book cover */
    content: ""; position: fixed; inset: 8px; border: 1.5px dashed color-mix(in srgb, var(--stitch) 45%, transparent);
    border-radius: 18px; pointer-events: none;
  }
}

.masthead { display: flex; align-items: center; justify-content: space-between; padding: 14px 2px 10px; }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: 10px; }
.brand-script { font-family: var(--script); font-size: 30px; color: var(--brand, var(--pink-d)); line-height: 1; }
.mast-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bible-chip {
  display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; padding: 4px 14px 4px 4px; border-radius: 999px;
  background: var(--neutral); border: 1px solid var(--neutral-edge); color: var(--neutral-ink); font-family: var(--sans); font-size: 13px; font-weight: 500;
}
.bible-chip img { width: 26px; height: 36px; object-fit: cover; border-radius: 4px; box-shadow: 0 1px 3px rgba(110, 80, 60, .3); }
.bible-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }
@media (max-width: 560px) { .brand-sub { display: none; } .bible-chip span { max-width: 12ch; } }

/* theme colours: the cover board and the brand take the Bible's colour */
html[data-theme="pink"] { --board: #F8E9E5; --board-edge: #EBCFC9; --brand: var(--pink-d); }
html[data-theme="blush"] { --board: #F9EDF0; --board-edge: #EBD0DC; --brand: var(--blush-d); }
html[data-theme="lilac"] { --board: #EEEAF5; --board-edge: #D6D1EA; --brand: var(--lilac-d); }
html[data-theme="sky"] { --board: #E7F0F5; --board-edge: #C9DFEA; --brand: var(--sky-d); }
html[data-theme="seafoam"] { --board: #E6F1EE; --board-edge: #C6E1DB; --brand: var(--seafoam-d); }
html[data-theme="lime"] { --board: #F0F1E4; --board-edge: #DADDBF; --brand: var(--lime-d); }
/* ---------- bold themes: dark board, jewel tabs with metallic lettering, light accents on the white page.
   Tabs use --thN (by position, like Classic); the page uses --acc. Highlights keep their own pastels. */
:root {
  --heritage-board: #1F1C19; --heritage-1: #3A2A1D; --heritage-1-d: #E2C483; --heritage-1-m: #6B5233; --heritage-2: #4B1F24; --heritage-2-d: #E2C483; --heritage-2-m: #7A3B3F; --heritage-3: #1C2A44; --heritage-3-d: #E2C483; --heritage-3-m: #3A4E70; --heritage-4: #1E3527; --heritage-4-d: #E2C483; --heritage-4-m: #3D5E47; --heritage-5: #1F3A3D; --heritage-5-d: #E2C483; --heritage-5-m: #3E6266;
  --navy-board: #18202D; --navy-1: #1E2B42; --navy-1-d: #DCC189; --navy-1-m: #3D5276; --navy-2: #2A3F57; --navy-2-d: #DCC189; --navy-2-m: #4B6684; --navy-3: #33414F; --navy-3-d: #DCC189; --navy-3-m: #55677A; --navy-4: #262B33; --navy-4-d: #DCC189; --navy-4-m: #4A525E; --navy-5: #1F3B44; --navy-5-d: #DCC189; --navy-5-m: #3F6470;
  --forest-board: #2A2119; --forest-1: #1F3A2B; --forest-1-d: #E6CF98; --forest-1-m: #3F6450; --forest-2: #3B4226; --forest-2-d: #E6CF98; --forest-2-m: #626B45; --forest-3: #2E4A36; --forest-3-d: #E6CF98; --forest-3-m: #4F7259; --forest-4: #4A3220; --forest-4-d: #E6CF98; --forest-4-m: #72523A; --forest-5: #1C3330; --forest-5-d: #E6CF98; --forest-5-m: #3B5A55;
  --slate-board: #25282D; --slate-1: #34383F; --slate-1-d: #E6E2DA; --slate-1-m: #585E68; --slate-2: #3E4A57; --slate-2-d: #E6E2DA; --slate-2-m: #62717F; --slate-3: #4A4741; --slate-3-d: #E6E2DA; --slate-3-m: #6E6A62; --slate-4: #2F3B47; --slate-4-d: #E6E2DA; --slate-4-m: #536373; --slate-5: #2B2E33; --slate-5-d: #E6E2DA; --slate-5-m: #50555D;
  --oxblood-board: #221517; --oxblood-1: #4A1C1F; --oxblood-1-d: #EBCBA2; --oxblood-1-m: #77393C; --oxblood-2: #3E2A20; --oxblood-2-d: #EBCBA2; --oxblood-2-m: #69503F; --oxblood-3: #3A1A2A; --oxblood-3-d: #EBCBA2; --oxblood-3-m: #643B4E; --oxblood-4: #4E2A1A; --oxblood-4-d: #EBCBA2; --oxblood-4-m: #7A4D36; --oxblood-5: #33241E; --oxblood-5-d: #EBCBA2; --oxblood-5-m: #5E4639;
}
html[data-theme="heritage"] { --board: #1F1C19; --board-edge: #3A332B; --stitch: #B89A5E; --brand: #C9A45A;
  --th-on: #C9A45A; --th-on-ink: #1F1C19; --acc: #F4ECDD; --acc-d: #8A6A2E; --acc-m: #D9C39A;
  --th1: var(--heritage-1); --th1-d: var(--heritage-1-d); --th1-m: var(--heritage-1-m); --th2: var(--heritage-2); --th2-d: var(--heritage-2-d); --th2-m: var(--heritage-2-m); --th3: var(--heritage-3); --th3-d: var(--heritage-3-d); --th3-m: var(--heritage-3-m); --th4: var(--heritage-4); --th4-d: var(--heritage-4-d); --th4-m: var(--heritage-4-m); --th5: var(--heritage-5); --th5-d: var(--heritage-5-d); --th5-m: var(--heritage-5-m); }
html[data-theme="navy"] { --board: #18202D; --board-edge: #2C3A50; --stitch: #B39459; --brand: #C2A266;
  --th-on: #C2A266; --th-on-ink: #18202D; --acc: #EEF1F5; --acc-d: #2E4A6B; --acc-m: #B9C6D6;
  --th1: var(--navy-1); --th1-d: var(--navy-1-d); --th1-m: var(--navy-1-m); --th2: var(--navy-2); --th2-d: var(--navy-2-d); --th2-m: var(--navy-2-m); --th3: var(--navy-3); --th3-d: var(--navy-3-d); --th3-m: var(--navy-3-m); --th4: var(--navy-4); --th4-d: var(--navy-4-d); --th4-m: var(--navy-4-m); --th5: var(--navy-5); --th5-d: var(--navy-5-d); --th5-m: var(--navy-5-m); }
html[data-theme="forest"] { --board: #2A2119; --board-edge: #45372A; --stitch: #C2A170; --brand: #C9AA72;
  --th-on: #C9AA72; --th-on-ink: #2A2119; --acc: #EEF1E6; --acc-d: #3F5E3A; --acc-m: #BFCDB0;
  --th1: var(--forest-1); --th1-d: var(--forest-1-d); --th1-m: var(--forest-1-m); --th2: var(--forest-2); --th2-d: var(--forest-2-d); --th2-m: var(--forest-2-m); --th3: var(--forest-3); --th3-d: var(--forest-3-d); --th3-m: var(--forest-3-m); --th4: var(--forest-4); --th4-d: var(--forest-4-d); --th4-m: var(--forest-4-m); --th5: var(--forest-5); --th5-d: var(--forest-5-d); --th5-m: var(--forest-5-m); }
html[data-theme="slate"] { --board: #25282D; --board-edge: #3C4148; --stitch: #A9ADB3; --brand: #C9CDD3;
  --th-on: #C9CDD3; --th-on-ink: #25282D; --acc: #EEF0F2; --acc-d: #4A5563; --acc-m: #C3C9D1;
  --th1: var(--slate-1); --th1-d: var(--slate-1-d); --th1-m: var(--slate-1-m); --th2: var(--slate-2); --th2-d: var(--slate-2-d); --th2-m: var(--slate-2-m); --th3: var(--slate-3); --th3-d: var(--slate-3-d); --th3-m: var(--slate-3-m); --th4: var(--slate-4); --th4-d: var(--slate-4-d); --th4-m: var(--slate-4-m); --th5: var(--slate-5); --th5-d: var(--slate-5-d); --th5-m: var(--slate-5-m); }
html[data-theme="oxblood"] { --board: #221517; --board-edge: #3E2729; --stitch: #B48A6A; --brand: #C99A72;
  --th-on: #C99A72; --th-on-ink: #221517; --acc: #F5EAE6; --acc-d: #7A2E2E; --acc-m: #DDB9B0;
  --th1: var(--oxblood-1); --th1-d: var(--oxblood-1-d); --th1-m: var(--oxblood-1-m); --th2: var(--oxblood-2); --th2-d: var(--oxblood-2-d); --th2-m: var(--oxblood-2-m); --th3: var(--oxblood-3); --th3-d: var(--oxblood-3-d); --th3-m: var(--oxblood-3-m); --th4: var(--oxblood-4); --th4-d: var(--oxblood-4-d); --th4-m: var(--oxblood-4-m); --th5: var(--oxblood-5); --th5-d: var(--oxblood-5-d); --th5-m: var(--oxblood-5-m); }

/* ---------- soft palettes: five mixed colours per theme; each tab gets lettering that reads on it. The chosen tab
   is the palette's deepest colour (or its lightest, when the tab is already deep). Light board by default. */
:root {
  --blues-board: #0E2240; --blues-1: #E9E9F3; --blues-1-d: #1F3153; --blues-1-m: #C4C4CC; --blues-1-on: #173564; --blues-1-on-ink: #FFFFFF; --blues-2: #BCD0DF; --blues-2-d: #1F3153; --blues-2-m: #9EAFBB; --blues-2-on: #173564; --blues-2-on-ink: #FFFFFF; --blues-3: #79AACB; --blues-3-d: #1F3153; --blues-3-m: #668FAB; --blues-3-on: #173564; --blues-3-on-ink: #FFFFFF; --blues-4: #4A7FB0; --blues-4-d: #111014; --blues-4-m: #3E6B94; --blues-4-on: #173564; --blues-4-on-ink: #FFFFFF; --blues-5: #214C8F; --blues-5-d: #E4EAF2; --blues-5-m: #1C4078; --blues-5-on: #E9E9F3; --blues-5-on-ink: #1F3153;
  --moody-board: #0B141C; --moody-1: #CBCDCE; --moody-1-d: #15181F; --moody-1-m: #ABACAD; --moody-1-on: #0B141C; --moody-1-on-ink: #FFFFFF; --moody-2: #8DB3A9; --moody-2-d: #15181F; --moody-2-m: #76968E; --moody-2-on: #0B141C; --moody-2-on-ink: #FFFFFF; --moody-3: #55716F; --moody-3-d: #EBEEEE; --moody-3-m: #475F5D; --moody-3-on: #0B141C; --moody-3-on-ink: #FFFFFF; --moody-4: #13262F; --moody-4-d: #E3E5E6; --moody-4-m: #102027; --moody-4-on: #CBCDCE; --moody-4-on-ink: #15181F; --moody-5: #0B141C; --moody-5-d: #E2E3E4; --moody-5-m: #091118; --moody-5-on: #CBCDCE; --moody-5-on-ink: #15181F;
  --galaxy-board: #102536; --galaxy-1: #DCCED6; --galaxy-1-d: #1C2A3A; --galaxy-1-m: #B9ADB4; --galaxy-1-on: #1A3D57; --galaxy-1-on-ink: #FFFFFF; --galaxy-2: #B8AEC1; --galaxy-2-d: #1C2A3A; --galaxy-2-m: #9B92A2; --galaxy-2-on: #1A3D57; --galaxy-2-on-ink: #FFFFFF; --galaxy-3: #8587BD; --galaxy-3-d: #1E1B22; --galaxy-3-m: #70719F; --galaxy-3-on: #1A3D57; --galaxy-3-on-ink: #FFFFFF; --galaxy-4: #435784; --galaxy-4-d: #E8EBF0; --galaxy-4-m: #38496F; --galaxy-4-on: #DCCED6; --galaxy-4-on-ink: #1C2A3A; --galaxy-5: #1A3D57; --galaxy-5-d: #E4E8EB; --galaxy-5-m: #163349; --galaxy-5-on: #DCCED6; --galaxy-5-on-ink: #1C2A3A;
  --peacock-board: #22224A; --peacock-1: #E5ECD9; --peacock-1-d: #33315D; --peacock-1-m: #C0C6B6; --peacock-1-on: #353574; --peacock-1-on-ink: #FFFFFF; --peacock-2: #CFE4C2; --peacock-2-d: #33315D; --peacock-2-m: #AEC0A3; --peacock-2-on: #353574; --peacock-2-on-ink: #FFFFFF; --peacock-3: #8BD5C8; --peacock-3-d: #33315D; --peacock-3-m: #75B3A8; --peacock-3-on: #353574; --peacock-3-on-ink: #FFFFFF; --peacock-4: #6199DD; --peacock-4-d: #1E1B22; --peacock-4-m: #5181BA; --peacock-4-on: #353574; --peacock-4-on-ink: #FFFFFF; --peacock-5: #4C4CA6; --peacock-5-d: #EAEAF4; --peacock-5-m: #40408B; --peacock-5-on: #E5ECD9; --peacock-5-on-ink: #33315D;
  --peony-board: #28242B; --peony-1: #F0CFD4; --peony-1-d: #48404F; --peony-1-m: #CAAEB2; --peony-1-on: #564D5E; --peony-1-on-ink: #FFFFFF; --peony-2: #EAB6C8; --peony-2-d: #48404F; --peony-2-m: #C599A8; --peony-2-on: #564D5E; --peony-2-on-ink: #FFFFFF; --peony-3: #DCA2BC; --peony-3-d: #48404F; --peony-3-m: #B9889E; --peony-3-on: #564D5E; --peony-3-on-ink: #FFFFFF; --peony-4: #DA7598; --peony-4-d: #1E1B22; --peony-4-m: #B76280; --peony-4-on: #564D5E; --peony-4-on-ink: #FFFFFF; --peony-5: #7B6E86; --peony-5-d: #FFFFFF; --peony-5-m: #675C71; --peony-5-on: #F0CFD4; --peony-5-on-ink: #48404F;
  --twilight-board: #0E0E12; --twilight-1: #BCADBC; --twilight-1-d: #17151B; --twilight-1-m: #9E919E; --twilight-1-on: #0E0E12; --twilight-1-on-ink: #FFFFFF; --twilight-2: #8086AA; --twilight-2-d: #17151B; --twilight-2-m: #6C718F; --twilight-2-on: #0E0E12; --twilight-2-on-ink: #FFFFFF; --twilight-3: #43557F; --twilight-3-d: #E8EBF0; --twilight-3-m: #38476B; --twilight-3-on: #0E0E12; --twilight-3-on-ink: #FFFFFF; --twilight-4: #1B2444; --twilight-4-d: #E4E5E9; --twilight-4-m: #171E39; --twilight-4-on: #BCADBC; --twilight-4-on-ink: #17151B; --twilight-5: #0E0E12; --twilight-5-d: #E2E2E3; --twilight-5-m: #0C0C0F; --twilight-5-on: #BCADBC; --twilight-5-on-ink: #17151B;
  --coral-board: #331A1E; --coral-1: #78989C; --coral-1-d: #1E1B22; --coral-1-m: #658083; --coral-1-on: #6D3940; --coral-1-on-ink: #FFFFFF; --coral-2: #CFDDD4; --coral-2-d: #57333C; --coral-2-m: #AEBAB2; --coral-2-on: #6D3940; --coral-2-on-ink: #FFFFFF; --coral-3: #F3D6BC; --coral-3-d: #57333C; --coral-3-m: #CCB49E; --coral-3-on: #6D3940; --coral-3-on-ink: #FFFFFF; --coral-4: #D4877A; --coral-4-d: #1E1B22; --coral-4-m: #B27166; --coral-4-on: #6D3940; --coral-4-on-ink: #FFFFFF; --coral-5: #9C515C; --coral-5-d: #F3EAEB; --coral-5-m: #83444D; --coral-5-on: #F3D6BC; --coral-5-on-ink: #57333C;
  --desertrose-board: #401A1A; --desertrose-1: #F5E4D0; --desertrose-1-d: #51292D; --desertrose-1-m: #CEC0AF; --desertrose-1-on: #642929; --desertrose-1-on-ink: #FFFFFF; --desertrose-2: #E8CBB5; --desertrose-2-d: #51292D; --desertrose-2-m: #C3AB98; --desertrose-2-on: #642929; --desertrose-2-on-ink: #FFFFFF; --desertrose-3: #D19F9A; --desertrose-3-d: #51292D; --desertrose-3-m: #B08681; --desertrose-3-on: #642929; --desertrose-3-on-ink: #FFFFFF; --desertrose-4: #A96262; --desertrose-4-d: #FFFFFF; --desertrose-4-m: #8E5252; --desertrose-4-on: #642929; --desertrose-4-on-ink: #FFFFFF; --desertrose-5: #8F3A3A; --desertrose-5-d: #F2E7E7; --desertrose-5-m: #783131; --desertrose-5-on: #F5E4D0; --desertrose-5-on-ink: #51292D;
  --driftwood-board: #1A262B; --driftwood-1: #3B5662; --driftwood-1-d: #E7EBEC; --driftwood-1-m: #324852; --driftwood-1-on: #DDE3DE; --driftwood-1-on-ink: #2B363F; --driftwood-2: #7FA8A0; --driftwood-2-d: #2B363F; --driftwood-2-m: #6B8D86; --driftwood-2-on: #293C45; --driftwood-2-on-ink: #FFFFFF; --driftwood-3: #BEDAE0; --driftwood-3-d: #2B363F; --driftwood-3-m: #A0B7BC; --driftwood-3-on: #293C45; --driftwood-3-on-ink: #FFFFFF; --driftwood-4: #DDE3DE; --driftwood-4-d: #2B363F; --driftwood-4-m: #BABFBA; --driftwood-4-on: #293C45; --driftwood-4-on-ink: #FFFFFF; --driftwood-5: #73563F; --driftwood-5-d: #EEEBE8; --driftwood-5-m: #614835; --driftwood-5-on: #DDE3DE; --driftwood-5-on-ink: #2B363F;
}
html[data-theme="blues"] { --board: #0E2240; --board-edge: #32435D; --stitch: #94BBD5; --brand: #A1C4DB;
  --th-on: #173564; --th-on-ink: #FFFFFF; --acc: #E9F0F6; --acc-d: #173564; --acc-m: #B7CCDF;
  --th1: var(--blues-1); --th1-d: var(--blues-1-d); --th1-m: var(--blues-1-m); --th1-on: var(--blues-1-on); --th1-on-ink: var(--blues-1-on-ink); --th2: var(--blues-2); --th2-d: var(--blues-2-d); --th2-m: var(--blues-2-m); --th2-on: var(--blues-2-on); --th2-on-ink: var(--blues-2-on-ink); --th3: var(--blues-3); --th3-d: var(--blues-3-d); --th3-m: var(--blues-3-m); --th3-on: var(--blues-3-on); --th3-on-ink: var(--blues-3-on-ink); --th4: var(--blues-4); --th4-d: var(--blues-4-d); --th4-m: var(--blues-4-m); --th4-on: var(--blues-4-on); --th4-on-ink: var(--blues-4-on-ink); --th5: var(--blues-5); --th5-d: var(--blues-5-d); --th5-m: var(--blues-5-m); --th5-on: var(--blues-5-on); --th5-on-ink: var(--blues-5-on-ink); }
html[data-theme="moody"] { --board: #0B141C; --board-edge: #30373E; --stitch: #778D8C; --brand: #889C9A;
  --th-on: #0B141C; --th-on-ink: #FFFFFF; --acc: #E3E5E6; --acc-d: #0B141C; --acc-m: #A1A8AC;
  --th1: var(--moody-1); --th1-d: var(--moody-1-d); --th1-m: var(--moody-1-m); --th1-on: var(--moody-1-on); --th1-on-ink: var(--moody-1-on-ink); --th2: var(--moody-2); --th2-d: var(--moody-2-d); --th2-m: var(--moody-2-m); --th2-on: var(--moody-2-on); --th2-on-ink: var(--moody-2-on-ink); --th3: var(--moody-3); --th3-d: var(--moody-3-d); --th3-m: var(--moody-3-m); --th3-on: var(--moody-3-on); --th3-on-ink: var(--moody-3-on-ink); --th4: var(--moody-4); --th4-d: var(--moody-4-d); --th4-m: var(--moody-4-m); --th4-on: var(--moody-4-on); --th4-on-ink: var(--moody-4-on-ink); --th5: var(--moody-5); --th5-d: var(--moody-5-d); --th5-m: var(--moody-5-m); --th5-on: var(--moody-5-on); --th5-on-ink: var(--moody-5-on-ink); }
html[data-theme="galaxy"] { --board: #102536; --board-edge: #344654; --stitch: #9D9FCA; --brand: #AAABD1;
  --th-on: #1A3D57; --th-on-ink: #FFFFFF; --acc: #E8EBF0; --acc-d: #1A3D57; --acc-m: #B4BCCE;
  --th1: var(--galaxy-1); --th1-d: var(--galaxy-1-d); --th1-m: var(--galaxy-1-m); --th1-on: var(--galaxy-1-on); --th1-on-ink: var(--galaxy-1-on-ink); --th2: var(--galaxy-2); --th2-d: var(--galaxy-2-d); --th2-m: var(--galaxy-2-m); --th2-on: var(--galaxy-2-on); --th2-on-ink: var(--galaxy-2-on-ink); --th3: var(--galaxy-3); --th3-d: var(--galaxy-3-d); --th3-m: var(--galaxy-3-m); --th3-on: var(--galaxy-3-on); --th3-on-ink: var(--galaxy-3-on-ink); --th4: var(--galaxy-4); --th4-d: var(--galaxy-4-d); --th4-m: var(--galaxy-4-m); --th4-on: var(--galaxy-4-on); --th4-on-ink: var(--galaxy-4-on-ink); --th5: var(--galaxy-5); --th5-d: var(--galaxy-5-d); --th5-m: var(--galaxy-5-m); --th5-on: var(--galaxy-5-on); --th5-on-ink: var(--galaxy-5-on-ink); }
html[data-theme="peacock"] { --board: #22224A; --board-edge: #434365; --stitch: #A2DDD3; --brand: #AEE2D8;
  --th-on: #353574; --th-on-ink: #FFFFFF; --acc: #ECF3FB; --acc-d: #353574; --acc-m: #C0D6F1;
  --th1: var(--peacock-1); --th1-d: var(--peacock-1-d); --th1-m: var(--peacock-1-m); --th1-on: var(--peacock-1-on); --th1-on-ink: var(--peacock-1-on-ink); --th2: var(--peacock-2); --th2-d: var(--peacock-2-d); --th2-m: var(--peacock-2-m); --th2-on: var(--peacock-2-on); --th2-on-ink: var(--peacock-2-on-ink); --th3: var(--peacock-3); --th3-d: var(--peacock-3-d); --th3-m: var(--peacock-3-m); --th3-on: var(--peacock-3-on); --th3-on-ink: var(--peacock-3-on-ink); --th4: var(--peacock-4); --th4-d: var(--peacock-4-d); --th4-m: var(--peacock-4-m); --th4-on: var(--peacock-4-on); --th4-on-ink: var(--peacock-4-on-ink); --th5: var(--peacock-5); --th5-d: var(--peacock-5-d); --th5-m: var(--peacock-5-m); --th5-on: var(--peacock-5-on); --th5-on-ink: var(--peacock-5-on-ink); }
html[data-theme="peony"] { --board: #28242B; --board-edge: #48454B; --stitch: #E3B5C9; --brand: #E6BED0;
  --th-on: #564D5E; --th-on-ink: #FFFFFF; --acc: #FBEEF3; --acc-d: #564D5E; --acc-m: #F0C8D6;
  --th1: var(--peony-1); --th1-d: var(--peony-1-d); --th1-m: var(--peony-1-m); --th1-on: var(--peony-1-on); --th1-on-ink: var(--peony-1-on-ink); --th2: var(--peony-2); --th2-d: var(--peony-2-d); --th2-m: var(--peony-2-m); --th2-on: var(--peony-2-on); --th2-on-ink: var(--peony-2-on-ink); --th3: var(--peony-3); --th3-d: var(--peony-3-d); --th3-m: var(--peony-3-m); --th3-on: var(--peony-3-on); --th3-on-ink: var(--peony-3-on-ink); --th4: var(--peony-4); --th4-d: var(--peony-4-d); --th4-m: var(--peony-4-m); --th4-on: var(--peony-4-on); --th4-on-ink: var(--peony-4-on-ink); --th5: var(--peony-5); --th5-d: var(--peony-5-d); --th5-m: var(--peony-5-m); --th5-on: var(--peony-5-on); --th5-on-ink: var(--peony-5-on-ink); }
html[data-theme="twilight"] { --board: #0E0E12; --board-edge: #323236; --stitch: #697799; --brand: #7B88A5;
  --th-on: #0E0E12; --th-on-ink: #FFFFFF; --acc: #E4E5E9; --acc-d: #0E0E12; --acc-m: #A4A7B4;
  --th1: var(--twilight-1); --th1-d: var(--twilight-1-d); --th1-m: var(--twilight-1-m); --th1-on: var(--twilight-1-on); --th1-on-ink: var(--twilight-1-on-ink); --th2: var(--twilight-2); --th2-d: var(--twilight-2-d); --th2-m: var(--twilight-2-m); --th2-on: var(--twilight-2-on); --th2-on-ink: var(--twilight-2-on-ink); --th3: var(--twilight-3); --th3-d: var(--twilight-3-d); --th3-m: var(--twilight-3-m); --th3-on: var(--twilight-3-on); --th3-on-ink: var(--twilight-3-on-ink); --th4: var(--twilight-4); --th4-d: var(--twilight-4-d); --th4-m: var(--twilight-4-m); --th4-on: var(--twilight-4-on); --th4-on-ink: var(--twilight-4-on-ink); --th5: var(--twilight-5); --th5-d: var(--twilight-5-d); --th5-m: var(--twilight-5-m); --th5-on: var(--twilight-5-on); --th5-on-ink: var(--twilight-5-on-ink); }
html[data-theme="coral"] { --board: #331A1E; --board-edge: #523C40; --stitch: #DD9F95; --brand: #E1ABA2;
  --th-on: #6D3940; --th-on-ink: #FFFFFF; --acc: #EFF3F3; --acc-d: #6D3940; --acc-m: #C9D6D7;
  --th1: var(--coral-1); --th1-d: var(--coral-1-d); --th1-m: var(--coral-1-m); --th1-on: var(--coral-1-on); --th1-on-ink: var(--coral-1-on-ink); --th2: var(--coral-2); --th2-d: var(--coral-2-d); --th2-m: var(--coral-2-m); --th2-on: var(--coral-2-on); --th2-on-ink: var(--coral-2-on-ink); --th3: var(--coral-3); --th3-d: var(--coral-3-d); --th3-m: var(--coral-3-m); --th3-on: var(--coral-3-on); --th3-on-ink: var(--coral-3-on-ink); --th4: var(--coral-4); --th4-d: var(--coral-4-d); --th4-m: var(--coral-4-m); --th4-on: var(--coral-4-on); --th4-on-ink: var(--coral-4-on-ink); --th5: var(--coral-5); --th5-d: var(--coral-5-d); --th5-m: var(--coral-5-m); --th5-on: var(--coral-5-on); --th5-on-ink: var(--coral-5-on-ink); }
html[data-theme="desertrose"] { --board: #401A1A; --board-edge: #5D3C3C; --stitch: #DAB2AE; --brand: #DFBCB8;
  --th-on: #642929; --th-on-ink: #FFFFFF; --acc: #F5ECEC; --acc-d: #642929; --acc-m: #DDC0C0;
  --th1: var(--desertrose-1); --th1-d: var(--desertrose-1-d); --th1-m: var(--desertrose-1-m); --th1-on: var(--desertrose-1-on); --th1-on-ink: var(--desertrose-1-on-ink); --th2: var(--desertrose-2); --th2-d: var(--desertrose-2-d); --th2-m: var(--desertrose-2-m); --th2-on: var(--desertrose-2-on); --th2-on-ink: var(--desertrose-2-on-ink); --th3: var(--desertrose-3); --th3-d: var(--desertrose-3-d); --th3-m: var(--desertrose-3-m); --th3-on: var(--desertrose-3-on); --th3-on-ink: var(--desertrose-3-on-ink); --th4: var(--desertrose-4); --th4-d: var(--desertrose-4-d); --th4-m: var(--desertrose-4-m); --th4-on: var(--desertrose-4-on); --th4-on-ink: var(--desertrose-4-on-ink); --th5: var(--desertrose-5); --th5-d: var(--desertrose-5-d); --th5-m: var(--desertrose-5-m); --th5-on: var(--desertrose-5-on); --th5-on-ink: var(--desertrose-5-on-ink); }
html[data-theme="driftwood"] { --board: #1A262B; --board-edge: #3C474B; --stitch: #99B9B3; --brand: #A5C2BC;
  --th-on: #293C45; --th-on-ink: #FFFFFF; --acc: #EEEBE8; --acc-d: #293C45; --acc-m: #C7BBB2;
  --th1: var(--driftwood-1); --th1-d: var(--driftwood-1-d); --th1-m: var(--driftwood-1-m); --th1-on: var(--driftwood-1-on); --th1-on-ink: var(--driftwood-1-on-ink); --th2: var(--driftwood-2); --th2-d: var(--driftwood-2-d); --th2-m: var(--driftwood-2-m); --th2-on: var(--driftwood-2-on); --th2-on-ink: var(--driftwood-2-on-ink); --th3: var(--driftwood-3); --th3-d: var(--driftwood-3-d); --th3-m: var(--driftwood-3-m); --th3-on: var(--driftwood-3-on); --th3-on-ink: var(--driftwood-3-on-ink); --th4: var(--driftwood-4); --th4-d: var(--driftwood-4-d); --th4-m: var(--driftwood-4-m); --th4-on: var(--driftwood-4-on); --th4-on-ink: var(--driftwood-4-on-ink); --th5: var(--driftwood-5); --th5-d: var(--driftwood-5-d); --th5-m: var(--driftwood-5-m); --th5-on: var(--driftwood-5-on); --th5-on-ink: var(--driftwood-5-on-ink); }
.t-acc { --tone: var(--acc); --tone-d: var(--acc-d); --tone-m: var(--acc-m); }
.t-th1 { --tone: var(--th1); --tone-d: var(--th1-d); --tone-m: var(--th1-m); }
.t-th2 { --tone: var(--th2); --tone-d: var(--th2-d); --tone-m: var(--th2-m); }
.t-th3 { --tone: var(--th3); --tone-d: var(--th3-d); --tone-m: var(--th3-m); }
.t-th4 { --tone: var(--th4); --tone-d: var(--th4-d); --tone-m: var(--th4-m); }
.t-th5 { --tone: var(--th5); --tone-d: var(--th5-d); --tone-m: var(--th5-m); }
/* tabs: jewel colour with metallic lettering; the chosen tab is the metal with dark lettering */
html[data-palette] .tab, html[data-palette] .btab { background: var(--t); color: var(--t-d); border-color: var(--t-m); }
html[data-palette] .tab[aria-current="page"], html[data-palette] .btab[aria-current="page"],
html[data-palette].bookmode .tab[aria-current="page"], html[data-palette].bookmode .btab[aria-current="page"] {
  background: var(--t-on, var(--th-on)); border-color: var(--t-on, var(--th-on)); color: var(--t-on-ink, var(--th-on-ink)); }
/* theme preview in Create / Customize: the five tabs on a dark strip */
/* bold themes on Home: jewel cards with metallic lettering, a gold "Welcome" */
html[data-palette] .hero .script { color: var(--acc-d); }
html[data-palette] .card[class*="t-th"] { background: var(--tone); border-color: var(--tone-m); color: var(--tone-d); }
html[data-palette] .card[class*="t-th"] h3, html[data-palette] .card[class*="t-th"] p { color: var(--tone-d); }
html[data-palette] .card[class*="t-th"] p { opacity: .85; }
.theme-tabs.palette { background: var(--pb); border-radius: 8px 8px 0 0; padding: 5px 5px 0; }
.theme-tabs.palette i { border-color: var(--m); background: var(--c); }
.theme-tabs.palette.light { background: #F1F1F3; box-shadow: inset 0 0 0 1px #E1E1E4; }
/* bold themes on a light board: the same jewel tabs, a warm white board with soft stitching */
html[data-palette][data-board="light"] { --board: #F3F3F4; --board-edge: #E1E1E4; --stitch: #B4B4BA; --brand: var(--acc-d); }
/* cool and bold themes: soft panels in a very light neutral grey instead of cream (cream stays for Classic, Pink, Blush) */
html:not([data-appearance="dark"]):not([data-theme="classic"]):not([data-theme="pink"]):not([data-theme="blush"]) { --neutral: #F7F7F8; }
.board-pick { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.set-sub { font-family: var(--sans); font-size: 13px; color: var(--neutral-ink); }
.board-seg { flex: 1; grid-template-columns: repeat(2, 1fr); max-width: 260px; }
.board-sw { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--neutral-edge); }
.board-sw.dark { background: #1F1C19; } .board-sw.light { background: #F3F3F4; }

.brand-sub { font-family: var(--sans); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--stitch); }
.icon-btn {
  min-width: 44px; height: 40px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  background: var(--neutral); border: 1px solid var(--neutral-edge); color: var(--neutral-ink);
  font-family: var(--display); font-size: 19px; font-weight: 600;
}

/* ---------- section tabs (colours follow position, as in the book) ---------- */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px;
  padding: 0 2px; position: relative; z-index: 1;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; text-align: center; text-decoration: none; white-space: nowrap;
  font-family: var(--sans); font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  padding: 10px 14px 9px; border-radius: 10px 10px 0 0;
  background: color-mix(in srgb, var(--t) 70%, var(--paper)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--t-m) 60%, var(--paper)); border-bottom: 0;
  transform: translateY(4px); transition: transform .15s;
}
.tab[aria-current="page"] { transform: none; background: var(--t); border-color: var(--t-d); padding-bottom: 12px; margin-bottom: -3px; }

/* ---------- the page ---------- */
.page {
  flex: 1; background: var(--paper); border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 1px 0 var(--board-edge), 0 10px 30px -18px rgba(110, 80, 60, .35);
  padding: 22px var(--gutter) 40px; outline: none; min-width: 0;
}
@media (min-width: 700px) { .page { padding: 32px 36px 56px; border-radius: 0 var(--radius) var(--radius) var(--radius); } }

.kicker { font-family: var(--sans); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--tone-d); margin: 0 0 4px; }
.h1 { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 6vw, 46px); line-height: 1.05; margin: 0 0 6px; }
.sub { font-style: italic; color: var(--muted); margin: 0 0 22px; }
.crumb { font-family: var(--sans); font-size: 13px; color: var(--tone-d); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 14px; }

/* ---------- cards and pills: light shade, slightly deeper outline ---------- */
.card {
  display: block; text-decoration: none; background: var(--tone); border: 1px solid var(--tone-m);
  border-radius: var(--radius); padding: 18px 18px 16px; color: var(--ink);
}
.card h3 { font-family: var(--display); font-weight: 600; font-size: 24px; margin: 0 0 2px; color: var(--tone-d); }
.card p { margin: 0; color: var(--plum); font-size: 16px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  min-height: 40px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  background: var(--tone); border: 1px solid var(--tone-m); color: var(--tone-d);
  font-family: var(--sans); font-size: 14px; font-weight: 500;
}
.pill.neutral { background: var(--neutral); border-color: var(--neutral-edge); color: var(--neutral-ink); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.t-pink { --tone: var(--pink); --tone-d: var(--pink-d); --tone-m: var(--pink-m); }
.t-blush { --tone: var(--blush); --tone-d: var(--blush-d); --tone-m: var(--blush-m); }
.t-lilac { --tone: var(--lilac); --tone-d: var(--lilac-d); --tone-m: var(--lilac-m); }
.t-sky { --tone: var(--sky); --tone-d: var(--sky-d); --tone-m: var(--sky-m); }
.t-seafoam { --tone: var(--seafoam); --tone-d: var(--seafoam-d); --tone-m: var(--seafoam-m); }
.t-lime { --tone: var(--lime); --tone-d: var(--lime-d); --tone-m: var(--lime-m); }

/* ---------- home ---------- */
.hero { text-align: center; padding: 14px 0 26px; }
.hero .script { font-family: var(--script); font-size: clamp(44px, 9vw, 68px); color: var(--pink-d); line-height: 1.1; }
.hero .verse { font-family: var(--display); font-style: italic; font-size: clamp(21px, 3.4vw, 27px); max-width: 34em; margin: 8px auto 4px; color: var(--plum); }
.hero .ref { font-family: var(--sans); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.continue { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.continue .big { font-family: var(--display); font-size: 28px; font-weight: 600; color: var(--tone-d); line-height: 1.1; }
.continue .arrow { font-family: var(--sans); font-size: 26px; color: var(--tone-d); }
.section-label { font-family: var(--sans); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; }

/* ---------- book index ---------- */
.testament { margin-bottom: 26px; }
.cat { margin: 18px 0 8px; font-family: var(--display); font-weight: 600; font-size: 21px; color: var(--tone-d); }
.books { display: flex; flex-wrap: wrap; gap: 8px; }
.books .pill { min-width: 96px; }

/* ---------- chapter list ---------- */
.chapters { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.ch {
  display: flex; gap: 12px; align-items: center; text-decoration: none; padding: 10px 12px; min-height: 52px;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--paper);
}
.ch:hover { border-color: var(--tone-m); }
.ch .n {
  flex: none; width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
  background: var(--tone); border: 1px solid var(--tone-m); color: var(--tone-d); font-family: var(--sans); font-size: 14px; font-weight: 500;
}
.ch .ttl { font-size: 16px; line-height: 1.25; }
.ch.read .n { border-color: var(--tone-d); }
.ch .done { font-family: var(--sans); font-size: 12px; color: var(--tone-d); letter-spacing: .08em; white-space: nowrap; }
.ch .done + .mark { margin-left: 10px; }
.ch .done { margin-left: auto; }
.ch .mark { margin-left: auto; color: var(--tone-d); font-family: var(--sans); font-size: 12px; }

/* ---------- reader ---------- */
.reader-top {
  position: sticky; top: 0; z-index: 2; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: -22px calc(-1 * var(--gutter)) 10px; padding: 10px var(--gutter); border-bottom: 1px solid var(--rule);
}
@media (min-width: 700px) { .reader-top { margin: -32px -36px 16px; padding: 12px 36px; border-radius: 0 var(--radius) 0 0; } }
.ref-btn {
  font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--tone-d);
  background: none; border: 0; cursor: pointer; padding: 8px 4px; text-decoration: none;
}
.nav-btn { font-family: var(--sans); font-size: 13px; color: var(--tone-d); text-decoration: none; padding: 8px 6px; min-width: 44px; }
.nav-btn.next { text-align: right; }

/* Reader layouts, chosen per Bible (html[data-layout] and html[data-hand]). Phones always get one column. */
.spread { display: grid; gap: 28px; grid-template-areas: "text" "journal"; }
.text-col { grid-area: text; min-width: 0; }
.journal { grid-area: journal; display: grid; gap: 24px; align-content: start; min-width: 0; }
/* Portrait: one tall page, a notes margin on the writing-hand side */
html[data-layout="portrait"] .board { max-width: 940px; }
@media (min-width: 760px) {
  html[data-layout="portrait"] .spread { grid-template-columns: minmax(0, 1.9fr) minmax(200px, 1fr); grid-template-areas: "text journal"; }
  html[data-layout="portrait"][data-hand="left"] .spread { grid-template-columns: minmax(200px, 1fr) minmax(0, 1.9fr); grid-template-areas: "journal text"; }
}
/* Landscape 1: scripture page + a whole journal page, split by a spine */
@media (min-width: 900px) {
  html[data-layout="landscape1"] .spread { grid-template-columns: 1fr 1fr; grid-template-areas: "text journal"; gap: 0; }
  html[data-layout="landscape1"][data-hand="left"] .spread { grid-template-areas: "journal text"; }
  html[data-layout="landscape1"] .text-col { padding: 0 28px; }
  html[data-layout="landscape1"] .journal { padding: 0 28px; border-left: 1px solid var(--rule); box-shadow: inset 10px 0 14px -14px rgba(110, 80, 60, .35); }
  html[data-layout="landscape1"][data-hand="left"] .journal { border-left: 0; border-right: 1px solid var(--rule); box-shadow: inset -10px 0 14px -14px rgba(110, 80, 60, .35); }
}
/* Landscape 2: notes margins on both sides of the text; the writing side gets the lined chapter notes */
@media (min-width: 1000px) {
  html[data-layout="landscape2"] .spread { grid-template-columns: minmax(180px, 1fr) minmax(0, 2.4fr) minmax(180px, 1fr); grid-template-areas: "vn text cn"; }
  html[data-layout="landscape2"][data-hand="left"] .spread { grid-template-areas: "cn text vn"; }
  html[data-layout="landscape2"] .journal { display: contents; }
  html[data-layout="landscape2"] .cn-box { grid-area: cn; }
  html[data-layout="landscape2"] .vn-box { grid-area: vn; }
}

.chapter-head { text-align: center; margin: 6px 0 18px; }
.chapter-head .kicker { color: var(--tone-d); }
.chapter-head h1 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 5vw, 40px); margin: 0; line-height: 1.1; }
.chapter-head .ttl { font-style: italic; color: var(--muted); }

.scripture { font-size: var(--text-size); line-height: 1.62; max-width: 36em; margin: 0 auto; }
.scripture p { margin: 0 0 .55em; text-align: left; hyphens: auto; }
.scripture .sh { font-family: var(--display); font-weight: 600; font-size: 1.17em; color: var(--tone-d); margin: 1.1em 0 .1em; line-height: 1.2; }
.scripture .xr, .scripture .d { font-style: italic; color: var(--muted); font-size: .85em; margin: 0 0 .4em; }
.scripture .ms { font-family: var(--sans); letter-spacing: .24em; font-size: .75em; text-align: center; color: var(--tone-d); margin: 1.4em 0 .2em; }
.scripture .q1 { padding-left: 1.2em; text-indent: -1.2em; margin: 0; }
.scripture .q2 { padding-left: 2.4em; text-indent: -1.2em; margin: 0; }
.scripture .q1 + :not(.q1):not(.q2), .scripture .q2 + :not(.q1):not(.q2) { margin-top: .55em; }
.scripture .li1 { padding-left: 1.4em; margin: 0 0 .2em; }
.scripture .li2 { padding-left: 2.8em; margin: 0 0 .2em; }
.scripture .qr { text-align: right; font-style: italic; }
.scripture .pc { text-align: center; font-family: var(--sans); letter-spacing: .12em; font-size: .85em; }
.scripture .qa { font-family: var(--sans); letter-spacing: .2em; font-size: .72em; color: var(--tone-d); margin-top: 1em; }
.scripture .gap { height: .2em; }

.v { cursor: pointer; border-radius: 3px; transition: background-color .15s, box-shadow .15s; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.vn { font-family: var(--sans); font-size: .58em; color: var(--tone-d); vertical-align: .5em; margin-right: .18em; font-weight: 500; text-indent: 0; }
.v.hl-pink { background: var(--pink); }
.v.hl-blush { background: #F8E1EC; }
.v.hl-lilac { background: var(--lilac); }
.v.hl-sky { background: var(--sky); }
.v.hl-seafoam { background: var(--seafoam); }
.v.hl-lime { background: var(--lime); }
.v.sel { box-shadow: 0 2px 0 var(--tone-d); }
.note-mark {
  display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; margin: 0 .15em; border-radius: 999px; vertical-align: .05em;
  background: var(--neutral); border: 1px solid var(--neutral-edge); color: var(--neutral-ink); font-size: .62em; font-family: var(--sans); cursor: pointer;
}

/* notes columns: lined like the book's margins */
.margin h2 { font-family: var(--sans); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--tone-d); font-weight: 500; margin: 0 0 8px; }
.lined {
  width: 100%; min-height: 220px; resize: vertical; border: 0; outline: none; padding: 0 2px;
  font-family: var(--serif); font-size: 17px; color: var(--ink); line-height: 32px;
  background: repeating-linear-gradient(to bottom, transparent 0 31px, var(--line) 31px 32px);
  background-attachment: local;
}
.lined::placeholder { color: #C3B9B4; font-style: italic; }
@media (min-width: 760px) {
  .journal { position: sticky; top: 76px; align-self: start; max-height: calc(100dvh - 96px); overflow: auto; }
  html[data-layout="landscape2"] .margin { position: sticky; top: 76px; align-self: start; }
  #cn { min-height: 40vh; }
  html[data-layout="landscape2"] #cn, html[data-layout="landscape1"] #cn { min-height: 55vh; }
}
.vnotes { display: grid; gap: 10px; }
.vnote {
  background: var(--neutral); border: 1px solid var(--neutral-edge); border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: left;
}
.vnote .r { font-family: var(--sans); font-size: 12px; letter-spacing: .12em; color: var(--neutral-ink); text-transform: uppercase; }
.vnote .t { font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { color: var(--muted); font-style: italic; font-size: 15.5px; }

.chapter-foot { display: flex; justify-content: space-between; gap: 10px; margin: 30px auto 0; max-width: 36em; }

/* ---------- coming-soon sections ---------- */
.soon { text-align: center; padding: 40px 0; }
.soon .script { font-family: var(--script); font-size: 50px; color: var(--tone-d); }

/* ---------- bottom sheet ---------- */
.sheet-scrim { position: fixed; inset: 0; background: rgba(46, 42, 54, .18); z-index: 10; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; margin: 0 auto; max-width: 560px;
  background: var(--paper); border-radius: 20px 20px 0 0; border: 1px solid var(--board-edge); border-bottom: 0;
  box-shadow: 0 -12px 40px -16px rgba(110, 80, 60, .35);
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 85dvh; overflow: auto;
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--board-edge); margin: 0 auto 10px; }
.sheet h2 { font-family: var(--display); font-size: 25px; font-weight: 600; margin: 0 0 12px; color: var(--tone-d); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.swatch { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--sw-m); background: var(--sw); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--sw-m); }
.swatch.clear { background: var(--paper); border-color: var(--line); color: var(--muted); font-family: var(--sans); font-size: 18px; }
.sheet textarea.lined { min-height: 160px; border: 1px solid var(--rule); border-radius: 12px; padding: 4px 12px; background-position: 0 4px; }
.row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.row .spacer { flex: 1; }
.size-row { display: flex; align-items: center; gap: 12px; }
.size-row input { flex: 1; accent-color: var(--tone-d); }

.toast {
  position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 20;
  background: var(--neutral); border: 1px solid var(--neutral-edge); color: var(--neutral-ink); border-radius: 999px;
  padding: 10px 18px; font-family: var(--sans); font-size: 14px; box-shadow: 0 6px 20px -10px rgba(110, 80, 60, .4);
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* =================================================================== sections */
.neutral-card { background: var(--neutral); border: 1px solid var(--neutral-edge); border-radius: var(--radius); padding: 16px 18px; margin: 18px 0; }
.neutral-card h3 { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--neutral-ink); margin: 0 0 4px; }
.neutral-card .kicker { color: var(--neutral-ink); }
.neutral-card p { margin: 0; }
.hint { font-family: var(--sans); font-size: 13px; color: var(--muted); margin: 10px 0; }
.link { background: none; border: 0; padding: 6px; cursor: pointer; font-family: var(--sans); font-size: 13px; color: var(--tone-d); text-decoration: underline; text-underline-offset: 3px; }
.input {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; min-height: 42px; min-width: 0; max-width: 100%;
}
.input:focus, .lined:focus-visible { outline: 2px solid var(--tone-m); outline-offset: 1px; }
.input.block { display: block; width: 100%; margin: 4px 0 12px; }
.status { font-family: var(--sans); font-size: 13px; color: var(--tone-d); margin-top: 8px; }
.ref { font-family: var(--sans); font-size: 13px; color: var(--tone-d); text-decoration: none; letter-spacing: .04em; }
.ref::after { content: " ›"; }
.today-plan p { font-family: var(--sans); font-size: 15px; color: var(--tone-d); }

/* progress */
.meter { height: 8px; border-radius: 99px; background: var(--paper); border: 1px solid var(--tone-m); overflow: hidden; margin-top: 12px; }
.meter span { display: block; height: 100%; background: var(--tone-m); border-radius: 99px; }
.meter.big { height: 12px; margin-top: 0; }
.plan-card { display: flex; flex-direction: column; }
.plan-card p { flex: 1; }

/* plan days */
.up-next { margin: 16px 0 22px; }
.readings a { color: var(--ink); text-decoration-color: var(--tone-m); text-underline-offset: 3px; }
.readings.big { font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.25; margin: 4px 0 12px; }
.readings.big a { color: var(--tone-d); text-decoration: none; }
.days { list-style: none; margin: 0 0 20px; padding: 0; border-top: 1px solid var(--rule); }
.day { display: grid; grid-template-columns: 44px 76px 1fr; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.day.next { background: color-mix(in srgb, var(--tone) 45%, transparent); border-radius: 10px; }
.day.done .readings { color: var(--muted); }
.day.done .readings a { color: var(--muted); }
.dn { font-family: var(--sans); font-size: 13px; color: var(--tone-d); font-weight: 500; line-height: 1.2; }
.dn small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.day .sep { color: var(--tone-m); }
.check {
  width: 34px; height: 34px; border-radius: 999px; cursor: pointer; justify-self: center;
  background: var(--paper); border: 1.5px solid var(--tone-m); color: var(--tone-d); font-family: var(--sans); font-size: 16px; line-height: 1;
}
.check[aria-pressed="true"], .check.on { background: var(--tone); border-color: var(--tone-d); }

/* tracker */
.trk { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
@media (max-width: 600px) { .trk { grid-template-columns: 1fr; gap: 4px; } }
.trk-name { font-family: var(--display); font-weight: 600; font-size: 19px; color: var(--tone-d); text-decoration: none; }
.trk-name small { font-family: var(--sans); font-size: 11.5px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.dots { display: flex; flex-wrap: wrap; gap: 5px; }
.dot {
  width: 30px; height: 30px; border-radius: 999px; padding: 0; cursor: pointer; font-family: var(--sans); font-size: 10.5px;
  background: var(--paper); border: 1px solid color-mix(in srgb, var(--tone-m) 70%, var(--paper)); color: var(--muted);
}
.dot.on { background: var(--tone); border-color: var(--tone-d); color: var(--tone-d); }

/* lists of saved pages */
.entries { display: grid; gap: 8px; }
.entry {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; text-decoration: none;
  padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; color: var(--tone-d);
}
.entry:hover { border-color: var(--tone-m); }
.entry .d { font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
.entry .t { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 500px) { .entry { grid-template-columns: 1fr auto; } .entry .d { grid-column: 1 / -1; } }

/* form pages */
.head-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 6px 0 18px; }
.hf { display: flex; flex-direction: column; gap: 2px; }
.hf.wide { flex: 1 1 220px; }
.hf .kicker { font-size: 11px; }
.form { display: grid; gap: 14px; }
@media (min-width: 900px) { .form { grid-template-columns: 1fr 1fr; align-items: start; } }
.field { border: 1px solid var(--tone-m); border-radius: 12px; overflow: hidden; background: var(--paper); }
.field .band {
  display: block; background: var(--tone); color: var(--tone-d); padding: 8px 14px;
  font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; border-bottom: 1px solid var(--tone-m);
}
.field .band small { letter-spacing: .02em; text-transform: none; font-weight: 400; color: var(--muted); margin-left: 8px; font-size: 12.5px; }
.field textarea.lined { padding: 2px 14px 0; display: block; }
textarea.lined { overflow: hidden; resize: none; }
.saved { font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
.title-input { width: 100%; border: 0; outline: none; font-family: var(--display); font-weight: 600; font-size: clamp(30px, 6vw, 42px); color: var(--ink); background: none; padding: 0; }

/* study guide */
.two { display: grid; gap: 22px; }
@media (min-width: 900px) { .two { grid-template-columns: 1fr 1fr; align-items: start; } .two .example { margin-top: 38px; } }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; }
.steps .num, .story .num {
  width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; background: var(--tone); border: 1px solid var(--tone-m);
  color: var(--tone-d); font-family: var(--sans); font-weight: 300; font-size: 15px;
}
.example .ex { margin-top: 12px; }
.exh { font-family: var(--sans); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--neutral-ink); }
.example p { margin: 2px 0 0; font-size: 16.5px; }

/* journals */
.list-rows { display: grid; gap: 10px; }
.list-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; }
.lr-body { flex: 1; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; min-width: 0; }
.lv { min-width: 0; overflow-wrap: anywhere; }
.lv.long { flex: 1 1 100%; white-space: pre-wrap; order: -1; }
.lv.long + .lv.long { order: 0; }
.cl { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--tone-d); }
.lr-body .check + .cl { display: inline; margin-left: -10px; }
.check-row { display: flex; gap: 10px; align-items: center; font-family: var(--sans); font-size: 15px; margin: 6px 0 12px; }
.check-row input { width: 22px; height: 22px; accent-color: var(--tone-d); }
.verse-card { border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; background: var(--paper); }
.verse-card.tinted { background: var(--tone); border-color: var(--tone-m); }
.verse-card .vt { font-family: var(--display); font-style: italic; font-size: 20px; line-height: 1.35; margin: 4px 0 8px; color: var(--plum); }
.verse-card.learned { background: var(--tone); border-color: var(--tone-m); }
.memory .row .pill { min-height: 34px; font-size: 13px; }

.month-nav { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.month-nav h2, .month-nav .h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(28px, 5vw, 40px); flex: 1; text-align: center; }
.month-nav .yr { color: var(--muted); font-weight: 500; }
.month-nav .pill { width: 44px; padding: 0; font-size: 20px; }
.habit-scroll { overflow-x: auto; margin: 0 calc(-1 * var(--gutter)) 14px; padding: 0 var(--gutter); }
.habits { border-collapse: separate; border-spacing: 0 6px; font-family: var(--sans); font-size: 12px; }
.habits thead th { color: var(--muted); font-weight: 400; min-width: 30px; }
.habits thead th.today { color: var(--tone-d); font-weight: 500; }
.habits tbody th { position: sticky; left: 0; z-index: 1; text-align: left; font-family: var(--serif); font-weight: 400; font-size: 15px; color: var(--ink);
  background: var(--tone); padding: 6px 12px; border-radius: 10px 0 0 10px; white-space: nowrap; border: 1px solid var(--tone-m); border-right: 0; }
.habits tbody td { background: var(--tone); padding: 5px 2px; border-top: 1px solid var(--tone-m); border-bottom: 1px solid var(--tone-m); }
.habits tbody td.cnt { border-radius: 0 10px 10px 0; border-right: 1px solid var(--tone-m); padding: 0 10px; color: var(--tone-d); font-weight: 500; }
.hb { width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--tone-m); background: var(--paper); cursor: pointer; padding: 0; display: block; margin: 0 auto; }
.hb.on { background: var(--tone-m); border-color: var(--tone-d); }

/* topics */
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.topic-list { display: grid; gap: 8px; }
@media (min-width: 900px) { .topic-list { grid-template-columns: 1fr 1fr; align-items: start; } }
.topic { border: 1px solid var(--tone-m); border-radius: 12px; background: var(--paper); }
.topic summary { list-style: none; cursor: pointer; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; border-radius: 12px; }
.topic summary::-webkit-details-marker { display: none; }
.topic summary b { font-family: var(--display); font-size: 21px; font-weight: 600; color: var(--tone-d); }
.topic summary .refs { font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
.topic[open] summary { background: var(--tone); border-radius: 12px 12px 0 0; }
.topic-body { display: grid; gap: 8px; padding: 10px; }
.topic-body .verse-card { border: 0; padding: 6px 8px; }
.story { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.story li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; background: var(--tone); border: 1px solid var(--tone-m); border-radius: 12px; padding: 14px; }
.story li .num { background: var(--paper); }
.story h3 { margin: 0; font-family: var(--display); font-size: 22px; color: var(--tone-d); }
.story p { margin: 0 0 4px; }
.timeline { list-style: none; padding: 0 0 0 18px; margin: 0; border-left: 2px solid var(--line); display: grid; gap: 10px; }
.timeline li { position: relative; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 6px; width: 12px; height: 12px; border-radius: 99px; background: var(--tone); border: 1px solid var(--tone-d); }
.timeline .when { font-family: var(--sans); font-size: 12.5px; color: var(--muted); min-width: 92px; }
.timeline .what { font-family: var(--display); font-size: 21px; font-weight: 600; }

/* calendar */
.legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-family: var(--sans); font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.mk { display: inline-block; width: 8px; height: 8px; border-radius: 99px; vertical-align: middle; }
.mk-read { background: var(--sky-m); }
.mk-page { background: var(--pink-m); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-family: var(--sans); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--tone-d); text-align: center; padding: 4px 0; }
.cal-cell {
  min-height: 64px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); padding: 6px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
@media (min-width: 900px) { .cal-cell { min-height: 96px; } }
.cal-cell.blank { border: 0; background: none; cursor: default; }
.cal-cell.today { background: var(--tone); border-color: var(--tone-d); }
.dnum { font-family: var(--sans); font-size: 13px; color: var(--ink); }
.cal-cell .ev { font-family: var(--sans); font-size: 11px; color: var(--tone-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marks { margin-top: auto; display: flex; gap: 3px; }
ul.plain { list-style: none; padding: 0; margin: 4px 0 14px; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--rule); }

.v.flash { background: var(--lime) !important; transition: background-color .6s; }

/* =================================================================== pop-up panels dock on the writing-hand side on wide screens */
@media (min-width: 900px) {
  .sheet-scrim { background: rgba(46, 42, 54, .06); }
  .sheet {
    left: auto; right: 20px; top: 20px; bottom: 20px; width: 420px; max-width: none; max-height: none; margin: 0;
    border-radius: 20px; border: 1px solid var(--board-edge); box-shadow: 0 16px 50px -20px rgba(110, 80, 60, .45);
    animation: in-right .2s ease-out;
  }
  html[data-hand="left"] .sheet { right: auto; left: 20px; animation-name: in-left; }
  .sheet .grab { display: none; }
}
@keyframes in-right { from { transform: translateX(30px); opacity: 0; } }
@keyframes in-left { from { transform: translateX(-30px); opacity: 0; } }

/* =================================================================== library */
.page.plain { border-radius: var(--radius); margin-top: 6px; }
.lib-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.bible-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
@media (max-width: 480px) { .bible-grid { grid-template-columns: 1fr 1fr; gap: 12px; } }
.bible-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  background: var(--neutral); border: 1px solid var(--neutral-edge); border-radius: 16px; padding: 18px 12px 16px; text-decoration: none; color: var(--ink);
}
.bible-card.current { border-color: var(--tone-m); }
.cover-link { display: block; width: 72%; margin-bottom: 10px; }
.cover-img { display: block; width: 100%; aspect-ratio: 1170 / 1653; object-fit: cover; border-radius: 4px 8px 8px 4px;
  box-shadow: -3px 0 0 -1px rgba(0,0,0,.06) inset, 0 10px 22px -12px rgba(110, 80, 60, .55); }
.bible-name { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.15; text-decoration: none; color: var(--ink); }
.bible-meta { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.bible-meta.strong { color: var(--neutral-ink); font-weight: 500; }
.more {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 999px; cursor: pointer; letter-spacing: 1px;
  background: var(--paper); border: 1px solid var(--neutral-edge); color: var(--neutral-ink); font-size: 10px;
}
.bible-card.add { justify-content: center; min-height: 260px; border-style: dashed; background: var(--paper); }
.bible-card.add .plus {
  width: 58px; height: 58px; border-radius: 999px; display: grid; place-items: center; margin-bottom: 10px;
  background: var(--tone); border: 1px solid var(--tone-m); color: var(--tone-d); font-family: var(--sans); font-size: 30px; font-weight: 300;
}
.menu { display: grid; gap: 10px; }
.menu .pill { width: 100%; }
.pill.danger { color: #B2575C; }

/* =================================================================== create / customize a Bible */
.page.wizard { padding-bottom: 0; display: flex; flex-direction: column; }
.wz-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.wz-x {
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; text-decoration: none;
  background: var(--neutral); border: 1px solid var(--neutral-edge); color: var(--neutral-ink); font-size: 24px; font-family: var(--sans); line-height: 1;
}
.wz-title { text-align: center; grid-column: 2; }
.wz-title .sub { margin: 6px 0 0; }
.wz-title h1 { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 5vw, 38px); margin: 0; line-height: 1.1; }
.wz-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 16px 0 22px; }
.wz-steps li { flex: 1; }
.wz-steps button { display: block; width: 100%; height: 6px; padding: 0; border: 0; border-radius: 99px; background: var(--rule); cursor: pointer; }
.wz-steps button:disabled { cursor: default; }
.wz-steps li.done button, .wz-steps li.cur button { background: var(--tone-m); }
.wz-body { flex: 1; }
.wz-foot {
  position: sticky; bottom: 0; background: linear-gradient(to top, var(--paper) 70%, transparent);
  padding: 18px 0 calc(22px + env(safe-area-inset-bottom)); margin-top: 18px;
}
.wz-next { width: 100%; min-height: 52px; font-size: 16px; }
.note { font-family: var(--sans); font-size: 13px; color: var(--muted); background: var(--neutral); border-radius: 10px; padding: 10px 14px; margin: 16px 0 0; }

.opts { display: grid; gap: 14px; }
.opts.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.opts.two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.opts.four { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.opts.themes { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.opt {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px; font: inherit; color: var(--ink);
}
.opt.on { border: 2px solid var(--tone-d); padding: 13px; background: color-mix(in srgb, var(--tone) 25%, var(--paper)); }
.opt .tick {
  position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--paper); color: var(--tone-d); font-family: var(--sans); font-size: 14px;
}
.opt.on .tick { border-color: var(--tone-d); background: var(--tone); }
.opt-name { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.1; margin-top: 4px; }
.opt-desc { font-size: 15px; color: var(--muted); line-height: 1.35; }
.opts.four .opt { align-items: center; text-align: center; }
.aa { font-family: var(--display); font-weight: 600; color: var(--tone-d); line-height: 1; height: 40px; display: flex; align-items: flex-end; }

/* layout diagrams */
.diagram { width: 100%; height: 132px; border-radius: 12px; background: var(--board); display: flex; align-items: center; justify-content: center; gap: 0; padding: 14px; }
.d-pg { height: 100%; background: var(--paper); border-radius: 3px; box-shadow: 0 4px 10px -6px rgba(110, 80, 60, .5); display: flex; gap: 6px; padding: 8px; }
.d-pg.tall { width: 76px; }
.diagram.landscape1 .d-pg { width: 82px; }
.diagram.landscape1 .d-pg:first-child { border-radius: 3px 0 0 3px; }
.diagram.landscape1 .d-pg:last-child { border-radius: 0 3px 3px 0; border-left: 1px solid var(--rule); }
.d-pg.wide { width: 170px; }
.d-txt { flex: 2.2; background: repeating-linear-gradient(to bottom, #B9AFAA 0 2px, transparent 2px 6px); opacity: .7; }
.d-jr { flex: 1; background: repeating-linear-gradient(to bottom, transparent 0 7px, var(--tone-m) 7px 8px); border-radius: 2px; background-color: color-mix(in srgb, var(--tone) 40%, transparent); }
.diagram.landscape1 .d-txt, .diagram.landscape1 .d-jr { flex: 1; }
.diagram.portrait.hand-left .d-pg, .diagram.landscape2.hand-left .d-pg { flex-direction: row-reverse; }
.diagram.landscape1.hand-left { flex-direction: row-reverse; }
.diagram.landscape1.hand-left .d-pg:first-child { border-radius: 0 3px 3px 0; border-left: 1px solid var(--rule); }
.diagram.landscape1.hand-left .d-pg:last-child { border-radius: 3px 0 0 3px; border-left: 0; }
.diagram.landscape2 .d-jr:first-child { flex: .7; background: color-mix(in srgb, var(--neutral) 90%, transparent); border: 1px solid var(--neutral-edge); }
.diagram.landscape2.hand-left .d-jr:last-child { flex: .7; background: color-mix(in srgb, var(--neutral) 90%, transparent); border: 1px solid var(--neutral-edge); }
.diagram.landscape2.hand-left .d-jr:first-child { flex: 1; background-color: color-mix(in srgb, var(--tone) 40%, transparent); background-image: repeating-linear-gradient(to bottom, transparent 0 7px, var(--tone-m) 7px 8px); border: 0; }
.hand-wrap { position: relative; width: 100%; }
.hand-wrap .pen { position: absolute; bottom: 10px; width: 30px; height: 30px; padding: 5px; border-radius: 999px; background: var(--paper); color: var(--tone-d); box-shadow: 0 2px 6px -2px rgba(110, 80, 60, .4); }
.hand-wrap.right .pen { right: 10px; }
.hand-wrap.left .pen { left: 10px; transform: scaleX(-1); }
.size-preview { font-family: var(--serif); line-height: 1.6; padding: 18px 20px; border: 1px solid var(--rule); border-radius: 14px; max-width: 36em; }
.size-preview .vn { color: var(--tone-d); }

/* covers */
.covers { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.cover-opt { background: none; border: 0; padding: 6px; border-radius: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: center; font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
.cover-opt img { width: 100%; aspect-ratio: 1170 / 1653; object-fit: cover; border-radius: 4px 8px 8px 4px; box-shadow: 0 8px 18px -10px rgba(110, 80, 60, .55); }
.cover-opt.on { background: var(--tone); outline: 2px solid var(--tone-d); color: var(--tone-d); font-weight: 500; }

/* themes */
.theme-tabs { display: flex; gap: 3px; width: calc(100% - 36px); margin: 6px 0 4px; }
.theme-tabs i { flex: 1; height: 26px; border-radius: 7px 7px 0 0; border: 1px solid; border-bottom: 0; }
/* the same five shades the tabs use with a single-colour theme */
.theme-tabs i.shade {
  background: color-mix(in srgb, var(--t-m) calc(var(--k) * 24%), var(--t));
  border-color: color-mix(in srgb, var(--t-d) calc(var(--k) * 12% + 8%), var(--t-m));
}

/* name */
.name-step { display: grid; gap: 26px; align-items: start; }
@media (min-width: 700px) { .name-step { grid-template-columns: 240px 1fr; } }
.preview-book { text-align: center; }
.preview-book img { width: 200px; max-width: 70%; aspect-ratio: 1170 / 1653; object-fit: cover; border-radius: 4px 10px 10px 4px; box-shadow: 0 16px 30px -14px rgba(110, 80, 60, .6); }
.preview-book .bible-name { margin-top: 12px; font-size: 24px; }
.input.big { font-family: var(--display); font-size: 26px; font-weight: 600; min-height: 56px; }
.summary { list-style: none; padding: 0; margin: 8px 0 0; }
.summary li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.summary span { font-family: var(--sans); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* =================================================================== index, welcome */
.index-cols { display: grid; gap: 8px 28px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.idx-group .cat { margin-top: 10px; }
.idx { list-style: none; padding: 0; margin: 0 0 8px; }
.idx a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 12px; margin-bottom: 4px; text-decoration: none;
  border-radius: 10px; background: var(--tone); border: 1px solid color-mix(in srgb, var(--tone-m) 60%, var(--paper)); color: var(--ink); }
.idx small { font-family: var(--sans); font-size: 12px; color: var(--tone-d); }
.welcome p { margin: 0 0 12px; }
.signoff { font-family: var(--script); font-size: 30px; color: var(--tone-d); margin-top: 6px !important; }
.belongs { display: grid; justify-items: center; gap: 6px; margin: 22px 0; }
.belongs span { font-family: var(--script); font-size: 24px; color: var(--tone-d); }
.belongs b { font-family: var(--display); font-size: 24px; font-weight: 600; border-bottom: 1px solid var(--tone-m); padding: 0 30px 4px; }
.fine { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.welcome-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.welcome-steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; background: var(--tone); border: 1px solid var(--tone-m); border-radius: 12px; padding: 12px 14px; }
.welcome-steps .num { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--tone-m); color: var(--tone-d); font-family: var(--sans); font-size: 14px; }
.welcome-steps p { margin: 0; font-size: 16px; }

/* =================================================================== phone: the book frame steps aside */
.book { display: contents; }
.corner, .btabs { display: none; }
.tab-group { display: contents; }

/* =================================================================== BOOK MODE (tablet and computer): the PDF spread
   Measurements follow the PDF (842 × 595 pt): side tabs 30 / 28 pt, top tabs 17 pt, page 760 pt wide,
   notes 140, gap 12, text column 196, gutter 44 at the spine. */
html.bookmode, html.bookmode body { height: 100%; overflow: hidden; }
.bookmode .board { max-width: none; height: 100dvh; padding: 0; display: grid; place-items: center; }
.bookmode .board::before { display: none; }
.bookmode .masthead { display: none; }
.bookmode .book {
  display: block; position: relative; container-type: size;
  width: min(100vw, calc(100dvh * 842 / 595)); height: min(100dvh, calc(100vw * 595 / 842));
}
.bookmode[data-view="page"] .book { width: min(100vw, calc(100dvh * 640 / 842)); height: min(100dvh, calc(100vw * 842 / 640)); }
/* the padded cover board with its stitching */
.bookmode .book::before {
  content: ""; position: absolute; inset: 0.4cqh 0.3cqw; border-radius: 1.6cqh; background: var(--board);
  box-shadow: inset 0 0 0 1px var(--board-edge), inset 0.25cqh 0.25cqh 0 rgba(255, 255, 255, .55), inset -0.3cqh -0.3cqh 0 rgba(156, 132, 115, .12);
}
.bookmode .book::after {
  content: ""; position: absolute; inset: 1cqh 0.75cqw; border-radius: 1.2cqh; pointer-events: none;
  border: 1.5px dashed color-mix(in srgb, var(--stitch) 45%, transparent);
}
.bookmode .corner {
  display: grid; place-items: center; position: absolute; top: 1.1cqh; z-index: 2; width: 3.2cqw; height: 3.2cqw; max-width: 4.2cqh; max-height: 4.2cqh;
  border-radius: 999px; padding: 0; cursor: pointer; background: var(--neutral); border: 1px solid var(--neutral-edge); color: var(--neutral-ink);
  font-family: var(--display); font-weight: 600; font-size: 1.7cqh; overflow: hidden; text-decoration: none;
}
.bookmode .corner-l { left: 1.3cqw; }
.bookmode .corner-r { right: 1.3cqw; }
.gear { display: block; width: 22px; height: 22px; margin: auto; }
.bookmode .corner .gear { width: 62%; height: 62%; }
.bookmode .corner img { width: 100%; height: 100%; object-fit: cover; }

/* top section tabs: five over each page, a gap at the spine */
.bookmode .tabs {
  position: absolute; left: 5.4%; right: 5.2%; top: 1.15%; height: 3.25%; z-index: 1;
  display: flex; gap: 1.6%; margin: 0; padding: 0; overflow: visible;
}
.bookmode .tab-group { display: flex; flex: 1; gap: 0.25%; }
.bookmode .tab {
  flex: 1; min-width: 0; display: grid; place-items: center; padding: 0; transform: none; overflow: hidden; white-space: nowrap;
  font-size: 1.15cqh; letter-spacing: .16em; border-radius: 0.8cqh 0.8cqh 0 0;
  border: 1px solid var(--t-m); border-bottom: 0; background: var(--t); color: var(--ink);
}
.bookmode .tab[aria-current="page"] { background: var(--t-m); border-color: var(--t-d); color: var(--ink); padding: 0; margin: 0; }
/* book tabs down the sides */
.bookmode .btabs {
  display: flex; flex-direction: column; gap: 0.22cqh; position: absolute; top: 5.4%; bottom: 2.6%; z-index: 1;
}
.bookmode .btabs.ot { left: 1.35%; width: 3.62%; }
.bookmode .btabs.nt { right: 1.35%; width: 3.4%; }
.bookmode .btab {
  flex: 1; min-height: 0; display: grid; place-items: center; text-decoration: none; overflow: hidden; white-space: nowrap;
  font-family: var(--sans); font-size: 1.12cqh; color: var(--ink); background: var(--t); border: 1px solid var(--t-m);
}
.bookmode .btabs.ot .btab { border-radius: 0.7cqh 0 0 0.7cqh; border-right: 0; }
.bookmode .btabs.nt .btab { border-radius: 0 0.7cqh 0.7cqh 0; border-left: 0; }
.bookmode .btab[aria-current="page"] { background: var(--t-m); border-color: var(--t-d); color: var(--ink); font-weight: 500; }
html.plain .btabs { visibility: hidden; }
/* single-colour themes: five shades of the colour, light to dark (top tabs left to right in each group of five,
   book tabs by group: Law → Minor Prophets, Gospels → Revelation). Classic keeps a different pastel per group. */
html:not([data-theme="classic"]):not([data-palette]) .tab:not([aria-current]),
html:not([data-theme="classic"]):not([data-palette]) .btab:not([aria-current]) {
  background: color-mix(in srgb, var(--t-m) calc(var(--k, 0) * 24%), var(--t));
  border-color: color-mix(in srgb, var(--t-d) calc(var(--k, 0) * 12% + 8%), var(--t-m));
}
html.bookmode:not([data-theme="classic"]):not([data-palette]) .tab[aria-current="page"],
html.bookmode:not([data-theme="classic"]):not([data-palette]) .btab[aria-current="page"] { background: var(--t-d); border-color: var(--t-d); color: #fff; }

/* the page */
.bookmode .page {
  position: absolute; left: 4.99%; right: 4.75%; top: 4.37%; bottom: 2.1%; z-index: 1;
  border-radius: 0.9cqh; overflow: auto; padding: 3.2cqh 3.4cqw; box-shadow: 0 0.3cqh 1.2cqh -0.6cqh rgba(110, 80, 60, .35);
}
.bookmode .page.plain { top: 2.4%; border-radius: 0.9cqh; margin: 0; }
.bookmode[data-view="page"] .tabs { top: 1%; height: 5.6%; flex-direction: column; gap: 0.35cqh; left: 8%; right: 8%; }
.bookmode[data-view="page"] .tab { font-size: 1.05cqh; letter-spacing: .12em; }
.bookmode[data-view="page"] .btabs { top: 8%; width: 6%; }
.bookmode[data-view="page"] .btab { font-size: 1cqh; }
.bookmode[data-view="page"] .page { top: 6.9%; left: 7.6%; right: 7.6%; }
.bookmode[data-view="page"] .corner { top: 0.9cqh; width: 5cqw; height: 5cqw; }

/* ---------- the Bible spread ---------- */
.bookmode .page.reader-page { padding: 0; overflow: hidden; }
.bk { position: absolute; inset: 0; display: grid; grid-template-rows: 3.7% minmax(0, 1fr) 3.9%; --fs: 14px; --nl: calc(var(--fs) * 1.42); }
.bk.spread2 {
  grid-template-columns: 10fr 140fr 12fr 196fr 44fr 196fr 12fr 140fr 10fr;
  grid-template-areas: ". hnl . htl . htr . hnr ." ". nl . tl . tr . nr ." ". fl fl fl . fr fr fr .";
}
.bk.spread1 { grid-template-columns: 24fr 330fr 44fr 330fr 24fr; grid-template-areas: ". htl . hj ." ". tl . jr ." ". fl . fr ."; }
.bk.spread1.hand-left { grid-template-areas: ". hj . htl ." ". jr . tl ." ". fr . fl ."; }
.bk.page1 { grid-template-columns: 18fr 300fr 18fr 150fr 18fr; grid-template-areas: ". htl . hn ." ". tl . nn ." ". fl fl fl ."; }
.bk.page1.hand-left { grid-template-areas: ". hn . htl ." ". nn . tl ." ". fl fl fl ."; }
/* the spine */
.bk.spread2::before, .bk.spread1::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 4cqw; transform: translateX(-50%); pointer-events: none;
  background: linear-gradient(to right, transparent, rgba(110, 80, 60, .07) 42%, rgba(110, 80, 60, .16) 50%, rgba(110, 80, 60, .07) 58%, transparent);
}
.hnl { grid-area: hnl; } .htl { grid-area: htl; } .htr { grid-area: htr; } .hnr { grid-area: hnr; } .hj { grid-area: hj; } .hn { grid-area: hn; }
.nl { grid-area: nl; } .nr { grid-area: nr; } .tl { grid-area: tl; } .tr { grid-area: tr; } .jr { grid-area: jr; } .nn { grid-area: nn; }
.fl { grid-area: fl; } .fr { grid-area: fr; }
.hd {
  align-self: end; display: flex; align-items: flex-end; gap: .5em; padding-bottom: 0.45cqh; min-width: 0;
  font-family: var(--sans); font-size: 1.2cqh; color: var(--tone-d); white-space: nowrap;
}
.hd a { color: var(--tone-d); text-decoration: none; }
.htl, .htr, .hj { border-bottom: 1px solid color-mix(in srgb, var(--tone-m) 55%, var(--paper)); }
.htl .rh { font-size: 1.45cqh; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; }
.htr, .hnr, .hj, .hn { justify-content: flex-end; }
.bk.page1.hand-left .hn { justify-content: flex-start; }
.dot-sep { color: var(--tone-m); }
.nl, .nr, .jr, .nn { min-height: 0; padding-top: 0.8cqh; display: flex; flex-direction: column; }
.jr-label { font-family: var(--sans); font-size: 1.1cqh; letter-spacing: .22em; text-transform: uppercase; color: var(--tone-d); margin-bottom: .4cqh; }
.pnote {
  flex: 1; width: 100%; min-height: 0; border: 0; outline: none; resize: none; padding: 0 0.2cqw; margin: 0;
  font-family: var(--serif); font-size: calc(var(--fs) * 0.98); line-height: var(--nl); color: var(--ink);
  background: repeating-linear-gradient(to bottom, transparent 0 calc(var(--nl) - 1px), var(--line) calc(var(--nl) - 1px) var(--nl));
  background-attachment: local;
}
/* journal space paper (Settings → Journal space), ruled at the Bible text's line spacing */
html[data-paper="blank"] .pnote { background: none; }
/* --gw: square width that fits a whole number of squares across (set by fitJournalPaper() in reader.js) */
html[data-paper="dotted"] .pnote {
  background: radial-gradient(circle at 50% calc(100% - .5px), var(--dot) 0 1.1px, transparent 1.5px) 0 0 / var(--gw, var(--nl)) var(--nl);
  background-attachment: local;
}
/* grid: lines along the bottom and right of every square, plus a top and left edge, so the grid is closed all round */
html[data-paper="grid"] .pnote {
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
  background: linear-gradient(to bottom, transparent calc(var(--nl) - 1px), var(--line) 0) 0 0 / 100% var(--nl),
    linear-gradient(to right, transparent calc(var(--gw, var(--nl)) - 1px), var(--line) 0) 0 0 / var(--gw, var(--nl)) 100%;
  background-attachment: local;
}
.paper-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; }
/* Settings sheet: soft cards, one per topic */
.set-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.set-head h2 { margin: 0; }
.set-card { background: var(--neutral); border: 1px solid var(--neutral-edge); border-radius: 16px; padding: 12px 14px 14px; margin: 0 0 10px; }
.set-label { font-family: var(--sans); font-size: 11.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--tone-d); margin: 0 0 10px; }
.set-bible { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.set-bible img { width: 46px; height: 64px; border-radius: 6px; object-fit: cover; flex: none; box-shadow: 0 2px 8px -2px rgba(110, 80, 60, .45); }
.set-bible-text { flex: 1; min-width: 0; }
.set-bible-text b { display: block; font-family: var(--display); font-size: 21px; font-weight: 600; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-bible-text small { font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
.set-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.set-name-row b { min-width: 0; }
.set-edit { flex: none; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border-radius: 999px; cursor: pointer;
  background: var(--paper); border: 1px solid var(--neutral-edge); color: var(--tone-d); }
.set-edit svg { width: 15px; height: 15px; }
.set-name-input { width: 100%; font-family: var(--display); font-size: 19px; font-weight: 600; padding: 4px 10px; min-height: 36px; }
/* cover and theme pickers inside Settings */
.set-covers { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; margin: 0 -2px; scrollbar-width: thin; }
.set-cover { flex: none; width: 50px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 8px; }
.set-cover img { display: block; width: 50px; height: 71px; object-fit: cover; border-radius: 7px; box-shadow: 0 2px 6px -2px rgba(110, 80, 60, .45); }
.set-cover.on img { outline: 2.5px solid var(--tone-d); outline-offset: 2px; }
.theme-groups { grid-template-columns: repeat(3, 1fr); margin-bottom: 10px; }
.theme-groups button { min-height: 32px; font-size: 13px; }
.wz-groups { max-width: 420px; margin: 0 auto 16px; }
.wz-groups button { min-height: 38px; font-size: 14px; }
.set-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.set-theme { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px 7px 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 12px; cursor: pointer; text-align: left;
  background: var(--paper); border: 1px solid var(--neutral-edge); font-family: var(--sans); font-size: 12.5px; color: var(--neutral-ink); }
.set-theme .theme-tabs { width: 100%; margin: 0; }
.set-theme .theme-tabs i { height: 11px; border-radius: 4px 4px 0 0; }
.set-theme span:last-child { font-size: 12px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.set-theme .theme-tabs.palette { padding: 3px 3px 0; gap: 2px; }
.set-theme.on { border-color: var(--tone-d); box-shadow: 0 0 0 1px var(--tone-d); color: var(--tone-d); font-weight: 500; }
/* soft panels on themed pages and sheets pick up the theme: outlines and lettering from the page tone */
.page.plain, .sheet { --neutral-edge: color-mix(in srgb, var(--tone-m) 45%, var(--paper)); --neutral-ink: var(--tone-d); }
.set-go { font-family: var(--sans); font-size: 13px; color: var(--tone-d); white-space: nowrap; }
.set-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.set-card .set-label + .set-note + .set-links { margin-top: 0; }
.set-note { font-family: var(--serif); font-size: 15px; line-height: 1.45; color: var(--neutral-ink); margin: 0 0 12px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper); border: 1px solid var(--neutral-edge); }
.seg button {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 6px; border: 0; border-radius: 999px;
  background: none; cursor: pointer; font-family: var(--sans); font-size: 14px; color: var(--neutral-ink);
}
.seg button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.seg button.on { background: var(--tone); color: var(--tone-d); box-shadow: inset 0 0 0 1px var(--tone-m); font-weight: 500; }
.set-card .paper-opt { background: var(--paper); }
.paper-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 12px; cursor: pointer;
  font-family: var(--sans); font-size: 13px; color: var(--neutral-ink); background: var(--neutral); border: 1px solid var(--neutral-edge);
}
.paper-opt.on { border-color: var(--tone-d); box-shadow: 0 0 0 1px var(--tone-d); color: var(--tone-d); }
.paper-opt .sw { width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--rule); background-color: var(--paper); --g: 9px; }
.sw.paper-lined { background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--g) - 1px), var(--line) calc(var(--g) - 1px) var(--g)); }
.sw.paper-dotted { background-image: radial-gradient(circle, var(--dot) 0 1px, transparent 1.4px); background-size: var(--g) var(--g); }
.sw.paper-grid { background-image: linear-gradient(to bottom, transparent calc(var(--g) - 1px), var(--line) 0), linear-gradient(to right, transparent calc(var(--g) - 1px), var(--line) 0); background-size: var(--g) var(--g); }
.pnote:focus { background-color: color-mix(in srgb, var(--neutral) 70%, transparent); }
.pnote:disabled { opacity: .5; }
.ft { display: flex; align-items: center; gap: 0.8cqw; font-family: var(--sans); font-size: 1.15cqh; color: var(--muted); min-width: 0; }
.fr { justify-content: flex-end; }
.ft .pg { min-width: 2.4cqw; text-align: center; }
.turn {
  width: 3cqh; height: 3cqh; border-radius: 999px; padding: 0; cursor: pointer; line-height: 1;
  background: var(--neutral); border: 1px solid var(--neutral-edge); color: var(--neutral-ink); font-size: 1.8cqh;
}
.read-tick {
  font-family: var(--sans); font-size: 1.05cqh; padding: 0.35cqh 0.9cqw; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: var(--paper); border: 1px solid var(--tone-m); color: var(--tone-d);
}
.read-tick.on { background: var(--tone); border-color: var(--tone-d); }

/* the text flowing page to page */
.flow-view { position: absolute; overflow: hidden; }
.flow {
  column-fill: auto; height: 100%; font-family: var(--serif); line-height: 1.42; color: var(--ink);
  text-align: justify; hyphens: auto; -webkit-hyphens: auto; transition: transform .28s ease;
}
@media (prefers-reduced-motion: reduce) { .flow { transition: none; } }
.flow p { margin: 0 0 .5em; orphans: 2; widows: 2; }
.flow .sh { font-family: var(--display); font-weight: 600; font-size: 1.17em; line-height: 1.14; color: var(--tone-d); margin: .64em 0 .15em; text-align: left; break-after: avoid; }
.flow .xr { font-style: italic; font-size: .76em; color: var(--muted); margin: 0 0 .3em; text-align: left; break-before: avoid; }
.flow .d { font-style: italic; font-size: .88em; color: var(--muted); text-align: left; }
.flow .ms { font-family: var(--sans); letter-spacing: .26em; font-size: .72em; text-align: center; color: var(--tone-d); margin: 1em 0 .2em; }
.flow .mr { font-style: italic; font-size: .8em; text-align: center; color: var(--muted); margin: 0 0 .5em; }
.flow .q1 { padding-left: 1.4em; text-indent: -1.1em; margin: 0; text-align: left; }
.flow .q2 { padding-left: 2.6em; text-indent: -1.1em; margin: 0; text-align: left; }
.flow .q1 + :not(.q1):not(.q2), .flow .q2 + :not(.q1):not(.q2) { margin-top: .5em; }
.flow .li1 { padding-left: 1.4em; margin: 0 0 .2em; }
.flow .li2 { padding-left: 2.8em; margin: 0 0 .2em; }
.flow .qr { text-align: right; font-style: italic; }
.flow .pc { text-align: center; font-family: var(--sans); letter-spacing: .12em; font-size: .85em; }
.flow .qa { font-family: var(--sans); letter-spacing: .2em; font-size: .72em; color: var(--tone-d); margin-top: 1em; }
.flow .vn { font-size: .56em; }
.book-title { text-align: center; margin: .4em 0 1.1em; break-inside: avoid; break-after: avoid; }
.book-title h1 { font-family: var(--display); font-weight: 600; font-size: 3.3em; line-height: 1.05; margin: 0; color: var(--ink); }
.ch-div {
  display: flex; align-items: center; gap: .9em; margin: .9em 0 .55em; break-inside: avoid; break-after: avoid;
  font-family: var(--sans); font-size: .78em; font-weight: 500; letter-spacing: .32em; text-transform: uppercase; color: var(--tone-d);
}
.ch-div::before, .ch-div::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--tone-m) 60%, var(--paper)); }
.chap:first-child .ch-div { margin-top: 0; }
.flow .note-mark { text-indent: 0; }

/* =================================================================== drawing */
.ink-host { position: relative; }
.ink { position: absolute; left: 0; top: 0; pointer-events: none; touch-action: none; z-index: 2; }
html.pencil .ink, html.drawing .ink { pointer-events: auto; }
html.drawing .ink { cursor: crosshair; }
/* writing on the Bible text: the column layer sits above the text but lets taps through, except while drawing
   (the Apple Pencil is handed over from the text in reader.js) */
.bk .tcol.ink-host { position: relative; z-index: 3; pointer-events: none; }
html.pencil:not(.drawing) .bk .tcol .ink { pointer-events: none; }
.bk .tcol .ink { mix-blend-mode: multiply; }
html[data-appearance="dark"] .bk .tcol .ink { mix-blend-mode: normal; }
html.drawing .ink-host { outline: 1.5px dashed color-mix(in srgb, var(--tone-m) 70%, transparent); outline-offset: 2px; border-radius: 4px; }
.ink-bar {
  position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9;
  display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; max-width: calc(100vw - 24px); overflow-x: auto;
  background: var(--neutral); border: 1px solid var(--neutral-edge); box-shadow: 0 8px 24px -12px rgba(110, 80, 60, .5);
}
.ink-bar.top { top: calc(10px + env(safe-area-inset-top)); bottom: auto; }
.ink-btn {
  min-width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; padding: 0 9px; cursor: pointer; flex: none;
  background: var(--paper); border: 1px solid var(--neutral-edge); color: var(--neutral-ink); font-family: var(--sans); font-size: 14px;
}
.ink-btn svg { width: 18px; height: 18px; }
.ink-btn.on { background: var(--pink); border-color: var(--pink-d); color: var(--pink-d); }
.ink-btn.flash { animation: ink-flash .7s ease; }
/* pen pictures: the tools stand in a row like a pencil case, the chosen one lifted; only their tops show above the
   toolbar's edge. The row swipes sideways when there isn't room for every tool. */
.ink-tools {
  display: flex; align-items: flex-start; gap: 4px; height: 76px; overflow-x: auto; overflow-y: hidden; margin: -8px 0 -6px; padding: 0 4px;
  flex: 0 1 auto; max-width: min(380px, 52vw); scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
  --pen-body: #FBFAF9; --pen-hi: #FFFFFF; --pen-shade: #D9D4CF; --pen-edge: #CFC9C3; --pen-num: #8E8581;
}
.ink-tools::-webkit-scrollbar { display: none; }
.ink-tool { width: 40px; height: 76px; padding: 0; border: 0; background: none; cursor: pointer; flex: none; scroll-snap-align: center; overflow: visible; }
.ink-tool svg { display: block; transform: translateY(26px); transition: transform .2s ease; filter: drop-shadow(0 1.5px 1.5px rgba(80, 60, 50, .22)); }
.ink-tool:hover svg { transform: translateY(20px); }
.ink-tool.on svg { transform: translateY(3px); }
.ink-tool.flash svg { animation: pen-lift .6s ease; }
@keyframes pen-lift { 0%, 100% { transform: translateY(2px); } 40% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ink-tool svg { transition: none; } .ink-tool.flash svg { animation: none; } }
@keyframes ink-flash { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.18); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pink-d) 30%, transparent); } }
@media (prefers-reduced-motion: reduce) { .ink-btn.flash { animation: none; } }
.ink-btn.main { font-size: 20px; width: 44px; height: 44px; }
.ink-btn.done { font-size: 13.5px; font-weight: 500; }
.ink-btn:disabled { opacity: .4; cursor: default; }
.ink-sep { width: 1px; height: 22px; background: var(--neutral-edge); flex: none; margin: 0 2px; }
.ink-note { font-family: var(--sans); font-size: 12px; color: var(--neutral-ink); white-space: nowrap; padding: 0 4px; }
.ink-dot { width: 24px; height: 24px; border-radius: 999px; background: var(--c); border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--neutral-edge); cursor: pointer; flex: none; padding: 0; margin: 0 1px; }
.ink-dot.on { box-shadow: 0 0 0 2px var(--neutral-ink); }
.ink-size { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; background: none; border: 1px solid transparent; cursor: pointer; flex: none; padding: 0; }
.ink-size.on { background: var(--paper); border-color: var(--neutral-ink); }
/* size samples: the real line width in the chosen colour; eraser sizes as rings */
.ink-size .line { width: 18px; height: var(--w); border-radius: 99px; background: var(--c); }
.ink-size .line.hl { opacity: .7; border-radius: 2px; }
.ink-size .ring { width: var(--d); height: var(--d); border-radius: 99px; border: 1.5px solid var(--neutral-ink); }
.ink-dot.ink-more { display: grid; place-items: center; background: var(--paper); color: var(--neutral-ink); font-family: var(--sans); font-size: 17px; line-height: 1; }
.ink-dot.ink-more.on { box-shadow: 0 0 0 2px var(--neutral-ink); }
.ink-seg { display: flex; gap: 2px; padding: 2px; border-radius: 999px; border: 1px solid var(--neutral-edge); background: var(--paper); flex: none; }
.ink-seg button { border: 0; background: none; border-radius: 999px; padding: 6px 10px; font-family: var(--sans); font-size: 12.5px; color: var(--neutral-ink); cursor: pointer; white-space: nowrap; }
.ink-seg button.on { background: var(--pink); color: var(--pink-d); box-shadow: inset 0 0 0 1px var(--pink-d); }
/* the "+" palette, just above (or below) the toolbar */
.ink-pop {
  position: fixed; left: 50%; bottom: calc(68px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10;
  width: min(330px, calc(100vw - 24px)); padding: 12px 14px 14px; border-radius: 18px;
  background: var(--neutral); border: 1px solid var(--neutral-edge); box-shadow: 0 12px 30px -14px rgba(110, 80, 60, .55);
}
.ink-pop.top { bottom: auto; top: calc(5.5vh + 60px + env(safe-area-inset-top)); }
.ink-pop-title { font-family: var(--sans); font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--tone-d, var(--neutral-ink)); margin: 0 0 10px; }
.ink-pop-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; justify-items: center; }
.ink-pop-grid .ink-dot { width: 32px; height: 32px; }
/* thickness and transparency panel */
.ink-btn.ink-line { padding: 0 4px; }
.ink-btn.ink-line .squiggle { display: block; }
.ink-pop.line-pop { width: min(300px, calc(100vw - 24px)); }
.ink-widths { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ink-width { display: grid; place-items: center; aspect-ratio: 1; padding: 0; border-radius: 12px; cursor: pointer; background: var(--paper); border: 1px solid var(--neutral-edge); }
.ink-width.on { background: var(--pink); border-color: var(--pink-d); box-shadow: 0 0 0 1px var(--pink-d); }
.ink-alpha { display: block; margin-top: 14px; }
.ink-alpha-label { display: flex; justify-content: space-between; font-family: var(--sans); font-size: 12.5px; color: var(--neutral-ink); margin-bottom: 6px; }
.ink-alpha input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 30px; border-radius: 999px; margin: 0; cursor: pointer;
  border: 1px solid var(--neutral-edge);
  /* the colour fading in over a checkerboard, so you can see how see-through it will be */
  background: linear-gradient(to right, transparent, var(--c)), repeating-conic-gradient(#E9E4DF 0 25%, #FFFFFF 0 50%) 0 0 / 12px 12px;
}
.ink-alpha input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; border-radius: 999px; background: transparent; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 2px 6px rgba(0, 0, 0, .25);
}
.ink-alpha input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 999px; background: transparent; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.ink-alpha input[type="range"]::-moz-range-track { background: transparent; }
/* the ruler: a clear strip with tick marks along both edges and the angle in the middle */
.ink-ruler {
  position: fixed; z-index: 8; border-radius: 6px; touch-action: none; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(70, 60, 55, .55) 0 1px, transparent 1px 50px) top / 100% 16px no-repeat,
    repeating-linear-gradient(90deg, rgba(70, 60, 55, .4) 0 1px, transparent 1px 10px) top / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, rgba(70, 60, 55, .55) 0 1px, transparent 1px 50px) bottom / 100% 16px no-repeat,
    repeating-linear-gradient(90deg, rgba(70, 60, 55, .4) 0 1px, transparent 1px 10px) bottom / 100% 9px no-repeat,
    rgba(250, 250, 252, .72);
  border: 1px solid rgba(70, 60, 55, .22); box-shadow: 0 6px 18px -8px rgba(60, 45, 40, .45);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.ruler-deg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--sans); font-size: 13px; color: #5E5752; }
.ruler-knob { position: absolute; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 999px; background: #fff; border: 1px solid rgba(70, 60, 55, .3); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.ruler-knob.l { left: 8px; } .ruler-knob.r { right: 8px; }
.ink-tool.ruler { margin-left: 4px; }
/* stickers and washi tape */
.ink-btn.ink-stamp { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 4px; }
.stamp-thumb { display: block; width: 26px; height: 26px; object-fit: contain; flex: none; }
.stamp-thumb.big { width: 44px; height: 44px; }
.stamp-thumb.tape { height: 12px; border-radius: 2px; background-size: auto 100%; opacity: .9; }
.stamp-thumb.tape.big { width: 100%; height: 20px; background-size: auto 100%; }
.stamp-thumb.word { width: auto; height: auto; min-width: 26px; padding: 2px 6px; border-radius: 999px; background: var(--bg); color: var(--fg);
  font-family: var(--script); font-size: 13px; font-style: normal; line-height: 1.2; white-space: nowrap; box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0,0,0,.2); }
.stamp-thumb.word.big { font-size: 20px; padding: 4px 12px; }
.stamp-thumb.photo { object-fit: cover; border: 2px solid #fff; border-bottom-width: 5px; box-shadow: 0 1px 3px rgba(0,0,0,.25); border-radius: 1px; }
.stamp-thumb.photo.empty { background: #EFE9E4; }
.sticker-grid.photo { grid-template-columns: repeat(4, 1fr); margin-top: 10px; padding: 8px 4px 12px; row-gap: 14px; }
.sticker-grid.photo .stamp-thumb.big { width: 64px; height: 52px; }
.photo-add { display: flex; justify-content: center; width: 100%; cursor: pointer; }
.photo-cell { position: relative; }
.photo-del { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 999px; padding: 0; cursor: pointer;
  background: #fff; border: 1px solid var(--neutral-edge); color: var(--neutral-ink); font-size: 15px; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.photo-tag { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); font-family: var(--sans); font-size: 10px; padding: 1px 6px;
  border-radius: 999px; background: var(--paper); border: 1px solid var(--neutral-edge); color: var(--neutral-ink); white-space: nowrap; }
.storage-line .link { font: inherit; color: var(--tone-d); text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }
.ink-pop-hint { font-family: var(--sans); font-size: 12.5px; color: var(--neutral-ink); margin: 10px 2px 0; text-align: center; }
.ink-pop.sticker-pop { width: min(420px, calc(100vw - 24px)); }
.sticker-tabs { width: 100%; margin-bottom: 10px; }
.sticker-tabs button { flex: 1; }
.sticker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-height: 260px; overflow-y: auto; }
.sticker-grid.word { grid-template-columns: repeat(3, 1fr); }
.sticker-grid.tape { grid-template-columns: repeat(2, 1fr); }
.sticker-opt { display: grid; place-items: center; min-height: 54px; padding: 4px; border-radius: 12px; cursor: pointer; background: var(--paper); border: 1px solid var(--neutral-edge); }
.sticker-opt.on { border-color: var(--pink-d); box-shadow: 0 0 0 1px var(--pink-d); background: var(--pink); }
.ink-custom { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-family: var(--sans); font-size: 13.5px; color: var(--neutral-ink); cursor: pointer; }
.ink-custom input { width: 32px; height: 32px; padding: 0; border: 1px solid var(--neutral-edge); border-radius: 999px; background: none; cursor: pointer; }
.ink-custom input::-webkit-color-swatch-wrapper { padding: 2px; }
.ink-custom input::-webkit-color-swatch { border: 0; border-radius: 999px; }
.bookmode .ink-bar { bottom: calc(1.2vh + env(safe-area-inset-bottom)); }
.bookmode .ink-bar.top { top: calc(5.5vh + env(safe-area-inset-top)); bottom: auto; }

/* notes pages: lined, dotted, grid or blank paper */
.paper-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 0 12px; }
.paper-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.paper-pick .pill { min-height: 34px; font-size: 13px; }
.paper { border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--paper); }
.paper textarea { display: block; width: 100%; border: 0; resize: none; overflow: hidden; padding: 6px 18px; background-attachment: local; min-height: 400px; }
.paper.bg-dotted textarea { background: radial-gradient(circle, var(--line) 1.2px, transparent 1.6px) 0 0 / 24px 24px; }
.paper.bg-grid textarea { background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px; }
.paper.bg-blank textarea { background: none; }

/* Whole-Bible search uses the existing section colors and cards. */
.search-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.search-controls .input { flex: 1 1 220px; min-width: 0; }
.search-matches { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; }
.search-matches a { overflow-wrap: anywhere; }
.search-matches mark { background: var(--neutral); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.search-page #search-status { margin-top: 18px; }
.search-page .row { align-items: center; }
/* search: Bible / My writing tabs, and your own matches */
.search-tabs { display: grid; grid-template-columns: 1fr 1fr; max-width: 420px; margin: 4px 0 12px; }
.search-tabs a { display: flex; align-items: center; justify-content: center; min-height: 38px; border-radius: 999px; text-decoration: none;
  font-family: var(--sans); font-size: 14px; color: var(--neutral-ink); }
.search-tabs a.on { background: var(--tone); color: var(--tone-d); box-shadow: inset 0 0 0 1px var(--tone-m); font-weight: 500; }
.card.mine .kicker { margin-bottom: 2px; }
.search-mine .pill { margin: 4px 0 6px; }
/* reading streak on Home */
.card.streak { display: flex; align-items: center; gap: 18px; }
.streak-num { display: flex; flex-direction: column; align-items: center; min-width: 76px; color: var(--tone-d); }
.streak-num b { font-family: var(--display); font-size: 46px; line-height: 1; font-weight: 600; }
.streak-num span { font-family: var(--sans); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; text-align: center; }
.streak-body { flex: 1; min-width: 0; }
.streak-msg { margin: 0 0 8px; color: var(--plum); }
.streak-week { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.streak-week li { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; border: 1.5px solid var(--tone-m); background: var(--paper);
  font-family: var(--sans); font-size: 11.5px; color: var(--tone-d); }
.streak-week li.on { background: var(--tone-d); border-color: var(--tone-d); color: #fff; }
.streak-week li.today { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--tone-d); }
.streak-week li.future { opacity: .45; }
.streak-best { margin: 6px 0 0; font-family: var(--sans); font-size: 12.5px; color: var(--tone-d); }
/* reading reminder in Settings */
.reminder-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.reminder-seg { grid-template-columns: 1fr 1fr; width: 150px; }
.reminder-time { font-family: var(--sans); font-size: 14px; color: var(--neutral-ink); display: flex; align-items: center; gap: 8px; }
.reminder-time input { font: inherit; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--neutral-edge); background: var(--paper); color: var(--ink); }
#reminder-card .set-note { margin: 10px 0 0; }
/* print sheet */
.print-range { grid-template-columns: repeat(2, 1fr); margin: 10px 0; }
.print-dates { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; font-family: var(--sans); font-size: 14px; color: var(--neutral-ink); }
.print-dates label { display: flex; align-items: center; gap: 8px; }
/* the printout: only #print-root prints */
#print-root { display: none; }
@media print {
  @page { margin: 16mm 14mm; }
  html, body, html.bookmode, html.bookmode body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; color: #2E2A36; font-family: var(--serif); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pr-cover { text-align: center; margin: 0 0 10mm; }
  .pr-kicker { font-family: var(--sans); font-size: 9pt; letter-spacing: .3em; text-transform: uppercase; color: #BE7973; margin: 0; }
  .pr-cover h1 { font-family: var(--display); font-size: 30pt; font-weight: 600; margin: 2mm 0; }
  .pr-range { font-family: var(--script); font-size: 18pt; color: #B87896; margin: 0; }
  .pr-entry { break-inside: auto; margin: 0 0 10mm; }
  .pr-entry + .pr-entry { break-before: page; }
  .pr-entry header h2 { font-family: var(--display); font-size: 18pt; margin: 0 0 2mm; }
  .pr-date { font-family: var(--sans); font-size: 9pt; letter-spacing: .2em; text-transform: uppercase; color: #8E8581; margin: 0; }
  .pr-head { margin: 0 0 1mm; font-size: 11pt; }
  .pr-field { break-inside: avoid; margin: 4mm 0; border: 1px solid var(--tone-m); border-radius: 3mm; overflow: hidden; }
  .pr-field h3 { margin: 0; padding: 1.6mm 4mm; background: var(--tone); color: var(--tone-d); font-family: var(--sans); font-size: 9pt; letter-spacing: .2em; text-transform: uppercase; }
  .pr-box { position: relative; padding: 3mm 4mm; min-height: 12mm; }
  .pr-text { white-space: pre-wrap; font-size: 11.5pt; line-height: 1.5; position: relative; }
  .pr-ink { position: absolute; left: 4mm; top: 3mm; width: calc(100% - 8mm); }
  .pr-table { width: 100%; border-collapse: collapse; font-size: 11pt; }
  .pr-table th { text-align: left; font-family: var(--sans); font-size: 8.5pt; letter-spacing: .15em; text-transform: uppercase; color: #BE7973; border-bottom: 1.5px solid #EBB0A9; padding: 2mm; }
  .pr-table td { border-bottom: 1px solid #F1E6E2; padding: 2.4mm 2mm; vertical-align: top; }
  .pr-table tr { break-inside: avoid; }
  .pr-empty { text-align: center; color: #8E8581; font-style: italic; }
}
/* share a verse as an image */
.vi-designs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.vi-design { padding: 10px 6px; border-radius: 12px; cursor: pointer; background: var(--bg); color: var(--fg); border: 1px solid var(--neutral-edge);
  font-family: var(--sans); font-size: 13px; }
.vi-design.on { box-shadow: 0 0 0 2px var(--tone-d); }
.vi-size { grid-template-columns: 1fr 1fr; max-width: 260px; margin: 0 auto 10px; }
.vi-preview { display: grid; place-items: center; margin: 0 0 12px; }
.vi-preview canvas { width: auto; height: auto; max-width: 100%; max-height: 46vh; border-radius: 12px; box-shadow: 0 8px 24px -12px rgba(80, 60, 50, .45); }
/* ---------- the app around the Bibles: bottom menu ---------- */
.app-nav {
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9;
  display: flex; gap: 2px; padding: 5px; border-radius: 22px; max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none;
  background: var(--paper); border: 1px solid var(--neutral-edge); box-shadow: 0 10px 30px -12px rgba(80, 60, 50, .45);
}
.app-nav::-webkit-scrollbar { display: none; }
.app-nav a, .app-nav button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 66px; padding: 7px 8px; border-radius: 17px; border: 0; background: none;
  font: 500 12px/1.1 var(--sans); color: var(--muted); text-decoration: none; cursor: pointer; flex: none;
}
.app-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-nav .on { background: var(--tone, var(--pink)); color: var(--tone-d, var(--pink-d)); }
html.app-mode .page.app-page { padding-bottom: 110px; }
html.app-mode:not(.bookmode) .masthead + .book .page { padding-bottom: 110px; }
/* drawing tools sit above the bottom menu in the app */
html.app-mode .ink-bar:not(.top) { bottom: calc(92px + env(safe-area-inset-bottom)); }
html.app-mode .ink-pop:not(.top) { bottom: calc(150px + env(safe-area-inset-bottom)); }
/* inside a book, the cover in the corner closes the book */
html.in-book.bookmode .corner-l::after {
  content: "‹"; position: absolute; left: -3px; top: -3px; width: 38%; height: 38%; border-radius: 999px; display: grid; place-items: center;
  background: var(--paper); border: 1px solid var(--neutral-edge); color: var(--tone-d, var(--pink-d)); font: 600 1.2cqh/1 var(--sans);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
html.in-book.bookmode .corner-l { overflow: visible; }
html.in-book.bookmode .corner-l img { border-radius: 999px; }
html.in-book .bible-chip::before { content: "‹"; font: 600 20px/1 var(--sans); color: var(--tone-d, var(--pink-d)); margin: 0 2px 0 4px; }
.hero-date { margin: 0 0 18px; }
html.app-mode .hero .script { line-height: 1.25; }
@media (max-width: 520px) {
  .app-nav { gap: 0; padding: 4px; border-radius: 20px; }
  .app-nav a, .app-nav button { min-width: 0; flex: 1 1 0; padding: 7px 2px; font-size: 10.5px; }
  .app-nav svg { width: 20px; height: 20px; }
  .app-nav { left: 8px; right: 8px; transform: none; }
}


.pill:disabled { opacity: .45; cursor: default; }
.set-input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--neutral-edge);
  background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 17px; }
.sheet .set-input { margin: 6px 0 12px; border-color: var(--tone-m); }

/* ---------- Home outside the book (appHome) ---------- */
.ah-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 18px; }
.ah-hello .hero-date { margin: 0 0 2px; color: var(--muted); }
.ah-greet { font-family: var(--script); font-weight: 400; font-size: clamp(42px, 6vw, 60px); line-height: 1.15; color: var(--pink-d); margin: 0; }
.ah-stats { display: flex; gap: 10px; padding-bottom: 8px; }
.ah-stat { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px 8px 12px; border-radius: 999px;
  background: var(--tone); border: 1px solid var(--tone-m); color: var(--tone-d); }
.ah-stat svg { width: 20px; height: 20px; fill: var(--tone-d); }
.ah-stat b { font-family: var(--sans); font-size: 19px; font-weight: 500; line-height: 1; }
.ah-stat small { font-family: var(--sans); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }

.ah-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.ah-grid > .card { margin: 0; }
@media (min-width: 820px) {
  .ah-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "week week" "verse journey" "cont cont"; }
  .ah-week { grid-area: week; } .ah-verse { grid-area: verse; } .ah-journey { grid-area: journey; } .ah-cont { grid-area: cont; }
}
.ah-bar { height: 7px; border-radius: 99px; background: var(--paper); border: 1px solid var(--tone-m); overflow: hidden; }
.ah-bar i { display: block; height: 100%; background: var(--tone-d); border-radius: 99px; transition: width .3s; }

/* this week */
.ah-days { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.ah-days li { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.ah-days .wd { font-family: var(--sans); font-size: 12px; letter-spacing: .1em; color: var(--tone-d); }
.ah-days .dn { width: 46px; height: 46px; border-radius: 999px; display: grid; place-items: center; background: var(--paper);
  border: 1.5px solid var(--tone-m); font-family: var(--sans); font-size: 16px; color: var(--ink); }
.ah-days li.today .dn { border: 2.5px solid var(--tone-d); font-weight: 600; }
.ah-days li.future { opacity: .55; }
.ah-days .dot { width: 9px; height: 9px; border-radius: 99px; border: 1.5px solid var(--tone-m); background: var(--paper); }
.ah-days .dot.part { background: var(--tone-m); }
.ah-days .dot.full { background: var(--tone-d); border-color: var(--tone-d); }
.ah-prog { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 8px; font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--tone-d); }
.ah-prog b { font-size: 17px; }

/* verse of the day: watercolour card */
.ah-verse { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 24px 26px 0; border-color: #EBD9E6;
  background:
    radial-gradient(circle at 12% 14%, rgba(242,184,176,.55), transparent 42%),
    radial-gradient(circle at 92% 26%, rgba(201,198,240,.6), transparent 40%),
    radial-gradient(circle at 24% 92%, rgba(169,217,240,.5), transparent 45%),
    radial-gradient(circle at 88% 94%, rgba(168,221,213,.5), transparent 38%),
    #FFF9F4; }
.ah-verse > * { position: relative; }
.ah-verse .kicker { color: #B87896; }
.ah-vref { font-family: var(--display); font-size: 30px; font-weight: 600; color: #8E4F6D; text-decoration: none; line-height: 1.1; margin: 2px 0 8px; }
.ah-vtext { flex: 1; display: flex; align-items: center; font-family: var(--display); font-style: italic; font-size: clamp(21px, 2.6vw, 28px); line-height: 1.4; color: #3A3340; margin: 0 0 16px; }
.ah-vfoot { display: flex; border-top: 1px solid rgba(184,120,150,.25); margin: 0 -26px; }
.ah-vbtn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; background: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 15px; font-weight: 500; color: #9A5F7B; }
.ah-vbtn + .ah-vbtn { border-left: 1px solid rgba(184,120,150,.25); }
.ah-vbtn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ah-vbtn .heart { font-size: 21px; line-height: 1; }
.ah-vbtn.on { color: #C2557F; }
.ah-deco { position: absolute !important; pointer-events: none; opacity: .9; }
.ah-deco-1 { width: 54px; right: 14px; top: 10px; transform: rotate(-14deg); }
.ah-deco-2 { width: 46px; right: 54px; top: -6px; transform: rotate(150deg); }

/* Today's Journey */
.ah-journey { display: flex; flex-direction: column; }
.ah-jhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.ah-jhead h2 { font-family: var(--display); font-size: 27px; font-weight: 600; color: var(--tone-d); margin: 0; line-height: 1.1; }
.ah-jhead small { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.ah-jcount { font-family: var(--sans); font-size: 13.5px; color: var(--tone-d); white-space: nowrap; padding-top: 6px; }
.ah-steps { list-style: none; margin: 8px 0 0; padding: 0; }
.ah-steps li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 11px 0; }
.ah-steps li + li { border-top: 1px solid var(--tone-m); }
.ah-step { display: flex; align-items: center; gap: 14px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; min-width: 0; }
.ah-icon { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--tone-m); }
.ah-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--tone-d); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ah-st b { display: block; font-family: var(--display); font-size: 21px; font-weight: 600; color: var(--ink); line-height: 1.15; }
.ah-st small { font-family: var(--sans); font-size: 13.5px; color: var(--muted); }
.ah-tick { width: 36px; height: 36px; border-radius: 999px; border: 1.5px solid var(--tone-m); background: var(--paper); cursor: pointer;
  color: var(--paper); font-size: 17px; font-weight: 700; display: grid; place-items: center; }
.ah-steps li.done .ah-tick { background: var(--tone-d); border-color: var(--tone-d); }
.ah-steps li.done .ah-st b { color: var(--tone-d); }

/* continue reading */
.ah-cont { display: flex; align-items: center; gap: 20px; }
.ah-cover { width: 92px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px 10px 10px 6px; box-shadow: 0 4px 12px rgba(0,0,0,.14); flex: none; }
.ah-cont-body { flex: 1; min-width: 0; }
.ah-cont .big { font-family: var(--display); font-size: 28px; font-weight: 600; color: var(--tone-d); line-height: 1.1; }
.ah-cont .ah-bar { margin: 10px 0 4px; max-width: 520px; }
.card p.ah-small { font-family: var(--sans); font-size: 12.5px; color: var(--tone-d); }
.ah-go { flex: none; background: var(--tone-d); border-color: var(--tone-d); color: var(--paper); }
@media (max-width: 600px) {
  .ah-stat small { display: none; }
  .ah-days .dn { width: 38px; height: 38px; font-size: 14.5px; }
  .ah-cont { display: grid; grid-template-columns: 72px 1fr; gap: 6px 16px; align-items: start; }
  .ah-cover { width: 72px; }
  .ah-go { grid-column: 2; justify-self: start; margin-top: 6px; }
}

/* ---------- outside the book: full screen, no cover board, no corner buttons (the bottom menu has Bibles and You) */
html.app-mode .corner, html.app-mode .bible-chip, html.app-mode #settings-btn { display: none !important; }
html.app-mode.bookmode .book { width: 100vw; height: 100dvh; }
html.app-mode.bookmode .book::before, html.app-mode.bookmode .book::after { display: none; }
html.app-mode.bookmode .page.plain {
  inset: 0; border-radius: 0; box-shadow: none; margin: 0;
  padding: 36px max(44px, calc((100vw - 1500px) / 2)) 120px;
}
html.app-mode:not(.bookmode) .board { padding-left: 0; padding-right: 0; }
html.app-mode:not(.bookmode) .board::before { display: none; }
html.app-mode:not(.bookmode) .masthead { padding-left: var(--gutter); padding-right: var(--gutter); }
html.app-mode:not(.bookmode) .page.plain { border-radius: 0; margin-top: 0; box-shadow: none; }
/* the name question: a small centred card on wide screens, not the tall side panel */
@media (min-width: 900px) {
  .sheet.sheet-ask { top: 50%; bottom: auto; left: 50%; right: auto; width: 440px; transform: translate(-50%, -50%); padding: 22px 24px 18px; animation: none; }
  html[data-hand="left"] .sheet.sheet-ask { left: 50%; right: auto; }
  .sheet-scrim:has(+ .sheet.sheet-ask:not([hidden])) { background: rgba(46, 42, 54, .22); }
}

/* ---------- Today's Journey pages (#/journey/dev|ref|pray) ---------- */
.jr { max-width: 760px; margin: 0 auto; }
.jr-steps { list-style: none; display: flex; gap: 8px; margin: 14px 0 26px; padding: 0; flex-wrap: wrap; }
.jr-steps a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; text-decoration: none;
  background: var(--neutral); border: 1px solid var(--neutral-edge); color: var(--neutral-ink); font-family: var(--sans); font-size: 14px; }
.jr-steps .n { width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--tone-m); font-size: 13px; }
.jr-steps a.on { background: var(--tone); border-color: var(--tone-d); color: var(--tone-d); font-weight: 500; }
.jr-steps a.done .n { background: var(--tone-d); border-color: var(--tone-d); color: var(--paper); }
.jr .kicker { color: var(--muted); }
.jr-title { font-family: var(--display); font-size: clamp(32px, 4.4vw, 44px); font-weight: 600; line-height: 1.12; color: var(--ink); margin: 2px 0 20px; }
.jr-verse { margin: 0 0 22px; padding: 18px 22px; border-radius: 16px; border: 1px solid #EBD9E6;
  background: radial-gradient(circle at 8% 10%, rgba(242,184,176,.4), transparent 45%), radial-gradient(circle at 96% 90%, rgba(201,198,240,.45), transparent 45%), #FFF9F4; }
.jr-verse figcaption { font-family: var(--sans); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #B87896; margin-bottom: 6px; }
.jr-verse blockquote { margin: 0 0 8px; font-family: var(--display); font-style: italic; font-size: 23px; line-height: 1.4; color: #3A3340; }
.jr-verse a { font-family: var(--sans); font-size: 13.5px; color: #9A5F7B; }
.jr-p { font-size: 19px; line-height: 1.65; color: var(--ink); margin: 0 0 16px; }
.jr-opts { display: grid; gap: 12px; margin-bottom: 16px; }
.jr-opt { min-height: 60px; padding: 12px 22px; border-radius: 999px; border: 1.5px solid var(--neutral-edge); background: var(--paper); cursor: pointer;
  font-family: var(--serif); font-size: 18px; color: var(--ink); text-align: center; }
.jr-opt.on { border-color: var(--tone-d); background: var(--tone); color: var(--tone-d); box-shadow: 0 0 0 1px var(--tone-d); }
.jr-own summary { list-style: none; cursor: pointer; text-align: center; font-family: var(--sans); font-size: 15px; color: var(--muted); padding: 8px; }
.jr-own summary::-webkit-details-marker { display: none; }
.jr-own textarea { width: 100%; box-sizing: border-box; margin-top: 8px; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--tone-m);
  background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 18px; line-height: 1.5; resize: vertical; }
.jr-prayer { font-family: var(--display); font-style: italic; font-size: clamp(23px, 2.8vw, 28px); line-height: 1.5; color: var(--ink); margin: 0 0 20px; }
.jr-blank { display: inline-block; width: 5em; border-bottom: 1.5px solid var(--tone-d); vertical-align: -2px; margin: 0 .15em; }
.jr-foot { display: flex; justify-content: center; margin: 26px 0 10px; }
.jr-next { min-width: 240px; min-height: 50px; font-size: 16px; background: var(--tone-d); border-color: var(--tone-d); color: var(--paper); }

/* ---------- Home fits one iPad screen with no scrolling: same layout on shorter screens; the week and Continue reading
   keep their natural height, verse and Today's Journey share the rest (never less than their content) ---------- */
@media (min-width: 820px) and (max-height: 900px) {
  html.app-mode.bookmode .page.app-home { display: flex; flex-direction: column; padding-top: 16px; padding-bottom: 96px; }
  .app-home .ah-head { margin-bottom: 8px; }
  .app-home .ah-hello .hero-date { font-size: 11px; }
  .app-home .ah-greet { font-size: clamp(34px, 4vw, 44px); line-height: 1.1; }
  .app-home .ah-stats { padding-bottom: 2px; }
  .app-home .ah-stat { padding: 5px 14px 5px 10px; }
  .app-home .ah-grid { flex: 1; min-height: 0; gap: 12px; grid-template-rows: auto minmax(min-content, 1fr) auto; }
  .app-home .ah-grid > .card { padding: 13px 20px; }
  .app-home .ah-days { margin-bottom: 8px; }
  .app-home .ah-days li { gap: 3px; }
  .app-home .ah-days .dn { width: 38px; height: 38px; font-size: 15px; }
  .app-home .ah-prog { margin-bottom: 6px; }
  .app-home .ah-verse { padding: 14px 22px 0; min-height: 0; }
  .app-home .ah-vref { font-size: 25px; margin-bottom: 2px; }
  .app-home .ah-vtext { font-size: clamp(19px, 2vw, 23px); margin-bottom: 8px; }
  .app-home .ah-vfoot { margin: 0 -22px; }
  .app-home .ah-vbtn { min-height: 42px; }
  .app-home .ah-deco-1 { width: 44px; } .app-home .ah-deco-2 { width: 38px; right: 46px; }
  .app-home .ah-jhead { margin-bottom: 4px; }
  .app-home .ah-jhead h2 { font-size: 23px; }
  .app-home .ah-steps { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; margin-top: 2px; }
  .app-home .ah-steps li { padding: 5px 0; }
  .app-home .ah-icon { width: 38px; height: 38px; border-radius: 11px; }
  .app-home .ah-st b { font-size: 19px; }
  .app-home .ah-tick { width: 32px; height: 32px; }
  .app-home .ah-cont { gap: 18px; }
  .app-home .ah-cover { width: 54px; }
  .app-home .ah-cont .kicker { margin-bottom: 0; }
  .app-home .ah-cont .big { font-size: 24px; }
  .app-home .ah-cont .ah-bar { margin: 6px 0 3px; }
}

@media (min-width: 820px) and (max-height: 740px) {
  html.app-mode.bookmode .page.app-home { padding-top: 10px; padding-bottom: 90px; }
  .app-home .ah-greet { font-size: 38px; }
  .app-home .ah-grid { gap: 10px; }
  .app-home .ah-grid > .card { padding-top: 11px; padding-bottom: 11px; }
  .app-home .ah-days .dn { width: 34px; height: 34px; font-size: 14px; }
  .app-home .ah-days { margin-bottom: 6px; }
}

/* Topics under the reading plans */
.topics-head { font-family: var(--display); font-size: 30px; font-weight: 600; color: var(--ink); margin: -4px 0 12px; }
.topic-cards { margin-bottom: 8px; }
/* Today's Journey: filled icons, no tile (the card colour draws the book spine and pencil line) */
.ah-icon, .app-home .ah-icon { background: none; border: 0; border-radius: 0; width: 34px; height: 34px; }
.ah-icon svg, .app-home .ah-icon svg { width: 28px; height: 28px; fill: var(--tone-d); stroke: var(--tone); stroke-width: 1.5; }
/* Study hub: the PDF's toolkit page, two columns of method cards with Guide / Template */
.toolkit-sub { padding-bottom: 18px; border-bottom: 1px solid var(--rule); margin-bottom: 22px; }
.toolkit { display: grid; gap: 14px 40px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .toolkit { grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(5, auto); } }
.tk-card { display: flex; align-items: center; gap: 18px; padding: 22px 22px 22px 28px; border-radius: var(--radius); background: var(--tone); }
.tk-text { flex: 1; min-width: 0; }
.tk-card h3 { font-family: var(--display); font-weight: 600; font-size: 27px; color: var(--ink); margin: 0 0 4px; line-height: 1.1; }
.tk-card p { margin: 0; font-size: 16px; color: var(--ink); line-height: 1.45; }
.tk-btns { flex: none; display: flex; flex-direction: column; gap: 8px; width: 148px; }
.tk-guide, .tk-template { display: grid; place-items: center; min-height: 34px; border-radius: 999px; text-decoration: none; cursor: pointer;
  font-family: var(--sans); font-size: 11.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; border: 0; }
.tk-guide { background: var(--tone-m); color: #fff; }
.tk-template { background: var(--paper); color: var(--tone-d); }

/* ---------- PDF look: Journals hub cards, template pages and list tables ---------- */
.tk-journal { text-decoration: none; color: inherit; }
.tk-journal p { font-style: italic; color: var(--muted); font-size: 15.5px; }
.tk-journal .tk-btns { justify-content: center; }
/* template pages: title left, Date / Passage as soft pills on the right */
.tpl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; margin-bottom: 16px; }
.tpl-head .h1 { margin: 0; }
.tpl-fields { margin: 0; flex: 0 1 560px; justify-content: flex-end; }
.tpl-fields .hf { flex-direction: row; align-items: center; gap: 10px; min-height: 42px; padding: 0 8px 0 18px; border-radius: 999px;
  background: var(--neutral); border: 1.5px solid var(--tone-m); }
.tpl-fields .hf.wide { flex: 1 1 220px; }
.tpl-fields .hf .kicker { margin: 0; font-size: 11.5px; letter-spacing: .2em; color: var(--neutral-ink); white-space: nowrap; }
.tpl-fields .hf .input { border: 0; background: transparent; min-height: 38px; padding: 0 6px; flex: 1; min-width: 0; }
.tpl-fields .hf .input:focus { outline: none; }
/* boxes: a light band with the label centred, as in the PDF */
.form .field { border-radius: 16px; }
.form .field .band { text-align: center; padding: 10px 14px; font-size: 12.5px; letter-spacing: .2em; font-weight: 600;
  background: color-mix(in srgb, var(--tone) 75%, var(--paper)); }
.form .field .band small { display: block; margin: 2px 0 0; }
/* list journals: a ruled table */
.ltable-wrap { overflow-x: auto; }
.ltable { min-width: 560px; }
.lt-head, .lt-row { display: grid; grid-template-columns: var(--cols); }
.lt-head { background: var(--tone); border: 1.5px solid var(--tone-m); border-radius: 12px; }
.lt-head span { padding: 11px 18px; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--tone-d); }
.lt-row { min-height: 52px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.lt-row:hover { background: color-mix(in srgb, var(--tone) 35%, transparent); }
.lt-c { padding: 12px 18px; border-left: 1px solid var(--rule); font-size: 16px; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.lt-c:first-child { border-left: 0; }
.lt-c.k-date { font-family: var(--sans); font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.lt-c.k-check { display: grid; place-items: center; padding: 8px; }
.list-head { justify-content: flex-start; align-items: baseline; gap: 6px 18px; }
.list-head .sub { margin: 0; }

/* ---------- Study and Journals hubs fit one iPad screen: the five rows of cards share the height ---------- */
@media (min-width: 820px) {
  html.app-mode.bookmode .page.app-hub { display: flex; flex-direction: column; padding-top: 24px; padding-bottom: 96px; }
  .app-hub .h1 { margin-bottom: 2px; }
  .app-hub .toolkit-sub { padding-bottom: 12px; margin-bottom: 14px; }
  .app-hub .toolkit { flex: 1; min-height: 0; gap: 12px 32px; grid-template-rows: repeat(5, minmax(0, 1fr)); }
  .app-hub .tk-card { min-height: 0; padding: 10px 18px 10px 24px; }
}
@media (min-width: 820px) and (max-height: 900px) {
  html.app-mode.bookmode .page.app-hub { padding-top: 16px; padding-bottom: 92px; }
  .app-hub .h1 { font-size: 38px; }
  .app-hub .toolkit-sub { font-size: 15px; padding-bottom: 8px; margin-bottom: 10px; }
  .app-hub .toolkit { gap: 10px 28px; }
  .app-hub .tk-card h3 { font-size: 23px; margin-bottom: 2px; }
  .app-hub .tk-card p { font-size: 14.5px; line-height: 1.35; }
  .app-hub .tk-btns { gap: 6px; width: 136px; }
  .app-hub .tk-guide, .app-hub .tk-template { min-height: 30px; }
}
/* upright iPads up to 11": one column of ten slimmer cards sharing the height (two columns would squeeze the text) */
@media (min-width: 700px) and (max-width: 1023px) and (orientation: portrait) {
  html.app-mode.bookmode .page.app-hub { display: flex; flex-direction: column; padding-top: 18px; padding-bottom: 92px; }
  .app-hub .h1 { font-size: 36px; margin-bottom: 2px; }
  .app-hub .toolkit-sub { font-size: 14.5px; padding-bottom: 8px; margin-bottom: 10px; }
  .app-hub .toolkit { flex: 1; min-height: 0; gap: 8px; grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: repeat(10, minmax(0, 1fr)); }
  .app-hub .tk-card { min-height: 0; padding: 6px 16px 6px 22px; }
  .app-hub .tk-card h3 { font-size: 21px; margin: 0; }
  .app-hub .tk-card p { font-size: 14px; line-height: 1.3; }
  .app-hub .tk-btns { gap: 5px; width: 128px; }
  .app-hub .tk-guide, .app-hub .tk-template { min-height: 28px; }
}

/* ---------- study and journal templates fit one screen (iPad and computer), like a page of the PDF ---------- */
html.bookmode .page.tpl-page { display: flex; flex-direction: column; }
html.app-mode.bookmode .page.tpl-page { padding-top: 18px; padding-bottom: 92px; }
.bookmode .tpl-page .crumb { flex: none; }
.bookmode .tpl-page .tpl-head { flex: none; margin-bottom: 12px; }
.bookmode .tpl-page .h1 { font-size: clamp(32px, 3.6vw, 42px); }
.bookmode .tpl-page .form { flex: 1; min-height: 0; display: grid; gap: 12px; grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); align-items: stretch; }
.bookmode .tpl-page .form .field { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.bookmode .tpl-page .form .field.span2 { grid-column: 1 / -1; }
.bookmode .tpl-page .form .field .band { flex: none; padding: 7px 14px; }
.bookmode .tpl-page .form .field textarea.lined { min-height: 0; height: 100%; overflow-y: auto; scrollbar-gutter: stable; }
.bookmode .tpl-page .tpl-foot { flex: none; margin: 8px 0 0; }
.bookmode .tpl-page .tpl-foot .pill { min-height: 32px; padding: 2px 14px; font-size: 13px; }
/* list journals: buttons and the table header stay put; the table shows as many ruled lines as fit */
.bookmode .tpl-page .list-head, .bookmode .tpl-page > .row { flex: none; }
.bookmode .tpl-page .ltable-wrap { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; }
/* the drawing layer stays inside its box (otherwise it can toggle the page scrollbar and resize forever) */
.bookmode .tpl-page .form .field { position: relative; overflow: hidden; }
html.bookmode .page.tpl-page { overflow: hidden; }
.bookmode .tpl-page .ltable-wrap { overflow-y: auto; }
/* Home on narrow upright iPads (iPad mini): one column, the verse card takes the spare height and long verses shrink */
@media (min-width: 700px) and (max-width: 819px) {
  html.app-mode.bookmode .page.app-home { display: flex; flex-direction: column; padding-top: 18px; padding-bottom: 92px; }
  .app-home .ah-grid { flex: 1; min-height: 0; gap: 12px; grid-template-rows: auto minmax(0, 1fr) auto auto; }
  .app-home .ah-verse { min-height: 0; overflow: hidden; }
  .app-home .ah-vtext { font-size: clamp(17px, 2.6vw, 21px); overflow: hidden; min-height: 0; }
}
.ah-vtext { overflow-wrap: anywhere; }

/* ---------- Close inside the book: a house button in the corner, "Close" on the phone chip, a first-time hint ---------- */
html.in-book.bookmode .corner-l::after { content: none; }
html.in-book.bookmode .corner-l { background: var(--neutral); color: var(--neutral-ink); }
html.in-book.bookmode .corner-l .gear { width: 60%; height: 60%; }
.close-hint { position: fixed; z-index: 30; max-width: 250px; padding: 10px 14px; border-radius: 14px; cursor: pointer; text-align: left;
  background: var(--ink); color: var(--paper); border: 0; font-family: var(--sans); font-size: 14px; line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: hint-in .3s ease-out; }
.close-hint span { opacity: .7; margin-left: 6px; }
.close-hint::before { content: ""; position: absolute; width: 12px; height: 12px; background: inherit; transform: rotate(45deg); }
html.bookmode .close-hint { left: calc((100vw - min(100vw, 100dvh * 842 / 595)) / 2 + min(100vw, 100dvh * 842 / 595) * 0.065); top: 14px; }
html.bookmode .close-hint::before { left: -5px; top: 16px; }
html:not(.bookmode) .close-hint { right: 70px; top: 64px; }
html:not(.bookmode) .close-hint::before { right: 36px; top: -5px; }
@keyframes hint-in { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Plans hub as in the PDF: intro on the left, plan cards with Open plan on the right ---------- */
.plans-spread { display: grid; gap: 22px; }
@media (min-width: 820px) { .plans-spread { grid-template-columns: 1fr 1.15fr; gap: 36px; } }
.plans-left { display: flex; flex-direction: column; }
.plans-intro { font-size: 16.5px; line-height: 1.55; margin: 6px 0 4px; }
.plans-left .section-label { margin-top: 16px; }
.plans-left .topic-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.topic-pill { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 14px; background: var(--tone); border: 1px solid var(--tone-m); text-decoration: none; }
.topic-pill b { font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--tone-d); }
.topic-pill span { font-size: 13.5px; color: var(--plum); line-height: 1.3; }
.plans-left .missed { margin-top: auto; }
.plans-right { display: grid; gap: 12px; }
.tk-plan { text-decoration: none; color: inherit; align-items: flex-start; }
.tk-plan .kicker { font-size: 10.5px; letter-spacing: .2em; color: var(--tone-d); margin: 2px 0 4px; }
.tk-plan p { font-size: 14.5px; line-height: 1.4; }
.tk-plan .status { margin-top: 4px; font-family: var(--sans); font-size: 12.5px; color: var(--tone-d); }
.tk-plan .tk-btns { padding-top: 2px; }
@media (min-width: 820px) {
  html.app-mode.bookmode .page.plans-hub .plans-spread { flex: 1; min-height: 0; }
  .plans-hub .plans-right { grid-template-rows: repeat(5, minmax(0, 1fr)); min-height: 0; }
  .plans-hub .tk-plan { min-height: 0; overflow: hidden; padding: 12px 18px 12px 24px; }
}
@media (min-width: 820px) and (max-height: 900px) {
  .plans-hub .tk-plan h3 { font-size: 22px; }
  .plans-hub .tk-plan p { font-size: 13.5px; }
  .plans-hub .plans-intro { font-size: 15px; }
  .plans-hub .topic-pill { padding: 7px 12px; } .plans-hub .topic-pill b { font-size: 17px; } .plans-hub .topic-pill span { font-size: 12.5px; }
}

/* a plan: the PDF table */
.plan-table { margin-top: 10px; }
.pt-head, .plan-table .day { display: grid; grid-template-columns: 34px 92px 1fr; gap: 0 12px; align-items: center; }
.plan-table.pt-two .pt-head, .plan-table.pt-two .day { grid-template-columns: 34px 92px 1fr 1fr; }
.pt-head { background: var(--tone); border: 1.5px solid var(--tone-m); border-radius: 12px; padding: 9px 12px; }
.pt-head span { font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--tone-d); }
.pt-head span:first-child { grid-column: 1 / 3; }
.plan-table .days { margin: 0; padding: 0 12px; }
.plan-table .day { padding: 7px 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: none; }

/* ---------- Calendar and Habit Tracker as in the PDF ---------- */
.cal-title { font-size: clamp(40px, 5vw, 56px) !important; }
.cal-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.year-pill { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 18px; border-radius: 999px; background: var(--neutral);
  border: 1.5px solid var(--tone-m); font-family: var(--sans); font-size: 15px; color: var(--ink); }
.year-pill .kicker { margin: 0; font-size: 11px; letter-spacing: .2em; color: var(--neutral-ink); }
.cal-spread { display: grid; gap: 16px; }
@media (min-width: 900px) { .cal-spread { grid-template-columns: 1fr 230px; } }
.cal-main { display: flex; flex-direction: column; min-height: 0; }
.cal-page .cal { gap: 0; border-left: 1px solid var(--rule); }
.cal-page .cal-head { background: var(--tone); border-top: 1.5px solid var(--tone-m); border-bottom: 1.5px solid var(--tone-m); padding: 8px 4px; text-align: center;
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--tone-d); }
.cal-page .cal-head:first-child { border-left: 1.5px solid var(--tone-m); border-radius: 12px 0 0 12px; margin-left: -1px; }
.cal-page .cal-head:nth-child(7) { border-right: 1.5px solid var(--tone-m); border-radius: 0 12px 12px 0; }
.cal-head .short { display: none; }
@media (max-width: 760px) { .cal-head .long { display: none; } .cal-head .short { display: inline; } }
.cal-page .cal-cell { border: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); border-radius: 0; background: var(--paper); min-height: 64px; }
.cal-page .cal-cell.today { background: var(--tone); box-shadow: inset 0 0 0 2px var(--tone-m); }
.cal-page .legend { margin-top: 8px; }
.cal-side { display: grid; gap: 12px; }
.cal-side .field .band, .habit-notes .field .band { text-align: center; letter-spacing: .2em; font-weight: 600; }
.habit-notes { display: grid; gap: 14px; margin-top: 12px; }
@media (min-width: 700px) { .habit-notes { grid-template-columns: 1fr 1fr; } }
.habits-page .habits thead th { background: var(--tone); }
.habits-page .habits thead th.hh { text-align: left; padding-left: 12px; font-family: var(--sans); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--tone-d); border-radius: 10px 0 0 10px; }
/* fit one screen on iPad */
html.bookmode .cal-page .cal-spread { flex: 1; min-height: 0; }
html.bookmode .cal-page .cal { flex: 1; min-height: 0; grid-template-rows: auto repeat(var(--weeks), minmax(0, 1fr)); }
html.bookmode .cal-page .cal-cell { min-height: 0; }
html.bookmode .cal-page .cal-side { grid-template-rows: repeat(3, minmax(0, 1fr)); min-height: 0; }
html.bookmode .cal-page .cal-side .field, html.bookmode .habits-page .habit-notes .field { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; position: relative; overflow: hidden; }
html.bookmode .cal-page .cal-side textarea.lined, html.bookmode .habits-page .habit-notes textarea.lined { height: 100%; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; }
html.bookmode .habits-page .habit-scroll, html.bookmode .habits-page > .row { flex: none; }
html.bookmode .habits-page .habit-notes { flex: 1; min-height: 120px; }
@media (min-width: 700px) and (max-height: 900px) {
  html.app-mode.bookmode .page.habits-page { padding-top: 14px; }
  .habits-page .tpl-head { margin-bottom: 8px; }
  .habits-page .tpl-head .sub { display: none; }
  .habits-page .habits td, .habits-page .habits th { padding-top: 1px; padding-bottom: 1px; }
  .habits-page .habit-notes { margin-top: 8px; min-height: 90px; }
  .habits-page > .row { margin: 6px 0 0; }
}
@media (min-width: 700px) and (max-width: 819px) {
  .plans-hub .plans-spread { gap: 14px; }
  .plans-hub .tk-plan { padding: 10px 16px 10px 20px; }
  .plans-hub .tk-plan p { font-size: 13.5px; }
  .plans-hub .plans-intro { font-size: 15px; }
}
@media (min-width: 700px) and (max-width: 819px) {
  html.app-mode.bookmode .page.plans-hub .plans-spread { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
  .plans-hub .plans-right { grid-template-rows: repeat(5, minmax(0, 1fr)); min-height: 0; }
  .plans-hub .tk-plan { min-height: 0; overflow: hidden; }
  .plans-hub .plans-intro { display: none; }
  .plans-hub .plans-left .missed { margin: 10px 0 0; padding: 10px 16px; }
}

/* ---------- phone polish (narrower than the book view) ---------- */
.ph-full { }
@media (max-width: 699px) {
  /* outside the Bible the bottom menu does the navigating: no brand strip */
  html.app-mode .masthead { display: none; }
  html.app-mode .page.plain { padding-top: calc(18px + env(safe-area-inset-top)); }
  /* Plans: the plans first, then topics and "Missed a day?" */
  .plans-left { display: contents; }
  .plans-spread { display: flex; flex-direction: column; gap: 10px; }
  .plans-left .h1 { order: 1; } .plans-left > .sub { order: 2; margin-bottom: 4px; }
  .plans-right { order: 3; } .plans-intro { display: none; }
  .plans-left .section-label { order: 4; } .plans-left .topic-cards { order: 5; } .plans-left .missed { order: 6; margin-top: 6px; }
  /* Study / Journals / Plans cards: buttons under the text, side by side */
  .tk-card { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px 18px; }
  .tk-btns { flex-direction: row; width: auto; }
  .tk-btns > * { flex: 1; }
  .tk-card h3 { font-size: 24px; }
  /* list tables fit the width: first date, the writing and the tick */
  .ltable { min-width: 0; }
  .lt-head, .lt-row { grid-template-columns: var(--cols-sm, var(--cols)); }
  .ph-hide { display: none !important; }
  .lt-head span { padding: 10px 10px; letter-spacing: .12em; font-size: 11px; }
  .lt-c { padding: 10px 10px; font-size: 15px; }
  .lt-c.k-date { font-size: 12px; white-space: normal; }
  /* a plan's table: short headings, tighter columns */
  .ph-full { display: none; }
  .pt-head, .plan-table .day { grid-template-columns: 30px 62px 1fr; gap: 0 8px; }
  .plan-table.pt-two .pt-head, .plan-table.pt-two .day { grid-template-columns: 30px 62px 1fr 1fr; }
  .pt-head span { font-size: 10.5px; letter-spacing: .14em; }
  .plan-table .days { padding: 0 8px; }
  .plan-table .day .readings { font-size: 15px; }
  /* template pages: date and passage pills share the width under the title */
  .tpl-head { flex-direction: column; align-items: stretch; }
  .tpl-fields { flex: none; justify-content: stretch; }
  .tpl-fields .hf { flex: 1 1 140px; }
}
/* which settings these are: the whole app (You) or one Bible (the gear inside it) */
.set-scope { margin: -4px 0 12px; font-size: 14.5px; color: var(--muted); font-style: italic; line-height: 1.4; }
/* App theme: "Match my Bible" choice above the theme grid */
.set-theme.match { display: flex; flex-direction: column; align-items: flex-start; width: 100%; margin: 4px 0 10px; padding: 10px 14px; text-align: left; }
.set-theme.match small { font-family: var(--sans); font-size: 12px; color: var(--muted); }
#app-theme-card .set-note { margin-top: -4px; }
/* bold and palette themes: Home card text takes the card's own lettering color (dark cards get light text) */
html[data-palette] .card[class*="t-th"] .ah-st b, html[data-palette] .card[class*="t-th"] .ah-st small,
html[data-palette] .card[class*="t-th"] .ah-jhead small, html[data-palette] .card[class*="t-th"] .ah-streak p { color: var(--tone-d); }
html[data-palette] .card[class*="t-th"] .ah-st small, html[data-palette] .card[class*="t-th"] .ah-jhead small { opacity: .8; }
/* App theme: round color swatches with names, as in most apps' settings */
.sw-group { margin: 12px 0 6px; font-family: var(--sans); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px 6px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 2px; cursor: pointer; }
.swatch .dot { position: relative; width: 44px; height: 44px; border-radius: 999px; box-shadow: 0 0 0 1px rgba(0,0,0,.08) inset; transition: transform .15s; }
.swatch .dot.match { display: grid; place-items: center; background: var(--paper); border: 1.5px dashed var(--neutral-edge); color: var(--neutral-ink); box-shadow: none; }
.swatch .dot.match svg { width: 22px; height: 22px; }
.swatch .nm { font-family: var(--sans); font-size: 11.5px; line-height: 1.25; color: var(--ink); text-align: center; }
.swatch.on .dot { box-shadow: 0 0 0 2.5px var(--paper), 0 0 0 4.5px var(--pink-d); transform: scale(1.03); }
.swatch.on .dot::after { content: "✓"; position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 99px; display: grid; place-items: center;
  background: var(--pink-d); color: #fff; font: 700 11px/1 var(--sans); }
.swatch.on .nm { font-weight: 600; }
#app-theme-card .board-pick { margin-top: 12px; }
.swatch { width: 100%; min-width: 0; }
.swatch .dot { display: block; flex: none; }
.swatch .dot.match { display: grid; }
.swatch .nm { display: block; width: 100%; }
.swatches { align-items: start; }
#sheet .swatch { height: auto; min-height: 0; max-height: none; line-height: normal; overflow: visible; }

/* ---------- custom app color (You → App theme → Your own color) and the color picker ---------- */
:root { --custom: var(--cu-l, #F8DEDB); --custom-m: var(--cu-lm, #F2B8B0); --custom-d: var(--cu-ld, #A9554F); }
html[data-appearance="dark"] { --custom: var(--cu-d, #392C2B); --custom-m: var(--cu-dm, #765650); --custom-d: var(--cu-dd, #E7B1AA); }
.t-custom { --tone: var(--custom); --tone-d: var(--custom-d); --tone-m: var(--custom-m); }
.swatch .dot.rainbow { background: conic-gradient(#f2b8b0, #f6d58e, #c9e3a3, #a8ddd5, #a9d9f0, #c9c6f0, #e3afc5, #f2b8b0); }
.cp-tabs { margin: 0 0 12px; }
.cp-grid { display: grid; grid-template-columns: repeat(12, 1fr); border-radius: 12px; overflow: hidden; }
.cp-cell { aspect-ratio: 1; border: 0; padding: 0; cursor: pointer; border-radius: 0; min-height: 0; }
.cp-cell.on { box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4.5px #333; }
.cp-spectrum { display: block; width: 100%; height: 260px; border-radius: 12px; cursor: crosshair; touch-action: none; }
.cp-sliders { display: grid; gap: 14px; }
.cp-sl { display: grid; grid-template-columns: 54px 1fr 72px; align-items: center; gap: 12px; font-family: var(--sans); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cp-range { -webkit-appearance: none; appearance: none; height: 26px; border-radius: 999px; outline: none; }
.cp-r { background: linear-gradient(90deg, #000, #f00); } .cp-g { background: linear-gradient(90deg, #000, #0f0); } .cp-b { background: linear-gradient(90deg, #000, #00f); }
.cp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 999px; background: transparent; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.cp-sl .input { min-height: 38px; text-align: center; }
.cp-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.cp-preview { width: 40px; height: 40px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.cp-hex { display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.cp-hex .input { width: 96px; min-height: 38px; font-family: var(--sans); }
@media (min-width: 900px) { .sheet.sheet-picker { width: 480px; } }
