/* noguilt.money — design system */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  /* Canvas + ink */
  --canvas: oklch(98.5% 0.003 90);
  --canvas-2: oklch(96.8% 0.004 90);
  --canvas-3: oklch(94.5% 0.005 90);
  --surface: #ffffff;
  --ink: oklch(18% 0.01 260);
  --ink-2: oklch(38% 0.01 260);
  --ink-3: oklch(58% 0.01 260);
  --ink-4: oklch(78% 0.008 260);
  --hairline: oklch(91% 0.005 90);
  --hairline-2: oklch(86% 0.006 90);

  /* Brand */
  --brand: oklch(62% 0.14 155);
  --brand-ink: oklch(28% 0.08 155);
  --brand-tint: oklch(94% 0.04 155);
  --brand-tint-2: oklch(88% 0.07 155);

  /* Rails — matching chroma 0.10, lightness 62% */
  --fixed: oklch(58% 0.04 250);
  --fixed-tint: oklch(94% 0.018 250);
  --buffer: oklch(70% 0.12 75);
  --buffer-tint: oklch(95% 0.04 75);
  --wealth: oklch(62% 0.12 175);
  --wealth-tint: oklch(94% 0.035 175);
  --float: oklch(62% 0.14 155);
  --float-tint: oklch(94% 0.04 155);

  /* Status — never aggressive red */
  --warn: oklch(68% 0.13 55);
  --warn-tint: oklch(95% 0.04 55);
  --danger: oklch(58% 0.13 25);
  --danger-tint: oklch(94% 0.035 25);

  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px oklch(20% 0.01 260 / 0.04);
  --shadow: 0 1px 3px oklch(20% 0.01 260 / 0.06), 0 8px 24px -12px oklch(20% 0.01 260 / 0.08);
  --shadow-lg: 0 1px 3px oklch(20% 0.01 260 / 0.06), 0 24px 48px -16px oklch(20% 0.01 260 / 0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Geist', -apple-system, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
  letter-spacing: -0.005em;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.mono, .num { font-family: 'Geist Mono', ui-monospace, monospace; font-feature-settings: 'tnum'; letter-spacing: -0.02em; }

/* App shell — desktop = sidebar, mobile = bottom tabs */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}
.app.mobile { display: block; grid-template-columns: 1fr; }
.app.mobile .main { display: none; }

/* Sidebar */
.sidebar {
  background: var(--canvas);
  border-right: 1px solid var(--hairline);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand-mark {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 24px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.brand-mark .logo {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--canvas);
  display: grid; place-items: center;
  font-family: 'Geist Mono'; font-weight: 600; font-size: 14px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--canvas-2); color: var(--ink); }
.nav-item.active { background: var(--ink); color: var(--canvas); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-spacer { flex: 1; }
.nav-section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 16px 12px 6px;
}
.household-card {
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--canvas-2);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: white;
}

/* Main */
.main {
  min-width: 0;
  padding: 32px 40px 80px;
  max-width: 1200px;
  width: 100%;
}
.app.mobile .main {
  padding: 16px 16px 96px;
}

/* Page header */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.page-head .sub {
  color: var(--ink-3);
  font-size: 14px;
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--hairline-2);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.btn:hover { background: var(--canvas-2); border-color: var(--ink-4); }
.btn-primary {
  background: var(--ink);
  color: var(--canvas);
  border-color: var(--ink);
}
.btn-primary:hover { background: oklch(28% 0.01 260); border-color: oklch(28% 0.01 260); }
.btn-brand {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}
.btn-brand:hover { background: oklch(56% 0.14 155); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--canvas-2); }
.btn-sm { padding: 6px 10px; font-size: 12px; gap: 6px; border-radius: 8px; }
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  display: grid; place-items: center;
}
.btn svg { width: 16px; height: 16px; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 20px;
}
.card-tight { padding: 14px; }

/* Hero — Safe to Spend */
.hero {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.hero-label {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-amount {
  font-family: 'Geist'; /* not mono — this one breathes */
  font-size: 88px;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  margin: 14px 0 8px;
  font-feature-settings: 'tnum';
}
.app.mobile .hero { padding: 22px 18px 18px; }
.app.mobile .hero-amount { font-size: 64px; line-height: 0.95; }
.app.mobile .hero-meta { gap: 12px; font-size: 12px; margin-top: 10px; }
.app.mobile .hero-status { gap: 6px; margin-top: 14px; }
.app.mobile .hero-status .pill { font-size: 10px; padding: 3px 8px; }
.hero-amount .cents { font-size: 0.5em; color: var(--ink-3); font-weight: 400; }
.hero-meta {
  display: flex; gap: 24px; flex-wrap: wrap;
  color: var(--ink-2);
  font-size: 13px;
  margin-top: 4px;
}
.hero-meta strong { color: var(--ink); font-weight: 500; }
.hero-status {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 20px;
}

/* Status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--canvas-2);
  color: var(--ink-2);
}
.pill-ok { background: var(--brand-tint); color: var(--brand-ink); }
.pill-warn { background: var(--warn-tint); color: oklch(45% 0.13 55); }
.pill-fixed { background: var(--fixed-tint); color: oklch(35% 0.05 250); }
.pill-buffer { background: var(--buffer-tint); color: oklch(45% 0.13 75); }
.pill-wealth { background: var(--wealth-tint); color: oklch(35% 0.1 175); }
.pill-float { background: var(--float-tint); color: var(--brand-ink); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Rails grid */
.rails {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.app.mobile .rails { grid-template-columns: repeat(2, 1fr); }

.rail {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.15s;
}
.rail:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--hairline-2); }
.rail-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.rail-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rail-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 14px;
}
.rail-amount {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.025em;
  font-feature-settings: 'tnum';
}
.rail-amount .cents { color: var(--ink-3); font-size: 0.65em; }
.rail-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}
.rail-bar {
  height: 4px;
  background: var(--canvas-2);
  border-radius: 2px;
  margin-top: 14px;
  overflow: hidden;
}
.rail-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.rail-fixed .rail-icon { background: var(--fixed-tint); color: oklch(35% 0.05 250); }
.rail-fixed .rail-bar-fill { background: var(--fixed); }
.rail-buffer .rail-icon { background: var(--buffer-tint); color: oklch(45% 0.13 75); }
.rail-buffer .rail-bar-fill { background: var(--buffer); }
.rail-wealth .rail-icon { background: var(--wealth-tint); color: oklch(35% 0.1 175); }
.rail-wealth .rail-bar-fill { background: var(--wealth); }
.rail-float .rail-icon { background: var(--float-tint); color: var(--brand-ink); }
.rail-float .rail-bar-fill { background: var(--float); }

/* Section */
.section {
  margin-top: 36px;
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-head .link {
  color: var(--ink-3);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.section-head .link:hover { color: var(--ink); }

/* Lists */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.12s;
}
.list-item:hover { background: var(--canvas-2); }
.list-item:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.list-item:last-child { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); border-bottom: 1px solid var(--hairline); }
.list { border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.list .list-item { border-left: none; border-right: none; }
.list .list-item:first-child { border-top: none; }
.list .list-item:last-child { border-bottom: none; }

.list-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--canvas-2);
  flex-shrink: 0;
  font-size: 14px;
}
.list-main { flex: 1; min-width: 0; }
.list-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}
.list-amount {
  font-size: 14px;
  font-weight: 500;
  font-family: 'Geist Mono';
  font-feature-settings: 'tnum';
  letter-spacing: -0.02em;
}

/* Mobile bottom tab bar */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: oklch(99% 0.002 90 / 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--hairline);
  display: flex;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}
.tabbar button {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 500;
}
.tabbar button.active { color: var(--ink); }
.tabbar button svg { width: 22px; height: 22px; }

/* Mobile header */
.mobile-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px 18px;
}
.mobile-head .greet { font-size: 14px; color: var(--ink-3); font-weight: 500; }
.mobile-head .greet strong { color: var(--ink); font-weight: 500; }

/* Calendar */
.cal {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--hairline);
}
.cal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-dow {
  padding: 10px;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
}
.cal-cell {
  min-height: 92px;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
  cursor: pointer;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.other-month { background: var(--canvas-2); color: var(--ink-4); }
.cal-cell.today .cal-date { background: var(--ink); color: var(--canvas); }
.cal-cell.selected { background: color-mix(in oklch, var(--brand) 6%, var(--canvas)); box-shadow: inset 0 0 0 1.5px var(--brand); }
.cal-date {
  font-size: 12px;
  font-weight: 500;
  font-family: 'Geist Mono';
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  margin-bottom: 2px;
}
.cal-event {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  font-family: 'Geist Mono';
  font-feature-settings: 'tnum';
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event.bill { background: var(--fixed-tint); color: oklch(30% 0.05 250); }
.cal-event.income { background: var(--brand-tint); color: var(--brand-ink); }
.cal-event.warn { background: var(--warn-tint); color: oklch(40% 0.13 55); }

.app.mobile .cal-cell { min-height: 56px; padding: 4px; }
.app.mobile .cal-event { font-size: 9px; padding: 1px 4px; }

/* Bills */
.bills-tabs {
  display: flex; gap: 4px;
  padding: 4px;
  background: var(--canvas-2);
  border-radius: 10px;
  width: fit-content;
  margin-bottom: 18px;
}
.bills-tabs button {
  padding: 7px 14px;
  border-radius: 7px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
}
.bills-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.bill-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; align-items: center; gap: 16px;
  transition: border-color 0.15s, transform 0.15s;
}
.bill-card:hover { border-color: var(--hairline-2); }
.bill-logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
  font-family: 'Geist Mono';
}
.bill-info { flex: 1; min-width: 0; }
.bill-name { font-size: 15px; font-weight: 500; }
.bill-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bill-amount { font-size: 18px; font-weight: 500; font-family: 'Geist Mono'; font-feature-settings: 'tnum'; letter-spacing: -0.02em; }
.bill-state {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.bill-state.auto { background: var(--brand-tint); color: var(--brand-ink); }
.bill-state.manual { background: var(--canvas-2); color: var(--ink-2); }
.bill-state.due { background: var(--warn-tint); color: oklch(40% 0.13 55); }
.bill-state.paid { background: var(--canvas-2); color: var(--ink-3); }

/* Toggle */
.toggle {
  width: 36px; height: 20px;
  background: var(--canvas-3);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
  flex-shrink: 0;
  border: none;
  padding: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 2px oklch(20% 0.01 260 / 0.15);
}
.toggle.on { background: var(--brand); }
.toggle.on::after { transform: translateX(16px); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(20% 0.01 260 / 0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid; place-items: center;
  padding: 16px;
  animation: fadeIn 0.18s ease-out;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--hairline);
}
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-body { padding: 22px; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 22px;
  border-top: 1px solid var(--hairline);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Field */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}
.field input, .field select, .field textarea {
  padding: 10px 12px;
  border: 1px solid var(--hairline-2);
  border-radius: 10px;
  font-size: 14px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px oklch(20% 0.01 260 / 0.06);
}

/* Slider */
.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--canvas-3);
  border-radius: 2px;
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--hairline-2);
}
.slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--ink); cursor: pointer; border: 2px solid white;
}

/* Two-col layout */
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-top: 18px;
}
.app.mobile .two-col { grid-template-columns: 1fr; }

/* Insights */
.insight {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--canvas-2);
  border: 1px solid var(--hairline);
}
.insight-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--surface);
}
.insight-body { flex: 1; }
.insight-title { font-size: 14px; font-weight: 500; }
.insight-body p { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* Onboarding */
.onb {
  position: fixed;
  inset: 0;
  background: var(--canvas);
  z-index: 200;
  display: flex; flex-direction: column;
  animation: fadeIn 0.3s;
}
.onb-bar {
  height: 3px;
  background: var(--canvas-3);
  position: relative;
}
.onb-bar-fill {
  position: absolute;
  inset-block: 0; left: 0;
  background: var(--brand);
  transition: width 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.onb-body {
  flex: 1;
  overflow: auto;
  padding: 48px 24px;
  display: flex; flex-direction: column; align-items: center;
}
.onb-content {
  width: 100%;
  max-width: 480px;
}
.onb-eyebrow {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.onb-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 12px;
}
.onb-sub {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 32px;
}
.onb-foot {
  display: flex; gap: 10px; justify-content: space-between;
  padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  background: var(--canvas);
}

.bank-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bank-opt {
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  text-align: left;
}
.bank-opt:hover { border-color: var(--ink-4); }
.bank-opt.selected { border-color: var(--ink); box-shadow: 0 0 0 3px oklch(20% 0.01 260 / 0.06); }
.bank-logo { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-weight: 600; color: white; font-size: 12px; font-family: 'Geist Mono'; }
.bank-name { font-size: 13px; font-weight: 500; }

/* Rule builder */
.rule-line {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--canvas-2);
  border-radius: 10px;
  font-size: 14px;
  flex-wrap: wrap;
}
.rule-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.rule-chip:hover { border-color: var(--ink-4); }
.rule-chip.active { background: var(--ink); color: var(--canvas); border-color: var(--ink); }

/* Activity timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--hairline-2);
}
.tl-item {
  position: relative;
  padding-bottom: 18px;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -19px;
  top: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--ink-4);
}
.tl-item.brand::before { border-color: var(--brand); }
.tl-time { font-size: 11px; color: var(--ink-3); font-family: 'Geist Mono'; }
.tl-title { font-size: 13px; margin-top: 2px; }

/* Spend page */
.spend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
.app.mobile .spend-grid { grid-template-columns: 1fr; }
.metric {
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
}
.metric-label { font-size: 12px; color: var(--ink-3); }
.metric-value { font-size: 22px; font-weight: 500; margin-top: 4px; font-feature-settings: 'tnum'; }
.metric-delta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.metric-delta.up { color: var(--brand-ink); }
.metric-delta.down { color: oklch(45% 0.13 55); }

/* Drawer (mobile detail) */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: oklch(20% 0.01 260 / 0.4);
  z-index: 90;
  animation: fadeIn 0.2s;
}
.drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  z-index: 100;
  max-height: 85vh;
  overflow: auto;
  animation: slideUp 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.drawer-grip { width: 36px; height: 4px; background: var(--canvas-3); border-radius: 2px; margin: 10px auto 0; }

/* Empty state */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-3);
  font-size: 14px;
}

/* Misc */
.kbd {
  font-family: 'Geist Mono';
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--hairline-2);
  border-radius: 4px;
  background: var(--canvas-2);
  color: var(--ink-2);
}
.divider { height: 1px; background: var(--hairline); margin: 18px 0; }
.row { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.tnum { font-feature-settings: 'tnum'; }

/* Sparkline chart */
.spark { width: 100%; height: 64px; }
.chart { width: 100%; height: 200px; }

/* Account chips on transactions */
.acct-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px;
  color: var(--ink-3);
  padding: 2px 7px;
  background: var(--canvas-2);
  border-radius: 5px;
}

/* Search */
.search {
  position: relative;
  flex: 1;
  max-width: 320px;
}
.search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid var(--hairline-2);
  border-radius: 10px;
  font-size: 13px;
  background: var(--surface);
}
.search svg {
  position: absolute;
  left: 11px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--ink-3);
}

/* Misc transitions */
.fade-in { opacity: 1; }

/* Filter chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { background: var(--canvas-2); border-color: var(--hairline-2); }
.chip-active {
  background: var(--ink);
  color: var(--canvas);
  border-color: var(--ink);
}
.chip-active:hover { background: var(--ink); color: var(--canvas); }
.chip .muted { opacity: 0.7; }
.chip-active .muted { color: oklch(85% 0.005 90); opacity: 0.7; }

.btn-warn {
  background: oklch(72% 0.13 55);
  color: #fff;
  border-color: oklch(72% 0.13 55);
}
.btn-warn:hover { background: oklch(66% 0.13 55); border-color: oklch(66% 0.13 55); }

/* Connect bank step */
.feature-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
}
.feature-row + .feature-row { border-top: 1px solid var(--hairline); }
.feature-row svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--brand); }
.feature-row strong { font-size: 14px; font-weight: 500; }
.feature-row p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.5; }

/* Placeholder pattern */
.placeholder-img {
  background: repeating-linear-gradient(45deg, var(--canvas-2), var(--canvas-2) 8px, var(--canvas-3) 8px, var(--canvas-3) 16px);
  border-radius: var(--radius);
  display: grid; place-items: center;
  color: var(--ink-3);
  font-family: 'Geist Mono';
  font-size: 11px;
}

/* Responsive */
@media (max-width: 880px) {
  .sidebar { display: none; }
}


/* ============ AI Command Bar ============ */
.ai-cmd-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--canvas);
  padding: 16px 0 14px;
  margin: -32px -40px 18px;
  padding-left: 40px;
  padding-right: 40px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ai-cmd-bar.scrolled {
  border-bottom-color: var(--hairline);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.app.mobile .ai-cmd-bar {
  margin: -16px -16px 14px;
  padding: 12px 16px;
}
.ai-cmd-input-wrap {
  position: relative;
}
.ai-cmd-input {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02), 0 4px 14px rgba(0,0,0,0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ai-cmd-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-tint), 0 4px 14px rgba(0,0,0,0.05);
}
.ai-cmd-icon {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--brand-tint), var(--brand-tint-2));
  color: var(--brand-ink);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ai-cmd-input input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  min-width: 0;
}
.ai-cmd-input input::placeholder {
  color: var(--ink-3);
}
.ai-cmd-kbd {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  padding: 3px 6px;
  background: var(--canvas-2);
  border-radius: 4px;
  color: var(--ink-3);
  border: 1px solid var(--hairline);
}

.ai-cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 30, 0.18);
  z-index: 25;
  animation: fadeIn 0.15s ease-out;
}
.ai-cmd-panel {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 32px));
  max-height: 70vh;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 4px 14px rgba(0,0,0,0.06);
  z-index: 28;
  overflow: hidden;
  animation: slideDown 0.18s ease-out;
}
.app.mobile .ai-cmd-panel {
  top: 60px;
  width: calc(100vw - 24px);
  max-height: 60vh;
}
@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.ai-cmd-thread {
  padding: 18px;
  overflow-y: auto;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-cmd-quick {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--canvas-2);
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  color: var(--ink-2);
  transition: all 0.12s;
}
.ai-cmd-quick:hover {
  border-color: var(--brand);
  color: var(--ink);
  background: var(--brand-tint);
}

.ai-cmd-user-msg {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
.ai-cmd-ai-msg {
  display: flex; align-items: flex-start; gap: 10px;
}
.ai-cmd-avatar {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--brand-tint), var(--brand-tint-2));
  color: var(--brand-ink);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.ai-cmd-busy {
  display: flex; align-items: center;
  padding: 6px 0 0 32px;
}
.ai-cmd-busy .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  margin-right: 4px;
  animation: bounce 1.2s infinite ease-in-out;
}
.ai-cmd-busy .dot:nth-child(2) { animation-delay: 0.15s; }
.ai-cmd-busy .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* =============================================================
   Plaid Connect Flow
   ============================================================= */
.plaid-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(15% 0.01 260 / 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  animation: fadeIn 0.2s ease-out;
}
.plaid-sheet {
  background: var(--surface);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px oklch(15% 0.01 260 / 0.25), 0 4px 14px oklch(15% 0.01 260 / 0.08);
  animation: plaidPop 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes plaidPop {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.plaid-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 10px;
  flex-shrink: 0;
}
.plaid-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.plaid-head-title {
  flex: 1;
  min-width: 0;
}
.plaid-head-app {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.plaid-head-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--canvas);
  display: grid; place-items: center;
  font-family: 'Geist Mono'; font-weight: 600; font-size: 12px;
}
.plaid-bank-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--canvas-2);
  font-size: 13px;
  font-weight: 500;
}
.plaid-bank-logo {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: 'Geist Mono';
  font-size: 10px;
  font-weight: 600;
  color: white;
}
.plaid-icon-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--ink-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.plaid-icon-btn:hover { background: var(--canvas-2); color: var(--ink); }

/* Progress bar */
.plaid-progress {
  height: 3px;
  background: var(--canvas-2);
  position: relative;
  overflow: hidden;
}
.plaid-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--brand);
  transition: width 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Body */
.plaid-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 28px 8px;
}
.plaid-step {
  padding: 18px 0 8px;
  animation: plaidFade 0.3s ease-out;
}
@keyframes plaidFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typography */
.plaid-h {
  margin: 18px 0 8px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}
.plaid-h-sm {
  margin: 6px 0 6px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
  text-wrap: balance;
}
.plaid-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 22px;
  text-wrap: pretty;
}
.plaid-sub-sm {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-3);
  margin: 0 0 18px;
  text-wrap: pretty;
}
.plaid-label-sm {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 10px 0 8px;
}

/* Buttons */
.plaid-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  background: var(--ink);
  color: var(--canvas);
  border: 1px solid var(--ink);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.08s;
}
.plaid-btn-primary:hover:not(:disabled) { background: oklch(28% 0.01 260); }
.plaid-btn-primary:active:not(:disabled) { transform: translateY(1px); }
.plaid-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.plaid-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.plaid-btn-secondary:hover { background: var(--canvas-2); border-color: var(--ink-4); }

.plaid-link {
  background: none;
  border: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--ink-4);
  transition: color 0.15s;
}
.plaid-link:hover { color: var(--ink); }

/* Footer */
.plaid-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 12px 16px;
  border-top: 1px solid var(--hairline);
  background: var(--canvas);
  font-size: 11px;
  color: var(--ink-3);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.plaid-foot-sep { color: var(--ink-4); }
.plaid-lock { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.plaid-secured strong {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.plaid-foot-cta {
  margin-top: 22px;
}
.plaid-disclaimer {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.5;
  margin-top: 14px;
  text-wrap: pretty;
  text-align: center;
}

/* Intro */
.plaid-step-intro {
  text-align: left;
}
.plaid-intro-art {
  position: relative;
  height: 140px;
  margin: 6px -28px 4px;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 40%, oklch(94% 0.04 155) 0%, transparent 50%),
    radial-gradient(circle at 20% 70%, oklch(92% 0.05 250) 0%, transparent 50%),
    var(--canvas);
}
.plaid-intro-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.6;
}
.plaid-intro-orb-a {
  width: 160px; height: 160px;
  background: oklch(70% 0.18 155);
  top: -40px; right: -20px;
}
.plaid-intro-orb-b {
  width: 140px; height: 140px;
  background: oklch(60% 0.16 250);
  bottom: -50px; left: -30px;
}
.plaid-intro-stack {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.plaid-intro-card {
  width: 130px; height: 80px;
  border-radius: 10px;
  padding: 12px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 24px oklch(20% 0.01 260 / 0.18);
  transform: rotate(-6deg) translateX(8px);
  position: relative;
  overflow: hidden;
}
.plaid-intro-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, oklch(100% 0 0 / 0.15) 0%, transparent 60%);
  pointer-events: none;
}
.plaid-intro-card-name {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  opacity: 0.85;
}
.plaid-intro-card-mask {
  font-family: 'Geist Mono';
  font-size: 11px;
  letter-spacing: 0.04em;
}
.plaid-intro-link {
  width: 56px;
  height: 2px;
  background: repeating-linear-gradient(to right, var(--ink-3) 0 4px, transparent 4px 8px);
  margin: 0 8px;
  position: relative;
  z-index: 1;
}
.plaid-intro-link::before, .plaid-intro-link::after {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink);
  top: 50%;
  transform: translateY(-50%);
}
.plaid-intro-link::before { left: -2px; }
.plaid-intro-link::after  { right: -2px; background: var(--brand); }
.plaid-intro-app {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 8px 24px oklch(20% 0.01 260 / 0.12);
  transform: rotate(3deg);
}
.plaid-intro-app-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--canvas);
  display: grid; place-items: center;
  font-family: 'Geist Mono'; font-weight: 600; font-size: 13px;
}

.plaid-facts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}
.plaid-fact {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.plaid-fact-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--brand-tint);
  color: var(--brand-ink);
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.plaid-fact-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.plaid-fact-body {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  text-wrap: pretty;
}

/* Search step */
.plaid-search {
  position: relative;
  margin-bottom: 8px;
}
.plaid-search svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
}
.plaid-search input {
  width: 100%;
  padding: 13px 14px 13px 38px;
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  font-size: 14px;
  background: var(--canvas-2);
  color: var(--ink);
  outline: none;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.plaid-search input:focus {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.plaid-search input::placeholder { color: var(--ink-3); }

.plaid-inst-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.plaid-inst-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.plaid-inst-tile:hover {
  background: var(--canvas-2);
  border-color: var(--hairline);
}
.plaid-inst-tile:active { transform: translateY(1px); }
.plaid-inst-logo {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: white;
  font-family: 'Geist Mono';
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.plaid-inst-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.plaid-inst-tile svg:last-child {
  color: var(--ink-3);
}

.plaid-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--ink-3);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* Sign-in step */
.plaid-bank-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border-radius: 14px;
  color: white;
  margin-bottom: 4px;
  position: relative;
  overflow: hidden;
}
.plaid-bank-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, oklch(100% 0 0 / 0.10) 0%, transparent 60%);
  pointer-events: none;
}
.plaid-bank-hero-mark {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: oklch(100% 0 0 / 0.18);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  font-family: 'Geist Mono';
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.plaid-field {
  margin-bottom: 14px;
}
.plaid-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.plaid-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--hairline-2);
  border-radius: 10px;
  font-size: 14px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.plaid-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

.plaid-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--warn-tint);
  color: oklch(40% 0.13 55);
  border-radius: 10px;
  font-size: 12px;
  margin-top: 8px;
}

/* MFA step */
.plaid-mfa-art {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--brand-tint);
  color: var(--brand-ink);
  display: grid; place-items: center;
  margin: 8px auto 18px;
}
.plaid-code {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 22px 0 14px;
}
.plaid-code-cell {
  width: 44px; height: 54px;
  border: 1.5px solid var(--hairline-2);
  border-radius: 10px;
  background: var(--surface);
  font-family: 'Geist Mono';
  font-size: 22px;
  font-weight: 500;
  text-align: center;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.plaid-code-cell:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
  background: var(--surface);
}

/* Account selection */
.plaid-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 8px;
  font-family: inherit;
}
.plaid-check {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--hairline-2);
  background: var(--surface);
  display: grid; place-items: center;
  color: white;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s;
}
.plaid-check.on {
  background: var(--brand);
  border-color: var(--brand);
}

.plaid-account-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.plaid-account-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--hairline);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.plaid-account-row:hover { border-color: var(--hairline-2); background: var(--canvas-2); }
.plaid-account-row.on {
  border-color: var(--brand);
  background: var(--brand-tint);
}
.plaid-acct-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--ink-2);
  flex-shrink: 0;
}
.plaid-acct-main { flex: 1; min-width: 0; }
.plaid-acct-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.plaid-acct-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 3px;
  flex-wrap: wrap;
}
.plaid-tag {
  padding: 1px 7px;
  background: var(--canvas-2);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.plaid-account-row.on .plaid-tag { background: var(--surface); }
.plaid-acct-limit { color: var(--ink-3); }
.plaid-acct-balance {
  text-align: right;
  flex-shrink: 0;
}
.plaid-acct-balance .num {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.plaid-negative { color: oklch(45% 0.13 25); }
.plaid-acct-balance-label {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* Permissions */
.plaid-range-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}
.plaid-range {
  padding: 14px 10px;
  background: var(--surface);
  border: 1.5px solid var(--hairline);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.plaid-range:hover { border-color: var(--hairline-2); }
.plaid-range.on {
  border-color: var(--brand);
  background: var(--brand-tint);
}
.plaid-range-num {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.plaid-range-num span {
  font-size: 12px;
  color: var(--ink-3);
  margin-left: 2px;
  font-weight: 400;
}
.plaid-range-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  margin-top: 2px;
}
.plaid-range-sub {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.plaid-perms {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.plaid-perm {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  align-items: flex-start;
}
.plaid-perm:last-child { border-bottom: none; }
.plaid-perm-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--brand-tint);
  color: var(--brand-ink);
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.plaid-perm.off .plaid-perm-icon {
  background: var(--canvas-2);
  color: var(--ink-3);
}
.plaid-perm-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
}
.plaid-perm.off .plaid-perm-title { color: var(--ink-3); }
.plaid-perm-body {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
  text-wrap: pretty;
}

.plaid-disclosure {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: var(--canvas-2);
  border-radius: 10px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}
.plaid-disclosure svg {
  color: var(--ink-2);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Syncing */
.plaid-step-sync { padding-bottom: 16px; }
.plaid-sync-art {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 4px 0 18px;
  position: relative;
}
.plaid-sync-pulse {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: white;
  font-family: 'Geist Mono';
  font-weight: 600;
  font-size: 14px;
  position: relative;
  box-shadow: 0 4px 14px oklch(20% 0.01 260 / 0.15);
}
.plaid-sync-pulse::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  border: 2px solid currentColor;
  opacity: 0.3;
  animation: plaidRing 1.6s ease-out infinite;
}
@keyframes plaidRing {
  0%   { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.4); opacity: 0; }
}
.plaid-sync-pulse-app {
  background: var(--ink);
  color: var(--canvas);
}
.plaid-sync-beam {
  width: 80px;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--brand), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  margin: 0 14px;
  animation: plaidBeam 1.2s linear infinite;
}
@keyframes plaidBeam {
  0%   { background-position: -50% 0; }
  100% { background-position: 150% 0; }
}

.plaid-tasks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.plaid-task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  transition: background 0.2s;
}
.plaid-task-active { background: var(--brand-tint); }
.plaid-task-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.plaid-task-done .plaid-task-icon {
  background: var(--brand);
  color: white;
}
.plaid-task-active .plaid-task-icon {
  background: var(--surface);
  border: 1.5px solid var(--brand);
}
.plaid-task-pending .plaid-task-icon {
  background: var(--canvas-2);
}
.plaid-task-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-4);
}
.plaid-spinner {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.8px solid var(--brand-tint-2);
  border-top-color: var(--brand);
  animation: plaidSpin 0.8s linear infinite;
}
@keyframes plaidSpin { to { transform: rotate(360deg); } }

.plaid-task-label {
  font-size: 13px;
  flex: 1;
  color: var(--ink);
  font-weight: 500;
}
.plaid-task-pending .plaid-task-label { color: var(--ink-3); font-weight: 400; }
.plaid-task-count {
  font-size: 12px;
  color: var(--ink-2);
  font-feature-settings: 'tnum';
}
.plaid-task-unit { color: var(--ink-3); font-size: 11px; }
.plaid-task-pending .plaid-task-count { color: var(--ink-4); }
.plaid-task-done .plaid-task-count { color: var(--brand-ink); font-weight: 500; }

/* Done */
.plaid-step-done { text-align: left; }
.plaid-done-art {
  width: 88px; height: 88px;
  margin: 4px auto 14px;
  position: relative;
  display: grid; place-items: center;
}
.plaid-done-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--brand-tint);
  animation: plaidPulse 2.4s ease-in-out infinite;
}
@keyframes plaidPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.7; }
}
.plaid-done-check {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  display: grid; place-items: center;
  position: relative;
  box-shadow: 0 6px 20px oklch(62% 0.14 155 / 0.35);
  animation: plaidPopCheck 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes plaidPopCheck {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.plaid-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}
.plaid-summary-cell {
  padding: 14px 12px;
  background: var(--canvas-2);
  border-radius: 12px;
  text-align: center;
}
.plaid-summary-label {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-bottom: 4px;
}
.plaid-summary-val {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.plaid-summary-val span {
  font-size: 11px;
  color: var(--ink-3);
  margin-left: 2px;
  font-weight: 400;
}

.plaid-next {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--canvas-2);
  border-radius: 12px;
}
.plaid-next-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  align-items: flex-start;
}
.plaid-next-item + .plaid-next-item {
  border-top: 1px solid var(--hairline);
}
.plaid-next-icon {
  width: 24px; height: 24px;
  border-radius: 7px;
  background: var(--surface);
  color: var(--brand-ink);
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.plaid-next-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.plaid-next-body {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
  line-height: 1.5;
}

.plaid-done-cta {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.plaid-done-cta .plaid-btn-primary { flex: 1; }
.plaid-done-cta .plaid-btn-secondary { flex-shrink: 0; }

@media (max-width: 540px) {
  .plaid-body { padding: 4px 20px 8px; }
  .plaid-intro-art { margin: 6px -20px 4px; }
  .plaid-summary { grid-template-columns: 1fr 1fr; }
  .plaid-done-cta { flex-direction: column; }
}

/* =============================================================
   Budget page
   ============================================================= */

/* Scan-complete banner */
.budget-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--brand-tint) 0%, var(--canvas) 80%);
  border: 1px solid var(--brand-tint-2);
  border-radius: 14px;
  margin-bottom: 16px;
  cursor: pointer;
  animation: bannerSlide 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes bannerSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.budget-banner-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--brand);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.budget-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}
.budget-banner-sub {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* Header summary stacked bar */
.budget-stack-row {
  position: relative;
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--canvas-2);
}
.budget-stack-seg {
  height: 100%;
  transition: opacity 0.15s;
}
.budget-stack-seg:hover { opacity: 0.85; }
.budget-stack-marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: oklch(45% 0.13 25);
  z-index: 1;
}
.budget-stack-marker-label {
  position: absolute;
  top: 100%;
  margin-top: 6px;
  left: 4px;
  font-size: 10px;
  font-weight: 500;
  color: oklch(45% 0.13 25);
  white-space: nowrap;
  font-family: 'Geist Mono';
  font-feature-settings: 'tnum';
}

.threshold-input {
  padding: 6px 10px;
  border: 1px solid var(--hairline-2);
  border-radius: 7px;
  font-size: 13px;
  font-family: 'Geist Mono';
  font-feature-settings: 'tnum';
  text-align: right;
  outline: none;
  background: var(--surface);
}
.threshold-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px oklch(20% 0.01 260 / 0.08);
}

/* ============== Unified accordion list ============== */
.budget-list {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
}
.budget-row-group {
  border-bottom: 1px solid var(--hairline);
  transition: background 0.15s;
}
.budget-row-group:last-child { border-bottom: none; }
.budget-row-droptarget {
  background: var(--brand-tint);
  box-shadow: inset 0 0 0 2px var(--brand);
}
.budget-row-source { opacity: 0.5; }

.budget-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  transition: background 0.12s;
}
.budget-row:hover { background: var(--canvas-2); }

/* Category row */
.budget-row-cat {
  padding: 14px 16px;
}
.budget-cat-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  color: white;
  display: grid; place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* Item & sub-item rows are progressively indented */
.budget-row-item {
  padding-left: 50px;
  background: oklch(99% 0.002 90);
  border-top: 1px solid var(--hairline);
  cursor: grab;
}
.budget-row-item:active { cursor: grabbing; }
.budget-row-item[draggable="true"]:active {
  opacity: 0.5;
}
.budget-row-subitem {
  padding-left: 90px;
  background: var(--canvas-2);
  border-top: 1px solid var(--hairline);
}

.budget-chevron {
  width: 22px; height: 22px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.budget-chevron:hover { background: var(--canvas-2); color: var(--ink); }
.budget-chevron-placeholder {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--ink-4);
  flex-shrink: 0;
}
.budget-row-item .budget-chevron-placeholder { color: var(--ink-4); }

.budget-row-body {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  color: inherit;
}
.budget-row-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.budget-row-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.budget-row-title-sm {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.budget-row-title-xs {
  font-size: 12px;
  color: var(--ink-2);
}
.budget-row-meta {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}
.budget-row-tag {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.budget-row-merchant {
  font-size: 10px;
  color: var(--ink-3);
  font-family: 'Geist Mono';
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.budget-row-bar {
  height: 3px;
  background: var(--canvas-2);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
  max-width: 280px;
}
.budget-row-bar-fill {
  height: 100%;
  transition: width 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.budget-row-amount { text-align: right; flex-shrink: 0; }
.budget-row-amt {
  font-size: 14px;
  font-weight: 500;
  font-feature-settings: 'tnum';
}
.budget-row-cap {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  font-feature-settings: 'tnum';
  white-space: nowrap;
}
.budget-row-amt-sm {
  font-size: 13px;
  font-weight: 500;
  font-feature-settings: 'tnum';
}
.budget-row-cap-sm {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 2px;
  font-feature-settings: 'tnum';
}
.budget-row-amt-xs {
  font-size: 12px;
  font-weight: 500;
  font-feature-settings: 'tnum';
  color: var(--ink-2);
}
.budget-row-cap-xs {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 2px;
  font-feature-settings: 'tnum';
}

.budget-items { display: flex; flex-direction: column; }
.budget-subitems { display: flex; flex-direction: column; }
.budget-empty {
  padding: 14px 16px 14px 50px;
  background: oklch(99% 0.002 90);
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
}
.budget-row-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 12px 50px;
  background: oklch(99% 0.002 90);
  border-top: 1px solid var(--hairline);
}

/* ============== Slide-over ============== */
.slideover-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(15% 0.01 260 / 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 250;
  animation: fadeIn 0.18s ease-out;
}
.slideover-panel {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: 440px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px oklch(15% 0.01 260 / 0.18);
  animation: slideoverIn 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes slideoverIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.slideover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-top: 3px solid transparent;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}
.slideover-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.slideover-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 0;
  display: flex;
  flex-direction: column;
}
.slideover-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  margin: 18px -20px 0;
  position: sticky;
  bottom: 0;
  z-index: 2;
}
.slideover-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--canvas-2);
  border-radius: 10px;
  margin-bottom: 18px;
}

/* Protection picker */
.protection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.protection-card {
  padding: 12px 10px;
  background: var(--surface);
  border: 1.5px solid var(--hairline);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
}
.protection-card:hover { border-color: var(--hairline-2); }
.protection-card:active { transform: translateY(1px); }
.protection-glyph {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 13px;
  font-weight: 600;
}
.protection-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.protection-desc {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.45;
  text-wrap: pretty;
}

/* Icon / color pickers */
.icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.icon-pick {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.icon-pick:hover { border-color: var(--hairline-2); }
.icon-pick-on {
  border-color: var(--ink);
  background: var(--canvas-2);
}
.color-pick {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 2px solid var(--surface);
  outline: 1px solid var(--hairline);
  cursor: pointer;
  transition: outline-color 0.15s;
}
.color-pick-on {
  border-color: var(--ink);
  outline-color: var(--ink);
}

/* Sub-item list inside item form */
.sub-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--canvas-2);
  border-radius: 8px;
}
.sub-row-input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}
.sub-row-input:focus {
  border-color: var(--ink);
}
.sub-row-amount {
  width: 90px;
  flex: 0 0 90px;
  text-align: right;
  font-family: 'Geist Mono';
  font-feature-settings: 'tnum';
}

@media (max-width: 540px) {
  .budget-row-item { padding-left: 40px; }
  .budget-row-subitem {
  padding-left: 72px; }
  .budget-empty, .budget-row-foot { padding-left: 40px; }
  .slideover-panel { width: 100%; }
  .protection-grid { grid-template-columns: 1fr; }
}

/* =============================================================
   Demo data banner + wipe modal
   ============================================================= */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, oklch(95% 0.03 75) 0%, var(--canvas) 80%);
  border: 1px solid oklch(88% 0.07 75);
  border-radius: 14px;
  margin-bottom: 18px;
  animation: bannerSlide 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.demo-banner-urgent {
  background: linear-gradient(135deg, oklch(95% 0.04 25) 0%, var(--canvas) 80%);
  border-color: oklch(85% 0.08 25);
}
.demo-banner-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: oklch(70% 0.13 75);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.demo-banner-urgent .demo-banner-icon {
  background: oklch(58% 0.13 25);
}
.demo-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
  text-wrap: balance;
}
.demo-banner-sub {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  text-wrap: pretty;
}

/* Confirm modal */
.demo-wipe-block {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid transparent;
}
.demo-wipe-remove {
  background: oklch(97% 0.015 25);
  border-color: oklch(92% 0.04 25);
}
.demo-wipe-keep {
  background: var(--brand-tint);
  border-color: var(--brand-tint-2);
}
.demo-wipe-info {
  background: var(--canvas-2);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  margin-top: 4px;
  margin-bottom: 0;
}
.demo-wipe-info svg {
  flex-shrink: 0;
  margin-top: 2px;
}
.demo-wipe-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  color: var(--ink-2);
}
.demo-wipe-remove .demo-wipe-head { color: oklch(45% 0.13 25); }
.demo-wipe-keep .demo-wipe-head { color: var(--brand-ink); }
.demo-wipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.demo-wipe-stat {
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 7px;
}
.demo-wipe-num {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
}
.demo-wipe-label {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
