:root, :root[data-theme="dark"] {
  --bg: #0a0c10; --surface: #12151c; --surface2: #181c26; --line: #232837; --ink: #eef0f6; --muted: #9aa2b4;
  --accent: #a99bff; --accent-ink: #15112e; --inc: #34d399; --exp: #fb7185; --net: #eef0f6;
  --warn: #fcd34d; --warn-bg: #2f2710;
  --c1: #a99bff; --c2: #34d399; --c3: #fbbf24; --c4: #fb7185; --c5: #60a5fa; --c6: #f472b6; --c7: #94a3b8;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset;
}
:root[data-theme="light"] {
  --bg: #f3f4f8; --surface: #ffffff; --surface2: #f0f1f6; --line: #e1e4ec; --ink: #12141b; --muted: #596175;
  --accent: #5b45e0; --accent-ink: #ffffff; --inc: #047857; --exp: #be123c; --net: #12141b;
  --warn: #92400e; --warn-bg: #fef3c7;
  --c1: #5b45e0; --c2: #059669; --c3: #b45309; --c4: #be123c; --c5: #2563eb; --c6: #be185d; --c7: #64748b;
  --shadow: 0 1px 2px rgba(20,24,40,.05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-feature-settings: "tnum";
}
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.inc-t { color: var(--inc); } .exp-t { color: var(--exp); }
.only-d { display: none; }

/* shell */
.app { min-height: 100dvh; }
.col { min-width: 0; }
.top { display: flex; align-items: center; gap: 10px; padding: 12px 16px 0; }
.mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.pill { margin-left: auto; font-size: 12px; color: var(--warn); background: var(--warn-bg); padding: 5px 10px; border-radius: 999px; }
#theme { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
#theme svg, nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#theme:focus-visible, nav a:focus-visible, .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main { padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; outline: none; }

.side { display: contents; }
.brand, .grp, .side-foot { display: none; }
nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 5; display: flex;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 22px; padding: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; color: var(--muted); text-decoration: none; font-size: 11px; border-radius: 16px; }
nav a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; }

/* typography */
.eyebrow { color: var(--muted); font-size: 13px; }
h1 { font-size: 30px; line-height: 1.1; letter-spacing: -.02em; margin: 2px 0 16px; font-weight: 650; }
h2 { font-size: 16px; margin: 0; font-weight: 600; }
.cap { color: var(--muted); font-size: 13px; margin-top: 2px; }
.big { font-size: 34px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card + .card, .stack > * + * { margin-top: 14px; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.grid > .card { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 24px; font-weight: 650; letter-spacing: -.01em; margin-top: 2px; }
.stat .s { font-size: 12.5px; margin-top: 2px; color: var(--muted); }

/* segmented control */
.seg { display: inline-flex; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex: none; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 5px 12px; border-radius: 9px; font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.tabs { margin-bottom: 16px; }

/* hero */
.hero { display: grid; gap: 16px; }
.hero-side { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.hero-side .l { color: var(--muted); font-size: 12px; }
.hero-side .v { font-size: 18px; font-weight: 650; margin-top: 2px; }
.hero-side .s { font-size: 12px; margin-top: 1px; }
.ch { width: 100%; min-height: 40px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .gl { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .gl0 { stroke: var(--line); stroke-width: 1; }
.chart .inc { fill: var(--inc); } .chart .exp { fill: var(--exp); opacity: .85; }
.chart .net { fill: none; stroke: var(--net); stroke-width: 2; stroke-linejoin: round; }
.chart .dot { fill: var(--surface); stroke: var(--net); stroke-width: 2; }
.chart .area-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

/* lists */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; padding-top: 0; }
.rows li:last-child { padding-bottom: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .sub { color: var(--muted); font-size: 12.5px; }
.amt { margin-left: auto; text-align: right; white-space: nowrap; font-weight: 550; }
.tile { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--tc); background: color-mix(in srgb, var(--tc) 16%, transparent); }
.date { flex: none; width: 40px; text-align: center; line-height: 1.1; background: var(--surface2); border-radius: 11px; padding: 5px 0; }
.date b { display: block; font-size: 16px; } .date span { font-size: 11px; color: var(--muted); }
.link { color: var(--accent); font-size: 13px; text-decoration: none; }

.bar { height: 8px; border-radius: 6px; background: var(--surface2); margin-top: 6px; overflow: hidden; position: relative; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.bar > u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); border-radius: 1px; opacity: .8; }

.donut-wrap { display: grid; gap: 16px; align-items: center; }
.donut { width: min(200px, 60vw); margin: 0 auto; }
.donut text { fill: var(--ink); text-anchor: middle; }
.donut .c-l { fill: var(--muted); font-size: 2.6px; } .donut .c-v { font-size: 4.2px; font-weight: 650; }
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.legend-list li { display: flex; align-items: center; gap: 10px; }
.legend-list i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-list .p { color: var(--muted); font-size: 12.5px; width: 34px; text-align: right; flex: none; }

.cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.acc { border-radius: 18px; padding: 14px; position: relative; overflow: hidden; background: linear-gradient(140deg, color-mix(in srgb, var(--tc) 38%, var(--surface2)), var(--surface2) 75%); border: 1px solid var(--line); min-height: 118px; display: flex; flex-direction: column; justify-content: space-between; }
.acc .n { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.acc .b { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.acc .b small { font-size: 13px; font-weight: 500; color: var(--muted); }
.acc .u { font-size: 12.5px; color: var(--muted); }

details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details > .rows { margin: 10px 0 0 48px; }
details .caret { color: var(--muted); transition: transform .15s; display: inline-block; }
details[open] .caret { transform: rotate(90deg); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 10px 6px; border-top: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; border-top: 0; }
th:first-child, td:first-child { text-align: left; }
.note { font-size: 12.5px; color: var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: 10px; margin-top: 12px; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 10px; }
.kv .l { color: var(--muted); font-size: 12px; } .kv .v { font-size: 17px; font-weight: 650; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 10px; }

/* desktop */
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 18px 12px; border-right: 1px solid var(--line); }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
  .brand-t { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
  .grp { display: block; margin: 14px 8px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .side-foot { display: block; margin: auto 8px 0; font-size: 12px; color: var(--muted); }
  nav { position: static; display: flex; flex-direction: column; background: none; border: 0; box-shadow: none; backdrop-filter: none; padding: 0; gap: 2px; }
  nav a { flex: none; flex-direction: row; gap: 12px; padding: 10px 12px; font-size: 14.5px; border-radius: 12px; }
  .only-m { display: none !important; } .only-d { display: flex; }
  .top { padding: 18px 32px 0; } .top .pill { margin-left: 0; } #theme { margin-left: auto; }
  main { padding: 18px 32px 40px; }
  h1 { font-size: 36px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr) 190px; gap: 24px; }
  .hero-side { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 22px; gap: 22px; align-content: start; }
  .hero-side .v { font-size: 24px; }
  .layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
  .two { grid-template-columns: 1fr 1fr; }
  .donut-wrap { grid-template-columns: 170px 1fr; }
  .donut { width: 170px; }
}
@media (min-width: 1200px) { .cards.acc3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) and (max-width: 899px) { .two { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: no-preference) { .bar > i { transition: width .25s ease; } }
