/*
 * Modern fintech design system. Loaded after each page's own <style>, so it restyles the app's
 * existing classes and adds a few new ones (hero, allocation bar, donut). Brand colours are the
 * leading accents (forest green for actions and the hero, gold for highlights); everything else is a
 * clean neutral plus fresh data colours. Every colour used by the app comes from the variables
 * below — change the palette here, nowhere else.
 */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap');

:root {
  /* midnight (hero, sidebar, login) + the logo's gold */
  --forest: #0E1A3D;
  --forest-hi: #1C2F6B;
  --forest-lo: #080F26;
  --gold: #C5A059;
  --gold-hi: #E3C98F;
  --cream: #F9F8F3;
  --charcoal: #1E293B;
  --gold-rgb: 197, 160, 89;
  /* text */
  --ink: #0B1220;
  --ink-2: #1E293B;
  --text-2: #334155;
  --muted: #4d596c;
  --muted-2: #5a667b;
  --ink-rgb: 11, 18, 32;
  /* surfaces + hairlines */
  --canvas: #f4f5f9;
  --surface: #ffffff;
  --paper: #f8f9fc;
  --paper-2: #eef0f6;
  --line: #e4e7ef;
  --line-2: #d0d5e2;
  /* interactive accent: indigo */
  --accent: #4f46e5;
  --accent-2: #4338ca;
  --accent-bg: #eef0ff;
  --accent-line: #c9cdf8;
  --accent-rgb: 79, 70, 229;
  /* status */
  --pos: #087f5b;  --pos-dot: #10b981;  --pos-bg: #e6f7f0;  --pos-on-dark: #6ee7b7;
  --neg: #d91e48;  --neg-dot: #f43f5e;  --neg-bg: #fff0f3;  --neg-line: #fbc9d4;  --neg-2: #be123c;
  --warn: #b45309; --warn-dot: #f59e0b; --warn-bg: #fef6e4; --warn-line: #f8dda0;
  /* chart series */
  --c1: #4f46e5; --c2: #d4a94f; --c3: #14b8a6; --c4: #38bdf8; --c5: #a78bfa; --c6: #fb7185;
  /* shape */
  --r: 10px;
  --r-card: 16px;
  --shadow-card: 0 1px 2px rgba(var(--ink-rgb), .04), 0 10px 28px -14px rgba(var(--ink-rgb), .14);
  --display: 'Manrope', 'Inter', system-ui, sans-serif;
}

html, body, .shell { background: var(--canvas); }
body { color: var(--ink); font-size: 14px; }
a { color: var(--accent-2); }
::selection { background: var(--accent-line); }

/* display face: page titles, hero and KPI figures, modal titles */
.display, .topbar h1, .modal-title, .hero-value, .hero-kpi b, .sb-logo-text { font-family: var(--display); font-variant-numeric: tabular-nums; }

/* ── Sidebar: brand forest green, gold active marker ── */
.sidebar { background: linear-gradient(180deg, var(--forest-hi) 0%, var(--forest) 38%, var(--forest-lo) 100%); border-right: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset; padding-top: 20px; }
.sb-logo { padding-bottom: 26px; }
.sb-logo-icon { background: linear-gradient(135deg, var(--gold-hi), var(--gold)); color: var(--forest); border-radius: 10px; box-shadow: 0 8px 16px -8px rgba(0,0,0,.5); }
.sb-logo-text { color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.sb-item { color: rgba(255,255,255,.66); position: relative; padding: 12px; border-radius: 10px; }
.sb-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sb-item.active { background: rgba(255,255,255,.13); color: #fff; }
.sb-item.active::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.sb-item .ic svg { color: currentColor; width: 20px; height: 20px; stroke-width: 1.75; }
.sb-item .lbl { color: inherit; font-size: 14px; font-weight: 600; }
.sb-user { border-top: 1px solid rgba(255,255,255,.14); }
.sb-user .nm { color: #fff; }
.sb-user .em { color: rgba(255,255,255,.62); }
.sb-signout { color: rgba(255,255,255,.62); }
.sb-signout:hover { color: #ffb3bf; }
.sb-avatar { background: linear-gradient(135deg, var(--gold-hi), var(--gold)); color: var(--forest); }

/* ── Top bar ── */
.topbar { background: var(--canvas); border-bottom: 0; height: 84px; padding: 0 40px; }
.topbar h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; line-height: 30px; }
.topbar .sub { font-size: 13px; color: var(--muted); }
.content { padding: 4px 40px 56px; }
.integ-pill { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); font-weight: 600; }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.card-head { padding: 18px 24px; font-size: 14px; font-weight: 700; letter-spacing: -0.005em; color: var(--ink); border-bottom: 1px solid var(--line); }

/* ── Tables ── */
table { font-variant-numeric: tabular-nums; }
th { background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
td { color: var(--text-2); padding: 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
tbody tr:last-child td { border-bottom: 0; }
tr.hoverable:hover { background: var(--paper); }
tr.foot, tr.foot td { background: var(--paper); }
tr.foot td { border-top: 1px solid var(--line-2); color: var(--ink); }
.strong { color: var(--ink); }

/* ── Badges ── */
.pill { border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border: 1px solid color-mix(in srgb, currentColor 16%, transparent); }
.integ-pill { font-weight: 700; }

/* ── Buttons ── */
.btn { border-radius: var(--r); box-shadow: none; font-weight: 600; font-size: 13.5px; padding: 9px 16px; transition: background .15s, border-color .15s, box-shadow .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #5b52f0, var(--accent-2)); border-color: var(--accent-2); color: #fff; box-shadow: 0 6px 14px -8px rgba(var(--ink-rgb), .6); }
.btn-primary:hover { background: linear-gradient(180deg, #6a62f5, var(--accent)); border-color: var(--accent); }
.btn-primary:disabled { background: var(--paper-2); border-color: var(--paper-2); color: var(--muted-2); box-shadow: none; }
.btn-outline { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); }
.btn-outline:hover { background: var(--paper); border-color: var(--muted-2); }
.btn-danger { background: var(--neg); border-color: var(--neg); color: #fff; }
.btn-danger:hover { background: var(--neg-2); border-color: var(--neg-2); }
.btn-tint { background: var(--accent-bg); color: var(--accent-2); border-color: var(--accent-line); }
.btn-tint:hover { background: #e0e4ff; }
.icon-btn:hover { background: var(--paper-2); }

/* ── Form fields ── */
.fld, .flt { color: var(--text-2); }
.fld input, .fld select, .flt input, .flt select { border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink); }
.fld input, .fld select { height: 40px; padding: 0 12px; }
.flt input, .flt select { height: 36px; }
input:focus, select:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18) !important; }
.info-box { background: var(--paper); border-radius: var(--r); border-color: var(--line); }
.warn-box { border-radius: var(--r); }
.viewer-note { border-radius: var(--r); }

/* ── Modal + toast ── */
.overlay { background: rgba(var(--ink-rgb), .5); backdrop-filter: blur(6px); }
.modal { border-radius: 20px; padding: 28px; box-shadow: 0 30px 60px -20px rgba(var(--ink-rgb), .45); }
.modal-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.modal-sub { color: var(--muted); font-size: 13px; }
.modal-actions { padding-top: 6px; }
#toast { background: var(--ink); border-radius: var(--r); box-shadow: 0 16px 32px -12px rgba(var(--ink-rgb), .5); }
#toast .dot { background: var(--pos-dot); }
.seg { background: var(--paper-2); border-radius: var(--r); }
.seg button.on { box-shadow: 0 1px 2px rgba(var(--ink-rgb), .12); }
.charity-toggle input:checked { background: var(--accent); }

/* ── Loader ── */
#appLoader { background: var(--canvas); }
.loader-spinner { border-color: var(--line); border-top-color: var(--accent); }
.loader-text { color: var(--muted); }

/* ── Dashboard: hero, allocation bar, donut ── */
.dash { display: flex; flex-direction: column; gap: 24px; animation: fadeIn 240ms ease-out; }
.dash > * { min-width: 0; }
.hero { position: relative; overflow: hidden; color: #fff; border-radius: 22px; padding: 34px 38px;
  background: radial-gradient(70% 140% at 100% 0%, rgba(var(--gold-rgb), .34), transparent 55%), radial-gradient(60% 90% at 0% 100%, rgba(99, 102, 241, .32), transparent 60%), linear-gradient(135deg, var(--forest-lo) 0%, var(--forest) 45%, var(--forest-hi) 100%);
  box-shadow: 0 28px 50px -30px rgba(var(--ink-rgb), .75); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: end; }
.hero::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); pointer-events: none; }
.hero-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.hero-value { font-size: 50px; line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; margin: 10px 0 10px; color: #fff; }
.hero-sub { font-size: 13px; color: rgba(255,255,255,.7); max-width: 460px; line-height: 1.55; }
.hero-kpis { display: grid; gap: 10px; }
.hero-kpi { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(4px); }
.hero-kpi span { font-size: 13px; color: rgba(255,255,255,.72); }
.hero-kpi b { font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.hero-kpi b.up { color: var(--pos-on-dark); }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.chart-body { padding: 24px; }
.alloc { display: flex; gap: 4px; height: 14px; border-radius: 999px; overflow: hidden; margin: 6px 0 22px; background: var(--paper-2); }
.alloc i { display: block; height: 100%; border-radius: 4px; min-width: 4px; }
.legend-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.legend-row:last-child { border-bottom: 0; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-row .nm { flex: 1; min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-row .amt { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 700; }
.legend-row .pc { width: 52px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.donut { width: 168px; height: 168px; flex-shrink: 0; }
.donut .center-label { font-family: var(--display); font-weight: 800; fill: var(--ink); font-size: 24px; }
.donut .center-sub { fill: var(--muted); font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.donut-legend { flex: 1; min-width: 200px; }
.empty-note { padding: 28px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* headline figures on detail pages (written inline by the views) */
.mono[style*="font-size:17px"] { font-family: var(--display); font-weight: 800 !important; font-size: 19px !important; letter-spacing: -0.02em; }

/* ── Login ── */
body { display: block !important; min-height: 100vh; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--canvas); }
.login-brand { position: relative; overflow: hidden; color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(80% 60% at 100% 0%, rgba(var(--gold-rgb), .34), transparent 55%), radial-gradient(70% 60% at 0% 100%, rgba(99, 102, 241, .34), transparent 60%), linear-gradient(145deg, var(--forest-lo) 0%, var(--forest) 50%, var(--forest-hi) 100%); }
.login-brand .mark { width: 46px; height: 46px; border-radius: 13px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); color: var(--gold-hi); display: inline-flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.login-brand .mark svg { width: 22px; height: 22px; }
.login-brand h2 { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 16px; max-width: 440px; }
.login-brand p { color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.6; max-width: 400px; margin: 0; }
.login-brand .fine { color: rgba(255,255,255,.5); font-size: 12px; letter-spacing: .08em; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--surface); }
.login-panel .card { background: transparent; border: 0; box-shadow: none; text-align: left; padding: 0; margin: 0; max-width: 380px; width: 100%; }
.login-panel .logo { display: none; }
.login-panel h1 { font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: -0.03em; margin-bottom: 8px; }
.login-panel .subtitle { color: var(--muted); margin-bottom: 28px; }
.login-panel .google-btn { height: 48px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-card); font-weight: 600; }
.login-panel .google-btn:hover { background: var(--paper); }
.login-panel .footer { color: var(--muted); }
.login-panel .error-msg { background: var(--neg-bg); border-color: var(--neg-line); color: var(--neg); border-radius: var(--r); }
@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { padding: 32px 28px; gap: 28px; }
  .login-brand h2 { font-size: 30px; }
}

/* ── Smaller screens ── */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .chart-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .topbar { padding: 0 16px; height: 72px; }
  .topbar h1 { font-size: 20px; }
  .content { padding: 4px 16px 40px; }
  .hero { padding: 24px 22px; }
  .hero-value { font-size: 36px; }
  .modal { padding: 22px; }
  .legend-row { gap: 8px; font-size: 13px; }
  .legend-row .pc { width: 44px; }
  .chart-body { padding: 18px; }
  .donut-wrap { justify-content: center; }
}

/* ═════════ Charts: line/area, sparkline, horizontal bars ═════════ */
.cbox { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; }
.cy { display: flex; flex-direction: column; justify-content: space-between; height: 200px; font: 600 11.5px var(--display); color: var(--muted); text-align: right; padding: 0 0 0; }
.cplot { position: relative; height: 200px; }
.chart { width: 100%; height: 100%; display: block; overflow: visible; animation: reveal 1.2s cubic-bezier(.3,.7,.2,1) .1s both; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .chart-line { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: none; animation: none; }
.chart rect:hover { fill: color-mix(in srgb, var(--accent) 8%, transparent); }
.cdot { position: absolute; right: -5px; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 2px 6px rgba(var(--ink-rgb), .3); animation: fadeUp .4s ease-out 1.1s both; }
.cx { grid-column: 2; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.chart-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chart-legend b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 1.1s cubic-bezier(.3,.7,.2,1) .15s both; }
.spark { width: 96px; height: 30px; display: block; overflow: visible; }
.spark .chart-line { stroke-width: 2; }
.hbar { padding: 11px 0; border-bottom: 1px solid var(--line); }
.hbar:last-child { border-bottom: 0; }
.hbar .hb-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-bottom: 8px; }
.hbar .nm { color: var(--text-2); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .amt { color: var(--pos); font-weight: 700; font-variant-numeric: tabular-nums; }
.hbar .amt.neg { color: var(--neg); }
.hb-track { height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.hb-track i { display: block; height: 100%; border-radius: 999px; transform-origin: left; animation: growX .9s cubic-bezier(.2,.8,.2,1) .15s both; }
.hb-sub { margin-top: 6px; font-size: 12px; color: var(--muted); }

/* ═════════ Motion ═════════ */
@keyframes drawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes reveal { from { clip-path: inset(-6px 100% -6px 0); } to { clip-path: inset(-6px -12px -6px 0); } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes donutIn { from { opacity: 0; transform: rotate(-40deg) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.dash > * { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; }
.dash > *:nth-child(2) { animation-delay: .06s; } .dash > *:nth-child(3) { animation-delay: .12s; } .dash > *:nth-child(4) { animation-delay: .18s; }
.dash > *:nth-child(5) { animation-delay: .24s; } .dash > *:nth-child(6) { animation-delay: .3s; }
.alloc i { transform-origin: left; animation: growX .9s cubic-bezier(.2,.8,.2,1) .15s both; }
.donut { animation: donutIn .9s cubic-bezier(.2,.8,.2,1) both; }
.card { transition: box-shadow .2s ease, transform .2s ease; }
tr.hoverable { transition: background .15s ease; }
.sb-item { transition: background .15s ease, color .15s ease; }
.btn, .icon-btn { transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease; }
/* skeleton loader shown until the first data arrives */
#appLoader { align-items: stretch; justify-content: flex-start; padding: 28px 40px 0 88px; }
.sk-wrap { max-width: 1180px; width: 100%; display: flex; flex-direction: column; gap: 22px; }
.sk { border-radius: 16px; background: linear-gradient(100deg, var(--paper-2) 30%, var(--surface) 50%, var(--paper-2) 70%); background-size: 300% 100%; animation: shimmer 1.6s linear infinite; }
.sk-title { height: 30px; width: 220px; border-radius: 10px; margin-top: 6px; }
.sk-hero { height: 190px; border-radius: 22px; }
.sk-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.sk-card { height: 150px; } .sk-tall { height: 220px; }
#appLoader .loader-text { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ═════════ Phone layout ═════════ */
@media (max-width: 720px) {
  #appLoader { padding: 20px 16px 0 78px; }
  .sk-row { grid-template-columns: 1fr; }
  /* tables become stacked rows: each cell shows its column title */
  .tbl-wrap, .table-responsive { overflow: visible; }
  table.rt { min-width: 0 !important; width: 100%; }
  .rt thead { display: none; }
  .rt, .rt tbody, .rt tr, .rt td { display: block; width: 100%; }
  .rt tr { padding: 14px 18px; border-bottom: 1px solid var(--line); }
  .rt tbody tr:last-child { border-bottom: 0; }
  .rt td { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 7px 0 !important; border: 0 !important; text-align: right; white-space: normal; }
  .rt td::before { content: attr(data-label); flex-shrink: 0; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; }
  .rt td[data-label=""]::before, .rt td:first-child::before { display: none; }
  .rt td[data-label=""] { justify-content: flex-end; }
  .rt td:first-child { justify-content: flex-start; text-align: left; font-weight: 700; color: var(--ink); padding-bottom: 10px !important; }
  .rt td.span-all { display: block; text-align: center; }
  .rt tr.foot { background: var(--paper); border-radius: 0 0 var(--r-card) var(--r-card); }
  .rt td input { max-width: 150px; }
  .rt .cv { display: block; min-width: 0; max-width: 100%; text-align: right; }
  .rt td:first-child .cv { text-align: left; }
  .rt .cv > div { flex-wrap: wrap; }
  .rt .cv .btn { margin: 0 !important; }
  .rt .cv:has(> .btn) { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .rt td { white-space: normal !important; }
  /* touch targets */
  .btn { min-height: 44px; padding: 10px 18px; }
  .btn-sm { min-height: 38px; }
  .icon-btn { width: 40px; height: 40px; }
  .sb-item { padding: 14px; }
  .fld input, .fld select, .flt input, .flt select { min-height: 44px; font-size: 16px; }
  /* modals become bottom sheets */
  .overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100% !important; max-width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding: 22px 18px 26px; animation: sheetUp .28s cubic-bezier(.2,.8,.2,1); }
  .modal-actions { position: sticky; bottom: -26px; background: var(--surface); padding: 12px 0 2px; }
  .modal-actions .btn { flex: 1; justify-content: center; }
  .page-actions, .expense-toolbar { width: 100%; }
  .donut { width: 150px; height: 150px; }
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.big-sum { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ── Brand logo ── */
.sb-logo { height: auto; align-items: center; justify-content: center; padding: 0 0 26px; min-height: 40px; }
.sb-mark { display: block; width: 40px; height: auto; }
.sb-wordmark { display: none; width: 132px; height: auto; }
.sidebar.expanded .sb-logo { justify-content: flex-start; padding-left: 8px; }
.sidebar.expanded .sb-mark { display: none; }
.sidebar.expanded .sb-wordmark { display: block; }
.loader-logo { position: fixed; left: 50%; bottom: 62px; transform: translateX(-50%); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.login-brand .brand-logo { display: block; width: 260px; max-width: 70%; height: auto; }

/* ── Needs attention ── */
.att-item { display: flex; align-items: center; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.att-item:last-child { border-bottom: 0; }
.att-ic { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.att-ic svg { width: 20px; height: 20px; }
.att-ic.warn { background: var(--warn-bg); color: var(--warn); }
.att-ic.neg { background: var(--neg-bg); color: var(--neg); }
.att-ic.accent, .att-ic.ok { background: var(--accent-bg); color: var(--accent-2); }
.att-ic.info { background: color-mix(in srgb, var(--c5) 14%, white); color: #0b6fa1; }
.att-body { flex: 1; min-width: 0; }
.att-title { font-weight: 700; color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.att-text { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.count-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.count-badge.ok { background: var(--pos-bg); color: var(--pos); }
@media (max-width: 640px) { .att-item { flex-wrap: wrap; padding: 16px 18px; } .att-item .btn { width: 100%; justify-content: center; } }

/* ── Empty states ── */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 44px 24px 40px; gap: 6px; }
.es-ic { width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-bg); color: var(--accent-2); margin-bottom: 8px; }
.es-ic svg { width: 24px; height: 24px; }
.es-title { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -0.02em; color: var(--ink); }
.es-text { color: var(--muted); font-size: 13.5px; max-width: 360px; line-height: 1.5; }
.empty-state .btn { margin-top: 14px; }
td.empty-cell { padding: 0 !important; }
#appLoader .loader-text a { color: var(--accent-2); font-weight: 600; }

/* ═════════ Accessibility + edge cases ═════════ */
.skip-link { z-index: 2000; background: var(--forest); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip-link:focus { position: fixed !important; left: 12px !important; top: 12px !important; width: auto !important; height: auto !important; overflow: visible !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sidebar :focus-visible { outline-color: var(--gold-hi); }
tr[data-action]:focus-visible { outline-offset: -2px; background: var(--paper); }
#screenRoot:focus { outline: none; }
::placeholder { color: var(--muted-2); opacity: 1; }
th { font-size: 11.5px; }
/* long names and large figures must not break the layout */
td, .card-head, .modal-title, .modal-sub, .att-title, .att-text, .hero-sub, .es-title, .es-text, .hb-sub, .legend-row .nm { overflow-wrap: anywhere; }
.hero-value { font-size: clamp(30px, 5.4vw, 50px); overflow-wrap: anywhere; }
.hero-kpi b { overflow-wrap: anywhere; text-align: right; }
.hero-kpi span { min-width: 0; }
.sb-user .nm, .sb-user .em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.topbar h1 { white-space: normal; overflow-wrap: anywhere; }
.titles { flex-wrap: wrap; row-gap: 2px; }
.topbar .sub { white-space: normal; }
.mono { overflow-wrap: anywhere; }
.pill { white-space: nowrap; }
@media (forced-colors: active) {
  .btn, .card, .pill { border: 1px solid CanvasText; }
  .hero { border: 1px solid CanvasText; }
}
/* selects and inputs never grow past their container, however long an option is */
.flt, .fld { min-width: 0; max-width: 100%; }
.flt select, .flt input, .fld select, .fld input { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
@media (max-width: 720px) { .flt { flex: 1 1 140px; } .flt select { width: 100%; min-width: 0; } }

/* ── Wadi icon set ── */
svg.wi { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: square; stroke-linejoin: miter; vertical-align: -4px; }
svg.wi .g { stroke: var(--gold); }
.sidebar svg.wi .g { stroke: var(--gold-hi); }
.btn-primary svg.wi .g { stroke: var(--gold-hi); }
.att-ic svg.wi .g, .es-ic svg.wi .g { stroke: var(--gold-lo, var(--gold)); }
.hero svg.wi .g { stroke: var(--gold-hi); }

/* ═════════ Investor statement (print / save as PDF) ═════════ */
#printRoot { display: none; }
.ps { font-family: 'Inter', system-ui, sans-serif; color: #0B1220; max-width: 780px; margin: 0 auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ps-head { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 14px; border-bottom: 3px solid #0E1A3D; }
.ps-head img { display: block; height: 62px; width: auto; }
.ps-meta { text-align: right; }
.ps-kicker { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8a6a2c; }
.ps-date { font-size: 13px; color: #334155; margin-top: 4px; }
.ps-inv { margin: 22px 0 16px; }
.ps-inv h1 { font-family: 'Manrope', 'Inter', sans-serif; font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 4px; font-weight: 800; }
.ps-inv p { margin: 0; color: #5B677A; font-size: 13px; }
.ps-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.ps-kpi { border: 1px solid #D9DDE8; border-radius: 10px; padding: 11px 14px; background: #F6F7FB; break-inside: avoid; }
.ps-kpi span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5B677A; }
.ps-kpi b { display: block; margin-top: 4px; font-family: 'Manrope', 'Inter', sans-serif; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ps h2 { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #0E1A3D; margin: 24px 0 8px; padding-bottom: 6px; border-bottom: 1px solid #D9DDE8; }
.ps-tbl { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.ps-tbl th { text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5B677A; padding: 7px 8px; background: transparent; border-bottom: 1px solid #AEB6C8; }
.ps-tbl td { padding: 7px 8px; border-bottom: 1px solid #E7EAF2; color: #1E293B; vertical-align: top; }
.ps-tbl tr { break-inside: avoid; }
.ps-tbl .r { text-align: right; white-space: nowrap; }
.ps-tbl .c { text-align: center; color: #5B677A; padding: 18px; }
.ps-foot { margin-top: 28px; padding-top: 10px; border-top: 1px solid #D9DDE8; font-size: 10.5px; color: #5B677A; line-height: 1.5; }
.ps-kpis.three { grid-template-columns: repeat(3, 1fr); }
/* what the printed page shows: only the statement */
@page { size: A4; margin: 14mm; }
@media print {
  body > *:not(#printRoot) { display: none !important; }
  html, body { background: #fff !important; }
  #printRoot { display: block !important; }
}
/* on-screen preview of the same layout (used for checking; not reachable from the UI) */
body.print-preview > *:not(#printRoot) { display: none !important; }
body.print-preview { background: #fff !important; }
body.print-preview #printRoot { display: block; padding: 24px; }

/* ═════════ Dark theme (toggle in the sidebar; remembered per browser) ═════════ */
.modal { background: var(--surface); }
.seg button.on { background: var(--surface); }
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8ecf8; --ink-2: #d3daee; --text-2: #b5bfd8; --muted: #8d99b5; --muted-2: #8490ae; --ink-rgb: 0, 0, 0;
  --canvas: #070b18; --surface: #0e1427; --paper: #0b1122; --paper-2: #151d36; --line: #1c2543; --line-2: #2a3560;
  --accent: #8b93ff; --accent-2: #a5abff; --accent-bg: #1a2150; --accent-line: #2d3a86; --accent-rgb: 139, 147, 255;
  --pos: #34d399; --pos-dot: #10b981; --pos-bg: #0f2e27; --pos-on-dark: #6ee7b7;
  --neg: #fb7185; --neg-dot: #f43f5e; --neg-bg: #34121e; --neg-line: #5a2233; --neg-2: #fda4af;
  --warn: #fbbf24; --warn-dot: #f59e0b; --warn-bg: #32260c; --warn-line: #5c4510;
  --c1: #818cf8;
  --shadow-card: 0 1px 0 rgba(255,255,255,.03), 0 12px 28px -16px rgba(0,0,0,.7);
}
html[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #0b1438 0%, #080e26 45%, #050a1a 100%); }
html[data-theme="dark"] #toast { background: #16204a; color: var(--ink); border: 1px solid var(--line-2); }
html[data-theme="dark"] .btn-primary { border-color: #3a4bc8; }
html[data-theme="dark"] .btn-outline:hover { background: var(--paper-2); }
html[data-theme="dark"] .btn-tint:hover { background: #232c6b; }
html[data-theme="dark"] .skip-link { background: var(--accent); color: #070b18; }
html[data-theme="dark"] .att-ic.info { background: #0f2a3f; color: #7dd3fc; }
html[data-theme="dark"] .count-badge { background: var(--warn-bg); }
html[data-theme="dark"] .sk { background: linear-gradient(100deg, var(--paper-2) 30%, var(--line) 50%, var(--paper-2) 70%); background-size: 300% 100%; }
html[data-theme="dark"] .login-panel .google-btn { color: var(--ink); }
html[data-theme="dark"] .donut circle:first-child { stroke: var(--paper-2); }
html[data-theme="dark"] .cdot { border-color: var(--surface); }

/* ── Hero chips + actions, page actions, report tables ── */
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.86); }
.chip.up { color: var(--pos-on-dark); background: rgba(16,185,129,.14); border-color: rgba(110,231,183,.3); }
.chip.down { color: #fda4af; background: rgba(244,63,94,.14); border-color: rgba(253,164,175,.3); }
.hero-actions { margin-top: 18px; }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: var(--r); padding: 8px 14px; cursor: pointer; transition: background .15s, border-color .15s; }
.btn-ghost:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.34); }
.btn-ghost svg.wi { width: 16px; height: 16px; }
.btn-ghost svg.wi .g { stroke: var(--gold-hi); }
.page-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ps-total td { font-weight: 700; border-top: 1px solid #AEB6C8; background: #F6F7FB; }
.ps + .ps { break-before: page; page-break-before: always; }
@media (max-width: 720px) { .page-actions { width: 100%; } .page-actions .btn { flex: 1 1 auto; justify-content: center; } }

/* ═════════ Flow components: result sheet, type cards, stepper ═════════ */
.sheet { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); overflow: hidden; }
.sheet-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 16px; font-size: 13.5px; color: var(--text-2); border-bottom: 1px solid var(--line); }
.sheet-row:last-of-type { border-bottom: 0; }
.sheet-row b { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.sheet-row .arr { color: var(--muted-2); margin: 0 3px; }
.sheet-row.good b { color: var(--pos); }
.sheet-row.bad b { color: var(--neg); }
.sheet-row.total { background: var(--surface); font-weight: 700; color: var(--ink); border-top: 1px solid var(--line-2); }
.sheet-row.total b { font-family: var(--display); font-size: 17px; letter-spacing: -0.01em; }
.sheet-note { padding: 9px 16px; font-size: 12px; color: var(--muted); background: var(--surface); border-top: 1px solid var(--line); }
.sheet.blocked { border-color: var(--neg-line); }
.sheet.blocked .sheet-note { background: var(--neg-bg); color: var(--neg); font-weight: 600; }
.sheet-quiet { font-size: 12.5px; color: var(--muted); padding: 10px 14px; background: var(--paper); border: 1px dashed var(--line-2); border-radius: 10px; }
.seg-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 12px 12px 11px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; color: var(--text-2); transition: border-color .15s, background .15s, box-shadow .15s; }
.seg-card:hover { border-color: var(--muted-2); }
.seg-card .ic { color: var(--muted); display: inline-flex; margin-bottom: 4px; }
.seg-card b { font-size: 13px; color: var(--ink); line-height: 1.25; }
.seg-card small { font-size: 11.5px; color: var(--muted); }
.seg-card.on { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .14); }
.seg-card.on .ic { color: var(--accent-2); }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.stepper li { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stepper li + li::before { content: ''; width: 28px; height: 1px; background: var(--line-2); margin-right: 8px; }
.stepper .n { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; background: var(--paper-2); color: var(--muted); border: 1px solid var(--line-2); }
.stepper .done .n { background: var(--pos-bg); color: var(--pos); border-color: transparent; }
.stepper .done { color: var(--text-2); }
.stepper .now { color: var(--ink); }
.stepper .now .n { background: var(--accent); color: #fff; border-color: transparent; }
@media (max-width: 520px) { .seg-cards { grid-template-columns: 1fr; } .seg-card { flex-direction: row; align-items: center; gap: 10px; } .seg-card .ic { margin: 0; } .seg-card small { margin-left: auto; } .stepper li .t { display: none; } .stepper li.now .t { display: inline; } }

/* ═════════ Component pass: sidebar tips, toast states, saving, calmer motion ═════════ */
#sbTip { position: fixed; z-index: 3000; transform: translateY(-50%); background: var(--ink); color: var(--surface); font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; box-shadow: 0 8px 20px -8px rgba(0,0,0,.5); }
#sbTip.show { opacity: 1; }
html[data-theme="dark"] #sbTip { background: #e8ecf8; color: #0b1220; }
#toast.err { background: #7f1d3a; }
#toast.err .dot { background: #fda4af; }
.modal.is-saving .btn-primary { position: relative; pointer-events: none; }
.modal.is-saving .btn-primary::before { content: ''; width: 14px; height: 14px; margin-right: 8px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; display: inline-block; }
.btn:disabled, button:disabled { cursor: not-allowed; }
#screenRoot:not([data-enter]) *, #screenRoot:not([data-enter]) *::before, #screenRoot:not([data-enter]) *::after { animation: none !important; }
.card { transition: box-shadow .2s ease, border-color .2s ease; }
a.card:hover, .card.clickable:hover { border-color: var(--line-2); box-shadow: 0 1px 2px rgba(var(--ink-rgb), .06), 0 16px 32px -16px rgba(var(--ink-rgb), .24); }
input, select, button, a { -webkit-tap-highlight-color: transparent; }

/* ═════════ Inner-page polish ═════════ */
/* Readable secondary text: lift the smallest inline sizes and deepen the grey */
[style*="font-size:11px"] { font-size: 12px !important; }
[style*="font-size:11.5px"] { font-size: 12.5px !important; }
[style*="font-size:12px"] { font-size: 13px !important; }
[style*="font-size:12.5px"] { font-size: 13px !important; }
.topbar .sub { font-size: 13.5px; }
td { font-size: 14px; }
.sb-item .ic svg, .sb-item svg.wi { width: 22px; height: 22px; }
.detail { display: flex; flex-direction: column; gap: 22px; animation: fadeIn 200ms ease-in; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.crumbs a { color: var(--accent-2); font-weight: 600; cursor: pointer; border-radius: 4px; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { color: var(--muted-2); }
.crumbs b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
/* entity header (project / investor): identity left, figures right, lead figure larger */
.ent { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 26px 28px; }
.ent-id { display: flex; gap: 18px; align-items: flex-start; min-width: 0; }
.ent-ic { width: 56px; height: 56px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: linear-gradient(135deg, var(--forest-hi), var(--forest)); color: var(--gold-hi); box-shadow: 0 10px 20px -12px rgba(var(--ink-rgb), .6); }
.ent-ic svg.wi { width: 26px; height: 26px; }
.ent-ic.person { background: var(--accent-bg); color: var(--accent-2); font-family: var(--display); font-weight: 800; font-size: 19px; box-shadow: none; }
.ent-text { min-width: 0; }
.ent-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ent-title h2 { margin: 0; font-family: var(--display); font-size: 26px; line-height: 32px; letter-spacing: -0.025em; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.ent-meta { margin-top: 4px; font-size: 14px; color: var(--muted); }
.ent-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ent-figs { display: flex; flex-wrap: wrap; gap: 0; justify-content: flex-end; }
.fig { padding: 2px 22px; border-left: 1px solid var(--line); min-width: 112px; display: flex; flex-direction: column; gap: 5px; }
.fig:first-child { border-left: 0; }
.fig span { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.fig b { font-family: var(--display); font-size: 18px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); overflow-wrap: anywhere; }
.fig.lead b { font-size: 26px; }
.fig b.g6 { color: var(--pos); } .fig b.r6 { color: var(--neg); } .fig b.a6 { color: var(--warn); }
@media (max-width: 1100px) { .ent { grid-template-columns: 1fr; } .ent-figs { justify-content: flex-start; } .fig:first-child { padding-left: 0; } }
@media (max-width: 640px) {
  .ent { padding: 20px 18px; gap: 18px; }
  .ent-ic { width: 46px; height: 46px; border-radius: 13px; }
  .ent-title h2 { font-size: 22px; line-height: 28px; }
  .ent-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; }
  .fig, .fig:first-child { border-left: 0; padding: 0; min-width: 0; }
  .fig.lead { grid-column: 1 / -1; }
}
/* quiet row actions: no outline until hovered */
.btn-quiet { background: transparent; border: 1px solid transparent; color: var(--muted); box-shadow: none; font-weight: 600; }
.btn-quiet:hover { background: var(--paper-2); color: var(--ink); }
.btn-quiet svg.wi { width: 15px; height: 15px; }
.btn-quiet svg.wi .g { stroke: currentColor; }
/* list-page toolbars */
.page-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-bar p { margin: 0; font-size: 14px; color: var(--muted); }
.toolbar-card { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; box-shadow: var(--shadow-card); }
.toolbar-card .flt { font-size: 12.5px; font-weight: 600; color: var(--text-2); min-width: 150px; }
.toolbar-card .flt select, .toolbar-card .flt input { height: 38px; font-size: 14px; }
.toolbar-card .btn-quiet { margin-bottom: 1px; }
@media (max-width: 720px) { .toolbar-card { gap: 10px; padding: 12px; } .toolbar-card .flt { min-width: 0; } }

/* entity header, second pass: identity on top, figures on their own row beneath a hairline */
.ent { display: flex; flex-direction: column; align-items: stretch; gap: 22px; }
.ent-actions .btn { white-space: nowrap; }
.ent-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); justify-content: stretch; gap: 0; border-top: 1px solid var(--line); padding-top: 20px; }
.fig, .fig:first-child { padding: 2px 20px; border-left: 1px solid var(--line); min-width: 0; }
.fig:first-child { border-left: 0; padding-left: 0; }
.fig.lead { grid-column: span 2; }
@media (max-width: 640px) {
  .ent-figs { grid-template-columns: 1fr 1fr; gap: 16px 10px; }
  .fig, .fig:first-child { border-left: 0; padding: 0; }
  .fig.lead { grid-column: 1 / -1; }
}

/* ledger rows: the Reverse/Return button must not make some rows taller than others */
table.rt tbody td { height: 62px; vertical-align: middle; }
table.rt .btn-quiet.btn-sm { min-height: 30px; padding-top: 4px; padding-bottom: 4px; }
table.rt td .pill { display: inline-block; line-height: 1.5; vertical-align: middle; }
table.rt.proj-tbl tbody td { vertical-align: top; }
@media (max-width: 720px) { table.rt tbody td { height: auto; } }

/* Investment Health tiles */
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.kpi-l { font-size: 11.5px !important; font-weight: 700 !important; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-v { font-size: 24px !important; font-weight: 700 !important; line-height: 1.15; letter-spacing: -.01em; white-space: nowrap; }
.kpi-s { font-size: 12.5px !important; line-height: 1.4 !important; color: var(--muted-2); overflow-wrap: anywhere; }

/* Investment Health: one joined strip (hairline dividers) instead of separate boxes */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--line); overflow: hidden; border-radius: 0 0 var(--radius, 16px) var(--radius, 16px); }
.kpi-strip .kpi { border: 0; border-radius: 0; background: var(--paper); padding: 20px 22px; }
@media (min-width: 1100px) { .kpi-strip { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; } }

/* chart range toggle */
.card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.range { display: inline-flex; gap: 2px; padding: 3px; background: var(--paper-2); border-radius: 999px; }
.range button { border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 12px; border-radius: 999px; cursor: pointer; min-height: 0; }
.range button:hover { color: var(--ink); }
.range button.on { background: var(--surface, #fff); color: var(--ink); box-shadow: 0 1px 2px rgba(var(--ink-rgb), .14); }

/* figures: lining digits so amounts stack neatly */
.mono, td, .amt, .fig b, .kpi-v, .sheet-row b { font-variant-numeric: tabular-nums lining-nums; }
table.rt td.amt, table.rt th.amt, table.rt td.num, table.rt th.num { text-align: right; }

/* phone cards: long notes stop at three lines, the amount reads first */
@media (max-width: 720px) {
  table.rt td .note-t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; text-align: right; }
  table.rt td.note-td { max-width: none !important; white-space: normal !important; }
  table.rt td[data-label="Amount"] { font-size: 16px; font-weight: 700; }
}

/* shared utility classes (replace repeated inline styles) */
.u-note { font-size:13px;color:var(--muted); }
.u-strong { font-size:13px;font-weight:600; }
.u-strong2 { font-size:13px;font-weight:600;color:var(--ink-2); }
.u-dim { color:var(--muted-2); }
.u-pad-a { padding:4px 16px 8px; }
.u-sub { font-size:13px;color:var(--muted-2); }
.u-box { border:1px solid var(--line);border-radius:8px;overflow:hidden; }
.u-body { font-size:13px;color:var(--ink-2); }
.u-row { display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 0;border-bottom:1px solid var(--paper-2); }
.u-bar { padding:12px 16px;background:var(--paper);border-bottom:1px solid var(--line); }
.u-note13 { font-size:13px;color:var(--muted); }
.u-sub2 { font-size:13px;color:var(--muted-2);margin-top:2px; }
.date-tags { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:5px; }
.date-tag { display:inline-flex; align-items:center; gap:4px; font-size:11.5px; font-weight:600; padding:3px 9px 3px 7px; border-radius:999px; white-space:nowrap; }
.date-tag svg.wi { flex-shrink:0; }
