/* Questmio design system 4 – "klar, ruhig, freundlich": neutral light surfaces, one confident accent, grouped lists
   instead of a card per row, colour only where it carries meaning. Mobile first (320 px+), dark mode via
   [data-theme="dark"]. Rules: docs/DESIGN.md. */

/* ================================================================== 1. tokens */
/* Palette (operator decision 13.10.2026: "andere Farben, moderner"): paper-white surfaces on a light warm grey,
   near-black ink, one accent (persimmon, matches the app icon) and gold only for Sparks. Still no green anywhere
   (guarded by web/tests/palette.test.mjs). Text/control pairs reach WCAG AA (>= 4.5:1) in both themes; non-text UI
   (focus ring, field outlines, event bars, check rings) >= 3:1. --primary is for marks, bars and icons; text and
   filled buttons use --primary-strong. Legacy names (--plum*, --sage*, --apricot*) are aliases. */
:root {
  --bg: #F4F4F1; --surface: #FFFFFF; --surface-2: #EEEEEA; --surface-3: #E3E3DE;
  --line: #E7E6E1; --line-strong: #D3D2CC; --outline: #85837C;
  --ink: #1C1B19; --ink-2: #45433E; --muted: #625F58;
  --primary: #E0592A; --primary-strong: #B9420F; --primary-hover: #9E370B; --primary-soft: #FCEBE2; --on-primary: #FFFFFF;
  --accent: #E2A03A; --accent-soft: #FBF1DD; --accent-ink: #855407;
  --success: #2F5E94; --success-soft: #E5EDF7; --on-success: #FFFFFF;
  --danger: #B3204A; --danger-soft: #FBE6EC; --on-danger: #FFFFFF;
  --focus: #B9420F; --spark: #E2A03A;
  --toast-bg: #1F1E1B; --toast-ink: #FFFFFF; --toast-action: #FFB894; --toast-success: #1F1E1B; --toast-error: #8E1A3C;
  /* calendar event colours: keys are stored in the API, values are free to change (sage = honey) */
  --c-plum: #7348AD; --c-plum-soft: #F0EAF8; --c-sage: #8A5A00; --c-sage-soft: #F8EED8; --c-apricot: #B9420F; --c-apricot-soft: #FCEBE2;
  --c-sky: #2766A6; --c-sky-soft: #E4EEF8; --c-rose: #B3305A; --c-rose-soft: #FAE6ED; --c-sand: #725B47; --c-sand-soft: #F1ECE6;
  --c-slate: #4F5A66; --c-slate-soft: #E9ECEF;
  /* legacy aliases (resolved per theme, because both blocks apply to the root element) */
  --plum: var(--primary-strong); --plum-strong: var(--primary-strong); --plum-soft: var(--primary-soft); --on-plum: var(--on-primary);
  --sage: var(--success); --sage-soft: var(--success-soft);
  --apricot: var(--accent); --apricot-ink: var(--accent-ink); --apricot-soft: var(--accent-soft);
  /* depth: almost flat; a real shadow only on sheets, the FAB and the selected segment */
  --shadow-1: 0 1px 2px rgba(28, 27, 25, .06);
  --shadow-2: 0 10px 30px rgba(28, 27, 25, .16), 0 2px 6px rgba(28, 27, 25, .06);
  --backdrop: rgba(20, 19, 17, .42);
  --seg-on: var(--surface);
  /* corners: fields/buttons 12, rows/groups 16, large cards 20, sheets 24, pills 999 */
  --r-sm: 12px; --r-btn: 12px; --r: 16px; --r-lg: 20px; --r-sheet: 24px; --r-pill: 999px;
  --pad: 16px; --content-w: 720px;
  --nav-h: 64px; --top-h: 56px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .2s;
  color-scheme: light;
}
/* Dark: neutral graphite (no blue-black), same hierarchy by lightness, no shadows. */
[data-theme="dark"] {
  --bg: #121211; --surface: #1C1C1A; --surface-2: #262623; --surface-3: #31302D;
  --line: #2D2C29; --line-strong: #45443F; --outline: #8C8A82;
  --ink: #F3F2EE; --ink-2: #D2D0C9; --muted: #A9A79F;
  --primary: #FF7B4A; --primary-strong: #FF9466; --primary-hover: #FFAD8A; --primary-soft: #3A2117; --on-primary: #1E0D06;
  --accent: #F2B65A; --accent-soft: #382A12; --accent-ink: #F6C97F;
  --success: #92B9EE; --success-soft: #1A2738; --on-success: #0D1828;
  --danger: #FF92AE; --danger-soft: #3B1823; --on-danger: #2A0C16;
  --focus: #FFA27C; --spark: #F2B65A;
  --toast-bg: #33322E; --toast-ink: #F3F2EE; --toast-action: #FFB894; --toast-success: #33322E; --toast-error: #6E1A33;
  --c-plum: #C7AEF0; --c-plum-soft: #2E2540; --c-sage: #EDC377; --c-sage-soft: #36290F; --c-apricot: #FF9C73; --c-apricot-soft: #3A2117;
  --c-sky: #93C1F2; --c-sky-soft: #1A2B3E; --c-rose: #F7A1BC; --c-rose-soft: #3D1C29; --c-sand: #E3C29C; --c-sand-soft: #33291D;
  --c-slate: #B4BEC9; --c-slate-soft: #2A2E33;
  --shadow-1: none; --shadow-2: 0 14px 40px rgba(0, 0, 0, .55);
  --backdrop: rgba(0, 0, 0, .6);
  --seg-on: var(--surface-3);
  color-scheme: dark;
}

/* ================================================================== 2. base & type scale */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
body.modal-open { overflow: hidden; }
/* Display · Title · Body · Label · Caption · Overline (DESIGN.md) */
h1, h2, h3, h4 { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: 1.75rem; font-weight: 750; line-height: 1.15; letter-spacing: -.022em; }
h2 { font-size: 1.0625rem; font-weight: 680; line-height: 1.3; letter-spacing: -.008em; }
h3 { font-size: 1rem; font-weight: 700; line-height: 1.3; }
h4 { font-size: .95rem; font-weight: 700; line-height: 1.3; }
p { margin: 0; }
a { color: var(--primary-strong); }
img { max-width: 100%; }
strong, b { font-weight: 650; }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--surface); padding: 10px 14px; border-radius: var(--r-sm); }
.skip-link:focus { left: 8px; }
[hidden] { display: none !important; }
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon.xs { width: 14px; height: 14px; stroke-width: 2; } .icon.sm { width: 18px; height: 18px; } .icon.lg { width: 28px; height: 28px; } .icon.xl { width: 40px; height: 40px; stroke-width: 1.5; }
.icon.muted { color: var(--muted); }
.spin { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); } .small { font-size: .875rem; } .grow { flex: 1; min-width: 0; }
.meta { display: block; color: var(--muted); font-size: .8125rem; font-weight: 400; line-height: 1.35; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.lead { color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.lead.small { font-size: .875rem; }
.hint { color: var(--muted); font-size: .85rem; line-height: 1.45; }
.hint .icon, .notice .icon { vertical-align: -3px; }
.label { font-size: .875rem; font-weight: 600; line-height: 1.35; }
.caption { font-size: .78rem; font-weight: 500; line-height: 1.35; color: var(--muted); }
.overline { display: block; font-size: .8125rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.pad { padding: 12px 4px; }

/* ================================================================== 3. app shell */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: breathe 1.6s var(--ease) infinite; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .7; } }
.app.plain { min-height: 100vh; min-height: 100dvh; }
.plain-main { width: min(480px, 100%); margin: 0 auto; padding: 20px var(--pad) 40px; }
.app.with-shell { padding: calc(var(--top-h) + env(safe-area-inset-top, 0px)) 0 calc(var(--nav-h) + 96px + env(safe-area-inset-bottom, 0px)); }
.app.with-shell main { width: min(var(--content-w), 100%); margin: 0 auto; padding: 4px var(--pad) 32px; outline: none; }

.topbar { position: fixed; inset: 0 0 auto; z-index: 20; height: calc(var(--top-h) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 8px 0 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { width: min(var(--content-w), 100%); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hh-switch { display: flex; align-items: center; gap: 8px; min-height: 44px; min-width: 0; padding: 4px 10px 4px 6px; border: 0; background: none; border-radius: var(--r-sm); font-weight: 600; font-size: .9375rem; color: var(--ink-2); cursor: pointer; }
.hh-switch[aria-disabled="true"] { cursor: default; }
.hh-switch:not([aria-disabled="true"]):hover { background: var(--surface-2); }
.hh-mark { border-radius: 9px; flex: none; }
.hh-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 2px; }
.sync-dot { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--muted); }
.sync-dot.pending { color: var(--accent-ink); } .sync-dot.offline { color: var(--danger); }
/* all synced: no icon on screen (the state stays available to screen readers) */
.sync-dot.ok { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.avatar-btn { border: 0; background: none; padding: 4px; border-radius: 50%; min-width: 44px; min-height: 44px; display: grid; place-items: center; cursor: pointer; }
.avatar { position: relative; overflow: hidden; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-weight: 750; flex: none; background: var(--primary-soft); color: var(--primary-strong); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur) var(--ease); }
.avatar.has-img img { opacity: 1; }
.avatar.sm { width: 28px; height: 28px; font-size: .8rem; } .avatar.lg { width: 56px; height: 56px; font-size: 1.4rem; } .avatar.xl { width: 88px; height: 88px; font-size: 2rem; }
.avatar.tone-1 { background: var(--c-sage-soft); color: var(--c-sage); } .avatar.tone-2 { background: var(--c-apricot-soft); color: var(--c-apricot); }
.avatar.tone-3 { background: var(--c-sky-soft); color: var(--c-sky); } .avatar.tone-4 { background: var(--c-rose-soft); color: var(--c-rose); }

.banner { display: flex; align-items: center; gap: 10px; min-height: 44px; width: min(var(--content-w), 100%); margin: 8px auto 0; padding: 10px calc(var(--pad) + 14px); font-size: .875rem; font-weight: 500; border: 0; text-align: left; }
.banner > span { flex: 1; min-width: 0; }
.banner.offline { color: var(--ink-2); }
.banner.offline .icon { color: var(--muted); }
.banner.conflict { color: var(--accent-ink); font-weight: 650; cursor: pointer; }
.banner.conflict::after { content: "›"; margin-left: auto; font-size: 1.2rem; }

.bottom-nav { position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 max(0px, calc((100% - var(--content-w)) / 2)) env(safe-area-inset-bottom, 0px); background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 600; min-height: 48px; transition: color var(--dur) var(--ease); }
.bottom-nav a .icon { width: 26px; height: 26px; margin-bottom: 1px; }
.bottom-nav a:hover { color: var(--ink-2); }
.bottom-nav a.active { color: var(--primary-strong); font-weight: 700; }
.bottom-nav a.active .icon { stroke-width: 2.2; }

/* FAB: extended at the top of a page, collapses to a round 56 px button while scrolling down (main.js toggles .collapsed) */
.fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px), calc((100vw - var(--content-w)) / 2 + 16px)); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 19;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 56px; min-width: 56px; padding: 0 20px 0 16px; border: 0; border-radius: 16px; background: var(--primary-strong); color: var(--on-primary);
  font-weight: 650; font-size: .95rem; box-shadow: var(--shadow-2); cursor: pointer; white-space: nowrap;
  transition: border-radius var(--dur) var(--ease), padding var(--dur) var(--ease), transform .1s var(--ease), background var(--dur); }
.fab:hover { background: var(--primary-hover); }
.fab:active { transform: scale(.97); }
.fab-label { max-width: 240px; overflow: hidden; transition: max-width var(--dur) var(--ease), opacity .15s var(--ease), margin var(--dur) var(--ease); }
.fab.collapsed { padding: 0; width: 56px; border-radius: var(--r-pill); }
.fab.collapsed .fab-label { max-width: 0; opacity: 0; margin-left: -8px; }
@media (max-width: 359px) { .fab { padding: 0; width: 56px; border-radius: var(--r-pill); } .fab .fab-label { max-width: 0; opacity: 0; margin-left: -8px; } }

/* ================================================================== 4. page structure */
.page { display: flex; flex-direction: column; gap: 28px; }
.page > section { display: flex; flex-direction: column; gap: 8px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding-top: 8px; }
.page-head > h1 { flex: 1; min-width: 0; }
.page-head > div { flex: 1; min-width: 0; }
.page-head.row { align-items: center; }
.page-head .icon-btn.back { margin-left: -10px; }
.page-head .head-actions { display: flex; align-items: center; gap: 2px; margin-right: -8px; }
.page-head > .head-actions { flex: none; }
.page-head + .segmented, .page-head + .chips { margin-top: -12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 2px; }
.section-head h2 { flex: 1; min-width: 0; }
.text-link { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 4px 6px; margin-right: -6px; border-radius: var(--r-sm); background: none; border: 0; color: var(--primary-strong); font-weight: 650; font-size: .875rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.text-link:hover { background: color-mix(in srgb, var(--primary-soft) 70%, transparent); }
.list { display: flex; flex-direction: column; gap: 8px; }
.list > h2, .list > h3 { margin-top: 8px; }
/* Grouped list (design system 4): rows share one rounded surface and are separated by hairlines instead of
   each sitting in its own bordered card. Inside sheets the group is a soft grey block on the white sheet. */
.list:has(> :is(.task-row, .reward-row, .event-row, .history-row, .list-row, .list-btn, .confirm-row, .member)) { gap: 0; background: var(--group-bg, var(--surface)); border-radius: var(--r); overflow: hidden; position: relative; }
.list > :is(.task-row, .reward-row, .event-row, .history-row, .list-row, .list-btn, .confirm-row) { position: relative; border: 0; border-radius: 0; background: transparent; }
.list > :is(.task-row, .reward-row, .event-row, .history-row, .list-row, .list-btn, .confirm-row) + :is(.task-row, .reward-row, .event-row, .history-row, .list-row, .list-btn, .confirm-row)::before {
  content: ""; position: absolute; top: 0; left: var(--div-inset, 16px); right: 0; height: 1px; background: var(--line); }
.list > :is(.event-row, .list-btn):hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
/* gestures (3.6): swipeable task rows, pull to refresh */
.task-row { touch-action: pan-y; }
.task-row.swiping { z-index: 1; background: var(--group-bg, var(--surface)); }
.swipe-under { position: absolute; left: 0; right: 0; z-index: 0; display: flex; align-items: center; padding: 0 22px; font-size: .9rem; font-weight: 650; background: var(--surface-3); color: var(--ink-2); transition: background .15s, color .15s; }
.swipe-under.left { justify-content: flex-end; }
.swipe-under.none { background: transparent; }
.swipe-under.tone-primary { background: var(--primary-soft); color: var(--primary-strong); }
.swipe-under.tone-primary.armed { background: var(--primary-strong); color: var(--on-primary); }
.swipe-under.tone-neutral.armed { background: var(--ink-2); color: var(--surface); }
.swipe-act { display: inline-flex; align-items: center; gap: 8px; transition: transform .15s var(--ease); }
.swipe-under.armed .swipe-act { transform: scale(1.06); }
.ptr { position: fixed; left: 50%; top: calc(var(--top-h) + env(safe-area-inset-top, 0px) + 8px); z-index: 25; transform: translate(-50%, -48px); opacity: 0; pointer-events: none; }
.ptr-ring { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); color: var(--primary-strong); box-shadow: var(--shadow-2); }
.ptr.spinning .ptr-ring .icon { animation: spin .8s linear infinite; }
.list-stack { display: flex; flex-direction: column; gap: 8px; }
.list-stack > .list-sub { margin: 16px 2px 2px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 6px; }
.tabbed { display: flex; flex-direction: column; gap: 12px; }
.tabbed > .stack { margin-top: 8px; }
.card { background: var(--group-bg, var(--surface)); border: 0; border-radius: var(--r); padding: 16px; }
.card.interactive { box-shadow: none; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-btn); background: var(--surface-2); color: var(--ink-2); font-size: .875rem; line-height: 1.45; }
.notice .icon { color: var(--primary-strong); margin-top: 1px; }
.notice.flow-note { background: var(--primary-soft); color: var(--ink); }
.notice.flow-note .hint { color: var(--ink-2); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 20px 24px; text-align: center; color: var(--ink-2); background: var(--group-bg, var(--surface)); border-radius: var(--r); }
.empty-ico { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); }
.empty h3 { color: var(--ink); }
.empty p { font-size: .9rem; max-width: 36ch; }
.empty .btn { margin-top: 10px; }
.skeleton { height: 60px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton-list { display: flex; flex-direction: column; gap: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ================================================================== 5. buttons */
/* .btn (neutral tonal) · .primary (filled) · .tonal (primary-soft, second action) · .ghost (text) · .danger (text/tonal) · .danger-solid */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: var(--r-btn);
  border: 0; background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: .95rem; line-height: 1.25; text-decoration: none; cursor: pointer; text-align: center;
  transition: background .15s var(--ease), transform .1s var(--ease); }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary-strong); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.tonal { background: var(--primary-soft); color: var(--primary-strong); }
.btn.tonal:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent); }
.btn.ghost { background: transparent; color: var(--primary-strong); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { color: var(--danger); background: var(--danger-soft); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger-soft) 85%, var(--danger)); }
.btn.danger.ghost { background: transparent; }
.btn.danger.ghost:hover { background: var(--danger-soft); }
.btn.danger-solid { background: var(--danger); color: var(--on-danger); }
.btn.small { min-height: 44px; padding: 8px 14px; font-size: .875rem; border-radius: 10px; }
.btn.big { min-height: 54px; font-size: 1.02rem; }
.btn.full { width: 100%; }
.btn > span { min-width: 0; overflow-wrap: anywhere; }
.icon-btn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; position: relative; transition: background .15s var(--ease); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.bordered { border: 0; background: var(--group-bg, var(--surface)); border-radius: var(--r-sm); }
.icon-btn.tonal { background: var(--primary-soft); color: var(--primary-strong); }
.icon-btn.on { color: var(--primary-strong); background: var(--primary-soft); border-color: var(--primary-soft); }
.icon-btn .count { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--primary-strong); color: var(--on-primary); font-size: .65rem; font-weight: 750; display: grid; place-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.actions .danger { margin-right: auto; }
.actions.start { justify-content: flex-start; }
.actions.start .danger { margin-right: 0; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-grid .big, .action-grid .full { grid-column: 1 / -1; }

/* ================================================================== 6. forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: .875rem; font-weight: 600; line-height: 1.35; color: var(--ink-2); }
.field small { font-weight: 500; color: var(--muted); }
.field > small { margin-top: -2px; }
.field input, .field select, .field textarea, .search input {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--outline); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-weight: 400; font-size: 1rem; line-height: 1.4;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus { border-color: var(--primary-strong); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent); }
.field input::placeholder, .field textarea::placeholder, .search input::placeholder { color: var(--muted); opacity: 1; }
.field input:user-invalid, .field select:user-invalid, .field textarea:user-invalid, .field [aria-invalid="true"] { border-color: var(--danger); }
.field.inline { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; }
.field.inline input { width: 96px; }
.field-error { display: block; color: var(--danger); font-size: .8rem; font-weight: 600; margin-top: -2px; }
.check .field-error, .switch .field-error { flex-basis: 100%; margin: -4px 0 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check, .switch { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; min-height: 44px; padding: 8px 0; cursor: pointer; font-size: .95rem; font-weight: 450; line-height: 1.4; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--primary-strong); flex: none; }
.check > input + span, .switch > span:first-child, .switch > input + span { flex: 1; min-width: 0; display: block; }
.check .task-ico { flex: none; }
.check small.hint, .switch small.hint { display: block; font-weight: 500; }
/* iOS/M3-style switch drawn in CSS on the native checkbox */
.switch { align-items: center; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; order: 2; width: 46px; height: 28px; margin: 0; border-radius: var(--r-pill); background: var(--line-strong); position: relative; cursor: pointer; transition: background var(--dur) var(--ease); }
.switch input::before { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform var(--dur) var(--ease); }
.switch input:checked { background: var(--primary-strong); }
.switch input:checked::before { transform: translateX(18px); background: var(--on-primary); }
.switch input:disabled { opacity: .5; cursor: not-allowed; }
.code-input { letter-spacing: .3em; font-size: 1.3rem !important; font-weight: 700 !important; text-align: center; font-variant-numeric: tabular-nums; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 52px; }
.pw-wrap .icon-btn { position: absolute; right: 2px; top: 2px; }
.form-error { padding: 10px 14px; border-radius: var(--r-sm); background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: .875rem; }
.form-error .btn { margin-top: 8px; }
.form-ok { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--success-soft); color: var(--success); font-weight: 600; font-size: .875rem; }
/* success is never colour-only: a drawn check mark accompanies it (no icon font or image needed) */
.form-ok::before, .toast.success::before { content: ""; flex: none; width: 6px; height: 11px; margin: 0 4px 3px 3px; border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; font-size: .875rem; line-height: 1.35; margin-bottom: 8px; padding: 0; }
.icon-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-picker legend { width: 100%; }
.ic-opt input, .weekday-picker input, .color-picker input { position: absolute; opacity: 0; pointer-events: none; }
.ic-opt span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-sm); border: 1px solid transparent; background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
.ic-opt input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-strong); }
.ic-opt input:focus-visible + span, .weekday-picker input:focus-visible + span, .color-picker input:focus-visible + .swatch, .chip-radio input:focus-visible + span, .segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.rotation-picker { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; }
.rotation-picker legend { font-weight: 600; font-size: .875rem; color: var(--ink-2); padding: 0; margin-bottom: 2px; }
.rotation-picker .chip { background: var(--surface-2); padding: 6px 14px 6px 6px; }
.rotation-picker .chip.on { background: var(--primary-soft); }
.rot-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-strong); color: var(--on-primary); font-weight: 750; font-size: .8rem; font-variant-numeric: tabular-nums; }
.avatar.xs { width: 28px; height: 28px; font-size: .75rem; }
.locked-row { background: var(--surface-2); }
.locked-row > .icon:first-child { color: var(--ink-2); flex: none; }
.locked-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.badge.plus-badge { background: var(--primary-soft); color: var(--primary-strong); }
.rotation-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.weekday-picker legend { width: 100%; }
.weekday-picker span { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; border-radius: var(--r-pill); border: 0; background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: .85rem; }
.weekday-picker input:checked + span { background: var(--primary-strong); border-color: var(--primary-strong); color: var(--on-primary); }
.color-picker { display: flex; gap: 4px; flex-wrap: wrap; }
.color-picker > label { display: grid; place-items: center; min-width: 44px; min-height: 44px; }
.color-picker legend { width: 100%; }
.swatch { display: block; width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.color-picker input:checked + .swatch { box-shadow: 0 0 0 3px var(--ink); }
.tz-box summary { display: list-item; cursor: pointer; color: var(--muted); font-size: .875rem; line-height: 20px; padding: 12px 0; min-height: 44px; }
.tz-box select { width: 100%; min-height: 48px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); padding: 8px; }

/* chips: 44 px standalone, 36 px in horizontally scrolling filter bars (.chips.scroll, hit area stays 44 px) */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 6px 14px; border-radius: var(--r-pill); border: 0; background: var(--chip-bg, var(--surface));
  font-size: .875rem; font-weight: 550; color: var(--ink-2); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s var(--ease), border-color .15s var(--ease); }
.chip:hover { background: var(--surface-3); }
.chip.on { background: var(--primary-soft); color: var(--primary-strong); font-weight: 650; }
.chip.on .icon { stroke-width: 2.2; }
.chip.locked { color: var(--muted); }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)); padding: 4px var(--pad); scroll-padding: var(--pad); -webkit-overflow-scrolling: touch; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { min-height: 36px; padding: 4px 12px; font-size: .85rem; flex: none; }
.chips.scroll .chip::before { content: ""; position: absolute; inset: -4px 0; }
.chips.static .chip { cursor: default; min-height: 30px; padding: 4px 10px; font-size: .8125rem; background: var(--surface-2); font-weight: 500; }
.chip-radio { position: relative; }
.chip-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-radio span { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 16px; border-radius: var(--r-pill); border: 0; background: var(--surface-2); font-weight: 550; font-size: .875rem; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.chip-radio input:checked + span { background: var(--ink); color: var(--surface); font-weight: 650; }
.size-picker legend, .segmented-field legend { margin-bottom: 8px; }

.segmented { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-btn); background: var(--seg-track, var(--surface-3)); }
.segmented > button, .segmented > label { position: relative; flex: 1; min-width: 0; min-height: 44px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; font-size: .875rem; line-height: 1.15; color: var(--muted); cursor: pointer; display: grid; place-items: center; text-align: center; padding: 4px 6px; overflow-wrap: anywhere; hyphens: auto; transition: background .15s var(--ease), color .15s var(--ease); }
.segmented > .on { background: var(--seg-on); color: var(--ink); box-shadow: 0 1px 3px rgba(28, 27, 25, .12); }
.segmented > label input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.search-row { display: flex; gap: 8px; align-items: center; }
.search { position: relative; display: block; flex: 1; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 44px; border-radius: var(--r-pill); border-color: transparent; background: var(--group-bg, var(--surface)); }
.search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-size: .75rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.badge.sync { background: var(--accent-soft); color: var(--accent-ink); }
.badge.private { background: var(--surface-3); color: var(--ink-2); }
.badge.done { background: var(--success-soft); color: var(--success); }

/* sparks */
/* Sparks: plain gold-ink number with the spark mark – no pill, so rows stay quiet */
.sparks { display: inline-flex; align-items: center; gap: 3px; padding: 0; color: var(--accent-ink); font-weight: 700; font-size: .875rem; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.4; }
.sparks .icon { color: var(--spark); stroke-width: 2.2; }
.sparks.xl { font-size: 2.25rem; gap: 8px; color: var(--ink); font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.sparks.xl .icon { width: 28px; height: 28px; }
.meta .sparks { font-size: inherit; font-weight: 650; vertical-align: -1px; }
.task-row.is-done .sparks, .task-row.is-done .sparks .icon { color: var(--muted); font-weight: 600; }
.neg { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.pos { color: var(--success); font-weight: 700; font-variant-numeric: tabular-nums; }
.danger-text { color: var(--danger); }

/* ================================================================== 7. task row */
/* [complete circle 44] [title · meta] [sparks] – the circle is the only primary action, the rest opens the sheet */
.task-row { --div-inset: 56px; display: flex; align-items: center; gap: 2px; min-height: 60px; padding: 4px 14px 4px 6px; background: var(--surface); border: 0; border-radius: var(--r); transition: background var(--dur) var(--ease); }
.task-row.is-done .task-text strong { color: var(--muted); font-weight: 500; }
.task-check { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; padding: 0; background: none; border-radius: 50%; color: var(--on-primary); cursor: pointer; }
.task-check:disabled { cursor: default; }
.task-check .ring { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--outline); background: transparent; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform .15s var(--ease); }
.task-check .ring .icon { width: 18px; height: 18px; stroke-width: 2.4; stroke-dasharray: 24; stroke-dashoffset: 24; opacity: 0; }
.task-check:not(:disabled):hover .ring { background: var(--primary-soft); border-color: var(--primary); }
.task-check:not(:disabled):active .ring { transform: scale(.9); }
.task-row.is-checking .task-check .ring { background: var(--primary-strong); border-color: var(--primary-strong); }
.task-row.is-checking .task-check .ring .icon { opacity: 1; animation: draw .3s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.task-check.done .ring { background: var(--muted); border-color: var(--muted); color: var(--surface); }
.task-check.done .ring .icon, .task-check.off .ring .icon, .task-check.pending .ring .icon { opacity: 1; stroke-dashoffset: 0; }
.task-check.off .ring { border-color: var(--line-strong); color: var(--muted); }
.task-check.off .ring .icon { stroke-width: 2; width: 14px; height: 14px; }
.task-check.pending .ring { border-color: var(--line-strong); color: var(--accent-ink); }
.task-check.pending .ring .icon { stroke-width: 2; width: 16px; height: 16px; }
.task-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 4px 8px 6px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--r-sm); min-height: 52px; color: inherit; }
.task-main:hover .task-text strong { color: var(--primary-strong); }
.task-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); flex: none; background: var(--surface-2); color: var(--ink-2); }
.task-ico .icon { width: 22px; height: 22px; }
.task-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.task-text strong { font-size: 1rem; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; transition: color .15s; }
.status-line { font-size: .8125rem; font-weight: 400; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; line-height: 1.35; }
.done-line { color: var(--muted); }
.claimed { color: var(--accent-ink); }
.task-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; align-self: center; }
/* category tiles stay neutral (DS4: colour only where it carries meaning); the classes remain as hooks */
:is(.cat-kitchen, .cat-pets, .cat-laundry, .cat-cleaning, .cat-garden, .cat-together, .cat-errands, .cat-organizing, .cat-other) { background: var(--surface); color: var(--ink-2); }
.list-row :is(.cat-kitchen, .cat-pets, .cat-laundry, .cat-cleaning, .cat-garden, .cat-together, .cat-errands, .cat-organizing, .cat-other),
.task-row :is(.cat-kitchen, .cat-pets, .cat-laundry, .cat-cleaning, .cat-garden, .cat-together, .cat-errands, .cat-organizing, .cat-other) { background: var(--surface-2); }

/* ================================================================== 8. generic rows */
.history-row, .list-row, .confirm-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 56px; background: var(--group-bg, var(--surface)); border: 0; border-radius: var(--r); }
.history-row { --div-inset: 68px; }
.history-row strong, .list-row strong { overflow-wrap: anywhere; }
.confirm-row { flex-wrap: wrap; row-gap: 10px; }
.confirm-row > .grow { flex: 1 1 220px; }
.confirm-row > .actions { margin: 0 0 0 auto; }
.history-row.reversed { opacity: .75; }
.history-row.reversed strong { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--muted); }
.thumb { width: 40px; height: 40px; border-radius: var(--r-sm); overflow: hidden; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; cursor: zoom-in; }
.thumb.loaded img { opacity: 1; }
.photo-full { margin: 0; width: 100%; height: auto; max-height: 75vh; cursor: default; background: none; }
.photo-full img { object-fit: contain; max-height: 75vh; height: auto; }
.list-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px; border: 0; border-radius: var(--r); background: var(--group-bg, var(--surface)); color: inherit; text-align: left; cursor: pointer; transition: background .15s var(--ease); }
.list-btn:hover { background: var(--surface-2); }
.list-btn.selected, .list > .list-btn.selected { background: var(--primary-soft); }
.list-btn.selected > .icon:last-child { color: var(--primary-strong); }
.list-btn.selected .meta, .choice.selected .meta { color: var(--ink-2); }
.list-btn > .icon:last-child, .list-btn .chev { color: var(--muted); }
.event-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 16px 10px 14px; border: 0; border-radius: var(--r); background: var(--surface); color: inherit; text-align: left; cursor: pointer; transition: background .15s var(--ease); }
.event-row:hover { background: var(--surface-2); }
.event-row strong { overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ev-date { display: flex; flex-direction: column; min-width: 68px; font-size: .8125rem; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev-date b { color: var(--ink); font-size: .875rem; font-weight: 650; }
.ev-bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--ev, var(--c-plum)); flex: none; min-height: 32px; }
.progress { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--primary); transition: width .4s var(--ease); }

/* ================================================================== 9. cards (goals, Spark actions, rewards, Flow, Plus) */
.goal-card { display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 16px; border: 0; border-radius: var(--r); background: var(--group-bg, var(--surface)); box-shadow: none; text-align: left; cursor: pointer; color: inherit; transition: background .15s var(--ease); }
.goal-card:hover { background: color-mix(in srgb, var(--surface) 70%, var(--surface-2)); }
.goal-card .grow { display: flex; flex-direction: column; gap: 6px; }
.goal-card strong { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.goal-card .progress { margin-top: 2px; }
.goal-card.achieved .goal-ico { background: var(--success-soft); color: var(--success); }
.goal-card.action.cancelled, .goal-card.action.expired, .goal-card.action.completed { opacity: .7; box-shadow: none; }
.goal-card.action.unlocked .goal-ico { background: var(--accent-soft); color: var(--accent-ink); }
.goal-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); flex: none; background: var(--surface-2); color: var(--ink-2); }
.goal-badges, .reward-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.reward-tags:empty { display: none; }
.meta.mine { color: var(--primary-strong); font-weight: 600; }
.goal-progress { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r); background: var(--surface-2); }
.goal-progress strong { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.goal-progress .progress { background: var(--surface); }
.milestones, .links, .privacy-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.milestones li { display: flex; align-items: center; gap: 8px; }
.milestones .check { flex: 1; }
.milestones .check input:checked + span { color: var(--muted); text-decoration: line-through; }
.links li.list-row { min-height: 52px; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.progress-form .field { flex: 1 1 140px; }
.history > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; color: var(--ink-2); font-size: .9rem; }
.history > summary::-webkit-details-marker { display: none; }
.history > summary::before { content: "›"; display: inline-block; width: 14px; text-align: center; color: var(--muted); transition: transform var(--dur) var(--ease); }
.history[open] > summary::before { transform: rotate(90deg); }
.history .list { margin-top: 6px; }
.reward-text { display: flex; gap: 10px; align-items: flex-start; }
.reward-text > span { display: flex; flex-direction: column; gap: 2px; }
.privacy-facts { gap: 6px; }
.privacy-facts li { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); font-size: .875rem; }
.privacy-facts .icon { margin-top: 3px; color: var(--primary-strong); }
.conflicts:empty { display: none; }
.sub-sec { border-top: 1px solid var(--line); padding-top: 4px; }
.sub-sec > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 600; list-style: none; }
.sub-sec > summary::-webkit-details-marker { display: none; }
.sub-sec > summary .chev { margin-left: auto; color: var(--muted); transition: transform var(--dur) var(--ease); }
.sub-sec[open] > summary .chev { transform: rotate(180deg); }

/* Flow recommendation: an explained suggestion, never an order */
.flow-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 0; background: var(--surface); }
.flow-head { display: flex; align-items: center; gap: 8px; }
.flow-head .flow-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); flex: none; }
.flow-head .overline { color: var(--primary-strong); font-size: .72rem; }
.flow-card p { line-height: 1.5; color: var(--ink); }
.flow-card .actions { margin-top: 0; }
.flow-card .hint { font-size: .8125rem; }
.recap-card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.recap-card .flow-head .overline { color: var(--primary-strong); font-size: .72rem; }
.recap-big { font-size: 1.25rem; font-weight: 750; letter-spacing: -.01em; line-height: 1.3; color: var(--ink); }
.recap-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: .9rem; line-height: 1.4; }
.recap-facts li { display: flex; gap: 8px; align-items: flex-start; }
.recap-facts .icon { flex: none; margin-top: 3px; color: var(--muted); }
.nudge-card { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); }
.nudge-card .flow-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-strong); flex: none; }
.nudge-card .grow { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.nudge-card p { line-height: 1.45; color: var(--ink); }
.nudge-card .actions { margin-top: 0; }
.plus-hint { display: flex; gap: 6px; align-items: flex-start; }
.plus-hint .icon { flex: none; margin-top: 2px; color: var(--primary-strong); }
.flow-item { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.flow-item .meta { color: var(--muted); }

/* ================================================================== 10. sheets, dialogs, toast, celebration */
.dialog-backdrop { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: var(--backdrop); animation: fade .18s var(--ease); }
.dialog { --group-bg: var(--surface-2); --chip-bg: var(--surface-2); --seg-track: var(--surface-2); position: relative; width: 100%; max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain; background: var(--surface); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--shadow-2);
  padding: 0 var(--pad) calc(20px + env(safe-area-inset-bottom, 0px)); animation: rise .24s var(--ease); }
.sheet-grip { position: sticky; top: 0; z-index: 2; display: block; width: 36px; height: 4px; margin: 0 auto; border-radius: 2px; background: var(--line-strong); }
.sheet-grip-wrap { position: sticky; top: 0; z-index: 2; margin: 0 calc(-1 * var(--pad)); padding: 10px 0 2px; background: var(--surface); }
.dialog:not(.sheet) { width: min(440px, calc(100% - 32px)); border-radius: var(--r-lg); margin: auto; padding: 0 20px 20px; }
.dialog:not(.sheet) .sheet-grip-wrap { display: none; }
.dialog-backdrop:has(.dialog:not(.sheet)) { align-items: center; }
.dialog.wide { width: min(720px, calc(100% - 24px)); }
.dialog-head { position: sticky; top: 16px; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 0 12px; margin-right: -8px; background: var(--surface); }
.dialog:not(.sheet) .dialog-head { top: 0; padding-top: 18px; }
.dialog-head > div { flex: 1; min-width: 0; padding-top: 8px; }
.dialog-head h2 { font-size: 1.1875rem; font-weight: 700; letter-spacing: -.012em; overflow-wrap: anywhere; }
.dialog-head .muted { font-size: .85rem; margin-top: 2px; }
.dialog-body { display: flex; flex-direction: column; gap: 16px; }
.sheet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--muted); font-size: .9rem; }
.sheet-meta .sparks { font-size: .9rem; }
.sheet-desc { color: var(--ink-2); line-height: 1.5; }
.dialog-body > p, .dialog-body .stack > p:not(.hint):not(.form-error):not(.form-ok):not(.notice):not(.status-line) { line-height: 1.5; }
.dialog-body h3 { margin-top: 8px; }
.dialog-body h3:first-child { margin-top: 0; }
/* sticky action bar for long forms (opt-in via .actions.sticky): flush with the sheet bottom, divider on top */
.dialog .actions.sticky { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom, 0px)); z-index: 1; margin: 6px calc(-1 * var(--pad)) calc(-20px - env(safe-area-inset-bottom, 0px)); padding: 12px var(--pad) calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
.dialog:not(.sheet) .actions.sticky { position: static; margin: 4px 0 0; padding: 0; border: 0; }
.dialog-body .skeleton { height: 48px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(32px); opacity: .6; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 86px + env(safe-area-inset-bottom, 0px)); z-index: 60; transform: translate(-50%, 20px); width: max-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--toast-bg); color: var(--toast-ink); font-weight: 550; font-size: .92rem; line-height: 1.4; box-shadow: var(--shadow-2);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); }
.app.plain ~ .toast { bottom: 24px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.error { background: var(--toast-error); } .toast.success { background: var(--toast-success); }
.toast-action { flex: none; border: 0; background: none; color: var(--toast-action); font-weight: 750; min-height: 44px; padding: 4px 8px; margin: -8px -8px -8px 0; border-radius: var(--r-sm); cursor: pointer; }
.spark-burst { --x: 50%; --y: 45%; position: fixed; left: var(--x); top: var(--y); z-index: 70; pointer-events: none; }
.spark-burst i { position: absolute; width: 9px; height: 9px; margin: -4px; border-radius: 2px; background: var(--spark); transform: rotate(var(--a)) translateY(0); animation: burst .8s var(--ease) forwards; }
.spark-burst i:nth-child(2n) { background: var(--primary); } .spark-burst i:nth-child(3n) { background: var(--accent); border-radius: 50%; }
@keyframes burst { to { transform: rotate(var(--a)) translateY(-70px) scale(.3); opacity: 0; } }

/* ================================================================== 11. Today */
.sparks-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 44px; padding: 4px 10px 4px 6px; margin: -6px 0 0 -6px; border-radius: var(--r-pill); color: var(--muted); text-decoration: none; font-weight: 500; font-size: .9375rem; transition: background .15s var(--ease); }
.sparks-line:hover { background: var(--surface-2); }
.sparks-line .chev { display: inline-flex; color: var(--muted); margin-left: -4px; }
.sparks-line > span:not(.sparks):not(.badge) { white-space: nowrap; }
.today .page-head { flex-direction: column; align-items: flex-start; gap: 0; }
.today .page-head h1 { width: 100%; }

/* ================================================================== 12. Sparks & rewards */
.balance-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 16px 16px; border-radius: var(--r); background: var(--surface); border: 0; }
.balance-head > div { display: flex; flex-direction: column; gap: 6px; }
.balance-head .text-link { align-self: flex-end; }
.billing-note { align-items: flex-start; }
.billing-note .stack { gap: 10px; flex: 1; }
.plus-features h2 { font-size: 1rem; }
.balance-head .overline { margin-bottom: 2px; }
.reward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.reward-grid > .empty { grid-column: 1 / -1; }
.reward-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 0; }
.reward-card strong { overflow-wrap: anywhere; hyphens: auto; font-weight: 650; line-height: 1.3; padding-right: 36px; }
.reward-card.inactive { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.reward-card.inactive .reward-ico { background: var(--surface-3); color: var(--ink-2); }
.reward-ico { width: 48px; height: 48px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); margin-bottom: 4px; }
.reward-edit { position: absolute; top: 4px; right: 4px; }
.reward-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.reward-foot .small { font-size: .78rem; font-weight: 500; }
.reward-foot .badge { white-space: normal; max-width: 100%; }

/* ================================================================== 13. Profile: grouped settings */
.me-card { display: flex; align-items: center; gap: 16px; padding: 4px 2px; }
.me-avatar { position: relative; flex: none; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.me-cam { position: absolute; right: -3px; bottom: -3px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); border: 2px solid var(--bg); box-shadow: var(--shadow-1); }
.me-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.me-card h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-card .meta { font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-group { background: var(--group-bg, var(--surface)); border: 0; border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.settings-group > * { position: relative; }
.settings-group > * + *::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; height: 1px; background: var(--line); z-index: 1; }
.settings-sec > summary, .settings-row { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 12px 0 16px; cursor: pointer; font-weight: 500; list-style: none; color: var(--ink); text-decoration: none; transition: background .15s var(--ease); }
.settings-sec > summary:hover, .settings-row:hover { background: var(--surface-2); }
.settings-sec > summary::-webkit-details-marker { display: none; }
.settings-sec > summary > .icon:first-child, .settings-row > .icon:first-child { color: var(--ink-2); width: 22px; height: 22px; }
.settings-sec > summary span, .settings-row span { flex: 1; min-width: 0; }
.settings-sec > summary .chev, .settings-row .chev { color: var(--muted); transition: transform var(--dur) var(--ease); }
.settings-sec[open] > summary .chev { transform: rotate(180deg); }
.settings-row > span:not(.value) { flex: 1 0 auto; white-space: nowrap; }
.settings-row .value { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 500; font-size: .875rem; }
.settings-row .sparks { flex: none; }
.sec-body { padding: 4px 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.sec-body > .btn, .sec-body .stack > .btn, .sec-body .stack > a.btn { align-self: flex-start; }
.sec-body .stack > .btn.full, .sec-body .stack > .btn.primary { align-self: stretch; }
.sec-body h3 { margin-top: 6px; }
.members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.member { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.member + .member { border-top: 1px solid var(--line); }
.invite-card { display: flex; flex-direction: column; gap: 10px; }
.invite-code { font-size: 1.75rem; font-weight: 750; letter-spacing: .16em; text-align: center; font-variant-numeric: tabular-nums; padding: 14px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink); }
.version-line { text-align: center; padding: 8px 0 0; }

/* ================================================================== 14. Plus */
.feature-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; }
.feature-list .icon { color: var(--primary-strong); background: var(--primary-soft); border-radius: 50%; padding: 4px; width: 24px; height: 24px; margin-top: 0; flex: none; }
.plans { display: grid; gap: 10px; }
.plan-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 0; border-radius: var(--r); background: var(--group-bg, var(--surface)); }
.plan-card .price { font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.plan-card .badge { align-self: flex-start; }
.plan-card .btn { margin-top: 4px; }
.paywall { display: flex; flex-direction: column; gap: 14px; padding: 22px 18px 18px; border-radius: var(--r-lg); background: var(--surface); }
.pw-title { font-size: 1.5rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.paywall .lead { margin-top: -6px; }
.pw-benefits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pw-benefits li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; color: var(--ink); }
.pw-ico { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); }
.plan-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.plan-opt { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 14px; border-radius: var(--r); border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); text-align: left; font: inherit; cursor: pointer; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.plan-opt:hover { background: var(--surface-2); }
.plan-opt.on { border-color: var(--primary-strong); background: var(--primary-soft); }
.plan-opt .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plan-radio { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--outline); display: grid; place-items: center; }
.plan-opt.on .plan-radio { border-color: var(--primary-strong); }
.plan-opt.on .plan-radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary-strong); }
.plan-price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: none; }
.plan-price b { font-size: 1.05rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.plan-save { position: absolute; top: -10px; right: 12px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--primary-strong); color: var(--on-primary); font-size: .72rem; font-weight: 700; letter-spacing: .01em; }
.pw-fine { color: var(--muted); font-size: .78rem; line-height: 1.45; text-align: center; }
.plus-how .list-row { gap: 12px; align-items: flex-start; }
.plus-how .list-row > .icon { color: var(--primary-strong); flex: none; margin-top: 2px; }
.plus-status { display: flex; align-items: center; gap: 12px; }
.plus-status.on { background: var(--surface); }
.plus-status.on > .icon { color: var(--primary-strong); }
.free-note { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--ink-2); }
.free-note .icon { color: var(--primary-strong); flex: none; margin-top: 2px; }
.week-nav { display: flex; align-items: center; gap: 4px; }
.week-nav .week-title { flex: 1; text-align: center; font-weight: 650; font-size: .95rem; font-variant-numeric: tabular-nums; }
.plan-day { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-radius: var(--r); background: var(--surface); border: 0; }
.plan-day h3 { font-size: .95rem; }
.plan-day .list-row { padding: 6px 0 6px 4px; min-height: 48px; border: 0; border-radius: 0; background: none; }
.plan-day .list-row + .list-row { border-top: 1px solid var(--line); }
.plan-day .btn { align-self: flex-start; }
.week-bars, .people-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.week-bars li { display: grid; grid-template-columns: 64px 1fr 28px; align-items: center; gap: 10px; }
.week-bars .bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.week-bars .bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.people-list li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--surface); border: 0; border-radius: var(--r); }
.update-required { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }

/* ================================================================== 15. onboarding · auth · setup */
.onboarding, .auth, .setup { display: flex; flex-direction: column; gap: 20px; min-height: min(calc(100dvh - 60px), 780px); }
.onb-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lang-switch { display: flex; gap: 3px; padding: 3px; background: var(--surface-2); border-radius: var(--r-pill); }
.lang-switch button { border: 0; background: none; min-height: 40px; padding: 4px 14px; border-radius: var(--r-pill); font-weight: 650; font-size: .85rem; color: var(--muted); cursor: pointer; }
.lang-switch [aria-pressed="true"] { background: var(--seg-on); color: var(--ink); box-shadow: var(--shadow-1); }
.onb-top { justify-content: flex-end; }
.onb-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 7vh; text-align: center; }
.onb-hero img { width: 76px; height: 76px; border-radius: 20px; box-shadow: var(--shadow-2); margin-bottom: 10px; }
.onboarding h1 { text-align: center; font-size: 2rem; letter-spacing: -.025em; }
.onboarding .lead { text-align: center; font-size: 1.05rem; max-width: 30ch; margin: 0 auto; }
.onb-points { list-style: none; margin: 16px auto 0; padding: 0; width: min(320px, 100%); display: flex; flex-direction: column; gap: 4px; }
.onb-points li { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 4px; font-size: 1rem; color: var(--ink); }
.onb-ico { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); }
.onb-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.auth-head, .setup-head { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding-top: 8px; }
.auth-head img, .setup-head img { border-radius: 14px; margin-bottom: 10px; }
.auth form, .setup form { gap: 16px; }
.auth .text-link { align-self: flex-start; margin: -4px 0 0 -6px; }
.auth-switch { text-align: center; color: var(--muted); font-size: .95rem; padding: 4px 0; }
.auth-switch a { font-weight: 650; display: inline-block; padding: 8px 4px; }
.step-label { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 14px 16px; border-radius: var(--r); border: 0; background: var(--group-bg, var(--surface)); color: inherit; text-align: left; cursor: pointer; transition: background .15s var(--ease), box-shadow .15s var(--ease); }
.choice > span:last-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.choice.selected { background: var(--surface); box-shadow: inset 0 0 0 2px var(--primary-strong); }
.choice-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.choice.selected .choice-ico { background: var(--primary-soft); color: var(--primary-strong); }
.tpl { display: flex; flex-direction: column; gap: 6px; }
.tpl legend { margin-bottom: 2px; }
.tpl .hint { margin-bottom: 6px; }
.tpl-item { align-items: center; padding: 8px 14px; min-height: 56px; border-radius: var(--r); border: 0; background: var(--group-bg, var(--surface)); }
.tpl-item .task-ico { width: 36px; height: 36px; border-radius: 10px; }
.tpl-item .task-ico { background: var(--surface); color: var(--ink-2); }
.explain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.explain li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--group-bg, var(--surface)); border: 0; line-height: 1.45; }
.explain .icon { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); }
.join-preview { display: flex; align-items: center; gap: 12px; }
.join-preview > .icon { color: var(--primary-strong); }

/* ================================================================== 17. responsiveness, motion, forced colours */
@media (min-width: 600px) {
  :root { --pad: 24px; }
  .dialog.sheet { width: min(560px, calc(100% - 32px)); border-radius: var(--r-lg); margin: auto; padding-bottom: 20px; }
  .dialog.sheet .sheet-grip-wrap { display: none; }
  .dialog.sheet .dialog-head { top: 0; padding-top: 18px; }
  .dialog.sheet .actions.sticky { bottom: -20px; margin-bottom: -20px; padding-bottom: 16px; }
  .dialog-backdrop { align-items: center; }
  .plans { grid-template-columns: 1fr 1fr; }
}
/* Desktop (3.5.1): navigation as a left rail, content centred in the remaining space, wider calendar */
@media (min-width: 1024px) {
  :root { --rail-w: 232px; --content-w: 760px; }
  .app.with-shell { padding-left: var(--rail-w); padding-bottom: 96px; }
  .topbar { padding-left: 16px; padding-right: 16px; }
  .topbar-inner { width: 100%; }
  .bottom-nav { inset: calc(var(--top-h) + env(safe-area-inset-top, 0px)) auto 0 0; width: var(--rail-w); height: auto; display: flex; flex-direction: column; gap: 2px;
    padding: 16px 12px; border-top: 0; border-right: 1px solid var(--line); background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .bottom-nav a { flex-direction: row; justify-content: flex-start; gap: 14px; min-height: 48px; padding: 0 14px; border-radius: var(--r-btn); font-size: .95rem; font-weight: 550; color: var(--ink-2); }
  .bottom-nav a .icon { width: 22px; height: 22px; margin: 0; }
  .bottom-nav a:hover { background: var(--surface-2); color: var(--ink); }
  .bottom-nav a.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 700; }
  .bottom-nav a:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
  .fab { bottom: 28px; right: max(24px, calc((100vw - var(--rail-w) - var(--content-w)) / 2 + 16px)); }
  .app.with-shell ~ .toast { left: calc(50% + var(--rail-w) / 2); bottom: 28px; }
  .app.with-shell main:has(> .page.calendar) { width: min(1180px, 100%); }
}
@media (max-width: 359px) {
  :root { --pad: 12px; }
  h1 { font-size: 1.35rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: 1fr; }
  .segmented > button, .segmented > label { font-size: .8rem; padding: 4px 2px; }
  .task-row { padding-right: 8px; }
  .task-text strong { -webkit-line-clamp: 3; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .task-check .ring .icon { stroke-dashoffset: 0; }
}
@media (forced-colors: active) {
  .btn, .chip, .task-row, .card, .list-btn, .goal-card, .event-row, .settings-group { border: 1px solid CanvasText; }
  .task-check .ring { border-color: CanvasText; }
}

/* ================================================================== 18. Sparks tab rows, task form extras, week plan (3.2) */
.reward-row { --div-inset: 68px; display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 6px 14px 6px 8px; background: var(--surface); border: 0; border-radius: var(--r); }
.reward-row.inactive .task-text strong { color: var(--muted); }
.reward-row .task-main { padding-left: 8px; }
.reward-row .reward-ico { width: 40px; height: 40px; margin: 0; flex: none; border-radius: var(--r-sm); }
.reward-row .reward-ico .icon { width: 22px; height: 22px; }
.reward-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; max-width: 46%; }
.reward-side .badge { white-space: normal; text-align: right; }
.reward-side .small { font-size: .78rem; font-weight: 500; text-align: right; }
.action-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.action-grid .btn { flex: 1 1 130px; min-width: 0; padding-left: 10px; padding-right: 10px; gap: 6px; overflow-wrap: normal; hyphens: manual; }
.action-grid .more-btn { flex: none; width: 52px; padding: 0; }
/* in sheets only the primary action carries colour; second actions stay neutral */
.action-grid .btn.tonal, .action-grid .more-btn { background: var(--surface-2); color: var(--ink); }
.action-grid .btn.tonal:hover, .action-grid .more-btn:hover { background: var(--surface-3); }
.more-options { border: 0; border-radius: var(--r-btn); background: var(--group-bg, var(--surface)); }
.more-options > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px 0 14px; font-weight: 600; cursor: pointer; list-style: none; }
.more-options > summary::-webkit-details-marker { display: none; }
.more-options > summary > span { flex: 1; }
.more-options > summary .chev { color: var(--muted); transition: transform var(--dur) var(--ease); }
.more-options[open] > summary .chev { transform: rotate(180deg); }
.more-options > .stack { padding: 4px 14px 14px; }
.actions.center { justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.tpl-list { gap: 6px; }
.list-sub { font-size: .875rem; font-weight: 600; color: var(--muted); margin: 10px 4px 0; }
.plan-day.free { flex-direction: row; align-items: center; gap: 10px; min-height: 48px; padding: 2px 4px 2px 14px; }
.plan-day.free .btn { align-self: center; flex: none; }
.plan-day.free strong { font-size: .95rem; }
.plan-day.free .meta { display: block; font-size: .78rem; }
.flow-text { display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.flow-item .flow-ico { flex: none; margin-top: 1px; }

/* ================================================================== 19. household page (3.3) */
.hh-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.hh-head .goal-ico { width: 48px; height: 48px; border-radius: 50%; }
.hh-head h2 { font-size: 1.1875rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.hh-head .meta { display: block; margin-top: 2px; }
.household .members { gap: 0; }
.household .member { width: 100%; }
.household .member.static { cursor: default; }
.household .member.static:hover { background: none; }
.household .sec-body h4 { margin-top: 6px; }
.invite-row strong { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.invite-sheet .invite-code { text-align: center; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 8px 0 4px; }
.hh-switch .icon.muted { flex: none; }
