:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --card: #ffffff;
  --label: #000000;
  --secondary: rgba(60, 60, 67, 0.62);
  --tertiary: rgba(60, 60, 67, 0.36);
  --sep: rgba(60, 60, 67, 0.14);
  --track: rgba(120, 120, 128, 0.16);
  --field: rgba(118, 118, 128, 0.12);
  --tint: #007aff;
  --tint-soft: rgba(0, 122, 255, 0.12);
  --green: #248a3d;
  --red: #d70015;
  --orange: #c93400;
  --bar: rgba(242, 242, 247, 0.86);
  --segment: rgba(118, 118, 128, 0.16);
  --segment-on: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.06);
  --good: #34c759;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --card: #1c1c1e;
  --label: #ffffff;
  --secondary: rgba(235, 235, 245, 0.6);
  --tertiary: rgba(235, 235, 245, 0.34);
  --sep: rgba(255, 255, 255, 0.1);
  --track: rgba(255, 255, 255, 0.1);
  --field: rgba(118, 118, 128, 0.28);
  --tint: #0a84ff;
  --tint-soft: rgba(10, 132, 255, 0.22);
  --green: #30d158;
  --red: #ff453a;
  --orange: #ff9f0a;
  --bar: rgba(28, 28, 30, 0.82);
  --segment: rgba(118, 118, 128, 0.28);
  --segment-on: #636366;
  --shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.06);
  --good: #30d158;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; }
input.passphrase { -webkit-text-security: disc; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--tint);
  outline-offset: 2px;
}
.num { font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.02em; }

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.workspace { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen-host { position: relative; flex: 1; min-height: 0; }
.screen {
  position: absolute;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
.screen-inner { width: min(760px, 100%); margin: 0 auto; }
.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: calc(44px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
}
.inline-title {
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  opacity: 0;
  pointer-events: none;
}
.sticky-bar.is-compact .inline-title,
.child-screen .inline-title { opacity: 1; }
.large-title {
  margin: 2px 20px 4px;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.back, .icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  min-width: 44px;
  color: var(--tint);
  font-size: 17px;
  font-weight: 400;
}
.back span {
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon-btn { justify-content: center; justify-self: end; }
.icon-spacer { width: 44px; }
.content { display: flex; flex-direction: column; gap: 16px; padding: 8px 16px 28px; }
.kicker, .footnote, .tx-meta, .day-label, .section-note {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 500;
}
.footnote { margin: 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 8px 4px 0;
}
.section-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.linkish { color: var(--tint); font-size: 17px; font-weight: 400; min-height: 44px; }

.card, .group {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.card { padding: 16px; }
.hero { padding-bottom: 8px; }
.hero-hit {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 12px;
}
.hero-num { margin: 2px 0 0; font-size: 40px; font-weight: 700; letter-spacing: -0.035em; }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
}
.metrics button {
  text-align: left;
  min-height: 64px;
  padding: 10px 8px 12px 0;
  border-top: 0.5px solid var(--sep);
}
.metrics .k { display: block; color: var(--secondary); font-size: 13px; }
.metrics .v { display: block; margin-top: 2px; font-size: 17px; font-weight: 600; }
.month-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; }
.month-card > span { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.month-card .figure { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin: 2px 0; }
.ring-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }

.group { overflow: hidden; }
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 16px;
  text-align: left;
  position: relative;
}
.row + .row::before, .goal-block + .goal-block::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 0;
  top: 0;
  height: 0.5px;
  background: var(--sep);
}
.row:active { background: color-mix(in srgb, var(--label) 5%, transparent); }
.grow { flex: 1; min-width: 0; }
.row-title, .tx-merchant { display: block; font-size: 16px; font-weight: 500; }
.row-sub, .tx-meta {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chevron { color: var(--tertiary); flex: none; }
.cat-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.tx-copy { flex: 1; min-width: 0; }
.tx-merchant, .row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-amt, .row > .num { font-weight: 600; font-size: 16px; flex: none; white-space: nowrap; }
.kind-income { color: var(--green); }
.kind-transfer { color: var(--secondary); font-weight: 500; }
.day-label {
  position: sticky;
  top: calc(44px + env(safe-area-inset-top));
  z-index: 2;
  margin: 0 0 6px;
  padding: 8px 4px 4px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--label);
}
.day-group { margin-bottom: 8px; }
.card.order-card { padding: 0; overflow: hidden; }
.card .figure { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin: 2px 0; }
.split-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.split-metrics b { display: block; font-size: 22px; letter-spacing: -0.02em; }
.card.muted, .muted-group { color: var(--secondary); }
.item-returned { color: var(--tertiary); text-decoration: line-through; }
.order-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px 2px;
}
.order-items {
  list-style: none;
  margin: 0;
  padding: 0 16px 10px 44px;
}
.order-items li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
}
.order-items li + li { border-top: 0.5px solid var(--sep); }
.item-name { display: block; font-size: 15px; font-weight: 500; }
.sheet-items { padding: 0 0 8px; }
.order-card + .order-card { margin-top: 10px; }

.months {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 0 12px 2px;
}
.months::-webkit-scrollbar { display: none; }
.months button {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 44px;
  padding: 0 10px;
  color: var(--tertiary);
  font-weight: 600;
  font-size: 16px;
  scroll-snap-align: center;
}
.months button[aria-pressed="true"] { color: var(--label); font-size: 17px; }

.donut-wrap { position: relative; display: grid; place-items: center; margin: 4px 0 8px; }
.donut { width: min(232px, 70vw); height: auto; }
.donut-seg { cursor: pointer; }
.donut-center {
  position: absolute;
  width: 118px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.donut-center strong { font-size: 22px; letter-spacing: -0.03em; }
.track { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; margin-top: 8px; }
.fill { height: 100%; border-radius: 99px; }
.cat-top { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; }
.cat-top .grow { padding-top: 1px; }
.delta { font-size: 13px; font-weight: 600; }
.delta-up { color: var(--orange); }
.delta-down { color: var(--green); }
.delta-flat { color: var(--secondary); font-weight: 500; }
.trend, .spark, .ring { width: 100%; height: auto; display: block; }
.spark { width: 72px; height: 28px; flex: none; }
.chart-label { fill: var(--tertiary); font-size: 11px; font-family: var(--font); }
.chart-label.is-active { fill: var(--label); font-weight: 600; }

.insight {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  align-items: flex-start;
}
.tone {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--tint);
  flex: none;
}
.tone-attention { background: var(--orange); }
.tone-positive { background: var(--good); }
.tone-info { background: var(--tint); }
.insight h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.02em; }
.insight p { margin: 0; color: var(--secondary); font-size: 15px; line-height: 1.35; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { min-height: 64px; }
.stat b { display: block; margin-top: 4px; font-size: 20px; letter-spacing: -0.03em; }
.callout { background: var(--tint-soft); border-radius: 14px; padding: 12px 14px; }
.callout p { margin: 0; }
.notes { margin: 0; padding-left: 18px; color: var(--secondary); font-size: 13px; }
.notes li + li { margin-top: 4px; }

.segment {
  display: flex;
  padding: 2px;
  background: var(--segment);
  border-radius: 9px;
}
.segment button {
  flex: 1;
  min-height: 32px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--label);
}
.segment button[aria-pressed="true"] {
  background: var(--segment-on);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.goal-block { position: relative; padding: 14px 16px 16px; }
.goal-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.goal-row b { font-size: 17px; }
.ring-card { display: grid; grid-template-columns: 148px 1fr; gap: 8px; align-items: center; width: 100%; text-align: left; }
.ring { width: 148px; }
.ring-copy .figure { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.searchline { display: flex; gap: 8px; align-items: center; }
.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  background: var(--field);
  border-radius: 10px;
  color: var(--secondary);
}
.search input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 17px;
  min-height: 36px;
  color: var(--label);
}
.filter-btn, .text-btn {
  min-height: 44px;
  color: var(--tint);
  font-weight: 500;
  padding: 0 4px;
}
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--tint);
  color: white;
  font-size: 12px;
  font-weight: 600;
}
.empty {
  text-align: center;
  padding: 28px 12px 12px;
}
.empty h2 { margin: 8px 0; font-size: 22px; letter-spacing: -0.02em; }
.empty p { margin: 0 auto; max-width: 320px; color: var(--secondary); }
.gain-pos { color: var(--green); }
.gain-neg { color: var(--red); }
.stack { display: flex; flex-direction: column; gap: 6px; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: space-around;
  height: calc(49px + env(safe-area-inset-bottom));
  padding: 2px 2px env(safe-area-inset-bottom);
  background: var(--bar);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--sep);
}
.tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 44px;
  color: var(--tertiary);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
}
.tabbar button span { white-space: nowrap; }
.tabbar button[aria-current="page"], .nav-item[aria-current="page"] { color: var(--tint); }
.tabbar .icon, .nav-item .icon { width: 24px; height: 24px; }
.sidebar { display: none; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.36);
  animation: fade 0.28s ease;
}
.sheet {
  position: fixed;
  z-index: 41;
  left: 0; right: 0; bottom: 0;
  max-height: min(92dvh, 840px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
  animation: rise 0.46s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet-scroll { overflow: auto; padding: 0 16px 24px; }
.grabber {
  width: 36px; height: 5px; border-radius: 3px;
  background: var(--tertiary);
  margin: 8px auto 4px;
}
.sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 8px 0 16px;
}
.sheet-bar h2 { margin: 0; font-size: 17px; }
.sheet-amount { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field span { font-size: 13px; color: var(--secondary); font-weight: 600; }
.field select, .lock-card input {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--card);
  color: var(--label);
  padding: 0 12px;
  box-shadow: var(--shadow);
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
}
.switch {
  width: 51px; height: 31px; border-radius: 16px;
  background: #e9e9eb; position: relative; flex: none;
  transition: background 0.2s ease;
}
:root[data-theme="dark"] .switch { background: #39393d; }
.switch[aria-checked="true"] { background: var(--good); }
.switch i {
  position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}
.switch[aria-checked="true"] i { transform: translateX(20px); }
.destructive { color: var(--red); font-weight: 500; min-height: 44px; }

.lock {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}
.lock-card { width: min(420px, 100%); }
.lock-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 22px; }
.lock-brand img { width: 64px; height: 64px; border-radius: 16px; }
.lock-brand h1 { margin: 0; font-size: 40px; letter-spacing: -0.035em; }
.lock-brand p, .demo-hint, .status-line { color: var(--secondary); margin: 0; }
.lock-card form, .lock-panel { display: flex; flex-direction: column; gap: 12px; }
.lock-card input { font-size: 17px; }
.primary {
  min-height: 50px;
  border-radius: 14px;
  background: var(--tint);
  color: white;
  font-weight: 600;
  font-size: 17px;
}
.primary:disabled { opacity: 0.55; }
.lock-error {
  margin: 0;
  color: var(--red);
  font-size: 15px;
}
.demo-hint { font-size: 13px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--sep);
  border-top-color: var(--tint);
  animation: spin 0.8s linear infinite;
}
.center-status { display: grid; justify-items: center; gap: 12px; padding: 24px 0; }

.anim-push { animation: push 0.42s cubic-bezier(0.32, 0.72, 0, 1); }
.anim-pop { animation: pop 0.36s cubic-bezier(0.32, 0.72, 0, 1); }
.anim-fade { animation: fade 0.22s ease; }

@keyframes push { from { transform: translateX(18%); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: translateX(-12%); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(110%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 880px) {
  .app { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .workspace { height: 100dvh; }
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 22px 12px;
    border-right: 0.5px solid var(--sep);
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 6px 12px 18px; }
  .brand img { width: 36px; height: 36px; border-radius: 9px; }
  .brand strong { font-size: 22px; letter-spacing: -0.03em; }
  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 500;
    text-align: left;
  }
  .nav-item[aria-current="page"] { background: var(--tint-soft); font-weight: 600; }
  .tabbar { display: none; }
  .screen { padding-bottom: 32px; }
  .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 8dvh;
    width: min(480px, calc(100vw - 48px));
    transform: translateX(-50%);
    border-radius: 16px;
    max-height: 82dvh;
    animation: fade 0.22s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  .anim-push, .anim-pop, .anim-fade, .sheet, .sheet-backdrop { animation: none; }
  .switch, .switch i { transition: none; }
}

svg.icon { width: 24px; height: 24px; flex: none; display: block; }
svg.chevron { width: 8px; height: 13px; flex: none; display: block; }
svg.back-icon { width: 13px; height: 17px; flex: none; display: block; }
.search svg.icon { width: 16px; height: 16px; }
.bar-tools { display: flex; justify-content: flex-end; align-items: center; }
.bar-tools .icon-btn { min-width: 36px; }

.balance-banner { display: flex; flex-direction: column; gap: 8px; }
.net-hit { display: flex; flex-direction: column; align-items: flex-start; text-align: left; width: 100%; padding: 2px 2px 0; }
.net-hit .hero-num { font-size: 34px; }
.balance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.balance-tile { min-width: 0; min-height: 96px; gap: 1px; }
.balance-split { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 1.3; color: var(--secondary); }
.month-switch { display: flex; align-items: center; justify-content: space-between; min-height: 36px; }
.month-switch-label { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.flip-chevron { display: inline-flex; transform: rotate(180deg); }
.month-switch .icon-btn { min-width: 36px; min-height: 36px; }
.month-switch .icon-btn:disabled { opacity: 0.28; }
.split-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.split-figure { display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-width: 0; }
.split-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--track); margin: 8px 0; }
.split-bar span { display: block; height: 100%; min-width: 0; }
.stack-months { width: 100%; height: auto; display: block; }
.stack-months .chart-label { font-size: 10px; }
.stack-legend { margin-top: 6px; }
.typical-swatch { width: 10px; height: 0; border-top: 2px dashed var(--tertiary); align-self: center; }
.summary-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; }
.summary-card .section-head { width: 100%; }
.lock-actions { display: flex; flex-direction: column; gap: 8px; }
.dash .large-title { font-size: 28px; margin-bottom: 0; }
.dash .content { gap: 10px; padding-top: 0; }
.dash .section-head { margin: 0 2px; }
.dash .section-head h2, .section-head.tight h2 { font-size: 17px; }
.section-head.tight { margin: 0 2px; }
.section-head.tight .linkish { min-height: 32px; font-size: 15px; }

.kpi-row, .tile-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile-row { grid-template-columns: 1fr 1fr; }
.kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  text-align: left;
}
.kpi-value { font-size: 17px; font-weight: 700; letter-spacing: -0.03em; }
.compare-card { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; gap: 2px; padding-bottom: 8px; }
.compare-figure { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.bar-compare { width: 100%; height: auto; display: block; }

.pair { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 8px; align-items: center; }
.donut-wrap.compact { margin: 0; }
.compact .donut { width: 120px; height: auto; }
.compact .donut-center { width: 64px; min-height: 36px; }
.compact .donut-center strong { font-size: 13px; }
.legend { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-height: 168px; overflow: auto; }
.legend-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto auto;
  gap: 6px;
  align-items: center;
  width: 100%;
  min-height: 28px;
  text-align: left;
  font-size: 12px;
}
.legend-plain .legend-row { grid-template-columns: 10px minmax(0, 1fr) auto auto; }
.legend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-pct { color: var(--secondary); }

.goal-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.goal-strip::-webkit-scrollbar { display: none; }
.goal-mini {
  flex: none;
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 10px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.goal-mini .ring { width: 52px; height: 52px; }
.goal-mini-name {
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
}
.goal-mini-pct { font-size: 12px; color: var(--secondary); }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 1px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--field);
  color: var(--label);
  font-size: 13px;
  font-weight: 600;
}
.chip[aria-pressed="true"] { background: var(--tint); color: #fff; }
.activity-filters { display: flex; flex-direction: column; gap: 6px; }
.result-line { margin: 0 4px; font-size: 13px; font-weight: 600; color: var(--secondary); }

.table-wrap { overflow-x: auto; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
table.grid { width: 100%; border-collapse: collapse; font-size: 12px; }
table.grid th, table.grid td {
  height: 44px;
  padding: 0 3px;
  white-space: nowrap;
  text-align: left;
  border-bottom: 0.5px solid var(--sep);
}
table.grid th:first-child, table.grid td:first-child { padding-left: 12px; }
table.grid th:last-child, table.grid td:last-child { padding-right: 12px; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid th { height: 36px; color: var(--secondary); font-size: 11px; font-weight: 600; }
table.grid th.num, table.grid td.num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:active { background: color-mix(in srgb, var(--label) 6%, transparent); }
.th-btn { color: inherit; font: inherit; font-weight: 600; min-height: 32px; padding: 0; }
.name-cell { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 132px; }
.name-cell span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.deferral { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.deferral .ring { width: 64px; height: 64px; }
.insight-detail h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.02em; }
.insight-detail p { margin: 0; color: var(--secondary); font-size: 14px; line-height: 1.35; }
.insight-top { display: flex; gap: 12px; align-items: flex-start; }
.insight-impact { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.insight-impact b { font-size: 18px; letter-spacing: -0.02em; }
.evidence { margin-top: 8px; }
.evidence .spark { width: 100%; height: 36px; }
.horizon { width: 100%; height: auto; display: block; }
.plan-card, .plan-link { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; }
.plan-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.plan-headline { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.plan-preview { display: flex; gap: 8px; }
.plan-pill { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.plan-pill-label { display: flex; align-items: center; gap: 4px; color: var(--secondary); font-size: 11px; font-weight: 600; white-space: nowrap; }
.plan-pill b { font-size: 15px; }
i.status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status-good { background: var(--good); }
.status-watch { background: var(--orange); }
.status-act { background: var(--red); }
.key-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.key-grid .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
.takeaways { padding-bottom: 8px; }
.takeaway-list { display: flex; flex-direction: column; }
.takeaway-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 8px 0;
  text-align: left;
  border-top: 0.5px solid var(--sep);
}
.takeaway-row .grow { display: flex; flex-direction: column; gap: 1px; }
.takeaway-row .row-title,
.takeaway-row .row-sub {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.takeaway-row .row-title { font-weight: 650; }
.takeaway-row .row-sub { color: var(--secondary); font-size: 13px; line-height: 1.3; }
.area-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
}
.area-icon { width: 16px; height: 16px; }
.area-spend { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
.area-invest { background: var(--tint-soft); color: var(--tint); }
.area-tax { background: color-mix(in srgb, #af52de 18%, transparent); color: #af52de; }
.area-cash { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.impact-pill {
  flex: none;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--field);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.brief-top { display: flex; align-items: center; gap: 8px; }
.brief-top strong { flex: 1; min-width: 0; font-size: 17px; letter-spacing: -0.02em; }
.step.brief { display: block; }
.fold { margin-top: 8px; }
.fold summary { color: var(--tint); font-weight: 600; font-size: 15px; cursor: pointer; }
.fold p { margin: 8px 0 0; color: var(--secondary); font-size: 15px; line-height: 1.35; }
.stack[id] { scroll-margin-top: 72px; }
.finding h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.02em; }
.finding p { margin: 6px 0 0; color: var(--secondary); font-size: 14px; line-height: 1.35; }
.finding-top { display: flex; gap: 8px; align-items: flex-start; }
.finding-top > .status { margin-top: 6px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; gap: 10px; align-items: flex-start; }
.step-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tint-soft);
  color: var(--tint);
  font-weight: 700;
  flex: none;
}
.plan-filter { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; font-size: 13px; font-weight: 600; }
.horizon-legend { max-height: none; }
.order-items li > span:first-child { min-width: 0; flex: 1; }
.item-name, .order-items .row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 380px) {
  .kpi-value { font-size: 17px; }
  .pair { grid-template-columns: 108px minmax(0, 1fr); }
  .compact .donut { width: 104px; }
}
