:root {
  --bg: #000; --panel: #121214; --panel2: #1c1c1e; --line: #2c2c2e;
  --fg: #f5f5f7; --muted: #8e8e93; --dim: #636366;
  --up: #30d158; --down: #ff453a; --amber: #ff9f0a; --accent: #ff8a00;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { padding: 0 16px 40px; max-width: 1100px; margin: 0 auto; }
[hidden] { display: none !important; }

.brand { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 8px; margin: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; font-weight: 600; }
.msg { color: var(--muted); font-size: 14px; min-height: 1em; margin: 8px 0; }
.msg.err { color: var(--down); }
.note { color: var(--muted); font-size: 13px; margin: 14px 0 0; line-height: 1.5; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: grid; gap: 14px; }
.login-card h1 { font-size: 26px; margin: 4px 0 6px; font-weight: 600; }
.login-card label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select { font: inherit; color: var(--fg); background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: 11px 14px; background: var(--accent); color: #000; font-weight: 600; }
button:disabled { opacity: .6; cursor: default; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 7px 12px; font-weight: 500; font-size: 13px; }

/* Header */
.top { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tabs button { background: transparent; color: var(--muted); font-weight: 500; padding: 8px 12px; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--panel2); color: var(--fg); }

/* Blocks */
.hero { margin-bottom: 18px; }
.big { font-size: clamp(40px, 9vw, 64px); font-weight: 600; letter-spacing: -.02em; margin: 0; font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tile .k { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.tile .v { font-size: 22px; font-weight: 600; margin: 0; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; min-width: 0; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.row-head .label { margin: 0; }
.row-head input { max-width: 180px; padding: 7px 10px; font-size: 14px; }

.kv > div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kv > div:first-child { border-top: 0; }
.kv span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.kv span small { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; }
.kv b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv .total { border-top: 1px solid var(--dim); }
.kv .total span { color: var(--fg); font-weight: 600; }
.tx { max-height: 520px; overflow-y: auto; }
.up { color: var(--up); } .down { color: var(--down); } .amber { color: var(--amber); }

.bar-row { padding: 9px 0; border-top: 1px solid var(--line); }
.bar-row:first-child { border-top: 0; }
.bar-row .top-line { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; gap: 10px; }
.bar-row .top-line span { color: var(--muted); }
.bar-row .top-line b { font-variant-numeric: tabular-nums; font-weight: 600; }
.bar { height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; }

.goal .bar { height: 8px; margin: 8px 0 6px; }
.goal p { margin: 0; font-size: 14px; color: var(--muted); }
.goal h4 { margin: 0; font-size: 15px; font-weight: 600; }

.chip { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: #a6ff00; border: 1px solid color-mix(in srgb, #a6ff00 45%, transparent); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.chip.live { color: #a6ff00; border-color: color-mix(in srgb, #a6ff00 45%, transparent); }
.chip.wb { color: #a6ff00; border-color: color-mix(in srgb, #a6ff00 45%, transparent); }
.chip.up { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, transparent); } .chip.down { color: var(--down); border-color: color-mix(in srgb, var(--down) 40%, transparent); } .chip.amber { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.spark svg { display: block; width: 100%; height: 120px; }
.spark-sm svg { display: block; width: 100%; height: 56px; }
.ctrl { display: grid; grid-template-columns: 90px 1fr 120px; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.ctrl b { color: var(--fg); text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] { padding: 0; accent-color: var(--accent); background: transparent; border: 0; width: 100%; }
.kv.two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.kv.two > div:nth-child(2) { border-top: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.two-col .big { font-size: clamp(30px, 6vw, 46px); }
.opt h4 { margin: 0; font-size: 16px; font-weight: 600; }
.fund { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.fund .spark-sm { flex: 1; }
@media (max-width: 560px) { .kv.two { grid-template-columns: 1fr; } .kv.two > div:nth-child(2) { border-top: 1px solid var(--line); } .ctrl { grid-template-columns: 70px 1fr 96px; gap: 8px; } }

.foot { color: var(--dim); font-size: 12px; margin-top: 30px; text-align: center; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } .top { gap: 10px; } .tabs { order: 3; flex-basis: 100%; } .top .brand { flex: 1; } }
.login-card .msg { margin: 0; min-height: 0; }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); margin-top: 6px; font-family: var(--mono); }
#house-options { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 4px; }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; } .tile .v { font-size: 19px; } }

/* ---------- Pension and Drawdown ---------- */
.settings { margin-top: 4px; }
.settings .ctrl:last-of-type { margin-bottom: 10px; }
.ctrl-row { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.ctrl-row > span { width: 90px; }
.ctrl-row .ghost { margin-left: auto; }
.seg { display: inline-flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: transparent; color: var(--muted); font-weight: 500; font-size: 13px; padding: 6px 11px; border-radius: 7px; }
.seg button[aria-pressed="true"] { background: var(--line); color: var(--fg); }
button.small { padding: 5px 10px; font-size: 12px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
h4.h { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.mid { font-size: 15px; color: var(--muted); margin: 4px 0 10px; }
.mid b { font-size: 24px; color: var(--fg); margin-right: 4px; }
.amber { color: var(--amber); }

.chart { position: relative; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .tick { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart-svg .ms { stroke: var(--dim); stroke-dasharray: 3 4; }
.chart-svg .mslab { fill: var(--accent); font-size: 10.5px; font-family: var(--mono); letter-spacing: .04em; }
.chart-svg .band { fill: var(--up); fill-opacity: .1; }
.chart-svg .line-main { fill: none; stroke-width: 2.4; stroke-linejoin: round; }
.chart-svg .line-other { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 4 4; }
.chart-svg .rule { stroke: var(--muted); stroke-width: 1; }
.chart-svg .inc-sp-area { fill: url(#incSp); }
.chart-svg .inc-pen-area { fill: url(#incPen); }
.chart-svg .inc-sp-line { fill: none; stroke: #ffb340; stroke-width: 2.2; }
.chart-svg .inc-pen-line { fill: none; stroke: #32e463; stroke-width: 2.6; filter: drop-shadow(0 0 4px rgba(48,209,88,.55)); }
.chart-svg .inc-tgt { stroke: #fff; stroke-width: 1.4; stroke-dasharray: 6 4; opacity: .9; }
.chart-svg .inc-swr { fill: none; stroke: #64d2ff; stroke-width: 2; stroke-dasharray: 2 4; stroke-linecap: round; }
.tip { position: absolute; pointer-events: none; opacity: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; white-space: nowrap; transition: opacity .1s; }
.tip .h { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend span::before { content: ""; display: inline-block; width: 14px; height: 0; vertical-align: middle; margin-right: 6px; border-top: 2px solid; }
.lg-main::before { border-color: var(--up) !important; }
.lg-other::before { border-color: var(--muted) !important; border-top-style: dashed !important; }
.lg-band::before { border-top-width: 8px !important; border-color: color-mix(in srgb, var(--up) 22%, transparent) !important; }
.lg-pen::before { border-top-width: 8px !important; border-color: #30d158 !important; }
.lg-sp::before { border-top-width: 8px !important; border-color: #ff9f0a !important; }
.lg-tgt::before { border-color: var(--fg) !important; border-top-style: dashed !important; }
.lg-swr::before { border-color: #64d2ff !important; border-top-style: dotted !important; }

.tblwrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: right; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { text-align: right; padding: 10px; border-top: 1px solid var(--line); white-space: nowrap; }
.tbl tr:first-child td { border-top: 0; }
.tbl th:first-child, .tbl td.rl { text-align: left; }
.tbl td.rl { color: var(--muted); }
.tbl .mine { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tbl th.mine { color: var(--accent); }
.tbl.click tbody tr { cursor: pointer; }
.tbl.click tbody tr:hover td { background: var(--panel2); }
.tbl tr.on td { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--fg); }
.tbl td.muted { color: var(--muted); text-align: left; }
.holdings th:nth-child(2) { text-align: left; }
.h-spark { width: 110px; }
.h-spark svg.mini { display: block; width: 100px; height: 26px; margin-left: auto; }
.h-bar { display: inline-block; width: 60px; height: 5px; background: var(--panel2); border-radius: 3px; vertical-align: middle; overflow: hidden; }
.h-bar i { display: block; height: 100%; background: var(--accent); }
.pill { display: inline-block; min-width: 58px; text-align: center; border-radius: 6px; padding: 3px 8px; font-size: 13px; font-weight: 600; background: var(--panel2); color: var(--muted); }
.pill.up { background: var(--up); color: #000; } .pill.down { background: var(--down); color: #fff; }

.zb { display: grid; grid-template-columns: 64px 1fr 150px; grid-template-rows: auto auto; gap: 4px 12px; width: 100%; text-align: left; background: transparent; color: var(--fg); border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 0; font-weight: 400; align-items: center; }
.zb:hover { background: var(--panel2); }
.zb-age { color: var(--muted); font-size: 14px; }
.zb.plan .zb-age { color: var(--accent); font-weight: 600; }
.zb-track { position: relative; height: 10px; background: var(--panel2); border-radius: 5px; }
.zb-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--up); border-radius: 5px; opacity: .85; }
.zb-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--amber); }
.zb-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.zb-sub { grid-column: 2 / 4; color: var(--muted); font-size: 12px; }
.mark-key { display: inline-block; width: 2px; height: 12px; background: var(--amber); vertical-align: middle; margin-right: 6px; }
@media (max-width: 560px) {
  .zb { grid-template-columns: 52px 1fr 110px; }
  .ctrl-row > span { width: 70px; }
  .h-spark { width: 70px; } .h-spark svg.mini { width: 64px; }
}

/* ---------- Overview and Cash flow (matching the Claude dashboard) ---------- */
:root { --blue: #0a84ff; }
.muted { color: var(--muted); }
.hero-row { display: flex; align-items: center; gap: 22px; }
.hero-row .big { flex: none; }
.hspark { flex: 1; max-width: 420px; min-width: 120px; }
.hero-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.hero-sub b { color: var(--fg); }
.take { font-size: 15px; line-height: 1.55; color: #d1d1d6; margin: 10px 0 0; }
.take b { color: var(--fg); }
.tiles.four { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tile .s { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; }
.tile .tspark { margin-top: 10px; }
.sum { list-style: none; margin: 0; padding: 0; }
.sum li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.45; }
.sum li:first-child { border-top: 0; }
.sum li i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; transform: translateY(-1px); }
.sum li.up i { background: var(--up); } .sum li.down i { background: var(--down); } .sum li.amb i { background: var(--amber); }
.cd { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 4px; text-align: center; }
.cd-mark { position: relative; height: 14px; margin-top: 12px; }
.cd-mark::before { content: ""; position: absolute; left: -5px; right: -5px; top: 5px; height: 4px; background: #3a3a3c; }
.cd > div:first-child .cd-mark::before { left: 0; border-radius: 2px 0 0 2px; }
.cd > div:last-child .cd-mark::before { right: 0; border-radius: 0 2px 2px 0; }
.cd-mark i { position: absolute; left: 50%; top: 0; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--panel); }
.cd-mark.r i { background: var(--up); }
.cd .age { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--accent); }
.cd .big { font-size: 26px; font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.cd .big small { font-size: 12px; color: var(--muted); font-weight: 500; margin: 0 8px 0 3px; }
.cd .when { font-size: 12px; color: var(--muted); }
.stack { display: flex; height: 18px; border-radius: 9px; overflow: hidden; gap: 2px; margin-bottom: 8px; }
.own-row { display: grid; grid-template-columns: minmax(70px, 1fr) 110px 90px 66px; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.own-row:first-child { border-top: 0; }
.own-row .nm b { display: flex; align-items: center; gap: 8px; font-size: 15px; } .kdot { flex: none; width: 10px; height: 10px; border-radius: 50%; } .kdot.debt { border: 2px solid var(--down); box-sizing: border-box; } .own-row .nm span { padding-left: 18px; } .own-row .nm span { font-size: 12px; color: var(--muted); }
.own-row .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.own-row .pill { min-width: 0; }
.cap { color: var(--muted); font-size: 12.5px; margin: 6px 0 10px; }
.allow { margin: 4px 0 14px; }
.allow .ah { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 8px; }
.allow .ah span { color: #d1d1d6; }
.dates, .flags { list-style: none; margin: 0; padding: 0; }
.dates li, .flags li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.dates li:first-child, .flags li:first-child { border-top: 0; }
.dates .d, .flags .d { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dates .b { flex: 1; min-width: 0; } .dates .t { font-size: 14px; font-weight: 600; } .dates .n { font-size: 12px; color: var(--muted); margin-top: 2px; }
.flags .t { flex: 1; font-size: 14px; }
#cf-flags { margin-top: 10px; }
.gauge { margin: 4px 0 12px; }
.gauge .track { position: relative; height: 10px; background: var(--panel2); border-radius: 5px; }
.gauge .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.gauge .mark { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--fg); }
.gauge .gcap { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.hb .r { display: grid; grid-template-columns: minmax(7rem, 32%) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 0; font-size: 14px; }
.hb .l { color: #d1d1d6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb .b { position: relative; height: 10px; background: var(--panel2); border-radius: 5px; }
.hb .b > span { display: block; height: 100%; border-radius: 5px; }
.hb .bm { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--fg); border-radius: 1px; }
.hb .v { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.hb .v .up, .hb .v .down { font-weight: 600; }
.flow { position: relative; }
.flowbar { display: flex; height: 28px; border-radius: 8px; overflow: hidden; gap: 2px; }
.flowbar span { cursor: pointer; }
.ends { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.ends b { color: var(--fg); }
.opts { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 10px; }
.opts > div { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.row-tools { display: flex; gap: 8px; }
.row-tools select, .row-tools input { padding: 7px 10px; font-size: 14px; max-width: 170px; }
.assume { margin-top: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips > div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--muted); }
.chips b { color: var(--fg); margin-left: 8px; }
.kv span small { display: block; }
@media (max-width: 560px) {
  .hero-row { flex-direction: column; align-items: stretch; gap: 6px; } .hspark { max-width: none; }
  .cd .big { font-size: 20px; }
  .own-row { grid-template-columns: minmax(60px, 1fr) 96px 56px 60px; gap: 8px; }
  .hb .r { grid-template-columns: minmax(5.5rem, 34%) minmax(0, 1fr) auto; gap: 8px; font-size: 13px; }
  .row-head { flex-wrap: wrap; }
}
.sum li.up, .sum li.down, .sum li.amb { color: var(--fg); }
@media (max-width: 560px) { .tiles.four { grid-template-columns: 1fr 1fr; } .tile .s { font-size: 11.5px; } }
.grid.four .row-head { min-height: 46px; align-items: flex-start; }
.grid.four .kv > div { white-space: nowrap; }
.grid.four .kv span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Investment risk ---------- */
.rhead { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.rscore { font-size: 46px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rscore small { font-size: 18px; color: var(--muted); font-weight: 500; }
.rname { font-family: var(--mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #d1d1d6; }
.rscale { position: relative; display: flex; gap: 3px; height: 14px; margin-top: 26px; }
.rscale > span { flex: 1; border-radius: 3px; opacity: .85; position: relative; }
.rscale > span b { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font: 600 11px var(--mono); color: var(--dim); }
.rmark { position: absolute; top: -8px; bottom: -8px; width: 3px; margin-left: -1.5px; background: var(--fg); border-radius: 2px; box-shadow: 0 0 0 2px #000; }
.rmark em { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -4px); font: 700 12px var(--mono); font-style: normal; color: var(--fg); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.rends { display: flex; justify-content: space-between; margin-top: 22px; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rsplit { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; }
.rlegend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font: 12px var(--mono); color: var(--muted); }
.rlegend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.rdots { display: inline-flex; gap: 3px; vertical-align: middle; }
.rdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }

/* ---------- Spending vs budget ---------- */
.sv-total { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.sv-total > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.sv-total .k { width: 100%; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sv-total b { font-size: 20px; font-variant-numeric: tabular-nums; }
.sv .r { display: grid; grid-template-columns: minmax(8rem, 26%) minmax(0, 1fr) 128px 76px; align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sv .r:first-child { border-top: 0; }
.sv .l { color: #d1d1d6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv .b { position: relative; height: 10px; background: var(--panel2); border-radius: 5px; }
.sv .b > span { display: block; height: 100%; border-radius: 5px; }
.sv .bm { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--fg); border-radius: 1px; }
.sv .v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sv .pill { min-width: 0; width: 76px; font-size: 12.5px; }
.pill.amber { background: color-mix(in srgb, var(--amber) 22%, transparent); color: var(--amber); }
@media (max-width: 560px) {
  .sv-total { grid-template-columns: 1fr 1fr; } .sv-total > div:last-child { grid-column: 1 / -1; }
  .sv .r { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "b p"; gap: 6px 10px; font-size: 13px; }
  .sv .l { grid-area: l; } .sv .v { grid-area: v; } .sv .b { grid-area: b; } .sv .pill { grid-area: p; width: 64px; font-size: 11.5px; }
}
.sv .pill { white-space: nowrap; width: auto; min-width: 64px; padding: 3px 8px; }
.pill.warn { background: var(--amber); color: #000; }
.isa-risk { padding: 6px 0 14px; border-top: 1px solid var(--line); }
.isa-risk:first-child { border-top: 0; }
.rwho { font-size: 16px; margin-right: 6px; }
.rscore.sm { font-size: 28px; }

/* Moving house boxes: one line per row so all four line up */
#house-options .opt .row-head { min-height: 26px; }
#house-options .opt h4 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#house-options .kv > div { white-space: nowrap; }
#house-options .kv span { overflow: hidden; text-overflow: ellipsis; }
.keyline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 24px; margin: 16px 0 0; }
.keyline div { margin: 0; }
.keyline dt { font-size: 12px; color: var(--fg); font-weight: 600; margin-bottom: 2px; }
.keyline dd { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
@media (max-width: 900px) { .keyline { grid-template-columns: 1fr 1fr; } }

/* Net worth forecast boxes */
.tiles.fc { grid-template-columns: repeat(4, 1fr); margin-bottom: 4px; }
.tiles.fc .tile.on { border-color: var(--accent); }
@media (max-width: 560px) { .tiles.fc { grid-template-columns: 1fr 1fr; } }

/* Your plan at a glance */
.rings-card { margin-top: 4px; }
.rings-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 30px; align-items: center; }
.rings { position: relative; width: 240px; height: 240px; }
.rings svg { width: 100%; height: 100%; display: block; }
.rings .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.rings .mid b { font-size: 22px; font-weight: 700; }
.rings .mid span { font: 9px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.rings-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rr { position: relative; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.rr.go { cursor: pointer; transition: border-color .15s; }
.rr.go:hover, .rr.go:focus-visible { border-color: var(--muted); outline: none; }
.rr .pill { position: absolute; right: 12px; top: 12px; }
.rr .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; padding-right: 64px; }
.rr .k i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.rr .v { font-size: 26px; font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.rr .s { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.col-stack { display: flex; flex-direction: column; gap: 14px; }
.col-stack > .card { margin: 0; }
@media (max-width: 900px) { .rings-wrap { grid-template-columns: 1fr; justify-items: center; } .rings-rows { width: 100%; } }
@media (max-width: 560px) { .rings { width: 210px; height: 210px; } .rings-rows { grid-template-columns: 1fr; } .rr .v { font-size: 24px; } }

/* Opening block: change against last month */
.big .delta { display: inline-block; font-size: 17px; font-weight: 600; margin-left: 14px; letter-spacing: 0; vertical-align: middle; white-space: nowrap; color: var(--fg); }
.big .delta i { font-style: normal; }
@media (max-width: 560px) { .big .delta { display: block; margin: 2px 0 0; font-size: 15px; } }
/* Spending list, like the Apple Stocks list */
.slist { margin-top: 6px; }
.srow { display: grid; grid-template-columns: 1fr auto 86px; gap: 16px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.srow:first-child { border-top: 0; }
.srow .n { font-size: 15px; font-weight: 600; min-width: 0; }
.srow .n small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.srow .v { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.srow .pill { width: 78px; min-width: 0; }
.srow .pill { white-space: nowrap; font-size: 12px; }

/* Outgoings by category with spent so far this year */
.hb.ytd .r { grid-template-columns: minmax(7rem, 24%) minmax(0, 1fr) 76px 120px 96px; }
.hb.ytd .v small { font-size: 12px; color: var(--dim); margin-left: 2px; }
.hb.ytd .r.head { padding-bottom: 2px; }
.hb.ytd .r.head .v { font-size: 11px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #c7c7cc; font-weight: 700; }
.hb.ytd .v { text-align: right; }
.hb.ytd .v.w { color: var(--muted); }
.hb.ytd .v i { font-style: normal; }
@media (max-width: 560px) { .hb.ytd .r { grid-template-columns: minmax(0, 1fr) 56px 92px 66px; gap: 8px; font-size: 13px; } .hb.ytd .b, .hb.ytd .b0 { display: none; } .hb.ytd .l { white-space: normal; overflow: visible; line-height: 1.25; } .hb.ytd .r.head .v { font-size: 9.5px; } }
.hb.ytd .v i.flat { color: var(--fg); }

/* Saved this month / this year labels */
.hero-sub .chip.lead { margin-right: 10px; }
.hero-sub .hchip { display: inline-flex; align-items: center; gap: 8px; }
/* Documents panel */
.docs { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.docs::backdrop { background: rgba(0, 0, 0, .7); }
.docs-up { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.docs-up input[type=file] { flex: 1; min-width: 0; font-size: 13px; }
.docs .tbl td, .docs .tbl th { font-size: 13px; }
.docs .docname { word-break: break-word; }
.docs .docbtns { white-space: nowrap; text-align: right; }
.docs .docbtns .ghost { padding: 4px 9px; margin-left: 4px; }
.docs-safe { margin-top: 14px; }
.msg.ok { color: var(--up); }
.docs .num { text-align: right; }
/* About panel */
.about { width: min(680px, calc(100vw - 32px)); line-height: 1.55; font-size: 14px; color: #d1d1d6; }
.about h4 { margin: 18px 0 6px; font-size: 15px; color: var(--fg); }
.about p { margin: 0 0 8px; }
.about ul { margin: 0 0 8px; padding-left: 18px; }
.about li { margin: 3px 0; }
.about b { color: var(--fg); }
.about .small { font-size: 13px; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.brand .tagline { font-family: var(--sans, inherit); letter-spacing: 0; text-transform: none; color: var(--muted); font-weight: 500; font-size: 12.5px; margin-left: 8px; }
@media (max-width: 560px) { .brand .tagline { display: none; } }

/* Tax-free cash comparison */
.legend .lg-tfc.a::before { border-top: 3px solid #1ee8ff; } .legend .lg-tfc.b::before { border-top: 3px solid #ff2d9b; }
#tfc-table td.best { color: var(--fg); font-weight: 600; }

.demo-banner { margin: 14px 0 0; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 8%, transparent); border-radius: 12px; font-size: 13px; line-height: 1.5; color: #d1d1d6; }
.demo-banner b { color: var(--amber); }
/* Demo only: banner buttons and the "your own figures" setup */
.demo-banner .vbtns { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-left: 4px; }
.vbtn { background: var(--amber); color: #000; border: 0; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.vbtn:hover { filter: brightness(1.08); }
.vsetup { width: min(620px, calc(100vw - 24px)); }
.vsetup .vprog { display: flex; gap: 6px; margin: 4px 0 12px; }
.vsetup .vprog i { flex: 1; height: 4px; border-radius: 2px; background: var(--panel2); }
.vsetup .vprog i.on { background: var(--amber); }
.vsetup .vprog i.done { background: color-mix(in srgb, var(--amber) 55%, transparent); }
.vsetup .vt { margin: 4px 0 2px; font-size: 20px; color: var(--fg); }
.vsetup .fld { display: block; margin: 0 0 14px; }
.vsetup .fl { display: block; font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 5px; }
.vsetup .fh { display: block; font-size: 12.5px; line-height: 1.45; color: var(--muted); margin-top: 5px; }
.vsetup .fh a { color: var(--accent); }
.vsetup .fi { position: relative; }
.vsetup .fi input, .vsetup .fi select { width: 100%; box-sizing: border-box; font-size: 16px; }
.vsetup .fi.money input { padding-left: 24px; }
.vsetup .fi.money::before { content: "£"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.vsetup .fi.pct input { padding-right: 28px; }
.vsetup .fi.pct::after { content: "%"; position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.vsetup .budget .bh, .vsetup .budget .br { display: grid; grid-template-columns: minmax(0, 1fr) 120px 28px; gap: 8px; align-items: center; }
.vsetup .budget.two .bh, .vsetup .budget.two .br { grid-template-columns: minmax(0, 1fr) 100px 100px 28px; }
.vsetup .budget .bh { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.vsetup .budget .br { margin-bottom: 6px; }
.vsetup .budget .bc { font-size: 14px; color: #d1d1d6; }
.vsetup .budget input { width: 100%; box-sizing: border-box; font-size: 16px; padding: 8px 10px; }
.vsetup .x { background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.vsetup .x:hover { color: var(--down); }
.vsetup .addb { margin: 4px 0 6px; }
.vsetup .adds { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.vsetup .vcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 2px; margin: 0 0 12px; background: color-mix(in srgb, var(--panel2) 50%, transparent); }
.vsetup .vch { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.vsetup .vch b { color: var(--fg); font-size: 15px; }
.vsetup .more { border-left: 2px solid var(--line); padding-left: 12px; margin: 4px 0 10px; }
.vsetup .vmore { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); margin: 14px 0 0; cursor: pointer; }
.vsetup .vnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; position: sticky; bottom: -18px; background: var(--panel); padding: 12px 0 2px; border-top: 1px solid var(--line); }
.vsetup .vnav #vsetup-next { margin-left: auto; }
@media (max-width: 560px) {
  .vsetup .budget .bh, .vsetup .budget .br { grid-template-columns: minmax(0, 1fr) 96px 24px; }
  .vsetup .budget.two .bh, .vsetup .budget.two .br { grid-template-columns: minmax(0, 1fr) 76px 76px 24px; }
}

/* First visit: welcome screen in place of the dashboard */
.v-welcome .tabs, .v-welcome .tab, .v-welcome .assume, .v-welcome #load-msg, .v-welcome .demo-banner, .v-welcome #docs-open, .v-welcome .foot, .v-welcome .top .chip { display: none !important; }
.vwelcome { max-width: 640px; margin: 28px auto 40px; }
.vwelcome h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.1; margin: 6px 0 14px; letter-spacing: -0.02em; }
.vwelcome .lead { font-size: 17px; line-height: 1.55; color: #d1d1d6; margin: 0 0 18px; }
.vwelcome .vw-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.vwelcome .vw-list li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.vwelcome .vw-list b { color: var(--fg); }
.vwelcome .vw-btns { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.vbtn.big { font-size: 16px; padding: 12px 22px; }
.vwelcome .vw-btns .ghost { font-size: 15px; padding: 11px 18px; }
.vwelcome .vw-safe { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.vwelcome .vw-small { color: var(--dim); font-size: 12.5px; margin: 0; }
/* Reading bank statements */
.vsetup .vstmt { border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 7%, transparent); border-radius: 12px; padding: 12px 14px; margin: 4px 0 14px; }
.vsetup .vstmt > b { color: var(--fg); font-size: 15px; }
.vsetup .fh.err { color: var(--down); }
.vsetup .fh.ok { color: var(--up); }
.vsetup .rtab { margin: 10px 0 4px; }
.vsetup .rtab .rh, .vsetup .rtab .rr { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 14px; }
.vsetup .rtab .rh { font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.vsetup .rtab .rr { border-bottom: 1px solid var(--line); color: #d1d1d6; }
.vsetup .rtab .rr span:last-child { font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 600; }
.vsetup .ur { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.vsetup .ur .un { font-size: 13.5px; color: #d1d1d6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vsetup .ur .un small { color: var(--muted); }
.vsetup .ur select { font-size: 14px; padding: 6px 8px; width: 100%; }
/* Goals step */
.vsetup .gcard { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 8px; }
.vsetup .gcard.on { border-color: color-mix(in srgb, var(--amber) 60%, transparent); background: color-mix(in srgb, var(--amber) 6%, transparent); }
.vsetup .gcard.off { opacity: .45; }
.vsetup .gcard .gh { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.vsetup .gcard .gh input { width: 16px; height: 16px; accent-color: var(--amber); }
.vsetup .gcard .gh b { color: var(--fg); font-size: 15px; }
.vsetup .gcard .gb { margin: 10px 0 0 26px; }
/* Funds inside a pension or ISA */
.vsetup .funds { margin: 2px 0 10px; }
.vsetup .fund-row { border-top: 1px dashed var(--line); padding: 8px 0 4px; }
.vsetup .fund-row .fr1 { display: grid; grid-template-columns: minmax(0, 1fr) 28px; gap: 6px; align-items: center; }
.vsetup .fund-row .fr2 { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 6px; margin-top: 6px; }
.vsetup .fund-row input, .vsetup .fund-row select { width: 100%; box-sizing: border-box; font-size: 15px; padding: 8px 10px; }

/* Invite only */
.v-locked .tabs, .v-locked .tab, .v-locked .assume, .v-locked #load-msg, .v-locked .demo-banner, .v-locked #docs-open, .v-locked .foot, .v-locked .top .chip, .v-locked .vwelcome:not(.vinvite) { display: none !important; }
.vinvite .vinv-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.vinvite .vinv-row input { flex: 1; min-width: 220px; font-size: 18px; letter-spacing: .06em; text-transform: uppercase; padding: 12px 14px; }
