/* Bible Loom · Your stories (reading paths), from Atelier's design (design/paths.css, design/PATHS.md). Loaded after theme.css, style.css and people-places.css.
   Every rule uses the app's own theme variables: no new colours, pills use --r-pill, hover changes colour only,
   reduced motion turns the one transition off. The markup reuses .card, .h-cont, .h-now, .eyebrow, .bar-line, .pill,
   .btn, .list, .nrow, .hub-h, .info-q / .info-tip, .pp-sec (people-places.css) and the Big Story loom (.rd-loom / .pring). */

/* ================= Home · Your paths =================
   Top of Home, where Continue was: one window (section.card.pa) holding the path you are in (today's Continue card,
   .h-cont, drawn without its own frame), your other paths as short rows, + Add a path and Finished (folded).
   Today's Reading row (.h-now) goes: a story opened off your paths stays open in Read. */
.home .pa { margin-top: 24px; padding: 0; overflow: hidden; }
.home .h-left > .notice + .pa { margin-top: 12px; }
.pa .h-cont, .pa > .pa-done { margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }   /* the window is the frame */
/* built like The Big Story so Home reads as one: a section.h-sec with its h2.section-h heading, then the window as a
   plain .card (the same fill, edge and radius as the loom's card in every style). Nothing inside it is tinted, so the
   whole window is one colour. */
.h-sec > .pa { margin-top: 0; }
/* Papyrus: Home is one colour. style.css already sets the tiles (.h-pair .card) and Search (.h-find) see-through, ink
   lines on the page; the window and The Big Story's card follow, so no section is a lighter patch of paper.
   (Space and Bloom already give every Home card the same fill.) THIS ALSO CHANGES THE BIG STORY CARD: move the
   .loom-band half into style.css beside the .h-pair rule. */
[data-style="papyrus"] .home :is(.pa, .loom-band) { background: transparent; }
.pa .h-cont .cv-foot { background: transparent; }
.pa > :is(.pa-list, .pa-add, .pa-fin) { border-top: 1px solid var(--sep); }
.pa-foot :is(.pa-add, .pa-fin) { border-top: 0; }
.pa > .pa-done + .pa-list { border-top-color: var(--edge); }
.pa-in { position: relative; }                              /* the path you are in: a.h-cont and its ⋯ side by side, never nested */
.pa-in > .pa-more { position: absolute; top: 5px; right: 6px; z-index: 1; }
.pa-in .h-cont .cv-top { padding-right: 52px; min-height: 26px; }
.pa-in .h-cont .cv-top .eyebrow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* inside the window the card is shorter than today's Continue card (247px → about 190px): two lines of the opening,
   title and reference on one line (the reference drops under a long title), a smaller go button */
.pa-in .h-cont .cv-top { padding-top: 12px; }
.pa-in .h-cont .teaser { margin-top: 6px; -webkit-line-clamp: 2; }
.pa-in .h-cont .cv-foot { margin-top: 10px; padding: 9px 10px 10px 18px; }
.pa-in .h-cont .tt { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.pa-in .h-cont .tt h2 { flex: 0 1 auto; min-width: 0; max-width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-in .h-cont .tt .ref { flex: none; }
.pa-in .h-cont .tt .where { flex: 1 0 100%; margin-top: 5px; }
.pa-in .h-cont .go { width: 44px; height: 44px; }
/* "again" beside a path's name (a path started as Read it again) */
.pa-again { display: inline-flex; align-items: center; gap: 3px; flex: none; font-size: .74rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.pa-again svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ⋯ : one per path (Rename · Start again · Remove) */
.pa-more { flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-pill); background: none; color: var(--muted); cursor: pointer; }
.pa-more svg { width: 20px; height: 20px; fill: currentColor; }
.pa-more:hover, .pa-more[aria-expanded="true"] { color: var(--text); background: color-mix(in srgb, var(--surface2) 60%, transparent); }

/* the other paths: ONE line each (name · next story · count, then ⋯); the thin progress line is the row's bottom
   edge, in place of the separator, so a row is 46px. */
.pa-item { position: relative; display: flex; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--sep); }
.pa-item:last-child { border-bottom: 0; }
.pa-item > .pa-more { margin-right: 6px; }
.pa-row {
  flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 10px;
  min-height: 60px; padding: 10px 2px 11px 18px; color: var(--text); text-decoration: none;
}
.pa-row > :first-child { grid-column: 1; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pa-row b { min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-row.one { display: flex; align-items: baseline; gap: 10px; min-height: 46px; padding: 0 0 0 18px; align-content: center; flex-wrap: nowrap; }
.pa-row.one { align-items: center; }
.pa-row.one > :first-child { flex: 0 1 auto; max-width: 48%; }
.pa-row.one .nx { flex: 1 1 0; margin: 0; }
.pa-row.one .pn { flex: none; }
.pa-item:has(> .pa-row.one > .bar-line) { border-bottom: 0; }
.pa-row.one .bar-line { position: absolute; left: 18px; right: 18px; top: 44px; height: 2px; margin: 0; }
/* in a one-line row "again" is just its ↻ (the word stays on the big card); the label is kept for screen readers */
.pa-row.one .pa-again, [data-style] .pa-row.one .pa-again { font-size: 0; gap: 0; letter-spacing: 0; color: var(--text); }
.pa-row.one .pa-again svg { width: 14px; height: 14px; }
.pa-row .pn { grid-row: 2; grid-column: 2; font-size: .78rem; font-weight: 700; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }   /* 3/96, at the end of the next-story line */
.pa-row .nx { grid-row: 2; grid-column: 1; margin-top: 1px; font-size: .86rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-row .nx.wait { color: var(--accent); font-weight: 700; }   /* a finished path waiting for a choice: "Finished · What next?" */
.pa-row .bar-line { grid-column: 1 / -1; flex: none; height: 3px; margin-top: 7px; }
a.pa-row:hover b { color: var(--accent); }
div.pa-row { cursor: default; }
/* + Add a path and Finished share the window's last row (.pa-foot): Add on the left, Finished ›  on the right.
   Opening Finished drops its list under that row, full width. */
.pa-foot { position: relative; border-top: 1px solid var(--sep); }
.pa-foot > .pa-add { width: auto; position: relative; z-index: 1; }
.pa-foot:has(> .pa-fin) > .pa-add { position: absolute; top: 0; left: 0; }
.pa-foot > .pa-fin > summary { justify-content: flex-end; min-height: 48px; }
.pa-foot > .pa-fin > summary::after { margin-left: 2px; }
/* + Add a path */
.pa-add { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 0 18px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.pa-add svg { width: 18px; height: 18px; margin-left: -1px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.pa-add:hover { background: color-mix(in srgb, var(--surface2) 55%, transparent); }
/* Finished: folded, at the foot of the window */
.pa-fin > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px 0 18px; list-style: none; cursor: pointer; font-size: .9rem; font-weight: 800; color: var(--muted); }
.pa-fin > summary::-webkit-details-marker { display: none; }
.pa-fin > summary .n { font-weight: 700; }
.pa-fin > summary::after { content: ""; width: 7px; height: 7px; margin: 0 14px 0 auto; border: solid currentColor; border-width: 0 2px 2px 0; rotate: -45deg; transition: rotate var(--t-pop); }
.pa-fin[open] > summary::after { rotate: 45deg; translate: 0 -2px; }
.pa-fin > summary:hover { color: var(--text); }
.pa-fin > .pa-list { border-top: 1px solid var(--sep); }
.pa-fin .pa-row { min-height: 52px; }

/* ⋯ opens a row of three pills under the path, in the page (nothing floats over anything, so nothing is hidden).
   Home only: never while reading. Tap ⋯ again, or anywhere else, to fold it. */
.pa-menu { box-sizing: border-box; flex: 0 0 100%; min-width: 0; display: flex; gap: 6px; padding: 0 12px 12px 18px; }
.pa-in > .pa-menu { padding-top: 2px; }
.pa-menu .pill { flex: 1 1 auto; min-width: 0; min-height: 40px; padding-inline: 8px; justify-content: center; gap: 5px; white-space: nowrap; }
.pa-menu .pill svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pa-menu .pill.danger { color: var(--accent2); }
/* Rename: the name becomes a field in place; Enter or tapping away keeps it */
.pa-name-in { width: 100%; min-height: 36px; margin: -4px 0; padding: 4px 10px; border: 1px solid var(--accent); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font: inherit; font-weight: 800; }
.pa-name-in:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

/* ================= First visit: Where would you like to start? =================
   The same window, asking: three suggestions (from the welcome question) as rows, then Or choose a book… */
.pa-ask { display: flex; align-items: center; margin: 0; padding: 16px 18px 12px; font-size: 1.2rem; line-height: 1.2; }
.pa-ask + .info-tip { margin: -6px 18px 12px; }
.pa > .pa-ask + .pa-list, .pa > .info-tip + .pa-list { border-top: 1px solid var(--sep); }
.pa-row .lead { grid-row: 2; grid-column: 1; margin-top: 1px; font-size: .86rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-row .go-c { align-self: center; grid-row: 1 / span 2; grid-column: 2; width: 38px; height: 38px; display: grid; place-items: center; margin-right: 10px; border: 1px solid var(--edge); border-radius: var(--r-pill); color: var(--accent); }
/* first-visit rows: two short lines and a 36px go, about 56px a row */
.pa-row:has(.lead) { min-height: 56px; padding-block: 7px 8px; }
.pa-row .go-c { width: 36px; height: 36px; }
.pa-row .go-c svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pa-item:first-child .go-c { background: var(--sel-bg); color: var(--accent-ink); border-color: var(--accent); }
a.pa-row:hover .go-c { border-color: var(--accent); }

/* ================= Welcome, step 2: one question (the setup screen, .loom.setup) =================
   Five answers as rows; one tap finishes setup and opens Home. Skip is the last row's quiet twin. */
.ob-q { margin-top: 4px; }
.ob-q .nrow { min-height: 60px; }
.ob-q .nrow .chev { color: var(--muted); font-size: 1.4rem; line-height: 1; }
.ob-skip { display: block; width: 100%; min-height: 48px; margin-top: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.ob-skip:hover { color: var(--text); }
.ob-steps { display: inline-flex; gap: 5px; margin-left: 8px; vertical-align: 1px; }
.ob-steps i { width: 6px; height: 6px; border-radius: 50%; background: var(--sep); }
.ob-steps i.on { background: var(--accent); }

/* ================= Finished · What next? =================
   The same card at the end of the last story's text (in the flow, not over it) and in the path's place on Home. */
.pa-done { padding: 14px 0 0; overflow: hidden; color: var(--text); font-family: var(--font-ui); font-size: 1rem; line-height: 1.4; text-align: left; }
.pa-done .pd-top { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 6px 0 18px; }
.pa-done .pd-top .eyebrow { margin: 0; }
.pa-done .pd-top .pa-more { margin-left: auto; margin-block: -6px; }
.pa-done h2 { display: flex; align-items: center; gap: 8px; margin: 2px 18px 0; font-size: 1.3rem; line-height: 1.15; }
.pa-done h2 svg { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pa-done .pd-sub { margin: 3px 18px 0; font-size: .9rem; color: var(--muted); }
.pa-done .pd-q { margin: 12px 18px 5px; font-size: .78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pd-ladder { border-top: 1px solid var(--sep); }
.pd-step { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 12px 6px 18px; border: 0; border-bottom: 1px solid var(--sep); background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.pd-step .nt { flex: 1; min-width: 0; }
.pd-step .nt b { display: block; font-weight: 800; line-height: 1.25; }
.pd-step .nt span { display: block; margin-top: 1px; font-size: .84rem; line-height: 1.3; color: var(--muted); }   /* may wrap: what is left matters */
/* the size of each step, as three small bars: one, two or three lit */
.pd-step .sz { flex: none; display: flex; align-items: flex-end; gap: 2px; width: 16px; height: 16px; }
.pd-step .sz i { flex: 1; border-radius: 1px; background: var(--sep); }
.pd-step .sz i:nth-child(1) { height: 6px; } .pd-step .sz i:nth-child(2) { height: 11px; } .pd-step .sz i:nth-child(3) { height: 16px; }
.pd-step .sz i.on { background: var(--accent); }
.pd-step .go { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--edge); border-radius: var(--r-pill); color: var(--accent); }
.pd-step .go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pd-step:first-child .go { background: var(--sel-bg); color: var(--accent-ink); border-color: var(--accent); }   /* the smallest step leads */
.pd-step:hover .nt b { color: var(--accent); }
.pd-acts { display: flex; gap: 6px; padding: 8px 10px 10px; }
.pd-acts .pill { flex: 1 1 auto; min-width: 0; min-height: 40px; padding-inline: 8px; justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* at the end of the text, in the Bible pane */
.bible-col > .pa-done { margin: 30px 0 28px; }
/* inside a bigger path, finishing a book gets one quiet line at the end of the text */
.pa-quiet { display: flex; align-items: center; gap: 10px; margin: 30px 0 40px; font-family: var(--font-ui); font-size: .84rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.pa-quiet::before, .pa-quiet::after { content: ""; flex: 1; height: 1px; background: var(--sep); }
.pa-quiet svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ================= Add a path (a hub page, opened from Home) ================= */
.ap-h { margin: 18px 2px 8px; }
.ap-h > span { flex: none; white-space: nowrap; }   /* heading and its ? stay on one line */
.ap .list { margin-bottom: 0; }
.ap .nrow[aria-pressed] .ok { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.ap .nrow[aria-pressed="true"] { background: var(--accent-soft); }
.ap .nrow[aria-pressed="true"] .ok { visibility: visible; }
.ap .nrow .rc { flex: none; font-size: .78rem; font-weight: 700; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
/* the eight parts: two columns, each with its colour from the Big Story */
.ap-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ap-parts [style*="--k"] { --pc: color-mix(in oklch longer hue, var(--jesus) calc(100% - var(--k) * 100% / 7), var(--god)); }
.ap-part { display: grid; grid-template-columns: 9px minmax(0, 1fr); column-gap: 9px; align-items: center; min-height: 54px; padding: 7px 10px; border: 1px solid var(--edge); border-radius: var(--r-item); background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ap-part .pd { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); }
.ap-part b { font-size: .92rem; font-weight: 800; line-height: 1.15; }   /* may take two lines (Wisdom and poetry) */
.ap-part span { grid-column: 2; font-size: .74rem; color: var(--muted); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-part:hover b { color: var(--accent); }
.ap-part[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
/* books, folded by part (the .pp-sec folds from people-places.css); a second tap on a later book makes a run */
.ap-books { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 2px 12px; }
.ap-bk { display: inline-flex; align-items: center; gap: 4px; min-height: 38px; padding: 0 12px; border: 1px solid var(--edge); border-radius: var(--r-pill); background: var(--panel); color: var(--text); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; }
.ap-bk:hover { border-color: color-mix(in srgb, var(--text) 35%, transparent); }
.ap-bk .tk { width: 13px; height: 13px; fill: none; stroke: var(--muted); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }   /* every story in it read */
.ap-bk.in { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--edge)); }          /* inside a run */
.ap-bk.end { background: var(--sel-bg); color: var(--accent-ink); border-color: var(--accent); }                          /* the book tapped, or a run's two ends */
.ap-bk.end .tk { stroke: currentColor; }
/* the choice so far, and Start: a footer of the hub pane, after .hub-body (like .hub-head before it), so the list
   scrolls above it and never under it. Shown only once something is chosen. */
.ap-foot { flex: none; padding: 10px 18px 12px; border-top: 1px solid var(--edge); background: var(--panel); }
.ap-foot .t { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ap-foot .t b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-foot .t span { flex: none; font-size: .84rem; color: var(--muted); white-space: nowrap; }
.ap-foot .acts { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ap-foot .switch { flex: 1; min-width: 0; min-height: 44px; white-space: nowrap; }
.ap-foot .btn { flex: none; min-height: 46px; padding: 0 26px; }
.ap-foot .info-tip { margin: 2px 0 0; }
.ap-have { margin-left: auto; flex: none; font-size: .74rem; font-weight: 800; color: var(--accent); white-space: nowrap; }   /* "Your path" on a choice you already have */

/* ================= The Big Story: the path you are in =================
   A soft bracket just outside the rim over the path's books (an arc at r 127.5, clear of the dot's halo at r 124.5 and
   inside the 260 viewBox), or, for a one-book path, its spoke lit. The Whole Bible has none (it would ring everything). */
.rd-loom .pbr { fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; opacity: .45; }
.rd-loom .w.lit { stroke: var(--text); stroke-width: 3.2; }
.pring .rd-loom .pt .w.lit { stroke: var(--pc); stroke-width: 3.4; }
.lb-key .k-path { width: 14px; height: 8px; margin-right: 6px; border: 2px solid var(--text); border-bottom: 0; border-radius: 8px 8px 0 0; opacity: .55; vertical-align: 1px; }
.lb-key .k-spoke { width: 3px; height: 12px; margin: 0 8px 0 3px; border-radius: 2px; background: var(--text); vertical-align: -1px; }

/* ================= the three styles ================= */
[data-style="papyrus"] .pa-row b, [data-style="papyrus"] .pd-step .nt b { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; }
[data-style="papyrus"] .ap-part b { font-family: var(--font-display); font-weight: 600; font-size: 1.04rem; }
[data-style="papyrus"] .pa-done h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; }
[data-style="papyrus"] :is(.pa-fin > summary, .pa-done .pd-q, .pa-add, .pa-again, .ap-have, .ob-skip) { font-family: var(--font-label); font-weight: 500; text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; }
[data-style="papyrus"] .pa-add { font-size: .74rem; }
[data-style="papyrus"] .pa-row .bar-line { height: 2px; }
[data-style="papyrus"] :is(.pa-done, .ap-part:not([aria-pressed="true"])) { background: transparent; }
[data-style="papyrus"] .ap-bk:not(.in, .end) { background: transparent; }
[data-style="papyrus"] .pa-ask { font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; }
[data-style="space"] :is(.pa-fin > summary, .pa-done .pd-q, .pa-add, .ap-have, .ob-skip) { font-weight: 500; text-transform: lowercase; letter-spacing: 0; }
[data-style="space"] :is(.pa-row b, .pd-step .nt b, .ap-part b, .ap-bk) { font-weight: 500; }
[data-style="space"] :is(.pa-done h2, .pa-ask) { font-weight: 500; }
[data-style="space"] .pa-item:first-child .go-c, [data-style="space"] .ob-steps i.on { background: var(--text); border-color: var(--text); }
[data-style="space"] .pa-row .bar-line { height: 2px; }
[data-style="space"] .pd-step .sz i.on, [data-style="space"] .pa-quiet svg, [data-style="space"] .pa-done h2 svg { background: var(--text); stroke: var(--text); }
[data-style="space"] .pd-step .sz i.on { background: var(--text); }
[data-style="space"] :is(.pa-done, .ap-part:not([aria-pressed="true"]), .ap-bk:not(.in, .end)) { background: transparent; }
[data-style="space"] .ap-part[aria-pressed="true"] { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); background: var(--accent-soft); }

@media (prefers-reduced-motion: reduce) { .pa-fin > summary::after { transition: none; } }
