/* APT, Better Care Project by B7 Collective. Copyright (C) 2026 B7 Collective LLC. All rights reserved.
   Design system: DESIGN-STANDARDS.md. Pale green ground, white cards, five color roles (act, now, child, records,
   paperwork), Literata for names and numbers, Atkinson for reading. Friendly shapes: scallop countdowns, blob counts,
   clover avatars, connected button groups, one asymmetric "now" corner per screen, Better Care Project brackets around
   the current step. Window classes: compact <600 (bottom tabs), medium 600-839 (rail), expanded 840+ (rail, hub and
   page side by side), large 1200+. Foldables: book posture splits at the hinge; tabletop puts controls below. */

@font-face { font-family: Literata; src: url(/assets/fonts/literata-latin-wght-normal.woff2) format('woff2'); font-weight: 200 900; font-display: swap; }
@font-face { font-family: Atkinson; src: url(/assets/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }

:root {
  --ink: #1D2A26; --soft: #36443F; --muted: #4D5A55; --faint: #8A9993; --hair: #E1E7E4; --mist: #EEF3F0; --paper: #fff; --bg: #F5F9F7; --bg-2: #EAF2EE;
  --green: #1E6B4F; --green-t: #DCEFE5; --green-ink: #134A36; --forest: #123A2F; --sage: #9CC3B2;
  --gold: #F0B13A; --gold-t: #FFF1CF; --gold-ink: #5E3F00; --gold-deep: #E2A12A;
  --coral: #E2583D; --coral-t: #FCE1D9; --coral-ink: #8F2C17;
  --teal: #157A76; --teal-t: #D5EEEB; --teal-ink: #0D5551;
  --navy: #26446B; --navy-t: #E3EAF4; --navy-ink: #1B3354;
  --kid: var(--coral); --kid-t: var(--coral-t); --kid-ink: var(--coral-ink);
  --fs-12: .75rem; --fs-13: .8125rem; --fs-14: .875rem; --fs-15: .9375rem; --fs-16: 1rem; --fs-17: 1.0625rem; --fs-18: 1.125rem;
  --fs-20: 1.25rem; --fs-22: 1.375rem; --fs-24: 1.5rem; --fs-28: 1.75rem; --fs-34: 2.125rem; --fs-44: 2.75rem; --fs-56: 3.5rem;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px;
  --gutter: 20px; --r-hero: 30px; --r-card: 26px; --r-tile: 22px; --r-btn: 16px;
  --lift: 0 1px 2px rgba(29,42,38,.05), 0 10px 24px -16px rgba(29,42,38,.3);
  --lift-2: 0 2px 6px rgba(29,42,38,.06), 0 24px 44px -24px rgba(29,42,38,.5);
  --ring: 0 0 0 1px var(--hair);
  --ease: cubic-bezier(.2,0,0,1); --ease-in: cubic-bezier(.05,.7,.1,1); --spring: cubic-bezier(.34,1.4,.64,1);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --rail-w: 0px; --list-w: 100%; --nav-h: 76px;
  color-scheme: light;
}
html[data-text="lg"] { font-size: 112.5%; }
html[data-text="xl"] { font-size: 125%; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: Atkinson, system-ui, sans-serif; font-size: var(--fs-17); line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.dark :focus-visible, .cv :focus-visible, .bcp-band :focus-visible { outline-color: #fff; }
span.dg { display: inline !important; margin: 0 !important; }
.dg { font-family: Literata, Georgia, serif; font-variant-numeric: lining-nums; font-feature-settings: "lnum"; }
.serif { font-family: Literata, Georgia, serif; }
.muted { color: var(--muted); }

/* ---------- Shell ---------- */
.app { position: fixed; inset: 0; display: grid; grid-template-columns: var(--rail-w) 1fr; }
.rail { display: none; }
.panes { grid-column: 2; position: relative; display: grid; grid-template-columns: 1fr; min-width: 0; height: 100%; overflow: hidden; }
.pane { position: relative; height: 100%; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; container-type: inline-size; scrollbar-width: thin; }
.pane.detail { display: none; }
.app.show-detail .pane.list { display: none; }
.app.show-detail .pane.detail { display: block; }
.pane-inner { padding: calc(var(--sat) + 8px) 0 calc(var(--nav-h) + 40px + var(--sab)); }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 var(--gutter); }
.hinge-gap { display: none; }
.deco { position: absolute; pointer-events: none; z-index: 0; }
.pane-inner > .wrap { position: relative; z-index: 1; }

/* ---------- Press feedback ---------- */
.press { position: relative; overflow: hidden; transition: transform .14s var(--ease), opacity .14s, background-color .2s, box-shadow .2s; }
.ios .press:active { opacity: .6; }
.android .press:active, .desktop .press:active { transform: scale(.98); }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .12; transform: scale(0); animation: ripple .5s var(--ease) forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
@media (hover: hover) and (pointer: fine) { .press:hover { filter: brightness(.97); } }

/* ---------- Navigation ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; padding: 8px calc(6px + var(--sar)) calc(8px + var(--sab)) calc(6px + var(--sal)); background: #fff; border-radius: 28px 28px 0 0; box-shadow: 0 -8px 24px -14px rgba(29,42,38,.22); }
.tab { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; min-height: 56px; font-size: var(--fs-12); font-weight: 750; color: var(--muted); border-radius: 16px; }
.tab .g { width: 60px; height: 34px; border-radius: 17px; display: grid; place-items: center; transition: background-color .3s var(--ease), border-radius .3s var(--ease); }
.tab .tlab { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] .g { border-radius: 17px 7px 17px 7px; }
.tab[aria-current="page"] svg.i { stroke-width: 2.3; }
.tab.c-today[aria-current="page"] .g { background: var(--green-t); color: var(--green-ink); }
.tab.c-child[aria-current="page"] .g { background: var(--kid-t); color: var(--kid-ink); }
.tab.c-tools[aria-current="page"] .g { background: var(--gold-t); color: var(--gold-ink); }
.tab.c-records[aria-current="page"] .g { background: var(--teal-t); color: var(--teal-ink); }
.tab.c-paperwork[aria-current="page"] .g { background: var(--navy-t); color: var(--navy-ink); }
.tab .kid-dot { width: 24px; height: 24px; }
.rail .mark-link { display: grid; place-items: center; padding: 6px; border-radius: 14px; }
.rail .rail-settings { margin-top: auto; }
.app.show-detail .tabbar { display: none; }

/* ---------- Page tops ---------- */
.topbar { display: flex; align-items: center; gap: var(--s3); min-height: 60px; padding: 6px 0 var(--s3); }
.topbar .grow { flex: 1; min-width: 0; }
.topbar h1, .page-title { font: 500 var(--fs-28)/1.1 Literata, serif; letter-spacing: -.015em; }
.topbar .apt-mark { display: block; }
.topbar-r { display: flex; gap: var(--s2); align-items: center; margin-left: auto; }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(29,42,38,.12); display: grid; place-items: center; color: var(--ink); flex: none; }
.icon-btn.ghost { background: transparent; box-shadow: none; }
.back-btn { width: 48px; height: 48px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(29,42,38,.12); display: grid; place-items: center; flex: none; }
@media (min-width: 840px) and (min-height: 480px) { .detail .back-btn.hub-back { display: none; } }
.kid-pill { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px 0 5px; border-radius: 999px; background: var(--kid-t); color: var(--kid-ink); font-weight: 750; font-size: var(--fs-16); max-width: 52vw; }
.kid-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kid-pill svg.avatar { flex: none; }
.hello { padding: var(--s2) 2px var(--s5); }
.hello h1 { font: 500 var(--fs-34)/1.08 Literata, serif; letter-spacing: -.02em; }
.hello p { font-size: var(--fs-16); color: var(--muted); margin-top: 6px; }
.label { font-size: var(--fs-13); font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: var(--s7) 4px var(--s3); display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.label a, .label button { text-transform: none; letter-spacing: 0; font-size: var(--fs-15); color: var(--green-ink); padding: 12px 4px; margin: -12px -4px; min-height: 48px; display: inline-flex; align-items: center; }
.label:first-child { margin-top: var(--s2); }
.lede { color: var(--muted); font-size: var(--fs-16); margin: -2px 2px var(--s4); max-width: 52ch; }

/* ---------- Surfaces ---------- */
.card { background: #fff; border-radius: var(--r-card); box-shadow: var(--lift); padding: var(--s5); }
.card.flat { box-shadow: var(--ring); }
.card + .card { margin-top: var(--s3); }
.hero { border-radius: var(--r-hero); padding: var(--s6); position: relative; overflow: hidden; }
.hero .k { font-size: var(--fs-13); font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.hero h2 { font: 500 var(--fs-28)/1.12 Literata, serif; letter-spacing: -.015em; margin-top: 6px; }
.hero p.sub { font-size: var(--fs-15); margin-top: 6px; }
.t-green { background: var(--green-t); color: var(--green-ink); }
.t-gold { background: var(--gold-t); color: var(--gold-ink); }
.t-coral, .t-kid { background: var(--kid-t); color: var(--kid-ink); }
.t-teal { background: var(--teal-t); color: var(--teal-ink); }
.t-navy { background: var(--navy-t); color: var(--navy-ink); }
.t-mist { background: var(--mist); color: var(--soft); }
.t-white { background: #fff; color: var(--ink); }
.now { border-radius: 30px 30px 30px 10px !important; }
.tile { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; }
.tile.lg { width: 56px; height: 56px; border-radius: 18px; }
.tile.lg svg.i { width: 26px; height: 26px; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; min-height: 68px; text-align: left; }
.rows { background: #fff; border-radius: var(--r-card); box-shadow: var(--lift); overflow: hidden; }
.rows .row + .row { border-top: 1px solid var(--hair); }
.row .rt { flex: 1; min-width: 0; }
.row .rt > b { display: block; font-size: var(--fs-17); font-weight: 750; line-height: 1.25; }
.row .rt > span { display: block; font-size: var(--fs-15); color: var(--muted); margin-top: 2px; }
.row .chev { color: var(--faint); }
.row .end { font-size: var(--fs-15); color: var(--muted); white-space: nowrap; }
.empty { text-align: center; padding: var(--s7) var(--s5); display: grid; justify-items: center; gap: 6px; }
.empty .tile { margin-bottom: 6px; }
.empty b { font-size: var(--fs-18); }
.empty p { color: var(--muted); font-size: var(--fs-15); max-width: 34ch; }
.empty-a { margin-top: var(--s3); }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-15); color: var(--soft); background: #fff; border-radius: 16px; padding: 12px 14px; }
.note svg.i { margin-top: 2px; color: var(--muted); }
.note.on-tint { background: rgba(255,255,255,.75); }
.fine { font-size: var(--fs-14); color: var(--muted); margin: var(--s4) 4px 0; }

/* ---------- Buttons ---------- */
.btn { min-height: 52px; border-radius: var(--r-btn); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; font-size: var(--fs-16); padding: 0 20px; text-align: center; line-height: 1.2; }
.btn.block { display: flex; width: 100%; }
.btn.pri { background: var(--green); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.soft { background: var(--mist); color: var(--ink); }
.btn.white { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(29,42,38,.1); }
.btn.quiet { color: var(--green-ink); min-height: 48px; }
.btn.danger { background: #fff; color: #8E3B2B; box-shadow: inset 0 0 0 1.5px #E6C8C0; }
.btn.sm { min-height: 44px; font-size: var(--fs-15); padding: 0 16px; border-radius: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-stack { display: grid; gap: var(--s2); margin-top: var(--s4); }
.btn-row { display: flex; gap: var(--s2); margin-top: var(--s4); flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 140px; }
.bgrp { display: flex; gap: 4px; }
.bgrp > * { flex: 1; min-width: 0; min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px; font-size: var(--fs-14); font-weight: 750; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(29,42,38,.06); text-align: center; line-height: 1.15; }
.bgrp > *:first-child { border-radius: 22px 10px 10px 22px; }
.bgrp > *:last-child { border-radius: 10px 22px 22px 10px; }
.bgrp .gi { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; }

/* ---------- Shapes ---------- */
.badge { position: relative; display: grid; place-items: center; flex: none; }
.badge > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.badge > .bn { position: relative; font-family: Literata, serif; font-weight: 700; letter-spacing: -.03em; line-height: .9; text-align: center; }
.badge > .bn small { display: block; font-family: Atkinson, sans-serif; font-size: 12px; font-weight: 750; letter-spacing: .02em; margin-top: 3px; }
.badge.spin > svg { animation: slowspin 40s linear infinite; }
@keyframes slowspin { to { transform: rotate(360deg); } }
.avatar { flex: none; display: block; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 12px; border-radius: 999px; font-size: var(--fs-13); font-weight: 750; }
.pill svg.i { width: 15px; height: 15px; }
.cite { font-family: Literata, serif; font-variant-numeric: lining-nums; font-size: var(--fs-13); font-weight: 600; padding: 4px 9px; border-radius: 8px; background: var(--navy-t); color: var(--navy-ink); white-space: nowrap; }
.bar { display: flex; gap: 5px; margin-top: var(--s3); }
.bar i { flex: 1; height: 6px; border-radius: 3px; background: rgba(29,42,38,.12); transition: background-color .4s var(--ease); }
.bar i.on { background: currentColor; }
.bar.slim i { height: 5px; }

/* ---------- Checkbox morph ---------- */
.cb { width: 30px; height: 30px; border-radius: 9px; border: 2.5px solid #B4C0BA; flex: none; display: grid; place-items: center; transition: border-radius .26s var(--spring), background-color .2s, border-color .2s; color: #fff; }
.cb svg.i { width: 16px; height: 16px; stroke-width: 3; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .26s var(--spring); }
[aria-checked="true"] > .cb, .cb.on { border-color: var(--green); border-radius: 50%; background: var(--green); }
[aria-checked="true"] > .cb svg.i, .cb.on svg.i { opacity: 1; transform: none; }

/* ---------- Chips and segmented control ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 48px; padding: 8px 16px; border-radius: 999px; font-size: var(--fs-15); font-weight: 750; background: #fff; box-shadow: 0 0 0 1.5px var(--hair); color: var(--soft); line-height: 1.2; transition: background-color .2s, color .2s, box-shadow .2s; }
.chip svg.i { width: 18px; height: 18px; }
.chip[aria-pressed="true"] { background: var(--teal); color: #fff; box-shadow: none; }
.chips.green .chip[aria-pressed="true"] { background: var(--green); }
.chips.gold .chip[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
.chips.navy .chip[aria-pressed="true"] { background: var(--navy); }
.chips.kid .chip[aria-pressed="true"] { background: var(--kid); }
.seg { display: flex; background: var(--bg-2); border-radius: 999px; padding: 4px; gap: 2px; }
.seg > * { flex: 1; min-height: 44px; display: grid; place-items: center; border-radius: 999px; font-size: var(--fs-15); font-weight: 750; color: var(--muted); text-align: center; padding: 0 10px; transition: background-color .25s var(--ease), color .2s, box-shadow .25s; }
.seg > [aria-selected="true"], .seg > [aria-current="page"], .seg > [aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- Forms ---------- */
.fl { display: block; margin-top: var(--s5); }
.fl:first-child { margin-top: 0; }
.fl-l { display: block; font-size: var(--fs-13); font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 2px 10px; }
.fl-h { display: block; font-size: var(--fs-14); color: var(--muted); margin: 8px 2px 0; }
.fl input, .fl textarea, .fl select, .in { width: 100%; min-height: 52px; border: 0; border-radius: 16px; background: var(--mist); padding: 14px 16px; font-size: var(--fs-17); line-height: 1.4; outline: none; transition: box-shadow .2s; resize: vertical; }
.fl input:focus, .fl textarea:focus, .in:focus { box-shadow: 0 0 0 2px var(--green); background: #fff; }
.fl-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.toggle { display: flex; align-items: center; gap: 12px; min-height: 52px; font-weight: 750; }
.toggle input { width: 22px; height: 22px; accent-color: var(--green); }
.fl-err { color: #8E3B2B; font-size: var(--fs-14); margin: 8px 2px 0; }

/* ---------- Sheet, dialog, toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(18,32,27,.36); opacity: 0; transition: opacity .3s; z-index: 50; }
.scrim.on { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: calc(100% - 24px - var(--sat)); background: var(--bg); border-radius: 30px 30px 0 0; z-index: 51; transform: translateY(104%); transition: transform .38s var(--ease-in); display: flex; flex-direction: column; box-shadow: 0 -20px 50px -20px rgba(0,0,0,.35); outline: none; }
.sheet.on { transform: none; }
.sheet-scroll { overflow-y: auto; padding: 0 var(--gutter) calc(28px + var(--sab)); overscroll-behavior: contain; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: #C9D3CE; margin: 10px auto 2px; }
.sh-top { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; background: var(--bg); padding: 6px 0 12px; margin-bottom: var(--s3); }
.sh-title { font: 500 var(--fs-20) Literata, serif; text-align: center; }
.sh-x, .sh-save { min-height: 48px; font-weight: 750; color: var(--green-ink); padding: 0 6px; }
.sh-save { justify-self: end; }
.sh-x { justify-self: start; color: var(--muted); }
.sheet .when-row { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--fs-15); padding: 0 2px var(--s3); }
.sheet .when-row input { background: var(--mist); border: 0; border-radius: 12px; min-height: 44px; padding: 8px 10px; font-size: var(--fs-15); }
.dialog { position: fixed; left: 50%; top: 50%; width: min(420px, calc(100% - 40px)); transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .28s var(--ease-in), opacity .2s; background: #fff; border-radius: 28px; padding: 26px 24px 18px; z-index: 61; box-shadow: var(--lift-2); }
.dialog.on { transform: translate(-50%, -50%); opacity: 1; }
#dialog-host .scrim { z-index: 60; }
.dialog h3 { font: 500 var(--fs-22)/1.2 Literata, serif; }
.dialog p { color: var(--muted); margin-top: 10px; font-size: var(--fs-16); }
.dbtns { display: flex; justify-content: flex-end; gap: 6px; margin-top: 20px; }
.dbtns button { min-height: 48px; padding: 0 16px; border-radius: 14px; font-weight: 750; color: var(--green-ink); }
.dbtns button.danger { color: #8E3B2B; }
.toast { position: fixed; left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); bottom: calc(var(--nav-h) + 16px + var(--sab)); z-index: 70; background: var(--ink); color: #fff; border-radius: 18px; padding: 12px 12px 12px 16px; display: flex; align-items: center; gap: 10px; font-size: var(--fs-15); transform: translateY(20px); opacity: 0; pointer-events: none; transition: transform .3s var(--ease-in), opacity .2s; max-width: 560px; margin: 0 auto; }
.toast.on { transform: none; opacity: 1; pointer-events: auto; }
.toast > span { flex: 1; }
.toast svg.i { color: var(--sage); }
.toast .undo { min-height: 44px; padding: 0 12px; border-radius: 12px; font-weight: 750; color: #BDE5D2; }
.app.show-detail ~ .toast { bottom: calc(16px + var(--sab)); }

/* ===================== Today ===================== */
.today-grid { display: grid; gap: var(--s3); }
.today-grid > section > .label:first-child { margin-top: var(--s4); }
.rn { padding: var(--s5); display: block; width: 100%; text-align: left; }
.rn-top { display: flex; align-items: center; gap: var(--s3); }
.rn-top .rt { flex: 1; min-width: 0; }
.rn-top .rt > b { display: block; font-size: var(--fs-18); font-weight: 750; }
.rn-top .rt > span { display: block; font-size: var(--fs-15); margin-top: 2px; }
.rn-step { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s4); background: rgba(255,255,255,.72); border-radius: 18px; padding: 10px 12px; }
.rn-step .tile { background: #fff; color: var(--gold-ink); }
.rn-step .ph { width: 46px; height: 46px; border-radius: 14px; object-fit: cover; }
.rn-step b { font: 500 var(--fs-22)/1.15 Literata, serif; flex: 1; min-width: 0; }
.rn .btn-row { margin-top: var(--s3); }
.count { display: flex; gap: var(--s4); align-items: flex-start; }
.count .ct { flex: 1; min-width: 0; }
.count h2 { font: 500 var(--fs-24)/1.15 Literata, serif; letter-spacing: -.01em; margin-top: 4px; }
.count .sub { font-size: var(--fs-15); margin-top: 6px; }
.count .bar { color: var(--navy); }
.count .prog { font-size: var(--fs-14); margin-top: 8px; }
.med-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; min-height: 68px; }
.med-row + .med-row { border-top: 1px solid var(--hair); }
.med-row .rt { flex: 1; min-width: 0; }
.med-row .rt > b { font-weight: 750; font-size: var(--fs-16); display: block; }
.med-row .rt > span { font-size: var(--fs-14); color: var(--muted); display: block; margin-top: 1px; }
.med-row .gave { display: inline-flex; align-items: center; gap: 6px; color: var(--green-ink); font-weight: 750; font-size: var(--fs-14); }
.coming .row { min-height: 64px; }
.coming .when { text-align: right; font-size: var(--fs-14); color: var(--muted); line-height: 1.25; }
.coming .when > b { display: block; font: 600 var(--fs-18) Literata, serif; color: var(--ink); }
.win { display: flex; gap: var(--s3); align-items: center; }
.win .badge { color: var(--gold-ink); }
.win .wt > b { display: block; font-weight: 750; }
.win .wt > span { display: block; color: var(--coral-ink); font-size: var(--fs-15); margin-top: 2px; }

/* ===================== Hubs (child, tools, records, paperwork) ===================== */
.hub-hero { display: flex; align-items: center; gap: var(--s4); }
.hub-hero .ht { flex: 1; min-width: 0; }
.hub-hero h1 { font: 500 var(--fs-34)/1.05 Literata, serif; letter-spacing: -.02em; }
.hub-hero p { color: inherit; opacity: .86; font-size: var(--fs-15); margin-top: 6px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
@container (min-width: 560px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@container (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tl { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s4); min-height: 138px; padding: 16px; border-radius: var(--r-tile); background: #fff; box-shadow: var(--lift); text-align: left; position: relative; }
.tl .tile { width: 48px; height: 48px; }
.tl .tt > b { font-size: var(--fs-17); font-weight: 750; line-height: 1.2; display: block; }
.tl span.s { font-size: var(--fs-14); color: var(--muted); display: block; margin-top: 3px; }
.tl.big { grid-column: span 2; flex-direction: row; align-items: center; min-height: 104px; }
.tl.big .tt { flex: 1; }
.tl .corner { position: absolute; top: 14px; right: 14px; }
.tl.fill-gold { background: var(--gold); color: var(--ink); }
.tl.fill-gold span.s { color: var(--soft); }
.tl.fill-gold .tile { background: #fff; color: var(--gold-ink); }
.tl.fill-teal { background: var(--teal); color: #fff; }
.tl.fill-teal span.s { color: #D5EEEB; }
.tl.fill-teal .tile { background: rgba(255,255,255,.18); color: #fff; }
.tl.fill-green { background: var(--green); color: #fff; }
.tl.fill-green span.s { color: #CFE6DB; }
.tl.fill-green .tile { background: rgba(255,255,255,.18); color: #fff; }
.tl.fill-navy { background: var(--navy); color: #fff; }
.tl.fill-navy span.s { color: #D3DDEB; }
.tl.fill-navy .tile { background: rgba(255,255,255,.16); color: #fff; }
.tl.fill-kid { background: var(--kid); color: #fff; }
.tl.fill-kid span.s { color: rgba(255,255,255,.86); }
.tl.fill-kid .tile { background: rgba(255,255,255,.2); color: #fff; }
@container (max-width: 330px) { .tiles { grid-template-columns: 1fr; } .tl.big { grid-column: auto; } }
html[data-text="xl"] .tiles { grid-template-columns: 1fr; }
html[data-text="xl"] .tl.big { grid-column: auto; }

/* ---------- Q and A pages (passport, calm plan, missing, parent input) ---------- */
.qa { display: grid; gap: var(--s3); }
.qa-item { background: #fff; border-radius: 22px; padding: 16px 18px; box-shadow: var(--lift); text-align: left; width: 100%; display: block; }
.qa-item b { display: block; font-weight: 750; font-size: var(--fs-16); }
.qa-item p { margin-top: 6px; font-size: var(--fs-16); color: var(--soft); white-space: pre-wrap; }
.qa-item.blank { background: transparent; box-shadow: inset 0 0 0 1.5px var(--hair); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qa-item.blank .add { color: var(--green-ink); font-weight: 750; font-size: var(--fs-15); white-space: nowrap; }
.foods { display: flex; flex-wrap: wrap; gap: 8px; }
.food { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px; background: #fff; box-shadow: var(--lift); font-weight: 750; }
.food.try { background: var(--gold-t); color: var(--gold-ink); box-shadow: none; }

/* ===================== Tools ===================== */
.routine-row .tile { background: var(--gold-t); color: var(--gold-ink); }
.steps-edit { display: grid; gap: 8px; }
.step-ed { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 18px; padding: 8px 8px 8px 10px; box-shadow: var(--lift); }
.step-ed .pic { width: 48px; height: 48px; border-radius: 14px; background: var(--gold-t); color: var(--gold-ink); display: grid; place-items: center; flex: none; overflow: hidden; }
.step-ed .pic img { width: 100%; height: 100%; object-fit: cover; }
.step-ed input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: var(--fs-17); font-weight: 750; min-height: 48px; padding: 0 4px; outline: none; }
.step-ed input:focus { background: var(--mist); border-radius: 10px; }
.step-ed .mv { display: flex; flex-direction: column; }
.step-ed .mv button { width: 40px; height: 24px; display: grid; place-items: center; color: var(--muted); }
.step-ed .mv svg.i { width: 18px; height: 18px; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.picker button { aspect-ratio: 1; border-radius: 16px; background: #fff; box-shadow: var(--ring); display: grid; place-items: center; color: var(--ink); }
.picker button svg.i { width: 26px; height: 26px; }
.picker button[aria-pressed="true"] { background: var(--gold); box-shadow: none; }
.timer-presets { display: flex; flex-wrap: wrap; gap: 8px; }

/* ===================== Child view: full screen, one thing at a time ===================== */
.cv { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; padding: calc(var(--sat) + 10px) calc(var(--gutter) + var(--sar)) calc(16px + var(--sab)) calc(var(--gutter) + var(--sal)); animation: cvIn .35s var(--ease-in) both; overflow: hidden; }
@keyframes cvIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.cv-top { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.cv-top .grow { flex: 1; font: 500 var(--fs-24) Literata, serif; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-exit { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px 0 12px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(29,42,38,.12); font-weight: 750; font-size: var(--fs-14); color: var(--muted); position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.cv-exit .fillbar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--green-t); z-index: 0; }
.cv-exit.holding .fillbar { width: 100%; transition: width .9s linear; }
.cv-exit > *:not(.fillbar) { position: relative; z-index: 1; }
.cv-body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: var(--s4); max-width: 760px; width: 100%; margin: 0 auto; }
.cv-done-chips { display: flex; gap: 8px; flex-wrap: wrap; min-height: 40px; }
.cv-done-chips .dc { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 8px; border-radius: 999px; background: #fff; color: var(--muted); font-size: var(--fs-14); font-weight: 750; text-decoration: line-through; animation: chipIn .3s var(--spring) both; }
.cv-done-chips .dc svg.i { color: #fff; background: var(--green); border-radius: 50%; padding: 3px; width: 20px; height: 20px; stroke-width: 3; }
@keyframes chipIn { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.focus { position: relative; margin: 10px 14px; }
.focus::before, .focus::after { content: ""; position: absolute; top: -10px; bottom: -10px; width: 18px; border: 5px solid var(--ink); z-index: 2; pointer-events: none; }
.focus::before { left: -14px; border-right: none; }
.focus::after { right: -14px; border-left: none; }
.step-big { background: var(--gold); border-radius: 30px 30px 30px 10px; padding: var(--s6); color: var(--ink); animation: stepIn .45s var(--ease-in) both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.step-big .k { font-size: var(--fs-14); font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.step-big .sb { display: flex; align-items: center; gap: var(--s5); margin-top: var(--s4); }
.step-big .pic { width: clamp(84px, 22vw, 160px); aspect-ratio: 1; border-radius: 28px; background: #fff; display: grid; place-items: center; color: var(--gold-ink); flex: none; overflow: hidden; }
.step-big .pic svg.i { width: 56%; height: 56%; stroke-width: 1.7; }
.step-big .pic img { width: 100%; height: 100%; object-fit: cover; }
.step-big h2 { font: 600 clamp(1.75rem, 7.2vw, 4rem)/1.06 Literata, serif; letter-spacing: -.02em; overflow-wrap: break-word; min-width: 0; hyphens: auto; }
.step-big .btn { margin-top: var(--s5); min-height: 64px; font-size: var(--fs-18); border-radius: 20px; }
.cv-next { display: grid; gap: 8px; }
.cv-next .nx { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 18px 8px 8px; border-radius: 20px; font-weight: 750; font-size: var(--fs-18); }
.cv-next .nx .pic { width: 48px; height: 48px; border-radius: 14px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.cv-next .nx .pic img { width: 100%; height: 100%; object-fit: cover; }
.cv-next .nx .n { margin-left: auto; font-family: Literata, serif; font-weight: 600; }
.cv-next .nx:nth-child(3n+1) { background: var(--teal-t); color: var(--teal-ink); }
.cv-next .nx:nth-child(3n+2) { background: var(--coral-t); color: var(--coral-ink); }
.cv-next .nx:nth-child(3n+3) { background: var(--green-t); color: var(--green-ink); }
.cv-all { text-align: center; display: grid; justify-items: center; gap: var(--s4); }
.cv-all h2 { font: 600 clamp(2rem, 8vw, 3.5rem)/1.05 Literata, serif; }
.cv-all .badge { animation: pop .6s var(--spring) both; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 12px; border-radius: 4px; animation: fall 2.4s var(--ease) forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(260deg); opacity: .2; } }
/* First, then */
.ft { display: grid; gap: 12px; position: relative; flex: 1; min-height: 0; grid-template-rows: 1fr 1fr; max-height: 640px; }
.ft-card { border-radius: 30px; padding: var(--s5) var(--s6); display: flex; flex-direction: column; justify-content: center; gap: var(--s3); min-height: 0; transition: transform .4s var(--ease-in), opacity .3s; }
.ft-card .k { font: 500 var(--fs-24) Literata, serif; }
.ft-card .fb { display: flex; align-items: center; gap: var(--s5); }
.ft-card .pic { width: clamp(84px, 22vw, 136px); aspect-ratio: 1; border-radius: 26px; display: grid; place-items: center; flex: none; overflow: hidden; }
.ft-card .pic svg.i { width: 56%; height: 56%; stroke-width: 1.7; }
.ft-card .pic img { width: 100%; height: 100%; object-fit: cover; }
.ft-card h2 { font: 600 clamp(1.75rem, 7.2vw, 3.4rem)/1.06 Literata, serif; overflow-wrap: break-word; min-width: 0; hyphens: auto; }
.ft-card.first { background: var(--gold); color: var(--ink); border-radius: 30px 30px 30px 10px; }
.ft-card.first .pic { background: #fff; color: var(--gold-ink); }
.ft-card.then { background: var(--green); color: #fff; }
.ft-card.then .pic { background: rgba(255,255,255,.16); color: #fff; }
.ft-arrow { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 50%; background: #fff; box-shadow: var(--lift-2); display: grid; place-items: center; z-index: 2; }
.ft.first-done .ft-card.first { opacity: .45; transform: scale(.96); }
.ft.first-done .ft-card.then { transform: scale(1.02); }
/* Timer */
.tm { flex: 1; display: grid; place-items: center; min-height: 0; }
.tm-shape { position: relative; width: min(72vw, 52vh, 420px); aspect-ratio: 1; display: grid; place-items: center; }
.tm-shape svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tm-shape .ring { fill: var(--teal-t); }
.tm-shape .fillp { fill: var(--teal); transform-origin: 50% 50%; transform-box: view-box; transition: transform 1s linear; }
.tm-left { position: relative; color: #fff; text-align: center; font: 700 clamp(2.5rem, 11vw, 4.5rem)/1 Literata, serif; letter-spacing: -.03em; text-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tm-left small { display: block; font: 750 var(--fs-16) Atkinson, sans-serif; letter-spacing: .02em; margin-top: 6px; }
.tm.small .tm-left { color: var(--teal-ink); text-shadow: none; }
.tm-what { text-align: center; font: 500 var(--fs-28)/1.15 Literata, serif; }
.tm-sub { text-align: center; color: var(--muted); font-size: var(--fs-15); margin-top: 6px; }
.tm.ended .tm-shape { animation: breathe 3s var(--ease) infinite; }
@keyframes breathe { 50% { transform: scale(1.04); } }
/* Story */
.st-page { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; border-radius: 30px; overflow: hidden; box-shadow: var(--lift); }
.st-art { flex: 1; min-height: 140px; background: var(--kid-t); position: relative; display: grid; place-items: center; overflow: hidden; }
.st-art img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.st-art .circ { width: min(46vw, 30vh, 220px); aspect-ratio: 1; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--kid-ink); position: relative; z-index: 1; animation: stepIn .45s var(--ease-in) both; }
.st-art .circ svg.i { width: 50%; height: 50%; stroke-width: 1.6; }
.st-art .sq { position: absolute; width: 64px; height: 64px; border-radius: 18px; background: var(--gold); top: 14%; right: 12%; transform: rotate(8deg); }
.st-art .dot { position: absolute; width: 44px; height: 44px; border-radius: 50%; background: var(--teal); bottom: 16%; right: 22%; }
.st-art .cloud { position: absolute; left: -30px; bottom: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.4); }
.st-text { padding: var(--s6); }
.st-text p { font: 500 clamp(1.4rem, 5vw, 2rem)/1.25 Literata, serif; }
.st-dots { display: flex; align-items: center; gap: 6px; margin-top: var(--s4); }
.st-dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--hair); transition: width .3s var(--ease), background-color .3s; }
.st-dots i.on { width: 28px; background: var(--coral); }
.st-dots > span { margin-left: auto; font-size: var(--fs-14); color: var(--muted); }
.cv-foot { display: flex; gap: var(--s2); margin-top: var(--s4); max-width: 760px; width: 100%; margin-left: auto; margin-right: auto; }
.cv-foot .btn { flex: 1; min-height: 60px; font-size: var(--fs-17); white-space: nowrap; padding: 0 14px; }
/* Heads-up */
.hu { text-align: center; display: grid; justify-items: center; gap: var(--s5); }
.hu h2 { font: 600 clamp(2rem, 8vw, 3.4rem)/1.08 Literata, serif; }
.hu .sleeps { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hu .sleeps i { width: 48px; height: 48px; border-radius: 50%; background: var(--navy-t); color: var(--navy-ink); display: grid; place-items: center; animation: pop .5s var(--spring) both; }
.hu .sleeps i:last-child { background: var(--gold); color: var(--ink); width: 64px; height: 64px; }
.hu .sleeps svg.i { width: 24px; height: 24px; }
.hu p { font-size: var(--fs-20); color: var(--soft); max-width: 26ch; }

/* ===================== Records ===================== */
.fab { width: 56px; height: 56px; border-radius: 18px 18px 18px 6px; background: var(--teal); color: #fff; display: grid; place-items: center; box-shadow: var(--lift-2); flex: none; }
.fab svg.i { width: 26px; height: 26px; stroke-width: 2.3; }
.log-row .tile { width: 44px; height: 44px; border-radius: 14px; }
.day-h { font-size: var(--fs-14); font-weight: 750; color: var(--muted); margin: var(--s5) 4px var(--s2); }
.pat-head { display: flex; align-items: center; gap: var(--s4); margin: var(--s2) 0 var(--s5); }
.pat-head > div > b { display: block; font: 500 var(--fs-22)/1.2 Literata, serif; }
.pat-head > div > span { display: block; font-size: var(--fs-15); color: var(--muted); margin-top: 3px; }
.chart { background: var(--teal-t); border-radius: 26px; padding: var(--s5); color: var(--teal-ink); }
.chart h3 { font-size: var(--fs-16); font-weight: 750; }
.cols { display: flex; align-items: flex-end; gap: 10px; height: 150px; margin-top: var(--s4); }
.cols .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.cols .c i { width: 100%; max-width: 52px; border-radius: 999px; background: var(--teal); min-height: 16px; transform-origin: bottom; animation: grow .7s var(--ease-in) both; }
.cols .c i.zero { background: #fff; }
.cols .c > span { font-size: var(--fs-13); font-weight: 750; }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
.chart .note { margin-top: var(--s4); }
.hbars { display: grid; gap: 12px; }
.hb { display: grid; grid-template-columns: minmax(96px, 38%) 1fr 32px; align-items: center; gap: 12px; font-weight: 750; font-size: var(--fs-15); }
.hb .tr { height: 10px; border-radius: 5px; background: var(--bg-2); overflow: hidden; }
.hb .tr i { display: block; height: 100%; border-radius: 5px; background: var(--teal); transform-origin: left; animation: growx .7s var(--ease-in) both; }
.hb .n { text-align: right; font-family: Literata, serif; font-weight: 600; }
@keyframes growx { from { transform: scaleX(0); } to { transform: none; } }

/* ===================== Paperwork ===================== */
.ck { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; background: #fff; border-radius: 22px; padding: 16px 18px; box-shadow: var(--lift); }
.ck + .ck { margin-top: 10px; }
.ck .ckt { flex: 1; min-width: 0; }
.ck .ckt > b { display: block; font-weight: 750; font-size: var(--fs-16); line-height: 1.3; }
.ck .ckt .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ck .ckt .go { color: var(--green-ink); font-weight: 750; font-size: var(--fs-14); margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.ck[aria-checked="true"] .ckt > b { color: var(--muted); }
.right-tag { background: var(--green-t); color: var(--green-ink); }
.good-tag { background: var(--mist); color: var(--soft); }
.hours { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: var(--s4); }
.hours > div { background: rgba(255,255,255,.75); border-radius: 18px; padding: 12px; }
.hours > div > b { display: block; font: 600 var(--fs-24) Literata, serif; }
.hours > div > span { display: block; font-size: var(--fs-13); font-weight: 750; margin-top: 2px; }
.hours-bar { height: 14px; border-radius: 7px; background: rgba(255,255,255,.7); overflow: hidden; display: flex; margin-top: var(--s4); }
.hours-bar i { display: block; height: 100%; animation: growx .7s var(--ease-in) both; transform-origin: left; }
.cmp-wrap { overflow-x: auto; border-radius: 22px; box-shadow: var(--lift); background: #fff; }
.cmp { border-collapse: collapse; width: 100%; min-width: 480px; font-size: var(--fs-15); }
.cmp th { background: var(--navy-t); color: var(--navy-ink); text-align: left; padding: 14px; font-weight: 750; }
.cmp td { padding: 12px 14px; border-top: 1px solid var(--hair); vertical-align: top; }
.cmp td:first-child { color: var(--soft); width: 40%; }
.cmp td.ans { font-weight: 750; }
.cmp td.ans button { text-align: left; min-height: 32px; width: 100%; color: var(--green-ink); font-weight: 750; }
.cmp td.ans button.blank { color: var(--faint); font-weight: 400; }
.word-list .row b .l { font-weight: 400; color: var(--muted); }
.word-def h2 { font: 600 var(--fs-28) Literata, serif; }
.word-def .long { color: var(--muted); margin-top: 4px; }
.word-def p.d { margin-top: var(--s4); font-size: var(--fs-17); }
.search { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 0 16px; min-height: 52px; box-shadow: var(--lift); margin-bottom: var(--s4); }
.search input { flex: 1; border: 0; outline: none; min-height: 50px; background: transparent; font-size: var(--fs-17); }
.search:focus-within { box-shadow: 0 0 0 2px var(--green); }

/* ===================== Settings ===================== */
.share-card { background: var(--green-t); color: var(--green-ink); border-radius: var(--r-hero); padding: var(--s5); }
.share-card .sc-top { display: flex; align-items: center; gap: 14px; }
.share-card .sc-top .tile { background: var(--green); color: #fff; }
.share-card .sc-top div > b { display: block; font-weight: 750; font-size: var(--fs-18); color: var(--ink); }
.share-card .sc-top div > span { display: block; font-size: var(--fs-15); }
.people { display: flex; align-items: center; gap: 12px; margin-top: var(--s4); }
.faces { display: flex; }
.face { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; box-shadow: 0 0 0 3px var(--green-t); position: relative; }
.face + .face { margin-left: -9px; }
.people p { font-size: var(--fs-15); }
.words6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: var(--s4); }
.words6 > span { background: #fff; border-radius: 14px; min-height: 48px; display: grid; place-items: center; font: 600 var(--fs-18) Literata, serif; color: var(--ink); }
.qr { background: #fff; border-radius: 22px; padding: 16px; display: grid; place-items: center; margin-top: var(--s4); }
.qr svg { width: min(220px, 60vw); height: auto; }
.sections { background: #fff; border-radius: var(--r-card); box-shadow: var(--lift); padding: var(--s5); }
.sec-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sec { border-radius: 16px; background: var(--mist); color: var(--soft); min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: var(--fs-14); font-weight: 750; text-align: center; padding: 8px 4px; }
.sec.on { background: var(--green); color: #fff; }
.sections p { font-size: var(--fs-15); color: var(--soft); margin-top: var(--s4); }
.bcp-card { border-radius: var(--r-hero); overflow: hidden; background: #fff; box-shadow: var(--lift); }
.bcp-band { background: var(--forest); color: #fff; padding: var(--s6) var(--s5); position: relative; overflow: hidden; }
.bcp-band .bb-top { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.bcp-band .bb-top b { font: 500 var(--fs-22)/1.15 Literata, serif; }
.bcp-band p { position: relative; z-index: 1; color: #D6E6DE; margin-top: var(--s3); font-size: var(--fs-16); max-width: 44ch; }
.bcp-band .fam { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; margin-top: var(--s5); flex-wrap: wrap; }
.bcp-band .fam > span { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px 0 6px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: var(--fs-14); font-weight: 750; }
.bcp-band .fam > span.b7 { padding: 0 12px; }
.bcp-band .fam svg.i { width: 16px; height: 16px; color: var(--sage); }
.bcp-band .rings { position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; opacity: .14; }
.bcp-card .rows { box-shadow: none; border-radius: 0; }
.bcp-card .row .tile { width: 40px; height: 40px; border-radius: 12px; }
.bcp-foot { text-align: center; font-size: var(--fs-14); color: var(--muted); padding: var(--s4) var(--s5) var(--s5); border-top: 1px solid var(--hair); }
.bcp-foot b { color: var(--ink); }
.kids-list .avatar { flex: none; }
.size-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.size-pick button { min-height: 72px; border-radius: 18px; background: #fff; box-shadow: var(--ring); display: grid; place-items: center; font-family: Literata, serif; }
.size-pick button[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--green); background: var(--green-t); }
.sync-state { font-size: var(--fs-14); }

/* ===================== Setup ===================== */
.setup { position: fixed; inset: 0; z-index: 46; background: var(--bg); overflow-y: auto; }
.setup-in { max-width: 560px; margin: 0 auto; padding: calc(var(--sat) + 36px) calc(24px + var(--sar)) calc(36px + var(--sab)) calc(24px + var(--sal)); min-height: 100%; display: flex; flex-direction: column; }
.setup-art { position: relative; height: 200px; margin-bottom: var(--s6); }
.setup-art .blk { position: absolute; width: 96px; height: 96px; border-radius: 26px; display: grid; place-items: center; font: 600 48px Literata, serif; color: var(--ink); animation: drop .7s var(--spring) both; }
.setup-art .b1 { left: calc(50% - 160px); top: 62px; background: #F4BE4F; transform: rotate(-5deg); }
.setup-art .b2 { left: calc(50% - 48px); top: 40px; background: #EF7B5E; transform: rotate(4deg); animation-delay: .12s; }
.setup-art .b3 { left: calc(50% + 64px); top: 70px; background: #5CB2A9; transform: rotate(-3deg); animation-delay: .24s; }
.setup-art .br { position: absolute; top: 20px; bottom: 6px; width: 30px; border: 10px solid var(--ink); }
.setup-art .br.l { left: calc(50% - 200px); border-right: none; }
.setup-art .br.r { right: calc(50% - 200px); border-left: none; }
@keyframes drop { from { opacity: 0; translate: 0 -40px; } to { opacity: 1; translate: 0 0; } }
.setup h1 { font: 500 var(--fs-34)/1.08 Literata, serif; letter-spacing: -.02em; }
.setup .su-sub { color: var(--muted); margin-top: var(--s3); font-size: var(--fs-17); }
.setup .su-points { display: grid; gap: 10px; margin-top: var(--s6); }
.setup .su-points div { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 18px; padding: 12px 14px; box-shadow: var(--lift); font-weight: 750; font-size: var(--fs-16); }
.setup .grow { flex: 1; min-height: var(--s6); }
.setup .btn-stack { margin-top: var(--s6); }
.setup .su-foot { text-align: center; font-size: var(--fs-14); color: var(--muted); margin-top: var(--s5); display: flex; align-items: center; justify-content: center; gap: 8px; }
.setup .steps-dots { display: flex; gap: 6px; margin-bottom: var(--s5); }
.setup .steps-dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--hair); }
.setup .steps-dots i.on { width: 26px; background: var(--green); }
.boot { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; gap: 10px; background: var(--bg); color: var(--ink); z-index: 95; padding: 32px; }
.boot-late { color: var(--muted); max-width: 32ch; opacity: 0; animation: lateIn .3s 6s forwards; }
@keyframes lateIn { to { opacity: 1; } }

/* ===================== Medium: 600-839 ===================== */
@media (min-width: 600px) {
  :root { --rail-w: 104px; --gutter: 28px; --nav-h: 0px; }
  .tabbar { display: none; }
  .rail { display: flex; flex-direction: column; align-items: center; gap: 6px; grid-column: 1; padding: calc(18px + var(--sat)) 0 calc(18px + var(--sab)) var(--sal); background: #fff; box-shadow: 1px 0 0 var(--hair); z-index: 10; overflow-y: auto; }
  .rail .mark-link { margin-bottom: 18px; }
  .rail .tab { flex: none; width: 92px; min-height: 64px; }
  .pane-inner { padding-bottom: 48px; }
  .toast, .app.show-detail ~ .toast { bottom: calc(24px + var(--sab)); left: calc(var(--rail-w) + 24px); }
  .sheet { left: 50%; right: auto; bottom: 50%; width: min(600px, calc(100% - 48px)); max-height: min(820px, calc(100% - 48px)); border-radius: 30px; transform: translate(-50%, 54%) scale(.98); opacity: 0; transition: transform .32s var(--ease-in), opacity .25s; }
  .sheet.on { transform: translate(-50%, 50%); opacity: 1; }
  .sheet .grab { display: none; }
  .btn.block, .btn-stack .btn { max-width: 440px; }
  .btn-stack { justify-items: start; }
  .hello h1 { font-size: 2.5rem; }
  .cv { padding-left: calc(36px + var(--sal)); padding-right: calc(36px + var(--sar)); }
}
/* ===================== Expanded: 840+ (hub and page side by side) ===================== */
@media (min-width: 840px) and (min-height: 480px) {
  :root { --list-w: clamp(380px, 42vw, 460px); }
  .panes { grid-template-columns: var(--list-w) 1fr; }
  .pane.detail { display: block; background: var(--bg-2); }
  .app.show-detail .pane.list { display: block; }
  .app.single .panes { grid-template-columns: 1fr; }
  .app.single .pane.detail { display: none; }
  .detail .wrap { max-width: 720px; }
  .app.single .wrap.wide { max-width: 1120px; }
  .today-grid.two { grid-template-columns: 1fr 1fr; align-items: start; column-gap: var(--s6); }
  .today-grid.two > .col { display: grid; gap: var(--s3); align-content: start; }
}
@media (min-width: 1200px) { :root { --list-w: 480px; --rail-w: 112px; --gutter: 36px; } }
/* Short windows (phone on its side, small split screen): icons-only rail */
@media (max-height: 500px) and (min-width: 560px) {
  :root { --rail-w: 84px; --nav-h: 0px; }
  .tabbar { display: none; }
  .rail { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; grid-column: 1; padding: 6px 0 6px var(--sal); background: #fff; box-shadow: 1px 0 0 var(--hair); }
  .rail .mark-link { display: none; }
  .rail .tab { width: 76px; min-height: 52px; }
  .rail .tab .tlab { display: none; }
  .rail .rail-settings { margin-top: 0; }
  .pane-inner { padding-bottom: 32px; }
  .toast { bottom: 16px; }
  .ft { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .ft-arrow { transform: translate(-50%, -50%) rotate(-90deg); }
  .step-big .sb { gap: var(--s4); }
  .hello h1 { font-size: var(--fs-28); }
}
/* ===================== Foldables ===================== */
.app.book .panes { grid-template-columns: calc(var(--seg0-w) - var(--rail-w)) var(--hinge-w) 1fr; }
.app.book .pane.list { display: block; grid-column: 1; }
.app.book .pane.detail { display: block; grid-column: 3; }
.app.book .hinge-gap { display: block; grid-column: 2; background: var(--bg-2); }
.app.tabletop { bottom: auto; height: var(--seg0-h); }
.dock { display: none; }
.app.tabletop ~ .dock { display: flex; position: fixed; left: 0; right: 0; top: var(--seg1-top); bottom: 0; background: #fff; z-index: 45; padding: 16px calc(24px + var(--sar)) calc(16px + var(--sab)) calc(24px + var(--sal)); gap: 16px; align-items: stretch; box-shadow: 0 -1px 0 var(--hair); }
.app.tabletop .tabbar { display: none; }
.app.tabletop .pane-inner { padding-bottom: 28px; }
.dock-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.dock .btn { min-height: 60px; width: 100%; font-size: var(--fs-18); border-radius: 20px; }
.dock-label { font-size: var(--fs-14); font-weight: 750; color: var(--muted); }
.dock .tabs-row { display: flex; gap: 6px; }
.dock .tabs-row .tab { flex: 1; flex-direction: row; justify-content: center; gap: 6px; background: var(--bg); padding: 10px 0; min-height: 52px; font-size: var(--fs-14); }
.dock .tabs-row .tab .g { width: auto; height: auto; background: none !important; }
.dock .tabs-row .tab[aria-current="page"] { background: var(--green-t); color: var(--green-ink); }
body.tabletop-cv .cv { bottom: auto; height: var(--seg0-h); }
body.tabletop-cv .cv .step-big .btn, body.tabletop-cv .cv .cv-foot { display: none; }
.app.tabletop ~ .sheet-host .sheet { top: 12px; bottom: auto; left: 50%; right: auto; width: min(620px, calc(100% - 32px)); max-height: calc(var(--seg0-h) - 24px); border-radius: 28px; transform: translate(-50%, -24px); opacity: 0; }
.app.tabletop ~ .sheet-host .sheet.on { transform: translate(-50%, 0); opacity: 1; }

/* ===================== Motion ===================== */
.enter > * { animation: enter .45s var(--ease-in) both; }
.enter > *:nth-child(2) { animation-delay: .04s; } .enter > *:nth-child(3) { animation-delay: .08s; } .enter > *:nth-child(4) { animation-delay: .12s; }
.enter > *:nth-child(5) { animation-delay: .16s; } .enter > *:nth-child(6) { animation-delay: .2s; } .enter > *:nth-child(n+7) { animation-delay: .24s; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fade { animation: fadeIn .22s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.bump { animation: bump .5s var(--spring); }
@keyframes bump { 40% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .badge.spin > svg { animation: none; }
}

/* ===================== Print ===================== */
#print-host { display: none; }
@media print {
  @page { margin: 14mm; }
  body.printing { overflow: visible; background: #fff; height: auto; font-size: 11.5pt; }
  body.printing > *:not(#print-host) { display: none !important; }
  body.printing #print-host { display: block; }
  .pr { color: #111; font-family: Atkinson, sans-serif; }
  .pr-head { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #1D2A26; padding-bottom: 10px; margin-bottom: 14px; }
  .pr-head h1 { font: 600 22pt Literata, serif; }
  .pr-head p { font-size: 10pt; color: #444; }
  .pr h2 { font: 600 13pt Literata, serif; margin: 14px 0 6px; break-after: avoid; }
  .pr .qa2 { break-inside: avoid; padding: 8px 0; border-bottom: 1px solid #ddd; }
  .pr .qa2 b { display: block; font-size: 10.5pt; }
  .pr .qa2 p { white-space: pre-wrap; }
  .pr table { width: 100%; border-collapse: collapse; font-size: 10pt; }
  .pr td, .pr th { border-bottom: 1px solid #ddd; padding: 5px 6px; text-align: left; vertical-align: top; }
  .pr .foot { margin-top: 18px; font-size: 9pt; color: #555; border-top: 1px solid #ccc; padding-top: 8px; }
  .pr .photo { width: 140px; height: 140px; object-fit: cover; border-radius: 12px; }
  .pr .story-pg { break-inside: avoid; display: flex; gap: 16px; align-items: center; border: 1px solid #ccc; border-radius: 14px; padding: 14px; margin-bottom: 10px; }
  .pr .story-pg .pic { width: 90px; height: 90px; display: grid; place-items: center; }
  .pr .story-pg .pic svg.i { width: 64px; height: 64px; }
  .pr .story-pg .pic img { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; }
  .pr .story-pg p { font: 500 16pt Literata, serif; }
}
[tabindex="-1"]:focus { outline: none; }
@media (min-width: 600px), (max-height: 500px) and (min-width: 560px) { .topbar .mark-home { display: none; } }
@media (min-width: 840px) and (min-height: 480px) { .tl[aria-current="page"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5.5px var(--ink); } }
.btn-row .btn { flex: 1 1 auto; }
.hard-only > .fl:first-child { margin-top: var(--s5); }
.cv-foot .btn.sq { flex: 0 0 60px; padding: 0; }
body.tabletop-cv .cv .cv-next, body.tabletop-cv .cv .cv-done-chips { display: none; }
body.tabletop-cv .cv .cv-body { justify-content: flex-start; padding-top: 8px; }
.dock .tabs-row .tab { flex-direction: column; gap: 2px; font-size: var(--fs-12); }
@media (max-width: 440px) { .setup-art { transform: scale(.78); transform-origin: 50% 30%; height: 170px; margin-bottom: var(--s3); } }
/* Settings: the family at the top */
.set-hero { border-radius: var(--r-hero); padding: var(--s6) var(--s5); background: linear-gradient(140deg, #DCEFE5, #FFF1CF 60%, #FCE1D9); position: relative; overflow: hidden; }
.set-hero .faces-row { display: flex; align-items: center; }
.set-hero .faces-row > * + * { margin-left: -10px; }
.set-hero .faces-row .face, .set-hero .faces-row svg.avatar { box-shadow: 0 0 0 4px #fff; border-radius: 50%; }
.set-hero h2 { font: 500 var(--fs-28)/1.1 Literata, serif; margin-top: var(--s4); }
.set-hero p { color: var(--soft); margin-top: 6px; font-size: var(--fs-15); }
.set-hero .apt-mark { position: absolute; right: 18px; top: 18px; opacity: .95; }
.feed .row { min-height: 60px; }
.feed .who { font-size: var(--fs-13); font-weight: 750; color: var(--muted); white-space: nowrap; }
