/* Story screens (3 Oct 2026) — see js/story.js */
.st { padding-bottom: 24px; }
.st-loading, .st-empty { text-align: center; padding: 80px 24px; color: var(--color-text-secondary); }
.st-empty-ic { font-size: 36px; } .st-empty p { margin: 6px 0 0; }
.st-spin { display: block; width: 26px; height: 26px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid var(--color-primary-light); border-top-color: var(--color-primary); animation: st-spin 0.9s linear infinite; }
@keyframes st-spin { to { transform: rotate(360deg); } }

.st-hero { background: linear-gradient(160deg, #075E54 0%, #054A42 100%); color: #fff; padding: 22px 18px 20px; margin: -1px 0 0; }
.st-hero-top { display: flex; align-items: center; gap: 12px; }
.st-avatar { width: 54px; height: 54px; flex: none; border-radius: 50%; background: #C9A227; display: flex; align-items: center; justify-content: center; font-size: 24px; border: 3px solid rgba(255,255,255,.35); }
.st-hero-name { flex: 1; min-width: 0; }
.st-hero h1 { margin: 0; font-size: 22px; line-height: 1.2; color: #fff; }
.st-hero small { opacity: .85; font-size: 13px; }
.st-switch { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 10px; padding: 6px 8px; font: inherit; font-size: 13px; max-width: 120px; }
.st-switch option { color: #16231F; }
.st-live { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.14); padding: 5px 11px; border-radius: 99px; font-size: 13px; margin-top: 14px; }
.st-live-quiet { opacity: .85; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; background: #7CF0B0; box-shadow: 0 0 0 3px rgba(124,240,176,.25); }
.st-stats { display: flex; gap: 22px; margin-top: 16px; }
.st-stats b { display: block; font-size: 23px; } .st-stats span { font-size: 12px; opacity: .85; }

.st-sec { padding: 18px 16px 2px; }
.st-top { padding-top: 22px; }
.st-sec h2 { margin: 0 0 10px; font-size: 16px; color: var(--color-text-primary); }
.st-h2-gap { margin-top: 22px !important; }
.st-h1 { margin: 0; font-size: 24px; color: var(--color-text-primary); }
.st-sub, .st-hint { margin: 6px 0 0; color: var(--color-text-secondary); font-size: 14px; line-height: 1.45; }
.st-hint { margin: 0 0 10px; font-size: 13px; }
.st-card { background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.st-soft p { margin: 6px 0 0; color: var(--color-text-secondary); font-size: 14px; line-height: 1.45; }

.st-quote { margin: 0 0 12px; background: #fff; border-radius: 16px; padding: 16px; border-left: 4px solid #C9A227; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.st-quote p { margin: 0; font-family: Georgia, "Noto Serif", serif; font-size: 17px; line-height: 1.5; color: var(--color-text-primary); }
.st-quote small { display: block; margin-top: 8px; color: var(--color-text-muted); font-size: 12px; }

.st-moment { display: flex; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--color-border); text-decoration: none; color: inherit; }
.st-moment:last-child { border-bottom: none; }
.st-ic { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--color-primary-tint-bg); display: flex; align-items: center; justify-content: center; }
.st-moment p { margin: 0; font-size: 14px; line-height: 1.35; } .st-moment small { color: var(--color-primary); font-size: 12px; font-weight: 600; }

.st-next { background: #FBF5DF; border-radius: 16px; padding: 15px; }
.st-next-lbl { font-size: 11.5px; color: #7A5F12; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.st-next p { margin: 6px 0 4px; font-size: 16px; font-weight: 600; line-height: 1.4; }
.st-next small { color: #6b5a26; font-size: 13px; display: block; }
.st-btns { display: flex; gap: 8px; margin-top: 12px; }
.st-btn { flex: 1; text-align: center; padding: 11px; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 600; background: #fff; border: 1px solid var(--color-border-strong); color: var(--color-text-primary); text-decoration: none; cursor: pointer; }
.st-btn-p { background: var(--color-primary); color: #fff; border: none; }
.st-btn:disabled { opacity: .55; }
.st-btn-wide { flex: none; width: 100%; padding: 14px; font-size: 16px; }
.st-link { background: none; border: none; color: var(--color-primary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }

.st-ribbon { display: flex; overflow-x: auto; padding: 6px 2px 10px; scroll-snap-type: x mandatory; }
.st-era { min-width: 128px; max-width: 150px; position: relative; padding-top: 26px; scroll-snap-align: start; }
.st-era:before { content: ""; position: absolute; top: 11px; left: 0; right: 0; height: 3px; background: var(--color-border); }
.st-yr { position: absolute; top: 0; left: 0; font-size: 11px; color: var(--color-text-muted); font-weight: 700; }
.st-era > .st-pin { position: absolute; top: 5px; left: 34px; }
.st-pin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: #075E54; border: 3px solid #fff; box-shadow: 0 0 0 1px #075E54; vertical-align: middle; }
.st-pin-heard { background: #C9A227; box-shadow: 0 0 0 1px #C9A227; }
.st-pin-gap { background: #fff; box-shadow: 0 0 0 1px #B8B2A7; }
.st-era p { margin: 0; font-size: 13px; line-height: 1.35; padding-right: 10px; } .st-era em { display: block; color: var(--color-text-muted); font-style: normal; font-size: 11.5px; }
.st-gap { color: #9aa29e; font-style: italic; }
.st-legend { color: var(--color-text-muted); font-size: 11.5px; }

.st-chap { background: #fff; border-radius: 16px; overflow: hidden; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.st-band { min-height: 74px; padding: 14px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }
.st-band-0 { background: linear-gradient(120deg, #0B7A6C, #054A42); } .st-band-1 { background: linear-gradient(120deg, #C9A227, #8C6E1A); } .st-band-2 { background: linear-gradient(120deg, #7B8C86, #4E5C57); }
.st-band span { font-size: 11px; opacity: .9; letter-spacing: .05em; text-transform: uppercase; } .st-band b { font-size: 18px; }
.st-chap-body { padding: 14px 14px 4px; font-family: Georgia, "Noto Serif", serif; font-size: 15px; line-height: 1.6; color: var(--color-text-primary); }
.st-chap-body p { margin: 0 0 10px; }
.st-chap-meta { display: flex; justify-content: space-between; align-items: center; padding: 0 14px 12px; font-size: 12px; color: var(--color-text-muted); }

.st-tree { background: #fff; border-radius: 16px; padding: 14px 10px; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.st-gen-lbl { text-align: center; font-size: 11px; color: var(--color-text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.st-gen-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.st-vline { width: 2px; height: 14px; background: var(--color-border); margin: 8px auto; }
.st-person { width: 104px; padding: 9px 6px; border-radius: 12px; background: var(--color-primary-tint-bg); font: inherit; font-size: 12px; line-height: 1.3; text-align: center; border: none; color: var(--color-text-primary); }
.st-person b { display: block; font-size: 13px; text-transform: capitalize; } .st-person span { display: block; color: var(--color-text-secondary); text-transform: capitalize; }
.st-person em { display: block; font-style: normal; color: var(--color-text-muted); font-size: 11px; margin-top: 3px; }
.st-self { background: #075E54; color: #fff; } .st-self span, .st-self em { color: rgba(255,255,255,.85); }
.st-unknown { background: #fff; border: 1.5px dashed #C9C2B6; color: #8b928f; cursor: pointer; } .st-unknown em { color: var(--color-primary); font-weight: 600; }

.st-ta { width: 100%; box-sizing: border-box; min-height: 74px; border: 1.5px solid var(--color-border); border-radius: 12px; padding: 11px; font: inherit; font-size: 15px; line-height: 1.45; background: #FCFBF8; resize: vertical; }
.st-ta:focus { outline: none; border-color: var(--color-primary); background: #fff; }
.st-ta-tall { min-height: 130px; }
.st-chips-lbl { font-size: 12px; color: var(--color-text-muted); margin: 10px 0 6px; font-weight: 600; }
.st-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.st-chip { font: inherit; font-size: 13px; padding: 7px 11px; border-radius: 99px; background: var(--color-primary-tint-bg); color: #054A42; border: 1px solid transparent; cursor: pointer; text-align: left; }
.st-chip-on { background: #075E54; color: #fff; }
.st-qlist { list-style: none; margin: 12px 0 0; padding: 0; }
.st-qlist li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--color-border); font-size: 14.5px; line-height: 1.4; }
.st-qlist li span { flex: 1; } .st-qlist small { display: block; color: var(--color-text-muted); font-size: 12px; }
.st-done span { color: var(--color-text-muted); } .st-done small { color: #356048; }
.st-x { background: none; border: none; color: var(--color-text-muted); font-size: 16px; cursor: pointer; padding: 2px 6px; }
.st-save { padding: 18px 0 6px; text-align: center; } .st-save span { display: block; margin-top: 8px; font-size: 13px; color: #356048; }
.st-fix summary { cursor: pointer; list-style: none; } .st-fix summary::-webkit-details-marker { display: none; }
.st-fix summary small { display: block; color: var(--color-text-muted); font-size: 12.5px; margin-top: 2px; }
.st-fix-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; } .st-fix-row span { color: var(--color-text-muted); }
.st-in { min-height: 46px !important; }
.st-listen { margin-top: 10px; background: var(--color-primary-tint-bg); color: #054A42; border: none; border-radius: 99px; padding: 8px 14px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.st-lock { font-size: 11px; font-weight: 700; background: #FBF5DF; color: #7A5F12; padding: 3px 8px; border-radius: 99px; vertical-align: middle; margin-left: 6px; }
.st-toggle { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; } .st-toggle input { width: 22px; height: 22px; accent-color: #075E54; }

/* ---- 4 Oct 2026: vertical timeline, tree, sheets, nudge, book ---- */
.st-tlist { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.st-tlist:before { content: ""; position: absolute; left: 58px; top: 8px; bottom: 8px; width: 2px; background: var(--color-border); }
.st-tl { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; position: relative; }
.st-tl-yr { width: 46px; flex: none; text-align: right; font-weight: 700; font-size: 13px; color: var(--color-text-secondary); padding-top: 2px; }
.st-tl-dot { width: 14px; height: 14px; flex: none; margin-top: 3px; border-radius: 50%; background: #075E54; border: 3px solid var(--color-bg-canvas); box-shadow: 0 0 0 1px #075E54; position: relative; z-index: 1; }
.st-tl div { flex: 1; background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.st-tl p { margin: 0; font-size: 15px; line-height: 1.4; } .st-tl small { color: var(--color-text-muted); font-size: 12.5px; }
.st-tl-heard .st-tl-dot { background: #C9A227; box-shadow: 0 0 0 1px #C9A227; }
.st-tl-gap .st-tl-dot { background: #fff; box-shadow: 0 0 0 1px #B8B2A7; }
.st-tl-gap div { background: transparent; border: 1.5px dashed #CFC8BC; box-shadow: none; } .st-tl-gap p { color: #7d8580; font-style: italic; }
.st-link-v { width: 2px; height: 18px; background: #A8D5C8; margin: 6px auto; }
.st-person { cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.st-face { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #075E54; font-weight: 800; font-size: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; box-shadow: 0 0 0 2px #A8D5C8; }
.st-self .st-face { background: #C9A227; color: #fff; box-shadow: none; }
.st-unknown .st-face { box-shadow: 0 0 0 2px #D9D2C5; color: #9a9a9a; }
.st-gen-others { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--color-border); }
.st-sheet-bg { position: fixed; inset: 0; background: rgba(10,20,18,.45); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
.st-sheet { background: var(--color-bg-canvas); width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 10px 18px 22px; box-shadow: 0 -8px 30px rgba(0,0,0,.2); }
.st-sheet-grip { width: 44px; height: 5px; border-radius: 9px; background: #CFC8BC; margin: 0 auto 12px; }
.st-sheet h2 { margin: 0; font-size: 21px; } .st-sheet h3 { font-size: 14px; margin: 16px 0 6px; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.st-facts { margin: 0; padding-left: 18px; line-height: 1.5; }
.st-lbl { display: block; font-size: 13px; color: var(--color-text-secondary); margin-top: 10px; } .st-lbl input { margin-top: 4px; }
.st-nudge { margin-top: 16px; width: 100%; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 12px; padding: 12px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.st-book { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.st-book-ic { font-size: 30px; } .st-book b { display: block; } .st-book small { color: var(--color-text-secondary); font-size: 13px; }
.st-bar { display: block; height: 8px; border-radius: 9px; background: #EEE9E0; overflow: hidden; margin-top: 8px; width: 100%; min-width: 180px; } .st-bar i { display: block; height: 100%; background: #C9A227; }
/* Top bar overflowed on phones (4 Oct 2026): tighten controls under 420px. */
@media (max-width: 420px) {
  .top-bar { padding-left: 12px !important; padding-right: 12px !important; gap: 8px; }
  .top-bar .brand { font-size: 17px; }
  .top-bar-controls { gap: 6px !important; }
  .text-size-toggle button, .lang-toggle button { min-width: 30px !important; padding: 4px 6px !important; }
}
.st-switch-row { display: flex; justify-content: flex-end; margin: -6px 0 10px; }
.st-switch-row .st-switch { max-width: 60%; }
.st-stats b { font-size: 20px; white-space: nowrap; } .st-stats > div { min-width: 0; }
.st-more { padding: 6px 0 0; display: block; }
@media (max-width: 420px) {
  .text-size-toggle { display: none !important; }   /* lives under More on small phones */
  .st-stats { gap: 16px; } .st-stats b { font-size: 18px; }
}
.st-person .st-born { text-transform: none; }
.st-sizes { display: flex; gap: 8px; }
.st-del { margin-left: 10px; font-size: 12.5px; color: var(--color-text-muted); }
.join-steps { padding-left: 20px; line-height: 1.6; font-size: 16px; } .join-steps li { margin-bottom: 8px; }
.join-btns { display: flex; gap: 10px; margin-top: 12px; } .join-btns .btn { flex: 1; text-align: center; text-decoration: none; }
/* Photos & documents (premium) */
.st-up-form { margin-top: 12px; display: grid; gap: 8px; }
.st-up-list { margin-top: 12px; display: grid; gap: 10px; }
.st-up-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 12px; background: rgba(7,94,84,.05); }
.st-up-thumb { width: 64px; height: 64px; flex: none; border-radius: 10px; background: #fff; display: grid; place-items: center; font-size: 28px; overflow: hidden; }
.st-up-thumb img { width: 100%; height: 100%; object-fit: cover; }
.st-up-meta { min-width: 0; } .st-up-meta b { display: block; } .st-up-meta small { color: #667; }
.st-up-acts { display: flex; gap: 14px; margin-top: 4px; } .st-up-acts .st-link { background: none; border: 0; padding: 0; cursor: pointer; }
.st-premium { margin-top: 16px; padding-top: 14px; border-top: 1px dashed rgba(7,94,84,.25); }
.st-premium h3 { font-size: 16px; margin: 0 0 6px; }

/* ---------- Welcome / sign-in screen (17 Oct 2026) ---------- */
body.obw-page { background: linear-gradient(180deg, #075E54 0%, #075E54 300px, #FAF6EC 300px); }
.obw-shell .onboarding-header { display: none; }
.obw-shell { background: transparent !important; box-shadow: none !important; }
.obw { max-width: 460px; margin: 0 auto; padding: 36px 16px 32px; }
.obw-hero { text-align: center; color: #fff; padding-bottom: 22px; }
.obw-logo { display: block; margin: 0 auto; width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 8px 26px rgba(0,0,0,.28); }
.obw-title { font-family: Georgia, "Times New Roman", serif; font-size: 40px; margin: 14px 0 2px; color: #fff; letter-spacing: .5px; }
.obw-tag { margin: 0; color: #F3DE9A; font-size: 17px; }
.obw-card { background: #fff; border-radius: 22px; padding: 26px 22px 20px; box-shadow: 0 10px 40px rgba(5,74,66,.18); }
.obw-h2 { font-family: Georgia, serif; color: #075E54; font-size: 23px; line-height: 1.3; margin: 0 0 16px; text-align: center; }
.obw-points { list-style: none; margin: 0 0 22px; padding: 0; }
.obw-points li { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #F0EADB; font-size: 15.5px; line-height: 1.45; color: #2b3a36; }
.obw-points li:last-child { border-bottom: none; }
.obw-points b { color: #1d2b28; }
.obw-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; background: #E8F3F0; display: grid; place-items: center; font-size: 19px; }
.obw-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 15px 18px; font-size: 17px; font-weight: 600; color: #1f1f1f; background: #fff; border: 1.5px solid #DADCE0; border-radius: 999px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: box-shadow .15s, background .15s; }
.obw-google:hover { background: #F8FAF9; box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.obw-google:disabled { opacity: .7; cursor: default; }
.obw-small { text-align: center; color: #6b7a76; font-size: 14px; margin: 12px 0 0; }
.obw-legal { text-align: center; color: #6b7a76; font-size: 13px; margin: 18px 8px 0; }
.obw-legal a { color: #075E54; }

/* ======================================================================
   DESKTOP WEB APP (17 Oct 2026, Sam: "we need a mobile web app and a desktop
   web app"). One responsive app: phones keep the bottom tabs; from 960px the
   tabs become a left sidebar, content gets a wider centred column and
   pop-up sheets become centred dialogs.
   ====================================================================== */
@media (min-width: 960px) {
  body { background: #F3EEE2; }
  .app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
  .app-shell > .top-bar { grid-column: 1 / -1; padding: 14px 28px; }
  .app-shell > .bottom-nav {
    grid-column: 1; grid-row: 2; position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px);
    display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 22px 14px;
    border-top: none; border-right: 1px solid #E4DCCB; background: #FBF8F1; box-shadow: none; bottom: auto; left: auto; right: auto; width: auto;
  }
  .app-shell > .bottom-nav a {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 12px 16px; border-radius: 12px;
    font-size: 16px; font-weight: 600; min-height: 0;
  }
  .app-shell > .bottom-nav a .nav-icon { font-size: 20px; width: 26px; text-align: center; }
  .app-shell > .bottom-nav a[aria-current="page"] { background: #E3F1ED; color: #075E54; }
  .app-shell > .bottom-nav a:hover { background: #EFF5F2; }
  .app-shell > main#view { grid-column: 2; grid-row: 2; width: 100%; max-width: 920px; margin: 0 auto; padding: 18px 36px 48px; }
  .st { padding-bottom: 40px; }
  .st-sec { padding: 22px 0 4px; }
  .st-card { padding: 20px 22px; border-radius: 18px; }
  .st-h1 { font-size: 32px; }
  /* sheets: centred dialog instead of bottom drawer */
  .st-sheet-wrap, .st-overlay { align-items: center !important; }
  .st-sheet { border-radius: 22px; max-width: 560px; }
  /* onboarding steps: a centred card */
  .onboarding-shell:not(.obw-shell) { max-width: 720px; margin: 40px auto; background: #fff; border-radius: 22px; box-shadow: 0 10px 40px rgba(5,74,66,.12); overflow: hidden; }
  /* welcome screen: hero + card side by side */
  body.obw-page { background: linear-gradient(90deg, #075E54 0%, #075E54 50%, #FAF6EC 50%); min-height: 100vh; }
  .obw-shell, .obw-shell .onboarding-body { max-width: none !important; width: 100% !important; margin: 0 !important; padding: 0 !important; border-radius: 0 !important; }
  .obw { max-width: 1120px; min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; column-gap: 96px; align-items: center; align-content: center; padding: 40px 48px; }
  .obw-card { max-width: 460px; width: 100%; justify-self: end; }
  .obw-legal { justify-self: end; max-width: 460px; }
  .obw-hero { text-align: left; padding: 0; }
  .obw-logo { margin: 0; width: 120px; height: 120px; border-radius: 28px; }
  .obw-title { font-size: 64px; margin-top: 22px; }
  .obw-tag { font-size: 22px; }
  .obw-card { padding: 34px 32px 26px; }
  .obw-legal { grid-column: 2; margin-top: 14px; }
}
@media (min-width: 1280px) {
  .app-shell > main#view { max-width: 1000px; }
}

/* Setup step 2 — context before the form (17 Oct 2026) */
.obx-intro { background: #F1F7F5; border: 1px solid #D5E8E3; border-radius: 18px; padding: 18px 18px 8px; margin-bottom: 22px; }
.obx-kicker { margin: 0 0 6px; color: #075E54; font-weight: 600; font-size: 14px; }
.obx-intro h1 { margin: 0 0 8px; }
.obx-steps { margin: 12px 0 8px; padding-left: 22px; } .obx-steps li { margin-bottom: 8px; line-height: 1.45; }
.obx-h2 { font-size: 19px; color: #075E54; margin: 4px 0 12px; }

/* storyteller role */
body.role-storyteller .fam-only, body.role-storyteller a[href="#/guide"], body.role-storyteller a[href="#/family-settings"] { display: none !important; }
