/* Generated from tokens/tokens.json by scripts/build.mjs. Do not edit. */

:root, [data-theme="day"] {
  --font-display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --font-text: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-reading: Andika, "Comic Sans MS", system-ui, sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --radius-icon: 27%;
  --sky-1: #D6E8F3;
  --sky-2: #F6F9FB;
  --surface: #FFFFFF;
  --surface-sunk: #E4EDF3;
  --line: #D5E2EA;
  --ink: #14324A;
  --ink-muted: #4A6274;
  --bridge: #14324A;
  --water: #B5D3E5;
  --streak: #FFFFFF;
  --mtn-far: #C4D9E6;
  --mtn-mid: #B3D2C1;
  --mtn-near: #8DBA9F;
  --snow: #FFFFFF;
  --scene-pine: #2F5D45;
  --accent: #F7A548;
  --accent-deep: #EF8F33;
  --accent-text: #A3501C;
  --accent-soft: #FDE7CF;
  --on-accent: #14324A;
  --go: #2F5D45;
  --go-edge: #1C3B2B;
  --app-lessons: #2F5D45;
  --app-chores: #A3501C;
  --app-farm: #7A5718;
  --farm-fill: #E3C48E;
  --farm-soft: #F6ECD9;
  --app-rewards: #2E6F9E;
  --done: #F7A548;
  --focus: #A3501C;
  --person-coral: #F5B49A;
  --person-mint: #A9D3B8;
  --person-butter: #F3D98B;
  --person-sky: #A9CDEB;
  --person-lilac: #C9B8EE;
  --person-rose: #F2B6C8;
  --on-person: #14324A;
  --shadow-card: 0 10px 22px -16px rgba(20,50,74,0.55);
  --shadow-lift: 0 26px 46px -16px rgba(20,50,74,0.42), 0 8px 16px -8px rgba(20,50,74,0.42);
  --shadow-go: 0 4px 0 #1C3B2B;
  color-scheme: light;
}

/* Optional dark mode, chosen by the family. Never switched by the clock. */
[data-theme="night"] {
  --sky-1: #011B3E;
  --sky-2: #0B2D5E;
  --surface: #0D3466;
  --surface-sunk: #173E66;
  --line: #1F4575;
  --ink: #F4F6FB;
  --ink-muted: #B7C5DC;
  --bridge: #FEFEFE;
  --water: #1F4575;
  --streak: #2F5C94;
  --mtn-far: #2B5C4A;
  --mtn-mid: #1F4A3D;
  --mtn-near: #154038;
  --snow: #F4F6FB;
  --scene-pine: #031C1F;
  --accent: #F7A548;
  --accent-deep: #EF8F33;
  --accent-text: #F7A548;
  --accent-soft: #3A2A1A;
  --on-accent: #14324A;
  --go: #2F5D45;
  --go-edge: #0E2419;
  --app-lessons: #8DBA9F;
  --app-chores: #F7A548;
  --app-farm: #E3C48E;
  --farm-fill: #E3C48E;
  --farm-soft: #173E5F;
  --app-rewards: #9CC6E4;
  --done: #F7A548;
  --focus: #F7A548;
  --person-coral: #F5B49A;
  --person-mint: #A9D3B8;
  --person-butter: #F3D98B;
  --person-sky: #A9CDEB;
  --person-lilac: #C9B8EE;
  --person-rose: #F2B6C8;
  --on-person: #14324A;
  --shadow-card: 0 0 0 1px #1F4575;
  --shadow-lift: 0 26px 46px -16px rgba(0,8,24,0.7);
  --shadow-go: 0 4px 0 #0E2419;
  color-scheme: dark;
}

.type-display-xl { font-family: var(--font-display); font-size: 56px; line-height: 0.98; font-weight: 800; letter-spacing: -0.035em; }
.type-display-lg { font-family: var(--font-display); font-size: 40px; line-height: 1.02; font-weight: 800; letter-spacing: -0.035em; }
.type-title { font-family: var(--font-display); font-size: 28px; line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }
.type-heading { font-family: var(--font-display); font-size: 19px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.type-body { font-family: var(--font-text); font-size: 17px; line-height: 1.5; font-weight: 500; }
.type-body-strong { font-family: var(--font-text); font-size: 15px; line-height: 1.35; font-weight: 700; }
.type-meta { font-family: var(--font-text); font-size: 13px; line-height: 1.4; font-weight: 500; }
.type-label { font-family: var(--font-text); font-size: 13px; line-height: 1.2; font-weight: 700; }
.type-tab { font-family: var(--font-text); font-size: 12px; line-height: 1.2; font-weight: 700; }
.type-word-card { font-family: var(--font-reading); font-size: 96px; line-height: 1.2; font-weight: 400; }
/* Longbridge app stylesheet: the shared look of every app screen.
 *
 * Load after tokens.css. Every app inlines both. Pages set which app they are
 * on <body data-app="chores|lessons|farm|rewards|hub|account">, which picks
 * the app accent (--app, --app-soft) and nothing else.
 *
 * The class names are a fixed vocabulary, so a page that uses them picks up
 * changes here without its own CSS:
 *   frame     .lb-bar .lb-app .lb-home .lb-scene .lb-hero .lb-page
 *   blocks    .card .list .row (.well .body .title .meta .check) .section-head .empty
 *   controls  .btn .go .small .quiet .danger .icon-btn .tabs/.tab .people/.person .toggle
 *   bits      .chip .jar .avatar .meta .muted .error .notice .progress .sheet .lb-toast
 * See components/App/README.md for how they fit together.
 */

@font-face { font-family: "Bricolage Grotesque"; src: url("/_lb/bricolage-grotesque.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/_lb/figtree.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Andika"; src: url("/_lb/andika.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("/_lb/andika-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root { --app: var(--ink); --app-soft: var(--surface-sunk); --page: 720px; }
/* Motion. See components/Motion/README.md. UI motion is under 300ms, eases
 * out (starts fast), and moves only transform and opacity. --bounce is for
 * the rare earned moments in js/delight.js, never for plain UI. */
:root {
  --ease-out: cubic-bezier(.23, 1, .32, 1);      /* anything entering, leaving or reacting */
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);  /* something already on screen moving to a new place */
  --bounce: cubic-bezier(.3, 1.5, .5, 1);        /* celebrations only */
  --ease: var(--ease-out);
  --dur-press: 120ms;  /* buttons, rows, checks */
  --dur-fast: 160ms;   /* colour and shadow changes, small things */
  --dur-base: 220ms;   /* toasts, menus, errors appearing */
  --dur-slow: 280ms;   /* sheets and dialogs; the ceiling for UI */
  --press: .97;        /* how far a button gives under the finger */
  --press-big: .985;   /* the same for big surfaces like rows */
}
/* Each app has its own corner of the same world: a sky, a ground colour, a
 * piece of the view, a button colour, a corner shape and its own sounds and
 * confetti (js/delight.js reads data-app). Everything else is shared.
 *   Chores   morning at home: warm sky, a cabin, sunset orange, plucked notes
 *   Lessons  building the bridge: clear green-blue, a crane, pine, wooden notes
 *   Farm     the meadow: sand ground, a barn and fence, round corners, soft notes
 *   Rewards  the lake on a fair day: a balloon, lake blue, bell notes, coins */
body[data-app="chores"] {
  --app: var(--app-chores); --app-soft: var(--accent-soft); --app-go: var(--app-chores);
  --scene-sky-top: color-mix(in srgb, var(--sky-1) 70%, #FFD2A6); --scene-sky-low: color-mix(in srgb, var(--sky-1) 60%, #FFF1DF);
  --page-bg: color-mix(in srgb, var(--sky-2) 85%, #FFE2C4);
}
body[data-app="lessons"] {
  --app: var(--app-lessons); --app-soft: color-mix(in srgb, var(--app-lessons) 14%, var(--surface)); --app-go: var(--app-lessons);
  --scene-sky-top: color-mix(in srgb, var(--sky-1) 82%, #BFE8D2); --scene-sky-low: var(--sky-1);
  --radius-lg: 14px; --radius-md: 10px;
  --page-bg: color-mix(in srgb, var(--sky-2) 86%, #D3EEDF);
}
body[data-app="farm"] {
  --app: var(--app-farm); --app-soft: var(--farm-soft); --app-go: var(--app-farm);
  --scene-sky-top: var(--sky-1); --scene-sky-low: color-mix(in srgb, var(--sky-1) 70%, #FFF4D6);
  --radius-lg: 26px; --radius-md: 18px;
  --page-bg: color-mix(in srgb, var(--sky-2) 55%, var(--farm-soft));
}
body[data-app="rewards"] {
  --app: var(--app-rewards); --app-soft: color-mix(in srgb, var(--app-rewards) 13%, var(--surface)); --app-go: var(--app-rewards);
  --scene-sky-top: color-mix(in srgb, var(--sky-1) 85%, #A9D5F5); --scene-sky-low: var(--sky-1);
  --page-bg: color-mix(in srgb, var(--sky-2) 86%, #CDE5F8);
}
[data-theme="night"] body[data-app], body[data-app][data-theme="night"] { --scene-sky-top: var(--sky-1); --scene-sky-low: var(--sky-1); --page-bg: var(--sky-2); }
body[data-app] { --app-head: var(--app); }
body[data-app="hub"], body[data-app="account"] { --app-head: var(--ink); }
body[data-app] :is(h1, .lb-app span) { color: var(--app-head); }
body[data-app] .tab:is([aria-selected="true"], [aria-current="page"]) { color: var(--app-head); }
.lb-own { display: none; }
body[data-app="chores"] .lb-own-chores, body[data-app="lessons"] .lb-own-lessons,
body[data-app="farm"] .lb-own-farm, body[data-app="rewards"] .lb-own-rewards { display: inline; }
body[data-app="hub"], body[data-app="account"] { --app: var(--ink); --app-soft: var(--surface-sunk); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--page-bg, var(--sky-2)); color: var(--ink);
  font-family: var(--font-text); font-size: 16px; line-height: 1.45; font-weight: 500;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: 30px; line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: 20px; line-height: 1.15; letter-spacing: -0.02em; }
h3 { font-size: 17px; line-height: 1.2; letter-spacing: -0.015em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-soft); color: var(--ink); }
[hidden] { display: none !important; }
.muted { color: var(--ink-muted); }
.meta { font-size: 13px; line-height: 1.4; color: var(--ink-muted); font-weight: 500; }
.num { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sr-only, .lb-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- frame ---- */

/* The "All apps" link back to the family home. */
.lb-home { display: flex; align-items: center; gap: 6px; padding: 0 max(16px, calc((100% - var(--page)) / 2)) !important; background: var(--sky-1) !important; border: 0 !important; font-size: 13px; font-weight: 700; }
.lb-home a { color: var(--ink-muted) !important; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }

/* The app bar: which app, the Jar, and who is signed in. */
.lb-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px max(16px, calc((100% - var(--page)) / 2)); min-height: 60px;
  background: color-mix(in srgb, var(--page-bg, var(--sky-2)) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color var(--dur-fast) var(--ease-out);
}
.lb-bar.scrolled, .lb-bar.solid { border-bottom-color: var(--line); }
.lb-app { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--ink); min-width: 0; margin-right: auto; }
.lb-app img, .lb-app svg { width: 32px; height: 32px; border-radius: 9px; flex: none; }
.lb-app b, .lb-app span { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -0.025em; white-space: nowrap; }
.lb-bar .avatar { width: 36px; height: 36px; font-size: 15px; }
/* The avatar is 36px; the button around it is the 44px target. */
.lb-me { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius-pill); padding: 4px; min-width: 44px; min-height: 44px; text-decoration: none; color: var(--ink); border: 0; background: none; font: inherit; cursor: pointer; }

/* The scene: the website's view, full bleed, on home screens only. */
.lb-scene { position: relative; height: 132px; overflow: hidden; background: var(--sky-1); }
.lb-scene svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lb-scene .lb-stars, .lb-scene .lb-moon-cut { display: none; }
.lb-scene .lb-sun circle { fill: var(--accent); }
[data-theme="night"] .lb-scene .lb-stars { display: inline; }
[data-theme="night"] .lb-scene .lb-sun circle { fill: var(--snow); }
[data-theme="night"] .lb-scene .lb-sun .lb-moon-cut { display: inline; fill: var(--sky-1); }
/* Chores' kitchen (assets/scenes/chores.svg): the window's light patch is a daytime thing. */
[data-theme="night"] .lb-scene .lb-light { display: none; }
@media (min-width: 720px) { .lb-scene { height: 184px; } }
.lb-bar + .lb-scene, .lb-scene + .lb-bar { margin-top: 0; }

/* The greeting under the scene. Text never sits on the scene. */
.lb-hero { max-width: var(--page); margin: 0 auto; padding: 20px 16px 4px; display: grid; gap: 6px; }
.lb-hero h1 { font-size: 34px; }
.lb-hero p { color: var(--ink-muted); font-size: 16px; }
@media (min-width: 720px) { .lb-hero h1 { font-size: 40px; } }

.lb-page, main { max-width: var(--page); margin: 0 auto; padding: 16px 16px 72px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; }
main > *, .lb-page > * { min-width: 0; }

/* ---- blocks ---- */

.card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 18px; display: grid; gap: 12px; align-content: start;
}
.card > h2, .card > h3 { margin-bottom: -2px; }
.card.flat { box-shadow: none; background: var(--surface-sunk); }
/* A parent-only page someone can't open (kit lockedPage()): Pip and one way
 * on for a child, Unlock and Back for a locked parent. One calm column, no card. */
main.lb-locked { max-width: 34rem; padding-top: 48px; justify-items: start; gap: 14px; }
.lb-locked h1 { font-family: var(--font-display); font-weight: 800; font-size: 28px; letter-spacing: -0.025em; }
.lb-locked > p { color: var(--ink-muted); font-size: 17px; line-height: 1.45; }
.lb-locked > p:last-child { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.lb-locked .pip-says > .pip { width: 84px; }
.card.tight { padding: 12px; }
.section { display: grid; gap: 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 2px; }
.section-head .meta { white-space: nowrap; }
.list { display: flex; flex-direction: column; gap: 8px; }
.list > h2, .list > h3 { margin: 10px 2px 2px; }
.list > h2:first-child, .list > h3:first-child { margin-top: 0; }

/* A row: icon well, title and meta, then actions. One per chore, reward, person. */
.row {
  position: relative; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 10px 10px 10px 12px; display: flex; align-items: center; gap: 12px; min-height: 64px;
  transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.card .row, .row.plain { box-shadow: none; background: var(--surface-sunk); }
.card .row + .row { margin-top: 0; }
a.row { text-decoration: none; color: inherit; }
.well {
  width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--app-soft); color: var(--app);
  display: grid; place-items: center; flex: none; font-size: 24px; line-height: 1;
}
.well svg { width: 24px; height: 24px; }
.body { flex: 1; display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.title { font-weight: 700; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.row .meta { overflow-wrap: anywhere; }
.done .title { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: color-mix(in srgb, var(--ink-muted) 60%, transparent); color: var(--ink-muted); }
.done .well { filter: saturate(.4); opacity: .7; }
.done { background: color-mix(in srgb, var(--surface) 70%, var(--sky-2)); box-shadow: none; }
.wait { color: var(--accent-text); font-weight: 600; }

/* The check: a ring to tap, a filled orange tick when done. */
.check { border: 0; background: none; padding: 0; width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer; flex: none; border-radius: 50%; color: var(--ink); }
.check svg { width: 34px; height: 34px; overflow: visible; transition: transform var(--dur-press) var(--ease-out); }
.check:disabled { cursor: default; opacity: .45; }
/* A tick happens many times a day, so the pop is short and eases out, with
 * no overshoot curve (motion rules 1 and 3). */
.check.popped svg { animation: lb-pop var(--dur-slow) var(--ease-out); }
.check.popped::after { content: ""; position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--accent); animation: lb-ring var(--dur-slow) var(--ease-out) forwards; pointer-events: none; }
.check { position: relative; }

.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 28px 16px 20px; color: var(--ink-muted); }
.empty svg, .empty img { width: 88px; height: auto; }
.empty strong, .empty h2, .empty h3 { color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }

hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }

/* ---- controls ---- */

button { font: inherit; color: inherit; }
.btn, .go, .small, .quiet, .danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; line-height: 1.1; text-decoration: none; white-space: nowrap;
  border-radius: var(--radius-pill); transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn svg, .go svg, .small svg, .quiet svg, .danger svg { width: 18px; height: 18px; flex: none; }
/* Primary: the one main action on a screen. */
.go, .btn.primary { background: var(--app-go, var(--ink)); color: var(--sky-2); min-height: 48px; padding: 0 22px; font-size: 16px; }
/* Spend: tokens leave the Jar. Orange, navy text, never white. */
.btn.spend { background: var(--accent); color: var(--on-accent); min-height: 48px; padding: 0 20px; box-shadow: 0 3px 0 var(--accent-deep); }
.btn.spend:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-deep); }
/* Secondary and quiet actions. */
.small, .quiet, .btn {
  background: var(--surface); color: var(--ink); min-height: 44px; padding: 0 16px; font-size: 14px;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.card .small, .card .quiet, .row .small, .row .quiet { background: var(--surface); }
.danger { background: transparent; color: #B3261E; min-height: 44px; padding: 0 14px; font-size: 14px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #B3261E 35%, transparent); }
[data-theme="night"] .danger { color: #FFB4A9; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #FFB4A9 40%, transparent); }
.go:disabled, .btn:disabled, .small:disabled, .quiet:disabled, .danger:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.wide, .go.wide { width: 100%; }
/* Icon-only button: always give it an aria-label. */
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-muted); display: inline-grid; place-items: center; cursor: pointer; flex: none; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-press) var(--ease-out); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn[aria-pressed="true"] { color: var(--app); background: var(--app-soft); }

/* Tabs: a segmented track. The current one is a white pill. */
.tabs {
  display: flex; gap: 2px; padding: 4px; background: var(--surface-sunk); border-radius: var(--radius-pill);
  overflow-x: auto; scrollbar-width: none; width: max-content; max-width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: none; font: inherit; font-weight: 700; font-size: 14px; color: var(--ink-muted);
  padding: 0 16px; min-height: 44px; border-radius: var(--radius-pill); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.tab[aria-selected="true"], .tab[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 50, 74, .12), 0 2px 8px -2px rgba(20, 50, 74, .12); }
[data-theme="night"] .tab[aria-selected="true"], [data-theme="night"] .tab[aria-current="page"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.tab .chip { min-height: 20px; padding: 0 7px; font-size: 12px; background: var(--accent); color: var(--on-accent); box-shadow: none; }

/* People: pick whose day you are looking at. */
.people { display: flex; gap: 8px; flex-wrap: wrap; }
.person {
  border: 0; border-radius: var(--radius-pill); padding: 4px 16px 4px 4px; display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; min-height: 48px;
  box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.person[aria-pressed="true"] { box-shadow: inset 0 0 0 2.5px var(--ink); }
.person .avatar { width: 40px; height: 40px; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--person-sky); color: var(--on-person); font-family: var(--font-display); font-weight: 800; font-size: 15px; line-height: 1;
}
.avatar.lg { width: 56px; height: 56px; font-size: 24px; }

/* Forms */
label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.field { display: grid; gap: 6px; }
.hint { font-size: 13px; color: var(--ink-muted); font-weight: 500; }
input:where(:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"])), select, textarea {
  font: inherit; font-weight: 500; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 0; box-shadow: inset 0 0 0 1.5px var(--line); border-radius: var(--radius-md);
  padding: 10px 12px; min-height: 46px; width: 100%; transition: box-shadow var(--dur-fast) var(--ease-out); appearance: none;
}
textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
select { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234A6274' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 4px color-mix(in srgb, var(--ink) 10%, transparent); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--ink-muted) 75%, transparent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); width: 20px; height: 20px; margin: 0; flex: none; cursor: pointer; }
input[type="number"] { font-variant-numeric: tabular-nums; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
legend { font-weight: 700; font-size: 14px; padding: 0; margin-bottom: 8px; }
.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline > label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.inline > label:has(input:not([type="checkbox"]):not([type="radio"]), select) { display: grid; gap: 6px; font-weight: 700; }
.inline input:where(:not([type="checkbox"]):not([type="radio"])), .inline select { width: auto; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions.end { justify-content: flex-end; }

/* A checkbox as a pill: <label class="toggle"><input type="checkbox">Mon</label> */
.toggle { position: relative; display: inline-flex !important; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: var(--radius-pill); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 700 !important; font-size: 14px; cursor: pointer; user-select: none; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle:has(input:checked) { background: var(--ink); color: var(--sky-2); box-shadow: none; }
.toggle:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
/* A switch row: <label class="switch"><span>Text</span><input type="checkbox"></label> */
.switch { display: flex !important; align-items: center; justify-content: space-between; gap: 16px; font-weight: 600 !important; font-size: 15px; cursor: pointer; min-height: 44px; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: background-color var(--dur-fast) var(--ease-out); cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(20, 50, 74, .3); transition: transform var(--dur-fast) var(--ease-in-out); }
.switch input:checked { background: var(--go); }
.switch input:checked::after { transform: translateX(18px); }

/* ---- bits ---- */

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--surface-sunk); color: var(--ink); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.chip:empty { display: none; }
.chip.app { background: var(--app-soft); color: var(--app); }
.chip.warn { background: var(--accent-soft); color: var(--accent-text); }
/* The Jar: coin and number. */
.jar {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 6px; border-radius: var(--radius-pill);
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); text-decoration: none; white-space: nowrap;
}
.jar svg { width: 24px; height: 24px; flex: none; }
.jar b, .jar .num { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.jar.bump { animation: lb-jar var(--dur-slow) var(--ease-out); }
.coin { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; flex: none; }
.coin svg { width: 100%; height: 100%; display: block; }

.error, .notice {
  display: flex; align-items: flex-start; gap: 10px; border-radius: var(--radius-md); padding: 12px 14px; font-weight: 600; font-size: 15px;
  animation: lb-rise var(--dur-base) var(--ease-out);
}
.error { background: color-mix(in srgb, #B3261E 10%, var(--surface)); color: var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #B3261E 28%, transparent); }
.notice { background: var(--app-soft); color: var(--ink); }
#msg:empty { display: none; }

/* A slim progress bar in the app colour. Not for mastery: that is the bridge. */
.progress { height: 8px; border-radius: 999px; background: var(--surface-sunk); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--app);  }

/* A sheet: <dialog class="sheet">. Slides up on phones, centred on wide screens. */
.sheet {
  border: 0; padding: 20px; width: min(520px, 100%); max-height: 90vh; background: var(--surface); color: var(--ink);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lift); display: grid; gap: 14px;
}
.sheet:not([open]) { display: none; }
.sheet::backdrop { background: rgba(1, 27, 62, .42); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sheet[open] { animation: lb-sheet var(--dur-slow) var(--ease-out); }
@media (max-width: 560px) {
  .sheet { margin: auto 0 0; width: 100%; max-width: 100%; inset: auto 0 0 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}

.lb-toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--sky-2); padding: 12px 18px; border-radius: var(--radius-pill); font-weight: 700; font-size: 15px;
  box-shadow: var(--shadow-lift); display: flex; align-items: center; gap: 10px; animation: lb-toast var(--dur-base) var(--ease-out); max-width: calc(100% - 32px);
}
.lb-toast .coin { width: 22px; height: 22px; }
.lb-toast.out { opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }

img.photo { max-width: 100%; border-radius: var(--radius-md); display: block; }

/* .rise used to stagger lists in on every render. Lists render many times a
 * day, so they now just appear (motion rule 1). The class is kept so old
 * markup stays valid. */

/* ---- delight (js/delight.js does sound, haptics and the bits that fly) ----
   Press: everything you can press gives a little under your finger.
   Idle: the scene and Pip move a little, slowly, so screens feel alive. */
/* Press: everything you can press gives under the finger at once (a CSS
 * transition, so a quick tap or a drag-off reverses smoothly). */
.tab, .toggle, .person, .chip:is(a, button) { transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
a.row:active, button.row:active { transform: scale(var(--press-big)); }
:is(.go, .btn, .small, .quiet, .danger, .icon-btn, .tab, .toggle, .person, .chip:is(a, button)):active { transform: scale(var(--press)); }
.check:not(:disabled):active svg { transform: scale(.92); }

@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-color: currentColor; }
  .lb-home a:hover { color: var(--ink) !important; }
  .lb-me:hover .avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--line); }
  a.row:hover, button.row:hover { box-shadow: var(--shadow-lift); }
  .check:not(:disabled):hover svg { transform: scale(1.04); }
  .go:hover, .btn.primary:hover { background: color-mix(in srgb, var(--app-go, var(--ink)) 88%, var(--sky-1)); }
  .small:hover, .quiet:hover, .btn:hover { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 40%, var(--line)); }
  .icon-btn:hover { background: var(--surface-sunk); color: var(--ink); }
  .tab:hover { color: var(--ink); }
  input:hover, select:hover, textarea:hover { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 30%, var(--line)); }
}

/* ---- Pip ----
   Pip lives in the scene (sitting at the end of the bridge, by the pennant),
   peeks over the card with the next thing to do, and says one short line at
   the moments that matter. Pip only talks to children.
   .pip-says   Pip beside a speech bubble:  <div class="pip-says"><span class="pip">{pip}</span><p class="bubble">…</p></div>
   .pip-peek   Pip holding on to a card's top edge: <section class="card"><span class="pip-peek">{pipPeek}</span>…
   .lb-pip-pop Pip up from the bottom of the screen, made by lb.pip(line) / lb.feel("cheer", el, line) */
.pip-says { display: flex; align-items: flex-end; gap: 10px; }
.pip-says > .pip { width: 68px; flex: none; }
.pip-says > .pip svg, .pip-peek svg, .lb-pip-pop .pip svg { display: block; width: 100%; height: auto; }
.pip-says .bubble, .lb-pip-pop .bubble {
  position: relative; margin: 0 0 16px; padding: 10px 14px; max-width: 34ch;
  background: var(--surface); color: var(--ink); border-radius: 18px 18px 18px 6px;
  box-shadow: var(--shadow-card); font-weight: 600; font-size: 16px; line-height: 1.35;
}
.card:has(> .pip-peek) { position: relative; overflow: visible; margin-top: 44px; }
.card > .pip-peek { z-index: 1; }
.pip-peek { position: absolute; right: 24px; bottom: calc(100% - 7px); width: 60px; pointer-events: none; }
.lb-pip-pop {
  position: fixed; z-index: 60; left: max(12px, env(safe-area-inset-left)); bottom: 0; right: 12px;
  display: flex; align-items: flex-end; gap: 6px; pointer-events: none;
  animation: lb-pip-up var(--dur-slow) var(--ease-out) both;
}
.lb-pip-pop .pip { width: 92px; flex: none; margin-bottom: -4px; }
.lb-pip-pop .bubble { margin-bottom: 52px; box-shadow: var(--shadow-lift); }
.lb-pip-pop.out { transform: translateY(110%); opacity: 0; transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out); }
/* One talking Pip per screen: while Pip is popped up, a Pip line on the page
 * waits, then fades in as Pip drops away (as if Pip came to sit there). */
.pip-says { transition: opacity var(--dur-base) var(--ease-out); }
body:has(.lb-pip-pop:not(.out)) .pip-says { opacity: 0; }
@keyframes lb-pip-up { from { transform: translateY(100%); } to { transform: none; } }
.pip-tail { transform-box: fill-box; transform-origin: 8% 92%; animation: lb-tail 5s ease-in-out infinite alternate; }
@keyframes lb-tail { from { transform: rotate(0); } to { transform: rotate(8deg); } }

.lb-fx { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
/* lb.celebrate(): the full-screen moment. A dialog over a soft sky, Pip
   holding on to the top of the card, confetti thrown inside the dialog. */
.lb-party { border: 0; padding: 0; margin: 0; width: 100%; max-width: none; height: 100%; max-height: none; background: transparent; display: grid; place-items: center; }
.lb-party:not([open]) { display: none; }
.lb-party::backdrop { background: color-mix(in srgb, var(--sky-1) 82%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.lb-party > .lb-fx { z-index: 0; }
.lb-party-card { position: relative; z-index: 1; width: min(340px, calc(100% - 48px)); margin-top: 48px; padding: 32px 24px 24px; border-radius: var(--radius-xl); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); text-align: center; display: grid; gap: 10px; justify-items: center; }
.lb-party-card .pip-peek { right: auto; left: 50%; width: 92px; margin-left: -46px; }
.lb-party-card h2 { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; color: var(--app-head, var(--ink)); }
.lb-party-card p { color: var(--ink-muted); font-size: 16px; }
.lb-party-card .go { margin-top: 8px; min-width: 140px; }
.lb-party[open] .lb-party-card { animation: lb-party var(--dur-slow) var(--ease-out) both; }
.lb-party[open]::backdrop { animation: lb-fade var(--dur-slow) var(--ease-out) both; }
@keyframes lb-party { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.lb-fx > i { position: absolute; display: block; border-radius: 50%; will-change: transform, opacity; }
.lb-fx > .lb-fly { width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: none; filter: drop-shadow(0 4px 6px rgba(20, 50, 74, .25)); }
.lb-fx > .lb-fly svg { width: 100%; height: 100%; display: block; }
.jar.dip svg { animation: lb-dip var(--dur-slow) var(--ease-out); }
.lb-shake { animation: lb-shake .3s var(--ease-out); }
.lb-nudge { animation: lb-nudge .3s var(--ease-out); }

.pip-eye { transform-box: fill-box; transform-origin: center; animation: lb-blink 6.5s infinite; }
.pip-eye + .pip-eye { animation-delay: .02s; }
.lb-scene .lb-streaks { animation: lb-drift 9s ease-in-out infinite alternate; }
.lb-scene .lb-smoke { animation: lb-smoke 4s ease-in-out infinite alternate; }
.lb-scene .lb-plank { animation: lb-lower 5s ease-in-out infinite alternate; }
.lb-scene .lb-balloon { animation: lb-bob 6s ease-in-out infinite alternate; }
.lb-scene .lb-flag { transform-box: fill-box; transform-origin: 0 50%; animation: lb-wave 2.8s ease-in-out infinite; }
/* The ambient loops hold still when nobody is using the page (delight.js sets
 * html.lb-idle after a quiet minute, and while the tab is hidden) and while
 * the scene is scrolled out of view (.lb-scene.lb-off). */
.lb-idle .pip-eye, .lb-idle .pip-tail, .lb-idle .lb-scene *, .lb-scene.lb-off * { animation-play-state: paused !important; }

@keyframes lb-smoke { from { transform: translate(0, 0); opacity: .8; } to { transform: translate(4px, -3px); opacity: .5; } }
@keyframes lb-lower { from { transform: translateY(0); } to { transform: translateY(10px); } }
@keyframes lb-bob { from { transform: translate(0, 0); } to { transform: translate(-14px, 6px); } }
@keyframes lb-nudge { 0%, 100% { transform: none; } 30% { transform: translateX(-4px) rotate(-.6deg); } 65% { transform: translateX(3px) rotate(.4deg); } }
@keyframes lb-jar { 0% { transform: scale(1); } 35% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes lb-pop { 0% { transform: scale(.95); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes lb-ring { from { transform: scale(.95); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
@keyframes lb-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes lb-sheet { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes lb-dip { 0%, 100% { transform: none; } 35% { transform: translateY(3px) scale(.9); } 70% { transform: translateY(-1px) scale(1.03); } }
@keyframes lb-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes lb-blink { 0%, 95%, 100% { transform: none; } 97% { transform: scaleY(.1); } }
@keyframes lb-drift { from { transform: translateX(-14px); } to { transform: translateX(14px); } }
@keyframes lb-wave { 0%, 100% { transform: skewY(0) scaleX(1); } 50% { transform: skewY(-6deg) scaleX(.9); } }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lb-toast { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Parent screens are calm: they set data-sound="off", act many times a day
 * and get the state change with no pop (motion rule 1). */
body[data-sound="off"] .check.popped svg, body[data-sound="off"] .check.popped::after { animation: none; }

/* Reduced motion: nothing travels, drifts or bounces; fades stay so changes
 * still read. */
@media (prefers-reduced-motion: reduce) {
  .lb-pip-pop { animation-name: lb-fade !important; }
  .lb-pip-pop.out { transform: none; }
  .pip-eye, .pip-tail, .lb-scene .lb-streaks, .lb-scene .lb-flag, .lb-scene .lb-smoke, .lb-scene .lb-plank, .lb-scene .lb-balloon,
  .check.popped svg, .check.popped::after, .jar.bump, .jar.dip svg, .lb-shake, .lb-nudge { animation: none !important; }
  .sheet[open], .lb-toast, .error, .notice, .lb-party[open] .lb-party-card { animation-name: lb-fade !important; }
  :is(a, button, .row, .tab, .toggle, .person, .chip):active, :is(a, button, .row, .tab, .toggle, .person, .chip):active svg { transform: none !important; }
  * { transition-property: opacity, color, background-color, border-color, box-shadow !important; }
}

/* Kid screens: bigger targets. <body data-kid> */
body[data-kid] .row { min-height: 72px; }
body[data-kid] .title { font-size: 18px; }
body[data-kid] .check { width: 56px; height: 56px; }
body[data-kid] .check svg { width: 40px; height: 40px; }