    :root {
color-scheme: light dark;

/* Core palette */
--text: #1d1d1f;
--muted: #6e6e73;
--subtle: #8e8e93;

--purple: #7c3aed;
--purple-soft: #ede9fe;
--purple-muted: #a78bfa;
--purple-deep: #5b21b6;

/* Lines */
--line: rgba(17, 17, 17, 0.08);
--line-strong: rgba(17, 17, 17, 0.12);
--line-purple: color-mix(in srgb, var(--purple) 24%, var(--line));

/* Surfaces */
--surface: #ffffff;
--surface-muted: #f5f5f7;
--surface-soft: #fafafc;
--surface-elevated: #ffffff;
--page-bg: #ffffff;

/* Status colors */
--green: #34c759;
--red: #ff3b30;
--orange: #ff9500;

/* Neutrals */
--black: #1d1d1f;
--grey-chip: #e5e5ea;

/* Layout */
--max: 1280px;
--radius-md: 14px;
--radius-lg: 18px;
--radius-xl: 24px;

/* Shadows */
--shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
--shadow-purple: 0 18px 46px rgba(124, 58, 237, 0.16);

/* Charts */
--chart-grid: rgba(17, 17, 17, 0.045);
--chart-zero: #1d1d1f;
--chart-tick: #8e8e93;
--chart-legend: #6e6e73;
--chart-tooltip-bg: #1d1d1f;
--chart-tooltip-text: #ffffff;
--chart-accent: var(--purple);
    }

    @media (prefers-color-scheme: dark) {
  :root {
    --text: #f5f5f7;
    --muted: #a1a1aa;
    --subtle: #71717a;

    --purple: #a78bfa;
    --purple-soft: rgba(167, 139, 250, 0.16);
    --purple-muted: #8b5cf6;
    --purple-deep: #c4b5fd;

    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --line-purple: color-mix(in srgb, var(--purple) 30%, var(--line));

    --surface: #0f0f12;
    --surface-muted: #18181b;
    --surface-soft: #121216;
    --surface-elevated: #1c1c21;
  --page-bg: #ffffff;

    --black: #f5f5f7;
    --grey-chip: #27272a;

    --shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
    --shadow-purple: 0 20px 52px rgba(124, 58, 237, 0.24);

    --chart-grid: rgba(255, 255, 255, 0.075);
    --chart-zero: #f5f5f7;
    --chart-tick: #a1a1aa;
    --chart-legend: #a1a1aa;
    --chart-tooltip-bg: #f5f5f7;
    --chart-tooltip-text: #111113;
    --chart-accent: var(--purple);
  }
}

    /* =========================
   GOOD (green)
========================= */

.range-chip.good,
.icon-btn.good {
  color: #2e7d32;
}
.negative-balance {
  background-color: color-mix(in srgb, var(--orange) 10%, transparent);
  border-left: 5px solid var(--orange);
}

.range-chip.good {
  border-color: #2e7d32;
  background-color: rgba(46, 125, 50, 0.1);
}

.icon-btn.good:hover {
  background-color: rgba(46, 125, 50, 0.1);
}

.range-chip.good svg,
.icon-btn.good svg {
  stroke: #2e7d32;
}

.icon-dir {
  border: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  cursor: pointer !important;

  width: 36px !important;
  height: 36px !important;

  background-color: rgba(0, 0, 0, 0.01) !important;

  transition: background-color 0.2s ease !important;
}

.icon-dir svg {
  width: 24px !important;
  height: 24px !important;

  stroke: var(--text-muted, #8e8e93) !important;
  stroke-width: 2 !important;

  transition: stroke 0.2s ease, opacity 0.2s ease !important;
}

.icon-dir:hover {
  background-color: rgba(0, 0, 0, 0.06) !important;
}

.icon-dir:hover svg {
  stroke: var(--text, #1d1d1f) !important;
}

.icon-dir:active {
  background-color: rgba(0, 0, 0, 0.1) !important;
}

.icon-dir:active svg {
  opacity: 0.7 !important;
}
/* =========================
   WARN (orange)
========================= */

.cf-next-payment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;

  border: 2px dotted color-mix(
    in srgb,
    var(--orange) 75%,
    transparent
  );

  color: color-mix(
    in srgb,
    var(--orange) 72%,
    var(--text)
  );

  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.cf-next-payment-pill svg,
.cf-next-payment-pill .lucide {
  width: 13px;
  height: 13px;
  color: var(--orange);
}

.cf-next-payment-pill strong {
color: var(--orange);
  font-size: 11px;
  letter-spacing: 0.01em;
  font-weight: 800;
  text-transform: uppercase;
}

.cf-next-date {
  font-size: 12px;
  font-weight: 600;
  color: color-mix(
    in srgb,
    var(--orange) 65%,
    var(--text)
  );
}

.range-chip.warn,
.icon-btn.warn {
  color: var(--orange);
  border: 1px solid rgba(255, 149, 0, 0.4);
  animation: warnPulse 1.4s ease-in-out infinite;
}
.range-chip.warn {
  border-color: #ef6c00;
  background-color: rgba(239, 108, 0, 0.1);
}

.icon-btn.warn:hover {
  background-color: rgba(239, 108, 0, 0.1);
}

.range-chip.warn svg,
.icon-btn.warn svg {
  stroke: #ef6c00;
}

/* =========================
   RISK (red)
========================= */

.range-chip.risk,
.icon-btn.risk {
  color: #c62828;
}

.range-chip.risk {
  border-color: #c62828;
  background-color: rgba(198, 40, 40, 0.1);
}

.icon-btn.risk:hover {
  background-color: rgba(198, 40, 40, 0.1);
}

.range-chip.risk svg,
.icon-btn.risk svg {
  stroke: #c62828;
}

    @media (prefers-color-scheme: dark) {
      :root {
        --text: #f5f5f7;
        --muted: #a1a1a8;
        --line: rgba(255, 255, 255, 0.10);
        --line-strong: rgba(255, 255, 255, 0.16);
        --surface: #111214;
        --surface-muted: #1a1b1f;
        --surface-soft: #17181c;
        --surface-elevated: #1c1d22;
        --page-bg: #0b0c0f;
        --grey-chip: #2a2b31;
        --black: #f5f5f7;
        --shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
        --chart-grid: rgba(255,255,255,0.08);
        --chart-zero: rgba(255,255,255,0.85);
        --chart-tick: #a1a1a8;
        --chart-legend: #c7c7cc;
        --chart-tooltip-bg: #1f2024;
        --chart-tooltip-text: #f5f5f7;
      }
    }

    * { box-sizing: border-box; }
    html, body {
      margin: 0;
      min-height: 100%;
      background: var(--page-bg);
      color: var(--text);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
    }
    body { padding: 24px; }
    .lock-screen {
      min-height: calc(100vh - 48px);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }
    .lock-screen.visible {
      display: flex;
    }
    .lock-card {
      width: min(460px, 100%);
      border-radius: 28px;
      border: 1px solid var(--line);
      background: var(--surface);
      box-shadow: var(--shadow);
      padding: 28px;
      display: grid;
      gap: 18px;
      text-align: center;
      position: relative;
      overflow: hidden;
    }
    .lock-card::before {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      padding: 2px;
      background: conic-gradient(from 0deg, transparent 0 72%, rgba(255,149,0,0.08) 78%, var(--orange) 86%, #ffd08a 91%, transparent 100%);
      -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      opacity: 0;
      pointer-events: none;
    }
    .lock-card.auth-loading::before {
      opacity: 1;
      animation: authSnakeSpin 1.05s linear infinite;
    }
    .lock-card.auth-loading .lock-card-icon {
      color: var(--orange);
      border-color: color-mix(in srgb, var(--orange) 34%, var(--line));
      background: color-mix(in srgb, var(--orange) 10%, var(--surface-soft));
    }
    @keyframes authSnakeSpin {
      to { transform: rotate(360deg); }
    }
    .lock-card-icon {
      width: 56px;
      height: 56px;
      border-radius: 18px;
      display: grid;
      place-items: center;
      margin: 0 auto;
      color: var(--text);
      background: var(--surface-soft);
      border: 1px solid var(--line);
    }
    .lock-card-title {
      font-size: 28px;
      font-weight: 800;
      letter-spacing: -0.05em;
      line-height: 1;
    }
    .lock-card-copy {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
    }
    .lock-card-status {
      min-height: 18px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
    }
    .lock-card-status.error {
      color: var(--red);
    }
    .auth-pending .app,
    .auth-pending .sticky-status-wrap {
      display: none;
    }
    button, input, select, textarea { font: inherit; }

    .app { max-width: var(--max); margin: 0 auto; }
    .top {
  
      top: 12px;
      z-index: 20;
      margin-bottom: 18px;
      padding: 14px 16px;
    

  
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }
    .topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
    .title-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
    .app-brand-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
    .app-logo {
      width: 50px;
      height: 50px;
      border-radius: 15px;
      display: grid;
      place-items: center;
      color: #ffffff;
background: linear-gradient(135deg, #9333ea, #ec4899);
      flex: 0 0 auto;
    }
    .app-logo .lucide { width: 25px; height: 25px; }
    .floating-menu {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px;
      border-radius: 50px;
      box-shadow: 0 8px 22px rgba(0,0,0,0.035);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      flex-wrap: nowrap;
    }
    .menu-btn {
      border: none;
      background: transparent;
      color: var(--muted);
      min-width: 42px;
      height: 42px;
      padding: 0 12px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      cursor: pointer;
      transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
      font-size: 12px;
      font-weight: 750;
      white-space: nowrap;
    }
    .menu-btn:hover { transform: translateY(-1px); background: var(--surface-soft); color: var(--text); }
.menu-btn.primary {
  color: #fff;
  background-color: #0a84ff; /* iOS system blue */
  border-radius: 999px;
  padding: 10px 15px;
  font-weight: 500;
  border: none;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

/* hover (desktop approximation of iOS highlight) */
.menu-btn.primary:hover {
  background-color: #369cff;
}

/* active / pressed (this is the key iOS feel) */
.menu-btn.primary:active {
  background-color: #0060df;
  transform: scale(0.97);
}
    .menu-divider { width: 1px; height: 24px; background: var(--line); margin: 0 2px; }
    .menu-label { display: inline; }
    .kicker { font-size: 12px; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
    h1, h2, h3, p { margin: 0; }
    h1 { font-size: 40px; line-height: 1.02; letter-spacing: -0.05em; font-weight: 900; }
    .subtitle {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.4;
      max-width: 700px;
    }
    .statement-box {
      display: inline-block;
      margin-top: 6px;
      padding: 10px 12px;
      border-radius: 12px;
      background: var(--surface-soft);
      border: 1px solid var(--line);
      color: var(--text);
      font-size: 12px;
      line-height: 1.4;
    }
    .statement-info-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .statement-info-card {
      padding: 12px;
      border-radius: 14px;
      background: var(--surface-soft);
      border: 1px solid var(--line);
      display: grid;
      gap: 6px;
    }
    .statement-info-label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: var(--muted);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .statement-info-label i {
      width: 12px;
      height: 12px;
      stroke-width: 2;
    }
    .statement-info-value {
      font-size: 15px;
      font-weight: 650;
      letter-spacing: -0.02em;
      line-height: 1.15;
    }
    .statement-info-copy {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
    }
    .statement-box strong {
      display: block;
      font-size: 12px;
      margin-bottom: 4px;
      letter-spacing: -0.01em;
    }
    .header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
    .notes-chip {
      min-height: 26px;
      padding: 0 10px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      color: var(--muted);
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
    }
    .notes-chip.has-note {
      color: #1E6EF4;
      border-color: color-mix(in srgb, #1E6EF4 28%, var(--line));
      background: color-mix(in srgb, #1E6EF4 8%, var(--surface-elevated));
    }
    .notes-summary-card {
      padding: 14px;
      border-radius: 16px;
      border: 1px solid var(--line);
      background: var(--surface-soft);
      display: grid;
      gap: 8px;
    }
    .notes-summary-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }
    .notes-summary-label {
      color: var(--muted);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .notes-summary-copy {
      font-size: 13px;
      line-height: 1.45;
      color: var(--text);
      white-space: pre-wrap;
      word-break: break-word;
    }
    .notes-summary-empty {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
    }
    .sync-actions { display: inline-flex; align-items: center; gap: 8px; }
    .sticky-status-wrap {
      position: fixed;
      left: 50%;
      bottom: 18px;
      transform: translateX(-50%);
      z-index: 30;
      pointer-events: none;
    }
    .mini-status {
  min-width: 180px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 0 14px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    var(--surface-soft);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.08),
    0 10px 28px rgba(0,0,0,0.14),
    inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  pointer-events: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease,
    color 0.25s ease,
    opacity 0.2s ease;
}

.mini-status:hover {
  transform: none;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.08),
    0 10px 28px rgba(0,0,0,0.14),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.mini-status::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  opacity: 0.95;
}

.mini-status.good {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  background:
    linear-gradient(180deg, rgba(34,197,94,0.18), rgba(34,197,94,0.06)),
    var(--surface-soft);
  box-shadow:
    0 0 0 1px rgba(34,197,94,0.08),
    0 10px 28px rgba(34,197,94,0.14),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.mini-status.bad {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 28%, var(--line));
  background:
    linear-gradient(180deg, rgba(239,68,68,0.16), rgba(239,68,68,0.05)),
    var(--surface-soft);
  box-shadow:
    0 0 0 1px rgba(239,68,68,0.07),
    0 10px 28px rgba(239,68,68,0.14),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.mini-status.warning {
  color: var(--amber, #f59e0b);
  border-color: color-mix(in srgb, var(--amber, #f59e0b) 28%, var(--line));
  background:
    linear-gradient(180deg, rgba(245,158,11,0.18), rgba(245,158,11,0.05)),
    var(--surface-soft);
  box-shadow:
    0 0 0 1px rgba(245,158,11,0.07),
    0 10px 28px rgba(245,158,11,0.14),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.ghost.loading,
.primary.loading {
  pointer-events: none;
  opacity: 0.78;
  position: relative;
  filter: saturate(0.9);
}

.ghost.loading::after,
.primary.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(255,255,255,0.16) 45%,
    transparent 70%
  );
  transform: translateX(-100%);
  animation: buttonShimmer 1.1s linear infinite;
}

@keyframes buttonShimmer {
  to {
    transform: translateX(100%);
  }
}
    .health-section {
      background: transparent;
      border: none;
      border-radius: 0;
      padding: 0;
    }

/* Section headers */
section > h2 {
  margin: -20px -20px 16px;
  padding: 14px 20px;
  background: var(--primary);
  color: var(--primary-foreground);
  border-bottom: 1px solid var(--border);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  font-size: 14px;
  letter-spacing: 0.02em;
}
    .health-card-body {
      overflow: hidden;
      transition: max-height 220ms ease, opacity 180ms ease, padding 220ms ease;
      max-height: 1600px;
      opacity: 1;
    }
    .health-card-body.collapsed {
      max-height: 0;
      opacity: 0;
      padding-top: 0 !important;
      padding-bottom: 0 !important;
    }
    .summary-section-hidden {
      display: none !important;
    }
    .health-toggle {
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      color: var(--text);
      border-radius: 999px;
      height: 34px;
      padding: 0 12px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
    }
    .cash-health-toggle {
      gap: 7px;
      transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
    }
    .cash-health-toggle:hover {
      transform: translateY(-1px);
    }
    .cash-health-toggle .cash-health-chevron {
      transition: transform 180ms ease;
    }
    .cash-health-toggle[aria-expanded="true"] .cash-health-chevron {
      transform: rotate(180deg);
    }
    .cash-health-toggle #toggleHealthText {
      color: inherit;
      opacity: 0.82;
    }
.health-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 30px;
  align-items: stretch;
  margin-bottom: 20px; /* pushes next section down */
}
    .health-panel,
    .health-summary {
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--surface-soft);
      padding: 16px;
    }
    .health-panel {
      display: grid;
      gap: 14px;
      align-content: start;
    }
    .health-score-card {
      display: grid;
      grid-template-columns: 132px minmax(0, 1fr);
      gap: 16px;
      align-items: center;
    }
    .health-gauge-wrap {
      position: relative;
      width: 132px;
      height: 132px;
      margin: 0;
    }
    .health-gauge-wrap canvas {
      width: 132px !important;
      height: 132px !important;
      display: block;
    }
    .health-gauge-center {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      text-align: center;
      pointer-events: none;
    }
    .health-gauge-score {
      font-size: 34px;
      line-height: 0.95;
      letter-spacing: -0.06em;
      font-weight: 700;
    }
    .health-gauge-label {
      margin-top: 4px;
      color: var(--muted);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .health-score-wrap {
      display: grid;
      gap: 8px;
      min-width: 0;
    }
    .health-score-label {
      color: var(--muted);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .health-score-line {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    .health-score {
      font-size: 40px;
      line-height: 0.92;
      letter-spacing: -0.06em;
      font-weight: 700;
    }
    .health-badge,
    .health-header-status {
      height: 28px;
      padding: 0 11px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 700;
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      color: var(--text);
      white-space: nowrap;
    }
    .health-badge.good,
    .health-header-status.good {
      color: var(--green);
      border-color: color-mix(in srgb, var(--green) 30%, var(--line));
      background: color-mix(in srgb, var(--green) 9%, var(--surface-elevated));
    }
    .health-badge.warn,
    .health-header-status.warn {
      color: var(--orange);
      border-color: color-mix(in srgb, var(--orange) 30%, var(--line));
      background: color-mix(in srgb, var(--orange) 10%, var(--surface-elevated));
    }
    .health-badge.risk,
    .health-header-status.risk {
      color: var(--red);
      border-color: color-mix(in srgb, var(--red) 30%, var(--line));
      background: color-mix(in srgb, var(--red) 9%, var(--surface-elevated));
    }
    .health-copy {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      max-width: 420px;
    }
    .health-meter,
    .health-meter-track,
    .health-meter-fill,
    .health-meter-scale {
      display: none;
    }
    .health-summary {
      display: grid;
      gap: 12px;
      align-content: start;
    }
    .health-summary-title {
      font-size: 15px;
      font-weight: 650;
      letter-spacing: -0.02em;
    }
    .health-summary-list {
      display: grid;
      gap: 10px;
    }
    .health-summary-item {
      display: grid;
      grid-template-columns: 28px 1fr;
      gap: 10px;
      align-items: start;
    }
    .health-summary-icon {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      background: var(--surface-elevated);
      border: 1px solid var(--line);
      color: var(--text);
    }
    .health-summary-item-title {
      font-size: 13px;
      font-weight: 600;
      line-height: 1.2;
      margin-bottom: 2px;
    }
    .health-summary-item-copy {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }
    .health-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin-bottom: 20px;
    }
    .health-stat {
      padding: 12px;
      background: var(--surface-elevated);
      border: 1px solid var(--line);
      border-radius: 14px;
      display: grid;
      gap: 6px;
    }
    .health-stat-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .health-stat-label {
      color: var(--muted);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .health-stat-value {
      font-size: 18px;
      font-weight: 650;
      letter-spacing: -0.03em;
      line-height: 1.1;
    }
    .health-stat-value.good { color: var(--green); }
    .health-stat-value.bad { color: var(--red); }
    .health-stat-note {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.3;
    }
    .health-tool {
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--surface-soft);
      padding: 16px;
      display: grid;
      gap: 14px;
    }
    .health-tool-top {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 14px;
      flex-wrap: wrap;
    }
    .health-tool-title {
      font-size: 15px;
      font-weight: 650;
      letter-spacing: -0.02em;
      margin-bottom: 2px;
    }
    .health-tool-copy {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
      max-width: 520px;
    }
    .health-tool-target {
      display: grid;
      gap: 4px;
      justify-items: end;
    }
    .health-tool-target-label {
      color: var(--muted);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .health-tool-target-value {
      font-size: 22px;
      font-weight: 700;
      letter-spacing: -0.04em;
      line-height: 1;
    }







    .health-slider-wrap {
  display: grid;
  gap: 8px;
}

.health-slider {
  --track-height: 5px;
  --thumb-size: 20px;
  --track-rest: #e9eaee;
  --fill-color: #34c759;
  --fill-percent: 50%;

  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: var(--thumb-size);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  outline: none;
}

/* WebKit track */
.health-slider::-webkit-slider-runnable-track {
  height: var(--track-height);
  border-radius: 999px;
  background:
    linear-gradient(
      to right,
      var(--fill-color) 0%,
      var(--fill-color) var(--fill-percent),
      var(--track-rest) var(--fill-percent),
      var(--track-rest) 100%
    );
}

/* WebKit thumb */
.health-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--thumb-size);
  height: var(--thumb-size);
  margin-top: calc((var(--track-height) - var(--thumb-size)) / 2);
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    0 4px 10px rgba(16, 24, 40, 0.10);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

/* Firefox track */
.health-slider::-moz-range-track {
  height: var(--track-height);
  border-radius: 999px;
  background: var(--track-rest);
}

.health-slider::-moz-range-progress {
  height: var(--track-height);
  border-radius: 999px;
  background: var(--fill-color);
}

/* Firefox thumb */
.health-slider::-moz-range-thumb {
  width: var(--thumb-size);
  height: var(--thumb-size);
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    0 4px 10px rgba(16, 24, 40, 0.10);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

/* Interaction */
.health-slider:hover::-webkit-slider-thumb,
.health-slider:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    0 6px 14px rgba(16, 24, 40, 0.14);
}

.health-slider:hover::-moz-range-thumb,
.health-slider:focus-visible::-moz-range-thumb {
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    0 6px 14px rgba(16, 24, 40, 0.14);
}

.health-slider:active::-webkit-slider-thumb {
  transform: scale(1.08);
}

.health-slider:active::-moz-range-thumb {
  transform: scale(1.08);
}

.health-slider:focus-visible {
  outline: none;
}

.health-slider-scale {
  display: flex;
  justify-content: space-between;
  color: #8c8f98;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

    .health-tool-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }
    .health-tool-stat {
      padding: 12px;
      background: var(--surface-elevated);
      border: 1px solid var(--line);
      border-radius: 14px;
      display: grid;
      gap: 8px;
    }
    .health-tool-stat-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .health-tool-stat-label {
      color: var(--muted);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .health-tool-stat-icon {
      width: 22px;
      height: 22px;
      border-radius: 6px;
      display: grid;
      place-items: center;
      background: rgba(0, 0, 0, 0.05);
      color: var(--text);
    }
    .health-tool-stat-icon.good {
      background: rgba(52,199,89,0.12);
      color: var(--green);
    }
    .health-tool-stat-icon.warn {
      background: rgba(255,149,0,0.12);
      color: var(--orange);
    }
    .health-tool-stat-icon.bad {
      background: rgba(255,59,48,0.12);
      color: var(--red);
    }
    .health-tool-stat-value {
      font-size: 20px;
      font-weight: 650;
      letter-spacing: -0.03em;
      line-height: 1.05;
    }
    .health-tool-stat-value.good { color: var(--green); }
    .health-tool-stat-value.warn { color: var(--orange); }
    .health-tool-stat-value.bad { color: var(--red); }
    .health-tool-stat-note {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.3;
    }

.icon-btn.highlight {
  color: #f4bf1e;
}

    .ghost, .primary, .icon-btn, .segmented button, .center-action-btn {
      border: 1px solid var(--line);
      background: var(--surface);
      color: var(--text);
      border-radius: 999px;
      height: 34px;
      padding: 0 12px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-size: 12px;
      font-weight: 600;
      white-space: nowrap;
      cursor: pointer;
    }
    .primary { background: var(--text); color: var(--page-bg); border-color: transparent; }
    .icon-btn { width: 34px; padding: 0; }

    .card {
      border-radius: var(--radius-xl);
      overflow: hidden;
      border: 1px solid var(--line);
      box-shadow: var(--shadow);
      background: var(--surface);
    }
    .card-header {
      padding: 14px 16px;
      background: var(--surface-muted);
      border-bottom: 1px solid var(--line);
    }
    .toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
    .main-header-toolbar {
      align-items: stretch;
      gap: 12px;
    }
    .main-header-primary,
    .main-header-tools {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .main-header-primary {
      min-width: 260px;
    }
    .main-header-tools {
      justify-content: flex-end;
      margin-left: auto;
    }
    .main-tool-group {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--surface-elevated);
    }
    .main-tool-group .icon-btn,
    .main-tool-group .range-chip {
      background: transparent;
      border-color: transparent;
    }
    .main-tool-group .icon-btn:hover,
    .main-tool-group .range-chip:hover {
      background: var(--surface-soft);
    }
    .main-tool-group[hidden] { display: none !important; }
    @media (max-width: 800px) {
      .main-header-primary,
      .main-header-tools,
      .main-tool-group {
        width: 100%;
      }
      .main-header-tools { justify-content: flex-start; }
      .main-tool-group { border-radius: 18px; flex-wrap: wrap; }
    }
    .month-nav { display: flex; align-items: center; gap: 8px; }
    .range-chip {
      height: 34px;
      padding: 0 10px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      font-weight: 600;
      color: var(--text);
      background: var(--surface-elevated);
      border: 1px solid var(--line);
    }

    .range-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

    .card-header .icon-btn { background: var(--surface-elevated); border-color: var(--line); }
    .segmented {
      --segment-index: 0;
      position: relative;
      display: inline-grid;
      grid-template-columns: repeat(2, minmax(96px, 1fr));
      align-items: center;
      padding: 2px;
      background: var(--surface-elevated);
      border: 1px solid var(--line);
      border-radius: 999px;
      isolation: isolate;
      overflow: hidden;
    }
    .segmented::before {
      content: "";
      position: absolute;
      top: 2px;
      bottom: 2px;
      left: 2px;
      width: calc((100% - 4px) / 2);
      border-radius: 999px;
      background: var(--surface);
      box-shadow: 0 1px 3px rgba(0,0,0,0.08);
      transform: translateX(calc(var(--segment-index) * 100%));
      transition: transform 220ms cubic-bezier(.2,.8,.2,1), background 180ms ease, box-shadow 180ms ease;
      z-index: -1;
    }
    .segmented button {
      position: relative;
      z-index: 1;
      border: none;
      background: transparent;
      min-width: 96px;
      height: 30px;
      color: var(--muted);
      transition: color 160ms ease, transform 160ms ease;
    }
    .segmented button.active {
      background: transparent;
      color: var(--text);
      box-shadow: none;
    }
    .segmented button:active {
      transform: scale(0.98);
    }
    .calendar-display-toggle[hidden],
    .calendar-source-filter[hidden] { display: none !important; }
    .calendar-source-filter {
      position: relative;
      overflow: visible;
      display: inline-flex;
      align-items: center;
    }
    .calendar-source-button {
      height: 36px;
      cursor: pointer;
      user-select: none;
    }
    .calendar-source-button strong {
      max-width: 170px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 12px;
      font-weight: 800;
    }
    .calendar-source-button[aria-expanded="true"] {
      border-color: color-mix(in srgb, #1E6EF4 32%, var(--line));
      background: color-mix(in srgb, #1E6EF4 7%, var(--surface-elevated));
    }
    .calendar-source-menu {
      position: absolute;
      top: calc(100% + 8px);
      left: 0;
      z-index: 35;
      width: min(280px, calc(100vw - 32px));
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--surface-elevated);
      box-shadow: 0 18px 48px rgba(0,0,0,0.16);
      display: grid;
      gap: 4px;
    }
    .calendar-source-menu[hidden] { display: none !important; }
    .calendar-source-option {
      width: 100%;
      border: none;
      background: transparent;
      color: var(--text);
      border-radius: 12px;
      padding: 9px 10px;
      display: grid;
      grid-template-columns: 20px minmax(0, 1fr);
      gap: 9px;
      align-items: center;
      text-align: left;
      cursor: pointer;
      font-size: 12px;
      font-weight: 700;
    }
    .calendar-source-option:hover {
      background: var(--surface-soft);
    }
    .calendar-source-option-check {
      width: 18px;
      height: 18px;
      border-radius: 6px;
      border: 1px solid var(--line-strong);
      display: grid;
      place-items: center;
      color: transparent;
      background: var(--surface);
    }
    .calendar-source-option.active .calendar-source-option-check {
      color: #fff;
      background: #1E6EF4;
      border-color: #1E6EF4;
    }
    .calendar-source-option-label {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .calendar-month-grid {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 1px;
      padding: 1px;
      background: var(--line);
      border-radius: 18px;
      overflow: hidden;
      margin: 14px 0;
    }
    .calendar-month-weekday,
    .calendar-month-day {
      background: var(--surface);
    }
.calendar-month-weekday {
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 6px 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;

  background: color-mix(in srgb, currentColor 8%, transparent);
}
    .calendar-month-day {
      min-height: 132px;
      padding: 10px;
      display: grid;
      align-content: start;
      gap: 7px;
    }
    .calendar-month-day.is-muted { opacity: 0.42; }
.calendar-month-day.is-today {


  position : relative;
  background: rgba(30, 110, 244, 0.12);
  box-shadow: 
    inset 0 0 0 2px rgba(30, 108, 244, 0.112),
    0 0 12px rgba(30, 110, 244, 0.18);
}
    .calendar-month-day-number {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
    }

  
    .calendar-month-day-total {
      color: var(--text);
      font-size: 12px;
      font-weight: 800;
    }
    .calendar-month-day-metrics {
      display: grid;
      gap: 2px;
      justify-items: end;
      text-align: right;
      min-width: 0;
    }
    .calendar-month-day-balance {
      color: var(--muted);
      font-size: 10px;
      font-weight: 650;
      line-height: 1.05;
      opacity: 0.78;
      white-space: nowrap;
    }
    .calendar-month-day-balance.negative {
      color: var(--orange);
      opacity: 0.9;
    }
    .calendar-month-event {
      min-width: 0;
      padding: 7px 8px;
      border-radius: 10px;
      background: var(--surface-soft);
      border: 1px solid var(--line);
      display: grid;
      grid-template-columns: 26px minmax(0, 1fr);
      gap: 7px;
      align-items: center;
      cursor: pointer;
    }
    .calendar-month-event:hover { background: var(--surface-elevated); border-color: var(--line-strong); }
    .calendar-month-event-icon {
      width: 24px;
      height: 24px;
      border-radius: 7px;
      display: grid;
      place-items: center;
      color: #fff;
      overflow: hidden;
      align-self: stretch;
      margin: auto 0;
    }
    .calendar-month-event-icon.has-image {
      background: var(--surface-elevated) !important;
      border: 1px solid var(--line);
      color: var(--text);
    }
    .calendar-month-event-icon img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      padding: 2px;
    }
    .calendar-month-event-main {
      min-width: 0;
      display: grid;
      gap: 3px;
    }
    .calendar-month-event-title {
      font-size: 11px;
      font-weight: 750;
      line-height: 1.15;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .calendar-month-event-amount {
      font-size: 11px;
      font-weight: 800;
      line-height: 1;
    }
    .calendar-month-event-amount.income { color: var(--green); }
    .calendar-month-event-amount.bill { color: var(--red); }
    .calendar-month-more {
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      padding: 2px 1px;
    }
    @media (max-width: 800px) {
      .calendar-month-grid { grid-template-columns: 1fr; background: transparent; gap: 8px; padding: 0; }
      .calendar-month-weekday { display: none; }
      .calendar-month-day { min-height: auto; border: 1px solid var(--line); border-radius: 16px; }
      .calendar-month-day.is-muted { display: none; }
    }

    .card-body { padding: 0 14px; }
    .card-footer { border-top: 1px solid var(--line); padding: 12px 14px 14px; background: var(--surface-soft); }

    .stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
    .stat {
      padding: 10px;
      background: var(--surface-elevated);
      border: 1px solid var(--line);
      border-radius: 14px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

.cashback-row-rate {
  background: rgba(34, 197, 94, 0.12); /* green tint */
  color: #16a34a;
}

#resetDemo:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
    .stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .stat-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
    .stat-value { font-size: 18px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; }
    .stat-value.income { color: var(--green); }
    .stat-value.bill { color: var(--red); }
    .stat-icon {
      width: 22px;
      height: 22px;
      border-radius: 6px;
      display: grid;
      place-items: center;
      background: rgba(0, 0, 0, 0.05);
      color: var(--text);
    }
    .stat-icon.income { background: rgba(52,199,89,0.12); color: var(--green); }
    .stat-icon.bill { background: rgba(255,59,48,0.12); color: var(--red); }

    .list { display: flex; flex-direction: column; }
    .row {
      display: grid;
      grid-template-columns: 36px minmax(0, 1fr) auto;
      gap: 12px;
      align-items: center;
      padding: 14px 6px;
      border-bottom: 1px solid var(--line);
      min-height: 64px;
    }
    .row:last-child { border-bottom: none; }
    .row.clickable { cursor: pointer; }
    .row.clickable:hover { background: rgba(0,0,0,0.02); }
    .row-icon {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      color: white;
      margin-left: 2px;
      overflow: hidden;
      flex: 0 0 28px;
    }
    .row-icon.has-image {
      background: var(--surface-elevated) !important;
      border: 1px solid var(--line);
      color: var(--text);
    }
.row-icon img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  padding: 0px;
}
.row-icon {
  overflow: hidden; /* important for cropping */
}
    .row-main { min-width: 0; }
    .name {
      font-size: 15px;
      font-weight: 600;
      letter-spacing: -0.02em;
      line-height: 1.15;
      margin-bottom: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .meta {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .row-amount { text-align: right; padding-left: 12px; }
    .row-actions {
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
    }
    .statement-link-btn {
      height: 28px;
      padding: 0 10px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      color: #1E6EF4;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      white-space: nowrap;
    }
    .statement-link-btn:hover {
      border-color: color-mix(in srgb, #1E6EF4 32%, var(--line));
      background: color-mix(in srgb, #1E6EF4 8%, var(--surface-elevated));
    }
    .value { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 2px; white-space: nowrap; }
    .value.bill { color: var(--red); }
    .value.income { color: var(--green); }
    .running { color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
    .suggestion-row {
      display: grid;
      grid-template-columns: 36px minmax(0, 1fr) auto;
      gap: 12px;
      align-items: center;
      padding: 14px 6px;
      border-bottom: 1px solid var(--line);
      background: color-mix(in srgb, var(--surface-soft) 84%, var(--surface));
    }
    .suggestion-row-icon {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      color: white;
      margin-left: 2px;
      background: linear-gradient(135deg, #1E6EF4, #8B5CF6);
    }
    .suggestion-row-main {
      min-width: 0;
      display: grid;
      gap: 2px;
    }
    .suggestion-row-title {
      font-size: 14px;
      font-weight: 650;
      letter-spacing: -0.02em;
      line-height: 1.15;
    }
    .suggestion-row-copy {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }
    .suggestion-chip {
      min-height: 28px;
      padding: 0 10px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      color: var(--text);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
    }
    .suggestion-chip.good {
      color: var(--green);
      border-color: color-mix(in srgb, var(--green) 30%, var(--line));
      background: color-mix(in srgb, var(--green) 9%, var(--surface-elevated));
    }
    .suggestion-chip.warn {
      color: var(--orange);
      border-color: color-mix(in srgb, var(--orange) 30%, var(--line));
      background: color-mix(in srgb, var(--orange) 10%, var(--surface-elevated));
    }
    .suggestion-chip.bad {
      color: var(--red);
      border-color: color-mix(in srgb, var(--red) 30%, var(--line));
      background: color-mix(in srgb, var(--red) 9%, var(--surface-elevated));
    }
    .empty { padding: 24px 0; color: var(--muted); text-align: center; font-size: 14px; }

    .summary-list { display: flex; flex-direction: column; }
    .summary-head,
    .summary-row {
      display: grid;
      grid-template-columns: minmax(140px, 1.3fr) repeat(4, minmax(0, 1fr));
      gap: 14px;
      align-items: center;
      padding: 14px 6px;
      border-bottom: 1px solid var(--line);
    }
    .summary-head {
      min-height: 44px;
      padding-top: 10px;
      padding-bottom: 10px;
      color: var(--muted);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .summary-head > div:first-child { text-align: left; }
    .summary-head > div:not(:first-child) { text-align: right; }
    .summary-row {
      min-height: 60px;
      cursor: pointer;
      transition: background 160ms ease, transform 120ms ease, box-shadow 160ms ease;
    }
    .summary-row:hover {
      background: rgba(0,0,0,0.03);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    }
    .summary-row:last-child { border-bottom: none; }
    .summary-month {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .summary-month-icon {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      background: var(--grey-chip);
      color: var(--black);
      flex: 0 0 auto;
    }
    .summary-month-label {
      font-size: 15px;
      font-weight: 600;
      letter-spacing: -0.02em;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .summary-cell {
      min-width: 0;
      text-align: right;
    }
    .summary-cell-value {
      font-size: 14px;
      font-weight: 600;
      letter-spacing: -0.02em;
      white-space: nowrap;
    }
    .summary-cell-value.income { color: var(--green); }
    .summary-cell-value.bill { color: var(--red); }
    .summary-row.negative-forward {
      background: rgba(255, 59, 48, 0.06);
    }
    .summary-row.negative-forward:hover {
      background: rgba(255, 59, 48, 0.1);
    }
    .summary-row.negative-forward .summary-month-icon {
      background: rgba(255, 59, 48, 0.14);
      color: var(--red);
    }
    .summary-row.negative-forward .summary-cell-value.forward-negative {
      color: var(--red);
    }
    .budget-card {
      margin-top: 16px;
    }
    .budget-shell {
      display: grid;
      gap: 14px;
      padding: 16px 0;
    }
    .budget-top {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 14px;
      align-items: stretch;
    }
    .budget-overview,
    .budget-goal-card,
    .budget-categories-card {
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--surface-soft);
    }
    .budget-overview,
    .budget-goal-card {
      padding: 16px;
      display: grid;
      gap: 14px;
    }
    .budget-graph-card {
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--surface-soft);
      padding: 16px;
      display: grid;
      gap: 14px;
    }
    .budget-graph-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }
    .budget-simple-meter {
      --budget-accent: #1E6EF4;
      --budget-accent-soft: rgba(30, 110, 244, 0.14);
      display: grid;
      gap: 12px;
      padding: 2px 0;
    }
    .budget-simple-meter.warn {
      --budget-accent: var(--orange);
      --budget-accent-soft: color-mix(in srgb, var(--orange) 16%, transparent);
    }
    .budget-simple-meter.bad {
      --budget-accent: var(--red);
      --budget-accent-soft: color-mix(in srgb, var(--red) 15%, transparent);
    }
    .budget-simple-row {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 12px;
    }
    .budget-simple-number-stack {
      display: grid;
      gap: 4px;
      min-width: 0;
    }
    .budget-simple-label {
      color: var(--muted);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      font-weight: 850;
    }
    .budget-simple-spent {
      font-size: clamp(28px, 4vw, 24px);
      font-weight: 900;
      letter-spacing: -0.07em;
      line-height: 0.94;
      color: var(--text);
    }
    .budget-simple-goal {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      min-height: 30px;
      padding: 0 11px;
      border-radius: 999px;
      color: var(--budget-accent);
      background: var(--budget-accent-soft);
      border: 1px solid color-mix(in srgb, var(--budget-accent) 24%, var(--line));
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
    }
    .budget-simple-track {
      position: relative;
      height: 15px;
      border-radius: 999px;
      border: 1px solid color-mix(in srgb, var(--budget-accent) 18%, var(--line));
      background:
        linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.02)),
        color-mix(in srgb, var(--budget-accent) 9%, var(--surface-elevated));
      overflow: hidden;
    }
    .budget-simple-track::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.24), transparent);
      transform: translateX(-100%);
      animation: budgetBarSheen 2.6s ease-in-out infinite;
      pointer-events: none;
    }
.budget-simple-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.26), rgba(255,255,255,0)),
    linear-gradient(
      90deg,
      var(--budget-accent),
      color-mix(in srgb, var(--budget-accent) 74%, #ffffff),
      var(--budget-accent)
    );

  background-size: 100% 100%, 200% 100%;
  animation: flow 2s linear infinite;

  transition: width 520ms cubic-bezier(.2,.8,.2,1);
}

@keyframes flow {
  from {
    background-position: 0 0, 0% 0;
  }
  to {
    background-position: 0 0, 200% 0;
  }
}
    .budget-simple-fill.warn,
    .budget-simple-fill.bad {
      background:
        linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0)),
        linear-gradient(90deg, var(--budget-accent), color-mix(in srgb, var(--budget-accent) 70%, #ffffff));
    }
    @keyframes budgetBarSheen {
      0%, 45% { transform: translateX(-100%); opacity: 0; }
      55% { opacity: 1; }
      100% { transform: translateX(100%); opacity: 0; }
    }
    .budget-simple-foot {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.3;
    }
    .budget-simple-status {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-height: 26px;
      padding: 0 10px;
      border-radius: 999px;
      background: var(--budget-accent-soft);
      color: var(--budget-accent);
      border: 1px solid color-mix(in srgb, var(--budget-accent) 24%, var(--line));
      font-weight: 850;
      white-space: nowrap;
    }
    .budget-simple-foot strong {
      color: var(--text);
      font-weight: 900;
      letter-spacing: -0.02em;
    }
    .budget-title-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }
    .budget-title-stack {
      display: grid;
      gap: 4px;
    }
    .budget-title {
      font-size: 20px;
      font-weight: 750;
      letter-spacing: -0.04em;
      line-height: 1.02;
    }
    .budget-copy {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
      max-width: 560px;
    }
    .budget-status-pill {
      height: 30px;
      padding: 0 11px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      font-size: 11px;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      white-space: nowrap;
    }
    .budget-status-pill.good {
      color: var(--green);
      border-color: color-mix(in srgb, var(--green) 30%, var(--line));
      background: color-mix(in srgb, var(--green) 9%, var(--surface-elevated));
    }
    .budget-status-pill.warn {
      color: var(--orange);
      border-color: color-mix(in srgb, var(--orange) 30%, var(--line));
      background: color-mix(in srgb, var(--orange) 10%, var(--surface-elevated));
    }
    .budget-status-pill.bad {
      color: var(--red);
      border-color: color-mix(in srgb, var(--red) 30%, var(--line));
      background: color-mix(in srgb, var(--red) 9%, var(--surface-elevated));
    }
    .budget-stats-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
    }
    .budget-stat-card {
      padding: 12px;
      border-radius: 16px;
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      display: grid;
      gap: 8px;
    }
    .budget-stat-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .budget-stat-label {
      color: var(--muted);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .budget-stat-icon {
      width: 24px;
      height: 24px;
      border-radius: 7px;
      display: grid;
      place-items: center;
      background: var(--surface-soft);
      border: 1px solid var(--line);
      color: var(--text);
    }
    .budget-stat-value {
      font-size: 22px;
      font-weight: 750;
      letter-spacing: -0.05em;
      line-height: 1;
    }
    .budget-stat-value.good { color: var(--green); }
    .budget-stat-value.bad { color: var(--red); }
    .budget-stat-value.warn { color: var(--orange); }
    .budget-stat-note {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }
    .budget-goal-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }
    .budget-goal-value {
      font-size: 26px;
      font-weight: 800;
      letter-spacing: -0.05em;
      line-height: 1;
    }
    .budget-goal-field {
      display: grid;
      gap: 8px;
    }
    .budget-progress {
      display: grid;
      gap: 8px;
    }
    .budget-progress-track {
      position: relative;
      height: 12px;
      border-radius: 999px;
      background: var(--surface-elevated);
      border: 1px solid var(--line);
      overflow: hidden;
    }
    .budget-progress-fill,
    .budget-progress-goal {
      position: absolute;
      inset: 0 auto 0 0;
      border-radius: inherit;
    }
    .budget-progress-fill {
      background: linear-gradient(90deg, rgba(30,110,244,0.9), rgba(90,200,250,0.9));
      width: 0%;
    }
    .budget-progress-goal {
      background: linear-gradient(90deg, rgba(52,199,89,0.32), rgba(52,199,89,0.14));
      width: 0%;
      mix-blend-mode: multiply;
    }
    .budget-progress-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }
    .budget-categories-card {
      padding: 0;
      overflow: hidden;
    }
    .budget-categories-head {
      padding: 14px 16px;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
      background: var(--surface-elevated);
    }
    .budget-categories-list {
      display: grid;
      gap: 0;
    }
    .budget-category-row {
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr) auto 20px;
      gap: 12px;
      align-items: center;
      padding: 13px 16px;
      border-top: 1px solid var(--line);
      cursor: pointer;
      transition: background 160ms ease;
    }
    .budget-category-row:hover {
      background: rgba(0,0,0,0.02);
    }
    .budget-category-value-wrap {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .budget-category-goal-pill {
      min-height: 28px;
      padding: 0 10px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      color: var(--text);
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
      cursor: pointer;
    }
    .budget-category-goal-pill:hover {
      border-color: var(--line-strong);
      background: var(--surface-soft);
    }
    .budget-category-progress {
      display: grid;
      gap: 6px;
      min-width: 220px;
      justify-items: end;
    }
    .budget-category-progress-line {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
      font-size: 11px;
      font-weight: 700;
      color: var(--text);
    }
    .budget-category-progress-muted {
      color: var(--muted);
      font-weight: 600;
    }
    .budget-category-progress-track {
      width: min(220px, 100%);
      height: 10px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      overflow: hidden;
    }
    .budget-category-progress-fill {
      height: 100%;
      width: 0%;
      border-radius: inherit;
      background: var(--green);
    }
    .budget-category-progress-fill.warn {
      background: var(--orange);
    }
    .budget-category-progress-fill.bad {
      background: var(--red);
    }
    .budget-category-goal-delta {
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
    }
    .budget-category-goal-delta.good { color: var(--green); }
    .budget-category-goal-delta.warn { color: var(--orange); }
    .budget-category-goal-delta.bad { color: var(--red); }
    .category-goals-list {
      display: grid;
      gap: 10px;
    }
    .category-goal-row {
      display: grid;
      grid-template-columns: minmax(220px, 1fr) 140px 140px 150px 130px;
      gap: 12px;
      align-items: center;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--surface-elevated);
    }
    .category-goal-row:hover {
      background: var(--surface-soft);
    }
    .category-goal-row-title {
      display: grid;
      grid-template-columns: 32px minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      min-width: 0;
    }
    .category-goal-row-icon {
      width: 32px;
      height: 32px;
      border-radius: 10px;
      display: grid;
      place-items: center;
      color: #fff;
      flex: 0 0 32px;
    }
    .category-goal-row-icon .lucide,
    .category-goal-row-icon i {
      width: 15px;
      height: 15px;
    }
    .category-goal-row-main {
      min-width: 0;
      display: grid;
      gap: 3px;
    }
    .category-goal-row-name {
      font-size: 13px;
      font-weight: 700;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .category-goal-row-meta {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.3;
    }
    .category-goal-row .field {
      gap: 5px;
    }
    .category-goal-row .label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 800;
    }
    .category-goal-row select,
    .category-goal-row input {
      padding: 9px 10px;
      border-radius: 10px;
      font-size: 12px;
      font-weight: 650;
      min-height: 38px;
    }
    .category-goal-preview {
      min-height: 38px;
      padding: 0 12px;
      border-radius: 10px;
      border: 1px solid var(--line);
      background: var(--surface-soft);
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      font-size: 12px;
      font-weight: 800;
      text-align: right;
      white-space: nowrap;
    }
    @media (max-width: 800px) {
      .category-goal-row {
        grid-template-columns: 1fr;
        align-items: stretch;
      }
      .category-goal-preview { justify-content: flex-start; text-align: left; }
    }
    .budget-category-value-input {
      width: 120px;
      padding: 8px 10px;
      text-align: right;
      font-size: 13px;
      font-weight: 700;
      border-radius: 10px;
    }
    .budget-category-chevron {
      color: var(--muted);
      display: grid;
      place-items: center;
      justify-self: end;
    }
    .budget-category-details {
      display: none;
      padding: 0 16px 14px 62px;
      border-top: 1px solid var(--line);
      background: color-mix(in srgb, var(--surface-soft) 78%, var(--surface-elevated));
    }
    .budget-category-details.open {
      display: block;
    }
    .budget-category-items {
      display: grid;
      gap: 0;
      padding-top: 10px;
    }
    .budget-category-item {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 12px;
      align-items: start;
      padding: 9px 0;
      border-top: 1px solid var(--line);
    }
    .budget-category-item:first-child {
      border-top: none;
      padding-top: 0;
    }
    .budget-category-item-title {
      font-size: 12px;
      font-weight: 600;
      line-height: 1.25;
      margin-bottom: 2px;
    }
    .budget-category-item-meta {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.3;
    }
    .budget-category-item-value {
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
      text-align: right;
    }
    .budget-category-row:first-child { border-top: none; }
    .budget-category-icon {
      width: 35px;
      height: 35px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      color: #fff;
    }
    .budget-category-main {
      min-width: 0;
      display: grid;
      gap: 2px;
    }
    .budget-category-title {
      font-size: 13px;
      font-weight: 650;
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .budget-category-meta {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.25;
    }
    .budget-category-value {
      font-size: 13px;
      font-weight: 700;
      white-space: nowrap;
      text-align: right;
    }
    .budget-empty {
      padding: 18px 16px;
      color: var(--muted);
      font-size: 12px;
      text-align: center;
    }
    .summary-chart-wrap {
      position: relative;
      height: 280px;
      padding: 8px 2px 0;
    }
    #summaryChart {
      width: 100%;
      height: 100%;
      display: block;
    }

    .center-stack { display: grid; gap: 14px; margin-top: 6px; }
    .center-section-card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface-elevated); overflow: hidden; }
    .center-section-head {
      display: grid;
      grid-template-columns: 40px minmax(0, 1fr) auto auto;
      gap: 12px;
      align-items: center;
      padding: 14px;
      background: var(--surface-soft);
      border-bottom: 1px solid var(--line);
    }
    .center-section-head.clickable { cursor: pointer; }
    .center-section-head.clickable:hover { background: color-mix(in srgb, var(--surface-soft) 82%, var(--surface-elevated)); }
    .center-action-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #ffffff; }
    .center-action-main { min-width: 0; }
    .center-action-title { font-size: 15px; font-weight: 600; line-height: 1.2; margin-bottom: 2px; }
    .center-action-meta { font-size: 12px; color: var(--muted); line-height: 1.25; }
    .center-action-btn { align-self: center; background: var(--surface-elevated); }
    .center-section-chevron {
      width: 28px;
      height: 28px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      color: var(--muted);
      display: grid;
      place-items: center;
      transition: transform 180ms ease;
    }
    .center-section-card.collapsed .center-section-chevron {
      transform: rotate(-90deg);
    }
    .center-section-body {
      display: block;
    }
    .center-section-card.collapsed .center-section-body {
      display: none;
    }
    .center-entries { display: grid; gap: 0; padding: 0 14px; }
    .center-entry {
      display: grid;
      grid-template-columns: 24px minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      padding: 12px 0;
      border-top: 1px solid rgba(17,17,17,0.06);
      cursor: pointer;
    }
    .card-manager-section {
      display: grid;
      gap: 12px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--surface-soft);
      margin-bottom: 14px;
    }
    .card-manager-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }
    .card-manager-title-wrap {
      display: grid;
      gap: 2px;
    }
    .card-manager-title {
      font-size: 15px;
      font-weight: 650;
      line-height: 1.2;
    }
    .card-manager-copy {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.35;
    }
    .card-manager-form {
      display: grid;
      gap: 12px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--surface-elevated);
    }
    .card-manager-form[hidden] { display: none; }
    .card-manager-list {
      display: grid;
      gap: 0;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--surface-elevated);
      overflow: hidden;
    }
    .card-row {
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr) auto auto;
      gap: 12px;
      align-items: center;
      padding: 12px 14px;
      border-top: 1px solid var(--line);
    }
    .card-row:first-child { border-top: none; }
    .card-row-icon {
      width: 24px;
      height: 24px;
      border-radius: 7px;
      display: grid;
      place-items: center;
      color: white;
      background: #5856D6;
      overflow: hidden;
      flex: 0 0 24px;
    }
    .card-row-icon.has-image {
      background: var(--surface-elevated);
      border: 1px solid var(--line);
      color: var(--text);
    }
    .card-row-icon img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      padding: 2px;
      background: transparent;
    }
    .card-row-main { min-width: 0; }
    .card-row-title {
      font-size: 13px;
      font-weight: 600;
      line-height: 1.2;
      margin-bottom: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .card-row-meta {
      font-size: 11px;
      color: var(--muted);
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .cashback-config-grid {
      display: grid;
      gap: 12px;
    }
    .cashback-base-card,
    .cashback-category-card {
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface-soft);
      display: grid;
      gap: 10px;
    }
    .cashback-category-list {
      display: grid;
      gap: 8px;
    }
    .cashback-category-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 110px auto;
      gap: 8px;
      align-items: center;
    }
    .cashback-category-remove {
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      color: var(--muted);
      border-radius: 999px;
      height: 34px;
      padding: 0 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 12px;
      font-weight: 700;
    }
    .cashback-category-remove:hover {
      color: var(--red);
      border-color: color-mix(in srgb, var(--red) 30%, var(--line));
    }
    .cashback-empty {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
      padding: 2px 0;
    }
    .cashback-add-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 110px auto;
      gap: 8px;
      align-items: center;
    }
    .cashback-total-card {
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--surface-soft);
      display: grid;
      gap: 6px;
    }
    .cashback-total-label {
      color: var(--muted);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .cashback-total-value {
      font-size: 28px;
      font-weight: 800;
      letter-spacing: -0.05em;
      line-height: 1;
    }
    .cashback-total-copy {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
    }
    .cashback-list {
      display: grid;
      gap: 0;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--surface-soft);
      overflow: hidden;
    }
    .cashback-row {
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr) auto auto;
      gap: 10px;
      align-items: center;
      padding: 12px 14px;
      border-top: 1px solid var(--line);
    }
    .cashback-row:first-child { border-top: none; }
    .cashback-row-earned {
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
      text-align: right;
    }
    .cashback-row-earned.positive {
      color: var(--green);
    }
    .cashback-row-earned.negative {
      color: var(--red);
    }
.cashback-row-rate {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px; /* full pill */
  background: rgba(0, 0, 0, 0.06); /* subtle neutral */
  color: var(--muted);
  white-space: nowrap;
  text-align: center;
}
    .card-row-cutoff {
      font-size: 12px;
      font-weight: 650;
      color: var(--text);
      white-space: nowrap;
    }
    .card-row-actions {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .card-row-action {
      border: 1px solid var(--line);
      background: var(--surface-soft);
      color: var(--muted);
      border-radius: 999px;
      height: 28px;
      padding: 0 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
    }
    .card-row-action:hover {
      color: var(--text);
      border-color: var(--line-strong);
    }
    .card-row-action.danger {
      color: var(--red);
    }
    .card-row-action.danger:hover {
      border-color: color-mix(in srgb, var(--red) 35%, var(--line));
      background: color-mix(in srgb, var(--red) 8%, transparent);
    }
    .danger-zone {
      display: grid;
      gap: 12px;
      padding: 14px;
      border: 1px solid color-mix(in srgb, var(--red) 22%, var(--line));
      border-radius: 18px;
      background: color-mix(in srgb, var(--red) 5%, var(--surface-soft));
      margin-top: 14px;
    }
    .danger-zone-head {
      display: grid;
      gap: 4px;
    }
    .danger-zone-title {
      font-size: 15px;
      font-weight: 650;
      line-height: 1.2;
      color: var(--red);
    }
    .danger-zone-copy {
      font-size: 12px;
      line-height: 1.4;
      color: var(--muted);
      max-width: 640px;
    }
    .danger-zone-confirm {
      display: grid;
      gap: 10px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface-elevated);
    }
    .danger-zone-confirm[hidden] {
      display: none;
    }
    .danger-zone-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .center-entry:first-child { border-top: none; }
    .center-entry:hover { background: rgba(0,0,0,0.015); }
    .center-entry-icon { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: white; }
    .center-entry-main { min-width: 0; }
    .center-entry-title { font-size: 13px; font-weight: 600; line-height: 1.2; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .center-entry-meta { font-size: 11px; color: var(--muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .center-entry-amount { font-size: 12px; font-weight: 600; white-space: nowrap; text-align: right; }
    .center-entry-amount.income { color: var(--green); }
    .center-entry-amount.bill { color: var(--red); }
    .center-empty { padding: 14px; color: var(--muted); font-size: 12px; }

    .quick-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
    .quick-edit-note { color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 8px; }
    .refund-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      min-height: 20px;
      padding: 0 8px;
      border-radius: 999px;
      border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
      background: color-mix(in srgb, var(--green) 8%, var(--surface-elevated));
      color: var(--green);
      font-size: 10px;
      font-weight: 700;
      line-height: 1;
      vertical-align: middle;
    }
    .refund-pill.unmatched {
      color: var(--orange);
      border-color: color-mix(in srgb, var(--orange) 34%, var(--line));
      background: color-mix(in srgb, var(--orange) 10%, var(--surface-elevated));
    }
    .refund-child-row {
      margin-left: 48px;
      padding: 8px 6px 12px 6px;
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      border-bottom: 1px solid var(--line);
      color: var(--green);
      background: color-mix(in srgb, var(--green) 5%, transparent);
      border-radius: 0 0 12px 12px;
    }
    .refund-child-row .name { color: var(--text); font-size: 13px; }
    .refund-child-row .meta { color: var(--muted); }
    .refund-match-btn {
      height: 24px;
      padding: 0 8px;
      border-radius: 999px;
      border: 1px solid color-mix(in srgb, var(--orange) 32%, var(--line));
      background: color-mix(in srgb, var(--orange) 8%, var(--surface-elevated));
      color: var(--orange);
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 10px;
      font-weight: 800;
      cursor: pointer;
      white-space: nowrap;
    }
    .refund-match-btn:hover { background: color-mix(in srgb, var(--orange) 14%, var(--surface-elevated)); }
    .refund-parent-row { border-bottom-color: color-mix(in srgb, var(--green) 20%, var(--line)); }
    .refund-unmatched-row { background: color-mix(in srgb, var(--orange) 6%, transparent); }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(0, 0, 0, 0.18);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      padding: 18px;
      z-index: 50;
    }
    .modal-backdrop.open { display: flex; }
    .modal {
      width: min(680px, 100%);
      max-height: min(88vh, 960px);
      overflow: auto;
      overscroll-behavior: contain;
      background: var(--surface-elevated);
      border-radius: 24px;
      border: 1px solid rgba(17, 17, 17, 0.06);
      box-shadow: 0 28px 80px rgba(0, 0, 0, 0.12);
      padding: 22px;
    }
    .modal::-webkit-scrollbar {
      width: 10px;
    }
    .modal::-webkit-scrollbar-thumb {
      background: color-mix(in srgb, var(--muted) 28%, transparent);
      border-radius: 999px;
      border: 2px solid transparent;
      background-clip: padding-box;
    }
    .modal::-webkit-scrollbar-track {
      background: transparent;
    }
    .modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
    .modal-head h2 { font-size: 24px; letter-spacing: -0.04em; font-weight: 650; margin-bottom: 4px; }
    .modal-copy { color: var(--muted); font-size: 13px; line-height: 1.45; }

    .form { display: grid; gap: 16px; }
    .form-section { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-soft); }
    .form-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }
    .field { display: grid; gap: 7px; }
    .field.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .label { color: var(--muted); font-size: 12px; font-weight: 600; }

    .payment-toggle {
      display: inline-flex;
      align-items: center;
      padding: 2px;
      background: var(--surface-muted);
      border: 1px solid var(--line);
      border-radius: 999px;
      width: fit-content;
      gap: 2px;
    }
    .payment-toggle button {
      border: none;
      background: transparent;
      color: var(--muted);
      border-radius: 999px;
      height: 32px;
      padding: 0 12px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
    }
    .payment-toggle button.active { background: var(--surface-elevated); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.369); }

    .category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .category-option {
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      border-radius: 14px;
      padding: 10px 12px;
      display: grid;
      grid-template-columns: 28px 1fr;
      gap: 10px;
      align-items: center;
      cursor: pointer;
      transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
      text-align: left;
      min-height: 52px;
    }
    .category-option.active { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(0,0,0,0.04); background: var(--surface-soft); }
    .category-option-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: white; }
    .category-option-label { font-size: 13px; font-weight: 600; line-height: 1.2; }

    input, select, textarea {
      width: 100%;
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      color: var(--text);
      border-radius: 14px;
      padding: 13px 14px;
      outline: none;
    }
    textarea { min-height: 92px; resize: vertical; }
    input:focus, select:focus, textarea:focus { border-color: rgba(0, 113, 227, 0.28); box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.10); }
    .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; padding-top: 4px; }
    .sync-status {
      margin-top: 8px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
      min-height: 18px;
    }
    .sync-details {
      display: grid;
      gap: 10px;
      margin-top: 10px;
    }
    .sync-details[hidden] { display: none; }
    .sync-details-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .sync-detail-card {
      padding: 12px;
      border-radius: 14px;
      border: 1px solid var(--line);
      background: var(--surface-soft);
      display: grid;
      gap: 6px;
    }
    .sync-detail-label {
      color: var(--muted);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .sync-detail-value {
      font-size: 14px;
      font-weight: 650;
      line-height: 1.2;
      word-break: break-word;
    }
    .sync-payload-list {
      padding: 12px;
      border-radius: 14px;
      border: 1px solid var(--line);
      background: var(--surface-soft);
      display: grid;
      gap: 6px;
    }
    .sync-payload-item {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }
    .statement-summary {
      display: grid;
      gap: 14px;
    }
    .report-hero {
      padding: 16px;
      border-radius: 18px;
      border: 1px solid var(--line);
      background: var(--surface-soft);
      display: grid;
      gap: 10px;
    }
    .report-title-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }
    .report-title {
      font-size: 26px;
      line-height: 1;
      letter-spacing: -0.05em;
      font-weight: 800;
    }
    .report-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
    }
    .report-stat {
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface-elevated);
      display: grid;
      gap: 5px;
    }
    .report-label {
      color: var(--muted);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 800;
    }
    .report-value {
      font-size: 17px;
      line-height: 1.1;
      font-weight: 750;
      letter-spacing: -0.03em;
    }
    .report-section {
      display: grid;
      gap: 10px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--surface-soft);
    }
    .report-section-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }
    .report-section-title {
      font-size: 15px;
      font-weight: 750;
      letter-spacing: -0.02em;
    }
    .report-table {
      display: grid;
      gap: 0;
      border: 1px solid var(--line);
      border-radius: 14px;
      overflow: hidden;
      background: var(--surface-elevated);
    }
    .report-row {
      display: grid;
      grid-template-columns: 30px minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      padding: 10px 12px;
      border-top: 1px solid var(--line);
    }
    .report-row:first-child { border-top: none; }
    .report-row-title {
      font-size: 12px;
      font-weight: 700;
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .report-row-meta {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.25;
    }
    .report-row-amount {
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
      text-align: right;
    }
    .report-row-amount.income { color: var(--green); }
    .report-row-amount.bill { color: var(--red); }
    .report-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    @media (max-width: 800px) {
      .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    .statement-summary-top {
      display: grid;
      gap: 4px;
      padding: 14px;
      border-radius: 16px;
      background: var(--surface-soft);
      border: 1px solid var(--line);
    }
    .statement-summary-kicker {
      color: var(--muted);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .statement-summary-amount-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }
    .statement-summary-amount {
      font-size: 28px;
      font-weight: 700;
      letter-spacing: -0.05em;
      line-height: 1;
    }
    .statement-edit-btn {
      height: 28px;
      padding: 0 10px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      color: var(--muted);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
    }
    .statement-edit-btn:hover {
      color: var(--text);
      border-color: var(--line-strong);
    }
    .statement-due-edit {
      display: grid;
      gap: 6px;
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid var(--line);
    }
    .statement-due-edit[hidden] { display: none; }
    .statement-due-edit-row {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .statement-due-edit-input {
      width: 140px;
      max-width: 100%;
      padding: 8px 10px;
      text-align: right;
      font-size: 13px;
      font-weight: 650;
      border-radius: 10px;
    }
    .statement-due-edit-note {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.35;
    }
    .statement-summary-copy {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
    }
    .statement-summary-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .statement-analytics-grid {
      display: grid;
      grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.05fr);
      gap: 14px;
      align-items: stretch;
    }
    .statement-chart-card,
    .statement-insights-card,
    .statement-breakdown-card {
      padding: 14px;
      border-radius: 16px;
      background: var(--surface-soft);
      border: 1px solid var(--line);
    }
    .statement-chart-wrap {
      position: relative;
      min-height: 300px;
      height: 100%;
    }
    .statement-chart-wrap canvas {
      width: 100% !important;
      height: 100% !important;
      display: block;
    }
    .statement-insights-card {
      display: grid;
      gap: 10px;
      align-content: start;
    }
    .statement-insight-stat {
      padding: 12px;
      border-radius: 14px;
      background: var(--surface-elevated);
      border: 1px solid var(--line);
      display: grid;
      gap: 5px;
    }
    .statement-insight-label {
      color: var(--muted);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .statement-insight-value {
      font-size: 20px;
      font-weight: 700;
      letter-spacing: -0.04em;
      line-height: 1.05;
    }
    .statement-insight-copy {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }
    .statement-breakdown-card {
      display: grid;
      gap: 0;
      overflow: hidden;
      padding: 0;
    }
    .statement-breakdown-row {
      display: grid;
      grid-template-columns: 32px minmax(0, 1fr) auto 20px;
      gap: 10px;
      align-items: center;
      padding: 12px 14px;
      border-top: 1px solid var(--line);
      cursor: pointer;
      transition: background 160ms ease;
    }
    .statement-breakdown-row:hover {
      background: rgba(0,0,0,0.02);
    }
    .statement-breakdown-chevron {
      color: var(--muted);
      display: grid;
      place-items: center;
    }
    .statement-breakdown-details {
      display: none;
      padding: 0 14px 12px 56px;
      border-top: 1px solid var(--line);
      background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface-elevated));
    }
    .statement-breakdown-details.open {
      display: block;
    }
    .statement-breakdown-items {
      display: grid;
      gap: 8px;
      padding-top: 10px;
    }
    .statement-breakdown-item {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 12px;
      align-items: start;
      padding: 8px 0;
      border-top: 1px solid var(--line);
    }
    .statement-breakdown-item:first-child {
      border-top: none;
      padding-top: 0;
    }
    .statement-breakdown-item-title {
      font-size: 12px;
      font-weight: 600;
      line-height: 1.25;
      margin-bottom: 2px;
    }
    .statement-breakdown-item-meta {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.3;
    }
    .statement-breakdown-item-amount {
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
      text-align: right;
    }
    .statement-breakdown-row:first-child {
      border-top: none;
    }
    .statement-breakdown-icon {
      width: 26px;
      height: 26px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      color: white;
    }
    .statement-breakdown-title {
      font-size: 13px;
      font-weight: 650;
      line-height: 1.2;
      margin-bottom: 2px;
    }
    .statement-breakdown-meta {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.25;
    }
    .statement-breakdown-value {
      text-align: right;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.2;
      white-space: nowrap;
    }
    .statement-summary-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .statement-summary-stat {
      padding: 12px;
      background: var(--surface-soft);
      border: 1px solid var(--line);
      border-radius: 14px;
      display: grid;
      gap: 6px;
    }
    .statement-summary-stat-label {
      color: var(--muted);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
    }
    .statement-summary-stat-value {
      font-size: 15px;
      font-weight: 650;
      letter-spacing: -0.02em;
      line-height: 1.15;
    }
    .statement-summary-list {
      display: grid;
      gap: 0;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--surface-soft);
      overflow: hidden;
    }
    .statement-summary-row {
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr) auto auto;
      gap: 10px;
      align-items: center;
      padding: 12px 14px;
      border-top: 1px solid var(--line);
    }
    .statement-summary-row:first-child { border-top: none; }
    .statement-summary-icon {
      width: 24px;
      height: 24px;
      border-radius: 7px;
      display: grid;
      place-items: center;
      color: white;
    }
    .statement-summary-row-title {
      font-size: 13px;
      font-weight: 600;
      line-height: 1.2;
      margin-bottom: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .statement-summary-row-meta {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .statement-summary-row-amount {
      font-size: 12px;
      font-weight: 650;
      white-space: nowrap;
      color: var(--red);
    }
    .statement-summary-row-input {
      width: 120px;
      max-width: 100%;
      padding: 8px 10px;
      text-align: right;
      font-size: 12px;
      font-weight: 650;
      border-radius: 10px;
    }

.linked-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #1E6EF4 24%, var(--line));
  background: color-mix(in srgb, #1E6EF4 8%, var(--surface-elevated));
  color: #1E6EF4;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

/* ==========================
   Prediction Rows v2
   ========================== */

.cf-prediction-row {
  --prediction-accent: var(--orange);
  --prediction-pill-bg: color-mix(in srgb, var(--prediction-accent) 12%, var(--surface-elevated));
  background: var(--prediction-bg);
  border-radius: 14px;
  border-bottom-color: transparent;
}

.cf-prediction-row:hover {
  background: color-mix(in srgb, var(--prediction-accent) 10%, transparent);
}

.cf-prediction-icon-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
}

/* Snake border */
.cf-prediction-icon-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  padding: 1px;

  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--prediction-accent) 25%,
    transparent 50%
  );
  background-size: 200% 200%;

  /* Keep only border */
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;

  animation: snakeMove 10s linear infinite;
  pointer-events: none;
}

@keyframes snakeMove {
  0% {
    background-position: 0% 50%;
  }
  25% {
    background-position: 100% 50%;
  }
  50% {
    background-position: 100% 100%;
  }
  75% {
    background-position: 0% 100%;
  }
  100% {
    background-position: 0% 50%;
  }
}
.cf-prediction-title-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.cf-prediction-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-prediction-pill {
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--prediction-accent) 28%, var(--line));
  background: var(--prediction-pill-bg);
  color: var(--prediction-accent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}

.cf-prediction-pill .lucide,
.cf-prediction-pill i {
  width: 11px;
  height: 11px;
}

.cf-prediction-meta-note {
  color: var(--prediction-accent);
  font-weight: 700;
}

.cf-prediction-toggle {
  position: relative;
}

.cf-prediction-toggle.active {
  color: var(--purple);
  border-color: color-mix(in srgb, var(--purple) 30%, var(--line));
  background: color-mix(in srgb, var(--purple) 8%, var(--surface-elevated));
}

.cf-prediction-toggle.hidden-predictions {
  color: var(--muted);
  border-color: color-mix(in srgb, var(--purple) 24%, var(--line));
  background: color-mix(in srgb, var(--purple) 5%, var(--surface-elevated));
}
.cf-prediction-toggle.has-hidden-predictions::after {
  content: attr(data-hidden-count);
  position: absolute;
  right: -6px;
  top: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #fff;
  border: 2px solid var(--surface-muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

@keyframes cfPredictionIconBreath {
  0%, 100% { transform: scale(0.94); opacity: 0.45; }
  50% { transform: scale(1.08); opacity: 0.95; }
}

@media (prefers-reduced-motion: reduce) {
  .cf-prediction-icon-wrap::before {
    animation: none;
  }
}
    .quick-edit-link-card {
      display: none;
      margin-top: 12px;
      padding: 12px;
      border-radius: 14px;
      border: 1px solid color-mix(in srgb, #1E6EF4 24%, var(--line));
      background: color-mix(in srgb, #1E6EF4 7%, var(--surface-soft));
      gap: 10px;
      align-items: center;
      justify-content: space-between;
    }
    .quick-edit-link-card.visible {
      display: flex;
    }
    .quick-edit-link-copy {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }
    .link-transaction-list {
      display: grid;
      gap: 8px;
      max-height: 360px;
      overflow: auto;
    }
    .link-transaction-option {
      border: 1px solid var(--line);
      background: var(--surface-elevated);
      border-radius: 14px;
      padding: 12px;
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      text-align: left;
      color: var(--text);
      cursor: pointer;
    }
    .link-transaction-option:hover,
    .link-transaction-option.active {
      border-color: color-mix(in srgb, #1E6EF4 35%, var(--line));
      background: color-mix(in srgb, #1E6EF4 7%, var(--surface-elevated));
    }

    .import-upload-zone {
      border: 1px dashed var(--line-strong);
      border-radius: 16px;
      background: var(--surface-elevated);
      padding: 18px;
      display: grid;
      gap: 10px;
    }
    .import-upload-row {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    .import-helper {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
    }
    .import-file-name {
      font-size: 12px;
      font-weight: 600;
      color: var(--text);
    }
    .mapping-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }
    .mapping-card {
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface-elevated);
      display: grid;
      gap: 8px;
    }
    .mapping-label {
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .import-table-wrap {
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--surface-elevated);
      overflow: hidden;
    }
    .import-table-scroll {
      max-height: 340px;
      overflow: auto;
    }

    .lock-screen-status.loading {
  color: #f59e0b;
  font-weight: 500;
}

    .import-table {
      width: 100%;
      border-collapse: collapse;
      min-width: 760px;
    }
    .import-table th,
    .import-table td {
      padding: 10px 12px;
      border-bottom: 1px solid var(--line);
      text-align: left;
      font-size: 12px;
      vertical-align: top;
    }
    .import-table th {
      position: sticky;
      top: 0;
      z-index: 1;
      background: var(--surface-soft);
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-size: 10px;
      font-weight: 700;
    }
    .import-table tr:last-child td { border-bottom: none; }
    .import-table td.amount-cell {
      font-weight: 700;
      white-space: nowrap;
    }
    .import-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      height: 28px;
      padding: 0 10px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--surface-soft);
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
    }
    .import-empty {
      padding: 18px;
      color: var(--muted);
      font-size: 12px;
      text-align: center;
    }
    .import-row-disabled {
      opacity: 0.6;
    }
    .import-replace-settings,
    .advanced-settings-panel {
      display: grid;
      gap: 10px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface-elevated);
    }
    .import-replace-settings[hidden],
    .advanced-settings-panel[hidden] {
      display: none;
    }
    .advanced-toggle-btn {
      width: fit-content;
      justify-self: start;
    }

    .lucide {
      width: 14px;
      height: 14px;
      stroke-width: 2;
    }

    .test-status { display: none; }

    @media (max-width: 800px) {
      .budget-head { display: none; }
      .budget-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px 14px;
        padding: 14px 6px;
      }
      .budget-month { grid-column: 1 / -1; }
      .budget-cell { text-align: left; }
      .budget-cell::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        font-weight: 700;
        margin-bottom: 4px;
      }
      .budget-cell-value { white-space: normal; }
      .budget-head { display: none; }
      .budget-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px 14px;
        padding: 14px 6px;
      }
      .budget-month { grid-column: 1 / -1; }
      .budget-cell { text-align: left; }
      .budget-cell::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        font-weight: 700;
        margin-bottom: 4px;
      }
      .budget-cell-value { white-space: normal; }
      .mapping-grid { grid-template-columns: 1fr; }
      .statement-info-grid { grid-template-columns: 1fr; }
      .statement-analytics-grid { grid-template-columns: 1fr; }
      .statement-chart-wrap { min-height: 260px; }
      .modal {
        max-height: calc(100vh - 24px);
        border-radius: 20px;
        padding: 18px;
      }
      .sticky-status-wrap {
        left: 16px;
        right: 16px;
        bottom: 14px;
        transform: none;
        display: flex;
        justify-content: center;
      }
      .mini-status {
        width: 100%;
        max-width: 100%;
      }
      body { padding: 14px; }

      .topbar { align-items: stretch; }
      .app-brand-row { align-items: center; }
      .app-logo { width: 40px; height: 40px; border-radius: 14px; }
      h1 { font-size: 32px; }
      .floating-menu { width: 100%; justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
      .floating-menu::-webkit-scrollbar { display: none; }
      .menu-btn { min-width: 42px; padding: 0 10px; }
      .menu-label { display: none; }
      .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .row { grid-template-columns: 32px minmax(0, 1fr); }
      .row-amount { grid-column: 2; text-align: left; padding-left: 0; margin-top: 2px; }
      .field.two, .quick-edit-grid, .category-grid { grid-template-columns: 1fr; }
      .topbar, .toolbar { flex-direction: column; align-items: stretch; }
      .header-actions { justify-content: flex-start; }
      .center-section-head { grid-template-columns: 40px 1fr; }
      .center-action-btn { grid-column: 2; justify-self: start; }
      .center-entry { grid-template-columns: 24px minmax(0, 1fr); }
      .center-entry-amount { grid-column: 2; }
      .health-hero { grid-template-columns: 1fr; }
      .health-score-card { grid-template-columns: 1fr; }
      .health-gauge-wrap,
      .health-gauge-wrap canvas { width: 120px !important; height: 120px !important; }
      .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .summary-head { display: none; }
      .summary-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px 14px;
        padding: 14px 6px;
      }
      .summary-month { grid-column: 1 / -1; }
      .summary-cell { text-align: left; }
      .summary-cell::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        font-weight: 700;
        margin-bottom: 4px;
      }

      html body {
  background: var(--bg);
  color: var(--text);
}

.lock-screen .lock-card,
#appRoot.app {
  background: var(--card);
  color: var(--text);
}

header.top {
  border-bottom: 1px solid var(--border);
}

button.primary {
  background: var(--primary);
  color: #fff;
}

button.ghost {
  background: transparent;
  color: var(--text);
}

    }
