/* The product's pages. Colours, spacing and type come from tokens.css; the base buttons and cards from style.css. Each shelf wears one era colour, set once on [data-era] and used by everything inside. */
body.app { margin: 0; background: var(--ground); color: var(--brand-text-color); font: var(--brand-text); min-height: 100dvh; }   /* the brand's text: Rubik, regular weight, 18px, black ink */
body.app.elder { font-size: 19px; }
.app .wrap { width: min(100% - 32px, 600px); margin-inline: auto; padding-bottom: var(--space-8); }
#stage:focus, .view-title:focus { outline: none; }
.btn.small { min-height: 48px; font-size: 18px; padding: 8px 20px; }
.btn.danger.ghost { color: #a3200f; box-shadow: inset 0 0 0 2px #a3200f; }
.btn.danger:not(.ghost) { background: #a3200f; }
.btn.link { background: none; color: var(--ink-soft); text-decoration: underline; font-weight: 600; font-size: 18px; min-height: 48px; }
.app .btn { width: 100%; }
.app .btn.small { width: auto; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 72px; padding: 12px 0; }
.sync { display: inline-flex; align-items: center; font-size: 16px; font-weight: 700; padding: 6px 14px; border-radius: 999px; background: var(--raised); box-shadow: inset 0 0 0 2px var(--line-soft); color: var(--ink-soft); margin-inline-start: auto; }
.sync::before { content: ""; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 8px; background: #2e7d4f; flex: none; }
.sync[data-state=busy]::before { background: var(--haley-tie); }
.sync[data-state=wait]::before { background: #a3200f; }


.live { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.live > [hidden] { display: none !important; }
.live:has(> [hidden]:nth-child(1)):has(> [hidden]:nth-child(2)):has(> [hidden]:nth-child(3)) { display: none; }
.status { margin: 0; min-height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 4px 18px; font-size: 18px; border-radius: 999px; font-weight: 800; color: #fff; }
.status::before { content: ""; flex: none; width: 24px; height: 24px; background: center / contain no-repeat; }
#stage[data-mode=speaking] .status { background: var(--action); }
#stage[data-mode=speaking] .status::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4z' fill='white'/%3E%3Cpath d='M16 8.5a5 5 0 0 1 0 7M18.5 6a8.5 8.5 0 0 1 0 12' stroke='white' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
#stage[data-mode=listening] .status { background: var(--rec); }
#stage[data-mode=listening] .status::before { border-radius: 50%; animation: pulse 1.4s ease-out infinite; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3' fill='white'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E"); }
#stage[data-mode=paused] .status { background: var(--ink-soft); }
#stage[data-mode=paused] .status::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='5' width='4' height='14' rx='1' fill='white'/%3E%3Crect x='14' y='5' width='4' height='14' rx='1' fill='white'/%3E%3C/svg%3E"); }
.timer { margin: 0; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.note { min-height: 1.4em; margin: 0 0 var(--space-1); font-size: 18px; color: var(--ink-soft); text-align: center; }

#view { display: grid; gap: var(--space-2); }
#view > * { min-width: 0; }
.view-title { font-size: 30px; line-height: 1.2; font-weight: 800; margin: 0; }
.lead { margin: 0; font-size: 18px; color: var(--ink-soft); }
.hero { margin: 0 auto; }
.shelf-title { font-size: 22px; font-weight: 800; margin: var(--space-2) 0 0; }

[data-era] { --c: var(--era-childhood); --g: var(--era-childhood-glow); }
[data-era=era-early] { --c: var(--era-early); --g: var(--era-early-glow); }
[data-era=era-roots] { --c: var(--era-roots); --g: var(--era-roots-glow); }
[data-era=era-teens] { --c: var(--era-teens); --g: var(--era-teens-glow); }
[data-era=era-legacy] { --c: var(--era-legacy); --g: var(--era-legacy-glow); }
[data-era=era-today] { --c: var(--era-today); --g: var(--era-today-glow); }
[data-era=era-leaving] { --c: var(--era-leaving); --g: var(--era-leaving-glow); }
[data-era=era-family] { --c: var(--era-family); --g: var(--era-family-glow); }
[data-era=era-middle] { --c: var(--era-middle); --g: var(--era-middle-glow); }
[data-era=era-work] { --c: var(--era-work); --g: var(--era-work-glow); }
[data-era=era-love] { --c: var(--era-love); --g: var(--era-love-glow); }
[data-era=era-later] { --c: var(--era-later); --g: var(--era-later-glow); }

.kicker { display: block; font-size: 17px; font-weight: 800; color: var(--ink-soft); }
.q { display: block; margin: 0; font-weight: 800; line-height: 1.35; }
.suggest { width: 100%; text-align: start; background: var(--g); border: 0; border-inline-start: 10px solid var(--c); border-radius: 24px; padding: 20px; box-shadow: var(--shadow-raised); display: grid; gap: 10px; font: inherit; color: var(--ink); cursor: pointer; }
.suggest .q { font-size: 26px; }
.suggest .go { justify-self: start; background: var(--action); color: var(--on-action); border-radius: 999px; padding: 10px 26px; font-weight: 800; }
.shelves { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 330px) { .shelves { grid-template-columns: 1fr; } }
.shelf { background: var(--g); border: 0; border-block-start: 8px solid var(--c); border-radius: 20px; padding: 14px 16px 16px; min-height: 116px; text-align: start; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; font: inherit; color: var(--ink); cursor: pointer; }
.shelf .name { font-weight: 800; font-size: 20px; line-height: 1.25; }
.shelf .of { font-size: 17px; color: var(--ink-soft); }
.shelf-page { display: grid; gap: var(--space-2); }
.chapters { display: grid; gap: 12px; }
.chapter { text-align: start; background: var(--g); border: 0; border-inline-start: 8px solid var(--c); border-radius: 18px; padding: 16px 18px; font: inherit; color: var(--ink); display: grid; gap: 8px; cursor: pointer; }
.chapter .q { font-size: 21px; font-weight: 700; }
.chapter.has { background: var(--raised); box-shadow: inset 0 0 0 2px var(--c); }
.chip { justify-self: start; font-size: 16px; font-weight: 800; padding: 2px 12px; border-radius: 999px; }
.chip.ok { color: #1f5c38; background: #dff3e6; }
.question { background: var(--g); border-radius: 24px; border-inline-start: 10px solid var(--c); padding: 20px 22px; }
.question .q { font-size: 28px; margin-top: 6px; }
.seg { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--raised); border-radius: 18px; padding: 12px 16px; box-shadow: var(--shadow-raised); }
.seg span { flex: 1 1 100%; font-weight: 700; }

.rec-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rec-actions .big { grid-column: 1 / -1; }
.rec-actions > :last-child { grid-column: 1 / -1; }
.rec-actions .btn { padding-inline: 12px; }
.followup { background: var(--tint); border-radius: 20px; padding: 16px 18px; display: grid; gap: 8px; }
.followup .q { font-size: 24px; }
.together { margin: 0; font-size: 18px; color: var(--ink-soft); text-align: center; }
.drawer { display: grid; gap: 12px; }
.fu { text-align: start; background: var(--raised); border: 2px solid var(--line-soft); border-radius: 18px; padding: 14px 18px; font: inherit; color: var(--ink); display: grid; gap: 4px; cursor: pointer; }
.fu .q { font-size: 21px; font-weight: 700; }
.drawer audio, #view audio { width: 100%; }

/* making a book */
.hero-book { text-align: center; padding: var(--space-2) 0 var(--space-3); display: grid; justify-items: center; gap: 8px; }
.hero-book h1 { margin: 0; }
.check label { font-weight: 600; font-size: 18px; }
#made h3 { margin: var(--space-3) 0 4px; font-size: 22px; }
#made input[type=text] { margin-top: 8px; font-size: 16px; }
#made .btn { margin-top: 8px; }

/* the family's book */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair .btn { font-size: 18px; padding-inline: 12px; }
.shelf-name { font-size: 24px; font-weight: 800; margin: var(--space-3) 0 0; padding-inline-start: 14px; border-inline-start: 8px solid var(--c); }
.chapter .meta { font-size: 17px; font-weight: 600; color: var(--ink-soft); }
.track { position: relative; height: 22px; border-radius: 999px; background: var(--g, var(--line-soft)); box-shadow: inset 0 0 0 2px var(--line-soft); cursor: pointer; margin-top: 8px; }
.track .fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; border-radius: 999px; background: var(--c, var(--action)); pointer-events: none; }
.track .mark { position: absolute; top: -6px; width: 10px; height: 34px; margin-inline-start: -5px; border-radius: 5px; background: var(--ink); pointer-events: none; }
.clock { margin: 0; text-align: center; font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 700; }
.marks { display: grid; gap: 10px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.photo { position: relative; padding: 0; border: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 1; background: var(--line-soft); cursor: pointer; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .when { position: absolute; inset-block-end: 6px; inset-inline-start: 6px; background: rgba(45, 41, 38, .8); color: #fff; font-size: 15px; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.lightbox { position: fixed; inset: 0; z-index: 10; background: rgba(30, 32, 70, .94); display: grid; grid-template-rows: 1fr auto; gap: 16px; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; border-radius: 12px; }
.saves { display: grid; gap: 10px; margin-top: var(--space-2); }
.top.bar { padding-block: 16px; justify-content: flex-end; }   /* the logo on the left, as on the first-story pages */

/* text pages */
.doc { padding-block: var(--space-3) var(--space-8); font-size: 18px; line-height: 1.7; }
.doc h1 { font-size: 34px; }
.doc h2 { font-size: 24px; margin: var(--space-4) 0 8px; }

/* The look of the landing page: Rubik for the interface, Frank Ruhl Libre for the questions and for what Haley says, warm rounded cards with a soft shadow, the orange used for one word of a headline. */
body.app { font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
h1, h2, .view-title { letter-spacing: -0.01em; text-wrap: balance; }
.accent { color: var(--accent-ink); }
.q, .bubble p, .followup .q { font-family: var(--font-sans); font-weight: 700; }   /* the questions and what Haley says use the same rounded face as the rest, as in the app design */
.suggest .q { font-size: 29px; line-height: 1.32; }
.question .q { font-size: 31px; line-height: 1.32; }
.chapter .q { font-size: 22px; line-height: 1.4; }
.fu .q, .followup .q { font-size: 23px; line-height: 1.4; }
.bubble p { font-size: 24px; line-height: 1.45; }
.suggest, .question, .seg, .shelf, .chapter, .followup, .card, .bubble { box-shadow: 0 2px 0 rgba(45, 41, 38, .04), 0 10px 28px rgba(45, 41, 38, .08); }
.suggest, .question { border-radius: 28px; }
.shelf { border-radius: 24px; }

/* the sun: the warm rounded card with a character in it, as on the landing page */
.sun { position: relative; overflow: hidden; border-radius: 32px; background: radial-gradient(circle at 50% 78%, var(--sky-3) 0 30%, var(--sky-2) 30% 52%, var(--sky-1) 52%); display: flex; justify-content: center; align-items: flex-end; gap: 6px; min-height: 210px; padding: 24px 16px 0; isolation: isolate; }   /* flat concentric bands, no gradient, no glow: depth comes from shapes overlapping */
.sun img { height: 190px; width: auto; max-width: 46%; object-fit: contain; }
.sun.small { min-height: 150px; } .sun.small img { height: 130px; }
.sun.crew { padding-inline: 0; gap: 0; direction: ltr; }   /* the family: Grandpa, Haley between them, Grandma */
.sun.crew img { height: auto; width: 34%; max-width: 34%; }
.sun.crew .mid { width: 27%; max-width: 27%; margin-inline: -1%; }
.hero-book { text-align: start; padding: var(--space-2) 0 var(--space-3); display: grid; justify-items: stretch; gap: 12px; }
.hero-book h1 { font-size: clamp(28px, 8vw, 36px); line-height: 1.12; font-weight: 800; margin: 8px 0 0; }
.hero-book .lead { font-size: 18px; text-wrap: pretty; }
.speeds { display: flex; gap: 10px; justify-content: center; }
.btn[aria-pressed=true] { background: var(--action); color: var(--on-action); }

/* family questions */
.owner-panel { display: grid; gap: 12px; }
.owner-panel .view-title { font-size: 24px; }
.owner-panel input[type=text] { font-size: 16px; }
.askers { display: grid; gap: 10px; }
.shelves .shelf-title { grid-column: 1 / -1; margin-top: var(--space-2); }

/* "Your life": the wheel of time, ported from the app design (haley/design/app/app.css). The wheel sits at the left edge, the told chapter on the right. */
.hl-disc { flex: none; box-sizing: border-box; width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 4px solid var(--g); }
.era-tag { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 800; color: var(--ink-soft); }
.focus { display: grid; gap: 10px; align-content: start; }
.focus-year { margin: 0; font-size: 44px; line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
.focus-title { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 800; }
.life-phone { position: relative; min-height: 640px; overflow-x: clip; }
.life-phone .focus { width: calc(100% - 100px); min-height: 504px; }
.life-pic { border-radius: 24px; overflow: hidden; background: var(--g); min-height: 150px; display: grid; }
.life-pic .sun { border-radius: 24px; min-height: 150px; box-shadow: none; }
.life-photo { width: 100%; height: 100%; max-height: 260px; object-fit: cover; }
.life-nav { margin-top: var(--space-2); }
.life-phone > .btn, .life-phone .life-nav .btn { width: 100%; }
.arc { position: absolute; top: 0; left: -20px; width: 116px; height: 520px; overflow: hidden; outline: none; border-radius: 0 var(--radius-tile) var(--radius-tile) 0; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%); }
.arc:focus-visible { box-shadow: inset 0 0 0 3px var(--focus); -webkit-mask-image: none; mask-image: none; }
.arc-track { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--line-soft); stroke-width: 3; pointer-events: none; }
.arc-item { position: absolute; right: 10px; top: 226px; width: 44px; height: 44px; border: 0; background: none; padding: 0; cursor: inherit; transform-origin: 22px 22px; will-change: transform; -webkit-tap-highlight-color: transparent; }
.arc-item .hl-disc { display: block; width: 44px; height: 44px; border-width: 7px; transition: box-shadow 200ms ease; }
.arc-item.is-on .hl-disc { box-shadow: 0 0 0 4px var(--ground), 0 0 0 7px var(--ink); }
.arc-year { position: absolute; top: 100%; left: 50%; margin-top: 4px; transform: translateX(-50%); font-size: 15px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.arc-item.is-on .arc-year { margin-top: 9px; color: var(--ink); font-weight: 900; }
.focus.is-later > *, .focus.is-earlier > * { animation: hl-in 420ms ease both; }
@keyframes hl-in { from { opacity: 0; transform: translateY(var(--from, 10px)); } to { opacity: 1; transform: none; } }
.focus.is-earlier { --from: -10px; }
.views { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: var(--space-2); }
.views .btn { width: 100%; }

.owner-panel > summary { cursor: pointer; list-style: none; }
.owner-panel > summary::-webkit-details-marker { display: none; }
.owner-panel > summary::after { content: ' ▾'; color: var(--ink-soft); }
.owner-panel[open] > summary::after { content: ' ▴'; }
.owner-panel[open] > summary { margin-bottom: 12px; }

/* Haley's place on the older person's pages, as on the app design's Home: the sky with Haley in it, and what she says on a white plate that overlaps its lower edge. */
.home-sky { margin: 0 0 var(--space-3); }
.home-sky .sky { position: relative; height: 236px; border-radius: 32px; overflow: hidden; container-type: size; display: grid; place-items: end center;
  background: radial-gradient(circle at 50% 70%, var(--sky-3) 0 38cqmin, var(--sky-2) 38cqmin 58cqmin, var(--sky-1) 58cqmin 80cqmin, color-mix(in srgb, var(--sky-1) 80%, #fff) 80cqmin); box-shadow: 0 18px 40px rgba(249, 160, 62, .28); }
.home-sky .sky img { width: 150px; height: auto; margin-bottom: 40px; transform-origin: 50% 90%; }   /* her face stays above the plate */
#stage.speaking .home-sky .sky img { animation: bob 1.6s ease-in-out infinite; }
.home-sky .plate { position: relative; margin: -34px 12px 0; padding: 16px 20px; min-height: 76px; display: flex; align-items: center; border-radius: 24px; background: var(--raised); box-shadow: 0 2px 0 rgba(45, 41, 38, .04), 0 12px 28px rgba(45, 41, 38, .1); }
.home-sky .plate p { margin: 0; font: var(--brand-text); color: var(--brand-text-color); text-wrap: balance; }   /* what Haley says: the brand's text, not bold */
@media (max-height: 720px) { .home-sky .sky { height: 150px; } .home-sky .sky img { width: 92px; margin-bottom: 30px; } }
input[type=password], textarea, input[type=file] { width: 100%; min-height: 56px; padding: 10px 16px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--raised); color: var(--ink); font: 500 19px var(--font-sans); }
textarea { font-size: 16px; min-height: 80px; }
input[type=file] { padding: 14px 12px; font-size: 16px; }
.card ul { padding-inline-start: 0; list-style: none; }
.card li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.card li input[type=checkbox] { width: 26px; height: 26px; flex: none; margin-top: 3px; accent-color: var(--action); }

/* Aligned with the first-story pages and the app design: white cards with the barely-there shadow token, the era shown by a small disc (the way chapters are drawn in the app design), never a thick coloured border or a tinted slab with text on it. */
.suggest, .question, .seg, .shelf, .chapter, .followup, .card, .bubble { box-shadow: var(--shadow-raised); }
.suggest, .question, .shelf, .chapter { position: relative; background: var(--raised); border: 0; }
.suggest::before, .question::before, .shelf::before, .chapter::before { content: ''; position: absolute; inset-block-start: 12px; inset-inline-end: 12px; width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%; background: var(--c); border: 4px solid var(--g); }
.shelf { min-height: 108px; padding-inline-end: 36px; }
.chapter { padding-inline-end: 40px; }
.suggest, .question { padding-inline-end: 44px; }
.home-sky .sky { box-shadow: none; }
.home-sky .plate { border-radius: 26px; box-shadow: var(--shadow-raised); }
.home-sky .sky { background: radial-gradient(circle at 50% 70%, var(--sky-3) 0 38cqmin, var(--sky-2) 38cqmin 58cqmin, var(--sky-1) 58cqmin); }   /* three flat bands to the corners, no pale fourth ring */

/* the "book is ready" screen: one card for each link, one main thing to do in it; keeping options in a quiet card; the copy message floats at the bottom of the screen */
#made .link-card h3, #made .keep-card h3 { margin: 0 0 4px; font-size: 20px; line-height: 1.25; }
#made .link-card .small, #made .keep-card .small { margin: 0 0 12px; }
.link-row { display: grid; gap: 8px; margin-top: 12px; }
.link-row input[type=text] { margin: 0; }
.link-row .btn { justify-self: start; margin-top: 0; }
.keep-card { background: var(--tint); box-shadow: none; }
.keep-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.keep-actions .btn { width: 100%; margin-top: 0; }
#copied { position: sticky; bottom: 12px; z-index: 2; margin: 0; padding: 10px 16px; border-radius: 16px; background: var(--raised); box-shadow: var(--shadow-raised); color: var(--ink); }
#copied:empty { display: none; }

/* a phone's home bar and notch never cover the main button or the message */
.panel > .btn.wide, #copied { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.app .wrap { padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom, 0px)); }

/* the personal area */
.account-card h3 { margin: 0 0 4px; font-size: 20px; line-height: 1.25; }
.account-card .small { margin: 0 0 10px; }
.account-card .code { margin-bottom: 10px; }
.chip-note { margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: var(--tint); font-size: 16px; }

/* the owner's launch check: each line says its level in words, the colour only adds to it */
.launch-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.launch-list > li { padding: 10px 14px; border-radius: 14px; background: #f3efe9; border-inline-start: 6px solid #8a8079; }
.launch-list > li.launch-ok { border-inline-start-color: #2f7d4a; }
.launch-list > li.launch-warn { border-inline-start-color: #b36b00; }
.launch-list > li.launch-fail { border-inline-start-color: #a3200f; }
.launch-list ul { margin: 6px 0 0; padding-inline-start: 20px; }
