/* OurCents — calm paper surfaces, hairline borders, colour only as accent */
:root {
  --bg: #F5F2EC; --surface: #FFFFFF; --surface2: #EFEBE3; --line: #E3DDD1;
  --ink: #1C1D24; --ink2: #696872; --a: #D9502F; --b: #17807A; --ours: #3F3A92;
  --a-soft: color-mix(in srgb, var(--a) 13%, transparent);
  --b-soft: color-mix(in srgb, var(--b) 13%, transparent);
  --ours-soft: color-mix(in srgb, var(--ours) 12%, transparent);
  --bad: #C2372B; --good: #2E7D4F;
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
  --display: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-mode="dark"] { color-scheme: dark; --bad: #FF8A7A; --good: #6FD39A; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; padding: 0 18px calc(110px + var(--safe-b)); position: relative; }

/* ---------- logo: two overlapping circles, the overlap is "ours" ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo svg { display: block; }
.logo .word { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.logo .word span { color: var(--ours); }

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.03em; margin: 0; font-weight: 750; font-optical-sizing: auto; }
h1 { font-size: clamp(30px, 8vw, 40px); line-height: 1.04; }
h2 { font-size: 22px; line-height: 1.15; }
h3 { font-size: 17px; }
.muted { color: var(--ink2); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink2); }
p { margin: 0; }

/* ---------- layout ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 10px; gap: 12px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.center { text-align: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.card.flat { background: transparent; }
.card + .card { margin-top: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 16px; transition: transform .12s ease, opacity .12s ease; width: 100%;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-soft { background: var(--surface2); color: var(--ink); }
.btn-link { background: none; border: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 0 6px; width: auto; font-weight: 500; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; width: auto; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; }

/* ---------- forms ---------- */
.field { display: block; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px 2px; }
.field small { display: block; color: var(--ink2); font-size: 13px; margin: 6px 2px 0; }
.input {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); outline: none; font-size: 16px;
}
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ours-soft); }
.input.code { text-transform: uppercase; letter-spacing: .18em; font-weight: 600; font-family: var(--display); font-size: 20px; text-align: center; }
.error { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; font-weight: 500; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); margin-top: 1px; flex: none; }

.seg { display: flex; background: var(--surface2); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 40px; border: 0; background: transparent; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- welcome ---------- */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; padding-top: 18px; }
.welcome .hero { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 30px 0; }
.welcome .hero h1 { margin-top: 26px; }
.welcome .hero p { margin-top: 14px; font-size: 18px; color: var(--ink2); max-width: 30ch; }
.welcome .actions > * + * { margin-top: 10px; }
.venn-art { width: min(260px, 70vw); }

/* ---------- codes ---------- */
.big-code { font-family: var(--display); font-size: 38px; font-weight: 700; letter-spacing: .12em; text-align: center; padding: 18px 8px; border: 1.5px dashed var(--line); border-radius: var(--r-lg); }
.rc { font-family: var(--display); font-size: clamp(16px, 4.6vw, 20px); font-weight: 600; letter-spacing: .04em; white-space: nowrap; text-align: center; padding: 14px 8px; background: var(--surface2); border-radius: var(--r-md); }

/* ---------- home ---------- */
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink2); padding: 6px 12px 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: block; }
.status-pill.off i { background: var(--ink2); }
.status-pill.busy i { background: var(--ours); animation: pulse 1s infinite ease-in-out; }
.status-pill.err i { background: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }

.pair { display: flex; align-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; border: 2px solid var(--a); color: var(--a); background: var(--a-soft); font-family: var(--display); }
.avatar.b { border-color: var(--b); color: var(--b); background: var(--b-soft); }
.avatar.ghost { border-style: dashed; border-color: var(--line); color: var(--ink2); background: transparent; }
.pair .avatar + .avatar { margin-left: -9px; }

.hero-card { padding: 22px 20px 20px; }
.hero-card .big { font-family: var(--display); font-size: clamp(34px, 10vw, 46px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; margin-top: 8px; }
.duo { margin-top: 18px; }
.duo-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface2); gap: 3px; }
.duo-bar > i { display: block; height: 100%; border-radius: 999px; }
.duo-bar .ia { background: var(--a); }
.duo-bar .ib { background: var(--b); }
.duo-legend { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.a { background: var(--a); } .dot.b { background: var(--b); } .dot.ours { background: var(--ours); }

.balance { display: flex; align-items: center; gap: 14px; }
.balance .arrow { flex: 1; height: 2px; background: linear-gradient(90deg, var(--from, var(--a)), var(--to, var(--b))); position: relative; border-radius: 2px; }
.balance .arrow::after { content: ''; position: absolute; right: -2px; top: -5px; border: 6px solid transparent; border-left-color: var(--to, var(--b)); border-right: 0; }
.balance .amt { font-family: var(--display); font-size: 22px; font-weight: 700; }

.invite { border-style: dashed; }

/* ---------- list ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 0; background: none; width: 100%; text-align: left; }
.item + .item { border-top: 1px solid var(--line); }
.item .meta { flex: 1; min-width: 0; }
.item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font-size: 13px; color: var(--ink2); }
.item .amount { font-weight: 600; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--surface2); color: var(--ink2); }
.tag.ours { background: var(--ours-soft); color: var(--ours); }
.empty { padding: 34px 20px; text-align: center; color: var(--ink2); }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10,10,14,.42); z-index: 40; animation: fade .15s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto;
  background: var(--bg); border-radius: 26px 26px 0 0; padding: 10px 18px calc(20px + var(--safe-b));
  max-height: 92dvh; overflow: auto; animation: rise .22s cubic-bezier(.2,.8,.2,1);
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.amount-input { font-family: var(--display); font-size: 44px; font-weight: 700; border: 0; background: transparent; width: 100%; text-align: center; outline: none; letter-spacing: -0.03em; padding: 6px 0; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.who { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.who button { min-height: 54px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; }
.who button.on.a { border-color: var(--a); background: var(--a-soft); }
.who button.on.b { border-color: var(--b); background: var(--b-soft); }

/* ---------- settings ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.theme-chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.theme-chip.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting select { border: 1px solid var(--line); background: var(--surface2); border-radius: var(--r-sm); padding: 8px 10px; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 60; animation: rise .2s ease; white-space: nowrap; }

.lang-select { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 12px; font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 700px) { #app { padding-top: 12px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.who button[disabled] { opacity: .4; }

/* =================== Phase 2 =================== */
.small { font-size: 13px; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.tb-title { font-weight: 700; font-family: var(--display); font-size: 18px; letter-spacing: -0.01em; }
.page { padding-bottom: 20px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset > * + * { margin-top: 14px; }
fieldset[disabled] { opacity: .65; }
.btn-link.small { font-size: 14px; min-height: 32px; color: var(--ink2); text-decoration: none; }
.btn-link.danger { color: var(--bad); width: 100%; }
.btn-add { margin-top: 10px; border-style: dashed; }
.notice { display: flex; gap: 8px; align-items: flex-start; background: var(--surface2); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; color: var(--ink2); }
.ic { flex: none; vertical-align: -3px; }

/* avatar sizes */
.avatar.xs { width: 20px; height: 20px; font-size: 10px; border-width: 1.5px; display: inline-grid; vertical-align: -5px; }
.avatar.lg { width: 58px; height: 58px; font-size: 22px; border-width: 3px; }

/* bottom navigation: flat bar, centre add button made of the two partner colours */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: end;
  max-width: 520px; margin: 0 auto; padding: 6px 10px calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.nav-tab { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink2); padding: 6px 0; min-height: 52px; justify-content: center; }
.nav-tab.on { color: var(--ink); }
.nav-tab.on .ic { stroke-width: 2.3; }
.nav-add { border: 0; background: none; display: grid; place-items: center; padding: 0; height: 60px; }
.nav-add span {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 50%, var(--a) 0 46%, transparent 47%), radial-gradient(circle at 70% 50%, var(--b) 0 46%, transparent 47%), var(--ours);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--ours) 35%, transparent); transform: translateY(-14px);
  border: 3px solid var(--bg);
}
.nav-add .ic { stroke-width: 2.6; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
#app { padding-bottom: calc(110px + var(--safe-b)); }

/* dashboard switch */
.view-seg { margin: 6px 0 14px; }
.view-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-seg .dot { margin: 0; }

.balance-card { width: 100%; text-align: left; margin-top: 12px; display: block; color: inherit; }
.pill-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--surface2); white-space: nowrap; }

/* three pots */
.pots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pot { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 12px 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; color: inherit; min-width: 0; }
.pot.a .ring { color: var(--a); } .pot.b .ring { color: var(--b); } .pot.ours .ring { color: var(--ours); }
.pot-ring { position: relative; margin-bottom: 6px; display: block; height: 44px; }
.pot-ring.locked .ic { position: absolute; left: 15px; top: 15px; color: var(--ink2); }
.pot-ring.locked .ring { opacity: .35; }
.pot-title { font-size: 12px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pot-main { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; }
.pot-sub { font-size: 12px; color: var(--ink2); line-height: 1.25; }

/* lists */
.emoji-dot { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface2); font-size: 19px; flex: none; }
.item .title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.item .amount { text-align: right; }
.item .amount small { display: block; font-size: 11px; color: var(--ink2); font-weight: 500; }
.item.paused { opacity: .55; }
.tag.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.date-chip { width: 42px; text-align: center; flex: none; line-height: 1.05; }
.date-chip b { display: block; font-family: var(--display); font-size: 20px; }
.date-chip small { font-size: 11px; color: var(--ink2); text-transform: uppercase; letter-spacing: .05em; }
.meter { height: 6px; border-radius: 99px; background: var(--surface2); overflow: hidden; margin: 6px 0 4px; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--ours); }
.meter.warn i { background: color-mix(in srgb, var(--ours) 50%, var(--b)); }
.meter.bad i, .meter.over i { background: var(--bad); }
.item.env .meta { min-width: 0; }

/* chips (radio inputs) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 12px -18px 0; padding: 0 18px 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip > span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.chip input:focus-visible + span { outline: 3px solid var(--ours-soft); }
.chip input:disabled + span { opacity: .4; }
.who-chips .chip.a input:checked + span { background: var(--a-soft); border-color: var(--a); color: var(--ink); }
.who-chips .chip.b input:checked + span { background: var(--b-soft); border-color: var(--b); color: var(--ink); }
.seg-chips { background: var(--surface2); border-radius: 999px; padding: 4px; gap: 4px; flex-wrap: nowrap; }
.seg-chips .chip { flex: 1; }
.seg-chips .chip > span { width: 100%; justify-content: center; border: 0; background: transparent; color: var(--ink2); min-height: 38px; }
.seg-chips .chip input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.cat-scroll { overflow-x: auto; margin: 0 -18px; padding: 0 18px 4px; scrollbar-width: none; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cats { flex-wrap: nowrap; }
.cats .chip > span { border-radius: var(--r-md); flex-direction: column; gap: 2px; min-height: 64px; min-width: 72px; padding: 8px 10px; font-size: 12px; justify-content: center; }
.cats .ce { font-size: 22px; }
.emoji-chips .chip > span { width: 46px; min-height: 46px; padding: 0; justify-content: center; font-size: 22px; border-radius: 14px; }
.emoji-chips .chip input:checked + span { background: var(--surface2); color: inherit; border-color: var(--ink); }
.chip-btn { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; min-height: 38px; padding: 0 14px; font-weight: 600; font-size: 14px; white-space: nowrap; color: var(--ink2); }
.chip-btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.custom-row { display: none; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.custom-row label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.input.pct { width: 74px; min-height: 44px; text-align: center; }
.split-help { display: block; color: var(--ink2); font-size: 13px; margin-top: 8px; }

/* conditional form parts (no JavaScript needed) */
.only-income, .only-t-income, .only-t-bill, .only-t-saving { display: none; }
form:has(input[name=kind][value=income]:checked) .only-spend { display: none; }
form:has(input[name=kind][value=income]:checked) .only-income { display: block; }
form:has(input[name=split][value=custom]:checked) .only-custom { display: flex; }
form:has(input[name=priv]:checked) .not-private { display: none; }
form:has(input[name=type][value=income]:checked) .only-t-income,
form:has(input[name=type][value=bill]:checked) .only-t-bill,
form:has(input[name=type][value=saving]:checked) .only-t-saving { display: block; }

.sheet-head h2 { font-size: 20px; }

/* log */
.month-switch { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 0; }
.month-switch strong { font-family: var(--display); font-size: 19px; text-transform: capitalize; }
.sum-line { display: flex; gap: 18px; margin: 14px 4px 4px; font-size: 14px; color: var(--ink2); }
.sum-line b { color: var(--ink); }
.day-head { font-size: 13px; font-weight: 700; color: var(--ink2); margin: 18px 4px 8px; text-transform: uppercase; letter-spacing: .06em; }

/* calendar */
.cal-card { padding: 12px 10px 14px; margin-top: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid.wd span { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink2); padding-bottom: 6px; }
.cal-cell { aspect-ratio: 1 / 1.12; border: 0; background: transparent; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 6px 0 0; gap: 3px; min-width: 0; color: inherit; }
.cal-cell.empty { pointer-events: none; }
.cal-cell b { font-size: 15px; font-weight: 600; line-height: 1; }
.cal-cell.past b { color: var(--ink2); }
.cal-cell.today b { background: var(--ink); color: var(--bg); border-radius: 999px; padding: 4px 7px; margin-top: -4px; }
.cal-cell.sel { background: var(--surface2); }
.cal-cell small { font-size: 9.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; max-width: 100%; }
.dots { display: flex; gap: 3px; height: 6px; }
.dots i, .cal-legend i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.d-inc { background: var(--good); }
.d-bill { border: 1.5px solid var(--ours); }
.d-spend { background: var(--ink2); }
.cal-legend { display: flex; justify-content: center; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--ink2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* plan */
.summary-card { display: flex; align-items: center; gap: 16px; }
.sum-ring { position: relative; display: grid; place-items: center; }
.sum-ring.ours .ring { color: var(--ours); }
.sum-ring b { position: absolute; font-size: 15px; font-family: var(--display); }
.big2 { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.big2 small { font-size: 14px; font-weight: 500; letter-spacing: 0; }
.goal-card { padding: 16px; }
.goal-top { display: flex; align-items: center; gap: 12px; border: 0; background: none; width: 100%; text-align: left; padding: 0; color: inherit; }
.goal-emoji { width: 46px; height: 46px; border-radius: 14px; background: var(--surface2); display: grid; place-items: center; font-size: 24px; flex: none; }
.goal-top .meta { flex: 1; min-width: 0; }
.goal-top .title { display: block; font-weight: 700; font-size: 17px; }
.goal-top .sub { font-size: 14px; color: var(--ink2); }
.goal-pct { font-family: var(--display); font-weight: 700; font-size: 20px; }
.goal-bar { margin: 14px 0 12px; height: 10px; }
.goal-foot { gap: 10px; }

/* person dashboard */
.hero-card.person { border-top: 4px solid var(--a); }
.hero-card.person.b { border-top-color: var(--b); }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stats3 small { display: block; font-size: 12px; color: var(--ink2); font-weight: 600; }
.stats3 b { font-family: var(--display); font-size: 22px; letter-spacing: -0.02em; }
.fun-card { margin-top: 12px; }
.fun-card.a .ring { color: var(--a); } .fun-card.b .ring { color: var(--b); }
.lock-ring { width: 64px; height: 64px; border-radius: 50%; border: 6px solid var(--surface2); display: grid; place-items: center; color: var(--ink2); }
.fun-ring { flex: none; }

/* settle */
.settle-hero { padding: 26px 20px 22px; }
.settle-pair { display: flex; align-items: center; justify-content: center; gap: 14px; }
.settle-arrow { width: 90px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--from), var(--to)); position: relative; }
.settle-arrow::after { content: ''; position: absolute; right: -3px; top: -6px; border: 7.5px solid transparent; border-left-color: var(--to); border-right: 0; }
button.setting { width: 100%; border: 0; background: none; text-align: left; color: inherit; font-size: inherit; }

.big { font-family: var(--display); font-size: clamp(34px, 10vw, 46px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.cats .chip > span .ce { font-size: 22px; }

/* =================== Signature Venn chart =================== */
.venn-chart { display: block; width: 100%; max-width: 440px; margin: 10px auto 0; height: auto; overflow: visible; }
.venn-chart .vc-name { font-size: 12px; font-weight: 700; fill: var(--ink2); letter-spacing: .02em; }
.venn-chart .vc-amt { font-size: 17px; font-weight: 700; fill: var(--ink); font-family: var(--display); }
.venn-chart .vc-heart { font-size: 14px; fill: #fff; opacity: .9; }

/* style picker */
.skin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.skin-chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: inherit; }
.skin-chip.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; }
.skin-prev { width: 46px; height: 34px; border-radius: 9px; position: relative; display: block; background: var(--bg); overflow: hidden; }
.skin-prev i { position: absolute; display: block; }
.sp-aurora { background: radial-gradient(circle at 25% 30%, var(--a), transparent 60%), radial-gradient(circle at 75% 70%, var(--b), transparent 60%), var(--ours); }
.sp-aurora i:first-child { left: 8px; right: 8px; bottom: 6px; height: 9px; border-radius: 5px; background: rgba(255,255,255,.6); }
.sp-pop { border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); background: var(--surface); width: 42px; height: 30px; }
.sp-pop i:first-child { left: 0; top: 0; bottom: 0; width: 50%; background: var(--a); }
.sp-pop i:last-child { right: 0; top: 0; bottom: 0; width: 50%; background: var(--b); }
.sp-clay { background: var(--surface2); box-shadow: inset 3px 3px 6px rgba(0,0,0,.12), inset -3px -3px 6px rgba(255,255,255,.7); }
.sp-clay i:first-child { left: 9px; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--a-soft); box-shadow: 2px 2px 4px rgba(0,0,0,.15), -2px -2px 4px rgba(255,255,255,.8); }
.sp-calm { border: 1px solid var(--line); }
.sp-calm i:first-child { left: 8px; right: 8px; top: 10px; height: 2px; background: var(--line); }

/* =========================================================================
   STYLE 1 — AURORA: the two partner colours glow and blend behind glass
   ========================================================================= */
:root[data-skin="aurora"] body {
  background:
    radial-gradient(600px 420px at -10% -8%, color-mix(in srgb, var(--a) 26%, transparent), transparent 70%),
    radial-gradient(560px 440px at 110% 4%, color-mix(in srgb, var(--b) 26%, transparent), transparent 70%),
    radial-gradient(700px 500px at 50% 115%, color-mix(in srgb, var(--ours) 16%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
:root[data-skin="aurora"] .card,
:root[data-skin="aurora"] .list,
:root[data-skin="aurora"] .pot,
:root[data-skin="aurora"] .icon-btn,
:root[data-skin="aurora"] .status-pill {
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-color: color-mix(in srgb, var(--surface) 70%, var(--line));
  box-shadow: 0 10px 30px -18px rgba(20, 15, 40, .35);
}
:root[data-skin="aurora"] .card, :root[data-skin="aurora"] .list { border-radius: 26px; }
:root[data-skin="aurora"] .pot { border-radius: 20px; }
:root[data-skin="aurora"] .item + .item { border-top-color: color-mix(in srgb, var(--line) 60%, transparent); }
:root[data-skin="aurora"] .hero-card.hero-us {
  color: #fff; border: 0;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--a) 90%, #fff 0%), transparent 58%),
    radial-gradient(120% 90% at 100% 100%, color-mix(in srgb, var(--b) 90%, #000 0%), transparent 58%),
    var(--ours);
  box-shadow: 0 22px 44px -22px color-mix(in srgb, var(--ours) 70%, transparent);
  position: relative; overflow: hidden;
}
:root[data-skin="aurora"] .hero-card.hero-us::after { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E"); pointer-events: none; mix-blend-mode: overlay; }
:root[data-skin="aurora"] .hero-us .eyebrow, :root[data-skin="aurora"] .hero-us .muted { color: rgba(255,255,255,.82); }
:root[data-skin="aurora"] .hero-us .venn-chart circle[stroke] { stroke: rgba(255,255,255,.95); }
:root[data-skin="aurora"] .hero-us .venn-chart circle[fill^="url"] { fill: rgba(255,255,255,.14); }
:root[data-skin="aurora"] .hero-us .venn-chart .vc-name { fill: rgba(255,255,255,.85); }
:root[data-skin="aurora"] .hero-us .venn-chart .vc-amt { fill: #fff; }
:root[data-skin="aurora"] .hero-us .venn-chart circle[clip-path] { fill: rgba(255,255,255,.32); opacity: 1; }
:root[data-skin="aurora"] .nav {
  left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); border-radius: 28px; padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--surface) 70%, var(--line));
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: 0 16px 40px -16px rgba(20,15,40,.45);
}
:root[data-skin="aurora"] .nav-add span { border-color: transparent; transform: translateY(-18px); }
:root[data-skin="aurora"] .seg { background: color-mix(in srgb, var(--surface) 45%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid color-mix(in srgb, var(--surface) 70%, var(--line)); }
:root[data-skin="aurora"] .btn-primary { background: var(--ink); box-shadow: 0 10px 24px -12px var(--ink); }
:root[data-skin="aurora"] .emoji-dot, :root[data-skin="aurora"] .goal-emoji { background: color-mix(in srgb, var(--surface2) 70%, transparent); }
:root[data-skin="aurora"] .sheet { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
:root[data-skin="aurora"] .avatar { box-shadow: 0 0 0 3px color-mix(in srgb, var(--surface) 60%, transparent); }

/* =========================================================================
   STYLE 2 — DUO POP: bold outlines, offset shadows, two-tone blocks
   ========================================================================= */
:root[data-skin="pop"] body { background-color: var(--bg); background-image: radial-gradient(color-mix(in srgb, var(--ink) 13%, transparent) 1px, transparent 1.4px); background-size: 18px 18px; }
:root[data-skin="pop"] .card, :root[data-skin="pop"] .list, :root[data-skin="pop"] .pot, :root[data-skin="pop"] .icon-btn {
  border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); border-radius: 18px; background: var(--surface);
}
:root[data-skin="pop"] .icon-btn { border-radius: 14px; }
:root[data-skin="pop"] .item + .item { border-top: 2px solid var(--ink); }
:root[data-skin="pop"] .hero-card.hero-us { background: linear-gradient(115deg, var(--a-soft) 0 50%, var(--b-soft) 50% 100%); }
:root[data-skin="pop"] .hero-us .big { font-size: clamp(40px, 12vw, 54px); }
:root[data-skin="pop"] .venn-chart circle[stroke] { stroke: var(--ink); stroke-width: 2.5; }
:root[data-skin="pop"] .venn-chart circle[fill^="url"] { fill: var(--surface); }
:root[data-skin="pop"] .venn-chart circle:nth-of-type(1)[fill^="url"] { fill: var(--a); }
:root[data-skin="pop"] .venn-chart circle:nth-of-type(2)[fill^="url"] { fill: var(--b); }
:root[data-skin="pop"] .venn-chart circle[clip-path] { fill: var(--ink); opacity: 1; }
:root[data-skin="pop"] .venn-chart .vc-name, :root[data-skin="pop"] .venn-chart .vc-amt { fill: #fff; paint-order: stroke; stroke: var(--ink); stroke-width: 3px; stroke-linejoin: round; }
:root[data-skin="pop"] .btn-primary { border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--a); }
:root[data-skin="pop"] .btn-ghost, :root[data-skin="pop"] .btn-soft, :root[data-skin="pop"] .pill-btn { border: 2px solid var(--ink); background: var(--surface); }
:root[data-skin="pop"] .btn:active, :root[data-skin="pop"] .pot:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
:root[data-skin="pop"] .seg { border: 2px solid var(--ink); background: var(--surface); }
:root[data-skin="pop"] .seg button.on { background: var(--ink); color: var(--bg); box-shadow: none; }
:root[data-skin="pop"] .chip > span, :root[data-skin="pop"] .chip-btn { border: 2px solid var(--ink); }
:root[data-skin="pop"] .emoji-dot, :root[data-skin="pop"] .goal-emoji { border: 2px solid var(--ink); background: var(--surface2); border-radius: 12px; }
:root[data-skin="pop"] .avatar { border-width: 2.5px; box-shadow: 2px 2px 0 var(--ink); }
:root[data-skin="pop"] .tag { border: 1.5px solid currentColor; }
:root[data-skin="pop"] .nav { border-top: 2px solid var(--ink); background: var(--surface); backdrop-filter: none; }
:root[data-skin="pop"] .nav-add span { border: 2.5px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); background: linear-gradient(90deg, var(--a) 0 50%, var(--b) 50%); border-radius: 18px; }
:root[data-skin="pop"] .pot.a { background: var(--a-soft); } :root[data-skin="pop"] .pot.b { background: var(--b-soft); } :root[data-skin="pop"] .pot.ours { background: var(--ours-soft); }
:root[data-skin="pop"] .meter, :root[data-skin="pop"] .duo-bar { border: 2px solid var(--ink); height: 12px; }
:root[data-skin="pop"] h1, :root[data-skin="pop"] h2, :root[data-skin="pop"] .tb-title { font-weight: 800; }
:root[data-skin="pop"] .sheet { border: 2px solid var(--ink); border-bottom: 0; }
:root[data-skin="pop"] .input { border: 2px solid var(--ink); }
:root[data-skin="pop"] .cal-cell.sel { background: var(--ours-soft); outline: 2px solid var(--ink); }

/* =========================================================================
   STYLE 3 — SOFT CLAY: puffy, tactile surfaces you want to press
   ========================================================================= */
:root[data-skin="clay"] { --clay-hi: rgba(255,255,255,.85); --clay-lo: color-mix(in srgb, var(--ink) 16%, transparent); }
:root[data-skin="clay"][data-mode="dark"] { --clay-hi: rgba(255,255,255,.06); --clay-lo: rgba(0,0,0,.55); }
:root[data-skin="clay"] body { background: var(--surface2); }
:root[data-skin="clay"] .card, :root[data-skin="clay"] .list, :root[data-skin="clay"] .pot, :root[data-skin="clay"] .icon-btn, :root[data-skin="clay"] .status-pill {
  border: 0; background: var(--surface2);
  box-shadow: 8px 8px 18px var(--clay-lo), -8px -8px 18px var(--clay-hi);
}
:root[data-skin="clay"] .card, :root[data-skin="clay"] .list { border-radius: 30px; }
:root[data-skin="clay"] .pot { border-radius: 24px; }
:root[data-skin="clay"] .item + .item { border-top: 1px solid color-mix(in srgb, var(--clay-lo) 50%, transparent); }
:root[data-skin="clay"] .hero-card.hero-us { background: linear-gradient(145deg, color-mix(in srgb, var(--a) 18%, var(--surface2)), color-mix(in srgb, var(--b) 18%, var(--surface2))); }
:root[data-skin="clay"] .venn-chart circle[stroke] { stroke-width: 0; }
:root[data-skin="clay"] .venn-chart circle:nth-of-type(1) { filter: drop-shadow(4px 6px 6px var(--clay-lo)); }
:root[data-skin="clay"] .venn-chart circle:nth-of-type(1)[fill^="url"] { fill: color-mix(in srgb, var(--a) 55%, var(--surface2)); }
:root[data-skin="clay"] .venn-chart circle:nth-of-type(2)[fill^="url"] { fill: color-mix(in srgb, var(--b) 55%, var(--surface2)); filter: drop-shadow(4px 6px 6px var(--clay-lo)); }
:root[data-skin="clay"] .venn-chart .vc-name, :root[data-skin="clay"] .venn-chart .vc-amt { fill: #fff; }
:root[data-skin="clay"] .seg, :root[data-skin="clay"] .seg-chips, :root[data-skin="clay"] .input, :root[data-skin="clay"] .meter, :root[data-skin="clay"] .emoji-dot, :root[data-skin="clay"] .goal-emoji {
  background: var(--surface2); border: 0; box-shadow: inset 4px 4px 9px var(--clay-lo), inset -4px -4px 9px var(--clay-hi);
}
:root[data-skin="clay"] .seg button.on, :root[data-skin="clay"] .seg-chips .chip input:checked + span { background: var(--surface2); box-shadow: 4px 4px 9px var(--clay-lo), -4px -4px 9px var(--clay-hi); }
:root[data-skin="clay"] .btn-primary { background: linear-gradient(145deg, color-mix(in srgb, var(--ink) 88%, #fff), var(--ink)); box-shadow: 6px 6px 14px var(--clay-lo), -6px -6px 14px var(--clay-hi); }
:root[data-skin="clay"] .btn-ghost, :root[data-skin="clay"] .btn-soft, :root[data-skin="clay"] .pill-btn, :root[data-skin="clay"] .chip > span, :root[data-skin="clay"] .chip-btn {
  border: 0; background: var(--surface2); box-shadow: 4px 4px 10px var(--clay-lo), -4px -4px 10px var(--clay-hi);
}
:root[data-skin="clay"] .chip input:checked + span, :root[data-skin="clay"] .chip-btn.on { box-shadow: inset 3px 3px 7px var(--clay-lo), inset -3px -3px 7px var(--clay-hi); background: var(--surface2); color: var(--ink); }
:root[data-skin="clay"] .nav { background: var(--surface2); border-top: 0; box-shadow: 0 -8px 20px var(--clay-lo); backdrop-filter: none; }
:root[data-skin="clay"] .nav-add span { border: 0; box-shadow: 6px 6px 14px var(--clay-lo), -6px -6px 14px var(--clay-hi), inset 2px 2px 6px rgba(255,255,255,.35); }
:root[data-skin="clay"] .avatar { box-shadow: 3px 3px 7px var(--clay-lo), -3px -3px 7px var(--clay-hi); border: 0; }
:root[data-skin="clay"] .sheet { background: var(--surface2); }
:root[data-skin="clay"] .cal-cell.sel { box-shadow: inset 3px 3px 7px var(--clay-lo), inset -3px -3px 7px var(--clay-hi); background: var(--surface2); }

/* dark-mode tuning for the styles */
:root[data-skin="aurora"][data-mode="dark"] .hero-card.hero-us {
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--a) 62%, #000), transparent 58%),
    radial-gradient(120% 90% at 100% 100%, color-mix(in srgb, var(--b) 58%, #000), transparent 58%),
    color-mix(in srgb, var(--ours) 45%, #0b0b12);
}
:root[data-skin="pop"] { --pop-sh: var(--ink); }
:root[data-skin="pop"][data-mode="dark"] { --pop-sh: var(--ours); }
:root[data-skin="pop"] .card, :root[data-skin="pop"] .list, :root[data-skin="pop"] .pot, :root[data-skin="pop"] .icon-btn { box-shadow: 4px 4px 0 var(--pop-sh); }
:root[data-skin="pop"] .nav-add span { box-shadow: 4px 4px 0 var(--pop-sh); }
:root[data-skin="pop"] .avatar { box-shadow: 2px 2px 0 var(--pop-sh); }
:root[data-skin="pop"] .venn-chart .vc-name, :root[data-skin="pop"] .venn-chart .vc-amt { stroke: rgba(0,0,0,.85); }
:root[data-skin="pop"][data-mode="dark"] .venn-chart circle[clip-path] { fill: var(--ours); }
:root[data-skin="pop"][data-mode="dark"] .venn-chart circle[stroke] { stroke: #000; }

/* =================== Phase 3: Insights dashboard =================== */
.ins-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.ins-seg { flex: 1; min-width: 260px; }
.print-btn { flex: none; }
.print-title, .print-foot { display: none; }
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.dash-card { margin: 0 !important; min-width: 0; }
.dc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.dc-head h3 { font-size: 16px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi small { font-size: 12px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; }
.kpi b { font-family: var(--display); font-size: 25px; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.neg b { color: var(--bad); }
.delta { font-size: 12px; color: var(--ink2); font-weight: 600; }
.delta.good { color: var(--good); } .delta.bad { color: var(--bad); }
.badge { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.badge.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.badge.bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }

/* charts */
.chart { width: 100%; height: auto; display: block; margin-top: 6px; overflow: visible; touch-action: pan-y; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .ax { font-size: 10.5px; fill: var(--ink2); font-family: var(--body); }
.chart .ax.on { fill: var(--ink); font-weight: 700; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit.on { fill: color-mix(in srgb, var(--ink) 5%, transparent); }
.chart .c-in { fill: var(--ours); } .chart .c-out { fill: color-mix(in srgb, var(--ink) 62%, var(--surface)); }
.chart .sa { fill: var(--a); } .chart .sb { fill: var(--b); }
.chart .dim { opacity: .55; }
.chart .act { fill: none; stroke: var(--ours); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .ref { fill: none; stroke: var(--ink2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .dotm { fill: var(--ours); stroke: var(--surface); stroke-width: 2; }
.chart .todayl { stroke: var(--line); stroke-width: 1; }
.chart .xhair { stroke: var(--ink2); stroke-width: 1; opacity: 0; pointer-events: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--ink2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lgd { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lgd.c-in { background: var(--ours); } .lgd.c-out { background: color-mix(in srgb, var(--ink) 62%, var(--surface)); }
.lgd.sa { background: var(--a); } .lgd.sb { background: var(--b); }
.lg-line { width: 16px; height: 0; border-top: 2.25px solid var(--ours); display: inline-block; }
.lg-line.ref { border-top: 1.5px dashed var(--ink2); }
.chart-tip { position: fixed; z-index: 80; display: none; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 10px; padding: 8px 11px; font-size: 12.5px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 240px; }
.chart-tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.chart-tip span { display: block; font-variant-numeric: tabular-nums; }

.hbars { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.hb { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; cursor: default; }
.hb-l { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-v { font-size: 14px; font-weight: 700; }
.hb-track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--surface2); overflow: hidden; display: block; }
.hb-track i { display: block; height: 100%; border-radius: 99px; background: var(--ours); }
.hb-track i.g { background: linear-gradient(90deg, var(--a), var(--b)); }
.rule { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.rule-top { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.rule-track { position: relative; height: 10px; border-radius: 99px; background: var(--surface2); }
.rule-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.r-needs { background: var(--a); } .r-wants { background: var(--b); } .r-savings { background: var(--ours); }
.rule-track em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.toplist { margin: 4px 0 0; padding: 0; list-style: none; counter-reset: n; }
.toplist li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; counter-increment: n; }
.toplist li:first-child { border-top: 0; }
.toplist li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist li span::before { content: counter(n) "."; color: var(--ink2); font-weight: 700; margin-right: 8px; }
.g-mini { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 8px 0; font-size: 14px; font-weight: 600; }
.g-mini .hb-track { height: 8px; }
:root[data-skin="aurora"] .kpi { background: color-mix(in srgb, var(--surface) 62%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-radius: 20px; }
:root[data-skin="pop"] .kpi { border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--pop-sh); border-radius: 16px; }
:root[data-skin="clay"] .kpi { border: 0; background: var(--surface2); box-shadow: 8px 8px 18px var(--clay-lo), -8px -8px 18px var(--clay-hi); border-radius: 22px; }

/* =================== Laptop / tablet: a real dashboard =================== */
@media (min-width: 900px) {
  #app { max-width: 1240px; padding: 8px 32px 40px 128px; }
  .nav {
    top: 0; bottom: 0; left: 0; right: auto; width: 100px; margin: 0; padding: 24px 8px;
    grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: center; gap: 10px;
    border-top: 0; border-right: 1px solid var(--line); border-radius: 0;
  }
  :root[data-skin="aurora"] .nav { left: 14px; top: 14px; bottom: 14px; right: auto; border-radius: 28px; }
  :root[data-skin="pop"] .nav { border-right: 2px solid var(--ink); border-top: 0; }
  .nav-add { order: -1; height: auto; margin-bottom: 14px; }
  .nav-add span, :root[data-skin="aurora"] .nav-add span { transform: none; }
  .nav-tab { font-size: 12px; min-height: 64px; border-radius: 16px; }
  .nav-tab.on { background: var(--surface2); }
  .page > * { max-width: 720px; margin-left: auto; margin-right: auto; }
  .page > .dash-grid, .page > .ins-bar, .page:has(.dash-grid) > * { max-width: none; }
  .page > .chips.scroll { margin: 12px auto 0; padding: 0; flex-wrap: wrap; overflow: visible; }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .span-all { grid-column: 1 / -1; }
  .sheet { bottom: auto; top: 50%; transform: translateY(-50%); border-radius: 26px; max-width: 520px; animation: fade .18s ease; }
  .toast { bottom: 28px; }
}
@media (min-width: 1280px) { .dash-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* =================== Print / Save as PDF =================== */
@media print {
  @page { margin: 14mm; }
  :root { --bg: #fff; --surface: #fff; --surface2: #f1f1f1; --line: #ddd; --ink: #111; --ink2: #555; }
  html, body { background: #fff !important; }
  .nav, .topbar, .ins-bar, .scrim, .sheet, .toast, .chart-tip { display: none !important; }
  #app { max-width: none; padding: 0; }
  .print-title, .print-foot { display: block; }
  .print-title { margin-bottom: 14px; }
  .dash-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card, .kpi, .list { box-shadow: none !important; backdrop-filter: none !important; background: #fff !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .chart .dim { opacity: 1; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =================== Phase 3b =================== */
.meta-btn { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; color: inherit; }
.meta-btn .meta { flex: 1; min-width: 0; }
.item.wish { flex-wrap: wrap; }
.item.wish.ready { background: color-mix(in srgb, var(--good) 7%, transparent); }
.wish-act { display: flex; gap: 8px; width: 100%; padding-left: 50px; }
.wish-act .btn { flex: 1; }
.good-t { color: var(--good); font-weight: 600; }
.notice.bad-n { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tag.warn { background: color-mix(in srgb, #E0A100 18%, transparent); color: color-mix(in srgb, #9A6B00 80%, var(--ink)); }
.plan-tabs { margin-top: 2px; }
.file-btn { cursor: pointer; }
.receipt-row { display: flex; align-items: center; gap: 10px; }
.textarea { min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.45; font-family: inherit; }

/* debt simulator */
.slider-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; font-weight: 600; }
.slider-row b { font-family: var(--display); font-size: 22px; color: var(--ours); }
.slider { width: 100%; margin: 10px 0 4px; accent-color: var(--ours); height: 28px; }
.debt-free { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.debt-free > div { background: var(--surface2); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.debt-free small { font-size: 12px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .05em; }
.debt-free b { font-family: var(--display); font-size: 22px; letter-spacing: -0.02em; }

/* net worth */
.worth-hero .worth-split { display: flex; gap: 18px; margin-top: 10px; font-size: 14px; color: var(--ink2); }
.worth-hero .worth-split b { color: var(--ink); }
:root[data-skin="aurora"] .worth-hero { color: #fff; border: 0; background: radial-gradient(120% 90% at 0% 0%, var(--a), transparent 58%), radial-gradient(120% 90% at 100% 100%, var(--b), transparent 58%), var(--ours); }
:root[data-skin="aurora"][data-mode="dark"] .worth-hero { background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--a) 62%, #000), transparent 58%), radial-gradient(120% 90% at 100% 100%, color-mix(in srgb, var(--b) 58%, #000), transparent 58%), color-mix(in srgb, var(--ours) 45%, #0b0b12); }
:root[data-skin="aurora"] .worth-hero .eyebrow, :root[data-skin="aurora"] .worth-hero .worth-split, :root[data-skin="aurora"] .worth-hero .worth-split b { color: rgba(255,255,255,.9); }

/* home: OK requests + money date */
.ok-card { margin-bottom: 12px; border-color: color-mix(in srgb, #E0A100 45%, var(--line)); }
.ok-row { padding: 10px 0; border-top: 1px solid var(--line); }
.ok-row:first-of-type { border-top: 0; }
.md-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; color: inherit; margin-bottom: 12px; }
.md-card.done { opacity: .85; }
.md-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: linear-gradient(135deg, var(--a-soft), var(--b-soft)); flex: none; }
.streak { font-weight: 700; font-size: 14px; white-space: nowrap; }
.md-step { display: flex; gap: 14px; }
.md-n { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-family: var(--display); color: #fff; background: linear-gradient(135deg, var(--a), var(--b)); }
.md-body { flex: 1; min-width: 0; }
.md-body h3 { margin-bottom: 8px; }
.md-list { list-style: none; margin: 0; padding: 0; }
.md-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 14px; }
.md-env { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; font-size: 14px; margin-bottom: 8px; }
.md-env .meter { grid-column: 1 / -1; }
.md-q { font-family: var(--display); font-size: 19px; line-height: 1.3; }
.mood .chip > span { font-size: 22px; min-height: 48px; width: 56px; justify-content: center; padding: 0; }
.mood .chip input:checked + span { background: var(--surface2); color: inherit; border-color: var(--ink); }

/* receipt viewer */
.viewer { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.86); display: grid; place-items: center; padding: 20px; }
.viewer img { max-width: 100%; max-height: 88vh; border-radius: 12px; }
.viewer .icon-btn { position: absolute; top: 16px; right: 16px; }

/* demo banner */
.demo-bar { position: sticky; top: 0; z-index: 25; margin: 0 -18px; padding: 8px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: #fff; background: linear-gradient(90deg, var(--a), var(--ours), var(--b)); }
.demo-actions { display: flex; gap: 8px; }
.demo-actions button, .demo-actions a { border: 0; background: rgba(255,255,255,.22); color: #fff; font-weight: 700; font-size: 12.5px; padding: 6px 11px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
@media (min-width: 900px) { .demo-bar { margin: 0 0 6px; border-radius: 14px; } }
