/* Family Hub, matched to the reference designs: soft lilac-grey canvas, white
   sidebar and top bar, rich purple actions, page banners and tinted cards
   (mint, peach, lilac, pink, soft yellow, sky). */
:root {
  --bg: #f5f4fa; --side: #fcfbff; --top: #fbfbfd; --surface: #ffffff; --surface-2: #f4f1fb; --surface-3: #ebe6f7;
  --border: #e6e1f1; --border-strong: #cfc6e4;
  --text: #241a3a; --text-2: #4b4163; --muted: #6a6180;
  --accent: #6744e0; --accent-edge: #4d25c4; --accent-hover: #5b37d4; --accent-bg: #efe7ff; --accent-text: #5a2fd0; --on-accent: #ffffff;
  --danger: #b42318; --danger-bg: #fde8e7; --warning: #8a4b00; --warning-bg: #fff0d4; --info: #124b7d; --info-bg: #dcedfb;
  --chart: #7a52e0; --chart-hi: #e07a2f;
  /* tints: card/banner background, stronger chip background, ink */
  --lilac: #f1ebff;  --lilac-chip: #e3d9ff;  --lilac-ink: #5a2fd0;
  --mint: #e8f7f0;   --mint-chip: #cdeedd;   --mint-ink: #1d6b48;
  --peach: #fef2e6;  --peach-chip: #fddcc4;  --peach-ink: #9a3f18;
  --pink: #fcebf5;   --pink-chip: #f8d3e6;   --pink-ink: #9b2a63;
  --yellow: #fff5da; --yellow-chip: #fde6a0; --yellow-ink: #6e5100;
  --sky: #e8f2fc;    --sky-chip: #cfe3f8;    --sky-ink: #1c5a96;
  --grape: #ede8ff;  --grape-chip: #ddd2ff;  --grape-ink: #4f2bb8;
  --radius: 14px; --radius-card: 22px; --nav-w: 216px;
  font-family: "Segoe UI Variable Text", "Segoe UI", "Noto Sans", Roboto, system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15111d; --side: #1b1525; --top: #1b1525; --surface: #211a2d; --surface-2: #2a2139; --surface-3: #342945;
    --border: #342a45; --border-strong: #4c3f63;
    --text: #f3eefc; --text-2: #d3c9e6; --muted: #b0a4c9;
    --accent: #8f6dff; --accent-edge: #6a45e8; --accent-hover: #9d7fff; --accent-bg: #33265a; --accent-text: #cdb9ff; --on-accent: #ffffff;
    --danger: #ffaba4; --danger-bg: #4a1714; --warning: #ffcf7a; --warning-bg: #45300a; --info: #a6d0f5; --info-bg: #0e2c4b;
    --chart: #a98bff; --chart-hi: #f5a35c;
    --lilac: #2a2045;  --lilac-chip: #3a2d62;  --lilac-ink: #d4c4ff;
    --mint: #15302a;   --mint-chip: #1d4639;   --mint-ink: #9fe8c9;
    --peach: #362319;  --peach-chip: #4d2f20;  --peach-ink: #ffc6a3;
    --pink: #351b2b;   --pink-chip: #4c2340;   --pink-ink: #ffb8d8;
    --yellow: #332a12; --yellow-chip: #4a3c15; --yellow-ink: #f7dc7c;
    --sky: #142a40;    --sky-chip: #1c3b5a;    --sky-ink: #a6d0f5;
    --grape: #2c2250;  --grape-chip: #3b2d6b;  --grape-ink: #d9c9ff;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1 { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: 20px; font-weight: 800; margin: 0 0 .6rem; letter-spacing: -.02em; }
h3 { font-size: 15px; font-weight: 700; margin: 0 0 .5rem; }
p { margin: 0 0 .5rem; }
a { color: var(--accent-text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 30; border-radius: 12px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.boot { padding: 2rem; color: var(--muted); }

/* tints (the .bg-* backgrounds are at the end of the file so they win over .card) */
.ink-lilac { color: var(--lilac-ink); } .ink-mint { color: var(--mint-ink); } .ink-peach { color: var(--peach-ink); }
.ink-pink { color: var(--pink-ink); } .ink-yellow { color: var(--yellow-ink); } .ink-sky { color: var(--sky-ink); } .ink-grape { color: var(--grape-ink); }
.tint-lilac { background: var(--lilac-chip); color: var(--lilac-ink); }
.tint-mint { background: var(--mint-chip); color: var(--mint-ink); }
.tint-peach { background: var(--peach-chip); color: var(--peach-ink); }
.tint-pink { background: var(--pink-chip); color: var(--pink-ink); }
.tint-yellow { background: var(--yellow-chip); color: var(--yellow-ink); }
.tint-sky { background: var(--sky-chip); color: var(--sky-ink); }
.tint-grape { background: var(--grape-chip); color: var(--grape-ink); }
.chip { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* shell: sidebar | (top bar + content) */
.app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
.nav { background: var(--side); border-right: 1px solid var(--border); padding: 22px 14px 16px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.03em; padding: 0 8px 22px; display: flex; gap: 12px; align-items: center; color: var(--text); }
.brand .chip { width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: #fff; box-shadow: inset 0 -3px 0 var(--accent-edge); }
.nav-label { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 10px 8px; margin: 0; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; min-height: 44px; border-radius: 12px; color: var(--text-2); text-decoration: none; font-weight: 700; font-size: 15px; }
.nav a .ic { width: 19px; height: 19px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-bg); color: var(--accent-text); }
.nav .who { margin-top: auto; padding-top: 12px; }
.nav .who a { font-weight: 600; font-size: 14px; }
.side-note { font-size: 12px; color: var(--muted); padding: 8px 10px 0; line-height: 1.4; }
.side-note strong { color: var(--text-2); display: block; }
.col { min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--top); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 14px clamp(16px, 2.2vw, 30px); position: sticky; top: 0; z-index: 4; }
.crumbs { font-weight: 600; color: var(--text-2); font-size: 15px; margin-right: auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs strong { color: var(--text); font-weight: 700; }
main { padding: 24px clamp(16px, 2.2vw, 30px) 110px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fab { display: none; }

/* page banner */
.page-hero { border-radius: 30px; padding: 30px 28px 32px; margin-bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 6px; }
.eyebrow .ic { width: 18px; height: 18px; }
.page-hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; letter-spacing: -.045em; line-height: 1.05; }
.page-hero .sub { color: var(--text-2); font-size: 15.5px; margin: 10px 0 0; }

/* tablet: icon rail */
@media (max-width: 1024px) and (min-width: 761px) {
  .app { grid-template-columns: 84px minmax(0, 1fr); }
  .nav { padding: 18px 10px; align-items: center; }
  .brand span:not(.chip), .nav-label, .nav a > span:not(.avatar), .nav .who .label, .side-note { display: none; }
  .brand { padding: 0 0 18px; }
  .nav a { justify-content: center; padding: 6px; width: 56px; }
}
/* phone: bottom bar, compact top bar, floating quick add */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; flex-direction: row; border-right: 0; border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); overflow-x: auto; z-index: 5; gap: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .brand, .nav-label, .nav .who, .side-note { display: none; }
  .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 6px; min-width: 70px; min-height: 56px; justify-content: center; font-weight: 700; }
  .topbar { padding: 10px 16px; }
  .topbar .quick-top { display: none; }
  .fab { display: inline-flex; position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 6; width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; align-items: center; justify-content: center; box-shadow: inset 0 -4px 0 var(--accent-edge), 0 8px 22px rgba(103, 68, 224, .35); cursor: pointer; }
  .fab .ic { width: 28px; height: 28px; stroke-width: 2.4; }
  main { padding-top: 16px; }
  .page-hero { padding: 22px 20px 24px; border-radius: 24px; }
}

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 20px 20px; margin-bottom: 18px; }
.card[class*="bg-"] { border-color: transparent; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.link { font-weight: 800; font-size: 14px; color: var(--accent-text); text-decoration: none; background: none; border: 0; padding: 6px 0; cursor: pointer; font-family: inherit; }
.link:hover { text-decoration: underline; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.two { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); align-items: start; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px 18px; text-decoration: none; color: inherit; display: block; }
.tile[class*="bg-"] { border-color: transparent; }
a.tile:hover { outline: 2px solid var(--border-strong); }
.tile .l { font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.tile .v { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.25; margin-top: 4px; }
.tile .s { font-size: 13px; color: var(--muted); }
.sum-card { border-radius: var(--radius-card); padding: 18px 18px 20px; text-decoration: none; color: inherit; display: block; }
.sum-card .card-head { margin-bottom: 10px; }
.sum-card .card-head h2 { font-size: 20px; }
.sum-card .v { font-size: 23px; font-weight: 800; letter-spacing: -.03em; }
.sum-card .s { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: inset 0 -3px 0 var(--accent-edge); padding-bottom: 2px; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.pill { border-radius: 999px; }
.btn:disabled { opacity: .6; cursor: progress; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--text-2); border-radius: 12px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { min-height: 36px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-weight: 700; font-size: 14px; color: var(--text); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent-bg); border-color: #d9cbff; color: var(--accent-text); }

/* status */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; margin-bottom: 8px; text-decoration: none; font-weight: 700; }
.alert.danger { background: var(--danger-bg); color: var(--danger); }
.alert.warning { background: var(--warning-bg); color: var(--warning); }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert.ok { background: var(--surface); color: var(--mint-ink); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge .ic { width: 14px; height: 14px; }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.ok { background: var(--mint); color: var(--mint-ink); }
.badge.pts { background: var(--lilac-chip); color: var(--lilac-ink); }

table.list { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.list th { text-align: left; font-weight: 800; color: var(--muted); font-size: 12.5px; padding: 8px; border-bottom: 1px solid var(--border); }
table.list td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--chart); }
.bg-mint .progress { background: rgba(29, 107, 72, .15); }
.bg-mint .progress > div { background: #3aa06f; }
.progress.warning > div { background: var(--chart-hi); }
.progress.danger > div { background: var(--danger); }
.budget-row { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-weight: 600; }

/* Today */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; background: var(--lilac); border-radius: 30px; padding: 0 0 0 34px; margin-bottom: 18px; overflow: hidden; min-height: 250px; }
.hero-text { padding: 30px 0; }
.hero .eyebrow { color: var(--lilac-ink); letter-spacing: .16em; font-size: 12px; }
.hero h1 { font-size: clamp(36px, 5.2vw, 56px); font-weight: 800; letter-spacing: -.05em; line-height: 1.02; }
.hero .sub { color: var(--text-2); font-size: 16px; margin: 12px 0 18px; }
.hero-art { width: clamp(220px, 30vw, 370px); height: auto; display: block; align-self: stretch; object-fit: cover; object-position: center; }
@media (prefers-color-scheme: dark) { .hero-art { border-radius: 24px; margin: 10px; } }
@media (max-width: 600px) {
  .hero { grid-template-columns: 1fr; padding: 22px 20px 0; min-height: 0; gap: 4px; }
  .hero-text { padding: 0; }
  .hero-art { width: 100%; max-width: 330px; justify-self: center; margin-bottom: 0; }
}
.week-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px 16px; margin-bottom: 18px; }
.week-card .wk { flex: none; font-weight: 800; line-height: 1.25; }
.week-card .wk small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; flex: 1; }
.day-btn { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 48px; padding: 4px 6px; border-radius: 14px; border: 1px solid transparent; background: var(--surface-2); color: var(--text-2); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.day-btn .dn { font-size: 18px; font-weight: 800; color: var(--text); }
.day-btn .dot { width: 6px; height: 6px; border-radius: 50%; background: #9a7cf0; }
.day-btn:hover { border-color: var(--border-strong); }
.day-btn[aria-pressed="true"] { background: var(--accent-bg); border-color: #d9cbff; color: var(--accent-text); }
.day-btn[aria-pressed="true"] .dn { color: var(--accent-text); }
.day-btn.today .dn { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
@media (max-width: 760px) {
  .week-card { flex-direction: column; align-items: stretch; }
  .day-btn { flex-direction: column; gap: 0; min-height: 60px; font-size: 12.5px; }
}
.plan-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; margin-bottom: 8px; text-decoration: none; color: inherit; }
.plan-row .k { font-weight: 800; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.plan-row .v { font-weight: 800; font-size: 16px; }
.plan-row .note { font-weight: 500; font-size: 13.5px; color: var(--muted); margin-left: 6px; }
.att-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 2px; border-bottom: 1px solid rgba(29, 107, 72, .14); text-decoration: none; color: var(--text); font-weight: 700; }
.att-row:last-child { border-bottom: 0; }
.att-row .lvl { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.att-row .lvl .ic { width: 16px; height: 16px; }
.att-row .lvl.danger { background: var(--danger-bg); color: var(--danger); }
.att-row .lvl.warning { background: var(--warning-bg); color: var(--warning); }
.att-row .lvl.info { background: var(--info-bg); color: var(--info); }

/* forms */
dialog { border: 0; border-radius: 24px; padding: 0; background: var(--surface); color: var(--text); width: min(540px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(30, 10, 80, .25); }
dialog::backdrop { background: rgba(36, 25, 61, .45); }
.dlg-form header { display: flex; justify-content: space-between; align-items: center; padding: 16px 14px 0 22px; }
.dlg-form h2 { margin: 0; font-size: 22px; }
.dlg-body { padding: 10px 22px; display: grid; gap: 14px; }
.dlg-form footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 20px; }
.form-error { color: var(--danger); margin: 0 22px; font-size: 14px; font-weight: 700; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 14px; font-weight: 700; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12.5px; }
.row2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
input, select, textarea { font: inherit; font-size: 16px; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 80px; }
input[type="checkbox"] { width: 24px; min-height: 24px; height: 24px; accent-color: #3aa06f; border-radius: 7px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.quick-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.quick-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; min-height: 88px; border-radius: 18px; border: 0; font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.quick-grid button:hover { outline: 2px solid var(--border-strong); }
.quick-grid .ic { width: 24px; height: 24px; }

/* charts */
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--chart); }
.chart .bar.hi { fill: var(--chart-hi); }
.chart .hit { fill: transparent; }
.chart .bar-g:hover .bar, .chart .bar-g:focus .bar { filter: brightness(1.15); }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }

/* shopping */
.shop-item { display: flex; align-items: center; gap: 12px; padding: 6px 2px; border-bottom: 1px solid var(--border); min-height: 54px; }
.shop-item:last-child { border-bottom: 0; }
.shop-item .name { flex: 1; font-weight: 700; }
.shop-item.done .name { text-decoration: line-through; color: var(--muted); font-weight: 600; }
.add-row { display: flex; gap: 8px; margin-bottom: 12px; }

/* sign-in / onboarding */
.picker { max-width: 560px; margin: 8vh auto; padding: 0 16px; grid-column: 1 / -1; width: 100%; }
.auth .brand { padding: 0 0 14px; }
.auth h1 { font-size: 34px; letter-spacing: -.04em; }
.auth-tabs { display: flex; gap: 4px; margin: 16px 0 12px; padding: 4px; background: var(--surface-3); border-radius: 14px; flex-wrap: wrap; }
.auth-tabs a { flex: 1; text-align: center; padding: 8px 12px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); text-decoration: none; border-radius: 11px; font-weight: 700; font-size: 14px; }
.auth-tabs a[aria-current="page"] { background: var(--surface); color: var(--accent-text); }

/* avatars: pastel circle, dark initial */
.avatar { --c: #6744e0; width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px;
  background: color-mix(in srgb, var(--c) 24%, #ffffff); color: color-mix(in srgb, var(--c) 70%, #000000); box-shadow: 0 0 0 2px var(--surface); flex: none; }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
@media (prefers-color-scheme: dark) { .avatar { background: color-mix(in srgb, var(--c) 45%, #211a2d); color: #ffffff; } }
.avatars { display: flex; }
.avatars .avatar + .avatar { margin-left: -6px; }
.swatch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.color-swatch { display: inline-block; width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch-input:checked + .color-swatch { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--surface); }
.swatch-input:focus-visible + .color-swatch { outline: 3px solid var(--accent); outline-offset: 2px; }

.demo-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--yellow); color: var(--yellow-ink); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 700; font-size: 14px; }
.demo-banner .btn { min-height: 34px; }
#toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; z-index: 40; max-width: 90vw; font-weight: 700; }
#toast[data-kind="error"] { background: var(--danger); color: #fff; }
.empty { text-align: center; padding: 24px 12px; color: var(--text-2); }

.sum-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* tinted backgrounds: last, so they override the white card surface */
.bg-lilac { background: var(--lilac); } .bg-mint { background: var(--mint); } .bg-peach { background: var(--peach); }
.bg-pink { background: var(--pink); } .bg-yellow { background: var(--yellow); } .bg-sky { background: var(--sky); } .bg-grape { background: var(--grape); }

/* celebration (brief; skipped when the user prefers reduced motion) */
.celebrate { position: fixed; inset: 0; pointer-events: none; z-index: 35; overflow: hidden; }
.celebrate i { position: absolute; top: 45%; left: 50%; width: 10px; height: 14px; border-radius: 3px; animation: burst 1.1s ease-out forwards; }
@keyframes burst {
  from { transform: translate(-50%, -50%) rotate(0); opacity: 1; }
  to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .celebrate { display: none; }
}
