/* style.css — mobile-first, violet + mint theme. Colours live in the variables below; dark mode just swaps them.
   Views only use the class names here; to re-theme, change the variables (and the few gradients marked "brand"). */
:root {
  --bg: #F6F4FB; --card: #ffffff; --text: #1E1B2E; --muted: #6B6780; --border: #ECE8F5;
  --accent: #7C3AED; --accent-2: #5B21B6; --accent-soft: #EFE9FD; --accent-text: #ffffff;
  --pos: #059669; --neg: #DC2626; --warn-bg: #FFF7E0; --warn-text: #6B4E00;
  --shadow: 0 1px 2px rgb(30 27 46 / 4%), 0 4px 16px rgb(91 33 182 / 7%);
  --brand-grad: linear-gradient(135deg, #4C1D95 0%, #6D28D9 55%, #8B5CF6 100%);
  --nav-h: 64px; --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #120F1F; --card: #1C1830; --text: #F3F0FA; --muted: #A69FBF; --border: #2E2748; --accent: #A78BFA; --accent-2: #7C3AED; --accent-soft: #2A2245; --accent-text: #120F1F; --pos: #34D399; --neg: #F87171; --warn-bg: #3A3017; --warn-text: #F2D98A; --shadow: 0 2px 14px rgb(0 0 0 / 35%); --brand-grad: linear-gradient(135deg, #2E1065 0%, #4C1D95 55%, #6D28D9 100%); }
}
:root[data-theme="dark"] { --bg: #120F1F; --card: #1C1830; --text: #F3F0FA; --muted: #A69FBF; --border: #2E2748; --accent: #A78BFA; --accent-2: #7C3AED; --accent-soft: #2A2245; --accent-text: #120F1F; --pos: #34D399; --neg: #F87171; --warn-bg: #3A3017; --warn-text: #F2D98A; --shadow: 0 2px 14px rgb(0 0 0 / 35%); --brand-grad: linear-gradient(135deg, #2E1065 0%, #4C1D95 55%, #6D28D9 100%); }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
h1 { font-size: 1.5rem; margin: .3em 0 .15em; font-weight: 750; letter-spacing: -.2px; }
h2 { font-size: 1.08rem; margin: 1.3em 0 .55em; font-weight: 700; }
h3 { font-size: 1rem; margin: 14px 0 6px; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: .82rem; }
.pos { color: var(--pos); } .neg { color: var(--neg); }

/* ---------- Top bar (brand) ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); background: var(--brand-grad); color: #fff; box-shadow: 0 4px 18px rgb(76 29 149 / 22%); }
.topbar .brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 750; font-size: 1.08rem; letter-spacing: .2px; white-space: nowrap; }
.topbar .brand::before { content: '₹'; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(135deg, #6EE7B7, #10B981); color: #064E3B; font: 800 17px system-ui, sans-serif; box-shadow: 0 0 0 3px #ffffff26; }
.topbar #profile-switch { flex: 1 1 0; min-width: 0; }
/* person dropdown (Home only) and the "whose numbers" label (other screens) */
.topbar select.person-select { width: auto; max-width: 52vw; margin: 0; padding: 6px 30px 6px 12px; border-radius: 999px; border: 1px solid #ffffff50; color: #fff; font-weight: 650; font-size: .88rem; cursor: pointer;
  -webkit-appearance: none; appearance: none; text-overflow: ellipsis;
  background: #ffffff22 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") right 11px center no-repeat; }
.topbar select.person-select option { color: #1E1B2E; background: #fff; }
.person-pill { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 11px; border-radius: 999px; background: #ffffff1f; color: #ffffffe0; font-size: .8rem; font-weight: 600; text-decoration: none; }

/* ---------- Navigation: bottom bar on phones (all six tabs), sidebar on desktop ---------- */
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom);
  background: var(--card); box-shadow: 0 -4px 20px rgb(30 27 46 / 8%); border-top: 1px solid var(--border); }
.nav a { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .68rem; font-weight: 600; text-decoration: none; color: var(--muted); }
.nav a .ico { display: grid; place-items: center; width: 44px; height: 28px; border-radius: 999px; transition: background .15s, color .15s; }
.nav a.active { color: var(--accent); }
.nav a.active .ico { background: var(--accent-soft); }
.nav .lbl-full { display: none; } .nav .lbl-short { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.view { padding: 14px 16px calc(var(--nav-h) + 40px); max-width: 1000px; margin: 0 auto; }
.foot { text-align: center; padding: 0 16px calc(var(--nav-h) + 24px); }

@media (min-width: 800px) {
  body { padding-left: 220px; }
  .nav { top: 0; bottom: auto; right: auto; width: 220px; height: 100vh; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 84px 12px 0; border-top: 0; border-right: 1px solid var(--border); box-shadow: none; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 9px 12px; border-radius: 12px; font-size: .95rem; }
  .nav a .ico { width: auto; height: auto; background: none !important; }
  .nav a.active { background: var(--accent-soft); }
  .nav a:hover:not(.active) { background: color-mix(in srgb, var(--accent) 6%, transparent); }
  .nav .lbl-full { display: block; } .nav .lbl-short { display: none; }
  .topbar { margin-left: -220px; padding-left: 236px; }
  .view { padding-bottom: 40px; } .foot { padding-bottom: 20px; }
}

/* ---------- Privacy gate (shown on every load) ---------- */
body.gated { overflow: hidden; }
body.gated > .topbar, body.gated > .nav, body.gated > .view, body.gated > .foot { visibility: hidden; }
.gate { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 85% 0%, #8B5CF6 0%, transparent 45%), radial-gradient(circle at 0% 100%, #10B98155 0%, transparent 40%), var(--brand-grad); }
.gate-card { background: var(--card); color: var(--text); border-radius: 24px; padding: 26px 22px 22px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgb(20 8 50 / 40%); margin: auto; }
.gate-lock { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 1.7rem; background: linear-gradient(135deg, #D1FAE5, #A7F3D0); margin-bottom: 10px; }
.gate-card h1 { font-size: 1.45rem; margin: 0 0 4px; }
.gate-card > p { margin: 0 0 14px; font-size: .92rem; }
.gate-points { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 12px; }
.gate-points li { display: flex; gap: 12px; align-items: flex-start; }
.gate-points b { font-size: .92rem; }
.gate-ico { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); font-size: 1.05rem; }
.gate-check { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); font-weight: 600; font-size: .92rem; cursor: pointer; margin-bottom: 14px; }
.gate-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent-2); flex: none; }
.btn.block-center { display: block; width: 100%; text-align: center; padding: 13px 16px; font-size: 1rem; font-weight: 700; }

/* ---------- Cards and grids ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.grid { display: grid; gap: 12px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid .card, .grid .stat { margin: 0; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat-label { font-size: .76rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.3rem; font-weight: 750; margin: 3px 0; word-break: break-word; letter-spacing: -.2px; }
.stat-note { font-size: .74rem; color: var(--muted); }
.cat-card { display: block; text-decoration: none; color: inherit; border-left: 4px solid var(--accent); transition: transform .12s, box-shadow .12s; }
.cat-card:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgb(91 33 182 / 12%); }
.cat-head { border-left: 4px solid var(--accent); padding-left: 10px; display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; }
.cat-head h2 { margin: 0 0 6px; }
.chart-box { height: 320px; position: relative; }
.chart-box.short { height: 260px; }
.note { background: var(--warn-bg); color: var(--warn-text); padding: 11px 14px; border-radius: 14px; }
.empty { text-align: center; padding: 34px 16px; }
.back { display: inline-block; margin-top: 6px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 6px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child > td { border-bottom: 0; }
th { font-size: .72rem; color: var(--muted); font-weight: 650; white-space: nowrap; text-transform: uppercase; letter-spacing: .3px; }
.num { text-align: right; white-space: nowrap; }
tr.clickable { cursor: pointer; } tr.clickable:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.name { font-weight: 600; }
table.edit input, table.edit select { min-width: 90px; padding: 5px; }
table.edit td:nth-child(4) input { min-width: 160px; }
tr.dup { opacity: .65; } tr.bad { background: color-mix(in srgb, var(--neg) 10%, transparent); }

/* ---------- Buttons and forms ---------- */
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.row.between { justify-content: space-between; }
.btn { display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: filter .12s, background .12s; }
.btn:hover { background: var(--accent-soft); }
.btn.primary { background: linear-gradient(135deg, #6D28D9, #8B5CF6); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgb(109 40 217 / 30%); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 45%, transparent); }
.btn.small { padding: 5px 12px; font-size: .84rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; filter: grayscale(.4); }
.btn.block { display: block; width: 100%; text-align: left; margin: 4px 0; border-radius: 14px; }
.form label { display: block; margin: 10px 0; font-size: .85rem; color: var(--muted); }
input, select, textarea { width: 100%; padding: 10px 12px; margin-top: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px; }
input[type=checkbox] { width: auto; accent-color: var(--accent-2); }
.txn-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.txn-row input { margin: 0; }
.seg { display: flex; gap: 4px; } .grow { flex: 1; min-width: 180px; } .grow select { margin: 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%); background: #1E1B2E; color: #fff; padding: 11px 18px; border-radius: 999px; z-index: 50; box-shadow: 0 8px 24px rgb(0 0 0 / 25%); }

/* ---------- Import ---------- */
.raw { white-space: pre-wrap; font-size: .75rem; background: var(--bg); padding: 10px; border-radius: 10px; overflow-x: auto; }
tr.flag { background: color-mix(in srgb, #F59E0B 18%, transparent); }
.card.off { opacity: .55; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 10px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--text); }
.dropzone { display: block; text-align: center; padding: 28px 16px; border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: var(--radius); cursor: pointer; background: color-mix(in srgb, var(--accent) 3%, var(--card)); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dz-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }
.result { border-left: 4px solid var(--pos); }
.res-list { margin-top: 8px; } .res-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.res-notes { margin: 8px 0 0; padding-left: 18px; font-size: .82rem; color: var(--muted); }

/* ---------- Progress bars, badges, gauges ---------- */
.bar { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.tall { height: 14px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.badge.ok { background: color-mix(in srgb, var(--pos) 16%, transparent); color: var(--pos); }
.badge.no { background: color-mix(in srgb, var(--neg) 16%, transparent); color: var(--neg); }
.checks label { display: flex; align-items: center; gap: 8px; margin: 4px 0; color: var(--text); }
.catchup { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 4px; } .catchup h3 { margin: 10px 0 4px; font-size: 1rem; }
.gauge { margin: 10px 0; } .gauge-head { margin-bottom: 4px; }
.gauge.click { cursor: pointer; border-radius: 12px; padding: 6px 8px; } .gauge.click:hover { background: var(--accent-soft); }
.eat { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--border); margin: 6px 0; }
.eat .keep { background: #10B981; } .eat .lose { background: #EF4444; }
details.card > summary { cursor: pointer; font-weight: 650; }

/* ---------- Overview hero: the big net-worth card (brand) ---------- */
.hero { display: flex; gap: 14px; flex-wrap: wrap; align-items: stretch; position: relative; overflow: hidden; color: #fff; border: 0; padding: 20px 18px;
  background: radial-gradient(circle at 100% 0%, #A78BFA66 0%, transparent 45%), radial-gradient(circle at 0% 110%, #10B98140 0%, transparent 45%), var(--brand-grad);
  box-shadow: 0 10px 30px rgb(76 29 149 / 28%); border-radius: 22px; }
.hero .hero-text { flex: 1 1 260px; min-width: 0; }
.hero .hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hero .hero-label { font-size: .76rem; opacity: .85; font-weight: 650; letter-spacing: .3px; text-transform: uppercase; }
.hero .hero-icon { border: 1px solid #ffffff40; background: #ffffff1f; color: #fff; border-radius: 999px; min-width: 34px; height: 30px; padding: 0 10px; font: inherit; font-size: .85rem; font-weight: 650; cursor: pointer; }
.hero .hero-icon:hover { background: #ffffff38; }
.hero .hero-value-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0 4px; }
.hero .hero-value { font-size: 2.2rem; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.hero .hero-legend { display: flex; gap: 14px; font-size: .74rem; opacity: .9; margin-top: 4px; }
.hero .hero-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.hero .hero-since { font-size: .93rem; opacity: .95; } .hero .hero-since b { font-weight: 700; }
.hero .hero-chart-wrap { flex: 1 1 340px; max-width: 460px; min-width: 240px; align-self: center; margin-left: auto; }
.hero .hero-chart-title { font-size: .74rem; opacity: .8; margin-bottom: 2px; }
.hero .hero-chart { height: 150px; position: relative; }
.hero .hero-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.hero .chip { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; background: #ffffff22; padding: 3px 10px; border-radius: 999px; }
.hero .chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.hero .chip.gain { background: #10B981cc; font-weight: 700; } .hero .chip.gain.neg { background: #EF4444cc; }
.hero .hero-btns { margin-top: 12px; }
.hero .btn { background: #ffffff24; color: #fff; border-color: #ffffff40; box-shadow: none; }
.hero .btn:hover { background: #ffffff38; }

/* ---------- Investments: holdings list ---------- */
.add-row { flex-wrap: nowrap; } .add-row .btn { white-space: nowrap; } .add-row .btn.primary { flex: 1 1 auto; text-align: center; }
.hold-sum { padding: 14px 16px; }
.hs-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hs-k { font-size: .74rem; color: var(--muted); font-weight: 600; }
.hs-big { font-size: 1.7rem; font-weight: 800; letter-spacing: -.4px; line-height: 1.15; margin-top: 2px; }
.hs-ret { font-weight: 750; font-size: .9rem; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, currentColor 12%, transparent); white-space: nowrap; }
.hs-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.hs-v { font-weight: 750; font-size: 1rem; margin-top: 2px; white-space: nowrap; }
.hold-tools { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 14px 0 4px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chips .chip-btn { padding: 5px 11px; }
select.sort-select { width: auto; margin: 0; padding: 5px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--card); flex: none; }
.hold-card { padding: 4px 0; overflow: hidden; }
.hold-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px 8px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.hold-head-l { display: flex; align-items: center; } .hold-head-l .dot { margin-right: 7px; } .hold-head-l .muted { margin-left: 4px; }
.hold-head-r { display: flex; align-items: center; gap: 10px; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: .78rem; font-weight: 650; color: var(--neg); cursor: pointer; opacity: .8; }
.link-btn:hover { opacity: 1; text-decoration: underline; }
.hold-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.hold-row:last-child { border-bottom: 0; }
.hold-row:hover, .hold-row:focus-visible { background: color-mix(in srgb, var(--accent) 5%, transparent); outline: none; }
.hold-badge { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: .82rem; letter-spacing: .3px; }
.hold-main { flex: 1 1 auto; min-width: 0; }
.hold-name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hold-sub { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.hold-warn { font-size: .74rem; color: var(--warn-text); background: var(--warn-bg); border-radius: 6px; padding: 1px 6px; margin-top: 3px; display: inline-block; }
.hold-val { flex: none; text-align: right; }
.hold-cur { font-weight: 750; white-space: nowrap; }
.hold-gain { font-size: .76rem; font-weight: 650; white-space: nowrap; margin-top: 1px; }
.hold-chev { flex: none; color: var(--muted); font-size: 1.3rem; line-height: 1; margin-left: -4px; opacity: .6; }

/* ---------- Growth ---------- */
.show-sm { display: none !important; }
.hs-sub { display: block; font-size: .7rem; font-weight: 600; color: var(--muted); }
.garden-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .74rem; color: var(--muted); margin-bottom: 6px; }
.garden-legend span { display: inline-flex; align-items: center; gap: 5px; }
.garden-legend i { display: inline-block; }
.lg-coin { width: 14px; height: 6px; border-radius: 2px; background: var(--accent); box-shadow: 0 -3px 0 color-mix(in srgb, var(--accent) 55%, transparent); margin-top: 3px; }
.lg-leaf { width: 9px; height: 13px; border-radius: 50%; background: var(--pos); } .lg-leaf.amber { background: var(--warn-text); }
.year-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.year-row:last-child { border-bottom: 0; }
.yr-label { flex: none; width: 44px; font-weight: 800; font-size: .95rem; line-height: 1.1; }
.yr-ytd { display: block; font-size: .64rem; font-weight: 650; color: var(--accent); text-transform: uppercase; letter-spacing: .3px; }
.yr-main { flex: 1 1 auto; min-width: 0; }
.yr-bar { position: relative; height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 2px 0 5px; }
.yr-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.yr-inv { background: color-mix(in srgb, var(--accent) 45%, var(--card)); z-index: 1; }
.yr-val { background: var(--pos); opacity: .85; } .yr-val.under { background: var(--warn-text); z-index: 2; }
details.how { margin: 10px 2px; } details.how summary { cursor: pointer; font-weight: 600; } details.how p { margin: 6px 0 0; }

/* ---------- Inflation ---------- */
.hs-row.flat { margin-top: 0; padding-top: 0; border-top: 0; }
.hold-row.static { cursor: default; } .hold-row.static:hover { background: none; }
.hold-name .dot { width: 9px; height: 9px; margin-right: 6px; vertical-align: 1px; }
.verdict { display: inline-block; font-size: .68rem; font-weight: 750; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, currentColor 12%, transparent); vertical-align: 1px; }
details.fold h3 { margin: 6px 0 4px; font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
details.fold .show-sm .hold-row { padding-left: 2px; padding-right: 2px; }

/* ---------- Goals (milestones) ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.goal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.goal-head h2 { margin: 0 0 2px; font-size: 1.08rem; }
.goal-actions { display: flex; gap: 12px; flex: none; padding-top: 3px; }
.link-btn.plain { color: var(--accent); text-decoration: none; }
.goal-prog { margin: 14px 0 8px; }
.goal-nums { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.goal-saved { font-size: 1.45rem; font-weight: 800; letter-spacing: -.3px; }
.goal-pct { margin-left: auto; font-weight: 800; font-size: 1.05rem; color: var(--accent); }
.goal .bar.tall { height: 12px; margin-top: 6px; }
.goal-verdict { font-size: .84rem; padding: 8px 11px; border-radius: 12px; margin: 10px 0 2px; }
.goal-verdict.ok { background: color-mix(in srgb, var(--pos) 11%, transparent); } .goal-verdict.ok b { color: var(--pos); }
.goal-verdict.no { background: color-mix(in srgb, var(--neg) 9%, transparent); } .goal-verdict.no b { color: var(--neg); }
.goal .hs-row { margin-top: 10px; }
details.fold.catchup { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
.catchup-visual .gauge-head { font-size: .88rem; }

/* ---------- Invested vs Growth (Flow) ---------- */
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.flow-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin: 18px 0 8px; }
.flow-head h2 { margin: 0; }
.flow-head .seg .btn { white-space: nowrap; }
/* a card that folds: the summary line is the card's title and a one-line answer */
details.fold > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '›'; font-size: 1.4rem; line-height: 1; color: var(--muted); transform: rotate(90deg); transition: transform .15s; flex: none; }
details.fold[open] > summary::after { transform: rotate(-90deg); }
details.fold[open] > summary { margin-bottom: 10px; }
.fold-title { font-weight: 750; font-size: 1.02rem; color: var(--text); }
.fold-sub { font-size: .84rem; font-weight: 650; margin-top: 2px; }
.cover-row { padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 8px; }
.cover-row:last-of-type { border-bottom: 0; }
.cover-row:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.cover-head { display: flex; align-items: center; gap: 2px; min-width: 0; }
.cover-head .dot { flex: none; }
.cover-st { margin-left: auto; padding-left: 10px; flex: none; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.cover-row .bar { margin: 6px 0 4px; }
.calc-grid { display: grid; gap: 0 10px; } .calc-grid.two { grid-template-columns: 1fr 1fr; } .calc-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.calc-grid label { margin: 6px 0; }

/* ---------- Snapshot (export image) dialog ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: #0d0820b3; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 20px 12px; }
.modal .sheet { background: var(--card); border-radius: 22px; padding: 16px; max-width: 520px; width: 100%; }
.modal img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); display: block; }

/* small print under overview totals */
.parts { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; font-size: .72rem; color: var(--muted); } .parts .dot { width: 7px; height: 7px; margin-right: 4px; }

/* tables that fit the window instead of scrolling */
.fit { padding: 8px 10px; } .fit table { table-layout: fixed; font-size: .82rem; } .fit th { white-space: normal; vertical-align: bottom; } .fit td, .fit th { padding: 7px 4px; overflow-wrap: anywhere; } .fit td.num, .fit th.num { white-space: normal; }
.fit.names th:first-child, .fit.names td:first-child { width: 40%; } .fit.years th:first-child, .fit.years td:first-child { width: 14%; } .fit td .name { font-size: .8rem; }
.garden { padding: 12px; } .garden .muted { padding-top: 6px; }

/* ---------- People chips (in the top bar) ---------- */
#profile-switch { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
.topbar { flex-wrap: wrap; }
.combine-row { flex-basis: 100%; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; margin-top: 2px; color: #ffffffd0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip-btn { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; }
.chip-btn.small { padding: 2px 10px; font-size: .78rem; }
.chip-btn.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chip-btn.add { color: var(--muted); border-style: dashed; }
.gear { text-decoration: none; font-size: 1.2rem; color: var(--muted); }
.topbar .chip-btn { background: #ffffff1f; color: #fff; border-color: #ffffff40; }
.topbar .chip-btn:hover { background: #ffffff33; }
.topbar .chip-btn.on { background: #fff; color: #4C1D95; border-color: #fff; }
.topbar .chip-btn.add { background: transparent; color: #ffffffd0; border-style: dashed; }
.topbar .combine-row .muted { color: #ffffffc0; }
.topbar .gear { color: #fff; opacity: .92; }

/* allocation card: soft violet/mint backdrop (a rising line and coins) */
.alloc { background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='400' viewBox='0 0 900 400'><g fill='none' stroke='%237C3AED' stroke-opacity='.10' stroke-width='3' stroke-linecap='round'><path d='M20 350 L140 300 L230 320 L350 230 L450 255 L580 160 L690 185 L880 60'/></g><g fill='%2310B981' fill-opacity='.10' stroke='%2310B981' stroke-opacity='.22' stroke-width='2'><circle cx='90' cy='70' r='34'/><circle cx='810' cy='330' r='42'/><circle cx='770' cy='90' r='22'/><circle cx='150' cy='330' r='24'/></g></svg>") center/cover no-repeat, linear-gradient(135deg, #F7F3FF 0%, #F0FBF6 100%); }
:root[data-theme="dark"] .alloc { background: linear-gradient(135deg, #1F1838 0%, #14282A 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .alloc { background: linear-gradient(135deg, #1F1838 0%, #14282A 100%); } }

/* ---------- phones ---------- */
.lg { display: inline; } .sm { display: none; }
@media (max-width: 600px) {
  .lg { display: none; } .sm { display: inline; } .hide-sm { display: none !important; } .show-sm { display: block !important; }
  /* one slim row: logo · person · ⚙ (the Combined "Include" chips wrap below it, on Home only) */
  .topbar { position: relative; flex-wrap: wrap; padding: 9px 12px; padding-top: calc(9px + env(safe-area-inset-top)); gap: 6px 8px; }
  .topbar .brand { font-size: 1rem; } .topbar .brand::before { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; }
  .topbar #profile-switch { flex-wrap: wrap; gap: 6px 10px; }
  .topbar .combine-row { flex: 1 1 100%; justify-content: flex-start; }
  .topbar .gear { font-size: 1.25rem; }
  .view { padding: 10px 12px calc(var(--nav-h) + 32px); }
  .grid.stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat { padding: 12px; } .stat-value { font-size: 1.12rem; }
  .parts { display: none; }
  .hs-big { font-size: 1.5rem; } .hs-v { font-size: .92rem; }
  .hold-tools { align-items: flex-start; }
  .flow-chart { height: 250px; padding: 10px 8px; }
  .flow-head { margin-top: 14px; } .flow-head h2 { font-size: 1rem; }
  .calc-grid label { font-size: .78rem; }
  .hold-row { padding: 10px 12px; gap: 10px; } .hold-badge { width: 36px; height: 36px; font-size: .76rem; } .hold-chev { display: none; }
  .card { padding: 14px; }
  /* compact net-worth card */
  .hero { padding: 14px 14px 10px; gap: 6px; border-radius: 20px; margin-top: 4px; }
  .hero .hero-value { font-size: 1.85rem; }
  .hero .hero-since { font-size: .85rem; }
  .hero .hero-chart-wrap { flex-basis: 100%; min-width: 0; max-width: none; }
  .hero .hero-chart { height: 92px; }
  .fit td, .fit th { padding: 6px 3px; } .fit table { font-size: .78rem; }
  .fit.names th:first-child, .fit.names td:first-child { width: 58%; } .fit td .name { font-size: .82rem; line-height: 1.25; } .fit .muted.small { font-size: .7rem; }
  h1 { font-size: 1.35rem; }
}
@media (max-width: 360px) { .nav a { font-size: .62rem; } .nav a .ico { width: 38px; } }

/* old-address notice */
.moved { margin: 10px auto 0; width: calc(100% - 24px); max-width: 968px; box-sizing: border-box; padding: 12px 14px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn-text); display: grid; gap: 6px; }
.moved .row { margin: 2px 0 0; }

/* ---------- Spend (expenses) ---------- */
.nav a .ico { width: 40px; }                       /* seven tabs share the bottom bar */
.month-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px 0 4px; }
.month-nav b { min-width: 110px; text-align: center; font-size: 1.05rem; }
.month-nav .btn { min-width: 38px; font-size: 1.1rem; line-height: 1; }
.spend-note { margin-top: 10px; }
.spend-cats h2 { margin: 0 0 6px; }
.list-head { display: flex; align-items: center; gap: 4px; margin: 14px 2px 6px; } .list-head .chip-btn { margin-left: auto; }
.spend-split { display: flex; gap: 18px; align-items: center; }
.spend-donut { flex: 0 0 200px; height: 200px; position: relative; }
.cat-lines { flex: 1 1 auto; min-width: 0; }
.cat-line { padding: 7px 6px; border-radius: 10px; cursor: pointer; }
.cat-line:hover, .cat-line.on { background: var(--accent-soft); }
.cat-line-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cat-line-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: .9rem; }
.cat-line-name .dot { width: 9px; height: 9px; margin-right: 7px; }
.cat-line-amt { white-space: nowrap; font-weight: 700; font-size: .9rem; }
.bar.thin { height: 6px; margin: 5px 0 0; }
.txn-edit { padding: 4px 14px 12px 66px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--accent) 4%, transparent); }
.txn-desc { word-break: break-all; padding-top: 6px; }
.txn-edit .row { margin-top: 8px; }
.more-btn { display: block; margin: 8px auto; }
.pwd-row { margin-top: 10px; }
input.need { border-color: var(--neg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--neg) 18%, transparent); }
.spend-foot { margin: 12px 0 4px; }
@media (max-width: 600px) {
  .spend-split { flex-direction: column; gap: 6px; align-items: stretch; }
  .spend-donut { flex-basis: auto; height: 170px; }
  .txn-edit { padding-left: 14px; }
}
