/* Allmayda Budget · Apple-calm v3.
   Served from 'self'; pages carry no inline styles or scripts. Charts are inline SVG whose
   geometry lives in presentation attributes and whose colors live here. */

:root {
  color-scheme: light dark;
  --bg: #f2f2f7; --card: #fff; --inset: #f2f2f7; --sep: #e5e5ea; --sep2: #d8d8dd;
  --fill: #e9e9ee; --fill2: rgba(118, 118, 128, .12);
  --l1: #1d1d1f; --l2: rgba(60, 60, 67, .62); --l3: rgba(60, 60, 67, .32);
  --blue: #007aff; --green: #34c759; --amber: #ff9500; --red: #ff3b30; --indigo: #5856d6;
  --teal: #30b0c7; --coral: #e05a2b; --gray: #8e8e93;
  --blue-t: #0062cc; --green-t: #248a3d; --amber-t: #c93400; --red-t: #d70015;
  --indigo-t: #3634a3; --gray-t: #636366;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .04);
  --chrome: rgba(249, 249, 251, .84); --segon: #fff;
  --v-slate: #4b72b5; --v-teal: #36b5c4; --v-green: #28a745; --v-amber: #e8a23a; --v-crim: #d63a4a;
  --v-indigo: #6f6cd9;
  --hair: rgba(0, 0, 0, .14); --tabon: rgba(75, 114, 181, .12);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; --card: #1c1c1e; --inset: #2c2c2e; --sep: #38383a; --sep2: #48484a;
    --fill: #2c2c2e; --fill2: rgba(118, 118, 128, .24);
    --l1: #f5f5f7; --l2: rgba(235, 235, 245, .62); --l3: rgba(235, 235, 245, .3);
    --blue: #0a84ff; --green: #30d158; --amber: #ff9f0a; --red: #ff453a; --indigo: #7d7aff;
    --teal: #40c8e0; --coral: #ff7847;
    --blue-t: #409cff; --green-t: #30d158; --amber-t: #ffb340; --red-t: #ff6961;
    --indigo-t: #a5a3ff; --gray-t: #aeaeb2;
    --shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
    --chrome: rgba(22, 22, 24, .84); --segon: #636366;
    --v-slate: #6380d6; --v-teal: #45c4c8; --v-green: #2c9e48; --v-amber: #f0ab45; --v-crim: #ff5f6d;
    --v-indigo: #8f8cff;
    --hair: rgba(255, 255, 255, .12); --tabon: rgba(120, 150, 230, .18);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--l1);
  font-size: 15px;
  line-height: 1.35;
}
a { color: inherit; text-decoration: none; }
b, strong { font-weight: 600; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.i { width: 20px; height: 20px; flex: none; }

/* ---------- chrome ---------- */
.app { display: block; }
.side { display: none; }
.main { min-width: 0; padding: 0 16px 104px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 2px; }
.topbar .b { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: linear-gradient(180deg, #a2a2a8, #8e8e93); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 48px; height: 48px; font-size: 18px; }
.mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--coral); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; letter-spacing: -.02em;
}
.mark.sm { width: 22px; height: 22px; border-radius: 6px; font-size: 12px; }
.mark.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 26px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px;
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: inset 0 .5px 0 var(--hair);
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
}
.titem {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 50px; padding: 5px 2px 4px; border-radius: 14px;
  font-size: 10.5px; font-weight: 500; color: var(--l2); position: relative; min-width: 0;
}
.titem svg.i { width: 24px; height: 24px; }
.titem span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.titem.on { color: var(--blue); background: var(--tabon); font-weight: 600; }
.titem .tb {
  position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--indigo); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--card);
}

.brand { display: flex; gap: 10px; align-items: center; padding: 0 10px 20px; min-width: 0; }
.brand-tx { min-width: 0; flex: 1; }
.brand b { display: block; font-size: 16px; }
.brand small { display: block; font-size: 12.5px; color: var(--l2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 15px; font-weight: 500; }
.sitem svg.i { color: var(--blue); }
.sitem:hover { background: var(--fill2); }
.sitem.on { background: var(--blue); color: #fff; }
.sitem.on svg.i { color: #fff; }
.sitem .badge { margin-left: auto; background: var(--indigo); color: #fff; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.sitem.on .badge { background: #fff; color: var(--indigo); }
.sitem.acct { margin-top: 10px; }
.sfoot { margin-top: 18px; padding: 12px 10px 0; border-top: 1px solid var(--sep); font-size: 12.5px; color: var(--l2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dot-status { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.dot-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.dot-status.ok { color: var(--green-t); }
.dot-status.ok::before { background: var(--green); }
.dot-status.part { color: var(--amber-t); }

@media (min-width: 860px) {
  .app { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 2px; padding: 24px 12px; position: sticky; top: 0; align-self: start; min-height: 100vh; }
  .tabbar, .topbar { display: none; }
  .main { padding: 28px 40px 48px; }
  /* Content sits beside the sidebar (Mail, Reminders) instead of floating in a wide gutter. */
  .screen { margin: 0; max-width: 960px; }
  .screen.narrow { max-width: 820px; }
}

/* ---------- screens ---------- */
.screen { display: block; max-width: 880px; margin: 0 auto; padding-bottom: 32px; }
.screen.narrow { max-width: 680px; }
.head { padding: 8px 4px 4px; }
.head h1 { font-size: 34px; font-weight: 700; letter-spacing: -.025em; margin: 4px 0 2px; line-height: 1.1; }
.head p { color: var(--l2); font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.head-main { min-width: 0; }
.head-row > .btn { flex: none; margin-bottom: 1px; }
.sh { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 28px 4px 10px; flex-wrap: wrap; }
.sh h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.sh h3 { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.sh .lnk, .lnk { font-size: 15px; color: var(--blue); white-space: nowrap; }
.cap { font-size: 13px; font-weight: 500; color: var(--l2); text-transform: uppercase; letter-spacing: .02em; margin: 18px 16px 7px; }
.section-note { margin: -4px 4px 12px; color: var(--l2); font-size: 14px; }
.top { margin-top: 20px; }
.top8 { margin-top: 8px; }
.top12 { margin-top: 12px; }
.top0 { margin-top: 0; }
.ink { color: var(--l1); }
.l2, .l2c { color: var(--l2); }
.blue { color: var(--blue); }
.red { color: var(--red-t); }
.quiet { color: var(--l3); }
.mono { font-family: var(--mono); font-size: 12px; }
.para { margin: 2px 0 6px; font-size: 14px; color: var(--l2); }
.center { text-align: center; }

.card { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card.stack { margin-top: 14px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) {
  .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span2 { grid-column: 1 / -1; }
}

.lh { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.lt { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600; color: var(--l1); }
.lt svg.i { width: 16px; height: 16px; color: var(--c, var(--l2)); }
.meta { font-size: 14px; color: var(--l2); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.lnk2 { color: var(--l2); }
.big { font-size: 34px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--l1); }
.big.md { font-size: 28px; margin: 8px 0 12px; }
.big small { font-size: 17px; font-weight: 600; color: var(--l2); letter-spacing: -.01em; margin-left: 3px; }
.quiet-big { color: var(--l2); }
.sub { font-size: 15px; color: var(--l2); margin-top: 3px; }
.neg { color: var(--red-t); }
.num { font-variant-numeric: tabular-nums; }
.lowhead { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }

.c-blue { --c: var(--blue); --ct: var(--blue-t); }
.c-green { --c: var(--green); --ct: var(--green-t); }
.c-amber { --c: var(--amber); --ct: var(--amber-t); }
.c-red { --c: var(--red); --ct: var(--red-t); }
.c-indigo { --c: var(--indigo); --ct: var(--indigo-t); }
.c-teal { --c: var(--teal); --ct: var(--teal); }
.c-gray { --c: var(--gray); --ct: var(--gray-t); }
.c-coral { --c: var(--coral); --ct: var(--coral); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--c, var(--gray)) 15%, transparent); color: var(--ct, var(--gray-t));
}
.pill.lg { height: 30px; padding: 0 14px; font-size: 15px; }
.pill svg.i { width: 14px; height: 14px; }

/* ---------- legends ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13.5px; color: var(--l2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dc, transparent); }
.legend b { color: var(--l1); font-weight: 600; font-variant-numeric: tabular-nums; }
.d-slate { --dc: var(--v-slate); }
.d-slate-soft { --dc: color-mix(in srgb, var(--v-slate) 34%, var(--fill)); }
.d-teal { --dc: var(--v-teal); }
.d-green { --dc: var(--v-green); }
.d-green-soft { --dc: color-mix(in srgb, var(--v-green) 36%, var(--fill)); }
.d-amber { --dc: var(--v-amber); }
.d-crim { --dc: var(--v-crim); }
.d-blue { --dc: var(--blue); }
.d-indigo { --dc: var(--v-indigo); }
.d-clear { --dc: transparent; }

/* ---------- charts (inline SVG, presentation attributes only) ---------- */
.chart { display: block; width: 100%; overflow: visible; margin-top: 14px; }
.chart.h-bar { height: 10px; }
.chart.h-tall { height: 16px; }
.chart.h-day { height: 180px; margin-bottom: 4px; }
.chart.h-lg { height: 240px; margin-bottom: 4px; }
.chart.h-promo { height: 120px; margin: 16px 0 6px; }
.chart .track { fill: var(--fill); }
.chart .f-slate { fill: var(--v-slate); }
.chart .f-slate-soft { fill: color-mix(in srgb, var(--v-slate) 26%, var(--fill)); }
.chart .f-teal { fill: var(--v-teal); }
.chart .f-green { fill: var(--v-green); }
.chart .f-green-soft { fill: color-mix(in srgb, var(--v-green) 36%, var(--fill)); }
.chart .f-amber { fill: var(--v-amber); }
.chart .f-crim { fill: var(--v-crim); }
.chart .f-indigo { fill: var(--v-indigo); }
.chart .gl { stroke: var(--sep); stroke-width: 1; }
.chart .gl.base { stroke: var(--sep2); }
.chart .gl.end { stroke: var(--l3); stroke-dasharray: 3 3; }
.chart .ylab, .chart .xlab { font-size: 12px; fill: var(--l2); font-variant-numeric: tabular-nums; }
.chart .db { fill: var(--v-slate); }
.chart .db.dn { fill: var(--v-crim); }
.chart .db:hover { opacity: .8; }
.chart .db.lo { stroke: var(--card); stroke-width: 1.5; }
.chart .pd { fill: var(--v-green); }
.chart .ln { stroke: var(--blue); stroke-width: 2.5; stroke-linecap: round; }
.chart .ln.dn { stroke: var(--red); }
.chart .ln.ok { stroke: var(--v-green); }
.chart .ln.amber { stroke: var(--v-amber); stroke-dasharray: 5 4; }
.chart .area { fill: color-mix(in srgb, var(--blue) 12%, transparent); }
.chart .area.dn { fill: color-mix(in srgb, var(--red) 16%, transparent); }
.chart .wall { fill: var(--v-crim); }
.chart .mk { stroke: var(--card); stroke-width: 2; }
.chart .mk.red { fill: var(--red); }
.chart .mk.ink { fill: var(--l1); }
.chart .mk.ok { fill: var(--v-green); }
.chart .mk.amber { fill: var(--v-amber); }
.chart .co rect { fill: var(--l1); }
.chart .co text { fill: var(--card); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart .co.red rect { fill: var(--red); }
.chart .co.red text, .chart .co.amber text, .chart .co.ok text { fill: #fff; }
.chart .co.amber rect { fill: var(--v-amber); }
.chart .co.ok rect { fill: var(--v-green); }
.xax { display: flex; justify-content: space-between; font-size: 12px; color: var(--l2); padding-right: 10%; }

/* ---------- disclosures ---------- */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary:focus { outline: none; }
details > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 12px; }
details.more { margin-top: 14px; border-top: 1px solid var(--sep); }
details.more.flat { margin-top: 0; border-top: 0; }
details.more > summary { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; font-size: 15px; color: var(--blue); }
details.more.flat > summary { padding-top: 2px; }
.chev { width: 13px; height: 13px; color: var(--l3); flex: none; transition: transform .22s ease; }
details.more > summary .chev { color: var(--blue); }
details[open] > summary .chev { transform: rotate(90deg); }
.kvs { padding-top: 8px; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 4px 0; font-size: 14.5px; }
.kv > span { color: var(--l2); min-width: 0; }
.kv > b { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.kv > b.neg { color: var(--red-t); }
.kv > b.quiet { color: var(--l2); }
.kv.tot { border-top: 1px solid var(--sep2); margin-top: 5px; padding-top: 9px; }
.kv.tot > b, .kv.tot > span { font-weight: 700; color: var(--l1); }
.kv.tot > b.neg { color: var(--red-t); }
.kv .sm { display: block; font-size: 12.5px; color: var(--l2); font-weight: 400; }
.ph { font-size: 12px; font-weight: 600; color: var(--l2); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 4px; }
.kvs > .ph:first-child, .proof > .ph:first-child { margin-top: 2px; }
.cite { display: flex; gap: 7px; align-items: flex-start; margin-top: 12px; font-family: var(--mono); font-size: 11.5px; line-height: 1.45; color: var(--l2); overflow-wrap: anywhere; }
.cite svg.i { width: 14px; height: 14px; margin-top: 1px; }
.note { margin-top: 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--l1); display: flex; gap: 8px; align-items: flex-start; }
.note svg.i { width: 18px; height: 18px; color: var(--c); margin-top: 1px; }
.banner-note { margin: 12px 0 4px; }
.hint { font-size: 12.5px; color: var(--l2); margin-top: 6px; }
.steps { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13.5px; }
.steps li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0 3px 16px; position: relative; font-variant-numeric: tabular-nums; }
.steps li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--l3); }
.steps li.skip { color: var(--l3); }
.steps li.hit { font-weight: 600; }
.steps li.hit::before { background: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent); }
.steps em { font-style: normal; color: var(--l2); text-align: right; }
.steps li.skip em { color: var(--l3); }

/* ---------- grouped lists (Wallet / Health) ---------- */
.list { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.r { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 64px; position: relative; }
.r.slim { min-height: 52px; }
a.r:hover, summary.r:hover { background: color-mix(in srgb, var(--fill2) 50%, transparent); }
.list > details:not(:first-child) > .r::before,
.list > .r:not(:first-child)::before,
.list > form:not(:first-child) > .r::before {
  content: ""; position: absolute; top: 0; right: 0; left: 68px; border-top: 1px solid var(--sep);
}
.ic { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--gray)) 15%, transparent); color: var(--c, var(--gray)); }
.ic svg.i { width: 22px; height: 22px; }
.ic.solid { background: var(--c, var(--gray)); color: #fff; }
.ic.round { border-radius: 50%; }
.ic.sm { width: 32px; height: 32px; }
.ic.sm svg.i { width: 18px; height: 18px; }
.ic.solid.t-blue { background: #4b72b5; }
.ic.solid.t-teal { background: #2b7bb9; }
.ic.solid.t-gray { background: #8e8e93; }
.ic.solid.t-coral { background: #e08a3c; }
.ic.solid.t-indigo { background: #5856d6; }
.tx { flex: 1; min-width: 0; }
.tx > b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx > small { display: block; font-size: 14px; color: var(--l2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx > small.wrap, .tx > small.when { white-space: normal; }
.tx > small.when { font-size: 13.5px; line-height: 1.3; }
.amt { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.amt > b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.amt > small { display: block; font-size: 13px; color: var(--l2); }
.amt > small.neg { color: var(--red-t); }
.st { display: flex; justify-content: flex-end; align-items: center; gap: 5px; margin-top: 3px; font-size: 12.5px; font-weight: 500; color: var(--l2); white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--gray)); }
.st.cash { display: inline-flex; height: 20px; padding: 0 8px; border-radius: 99px; background: var(--fill2); font-weight: 600; }
.st.cash::before { display: none; }
.proof { margin: 0 16px 14px; padding: 12px 14px; background: var(--inset); border-radius: 14px; font-size: 14px; }
.proof.flush { margin-left: 16px; }
@media (min-width: 640px) { .proof { margin-left: 68px; } .proof.flush { margin-left: 16px; } }
.dots { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: 1px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--l3); }
.dots i.on { background: var(--green); border-color: var(--green); }
.cardart { flex: none; width: 44px; height: 30px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); background: linear-gradient(135deg, #d1d1d6, #8e8e93); }
.cardart.t-blue { background: linear-gradient(135deg, #48484a, #1c1c1e); }
.cardart.t-teal { background: linear-gradient(135deg, #5ac8fa, #2b7bb9); }
.cardart.t-gray { background: linear-gradient(135deg, #d1d1d6, #8e8e93); }
.cardart.t-coral { background: linear-gradient(135deg, #ffcc80, #e08a3c); }
.cardart.t-indigo { background: linear-gradient(135deg, #a5a3ff, #5856d6); }

/* ---------- AI banner ---------- */
.ai-banner { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; padding: 8px 12px 8px 8px; border-radius: 99px; background: color-mix(in srgb, var(--indigo) 13%, var(--card)); }
.ai-banner .ic { width: 30px; height: 30px; border-radius: 50%; background: var(--indigo); color: #fff; }
.ai-banner .ic svg.i { width: 17px; height: 17px; }
.ai-banner b { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-banner > span:last-child { color: var(--indigo-t); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.ai-banner .chev { color: var(--indigo-t); width: 12px; height: 12px; }

/* ---------- tiles ---------- */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.tile { background: var(--inset); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.tile .k { font-size: 13px; color: var(--l2); font-weight: 500; }
.tile .v { font-size: 26px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile .v.neg { color: var(--red-t); }
.tile .h { font-size: 12.5px; color: var(--l2); margin-top: 1px; }
.tile .h.chg { color: var(--amber-t); font-weight: 600; }
.tile .was { font-size: 13px; color: var(--l3); text-decoration: line-through; font-variant-numeric: tabular-nums; margin-top: 6px; }
.trio, .impact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.impact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .impact { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.impact .tile, .trio .tile { padding: 12px; }
.impact .v { font-size: 21px; }
.stats3, .stat3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.stats3 { border-top: 1px solid var(--sep); padding-top: 14px; }
.stats3 small, .stat3 small { display: block; font-size: 12.5px; color: var(--l2); }
.stats3 b, .stat3 b { font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 420px) { .stats3 b, .stat3 b { font-size: 15px; } }

/* ---------- buttons & forms ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border: 0; border-radius: 14px; font-size: 17px; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--coral); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.grayb { background: var(--fill2); color: var(--blue); }
.btn.ink { background: var(--l1); color: var(--card); }
.btn.sm { height: 38px; font-size: 15px; border-radius: 11px; width: auto; padding: 0 16px; }
.btn.danger { color: var(--red-t); }
.prompt { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--card); font-size: 13.5px; line-height: 1.45; user-select: all; -webkit-user-select: all; cursor: text; border: 1px solid var(--sep2); overflow-wrap: anywhere; }
textarea { width: 100%; min-height: 84px; border-radius: 12px; border: 1px solid var(--sep2); background: var(--card); padding: 10px 12px; resize: vertical; font-size: 15px; margin-bottom: 10px; }
.inline-form { margin: 0; flex: none; }
.row-form { margin: 0; }
.rowbtn { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; min-height: 52px; padding: 11px 16px; color: inherit; }
.rowbtn:hover { background: color-mix(in srgb, var(--fill2) 50%, transparent); }
.rowbtn:focus { outline: none; }
.rowbtn:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.reset-form { margin: 12px 0 0; display: grid; gap: 4px; }
.reset-form .ack { margin-bottom: 8px; background: color-mix(in srgb, var(--red) 10%, var(--card)); }

/* ---------- review ---------- */
.proposal { margin-top: 18px; padding-top: 6px; }
.proposal + .proposal { border-top: 1px solid var(--sep2); margin-top: 32px; padding-top: 24px; }
.prop-head { padding: 4px 4px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.prop-title { flex-basis: 100%; font-size: 30px; font-weight: 700; letter-spacing: -.025em; margin-top: 6px; }
.prop-meta { flex-basis: 100%; color: var(--l2); font-size: 15px; }
.counts { font-weight: 600; font-variant-numeric: tabular-nums; }
.counts .add { color: var(--green-t); }
.counts .upd { color: var(--amber-t); }
.counts .rem { color: var(--red-t); }
.aside { margin-top: 14px; padding: 14px 16px; }
.aside-sum { display: flex; align-items: center; gap: 10px; }
.aside-sum .meta { margin-left: auto; }
.quote { margin: 10px 0 0; color: var(--l2); font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.oc { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none; font-size: 20px; font-weight: 700; color: #fff; background: var(--c); line-height: 1; }
.diff { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; justify-content: flex-end; text-align: right; overflow-wrap: anywhere; }
.diff s { color: var(--l3); }
.ack { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; background: color-mix(in srgb, var(--amber) 12%, var(--card)); cursor: pointer; font-size: 15px; margin-bottom: 12px; }
.ack input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--blue); }
.actions { margin-top: 18px; display: grid; gap: 14px; }
.confirm-form { margin: 0; }
pre.json { margin: 0; font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--l1); max-height: 420px; overflow: auto; }
.empty-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 22px; margin-top: 18px; }
.empty-card b { font-size: 18px; }
.history .pill { display: none; }
@media (min-width: 560px) { .history .pill { display: inline-flex; } }
.proof .fp { font-family: var(--mono); font-size: 11.5px; line-height: 1.45; color: var(--l2); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.kv > b.wrap-val { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }

/* ---------- runway ---------- */
.segc { display: flex; background: var(--fill2); border-radius: 10px; padding: 2px; gap: 2px; margin: 14px 0 12px; overflow-x: auto; }
.segc a { flex: 1; text-align: center; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.segc a.on { background: var(--segon); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }
.vt { display: flex; justify-content: flex-end; margin-top: 12px; }
.segm { display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--fill2); border-radius: 9px; padding: 2px; gap: 2px; }
.segm a { min-width: 58px; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; text-align: center; color: var(--l2); }
.segm a.on { background: var(--segon); color: var(--l1); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.withheld { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 16px; border: 1.5px dashed var(--sep2); }
.card.withheld { box-shadow: none; background: transparent; margin-top: 12px; }
.withheld b { font-size: 17px; }
.withheld span { color: var(--l2); font-size: 14.5px; }
.withheld a { color: var(--blue); font-size: 15px; margin-top: 4px; }
.ledger { margin-top: 18px; padding: 14px 16px; }
.days { font-size: 14px; margin-top: 10px; }
.days .dr { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 7px 0; border-top: 1px solid var(--sep2); font-variant-numeric: tabular-nums; }
.days .dr:first-child { border-top: 0; color: var(--l2); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.days .dr > :not(:first-child) { text-align: right; }
.days small { display: block; font-size: 12px; }

/* ---------- promos ---------- */
.ph-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hazard { margin-top: 14px; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--red) 12%, var(--card)); }
.hazard b { display: block; font-size: 20px; font-weight: 700; color: var(--red-t); letter-spacing: -.02em; }
.hazard span { font-size: 14px; color: var(--l2); }
.card.gated { border: 1.5px dashed var(--sep2); box-shadow: none; background: transparent; }
.gate-track { margin-top: 14px; min-height: 44px; border-radius: 12px; border: 1.5px dashed var(--sep2); display: flex; align-items: center; padding: 8px 14px; font-size: 13.5px; color: var(--l2); }
.inset { margin-top: 14px; background: var(--inset); border-radius: 16px; padding: 4px 14px 10px; }

/* ---------- scenarios ---------- */
.vs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.vs .card { padding: 16px; }
.vs .row { padding: 9px 0; border-top: 1px solid var(--sep); }
.vs .row small { display: block; font-size: 12.5px; color: var(--l2); }
.vs .row b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.vs .row b.neg { color: var(--red-t); }
.card.chosen { box-shadow: var(--shadow), inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent); }

/* ---------- day 1 ---------- */
.step-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none; font-weight: 700; font-size: 15px; background: var(--fill); color: var(--l2); }
.step-n svg.i { width: 16px; height: 16px; }
.step-n.done { background: var(--green); color: #fff; }
.step-n.next { background: var(--blue); color: #fff; }
.ghost { border: 1.5px dashed var(--sep2); border-radius: 18px; padding: 14px; min-width: 0; }
.ghost.wide { margin-top: 10px; }
.ghost .k { font-size: 14px; font-weight: 600; color: var(--l2); }
.ghost .v { font-size: 28px; font-weight: 700; color: var(--l3); margin-top: 4px; }
.ghost .h { font-size: 13px; color: var(--l2); }
.ghost-line { height: 56px; margin: 10px 0 6px; border-bottom: 2px dashed var(--sep2); }

/* ---------- entry pages ---------- */
.entry-page { min-height: 100vh; }
.entry-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.entry { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 30px 22px; width: 100%; max-width: 400px; gap: 4px; }
.entry-title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 14px 0 2px; }
.entry-title.sm { font-size: 20px; margin-top: 2px; }
.entry .sub { margin-bottom: 16px; overflow-wrap: anywhere; }
.entry .hint { margin-top: 12px; }
.entry-form { width: 100%; margin: 14px 0 0; }
.badges { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.badges .ai { width: 52px; height: 52px; border-radius: 14px; background: var(--indigo); color: #fff; display: grid; place-items: center; }
.badges .ai svg.i { width: 28px; height: 28px; }
.badges .swap { color: var(--l3); }
.perm { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 10px 0; border-top: 1px solid var(--sep); width: 100%; }
.perm b { display: block; font-size: 15px; }
.perm small { display: block; font-size: 13.5px; color: var(--l2); }

/* ---------- in the iPhone app ----------
   The native TabView owns navigation. A browser never has html.in-app, so these rules
   cannot reach an ordinary page. The app supplies the top safe area. */
html.in-app .side,
html.in-app .topbar,
html.in-app .tabbar {
  display: none;
}
html.in-app .app {
  display: block;
}
html.in-app .main {
  padding: 0 16px calc(28px + env(safe-area-inset-bottom));
}
html.in-app .content {
  margin: 0;
  max-width: none;
}
html.in-app .entry-page,
html.in-app .entry-wrap {
  min-height: 100%;
}
html.in-app .entry-wrap {
  padding: 16px;
}
html.in-app .head h1,
html.in-app .card,
html.in-app details,
html.in-app form,
html.in-app .btn {
  max-width: 100%;
}

@supports selector(::details-content) {
  details::details-content { block-size: 0; overflow: clip; transition: block-size .28s ease, content-visibility .28s allow-discrete; }
  details[open]::details-content { block-size: auto; }
}
:root { interpolate-size: allow-keywords; }
@media (prefers-reduced-motion: reduce) {
  details::details-content { transition: none; }
  .chev { transition: none; }
}
