/* ============================================================
   Praisi — design system
   Warm and considered. Bitter (a sturdy slab serif) for headings;
   Hanken Grotesk (a clean sans) for body, labels and UI. The book
   keeps its own delicate serif (Fraunces) so opening it still feels
   like a distinct moment — that serif and the paper surface are the
   book's alone and never appear in the app. Muted brand palette,
   used with restraint. All faces self-hosted (no external CDN).
   ============================================================ */

/* Bitter — headings (SIL OFL 1.1), self-hosted. Warm, grounded slab. */
@font-face {
    font-family: "Bitter";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/bitter-latin-500-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Bitter";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/bitter-latin-600-normal.woff2") format("woff2");
}

/* Hanken Grotesk — body, labels, UI (SIL OFL 1.1), self-hosted. */
@font-face {
    font-family: "Hanken Grotesk";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Hanken Grotesk";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/hanken-grotesk-latin-500-normal.woff2") format("woff2");
}

/* Fraunces — the BOOK'S serif only (SIL OFL 1.1), self-hosted. Delicate,
   with a resonant italic for the floating lines. Reserved for the book. */
@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/fraunces-latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Fraunces";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/fraunces-latin-400-italic.woff2") format("woff2");
}

/* Schibsted Grotesk — self-hosted (SIL OFL 1.1), used for the book's labels. */
@font-face {
    font-family: "Schibsted Grotesk";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/schibsted-grotesk-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Schibsted Grotesk";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/schibsted-grotesk-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Petit Formal Script — the vault NICKNAME face only (SIL OFL 1.1), self-hosted. An
   elegant formal script; used small and sparingly (collection titles, keepsake heading),
   never for running text. */
@font-face {
    font-family: "Petit Formal Script";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/petit-formal-script-latin-400.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Petit Formal Script";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/petit-formal-script-latin-ext-400.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* ---- Brand palette ---- */
    --snow:  #F9F9F6;   /* Stockholm Snow — ground */
    --slate: #2E3B32;   /* Fjord Slate — ink */
    --mint:  #A5CDB0;   /* Therapeutic Mint — accent */
    --paper: #FFFFFF;   /* cards */

    /* ---- Derived ---- */
    --ink:        #2E3B32;
    --ink-muted:  rgba(46, 59, 50, 0.66);
    --ink-faint:  rgba(46, 59, 50, 0.46);
    --mint-deep:  #4F7E62;             /* legible mint for small accents/labels */
    --green:      #46604f;             /* palette green — motifs, marks */
    --mint-tint:  #ECF3EE;             /* soft fill */
    --mint-tint2: #E2EDE5;
    /* The three contributor initial-circles are subtly DIFFERENT mint shades (per the
       reference), never identical — used by index (1st/2nd/3rd) across vault/collection/home. */
    --init-1: #A9CDB3;
    --init-2: #96C4A4;
    --init-3: #BAD7C1;
    --hair:        rgba(46, 59, 50, 0.10);
    --hair-strong: rgba(46, 59, 50, 0.18);
    --shadow:     0 1px 2px rgba(46, 59, 50, 0.04), 0 10px 30px rgba(46, 59, 50, 0.06);
    --shadow-sm:  0 1px 2px rgba(46, 59, 50, 0.04), 0 4px 14px rgba(46, 59, 50, 0.05);
    --green-deep: #26312a;             /* primary-button hover (darker brand green) */
    --mint-hover: #97c2a3;             /* accent-button hover (darker mint) */

    /* ---- Heart mark colour ----
       Swap --heart to restyle every recolourable heart (.heart-glyph) at once. Options to
       explore with the client — complementary in-palette greens, then contrasting accents
       that lift against the snow ground. Set --heart to any of these to preview: */
    --heart: #C9A96A;                  /* current: antique gold */
    /*  In-palette (complementary):  #A5CDB0 mint · #4F7E62 deep mint · #46604f green · #6FA383 fresh sage
        Contrasting accents:         #C9A96A antique gold · #D98C6A terracotta · #E0A3A0 dusty rose
                                     #C96F5A coral · #4A7FB5 slate blue · #B98A80 clay          */

    /* ---- Semantic / status colours (the rest of the colour scheme, single-source) ----
       Feedback + validation colours, kept here so the WHOLE palette lives in :root. */
    --danger:  #a24b3c;                /* error / validation text */
    --spell-underline: #4a7fb5;        /* offline spellcheck's calm underline */
    --ok-bg:   #e3f0e1; --ok-fg:   #2f6b32; --ok-bd:   #bfe0bd;   /* success flash / paid */
    --err-bg:  #f8e6e3; --err-fg:  #8a2f27; --err-bd:  #eec6bf;   /* error flash */
    --warn-bg: #fdf3e0; --warn-fg: #7a5a12;                       /* pending / warning */

    /* ---- Type ----
       App headings: Bitter (warm slab). App body/labels/UI: Hanken Grotesk.
       --book-serif (Fraunces) is the BOOK'S serif only — never used in the app. */
    --head: "Bitter", Georgia, "Times New Roman", serif;
    --sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
    --book-serif: "Fraunces", Georgia, "Times New Roman", serif;
    --script: "Petit Formal Script", "Snell Roundhand", "Apple Chancery", cursive;   /* vault nicknames only */

    /* ---- Spacing scale (4-based) ---- */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 20px; --sp-6: 28px; --sp-7: 40px; --sp-8: 56px;

    /* Horizontal page margin on mobile (fluid, capped). Used by .app padding
       and by full-bleed elements (e.g. the tabbar) so they reach the edges. */
    --app-pad-x: clamp(18px, 5vw, 28px);

    /* ---- Radii ---- */
    --r-card: 16px; --r-btn: 14px; --r-field: 12px; --r-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--snow);
    font-family: var(--sans);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
}
html { overflow-x: hidden; }

/* A real mobile browser — NOT a simulated handset. The app fills the device
   viewport edge to edge, scrolls naturally with the page, and keeps clear of the
   notch / home indicator via safe-area insets. No fixed phone-width frame, no
   simulated device chrome, no inner scroll container. */
.app {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, #F1F5F0 0%, var(--snow) 32%, var(--snow) 100%);
    padding:
        calc(var(--sp-6) + env(safe-area-inset-top))
        calc(var(--app-pad-x) + env(safe-area-inset-right))
        calc(var(--sp-6) + env(safe-area-inset-bottom))
        calc(var(--app-pad-x) + env(safe-area-inset-left));
}

/* ---- Top bar ----------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
    margin-bottom: var(--sp-7);
}
.wordmark {
    font-family: var(--sans);
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0.30em;
    text-transform: lowercase;
    color: var(--ink);
    padding-left: 0.30em;
}
.topbar-right {
    display: inline-flex;
    align-items: center;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-faint);
}

/* Account icon — the sole menu control on the top-level screens (home, collection):
   a head-and-shoulders link to the account page, sitting in the topbar right slot.
   (The burger is retired; the wordmark links home, this links to account.) Functional
   and presentation screens use their right slot for their own control instead, so the
   account icon is deliberately absent there. */
.acct-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    color: var(--green, #46604f); background: rgba(165, 205, 176, 0.20);
    text-decoration: none; transition: background 0.12s ease, transform 0.12s ease;
    box-shadow: var(--shadow-sm);
}
.acct-icon:hover { background: rgba(165, 205, 176, 0.34); transform: translateY(-1px); }
.acct-icon svg { width: 20px; height: 20px; }
/* The wordmark is a home link on the owner app; keep its type, drop link chrome. */
a.wordmark { text-decoration: none; color: inherit; }
/* Home link: the heart mark before the wordmark (markup in nav.php: render_home_link). The wordmark's own left
   padding balances its trailing letter-space when it stands alone, so it is dropped here. */
.wordmark-home { display: inline-flex; align-items: center; gap: 9px; padding-left: 0; }
.wordmark-home .heart-glyph { width: 18px; height: 18px; vertical-align: 0; color: var(--heart); }

/* Print: strip the app chrome so any page prints as clean paper (the keepsake print
   view additionally sets @page margins). */
@media print {
    .topbar, .footer-actions, .acct-icon, .tabbar, .dev-banner { display: none !important; }
    .app { max-width: none; }
    body { background: #fff; }
}

/* ---- Collection: fixed SQUARE vault tiles, 2 columns, the whole tile clickable — a
       window into the vault (who it's from + when). Blank space below is fine. ---- */
.vault-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3, 12px); }
.vault-tile {
    position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; text-decoration: none;
    border: 1px solid var(--hair, #e7e3db); background: var(--snow, #F9F9F6);
    color: var(--ink, #2E3B32); display: flex; flex-direction: column; padding: 16px;
    transition: transform .12s ease, box-shadow .12s ease;
}
.vault-tile:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(35, 48, 42, .45); }
.vault-tile:active { transform: translateY(0); }
.vault-tile .vt-name { font-family: "Schibsted Grotesk", var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: .16em;
    text-transform: uppercase; color: var(--green); margin: 0 0 10px; }
.vault-tile .vt-from { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--ink-muted, #6b6357); margin: 0 0 3px; }
.vault-tile .vt-friend { font-family: var(--sans); font-size: 14px; color: var(--ink, #2E3B32); margin: 0; line-height: 1.45; }
.vault-tile .vt-date { font-family: var(--sans); font-size: 12px; color: var(--ink-muted, #6b6357); margin: auto 0 0; }
.vault-tile .vt-state { font-family: var(--sans); font-size: 13px; color: var(--ink-muted, #6b6357); margin: auto 0 0; }
/* Image tiles (a saved share card, or the styled keepsake's first page) fill the tile. */
.vault-tile.vt-image { padding: 0; }
.vault-tile.vt-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Home: the on-screen lockup + a 2x2 grid of fixed SQUARE tiles (icon + small,
       left-aligned text). The grid fills/centres the space below the lockup so the page
       shows in one view with no scroll. ---- */
/* Home layout: tiles sit at the top at their natural square size; the lockup is pushed
   to the foot of the viewport by margin-top:auto, with generous spacing between its own
   elements. The whole thing still fits one screen (no scroll). */
.quad { flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr;
    gap: var(--sp-3, 12px); margin-top: var(--sp-2); }
/* Push the lockup as far from the tiles as the viewport allows: margin-top:auto absorbs
   ALL free space, and NOTHING but the device safe-area sits beneath it (the roomy app
   bottom padding is reclaimed on .home-view below). Reclaiming space only frees height,
   so it can never introduce scroll. */
.home-lockup { text-align: center; margin: auto 0 0; }
/* Home trims the app's generous bottom padding to just the safe-area so the lockup drops
   to the very foot of the screen, maximising the gap above it. */
.home-view { padding-top: calc(var(--sp-3) + env(safe-area-inset-top)); padding-bottom: max(var(--sp-1), env(safe-area-inset-bottom)); }
/* More air between the heart, the word and the strapline than the shared lockup. The
   heart mark alone takes the brand's Therapeutic Mint accent; the word + strapline keep
   their slate/green. */
.home-lockup .lockup-mark  { margin: var(--sp-3) 0 var(--sp-3); }   /* ~equal air above + below the heart */
.home-lockup .lockup-strap { margin-top: var(--sp-4); }
.quad-tile {
    aspect-ratio: 1 / 1; border-radius: 18px; padding: 16px; text-decoration: none;
    display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; text-align: left;
    border: 1px solid var(--hair, #e7e3db); background: var(--snow, #F9F9F6); color: var(--ink, #2E3B32);
    transition: transform .12s ease, box-shadow .12s ease;
}
.quad-tile:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(35, 48, 42, .45); }
.quad-tile:active { transform: translateY(0); }
.quad-tile .qt-icon { color: var(--green); line-height: 0; }
.quad-tile .qt-icon svg { width: 26px; height: 26px; }
.quad-tile .qt-title { font-family: var(--sans); font-size: 15px; font-weight: 600; margin: 0; color: var(--ink, #2E3B32); }
.quad-tile .qt-sub { font-family: var(--sans); font-size: 12px; color: var(--ink-muted, #6b6357); margin: 3px 0 0; line-height: 1.35; }
/* The Collection tile: green field, white icon + text. */
.quad-tile.tile-green { background: var(--green, #2E3B32); border-color: var(--green, #2E3B32); color: #fff; }
.quad-tile.tile-green .qt-icon { color: #fff; }
.quad-tile.tile-green .qt-title { color: #fff; }
.quad-tile.tile-green .qt-sub { color: rgba(255, 255, 255, .8); }

/* ---- Styled vault (keepsake): the shared per-section motif + landscape divider, shown
       single-page (the booklet spans the same scene across its gutter). No paper here. */
.keepsake .sv-motif { color: var(--green); line-height: 0; display: flex; justify-content: center; margin: var(--sp-4, 16px) 0 0; }
.keepsake .sv-motif svg { width: 20px; height: 20px; fill: currentColor; opacity: .82; }
.keepsake .sv-divider { margin: var(--sp-5, 18px) 0; line-height: 0; color: var(--green); }
.keepsake .sv-divider svg { width: 100%; height: auto; display: block; }

/* ---- Offline spellcheck: a calm BLUE underline (not the browser's red) + a tap-to
       -suggest popover. All checking is local; nothing the user writes leaves the page. */
.sp-field { white-space: pre-wrap; }
/* Contenteditable writing field (replaces a plain textarea so we can draw the blue
   underlines): keep the .field look, add a comfortable height + a placeholder. */
.sp-input { min-height: 150px; text-align: left; overflow-wrap: break-word; }
.sp-input:empty::before { content: attr(data-ph); color: var(--ink-faint, #889); white-space: pre-line; }
.sp-err {
    text-decoration: underline;
    text-decoration-style: wavy;
    text-decoration-color: var(--spell-underline);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
    cursor: pointer;
}
.sp-pop {
    position: absolute; z-index: 80; min-width: 150px; max-width: 240px;
    background: var(--snow, #F9F9F6); border: 1px solid var(--hair, #e7e3db);
    border-radius: 10px; box-shadow: 0 14px 34px rgba(30, 25, 15, .18); padding: 5px;
    display: flex; flex-direction: column;
}
.sp-pop .sp-opt {
    font-family: var(--sans); font-size: 14px; text-align: left; background: none; border: 0;
    color: var(--ink, #2E3B32); padding: 9px 11px; border-radius: 7px; cursor: pointer;
}
.sp-pop .sp-opt:hover { background: var(--hair, #e7e3db); }
.sp-pop .sp-ignore { color: var(--ink-muted, #6b6357); border-top: 1px solid var(--hair, #e7e3db); margin-top: 3px; padding-top: 10px; }
.sp-pop .sp-none { font-family: var(--sans); font-size: 13px; color: var(--ink-muted, #6b6357); padding: 8px 11px; }

/* PICK-ONLY passages (vault): text is not typeable, so every word is tappable. Known
   words carry no underline (only .sp-err does) — just a pointer + a faint tap-hint. */
.sp-pick { white-space: pre-wrap; cursor: default; }
.sp-pick .sp-word { cursor: pointer; border-radius: 3px; }
.sp-pick .sp-word:hover { background: var(--hair, #e7e3db); }
/* "Not right?" escape hatch + its inline custom-word input, inside the popover. */
.sp-pop .sp-notright { color: var(--ink-muted, #6b6357); border-top: 1px solid var(--hair, #e7e3db); margin-top: 3px; padding-top: 10px; }
.sp-pop .sp-custom { display: flex; flex-direction: column; gap: 6px; padding: 6px 5px 3px; border-top: 1px solid var(--hair, #e7e3db); margin-top: 3px; }
.sp-pop .sp-custom-input {
    font-family: var(--sans); font-size: 14px; color: var(--ink, #2E3B32);
    background: var(--paper, #fff); border: 1px solid var(--hair-strong, #cfc9bd);
    border-radius: 7px; padding: 8px 10px; width: 100%; box-sizing: border-box;
}
.sp-pop .sp-use { text-align: center; background: var(--mint, #A5CDB0); font-weight: 600; }
.sp-pop .sp-use:hover { background: var(--green, #46604f); color: var(--snow, #F9F9F6); }

/* ---- Share composer: a square social card + a pickable source panel ---------------- */
.share-stage { display: flex; justify-content: center; margin: var(--sp-5) 0 var(--sp-4); }
.share-card {
    position: relative; width: 100%; max-width: 320px; aspect-ratio: 1 / 1;
    border-radius: 16px; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 34px 28px;
    box-shadow: 0 18px 40px -20px rgba(35, 48, 42, .40);
}
.share-card .q-motif { line-height: 0; margin-bottom: 16px; }
.share-card .q-motif svg { width: 26px; height: 26px; fill: currentColor; opacity: .85; }
.share-card .q-text { font-family: var(--book-serif, Georgia, serif); font-weight: 400; line-height: 1.4; margin: 0; }
.share-card .q-attr { font-family: var(--sans); font-size: 11.5px; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase; margin: 16px 0 0; opacity: .82; }
.share-card .q-mark { position: absolute; bottom: 15px; left: 0; right: 0; text-align: center;
    font-family: "Schibsted Grotesk", var(--sans); letter-spacing: .30em; font-size: 10px;
    text-transform: lowercase; opacity: .6; }
/* Fixed type tiers by length band — the length-fit rule steps the size DOWN by band
   (never a continuous shrink-to-fit); an over-long quote is refused, not squeezed. */
.share-card.band-short  .q-text { font-size: 26px; }
.share-card.band-medium .q-text { font-size: 20px; }
.share-card.band-long   .q-text { font-size: 15px; line-height: 1.45; }
/* Curated, all-in-one templates (placeholders within the brand palette). */
.share-card.tpl-share-sage  { background: linear-gradient(158deg, #dfe9e0 0%, #f4f1e9 100%); color: var(--ink, #2E3B32); }
.share-card.tpl-share-cream { background: var(--snow, #F9F9F6); color: var(--green, #2E3B32); border: 1px solid var(--hair, #e7e3db); }
.share-card.tpl-share-night { background: linear-gradient(158deg, #2E3B32 0%, #3c4f43 100%); color: #F4F1E9; }

.share-note { font-family: var(--sans); font-size: 13px; color: var(--danger); text-align: center; min-height: 18px; margin: 0 0 var(--sp-3); }
.share-source { border: 1px solid var(--hair, #e7e3db); border-radius: 12px; padding: 14px 16px; margin-top: var(--sp-3); }
.share-source .src-head { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: var(--ink-faint, #889); margin: 0 0 4px; }
.share-source .src-name { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--green); margin: 12px 0 4px; }
.share-source .src-name:first-child { margin-top: 0; }
.q-pick { cursor: pointer; border-radius: 4px; padding: 0 2px; transition: background .12s; }
.q-pick:hover { background: var(--hair, #e7e3db); }
.q-pick.on { background: rgba(46, 59, 50, .14); box-shadow: inset 0 -2px 0 var(--green); }

/* Brand lockup — wordmark with the strapline quietly beneath. Used on the
   landing and the closing/home screen only, never in cramped UI. */
.brand-lockup { text-align: center; }
.brand-lockup .wordmark {
    display: inline-block;
    font-size: 19px;
    color: var(--ink);
}
.strapline {
    font-family: var(--sans);
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.05em;
    color: var(--ink-faint);
    text-align: center;
    margin-top: 7px;
}

/* ---- Typography -------------------------------------------- */
.h1 {
    font-family: var(--head);
    font-weight: 500;
    font-size: clamp(22px, 6.2vw, 27px);
    line-height: 1.22;
    letter-spacing: -0.005em;
    color: var(--ink);
    margin: 0 0 var(--sp-4);
}
.h1.xl {
    font-size: clamp(27px, 8.2vw, 34px);
    line-height: 1.16;
    letter-spacing: -0.01em;
    font-weight: 600;
}
.h2 {
    font-family: var(--head);
    font-weight: 500;
    font-size: clamp(18px, 5vw, 21px);
    line-height: 1.3;
    letter-spacing: -0.003em;
    color: var(--ink);
    margin: 0 0 var(--sp-3);
}
.lede {
    font-family: var(--sans);
    font-size: clamp(16px, 4.3vw, 18px);
    line-height: 1.55;
    color: var(--ink-muted);
    margin: 0 0 var(--sp-6);
    max-width: 34em;
}
.smallcaps {
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 0 0 var(--sp-4);
}
.center { text-align: center; }
.center.lede, .lede.center { margin-left: auto; margin-right: auto; }
.muted { color: var(--ink-muted); }
.fine {
    font-family: var(--sans);
    font-size: 13px;
    color: var(--ink-faint);
    text-align: center;
    margin-top: var(--sp-4);
}
.fine a { color: var(--mint-deep); text-decoration: none; font-weight: 500; }

/* ---- Heart badge / logo ------------------------------------ */
.heart-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--paper);
    box-shadow: var(--shadow-sm);
    display: grid;
    place-items: center;
    margin: var(--sp-2) auto var(--sp-7);
}
.heart-badge svg { width: 24px; height: 24px; }
.heart-ring {
    width: 84px; height: 84px; border-radius: 50%;
    border: 1px solid var(--hair-strong);
    display: grid; place-items: center;
    margin: var(--sp-1) auto var(--sp-6);
    background: var(--mint-tint);
}
.heart-ring svg { width: 28px; height: 28px; }

/* Plain heart mark at its natural aspect — no pill/oval/ring background. */
.heart-mark { display: flex; justify-content: center; margin: var(--sp-2) auto var(--sp-6); }
.heart-mark svg { width: 54px; height: 54px; }

/* The heart mark as a recolourable MASK of the line-heart (assets/images/heart.svg,
   an outline heart on a 24 grid): tints to any brand colour via `color`/currentColor —
   sage (green), white, mint or gold, per context. It is the mark everywhere (the lockups
   on index + home included). .heart-glyph = 1em inline (pills); add .fill to size it to a
   parent (rings, notice icon). Bump ?v= whenever heart.svg changes (Cloudflare). */
.heart-glyph { display: inline-block; width: 1em; height: 1em; vertical-align: -0.12em; flex: 0 0 auto;
    background-color: currentColor;
    -webkit-mask: url("../images/heart.svg?v=17") no-repeat center / contain;
    mask: url("../images/heart.svg?v=17") no-repeat center / contain; }
.heart-glyph.fill { width: 100%; height: 100%; vertical-align: 0; }
.heart-png { display: block; }
.lockup-mark .heart-glyph { width: 26px; height: 26px; }                              /* gift-welcome mark (green) */
.heart-ring .heart-glyph.fill { width: 28px; height: 28px; color: var(--green); }     /* contribute thank-you ring */
.notice-card .icon { color: var(--green); }                                           /* arrival-notice heart */
.notice-card .icon .heart-glyph.fill { width: 22px; height: 22px; }
.pill .heart-glyph { color: var(--mint-deep); }                                        /* count-pill heart */

/* A clean, light list of invited people — hairline separators, no boxes. */
.people-list { margin-bottom: var(--sp-5); }
.people-row { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) 2px; }
.people-row + .people-row { border-top: 1px solid var(--hair); }
.people-row .invited {
    display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
    font-family: var(--sans); font-size: 12.5px; font-weight: 500;
    letter-spacing: 0.02em; color: var(--ink-faint);
}
.people-row .invited svg { width: 15px; height: 15px; }

/* ---- App motifs -------------------------------------------- *
   The book's quiet Phosphor vectors, recoloured palette green, used sparingly
   in the app where a glyph helps (in place of UI emoji). The paper, the book's
   serif and the floating-line treatment stay in the book; this is just the
   shared visual vocabulary of calm line motifs. Painted from data-motif. */
.motif { color: var(--green); line-height: 0; display: inline-flex; }
.motif svg { width: 22px; height: 22px; display: block; fill: currentColor; opacity: 0.9; }
/* A larger, centred motif for emotional screens (keepsake, contributor close). */
.motif-mark { color: var(--green); line-height: 0; display: flex; justify-content: center; }
.motif-mark svg { width: 30px; height: 30px; fill: currentColor; opacity: 0.85; }

/* ---- Landing lockup ---------------------------------------- *
   Open-heart line mark, airy wordmark, quiet uppercase strapline. */
.landing-lockup { text-align: center; }
.lockup-mark { color: var(--green); display: flex; justify-content: center; margin-bottom: var(--sp-4); }
.lockup-mark svg { width: 30px; height: 30px; }
.lockup-word {
    font-family: var(--sans); font-weight: 500; font-size: 22px;
    letter-spacing: 0.5em; text-transform: lowercase; color: var(--slate);
    padding-left: 0.5em;
}
.lockup-strap {
    font-family: var(--sans); font-weight: 600; font-size: 10.5px;
    letter-spacing: 0.3em; text-transform: uppercase; color: var(--green);
    margin-top: 10px;
}

/* ---- Buttons ----------------------------------------------- */
.btn {
    display: block;
    width: 100%;
    border: 1px solid transparent;
    border-radius: var(--r-btn);
    padding: 16px 22px;
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.005em;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease,
                box-shadow 0.18s ease, transform 0.05s ease;
}
.btn-primary { background: var(--slate); color: var(--snow); }
.btn-primary:hover { background: var(--green-deep); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--hair-strong); }
.btn-secondary:hover { background: rgba(46, 59, 50, 0.04); }
/* Quiet destructive button (e.g. Delete account): the app's error red, understated. */
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(162, 75, 60, 0.4); }
.btn-danger:hover { background: rgba(162, 75, 60, 0.06); }

/* ---- Modal / lightbox (shared: gift lightbox, delete-account popup, …) ------------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(46, 59, 50, 0.55);
    display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-overlay[hidden] { display: none; }
.modal-card { background: var(--snow, #F9F9F6); border-radius: 18px; padding: 26px 22px 24px;
    width: 100%; max-width: 400px; position: relative; box-shadow: 0 20px 60px rgba(30, 25, 15, 0.28); }
.modal-card .h2 { margin: 2px 0 6px; }
.modal-card .lede { margin-bottom: var(--sp-5, 18px); }
.modal-close { position: absolute; top: 8px; right: 12px; background: none; border: none;
    font-size: 26px; line-height: 1; color: var(--ink-faint, #889); cursor: pointer; padding: 6px 10px; }
.btn-accent { background: var(--mint); color: var(--slate); }
.btn-accent:hover { background: var(--mint-hover); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn-row { display: flex; gap: var(--sp-3); }
.btn-row .btn { width: 100%; }

.spacer { flex: 1 1 auto; min-height: var(--sp-6); }
.footer-actions { margin-top: auto; padding-top: var(--sp-6); }
/* Stacked full-width buttons (e.g. keepsake's Share + Make it last) get a gap between. */
.footer-actions .btn + .btn { margin-top: var(--sp-3); }

/* ---- Segmented toggle -------------------------------------- */
.segment {
    display: flex;
    background: #EDEDE7;
    border-radius: var(--r-btn);
    padding: 4px;
    margin-bottom: var(--sp-4);
}
.segment button {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px;
    border-radius: 10px;
    font-family: var(--sans);
    font-size: 15px;
    color: var(--ink-muted);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}
.segment button.active {
    background: var(--paper);
    color: var(--ink);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

/* ---- Cards & rows ------------------------------------------ */
.card {
    background: var(--paper);
    border: 1px solid var(--hair);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-sm);
    padding: var(--sp-6);
}
.card + .card { margin-top: var(--sp-4); }

.avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--mint-tint);
    color: var(--mint-deep);
    display: grid; place-items: center;
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 500;
    flex: 0 0 auto;
}
.avatar.soft { background: var(--mint-tint); color: var(--mint-deep); }

.person-row {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    background: var(--paper);
    border: 1px solid var(--hair);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-sm);
    padding: var(--sp-4) var(--sp-5);
}
.person-row + .person-row { margin-top: var(--sp-3); }
.person-name { font-family: var(--sans); font-size: 16px; color: var(--ink); font-weight: 500; }
.person-sub  { font-size: 14px; color: var(--ink-muted); margin-top: 2px; }
.person-row .grow { flex: 1; }
.check { color: var(--mint-deep); display: inline-flex; }

/* ---- Status pill ------------------------------------------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    background: var(--mint-tint);
    color: var(--mint-deep);
    border-radius: var(--r-pill);
    padding: 6px 13px;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.pill.quiet { background: transparent; border: 1px solid var(--hair-strong); color: var(--ink-muted); }

/* ---- Form fields ------------------------------------------- */
.field-label {
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    display: block;
    margin-bottom: var(--sp-3);
}
.field {
    width: 100%;
    border: 1px solid var(--hair-strong);
    background: var(--paper);
    border-radius: var(--r-field);
    padding: var(--sp-4);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink);
}
.field::placeholder { color: var(--ink-faint); }
.field:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-tint); }
textarea.field { resize: none; }
.field-note { font-family: var(--sans); font-size: 14px; color: var(--ink-muted); margin-top: var(--sp-3); }

/* The single contributor prompt — read as calm guidance, not a form label. */
.prompt-text {
    font-family: var(--sans);
    font-size: 18px;
    line-height: 1.6;
    color: var(--ink);
    margin: 0 0 var(--sp-5);
}

/* ---- Vault: live arrival + responses ----------------------- */
/* A calm, secondary subtitle on the vault — smaller than the heading. */
.vault-sub {
    font-family: var(--sans);
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--ink-muted);
    margin: 0 0 var(--sp-6);
    max-width: 34em;
}

.notice-card {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    background: var(--paper);
    border: 1px solid var(--hair);
    border-radius: var(--r-card);
    box-shadow: 0 1px 3px rgba(46, 59, 50, 0.05), 0 14px 30px -12px rgba(46, 59, 50, 0.20);
    padding: var(--sp-4) var(--sp-5);
    margin-bottom: var(--sp-5);
}
.notice-card .icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--mint-tint);
    display: grid; place-items: center;
    flex: 0 0 auto;
}
.notice-title { font-family: var(--sans); font-weight: 500; font-size: 15px; }
.notice-sub { font-size: 14px; color: var(--ink-muted); margin-top: 1px; }
.notice-time { margin-left: auto; font-family: var(--sans); font-size: 12.5px; color: var(--ink-faint); }

.resp-card {
    background: var(--paper);
    border: 1px solid var(--hair);
    border-radius: var(--r-card);
    box-shadow: 0 1px 3px rgba(46, 59, 50, 0.05), 0 16px 34px -14px rgba(46, 59, 50, 0.18);
    padding: var(--sp-5) var(--sp-6);
    margin-bottom: var(--sp-5);
}
.resp-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.resp-name { font-family: var(--sans); font-weight: 500; font-size: 16px; color: var(--ink); }
.resp-body { font-size: 17px; line-height: 1.6; color: var(--ink); margin: 0; }

/* Prompt-headed answer sections (shared by the vault and the keepsake): a small
   green heading derived from the prompt, then the answer beneath it. */
.answer-block + .answer-block { margin-top: var(--sp-5); }
.answer-head {
    font-family: var(--sans); font-size: 12px; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--green);
    margin: 0 0 var(--sp-2);
}
/* Contributor name heading in the keepsake (quiet sans small caps). */
.passage-name {
    font-family: var(--sans); font-size: 13px; font-weight: 600;
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink);
    margin: 0 0 var(--sp-5);
}

/* ---- Vault (one page: waiting → filling → full) — plain read view, lifted cards ---- */
.send-summary { margin: 0 0 var(--sp-4); padding: 12px 14px; border: 1px solid var(--hair);
    border-radius: 12px; background: var(--snow); font-family: var(--sans); font-size: 14px; line-height: 1.5; }
.vlt-ring { position: relative; display: flex; justify-content: center; margin: var(--sp-6) 0 var(--sp-5); }
.vlt-ring[hidden] { display: none; }
.vlt-ring .vlt-ring-circles { width: 116px; height: 116px; }
.vlt-ring-heart { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 34px; height: 34px; color: var(--mint); }
/* The three contributor initial-circles — subtly different mint shades, never identical. */
.vlt-init { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--sans); font-weight: 600; font-size: 15px; color: #253630; }
.vlt-init.init-1 { background: var(--init-1); }
.vlt-init.init-2 { background: var(--init-2); }
.vlt-init.init-3 { background: var(--init-3); }
.vlt-init.soft { opacity: 0.55; }
.vlt-name { font-family: var(--sans); font-weight: 500; font-size: 16px; color: var(--ink); }
/* Waiting: one lifted card, rows split by hairlines, an "Invited" pill each. */
.vlt-people { background: var(--paper); border: 1px solid var(--hair); border-radius: var(--r-card);
    box-shadow: 0 1px 3px rgba(46, 59, 50, 0.05), 0 16px 34px -16px rgba(46, 59, 50, 0.16); padding: 2px 18px; }
.vlt-row { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-top: 1px solid var(--hair); }
.vlt-row:first-child { border-top: 0; }
.vlt-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--mint-deep);
    background: var(--mint-tint); border-radius: 999px; padding: 6px 12px; }
.vlt-pill .cl { display: inline-flex; } .vlt-pill .cl svg { width: 13px; height: 13px; }
/* Filling/full: written cards (lifted) + pending dashed rows. */
.vlt-card { background: var(--paper); border: 1px solid var(--hair); border-radius: var(--r-card);
    box-shadow: 0 1px 3px rgba(46, 59, 50, 0.05), 0 16px 34px -16px rgba(46, 59, 50, 0.16);
    padding: var(--sp-5) var(--sp-6); margin-bottom: var(--sp-4); }
.vlt-who { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.vlt-pending { display: flex; align-items: center; gap: 14px; border: 1px dashed var(--hair-strong);
    border-radius: var(--r-card); padding: 15px 18px; margin-bottom: var(--sp-4); color: var(--ink-faint); }
.vlt-pending .grow { flex: 1; font-family: var(--sans); font-size: 15px; }
.vlt-pending .cl { color: var(--ink-faint); } .vlt-pending .cl svg { width: 19px; height: 19px; }
/* Greyed primary button (e.g. "See them together" until all three are in). */
.btn:disabled { background: var(--hair); color: var(--ink-faint); border-color: transparent;
    cursor: default; box-shadow: none; }

/* ---- Keepsake — the saved ARTEFACT form of the vault (bespoke; not the contract) ---- */
/* Presentation-screen signature: the fuller green→cream wash (also used by home). */
.app.presentation { background: linear-gradient(178deg, #E4EDE4 0%, #EFF3ED 26%, var(--snow) 62%); }
/* Top-right tools: pencil + save-tick by default; red ✕ / blue ✓ while editing spelling. */
.ks-tools { display: flex; }
.ks-toolset { display: flex; gap: 8px; }
.ks-toolset[hidden] { display: none; }
.ks-ctrl { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--hair);
    background: var(--paper); color: var(--green); display: inline-flex; align-items: center;
    justify-content: center; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform 0.12s ease; }
.ks-ctrl:hover { transform: translateY(-1px); }
.ks-ctrl svg { width: 18px; height: 18px; }
.ks-ctrl.danger { color: var(--danger); }
.ks-ctrl.tick { color: #3d6ea8; }
/* The artefact card — white, softly lifted off the wash. */
.ks-card { background: var(--paper); border: 1px solid var(--hair); border-radius: 20px;
    box-shadow: 0 2px 6px rgba(46, 59, 50, 0.05), 0 26px 60px -30px rgba(46, 59, 50, 0.40);
    padding: var(--sp-7) var(--sp-6) var(--sp-6); margin: var(--sp-4) 0 var(--sp-5); }
.ks-card.editing { box-shadow: 0 0 0 2px var(--mint), 0 26px 60px -30px rgba(46, 59, 50, 0.40); }
.ks-eyebrow { text-align: center; font-family: var(--sans); font-size: 11px; font-weight: 700;
    letter-spacing: 0.18em; text-transform: uppercase; color: var(--mint-deep); margin: 0 0 var(--sp-2); }
.ks-title { text-align: center; font-family: var(--head); font-weight: 600; font-size: 26px;
    color: var(--ink); margin: 0 auto var(--sp-4); text-wrap: balance; }
/* A named vault shows its nickname in the script face — kept modest + calm. */
.ks-title.named { font-family: var(--script); font-weight: 400; font-size: 30px; line-height: 1.15; }
/* While editing, the heading is tappable to name the vault. */
.ks-title-edit { cursor: pointer; text-decoration: underline dotted var(--hair-strong); text-underline-offset: 5px; }
.ks-rule { width: 46px; height: 2px; background: var(--mint); border-radius: 2px; margin: 0 auto var(--sp-6); }
.ks-sep { height: 1px; background: var(--hair); margin: var(--sp-5) 0; }
.ks-quote { font-family: var(--head); font-style: italic; font-size: 17px; line-height: 1.55;
    color: #232f27; margin: 0 0 var(--sp-3); }
.ks-attr { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--mint-deep); margin: var(--sp-2) 0 0; }
.ks-mark { text-align: center; font-family: var(--sans); font-weight: 500; font-size: 14px;
    letter-spacing: 0.34em; padding-left: 0.34em; color: var(--ink-faint); margin-top: var(--sp-6); }

/* ---- Home + Collection: the green vault card, rounded actions, collection cards ---- */
.home-h { font-family: var(--head); font-weight: 600; font-size: 30px; letter-spacing: -0.01em;
    margin: 0 0 var(--sp-2); text-wrap: balance; }
.home-sub { font-family: var(--head); font-size: 15.5px; color: var(--ink-muted); margin: 0 0 var(--sp-5); }
/* Green "Your Vaults" card (home) — cycles; taps through to Collection. */
.vault-card { display: block; text-decoration: none; color: var(--ink); border-radius: 20px;
    padding: 19px 20px; background: linear-gradient(135deg, #8DB79A 0%, #A9CDB3 100%);
    box-shadow: 0 2px 6px rgba(46, 59, 50, 0.06), 0 20px 44px -22px rgba(46, 59, 50, 0.40);
    transition: transform 0.12s ease, box-shadow 0.12s ease; }
.vault-card:hover { transform: translateY(-2px); box-shadow: 0 2px 6px rgba(46, 59, 50, 0.06), 0 26px 52px -22px rgba(46, 59, 50, 0.46); }
.vc-ey { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #33463a; }
.vc-title { font-family: var(--head); font-weight: 600; font-size: 22px; color: var(--ink); margin-bottom: 10px; }
/* The vault odometer: a fixed-height window; the stacked rows roll up one at a time with
   an eased momentum (a smooth carousel, not a fade). */
.vc-roll { height: 52px; overflow: hidden; }
.vc-roll #vc-body { display: flex; flex-direction: column; will-change: transform;
    transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1); }
.vc-roll .vc-row { height: 52px; }
.vc-row { display: flex; align-items: center; gap: 14px; }
.vc-avset { display: flex; }
/* Overlapping initial circles — three subtly different mint shades; ring matches ground. */
.vc-av { width: 42px; height: 42px; border-radius: 50%; margin-left: -12px; display: flex;
    align-items: center; justify-content: center; font-family: var(--sans); font-weight: 600;
    font-size: 15px; color: #253630; box-shadow: 0 0 0 3px var(--paper); }
.vc-av:first-child { margin-left: 0; }
.vc-av.init-1 { background: var(--init-1); } .vc-av.init-2 { background: var(--init-2); } .vc-av.init-3 { background: var(--init-3); }
.vault-card .vc-av { box-shadow: 0 0 0 3px #A9CDB3; }   /* on the green card, ring = the card */
.vc-kept { font-family: var(--sans); font-size: 14.5px; font-weight: 500; color: #2b3a30; }
/* Rounded action buttons (Start / Gift) — home + collection. */
.action { display: flex; align-items: center; gap: 15px; text-decoration: none; color: var(--ink);
    background: var(--paper); border: 1px solid var(--hair); border-radius: 18px; padding: 15px 16px;
    margin-top: 13px; box-shadow: var(--shadow-sm); transition: transform 0.12s ease, box-shadow 0.12s ease; }
.action:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.action-box { width: 52px; height: 52px; border-radius: 14px; background: var(--mint-tint); color: var(--green);
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.action-box svg { width: 23px; height: 23px; }
.action-t { display: block; font-family: var(--sans); font-weight: 600; font-size: 16px; color: var(--ink); }
.action-s { display: block; font-family: var(--head); color: var(--ink-muted); font-size: 13.5px; margin-top: 2px; }
/* Collection cards. */
.col-card { position: relative; display: block; text-decoration: none; color: var(--ink);
    background: var(--paper); border: 1px solid var(--hair); border-radius: 18px; padding: 16px 17px;
    margin-top: 14px; box-shadow: var(--shadow-sm); transition: transform 0.12s ease, box-shadow 0.12s ease; }
.col-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.col-motif { position: absolute; top: 13px; right: 14px; color: var(--mint-deep); opacity: 0.85; }
.col-motif svg { width: 28px; height: 28px; }
.col-ey { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mint-deep); }
.col-nn { font-family: var(--script); font-weight: 400; font-size: 21px; line-height: 1.15; color: var(--slate); margin: 5px 0 16px; }
.col-nn.unnamed { font-family: var(--head); font-style: italic; font-size: 20px; color: var(--ink-faint); }
.col-row { display: flex; align-items: center; gap: 18px; }
.col-kept { font-family: var(--sans); font-size: 13.5px; color: var(--ink-muted); }
/* Collection pills a touch smaller than the home card's, for a calmer tile. */
.col-card .vc-av { width: 36px; height: 36px; font-size: 14px; margin-left: -10px; }
/* Shared card: pills + "Kept since" on the left, a small square of the share post right. */
.col-card.with-share { display: flex; align-items: center; gap: 14px; }
.col-main { flex: 1; min-width: 0; }
.col-share-sq { width: 82px; height: 82px; border-radius: 12px; flex: 0 0 auto; overflow: hidden;
    background: linear-gradient(140deg, #dfe9e0, #FCFBF6); border: 1px solid var(--hair);
    display: flex; align-items: center; justify-content: center; text-align: center; padding: 9px; }
.col-share-sq span { font-family: var(--head); font-style: italic; font-size: 10.5px; line-height: 1.3;
    color: var(--green); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Setup: add-person tiles + lightbox ---- */
.person-tile { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; width: 100%; text-align: left;
    background: var(--paper); border: 1px solid var(--hair); border-radius: 18px; padding: 14px 16px;
    margin-top: 13px; cursor: pointer; box-shadow: var(--shadow-sm);
    transition: transform 0.12s ease, box-shadow 0.12s ease; }
.person-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.person-tile:not(.filled) { border-style: dashed; background: transparent; box-shadow: none; }
.pt-empty { display: flex; align-items: center; gap: 12px; font-family: var(--sans); font-size: 16px; color: var(--ink-muted); }
.pt-plus { width: 44px; height: 44px; border-radius: 50%; background: var(--mint-tint); color: var(--green);
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.pt-plus svg { width: 22px; height: 22px; }
.pt-filled { display: none; align-items: center; gap: 14px; }
.person-tile.filled .pt-empty { display: none; }
.person-tile.filled .pt-filled { display: flex; }
.pt-init { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; display: flex; align-items: center;
    justify-content: center; font-family: var(--sans); font-weight: 600; font-size: 15px; color: #253630; }
.pt-init.init-1 { background: var(--init-1); } .pt-init.init-2 { background: var(--init-2); } .pt-init.init-3 { background: var(--init-3); }
.pt-name { display: block; font-family: var(--sans); font-weight: 600; font-size: 16px; color: var(--ink); }
.pt-phone { display: block; font-family: var(--head); font-style: italic; font-size: 14px; color: var(--ink-muted); margin-top: 1px; }
.pt-err { flex-basis: 100%; font-size: 12px; color: var(--danger); }

/* ---- Share composer: tap-a-word selection + share targets ---- */
.src-para { font-family: var(--head); line-height: 2.1; margin: 0 0 var(--sp-3); }
.w { cursor: pointer; border-radius: 4px; padding: 1px 2px; transition: background 0.1s ease; }
.w:hover { background: var(--hair); }
.w.pend { box-shadow: inset 0 0 0 2px var(--mint); }
.w.sel { background: var(--mint-tint); }
.w.rm { background: rgba(162, 75, 60, 0.16); color: var(--danger); text-decoration: line-through; }
.share-targets { margin: var(--sp-4) 0 var(--sp-5); text-align: center; }
.share-shared { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--mint-deep); margin: 0 0 var(--sp-3); }
.share-icons { display: flex; justify-content: center; gap: var(--sp-3); }
.share-i { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--hair); background: var(--paper);
    color: var(--green); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: var(--shadow-sm); transition: transform 0.12s ease; }
.share-i:hover { transform: translateY(-2px); }
.share-i svg { width: 22px; height: 22px; }
.share-toast { font-family: var(--sans); font-size: 13px; color: var(--ink-muted); margin: var(--sp-3) 0 0; min-height: 16px; }
/* ✕ / ✓ confirm row (appears on first word) + the always-visible share bar. */
.share-confirm { display: flex; justify-content: center; gap: var(--sp-4); margin: var(--sp-4) 0 var(--sp-3); }
.share-c { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--hair); background: var(--paper);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-sm);
    transition: transform 0.12s ease; }
.share-c:hover { transform: translateY(-2px); }
.share-c svg { width: 22px; height: 22px; }
.share-c.discard { color: var(--danger); }
.share-c.ok { color: var(--green); }
.share-bar { display: flex; justify-content: center; gap: var(--sp-3); margin-top: var(--sp-4); }

/* Admin-only "Admin console" button (nav.php render_admin_console_link) — only ever
   rendered for a signed-in admin; access to admin.php is independently require_admin-gated. */
.topbar-actions { display: inline-flex; align-items: center; gap: var(--sp-3); }
.admin-console-link { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--green);
    background: var(--mint-tint); border: 1px solid var(--hair); border-radius: 999px;
    padding: 5px 12px; text-decoration: none; white-space: nowrap; }
.admin-console-link:hover { background: var(--mint); }
/* On the account page it sits under the topbar as a standalone pill. */
.topbar + .admin-console-link { display: inline-block; margin: 0 0 var(--sp-3); }

/* Watercolour card: the 1080² canvas, shown scaled to the stage. */
.share-canvas { width: 100%; max-width: 330px; height: auto; display: block; border-radius: 14px;
    background: #f4f1e9; box-shadow: 0 2px 6px rgba(46, 59, 50, 0.06), 0 20px 44px -24px rgba(46, 59, 50, 0.4); }
/* Word-count / cap notice under the card; red past the limit. */
.share-cap { font-family: var(--sans); font-size: 12.5px; color: var(--ink-muted); text-align: center; margin: var(--sp-2) 0 0; }
.share-cap.over { color: var(--danger); font-weight: 600; }

/* Cut-the-middle lightbox */
.cut-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center;
    background: rgba(30, 40, 34, 0.44); padding: var(--sp-3); }
.cut-modal[hidden] { display: none; }
.cut-sheet { width: 100%; max-width: 460px; background: var(--paper); border-radius: 20px 20px 16px 16px;
    padding: var(--sp-5) var(--sp-4) var(--sp-4); box-shadow: 0 -8px 40px -12px rgba(46, 59, 50, 0.5); }
.cut-head { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 4px; text-align: center; }
.cut-sub { font-family: var(--head); font-style: italic; font-size: 13px; color: var(--ink-muted); margin: 0 0 var(--sp-3); text-align: center; }
.cut-words { font-family: var(--head); line-height: 2.1; text-align: center; margin: 0 0 var(--sp-3); }
.cw { cursor: pointer; border-radius: 4px; padding: 1px 3px; transition: background 0.1s ease; }
.cw:hover { background: var(--hair); }
.cw.pend { box-shadow: inset 0 0 0 2px var(--mint); }
.cw.rm { background: rgba(162, 75, 60, 0.16); color: var(--danger); text-decoration: line-through; }
.cut-preview { font-family: var(--book-serif, Georgia, serif); font-style: italic; font-size: 15px; color: var(--slate);
    text-align: center; margin: 0 0 var(--sp-4); min-height: 20px; }
.cut-preview.over { color: var(--danger); }
.cut-actions { display: flex; gap: var(--sp-3); }
.cut-actions .btn { flex: 1; }

/* ---- Booklet as a horizontal flick-through (3D flip retired to booklet-3d.php) ----
   Pages fill the viewport height; the row scrolls left↔right with momentum + snap, one
   page centred with its neighbours peeking off each edge, so the whole thing fits one
   screen with the buy button beneath (no vertical scroll). */
.booklet-view { height: 100vh; height: 100dvh; }
.booklet-h { font-size: 22px; margin: var(--sp-1) 0 var(--sp-1); }
.booklet-view .book-meta { margin: 0 0 var(--sp-2); }
.booklet-track { flex: 1; min-height: 0; display: flex; align-items: center; gap: var(--sp-3);
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    scroll-padding-inline: 11vw; padding: var(--sp-2) 11vw; margin: 0 calc(-1 * var(--app-pad-x)); scrollbar-width: none; }
.booklet-track::-webkit-scrollbar { display: none; }
/* The real book is 10×10in, so pages are SQUARE — sized by width (fits the screen with
   neighbours peeking), and a touch shorter than the track so there's a gap to the button. */
.booklet-track .bk-page { position: relative; flex: 0 0 auto; height: 100%; width: auto; aspect-ratio: 1 / 1;
    max-width: min(82vw, 400px); max-height: min(82vw, 400px); scroll-snap-align: center; border-radius: 12px; border: 1px solid var(--hair); overflow: hidden;
    box-shadow: 0 2px 6px rgba(46, 59, 50, 0.06), 0 22px 48px -24px rgba(46, 59, 50, 0.4);
    padding: var(--sp-6); display: flex; flex-direction: column; }
.booklet-track .pg-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.booklet-track .bk-cover { align-items: center; justify-content: center; text-align: center; gap: 10px; }

/* DEV-ONLY banner (SMS dry-run). Injected at the top of .app by auth.php only in
   a non-production environment — a loud, unmissable strip so it's never silent. */
.dev-banner {
    background: #8a3527; color: #fff;
    font-family: var(--sans); font-size: 11px; font-weight: 600;
    letter-spacing: 0.03em; line-height: 1.4; text-align: center;
    padding: 7px 12px; border-radius: 8px; margin: 0 0 var(--sp-4);
}
/* Demo-mode bar (admin with the toggle on). Calm green — it's a valid mode, not an
   error — and replaces the dev bar. */
.demo-banner {
    background: var(--green); color: #fff;
    font-family: var(--sans); font-size: 11px; font-weight: 600;
    letter-spacing: 0.03em; line-height: 1.4; text-align: center;
    padding: 7px 12px; border-radius: 8px; margin: 0 0 var(--sp-4);
}
.demo-banner a { color: #fff; text-decoration: underline; }
/* DEV-ONLY: the surfaced contributor links on the vault (dry-run testing). */
.dev-links {
    border: 1px dashed #b98a80; background: rgba(138, 53, 39, 0.05);
    border-radius: 12px; padding: 10px 14px; margin: 0 0 var(--sp-4);
    font-family: var(--sans); font-size: 14px;
}
.dev-links-head {
    font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
    color: #8a3527; margin: 0 0 6px;
}
.dev-links-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.dev-links-row a { color: #8a3527; font-weight: 500; text-decoration: none; }

.resp-pending {
    display: flex; align-items: center; gap: var(--sp-3);
    border: 1px dashed var(--hair-strong);
    border-radius: var(--r-card);
    padding: var(--sp-4) var(--sp-5);
    color: var(--ink-faint);
    margin-bottom: var(--sp-4);
}
.resp-pending .avatar { width: 36px; height: 36px; font-size: 14px; }
.resp-pending .person-name { color: var(--ink-muted); }
.resp-pending .clock { margin-left: auto; }

/* ---- Keepsake — composed passages -------------------------- */
.keepsake {
    background: var(--paper);
    border: 1px solid var(--hair);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: var(--sp-8) var(--sp-7);
}
.keepsake-motif { margin: 0 0 var(--sp-5); }
.keepsake-eyebrow {
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mint-deep);
    text-align: center;
    margin: 0 0 var(--sp-8);
}
.passage { margin: 0; }
.passage + .passage {
    margin-top: var(--sp-7);
    padding-top: var(--sp-7);
    border-top: 1px solid var(--hair);
}
.passage-text {
    font-family: var(--sans);
    font-size: 18px;
    line-height: 1.72;
    letter-spacing: 0.002em;
    color: var(--ink);
    margin: 0;
}
.passage-by {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-top: var(--sp-5);
}
.passage-by::before {
    content: "";
    width: 22px; height: 1px;
    background: var(--mint);
    flex: 0 0 auto;
}
.keepsake-mark {
    font-family: var(--sans);
    font-weight: 500;
    letter-spacing: 0.30em;
    text-transform: lowercase;
    color: var(--ink-faint);
    text-align: center;
    margin-top: var(--sp-8);
    padding-left: 0.30em;
}

/* ---- Home ---------------------------------------------------*/
.vault-hero {
    background: var(--mint-tint);
    border: 1px solid var(--hair);
    border-radius: var(--r-card);
    padding: var(--sp-6);
    margin-bottom: var(--sp-4);
}
.vault-hero .smallcaps { color: var(--mint-deep); margin-bottom: var(--sp-3); }
.vault-hero .h2 { color: var(--ink); margin-bottom: var(--sp-4); }
.stack-avatars { display: flex; align-items: center; }
.stack-avatars .mini {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--paper); color: var(--mint-deep);
    display: grid; place-items: center;
    font-family: var(--sans); font-weight: 500; font-size: 13px;
    margin-left: -8px; border: 1px solid var(--hair-strong);
}
.stack-avatars .mini:first-child { margin-left: 0; }
.stack-label { margin-left: var(--sp-3); font-size: 14px; color: var(--ink-muted); }

.action-row {
    display: flex; align-items: center; gap: var(--sp-4);
    background: var(--paper);
    border: 1px solid var(--hair);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-sm);
    padding: var(--sp-5);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s ease, transform 0.05s ease;
}
.action-row:hover { border-color: var(--hair-strong); }
.action-row:active { transform: translateY(1px); }
.action-row + .action-row { margin-top: var(--sp-3); }
.action-title { font-family: var(--sans); font-weight: 500; font-size: 16px; }
.action-sub { font-size: 14px; color: var(--ink-muted); margin-top: 2px; }

.add-icon {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--mint-tint);
    color: var(--mint-deep);
    display: grid; place-items: center;
    flex: 0 0 auto;
}

.tabbar {
    display: flex; justify-content: space-around;
    border-top: 1px solid var(--hair);
    /* full-bleed to the device edges (cancel the app's side padding) and down to
       the screen bottom, with the labels kept above the home indicator. */
    margin-top: var(--sp-6);
    margin-left: calc(-1 * (var(--app-pad-x) + env(safe-area-inset-left)));
    margin-right: calc(-1 * (var(--app-pad-x) + env(safe-area-inset-right)));
    margin-bottom: calc(-1 * (var(--sp-6) + env(safe-area-inset-bottom)));
    padding: var(--sp-4) 0 calc(var(--sp-4) + env(safe-area-inset-bottom));
    color: var(--ink-faint);
    font-family: var(--sans);
    font-size: 11.5px;
    letter-spacing: 0.04em;
    text-align: center;
}
.tabbar .tab { flex: 1; padding: 4px 0; min-height: 44px; }
.tabbar .tab.active { color: var(--ink); }
.tabbar .tab span { display: flex; justify-content: center; margin-bottom: var(--sp-1); color: inherit; }

/* ---- Booklet option select --------------------------------- */
.option {
    display: flex; align-items: center; gap: var(--sp-4);
    background: var(--paper);
    border: 1px solid var(--hair);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-sm);
    padding: var(--sp-4) var(--sp-5);
}
.option.selected { border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-tint), var(--shadow-sm); }
.option .add-icon { border-radius: 11px; }
.option .grow { flex: 1; }
.option .radio {
    width: 20px; height: 20px; border-radius: 50%;
    border: 1.5px solid var(--hair-strong); flex: 0 0 auto;
}
.option.selected .radio { border-color: var(--mint-deep); background: var(--mint-deep); box-shadow: inset 0 0 0 4px var(--paper); }

.price { font-family: var(--sans); font-size: 20px; font-weight: 500; color: var(--ink); }

/* ---- Inline SVG icons -------------------------------------- */
.check svg { width: 22px; height: 22px; }
.add-icon svg { width: 22px; height: 22px; }
.tabbar .tab span svg { width: 22px; height: 22px; }
.pill svg { width: 14px; height: 14px; }
.topbar-right svg { width: 22px; height: 22px; }
.notice-card .icon svg { width: 21px; height: 21px; }
.resp-pending .clock svg { width: 18px; height: 18px; color: var(--ink-faint); }

/* ---- Share bar (keepsake) ---------------------------------- *
   A conventional grouped social share control; the physical-keepsake button is
   a separate element beneath it. */
.sharebar {
    display: flex; align-items: center; gap: var(--sp-4);
    background: var(--paper);
    border: 1px solid var(--hair);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-sm);
    padding: var(--sp-3) var(--sp-5);
    margin-bottom: var(--sp-4);
}
.sharebar-label {
    font-family: var(--sans); font-size: 12.5px; font-weight: 500;
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint);
}
.sharebar-icons { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.share-icon {
    width: 44px; height: 44px; border-radius: 50%; border: none;
    background: var(--mint-tint); color: var(--mint-deep);
    display: grid; place-items: center; cursor: pointer;
    transition: background 0.18s ease, transform 0.05s ease;
}
.share-icon:hover { background: var(--mint-tint2); }
.share-icon:active { transform: translateY(1px); }
.share-icon svg { width: 20px; height: 20px; }
.sharebar.done .sharebar-label { color: var(--mint-deep); }

/* ---- Share sheet (keepsake, legacy) ------------------------ */
.share-wrap { position: relative; }
.share-sheet {
    position: absolute; left: 0; right: 0; bottom: calc(100% + 10px);
    background: var(--paper);
    border: 1px solid var(--hair);
    border-radius: var(--r-card);
    box-shadow: var(--shadow);
    padding: var(--sp-2);
    display: none;
}
.share-sheet.open { display: block; animation: fade 0.2s ease; }
.share-sheet .share-head {
    font-family: var(--sans);
    font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-faint); padding: var(--sp-3) var(--sp-3) var(--sp-2);
}
.share-opt {
    display: flex; align-items: center; gap: var(--sp-3); width: 100%;
    background: transparent; border: none; cursor: pointer;
    padding: var(--sp-3); border-radius: 11px;
    font-family: var(--sans); font-size: 15px; color: var(--ink); text-align: left;
}
.share-opt:hover { background: var(--mint-tint); }
.share-opt .si { width: 34px; height: 34px; border-radius: 9px; background: var(--mint-tint);
    color: var(--mint-deep); display: grid; place-items: center; flex: 0 0 auto; }
.share-opt .si svg { width: 19px; height: 19px; }

/* ---- Booklet: a photorealistic dark hardback --------------- */
.book-stage {
    position: relative;
    perspective: 1900px;
    display: flex;
    justify-content: center;
    padding: var(--sp-8) 0 var(--sp-7);
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.book-stage.fading { opacity: 0; transform: scale(0.96) translateY(4px); pointer-events: none; }
/* soft, layered ground shadow so the book sits in space */
.book-stage::after {
    content: "";
    position: absolute;
    left: 50%; bottom: 34px;
    width: 215px; height: 30px;
    transform: translateX(-42%);
    background: radial-gradient(ellipse at center, rgba(46, 59, 50, 0.30), rgba(46, 59, 50, 0) 70%);
    filter: blur(7px);
    z-index: 0;
}
.book {
    --w: 200px; --h: 216px; --d: 46px;
    position: relative;
    width: var(--w); height: var(--h);
    transform-style: preserve-3d;
    transform: rotateY(-32deg) rotateX(6deg);
    transition: transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
    z-index: 1;
    cursor: pointer;
}
.book:hover { transform: rotateY(-23deg) rotateX(5deg); }
.book__cover, .book__back {
    position: absolute; inset: 0;
    border-radius: 2px 5px 5px 2px;
}
.book__cover {
    transform: translateZ(calc(var(--d) / 2));
    background: linear-gradient(135deg, #3C4C3E 0%, #303C32 50%, #28332A 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05),
                inset 0 1px 0 rgba(255, 255, 255, 0.10);
    display: flex; flex-direction: column; align-items: center;
    padding: 22px 18px; overflow: hidden;
    color: #E9ECE3;
}
.book__cover::before { /* binding shadow at the spine edge */
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 18px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0));
}
.book__cover::after { /* light sheen + highlight on the cover */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(118deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 22%, rgba(255, 255, 255, 0) 44%),
        radial-gradient(130% 80% at 80% -12%, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 60%);
}
.book__back {
    transform: translateZ(calc(var(--d) / -2));
    background: linear-gradient(135deg, #2C382E, #222C24);
}
.book__pages { /* fore-edge — a real block of stacked cream pages */
    position: absolute; top: 3px; height: calc(100% - 6px);
    left: 100%; width: var(--d);
    transform-origin: left center;
    transform: translateZ(calc(var(--d) / -2)) rotateY(90deg);
    background: repeating-linear-gradient(90deg, #F5F2E9 0 1px, #E2DCCB 1px 2.3px, #F5F2E9 2.3px 3.3px);
    box-shadow: inset 0 3px 4px rgba(0, 0, 0, 0.16), inset 0 -3px 4px rgba(0, 0, 0, 0.16);
    border-radius: 0 2px 2px 0;
}
.book__spine { /* bound edge on the left */
    position: absolute; top: 3px; height: calc(100% - 6px);
    right: 100%; width: var(--d);
    transform-origin: right center;
    transform: translateZ(calc(var(--d) / -2)) rotateY(-90deg);
    background: linear-gradient(180deg, #34432F 0%, #28332A 50%, #34432F 100%);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.45);
}
/* cover detailing — foil-like flourish + calligraphic title */
.bk-frame { position: absolute; inset: 13px; border: 1px solid rgba(201, 183, 136, 0.32); border-radius: 2px; pointer-events: none; }
.bk-mark {
    position: relative; z-index: 2; margin-top: 4px;
    font-family: var(--sans); font-size: 11px; font-weight: 500;
    letter-spacing: 0.34em; text-transform: lowercase; color: var(--green);
    padding-left: 0.34em;
}
.bk-center { position: relative; z-index: 2; margin: auto 0; text-align: center; }
.bk-flourish { display: block; width: 72px; height: 14px; margin: 0 auto; }
.bk-flourish path { stroke: #C9B788; stroke-width: 1; fill: none; }
.bk-flourish circle { fill: #C9B788; }
.bk-title {
    font-family: var(--book-serif); font-style: italic; font-size: 19px;
    line-height: 1.2; color: #C9B788; margin: 11px 0 7px;
}
.bk-for {
    font-family: var(--sans); font-size: 10px; font-weight: 500;
    letter-spacing: 0.2em; text-transform: uppercase; color: var(--green);
}
.book-meta {
    text-align: center;
    font-family: var(--sans); font-size: 13px; color: var(--ink-muted);
    margin-top: var(--sp-3);
}
.book-hint {
    text-align: center;
    font-family: var(--sans); font-size: 12.5px; letter-spacing: 0.02em; color: var(--ink-faint);
    margin-top: var(--sp-3);
}

/* ---- Booklet: open double-page spread ---------------------- */
.open-wrap { display: none; }
.open-wrap.open { display: block; padding-top: var(--sp-4); animation: bookOpen 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.open-wrap.closing { animation: bookClose 0.42s ease both; }
@keyframes bookOpen { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes bookClose { from { opacity: 1; } to { opacity: 0; transform: translateY(8px) scale(0.99); } }
.open-close {
    display: block; margin: 0 auto var(--sp-4);
    background: transparent; border: none; cursor: pointer;
    font-family: var(--sans); font-size: 13px; font-weight: 500;
    letter-spacing: 0.04em; color: var(--ink-faint);
}
/* The open spread: near-square pages (≈340×380 in the reference) shown two-up,
   so it reads clearly wider than tall — a real hardback opened flat. */
.open-book {
    position: relative;
    width: 100%; max-width: 340px; margin: 0 auto;
    aspect-ratio: 1.79 / 1;
    perspective: 2200px;
    transform-style: preserve-3d;
    box-shadow: 0 26px 46px -22px rgba(35, 48, 42, 0.40);
    border-radius: 4px;
}
/* Single flat sage→cream wash + faint paper grain (from the reference). */
.bk-page, .ff {
    background: linear-gradient(160deg, #dfe9e0 0%, #FCFBF6 46%, #FCFBF6 100%);
    overflow: hidden;
}
.bk-page::before, .ff::before {
    content: ""; position: absolute; inset: 0; z-index: 0; opacity: .5;
    mix-blend-mode: multiply; pointer-events: none;
    background-image:
        repeating-linear-gradient(94deg, rgba(120,110,90,.025) 0 2px, transparent 2px 5px),
        repeating-linear-gradient(2deg, rgba(120,110,90,.02) 0 3px, transparent 3px 7px);
}
.bk-page {
    position: absolute; top: 0; height: 100%; width: 50%;
    backface-visibility: hidden;
}
.page-left  { left: 0;   border-radius: 4px 0 0 4px; box-shadow: inset -16px 0 28px -20px rgba(35,48,42,.45); cursor: pointer; }
.page-right { left: 50%; border-radius: 0 4px 4px 0; box-shadow: inset 16px 0 28px -20px rgba(35,48,42,.45); cursor: pointer; }

.flipper { position: absolute; top: 0; height: 100%; width: 50%; transform-style: preserve-3d; display: none; z-index: 3; }
.flipper.show { display: block; }
.flipper.right { left: 50%; transform-origin: left center; }
.flipper.left  { left: 0;   transform-origin: right center; }
.flipper.animate { transition: transform 0.62s cubic-bezier(0.42, 0, 0.2, 1); }
.ff { position: absolute; inset: 0; backface-visibility: hidden;
      box-shadow: inset 16px 0 28px -20px rgba(35,48,42,.4), inset -16px 0 28px -20px rgba(35,48,42,.4); }
.ff-back { transform: rotateY(180deg); }

/* The name gets its OWN reserved band at the top. The copy sits in a body area
   below that band and above the page number, vertically centred with the motif
   in-flow above/below it — so a motif can never collide with the name. */
.pg-name {
    position: absolute; top: 22px; left: 0; right: 0; z-index: 2; text-align: center;
    font-family: "Schibsted Grotesk", var(--sans); font-size: 8px; font-weight: 600;
    letter-spacing: .22em; text-transform: uppercase; color: var(--green); opacity: .7;
}
.pg-body {
    position: absolute; left: 9%; right: 9%; top: 48px; bottom: 34px; z-index: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
}
.pg-copy { font-family: var(--book-serif); font-weight: 400; color: #23302a; font-size: 12px; line-height: 1.62; margin: 0; }
.pg-copy.em { font-style: italic; }
.pg-num {
    position: absolute; bottom: 15px; left: 0; right: 0; z-index: 2; text-align: center;
    font-family: var(--book-serif); font-style: italic; font-size: 9px; color: #9aa69e;
}
/* small green motif, in the body above (snippet open) or below (snippet close)
   the line — clear of the name's reserved band. */
.pg-motif { color: var(--green); line-height: 0; }
.pg-motif svg { width: 14px; height: 14px; display: block; opacity: .82; fill: currentColor; }
.pg-motif.top { margin-bottom: 10px; }
.pg-motif.bot { margin-top: 8px; }
/* Section heading: replaces the top motif on the first page of a prompt section
   (a quiet green chapter label in the book's small-cap voice). */
.pg-heading {
    font-family: "Schibsted Grotesk", var(--sans); font-size: 9px; font-weight: 600;
    letter-spacing: .2em; text-transform: uppercase; color: var(--green);
    margin-bottom: 14px; line-height: 1.3;
}

/* Landscape divider: a single-line scene spanning the full spread across the
   gutter (left half on the left page, right half on the right page), sitting
   low with generous bare paper above (reference lines_v2). */
.pg-landscape { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; line-height: 0; }
.pg-landscape svg { width: 100%; height: auto; display: block; }
.pg-landscape.left svg  { margin-right: -1px; }   /* close the gutter seam */
.pg-landscape.right svg { margin-left: -1px; }

/* intro / title page (reference) */
.pg-wordmark { font-family: "Schibsted Grotesk", var(--sans); font-weight: 600; letter-spacing: .40em; font-size: 12px; color: #46604f; text-transform: lowercase; padding-left: .40em; }
.pg-rule { width: 30px; height: 1px; background: #46604f; opacity: .5; margin: 15px 0; }
.pg-introlead { font-family: var(--book-serif); font-weight: 400; font-style: italic; font-size: 16px; color: #23302a; line-height: 1.5; }
.pg-introfor { font-family: "Schibsted Grotesk", var(--sans); font-weight: 600; letter-spacing: .22em; font-size: 8.5px; color: #46604f; margin-top: 16px; }

/* ---- Motion ------------------------------------------------ */
.fade-in { animation: fade 0.45s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
