:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --ink: #111318;
  --muted: #7a8190;
  --muted-2: #98a1b2;
  --border: #e2e7ef;
  --border-strong: #d6deea;
  --brand: #2563eb;
  --brand-2: #4f46e5;
  --brand-soft: #eaf1ff;
  --asset-current: #2563eb;
  --asset-fund: #14b8a6;
  --asset-long: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --success: #059669;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --warning-soft: #fff7ed;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.05);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Styrene B", "Styrene A", "Claude Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display-font: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 30rem),
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.12), transparent 24rem),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 36%, #f7f9fd 100%);
  color: var(--ink);
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.site-header-inner {
  width: min(1360px, calc(100vw - 48px));
  margin: 0 auto;
  min-height: 70px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}
.brand { display: inline-flex; gap: 12px; align-items: center; min-width: max-content; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #10141f 0%, #27314a 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}
.brand h1 { font-size: 1.05rem; margin: 0; letter-spacing: -0.04em; }
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .76rem;
  font-weight: 850;
  color: var(--muted-2);
}
.nav-list {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-list::-webkit-scrollbar { display: none; }
.nav-btn {
  border: 0;
  color: #4b5565;
  background: transparent;
  padding: 10px 14px;
  border-radius: 8px;
  text-align: center;
  font-weight: 800;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-btn:hover { background: var(--brand-soft); color: var(--brand); }
.nav-btn.active { background: #111318; color: #ffffff; box-shadow: 0 10px 22px rgba(17, 19, 24, 0.12); }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.primary-btn, .ghost-btn, .danger-ghost {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 850;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.primary-btn { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 12px 24px rgba(37, 99, 235, .20); }
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 16px 30px rgba(37, 99, 235, .26); }
.ghost-btn { color: #344054; background: #fff; border-color: var(--border); }
.ghost-btn:hover { background: #f8fbff; border-color: #cbd5e1; }
.danger-ghost { color: var(--danger); background: #fff; border-color: #fecaca; }
.danger-ghost:hover { background: var(--danger-soft); }
.file-label { display: inline-flex; align-items: center; position: relative; }
.file-label input { display: none; }

.content {
  width: min(1360px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 24px 0 56px;
  min-width: 0;
}
.topbar { display: none; }
.view { display: none; }
.active-view { display: block; }
.grid { display: grid; gap: 20px; }
.dashboard-grid { grid-template-columns: minmax(0, 1fr) 310px; margin-top: 20px; }
.budget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; margin-top: 0; }
#budget { max-width: 1180px; margin-inline: auto; }
.dashboard-primary-grid { align-items: stretch; }
.bottom-dashboard-grid { margin-top: 20px; }
.cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.compact-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.projection-chart-panel { grid-column: 1 / -1; }
.projection-chart-panel .horizontal-chart { min-height: 280px; }

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(430px, 610px);
  gap: 32px;
  align-items: center;
  padding: 8px 0 34px;
}
.hero-net-worth {
  display: block;
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(3.4rem, 8vw, 5.7rem);
  line-height: .92;
  letter-spacing: -.075em;
  color: var(--ink);
}
.trend-note { margin: 10px 0 0; color: var(--muted); font-size: 1rem; }
.trend-note.positive, .positive-text { color: var(--success); }
.trend-note.negative, .negative-text { color: var(--danger); }
.hero-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.summary-tile {
  position: relative;
  min-height: 104px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #fff 0%, #fcfdff 100%);
}
.summary-tile + .summary-tile { border-left: 1px solid var(--border); }
.summary-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
}
.asset-tile::before { background: var(--asset-current); }
.liability-tile::before { background: var(--danger); }
.change-tile::before { background: var(--asset-fund); }
.metric-label { color: var(--muted-2); font-weight: 900; font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; }
.summary-tile strong { display: block; font-size: 1.35rem; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.summary-tile small { line-height: 1.35; }
.dashboard-divider { height: 1px; background: var(--border); margin: 20px 0 28px; }

.panel, .metric-card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.panel { padding: 24px; margin-bottom: 20px; }
.metric-card { padding: 22px; min-height: 140px; display: flex; flex-direction: column; justify-content: space-between; }
.hero-card { background: linear-gradient(135deg, #eff6ff, #eef2ff); color: var(--ink); }
.metric-card strong { display: block; font-size: clamp(1.7rem, 3vw, 2.45rem); letter-spacing: -.06em; margin-top: 10px; }
.metric-card p { margin: 12px 0 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; line-height: 1.45; }
.section-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.section-header h3 { margin: 4px 0 0; font-size: 1.12rem; letter-spacing: -.025em; }
.section-header p:not(.eyebrow) { margin: 6px 0 0; }
.wrap-header { align-items: flex-start; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 900;
  font-size: .78rem;
}
.pill.warning { background: var(--warning-soft); color: var(--warning); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }

.asset-breakdown-panel { min-height: 350px; }
.asset-breakdown-list { gap: 24px; }
.asset-breakdown-item { display: grid; gap: 8px; }
.breakdown-list, .stacked-summary, .mini-list, .bar-list { display: grid; gap: 12px; }
.breakdown-row, .summary-row, .mini-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.breakdown-row:last-child, .summary-row:last-child, .mini-row:last-child { border-bottom: 0; }
.breakdown-row span, .summary-row span, .mini-row span { color: #252b37; font-weight: 760; }
.breakdown-row strong, .summary-row strong, .mini-row strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.breakdown-subrow { color: var(--muted); font-size: .92rem; }
.progress-track { width: 100%; height: 9px; background: #edf2f7; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--asset-current), var(--brand-2)); }
.asset-breakdown-item.designatedFund .progress-fill { background: linear-gradient(90deg, var(--asset-fund), #22c55e); }
.asset-breakdown-item.nonCurrentAsset .progress-fill { background: linear-gradient(90deg, var(--asset-long), #fb7185); }

.goal-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.goal-progress { display: grid; gap: 10px; }
.goal-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.goal-progress-head span {
  font-size: 1.55rem;
  font-weight: 950;
  letter-spacing: -0.05em;
  color: var(--brand);
}
.goal-progress-head strong { font-size: .96rem; text-align: right; }
.goal-track {
  height: 12px;
  background: linear-gradient(90deg, #e5edf8, #e7f1ef);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}
.goal-track .progress-fill {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 1px 3px rgba(37, 99, 235, 0.18);
}
.goal-panel { background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(240,253,250,.58)); }

.allocation-panel { min-height: 350px; }
.allocation-donut-wrap { display: grid; place-items: center; padding: 4px 0 18px; }
.allocation-donut {
  width: min(220px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--asset-current) 0 100%);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.04);
}
.allocation-donut::after {
  content: "";
  position: absolute;
  inset: 31%;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--border);
}
.allocation-donut span { position: relative; z-index: 1; color: var(--muted-2); text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 900; }
.allocation-legend { display: grid; gap: 10px; }
.allocation-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .92rem; color: #394150; }
.allocation-row span { display: inline-flex; gap: 10px; align-items: center; }
.allocation-row i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.allocation-row strong { color: var(--muted); font-size: .9rem; }
.liabilities-panel .total-mini { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border-strong); font-weight: 900; }
.empty-state { margin: 0 0 8px; }

canvas { width: 100%; max-width: 100%; background: #fff; border-radius: 14px; border: 1px dashed var(--border-strong); }
.horizontal-chart { display: block; width: 100%; min-height: 260px; aspect-ratio: 16 / 5; }
.projection-chart-panel .horizontal-chart { aspect-ratio: 16 / 5; }

.control-row { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.field { display: grid; gap: 7px; }
.field span { color: var(--muted-2); font-weight: 900; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
input, select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.compact-field { min-width: 210px; }
.snapshot-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin: 10px 0 20px;
}
.account-group { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-bottom: 14px; background: #fff; }
.account-group-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  font-weight: 900;
  color: #fff;
  background: var(--brand);
}
.account-group-header.assets { background: #1f2937; }
.account-group-header.currentAsset { background: var(--asset-current); }
.account-group-header.designatedFund { background: var(--asset-fund); }
.account-group-header.nonCurrentAsset { background: var(--asset-long); }
.account-group-header.currentLiability, .account-group-header.nonCurrentLiability { background: var(--danger); }
.account-rows { display: grid; }
.account-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(120px, 180px) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.account-row .remove-row, .editable-row .remove-row {
  border: 0;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-weight: 900;
}
.add-account-btn { margin: 4px 0 16px; }
.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .94rem; }
th { background: #111827; color: #fff; position: sticky; top: 0; z-index: 1; }
tr:last-child td { border-bottom: 0; }
td.number, th.number { text-align: right; font-variant-numeric: tabular-nums; }
.total-row td { font-weight: 900; background: #eff6ff; }
.liability-cell { color: var(--danger); font-weight: 850; }
.editable-list { display: grid; gap: 10px; width: 100%; }
.editable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 170px) 44px;
  gap: 10px;
  align-items: center;
  width: 100%;
}
.budget-grid .panel, #budget > .panel { min-width: 0; }
.budget-grid .editable-row, .allocation-list .editable-row { grid-template-columns: minmax(0, 1fr) minmax(120px, 170px) 44px; }
.editable-row input { min-width: 0; }
.allocation-list .editable-row { grid-template-columns: minmax(0, 1fr) minmax(120px, 170px) 44px; }
.budget-total-strip {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.budget-total-strip div, .projection-cards div {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, var(--panel-soft));
}
.budget-total-strip div:nth-child(1), .projection-cards div:nth-child(1) { border-top: 4px solid var(--brand); }
.budget-total-strip div:nth-child(2), .projection-cards div:nth-child(2) { border-top: 4px solid var(--asset-fund); }
.budget-total-strip div:nth-child(3), .projection-cards div:nth-child(3) { border-top: 4px solid var(--asset-long); }
.budget-total-strip div:nth-child(4), .projection-cards div:nth-child(4) { border-top: 4px solid var(--accent-purple); }
.budget-total-strip span, .projection-cards span { display: block; color: var(--muted-2); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.budget-total-strip strong, .projection-cards strong { display: block; margin-top: 8px; font-size: 1.25rem; letter-spacing: -.04em; }
.projection-form, .settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, var(--panel-soft));
  min-height: 100%;
}
.toggle-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
  letter-spacing: -.03em;
}
.toggle-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}
.toggle-kicker {
  display: block;
  color: var(--muted-2);
  font-weight: 900;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.toggle-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 56px;
  height: 32px;
  flex: 0 0 auto;
}
.toggle-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d7deeb;
  border-radius: 999px;
  transition: background .2s ease;
}
.toggle-slider::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.16);
  transition: transform .2s ease;
}
.toggle-control input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.toggle-control input:checked + .toggle-slider::after {
  transform: translateX(24px);
}

#projection .dashboard-grid {
  grid-template-columns: 1fr;
}
#projection .horizontal-chart {
  aspect-ratio: 18 / 4;
  min-height: 240px;
}

body.night-mode {
  --bg: #04070d;
  --panel: #0c121c;
  --panel-soft: #111a27;
  --ink: #edf2fb;
  --muted: #b0bbce;
  --muted-2: #8895aa;
  --border: #243246;
  --border-strong: #31445f;
  --brand-soft: #10203a;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.28);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 30rem),
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.14), transparent 24rem),
    linear-gradient(180deg, #02050a 0%, #050913 35%, var(--bg) 100%);
}
body.night-mode .site-header {
  background: rgba(5, 9, 19, 0.86);
}
body.night-mode .brand-mark {
  background: linear-gradient(135deg, #ffffff 0%, #cad5e7 100%);
  color: #0b111b;
}
body.night-mode .nav-btn { color: var(--muted); }
body.night-mode .nav-btn.active {
  background: #f3f6fc;
  color: #0b111b;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}
body.night-mode .ghost-btn,
body.night-mode .danger-ghost,
body.night-mode input,
body.night-mode select,
body.night-mode .panel,
body.night-mode .table-wrap,
body.night-mode .account-group,
body.night-mode .toggle-card,
body.night-mode .budget-total-strip div,
body.night-mode .projection-cards div,
body.night-mode .notice,
body.night-mode canvas,
body.night-mode .modal {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--border);
}
body.night-mode .ghost-btn:hover { background: #111b29; }
body.night-mode .danger-ghost:hover { background: rgba(220, 38, 38, 0.16); }
body.night-mode .summary-tile,
body.night-mode .metric-card,
body.night-mode .mini-row,
body.night-mode .allocation-donut,
body.night-mode .bar,
body.night-mode .progress-track,
body.night-mode .account-row,
body.night-mode th,
body.night-mode .total-row td,
body.night-mode .modal form {
  background: var(--panel-soft);
}
body.night-mode th { color: var(--ink); }
body.night-mode .goal-track {
  background: linear-gradient(90deg, #223146, #1f3840);
  border-color: rgba(96, 165, 250, 0.16);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}
body.night-mode .goal-track .progress-fill {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 1px 3px rgba(37, 99, 235, 0.24);
}
body.night-mode .total-row td,
body.night-mode .notice {
  border-color: var(--border);
  color: var(--ink);
}
body.night-mode .toast {
  background: #f3f6fc;
  color: #0b111b;
}
.projection-cards { display: grid; gap: 12px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.notice {
  padding: 16px 18px;
  border-radius: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  line-height: 1.55;
}
.bar-row { display: grid; gap: 7px; }
.bar-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; }
.bar { height: 11px; background: #edf2f7; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--asset-fund)); }
.modal {
  border: 0;
  border-radius: 22px;
  padding: 0;
  width: min(520px, calc(100vw - 24px));
  box-shadow: 0 30px 80px rgba(15,23,42,.24);
}
.modal::backdrop { background: rgba(15, 23, 42, .38); backdrop-filter: blur(4px); }
.modal form { padding: 24px; display: grid; gap: 14px; }
.modal h3 { margin: 0; font-size: 1.4rem; letter-spacing: -.04em; }
.modal p { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #111827;
  color: #fff;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  box-shadow: 0 16px 40px rgba(15,23,42,.18);
  max-width: 360px;
}
.toast.show { opacity: 1; transform: translateY(0); }

.toast.has-action {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}
.toast-message {
  flex: 1;
}
.toast-action {
  appearance: none;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.14);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.toast-action:hover {
  background: rgba(255,255,255,.24);
}
body.night-mode .toast-action {
  border-color: rgba(191, 219, 254, .24);
  background: rgba(59, 130, 246, .18);
  color: #eff6ff;
}
body.night-mode .toast-action:hover {
  background: rgba(59, 130, 246, .28);
}
.status-select { min-width: 120px; }
.percentile-form { margin-bottom: 10px; }
.percentile-actions { margin: 2px 0 16px; }
.percentile-result .result-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff, #f0fdfa);
}
.percentile-result strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -.06em;
}
.percentile-gauge { display: grid; gap: 10px; margin-bottom: 18px; }
.gauge-topline { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 850; font-size: .82rem; }
.gauge-topline strong { color: var(--brand); font-size: 1.25rem; }
.gauge-track {
  height: 18px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #eff6ff, #f0fdfa, #fff7ed);
  overflow: hidden;
  border: 1px solid var(--border);
}
.gauge-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--asset-fund), var(--asset-long));
  transition: width .25s ease;
}
.highlight-row td { background: #eff6ff; }
.source-note { margin-top: 16px; }

@media (max-width: 1180px) {
  .site-header-inner { grid-template-columns: 1fr; gap: 14px; padding: 14px 0; }
  .brand, .topbar-actions { justify-content: center; }
  .dashboard-hero { grid-template-columns: 1fr; }
  .hero-summary { max-width: none; }
  .dashboard-grid, .cards-grid, .compact-cards, .budget-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .site-header-inner, .content { width: min(100% - 28px, 1360px); }
  .content { padding: 24px 0 42px; }
  .nav-list { justify-content: flex-start; }
  .topbar-actions { justify-content: flex-start; }
  .hero-summary { grid-template-columns: 1fr; }
  .summary-tile + .summary-tile { border-left: 0; border-top: 1px solid var(--border); }
  .dashboard-grid, .cards-grid, .compact-cards, .budget-grid, .snapshot-meta, .projection-form, .settings-grid, .budget-total-strip, .goal-editor { grid-template-columns: 1fr; }
  .account-row, .editable-row, .budget-grid .editable-row, .allocation-list .editable-row { grid-template-columns: 1fr; }
  .account-row .remove-row, .editable-row .remove-row { width: 100%; }
  .panel { padding: 18px; border-radius: 16px; }
  .metric-card { min-height: 120px; }
  .horizontal-chart { aspect-ratio: 4 / 3; }
}
@media print {
  .site-header, .topbar-actions, .danger-ghost, .ghost-btn, .primary-btn { display: none !important; }
  .content { width: 100%; padding: 0; }
  .panel, .metric-card { box-shadow: none; break-inside: avoid; }
}


/* Compact, no-scroll chart treatment */
.chart-panel, .projection-chart-panel {
  min-height: auto;
}
canvas.horizontal-chart,
.horizontal-chart,
.compact-chart,
#projection .horizontal-chart,
.projection-chart-panel .horizontal-chart {
  display: block;
  width: 100%;
  height: 180px !important;
  min-height: 0 !important;
  max-height: 190px !important;
  aspect-ratio: auto !important;
  border-style: solid;
}
#projection .dashboard-grid {
  grid-template-columns: 1fr;
}
#projection .projection-chart-panel {
  grid-column: auto;
}
#projection .projection-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.allocation-donut {
  width: min(170px, 100%);
}
.allocation-donut-wrap {
  padding-bottom: 8px;
}

/* Easier account creation by category */
.category-add-btn {
  margin: 12px 14px 14px;
  width: calc(100% - 28px);
  justify-content: center;
  border-style: dashed;
  color: var(--brand);
  background: var(--brand-soft);
}
.empty-account-row {
  grid-template-columns: 1fr !important;
}

/* Car tab */
.car-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  align-items: start;
}
.car-value-grid {
  margin-top: 20px;
}
.car-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.car-result, .car-value-result {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.car-hero-result {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .12), transparent 16rem),
    linear-gradient(180deg, #ffffff, var(--panel-soft));
}
.car-hero-result span {
  display: block;
  color: var(--muted-2);
  font-weight: 900;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.car-hero-result strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
  letter-spacing: -.06em;
}
.car-hero-result small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}
.car-summary-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.car-summary-cards div small,
.car-rule-cards div small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}
.car-rule-cards div.pass-card {
  border-top-color: var(--success);
  background: linear-gradient(180deg, #ffffff, var(--success-soft));
}
.car-rule-cards div.warn-card {
  border-top-color: var(--warning);
  background: linear-gradient(180deg, #ffffff, var(--warning-soft));
}
.car-note {
  margin-top: 16px;
}

body.night-mode .car-hero-result,
body.night-mode .car-rule-cards div.pass-card,
body.night-mode .car-rule-cards div.warn-card {
  background: var(--panel-soft);
  color: var(--ink);
  border-color: var(--border);
}

@media (max-width: 980px) {
  #projection .projection-form,
  .car-grid,
  .car-form,
  .car-summary-cards {
    grid-template-columns: 1fr;
  }
}

/* v9 dashboard target controls near the top */
.dashboard-goal-panel {
  margin: 0 0 20px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .10), transparent 18rem),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(240,253,250,.72));
}
.compact-goal-header {
  margin-bottom: 12px;
}
.dashboard-goal-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
}
.dashboard-goal-editor {
  margin-bottom: 0;
}
.dashboard-goal-progress {
  min-width: 0;
}
.info-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .72rem;
  font-weight: 950;
  line-height: 1;
  vertical-align: 1px;
  cursor: help;
}
.info-icon:hover,
.info-icon:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.dashboard-help-panel {
  background: linear-gradient(180deg, #fff, var(--panel-soft));
}

/* v9 percentile page: remove stretched panel whitespace */
#percentile .dashboard-grid {
  align-items: start;
}
#percentile .panel {
  min-height: 0;
}
#percentile .dashboard-grid > .panel {
  align-self: start;
}
#percentile .percentile-result {
  margin-top: 18px;
}
#percentile .percentile-result .result-card {
  padding: 18px 20px;
  min-height: 0;
}
#percentile .percentile-result strong {
  font-size: clamp(2rem, 4vw, 3.1rem);
}
#percentile .projection-cards div {
  padding: 14px;
}

body.night-mode .dashboard-goal-panel,
body.night-mode .dashboard-help-panel {
  background: var(--panel);
}
body.night-mode .info-icon {
  background: var(--panel-soft);
  border-color: var(--border);
}

@media (max-width: 980px) {
  .dashboard-goal-layout {
    grid-template-columns: 1fr;
  }
}


/* v10 night mode readability improvements */
body.night-mode {
  --panel: #101826;
  --panel-soft: #162133;
  --muted: #c6d0e0;
  --muted-2: #9fb0c9;
  --border: #2c3b52;
  --border-strong: #405574;
}
body.night-mode .panel,
body.night-mode .metric-card,
body.night-mode .account-group,
body.night-mode .table-wrap,
body.night-mode .toggle-card,
body.night-mode .budget-total-strip div,
body.night-mode .projection-cards div,
body.night-mode .car-hero-result,
body.night-mode .dashboard-goal-panel,
body.night-mode .dashboard-help-panel {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
body.night-mode .metric-label,
body.night-mode .eyebrow,
body.night-mode .field span,
body.night-mode .summary-tile small,
body.night-mode .gauge-topline,
body.night-mode .car-hero-result span,
body.night-mode .car-hero-result small,
body.night-mode .car-summary-cards div small,
body.night-mode .car-rule-cards div small {
  color: var(--muted-2);
}
body.night-mode .breakdown-row span,
body.night-mode .summary-row span,
body.night-mode .mini-row span,
body.night-mode .allocation-row,
body.night-mode .allocation-row strong,
body.night-mode .breakdown-subrow,
body.night-mode .muted,
body.night-mode .empty-state,
body.night-mode .gauge-track + p,
body.night-mode .result-card p,
body.night-mode .section-header p:not(.eyebrow) {
  color: var(--muted);
}
body.night-mode .summary-row strong,
body.night-mode .mini-row strong,
body.night-mode .breakdown-row strong,
body.night-mode .section-header h3,
body.night-mode .panel strong,
body.night-mode .panel h2,
body.night-mode .panel h3,
body.night-mode .panel h4,
body.night-mode .result-card strong,
body.night-mode .hero-net-worth,
body.night-mode .goal-progress-head strong {
  color: var(--ink);
}
body.night-mode .allocation-row i {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}
body.night-mode .summary-row,
body.night-mode .mini-row,
body.night-mode .breakdown-row,
body.night-mode .liabilities-panel .total-mini {
  border-color: var(--border-strong);
}
body.night-mode .allocation-donut::after {
  background: #0f1725;
  box-shadow: inset 0 0 0 1px var(--border);
}
body.night-mode canvas {
  background: #101826;
}


/* v11 graph hover improvements */
canvas.horizontal-chart {
  cursor: default;
}


/* v12 compact Accounts tab */
#networth .panel:first-child {
  padding: 18px;
}
#networth .wrap-header {
  margin-bottom: 12px;
}
#networth .section-header h3 {
  font-size: 1rem;
}
#networth .section-header p:not(.eyebrow) {
  font-size: .86rem;
  max-width: 720px;
}
#networth .control-row {
  align-items: center;
  gap: 8px;
}
#networth .control-row .primary-btn,
#networth .control-row .danger-ghost,
#networth .control-row .ghost-btn {
  padding: 8px 11px;
  border-radius: 9px;
  font-size: .86rem;
}
#networth .compact-field {
  min-width: 190px;
}
#networth .snapshot-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}
#networth .snapshot-meta input,
#networth .snapshot-meta select {
  padding: 8px 10px;
  min-height: 36px;
  border-radius: 9px;
}
.account-groups-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}
.compact-account-group {
  margin-bottom: 0;
  border-radius: 13px;
}
.compact-account-group .account-group-header {
  padding: 8px 10px;
  min-height: 40px;
  font-size: .86rem;
}
.account-group-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.account-group-actions strong {
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
}
.category-plus-btn {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255,255,255,.54);
  border-radius: 8px;
  background: rgba(255,255,255,.22);
  color: #fff;
  font-weight: 950;
  line-height: 1;
  padding: 0;
}
.category-plus-btn:hover {
  background: rgba(255,255,255,.34);
  transform: translateY(-1px);
}
.compact-account-row {
  grid-template-columns: minmax(120px, 1fr) minmax(90px, 130px) 28px;
  gap: 6px;
  padding: 5px 8px;
}
.compact-account-row input {
  padding: 6px 8px;
  min-height: 31px;
  border-radius: 8px;
  font-size: .88rem;
}
.compact-account-row .remove-row {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 1rem;
}
.compact-account-row.empty-account-row {
  padding: 8px 10px;
  font-size: .84rem;
}
.account-total-strip {
  margin-top: 10px;
  gap: 8px;
}
.account-total-strip div {
  padding: 10px 12px;
  border-radius: 12px;
}
.account-total-strip span {
  font-size: .68rem;
}
.account-total-strip strong {
  font-size: 1.05rem;
  margin-top: 5px;
}
#networth .panel:nth-of-type(2) {
  margin-top: 10px;
}
#networth .table-wrap th,
#networth .table-wrap td {
  padding: 8px 10px;
  font-size: .84rem;
}
body.night-mode .category-plus-btn {
  border-color: rgba(255,255,255,.32);
  background: rgba(255,255,255,.16);
  color: #fff;
}
@media (max-width: 980px) {
  .account-groups-grid {
    grid-template-columns: 1fr;
  }
  #networth .snapshot-meta {
    grid-template-columns: 1fr;
  }
}


/* v13 dark mode spinner arrow visibility */
body.night-mode input[type="number"],
body.night-mode input[type="date"],
body.night-mode select {
  color-scheme: dark;
}

body.night-mode input::-webkit-calendar-picker-indicator,
body.night-mode select::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.35);
}

body.night-mode input[type="number"]::-webkit-inner-spin-button,
body.night-mode input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
  filter: invert(1) brightness(1.55) contrast(1.2);
}

body.night-mode input[type="number"] {
  padding-right: 12px;
}


/* v14 custom input steppers for better visibility */
.input-enhanced {
  position: relative;
  width: 100%;
}
.input-enhanced > input {
  position: relative;
  z-index: 1;
}
.number-enhanced > input {
  padding-right: 46px;
}
.date-enhanced > input {
  padding-right: 44px;
}
.stepper-buttons {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 26px;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  z-index: 2;
}
.stepper-btn,
.date-picker-btn {
  border: 0;
  background: transparent;
  color: #344054;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.stepper-btn {
  height: 14px;
  line-height: 1;
}
.stepper-btn span {
  font-size: 11px;
  font-weight: 900;
}
.date-picker-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 8px;
  z-index: 2;
}
.date-picker-btn span {
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}
.input-enhanced > input[type="number"]::-webkit-inner-spin-button,
.input-enhanced > input[type="number"]::-webkit-outer-spin-button,
.input-enhanced > input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  pointer-events: none;
}
.input-enhanced > input[type="number"] {
  -moz-appearance: textfield;
}

body.night-mode .stepper-btn,
body.night-mode .date-picker-btn {
  color: #f3f7ff;
}
body.night-mode .stepper-btn:hover,
body.night-mode .date-picker-btn:hover {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255,255,255,0.18);
}
body.night-mode .stepper-buttons,
body.night-mode .date-picker-btn {
  background: rgba(255,255,255,0.02);
}
body.night-mode .date-picker-btn {
  border: 1px solid rgba(255,255,255,0.08);
}


/* v16 AI finance assistant */
.ai-agent {
  position: fixed;
  top: 84px;
  right: 24px;
  z-index: 35;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.ai-agent-toggle,
.ai-agent-panel {
  pointer-events: auto;
}
.ai-agent-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px 10px 10px;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}
.ai-orb {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--asset-fund));
  color: #fff;
  font-size: .78rem;
  letter-spacing: -.03em;
}
.ai-agent-panel {
  margin-top: 10px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15,23,42,.18);
  padding: 16px;
  backdrop-filter: blur(18px);
}
.ai-agent-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.ai-agent-header h3 { margin: 4px 0 0; font-size: 1rem; letter-spacing: -.03em; }
.ghost-icon-btn {
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-weight: 900;
}
.ai-agent-messages {
  display: grid;
  gap: 9px;
  max-height: 230px;
  overflow: auto;
  padding-right: 4px;
}
.ai-message {
  padding: 10px 12px;
  border-radius: 13px;
  font-size: .88rem;
  line-height: 1.42;
}
.agent-message {
  background: var(--brand-soft);
  color: #1e3a8a;
  border: 1px solid rgba(37,99,235,.14);
}
.user-message {
  background: var(--panel-soft);
  color: var(--ink);
  border: 1px solid var(--border);
  justify-self: end;
  max-width: 86%;
}
.ai-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}
.ai-quick-actions button {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 9px;
  font-size: .76rem;
  font-weight: 850;
}
.ai-quick-actions button:hover { color: var(--brand); border-color: var(--brand); }
.ai-agent-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.ai-agent-note { margin: 10px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.35; }
body.night-mode .ai-agent-toggle,
body.night-mode .ai-agent-panel {
  background: rgba(16,24,38,.94);
  color: var(--ink);
  border-color: var(--border);
}
body.night-mode .agent-message {
  background: #14233b;
  color: #dbeafe;
  border-color: #263b5c;
}
body.night-mode .ai-quick-actions button,
body.night-mode .user-message,
body.night-mode .ghost-icon-btn {
  background: var(--panel-soft);
  color: var(--muted);
  border-color: var(--border);
}

/* v16 draggable account categories */
.category-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: grab;
  user-select: none;
}
.category-title:active { cursor: grabbing; }
.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 24px;
  border-radius: 7px;
  background: rgba(255,255,255,.16);
  color: rgba(255,255,255,.86);
  font-size: .82rem;
  letter-spacing: -.2em;
  padding-right: 3px;
}
.draggable-category {
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease, outline-color .16s ease;
}
.draggable-category.dragging {
  opacity: .55;
  transform: scale(.99);
}
.draggable-category.drag-over {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
.draggable-category.drop-after {
  outline-color: var(--asset-fund);
}
body.night-mode .drag-handle {
  background: rgba(255,255,255,.18);
  color: #fff;
}

@media (max-width: 980px) {
  .ai-agent {
    top: auto;
    right: 14px;
    bottom: 14px;
    width: min(360px, calc(100vw - 28px));
  }
}
@media print {
  .ai-agent { display: none !important; }
}


/* v17 linked net worth fields */
.linked-field small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}
.linked-field small::before {
  content: "↔";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 900;
}
.linked-field input[readonly] {
  background: linear-gradient(180deg, var(--panel-soft), #fff);
  border-style: dashed;
  cursor: default;
}
body.night-mode .linked-field input[readonly] {
  background: var(--panel-soft);
  color: var(--ink);
  border-color: var(--border-strong);
}
body.night-mode .linked-field small {
  color: var(--muted);
}


/* v17 snapshot management */
.table-delete-btn {
  border: 1px solid #fecaca;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: .78rem;
}
.table-delete-btn:hover {
  background: #fecaca;
}
.row-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .7rem;
  font-weight: 900;
  vertical-align: middle;
}
.selected-snapshot-row td {
  background: rgba(37, 99, 235, .05);
}
body.night-mode .table-delete-btn {
  border-color: rgba(248, 113, 113, .35);
  background: rgba(220, 38, 38, .18);
  color: #fca5a5;
}
body.night-mode .table-delete-btn:hover {
  background: rgba(220, 38, 38, .28);
}
body.night-mode .selected-snapshot-row td {
  background: rgba(37, 99, 235, .10);
}


/* v18 account subtype dropdowns */
.compact-account-row {
  grid-template-columns: minmax(115px, 1.1fr) minmax(120px, .9fr) minmax(90px, 125px) 28px;
}
.compact-account-row .account-subtype-input,
.compact-account-row input {
  padding: 6px 8px;
  min-height: 31px;
  border-radius: 8px;
  font-size: .84rem;
}
.account-subtype-input {
  color: var(--muted);
  background: var(--panel-soft);
}
body.night-mode .account-subtype-input {
  color: var(--ink);
  background: var(--panel-soft);
  border-color: var(--border-strong);
}
@media (max-width: 760px) {
  .compact-account-row {
    grid-template-columns: 1fr;
  }
}


/* v19 searchable account types and account-based projection */
.projection-assumptions-wrap table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
  font-weight: 600;
}
.return-input {
  max-width: 96px;
  margin-left: auto;
  text-align: right;
  padding: 7px 8px;
  border-radius: 8px;
}
#projection .projection-form {
  grid-template-columns: minmax(220px, 1.2fr) minmax(170px, .9fr) minmax(190px, 1fr) minmax(90px, .5fr);
}
.account-subtype-input::placeholder,
#newAccountSubtype::placeholder {
  color: var(--muted-2);
}
body.night-mode .projection-assumptions-wrap table small {
  color: var(--muted);
}
@media (max-width: 980px) {
  #projection .projection-form {
    grid-template-columns: 1fr;
  }
}


/* v20 projection liability clarity */
.projection-assumption-note {
  margin: 12px 14px 14px;
}
.projection-liability-row td {
  background: rgba(254, 226, 226, 0.28);
}
.projection-liability-row td:first-child strong::after {
  content: " debt";
  color: var(--danger);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-left: 8px;
}
body.night-mode .projection-liability-row td {
  background: rgba(220, 38, 38, 0.10);
}


/* v21 projection top summary layout */
.projection-summary-panel {
  margin-bottom: 20px;
}
.projection-summary-header {
  margin-bottom: 16px;
}
.projection-layout-grid {
  grid-template-columns: 1fr;
}
.projection-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.projection-summary-cards > div {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.projection-summary-cards strong {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
}
.projection-summary-cards small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.4;
}
body.night-mode .projection-summary-cards small {
  color: var(--muted);
}
@media (max-width: 1100px) {
  .projection-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .projection-summary-cards {
    grid-template-columns: 1fr;
  }
}

/* v22 projection age controls */
.projection-age-controls {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(150px, 180px) minmax(240px, 1fr);
  gap: 14px;
  align-items: end;
  margin: 0 0 18px;
}
.age-helper-card {
  min-height: 74px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, var(--panel-soft));
}
.age-helper-card span {
  display: block;
  color: var(--muted-2);
  font-weight: 900;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.age-helper-card strong {
  display: block;
  margin-top: 5px;
  font-size: 1.05rem;
  letter-spacing: -.03em;
}
.age-helper-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}
body.night-mode .age-helper-card {
  background: var(--panel-soft);
  border-color: var(--border);
}
@media (max-width: 900px) {
  .projection-age-controls {
    grid-template-columns: 1fr;
  }
}


/* v23 projection recurring contributions */
.projection-contributions-panel {
  margin-bottom: 20px;
}
.projection-contribution-rows {
  display: grid;
  gap: 12px;
}
.projection-contribution-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(145px, .9fr) minmax(120px, .8fr) minmax(110px, .75fr) minmax(120px, .8fr) minmax(135px, .8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
}
.projection-contribution-row .field {
  min-width: 0;
}
.projection-contribution-row input,
.projection-contribution-row select {
  min-height: 40px;
}
.muted-field {
  opacity: .62;
}
.contribution-monthly-equivalent {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.contribution-monthly-equivalent span,
.contribution-summary span {
  color: var(--muted-2);
  font-weight: 900;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.contribution-monthly-equivalent strong {
  font-size: 1.05rem;
  letter-spacing: -.03em;
}
.contribution-monthly-equivalent small {
  color: var(--muted);
}
.contribution-remove-btn {
  min-height: 40px;
}
.contribution-summary {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.contribution-summary div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
}
.contribution-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 1.2rem;
  letter-spacing: -.04em;
}
.empty-contribution-plan {
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  background: var(--panel-soft);
}
.empty-contribution-plan p {
  margin: 6px 0 0;
}
body.night-mode .projection-contribution-row,
body.night-mode .contribution-summary div,
body.night-mode .contribution-monthly-equivalent,
body.night-mode .empty-contribution-plan {
  background: var(--panel-soft);
  border-color: var(--border);
}
body.night-mode .contribution-monthly-equivalent span,
body.night-mode .contribution-summary span {
  color: var(--muted-2);
}
body.night-mode .contribution-monthly-equivalent small {
  color: var(--muted);
}
@media (max-width: 1320px) {
  .projection-contribution-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .contribution-remove-btn {
    width: 100%;
  }
}
@media (max-width: 760px) {
  .projection-contribution-row,
  .contribution-summary {
    grid-template-columns: 1fr;
  }
}


/* v24 percentile dark mode readability fix */
body.night-mode #percentile .percentile-result .result-card {
  background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
  border-color: #bfdbfe;
  color: #111827;
}
body.night-mode #percentile .percentile-result .result-card .metric-label {
  color: #64748b;
}
body.night-mode #percentile .percentile-result .result-card strong {
  color: #0f172a;
  text-shadow: none;
}
body.night-mode #percentile .percentile-result .result-card p,
body.night-mode #percentile .percentile-result .result-card .muted {
  color: #475569;
}


/* v26 remove contribution label column */
.projection-contribution-row.compact-contribution-row {
  grid-template-columns: minmax(230px, 1.35fr) minmax(140px, .8fr) minmax(120px, .7fr) minmax(130px, .75fr) minmax(155px, .85fr) auto;
}
@media (max-width: 1320px) {
  .projection-contribution-row.compact-contribution-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .projection-contribution-row.compact-contribution-row {
    grid-template-columns: 1fr;
  }
}


/* v27 align Projection contribution rows */
.projection-contribution-row.compact-contribution-row {
  grid-template-columns: minmax(280px, 1.45fr) minmax(160px, .85fr) minmax(140px, .75fr) minmax(140px, .75fr) minmax(190px, .9fr) 118px;
  align-items: end;
  gap: 14px;
  padding: 16px 18px;
}
.projection-contribution-row.compact-contribution-row .field {
  align-self: end;
  display: grid;
  grid-template-rows: 20px 44px;
  gap: 7px;
}
.projection-contribution-row.compact-contribution-row .field span {
  line-height: 1.15;
  display: flex;
  align-items: end;
  min-height: 20px;
}
.projection-contribution-row.compact-contribution-row input,
.projection-contribution-row.compact-contribution-row select {
  min-height: 44px;
  height: 44px;
}
.projection-contribution-row.compact-contribution-row .contribution-monthly-equivalent {
  align-self: end;
  min-height: 71px;
  height: 71px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.projection-contribution-row.compact-contribution-row .contribution-monthly-equivalent span {
  white-space: nowrap;
  line-height: 1.05;
  font-size: .68rem;
}
.projection-contribution-row.compact-contribution-row .contribution-monthly-equivalent strong {
  margin: 0;
  line-height: 1.05;
}
.projection-contribution-row.compact-contribution-row .contribution-monthly-equivalent small {
  line-height: 1.1;
}
.projection-contribution-row.compact-contribution-row .contribution-remove-btn {
  align-self: end;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 1320px) {
  .projection-contribution-row.compact-contribution-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .projection-contribution-row.compact-contribution-row .contribution-remove-btn {
    width: 100%;
  }
}
@media (max-width: 760px) {
  .projection-contribution-row.compact-contribution-row {
    grid-template-columns: 1fr;
  }
}


/* v28 liability payoff projection */
.projection-liability-payoff-panel {
  margin-bottom: 20px;
}
.liability-payoff-wrap table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
  font-weight: 650;
}
.payoff-years-input {
  max-width: 92px;
}
.payoff-note {
  margin-top: 14px;
}
body.night-mode .liability-payoff-wrap table small {
  color: var(--muted);
}


/* v29 integrated liability payoff controls */
.projection-assumptions-wrap table {
  min-width: 1050px;
}
.inline-payoff-control,
.inline-payoff-payment {
  display: grid;
  gap: 4px;
  min-width: 140px;
}
.inline-payoff-control + .inline-payoff-control,
.inline-payoff-payment + .inline-payoff-payment {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.inline-payoff-control strong,
.inline-payoff-payment strong {
  font-size: .86rem;
}
.inline-payoff-control small,
.inline-payoff-payment small,
.assumption-dash {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.3;
}
.inline-payoff-control .payoff-years-input {
  max-width: 92px;
  padding: 6px 8px;
}
body.night-mode .inline-payoff-control + .inline-payoff-control,
body.night-mode .inline-payoff-payment + .inline-payoff-payment {
  border-color: var(--border);
}


/* v30 header calculator widget */
.topbar-actions {
  position: relative;
}
.calculator-toggle-btn {
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 850;
  color: var(--brand);
  background: var(--brand-soft);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.calculator-toggle-btn:hover {
  transform: translateY(-1px);
  background: #dbeafe;
  border-color: rgba(37, 99, 235, .36);
  box-shadow: 0 12px 24px rgba(37, 99, 235, .14);
}
.calculator-widget {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 315px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 22px 55px rgba(15, 23, 42, .20);
  z-index: 60;
}
.calculator-widget[hidden] { display: none !important; }
.calculator-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.calculator-header strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
  letter-spacing: -.03em;
}
.ghost-icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 950;
  line-height: 1;
}
.calculator-display {
  width: 100%;
  min-height: 52px;
  margin-bottom: 12px;
  text-align: right;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  border-radius: 14px;
  background: var(--panel-soft);
}
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.calculator-grid button {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 900;
  font-size: 1rem;
}
.calculator-grid button:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}
.calculator-grid .calc-action {
  color: var(--brand);
  background: var(--brand-soft);
}
.calculator-grid .calc-op,
.calculator-grid .calc-equals {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.calculator-grid .calc-zero {
  grid-column: span 2;
}
body.night-mode .calculator-toggle-btn {
  background: var(--brand-soft);
  color: #93c5fd;
  border-color: var(--border-strong);
}
body.night-mode .calculator-widget,
body.night-mode .calculator-display,
body.night-mode .calculator-grid button,
body.night-mode .ghost-icon-btn {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--border);
}
body.night-mode .calculator-display,
body.night-mode .calculator-grid button:not(.calc-op):not(.calc-equals),
body.night-mode .ghost-icon-btn {
  background: var(--panel-soft);
}
body.night-mode .calculator-grid .calc-action {
  color: #93c5fd;
  background: var(--brand-soft);
}
@media (max-width: 760px) {
  .calculator-widget {
    position: fixed;
    top: 112px;
    right: 14px;
    left: 14px;
    width: auto;
  }
}

/* v31 projection card emphasis + account-color matching */
#projection .projection-summary-cards > div {
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

/* Most important metric: projected net worth */
#projection .projection-summary-cards > div:nth-child(1) {
  border: 2px solid var(--asset-current);
  border-top: 8px solid var(--asset-current);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .18), transparent 16rem),
    linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: 0 18px 38px rgba(37, 99, 235, .16);
  transform: translateY(-2px);
}
#projection .projection-summary-cards > div:nth-child(1)::after {
  content: "Primary metric";
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--asset-current);
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
#projection .projection-summary-cards > div:nth-child(1) strong {
  font-size: clamp(2rem, 3.1vw, 3rem);
  color: var(--asset-current);
}

/* Match Accounts tab color language */
#projection .projection-summary-cards > div:nth-child(2) {
  border-top-color: var(--accent-purple);
}
#projection .projection-summary-cards > div:nth-child(3) {
  border-top-color: var(--asset-fund);
}
#projection .projection-summary-cards > div:nth-child(4) {
  border-top-color: var(--danger);
}

body.night-mode #projection .projection-summary-cards > div:nth-child(1) {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .22), transparent 16rem),
    linear-gradient(180deg, #111f35 0%, #101826 100%);
  border-color: var(--asset-current);
  box-shadow: 0 18px 42px rgba(37, 99, 235, .22);
}
body.night-mode #projection .projection-summary-cards > div:nth-child(1) strong {
  color: #93c5fd;
}
body.night-mode #projection .projection-summary-cards > div:nth-child(1)::after {
  background: rgba(37, 99, 235, .18);
  color: #bfdbfe;
}


/* v32 projection cards full-color border */
#projection .projection-summary-cards > div:nth-child(2) {
  border: 2px solid var(--accent-purple);
  border-top-width: 8px;
  box-shadow: 0 10px 24px rgba(139, 92, 246, .10);
}
#projection .projection-summary-cards > div:nth-child(3) {
  border: 2px solid var(--asset-fund);
  border-top-width: 8px;
  box-shadow: 0 10px 24px rgba(20, 184, 166, .10);
}
#projection .projection-summary-cards > div:nth-child(4) {
  border: 2px solid var(--danger);
  border-top-width: 8px;
  box-shadow: 0 10px 24px rgba(220, 38, 38, .10);
}

body.night-mode #projection .projection-summary-cards > div:nth-child(2) {
  border-color: var(--accent-purple);
  box-shadow: 0 12px 28px rgba(139, 92, 246, .16);
}
body.night-mode #projection .projection-summary-cards > div:nth-child(3) {
  border-color: var(--asset-fund);
  box-shadow: 0 12px 28px rgba(20, 184, 166, .16);
}
body.night-mode #projection .projection-summary-cards > div:nth-child(4) {
  border-color: var(--danger);
  box-shadow: 0 12px 28px rgba(220, 38, 38, .16);
}


/* v33 projection assumptions by individual account */
#projection .projection-assumptions-wrap td strong + small {
  display: block;
  margin-top: 3px;
}
#projection .projection-assumptions-wrap .inline-payoff-control {
  min-width: 150px;
}


/* v34 grouped projection assumptions */
#projection .projection-assumptions-wrap tbody tr.projection-group-row td {
  padding: 0;
  border-bottom: 0;
  background: transparent;
}
#projection .projection-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-top: 10px;
  border-radius: 12px;
  font-weight: 900;
  letter-spacing: .01em;
}
#projection .projection-group-label strong {
  font-size: .95rem;
}
#projection .projection-group-label span {
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .9;
}
#projection .projection-group-row.theme-current .projection-group-label {
  background: rgba(37, 99, 235, .10);
  color: var(--asset-current);
  border-left: 5px solid var(--asset-current);
}
#projection .projection-group-row.theme-fund .projection-group-label {
  background: rgba(20, 184, 166, .10);
  color: var(--asset-fund);
  border-left: 5px solid var(--asset-fund);
}
#projection .projection-group-row.theme-long .projection-group-label {
  background: rgba(245, 158, 11, .12);
  color: var(--asset-long);
  border-left: 5px solid var(--asset-long);
}
#projection .projection-group-row.theme-liability .projection-group-label {
  background: rgba(220, 38, 38, .10);
  color: var(--danger);
  border-left: 5px solid var(--danger);
}
#projection .projection-account-row.theme-current td:first-child {
  border-left: 4px solid rgba(37, 99, 235, .38);
}
#projection .projection-account-row.theme-fund td:first-child {
  border-left: 4px solid rgba(20, 184, 166, .38);
}
#projection .projection-account-row.theme-long td:first-child {
  border-left: 4px solid rgba(245, 158, 11, .38);
}
#projection .projection-account-row.theme-liability td:first-child {
  border-left: 4px solid rgba(220, 38, 38, .45);
}
body.night-mode #projection .projection-group-row.theme-current .projection-group-label {
  background: rgba(37, 99, 235, .16);
}
body.night-mode #projection .projection-group-row.theme-fund .projection-group-label {
  background: rgba(20, 184, 166, .16);
}
body.night-mode #projection .projection-group-row.theme-long .projection-group-label {
  background: rgba(245, 158, 11, .16);
}
body.night-mode #projection .projection-group-row.theme-liability .projection-group-label {
  background: rgba(220, 38, 38, .16);
}


/* v35 projection assumptions grouped like Accounts */
#projection .projection-group-label {
  padding: 12px 16px;
}
#projection .projection-group-meta {
  display: grid;
  gap: 2px;
}
#projection .projection-group-total {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -.02em;
}
#projection .projection-group-header-only {
  justify-content: flex-start;
}
#projection .projection-group-footer-row td {
  padding-top: 0;
  border-top: 0;
}
#projection .projection-group-footer-label {
  margin-top: 0;
  justify-content: flex-end;
  border-radius: 0 0 12px 12px;
}
#projection .projection-group-footer-label .projection-group-total-stack {
  width: 100%;
  justify-content: flex-end;
}
#projection .projection-group-row.theme-current .projection-group-label,
#projection .projection-group-row.theme-fund .projection-group-label,
#projection .projection-group-row.theme-long .projection-group-label,
#projection .projection-group-row.theme-liability .projection-group-label {
  color: #fff;
  border-left-width: 0;
}
#projection .projection-group-row.theme-current .projection-group-label {
  background: var(--asset-current);
}
#projection .projection-group-row.theme-fund .projection-group-label {
  background: var(--asset-fund);
}
#projection .projection-group-row.theme-long .projection-group-label {
  background: var(--asset-long);
}
#projection .projection-group-row.theme-liability .projection-group-label {
  background: var(--danger);
}
body.night-mode #projection .projection-group-row.theme-current .projection-group-label,
body.night-mode #projection .projection-group-row.theme-fund .projection-group-label,
body.night-mode #projection .projection-group-row.theme-long .projection-group-label,
body.night-mode #projection .projection-group-row.theme-liability .projection-group-label {
  color: #fff;
}


/* v36 header notes widget */
.notes-toggle-btn {
  border: 1px solid rgba(20, 184, 166, .28);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 850;
  color: var(--asset-fund);
  background: rgba(20, 184, 166, .10);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.notes-toggle-btn:hover {
  transform: translateY(-1px);
  background: rgba(20, 184, 166, .16);
  border-color: rgba(20, 184, 166, .45);
  box-shadow: 0 12px 24px rgba(20, 184, 166, .14);
}
.notes-widget {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 430px;
  max-height: min(680px, calc(100vh - 120px));
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 22px 55px rgba(15, 23, 42, .20);
  z-index: 65;
}
.notes-widget[hidden] { display: none !important; }
.notes-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.notes-header strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
  letter-spacing: -.03em;
}
.notes-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.notes-form input,
.notes-form textarea {
  width: 100%;
  border-radius: 12px;
  background: var(--panel-soft);
}
.notes-form textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.45;
}
.notes-list {
  display: grid;
  gap: 10px;
}
.note-card,
.empty-notes {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, var(--panel-soft));
  padding: 12px;
}
.note-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.note-card-header strong {
  display: block;
  font-size: .95rem;
}
.note-card-header small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .78rem;
}
.note-card p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.45;
}
.note-delete-btn {
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: .74rem;
  font-weight: 900;
}
body.night-mode .notes-toggle-btn {
  background: rgba(20, 184, 166, .14);
  color: #5eead4;
  border-color: var(--border-strong);
}
body.night-mode .notes-widget,
body.night-mode .notes-form input,
body.night-mode .notes-form textarea,
body.night-mode .note-card,
body.night-mode .empty-notes {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--border);
}
body.night-mode .notes-form input,
body.night-mode .notes-form textarea,
body.night-mode .note-card,
body.night-mode .empty-notes {
  background: var(--panel-soft);
}
body.night-mode .note-card p,
body.night-mode .note-card-header small {
  color: var(--muted);
}
@media (max-width: 760px) {
  .notes-widget {
    position: fixed;
    top: 112px;
    right: 14px;
    left: 14px;
    width: auto;
  }
}


/* v38 budget summary cards at top */
.budget-summary-panel {
  margin-bottom: 20px;
}
.budget-summary-header {
  margin-bottom: 16px;
}
#budget .budget-summary-cards {
  margin-top: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
#budget .budget-summary-cards > div {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  padding: 16px 18px 14px;
  border: 2px solid var(--border);
  border-top-width: 8px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.94));
  box-shadow: 0 12px 26px rgba(15, 23, 42, .08);
}
#budget .budget-summary-cards > div strong {
  font-size: clamp(1.6rem, 2.4vw, 2.3rem);
  line-height: 1.05;
  letter-spacing: -.05em;
  margin-top: 0;
}
#budget .budget-summary-cards > div small {
  color: var(--muted);
  line-height: 1.38;
}
#budget .budget-summary-cards > div:nth-child(1) {
  border-color: var(--success);
  border-top-width: 8px;
  background: linear-gradient(180deg, #f4fff9 0%, #ebfbf3 100%);
  box-shadow: 0 16px 34px rgba(5, 150, 105, .14);
}
#budget .budget-summary-cards > div:nth-child(1) span,
#budget .budget-summary-cards > div:nth-child(1) small {
  color: #2d6a4f;
}
#budget .budget-summary-cards > div:nth-child(1) strong {
  color: #064e3b;
  font-size: clamp(2rem, 3vw, 3rem);
}
#budget .budget-summary-cards > div:nth-child(2) {
  border-color: var(--danger);
  background: linear-gradient(180deg, #fff7f7 0%, #fff0f0 100%);
  box-shadow: 0 16px 34px rgba(220, 38, 38, .12);
}
#budget .budget-summary-cards > div:nth-child(2) span,
#budget .budget-summary-cards > div:nth-child(2) small {
  color: #8a3a35;
}
#budget .budget-summary-cards > div:nth-child(2) strong {
  color: #7f1d1d;
}
#budget .budget-summary-cards > div:nth-child(3) {
  border-color: var(--asset-long);
  background: linear-gradient(180deg, #fffaf1 0%, #fff4de 100%);
  box-shadow: 0 16px 34px rgba(245, 158, 11, .12);
}
#budget .budget-summary-cards > div:nth-child(3) span,
#budget .budget-summary-cards > div:nth-child(3) small {
  color: #8a5a15;
}
#budget .budget-summary-cards > div:nth-child(3) strong {
  color: #7c2d12;
}
#budget .budget-summary-cards > div:nth-child(4) {
  border-color: var(--accent-purple);
  background: linear-gradient(180deg, #faf7ff 0%, #f4efff 100%);
  box-shadow: 0 16px 34px rgba(139, 92, 246, .12);
}
#budget .budget-summary-cards > div:nth-child(4) span,
#budget .budget-summary-cards > div:nth-child(4) small {
  color: #5d4f8b;
}
#budget .budget-summary-cards > div:nth-child(4) strong {
  color: #312e81;
}
body.night-mode #budget .budget-summary-cards > div {
  background: linear-gradient(180deg, rgba(17, 26, 39, .92), rgba(12, 18, 28, .94));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}
body.night-mode #budget .budget-summary-cards > div:nth-child(1) {
  background: linear-gradient(180deg, rgba(5, 150, 105, .18) 0%, rgba(6, 78, 59, .22) 100%);
  border-color: #10b981;
  box-shadow: 0 16px 34px rgba(5, 150, 105, .22);
}
body.night-mode #budget .budget-summary-cards > div:nth-child(1) span,
body.night-mode #budget .budget-summary-cards > div:nth-child(1) small {
  color: #bbf7d0;
}
body.night-mode #budget .budget-summary-cards > div:nth-child(1) strong {
  color: #ecfdf5;
}
body.night-mode #budget .budget-summary-cards > div:nth-child(2) {
  border-color: var(--danger);
  background: linear-gradient(180deg, rgba(220, 38, 38, .12) 0%, rgba(127, 29, 29, .20) 100%);
  box-shadow: 0 16px 34px rgba(220, 38, 38, .18);
}
body.night-mode #budget .budget-summary-cards > div:nth-child(2) span,
body.night-mode #budget .budget-summary-cards > div:nth-child(2) small {
  color: #fecaca;
}
body.night-mode #budget .budget-summary-cards > div:nth-child(2) strong {
  color: #fef2f2;
}
body.night-mode #budget .budget-summary-cards > div:nth-child(3) {
  border-color: var(--asset-long);
  background: linear-gradient(180deg, rgba(245, 158, 11, .12) 0%, rgba(124, 45, 18, .18) 100%);
  box-shadow: 0 16px 34px rgba(245, 158, 11, .18);
}
body.night-mode #budget .budget-summary-cards > div:nth-child(3) span,
body.night-mode #budget .budget-summary-cards > div:nth-child(3) small {
  color: #fde68a;
}
body.night-mode #budget .budget-summary-cards > div:nth-child(3) strong {
  color: #fffbeb;
}
body.night-mode #budget .budget-summary-cards > div:nth-child(4) {
  border-color: var(--accent-purple);
  background: linear-gradient(180deg, rgba(139, 92, 246, .14) 0%, rgba(49, 46, 129, .20) 100%);
  box-shadow: 0 16px 34px rgba(139, 92, 246, .20);
}
body.night-mode #budget .budget-summary-cards > div:nth-child(4) span,
body.night-mode #budget .budget-summary-cards > div:nth-child(4) small {
  color: #ddd6fe;
}
body.night-mode #budget .budget-summary-cards > div:nth-child(4) strong {
  color: #f5f3ff;
}
@media (max-width: 1100px) {
  #budget .budget-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  #budget .budget-summary-cards {
    grid-template-columns: 1fr;
  }
}


/* v40 remove budget priority badge */
#budget .budget-summary-cards > div:nth-child(1)::after,
body.night-mode #budget .budget-summary-cards > div:nth-child(1)::after {
  content: none;
  display: none;
}


/* v41 color-coded budget sections */
#budget .budget-section-panel {
  padding-top: 0;
  overflow: hidden;
}
#budget .budget-section-panel > .section-header {
  margin: 0 -24px 18px;
  padding: 16px 24px 14px;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
#budget .budget-section-panel > .section-header .eyebrow,
#budget .budget-section-panel > .section-header h3,
#budget .budget-section-panel > .section-header p:not(.eyebrow) {
  color: #fff;
}
#budget .budget-section-panel > .section-header .eyebrow {
  opacity: .86;
}
#budget .budget-section-panel > .section-header p:not(.eyebrow) {
  opacity: .92;
}
#budget .budget-section-panel > .section-header .ghost-btn {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.34);
  color: #fff;
  box-shadow: none;
}
#budget .budget-section-panel > .section-header .ghost-btn:hover {
  background: rgba(255,255,255,.24);
  border-color: rgba(255,255,255,.48);
}
#budget .budget-income-panel {
  border-color: rgba(5,150,105,.28);
  box-shadow: 0 10px 24px rgba(5,150,105,.08);
}
#budget .budget-income-panel > .section-header {
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
}
#budget .budget-expense-panel {
  border-color: rgba(220,38,38,.22);
  box-shadow: 0 10px 24px rgba(220,38,38,.07);
}
#budget .budget-expense-panel > .section-header {
  background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
}
#budget .budget-goals-panel {
  border-color: rgba(245,158,11,.24);
  box-shadow: 0 10px 24px rgba(245,158,11,.10);
}
#budget .budget-goals-panel > .section-header {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}
body.night-mode #budget .budget-section-panel {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
body.night-mode #budget .budget-section-panel > .section-header {
  border-bottom-color: rgba(255,255,255,.10);
}
body.night-mode #budget .budget-section-panel > .section-header .ghost-btn {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.26);
  color: #fff;
}
body.night-mode #budget .budget-section-panel > .section-header .ghost-btn:hover {
  background: rgba(255,255,255,.18);
}


/* v43 percentile age stepper alignment */
#percentile .number-enhanced > input {
  padding-right: 58px;
}
#percentile .number-enhanced .stepper-buttons {
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 28px;
  height: 40px;
  grid-template-rows: repeat(2, 18px);
  gap: 4px;
  align-content: center;
  justify-items: center;
}
#percentile .number-enhanced .stepper-btn {
  width: 100%;
  height: 18px;
  border-radius: 6px;
}
#percentile .number-enhanced .stepper-btn span {
  font-size: 13px;
  line-height: 1;
}
body.night-mode #percentile .number-enhanced .stepper-btn {
  color: #e5edf9;
}


/* v44 percentile age steppers true centering */
#percentile .field .input-enhanced.number-enhanced {
  display: block;
}
#percentile .field .input-enhanced.number-enhanced > input {
  min-height: 56px;
  padding-right: 62px;
}
#percentile .field .input-enhanced.number-enhanced .stepper-buttons {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  width: 20px;
  height: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 0;
}
#percentile .field .input-enhanced.number-enhanced .stepper-btn {
  width: 20px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
#percentile .field .input-enhanced.number-enhanced .stepper-btn span {
  display: block;
  line-height: 1;
  font-size: 14px;
}


/* v45 move snapshot history to Dashboard */
.dashboard-history-panel {
  min-width: 0;
}
.snapshot-history-scroll {
  max-height: 340px;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 16px;
}
.snapshot-history-scroll table {
  min-width: 760px;
}
.snapshot-history-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
body.night-mode .snapshot-history-scroll thead th {
  background: #111827;
}


/* v46 remove projection primary metric badge */
#projection .projection-summary-cards > div:nth-child(1)::after,
body.night-mode #projection .projection-summary-cards > div:nth-child(1)::after {
  content: none;
  display: none;
}


/* v47 remove period field from Accounts snapshot meta */
#networth .snapshot-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}


/* v49 place Accounts summary strip at top */
.account-total-strip {
  margin-top: 0;
  margin-bottom: 12px;
}


/* v50 account summary color consistency */
.account-total-strip div:nth-child(1) {
  border-top-color: var(--asset-current);
}
.account-total-strip div:nth-child(2) {
  border-top-color: var(--danger);
}
.account-total-strip div:nth-child(3) {
  border-top-color: var(--asset-long);
}
.account-total-strip div:nth-child(4) {
  border-top-color: var(--danger);
}
body.night-mode .account-total-strip div:nth-child(1) {
  border-top-color: var(--asset-current);
}
body.night-mode .account-total-strip div:nth-child(2) {
  border-top-color: var(--danger);
}
body.night-mode .account-total-strip div:nth-child(3) {
  border-top-color: var(--asset-long);
}
body.night-mode .account-total-strip div:nth-child(4) {
  border-top-color: var(--danger);
}


/* v52 settings user guide */
.settings-help-panel {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
}
.settings-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.settings-guide-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, .92);
}
.settings-guide-card h4 {
  margin: 0 0 10px;
  font-size: 1rem;
  letter-spacing: -.025em;
}
.settings-guide-card ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 7px;
  color: var(--muted);
  line-height: 1.45;
}
.settings-guide-card li strong {
  color: var(--ink);
}
body.night-mode .settings-help-panel,
body.night-mode .settings-guide-card {
  background: var(--panel-soft);
  border-color: var(--border);
}
body.night-mode .settings-guide-card ul {
  color: var(--muted);
}
body.night-mode .settings-guide-card li strong {
  color: var(--ink);
}
@media (max-width: 820px) {
  .settings-guide-grid {
    grid-template-columns: 1fr;
  }
}


/* v53 information tab */
.nav-btn-info {
  width: 40px;
  padding-inline: 0;
  font-weight: 900;
  letter-spacing: .02em;
}
#info {
  max-width: 1180px;
  margin-inline: auto;
}
#info .settings-guide-grid {
  margin-top: 4px;
}
#info .settings-guide-card {
  height: 100%;
}


/* v54 info tab icon */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.nav-btn-info {
  min-width: 48px;
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.info-nav-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0f1f4b;
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.nav-btn-info:hover .info-nav-icon {
  background: #16306f;
}
.nav-btn-info.active .info-nav-icon {
  background: rgba(255,255,255,.18);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}
body.night-mode .nav-btn-info .info-nav-icon {
  background: #223a7d;
}
body.night-mode .nav-btn-info:hover .info-nav-icon {
  background: #2a4696;
}
body.night-mode .nav-btn-info.active .info-nav-icon {
  background: rgba(255,255,255,.16);
}


/* v56 individual account projection */
.individual-account-projection-panel {
  margin-bottom: 20px;
}
.account-projection-form {
  grid-template-columns: minmax(260px, 520px);
  margin-bottom: 14px;
}
.account-projection-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.account-projection-cards > div {
  min-height: 116px;
}
.account-projection-cards > div:nth-child(1) {
  border-top-color: var(--brand);
}
.account-projection-cards > div:nth-child(2) {
  border-top-color: var(--asset-current);
}
.account-projection-cards > div:nth-child(3) {
  border-top-color: var(--asset-long);
}
.account-projection-cards > div:nth-child(4) {
  border-top-color: var(--accent-purple);
}
.account-projection-cards > div:nth-child(5) {
  border-top-color: var(--accent-pink);
}
.account-projection-cards strong {
  font-size: clamp(1.05rem, 1.45vw, 1.55rem);
}
.account-projection-table-wrap {
  margin-top: 14px;
  max-height: 340px;
  overflow: auto;
}
@media (max-width: 1100px) {
  .account-projection-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .account-projection-cards,
  .account-projection-form {
    grid-template-columns: 1fr;
  }
}


/* v59 highlight Projection tab dropdowns */
#projection select {
  font-weight: 900;
  color: var(--ink);
  border: 2px solid rgba(37, 99, 235, .34);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .055), rgba(20, 184, 166, .045)),
    #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .07);
  min-height: 48px;
}
#projection select:hover {
  border-color: rgba(37, 99, 235, .55);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .08), rgba(20, 184, 166, .06)),
    #ffffff;
}
#projection select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .16), 0 10px 22px rgba(37, 99, 235, .10);
}
#projection select option {
  font-weight: 800;
}
#projection .field:has(select) > span {
  color: var(--brand);
  font-weight: 950;
}
body.night-mode #projection select {
  color: #f3f7ff;
  border-color: rgba(96, 165, 250, .55);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .16), rgba(20, 184, 166, .08)),
    var(--panel-soft);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
}
body.night-mode #projection select:hover,
body.night-mode #projection select:focus {
  border-color: #60a5fa;
}
body.night-mode #projection .field:has(select) > span {
  color: #93c5fd;
}


/* v60 highlight remaining Projection numeric selector controls */
#projection .projection-age-controls .field > span,
#projection .projection-basic-form .field > span {
  color: var(--brand);
  font-weight: 950;
}
#projection .projection-age-controls .input-enhanced.number-enhanced > input,
#projection .projection-basic-form .input-enhanced.number-enhanced > input {
  font-weight: 900;
  color: var(--ink);
  border: 2px solid rgba(37, 99, 235, .34);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .055), rgba(20, 184, 166, .045)),
    #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .07);
}
#projection .projection-age-controls .input-enhanced.number-enhanced > input:hover,
#projection .projection-basic-form .input-enhanced.number-enhanced > input:hover {
  border-color: rgba(37, 99, 235, .55);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .08), rgba(20, 184, 166, .06)),
    #ffffff;
}
#projection .projection-age-controls .input-enhanced.number-enhanced > input:focus,
#projection .projection-basic-form .input-enhanced.number-enhanced > input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .16), 0 10px 22px rgba(37, 99, 235, .10);
}
#projection .projection-age-controls .input-enhanced.number-enhanced .stepper-buttons,
#projection .projection-basic-form .input-enhanced.number-enhanced .stepper-buttons {
  right: 10px;
  width: 28px;
}
#projection .projection-age-controls .input-enhanced.number-enhanced .stepper-btn,
#projection .projection-basic-form .input-enhanced.number-enhanced .stepper-btn {
  color: var(--brand);
}
#projection .projection-age-controls .input-enhanced.number-enhanced .stepper-btn span,
#projection .projection-basic-form .input-enhanced.number-enhanced .stepper-btn span {
  font-size: 14px;
  font-weight: 950;
}
#projection .projection-age-controls .input-enhanced.number-enhanced .stepper-btn:hover,
#projection .projection-basic-form .input-enhanced.number-enhanced .stepper-btn:hover {
  color: #1d4ed8;
}
body.night-mode #projection .projection-age-controls .field > span,
body.night-mode #projection .projection-basic-form .field > span {
  color: #93c5fd;
}
body.night-mode #projection .projection-age-controls .input-enhanced.number-enhanced > input,
body.night-mode #projection .projection-basic-form .input-enhanced.number-enhanced > input {
  color: #f3f7ff;
  border-color: rgba(96, 165, 250, .55);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .16), rgba(20, 184, 166, .08)),
    var(--panel-soft);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
}
body.night-mode #projection .projection-age-controls .input-enhanced.number-enhanced > input:hover,
body.night-mode #projection .projection-basic-form .input-enhanced.number-enhanced > input:hover,
body.night-mode #projection .projection-age-controls .input-enhanced.number-enhanced > input:focus,
body.night-mode #projection .projection-basic-form .input-enhanced.number-enhanced > input:focus {
  border-color: #60a5fa;
}
body.night-mode #projection .projection-age-controls .input-enhanced.number-enhanced .stepper-btn,
body.night-mode #projection .projection-basic-form .input-enhanced.number-enhanced .stepper-btn {
  color: #bfdbfe;
}
body.night-mode #projection .projection-age-controls .input-enhanced.number-enhanced .stepper-btn:hover,
body.night-mode #projection .projection-basic-form .input-enhanced.number-enhanced .stepper-btn:hover {
  color: #ffffff;
}


/* v61 custom account categories */
.account-group-header.customCategory { color: #ffffff; }
#addCategoryBtn { border-color: rgba(37, 99, 235, .24); }
#categoryDialog select { font-weight: 800; }
#projection .projection-group-row.theme-custom .projection-group-label { background: var(--accent-purple); color: #fff; }
#projection .projection-account-row.theme-custom td:first-child { border-left: 4px solid rgba(139, 92, 246, .42); }
body.night-mode #projection .projection-group-row.theme-custom .projection-group-label { background: rgba(139, 92, 246, .72); color: #fff; }



/* v62 delete overarching account categories */
.account-group-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.category-delete-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 1.12rem;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.category-delete-btn:hover {
  transform: translateY(-1px);
  background: rgba(220, 38, 38, .95);
  border-color: rgba(255,255,255,.65);
}
.category-delete-btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255,255,255,.20);
}
body.night-mode .category-delete-btn {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.28);
  color: #fff;
}
body.night-mode .category-delete-btn:hover {
  background: rgba(239, 68, 68, .95);
}


/* v65 Accounts current value guidance */
.accounts-current-value-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 14px 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(37, 99, 235, .22);
  border-left: 5px solid var(--brand);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(20, 184, 166, .06)),
    #ffffff;
  color: var(--ink);
}
.accounts-current-value-note .note-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
  margin-top: 1px;
}
.accounts-current-value-note strong {
  display: block;
  font-weight: 900;
  letter-spacing: -.01em;
}
.accounts-current-value-note p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
.accounts-current-value-note p strong {
  display: inline;
  color: var(--brand);
}
body.night-mode .accounts-current-value-note {
  border-color: rgba(96, 165, 250, .32);
  border-left-color: #60a5fa;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .18), rgba(20, 184, 166, .10)),
    var(--panel-soft);
  color: #f3f7ff;
}
body.night-mode .accounts-current-value-note p {
  color: #cbd5e1;
}
body.night-mode .accounts-current-value-note p strong {
  color: #93c5fd;
}
body.night-mode .accounts-current-value-note .note-icon {
  background: #60a5fa;
  color: #08111f;
}


/* v66 clickable Projection note link */
.projection-note-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 900;
  color: #8b5cf6;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.projection-note-link:hover {
  color: #7c3aed;
}
.projection-note-link:focus-visible {
  outline: 2px solid rgba(139, 92, 246, .35);
  outline-offset: 2px;
  border-radius: 4px;
}
body.night-mode .projection-note-link {
  color: #c4b5fd;
}
body.night-mode .projection-note-link:hover {
  color: #ddd6fe;
}


/* v67 move projected net worth chart into Future value milestone section */
.projection-summary-chart {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.projection-summary-chart-header {
  margin-bottom: 12px;
}
.projection-summary-chart .projection-basic-form {
  margin-bottom: 12px;
}
.projection-summary-chart .horizontal-chart {
  min-height: 260px;
}
body.night-mode .projection-summary-chart {
  border-top-color: rgba(148, 163, 184, .22);
}


/* v68 embed individual account projection inside account-type assumptions */
.projection-assumptions-panel {
  display: grid;
  gap: 18px;
}
.embedded-account-projection {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .045), rgba(20, 184, 166, .035)),
    var(--panel-soft);
}
.embedded-account-projection-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
}
.embedded-account-projection h4 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -.035em;
}
.embedded-account-projection .account-projection-form {
  margin: 0;
}
.embedded-account-projection .account-projection-cards {
  margin-bottom: 12px;
}
.embedded-account-projection .horizontal-chart {
  min-height: 240px;
}
body.night-mode .embedded-account-projection {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .12), rgba(20, 184, 166, .08)),
    var(--panel-soft);
  border-color: rgba(148, 163, 184, .22);
}
@media (max-width: 900px) {
  .embedded-account-projection-header {
    grid-template-columns: 1fr;
  }
}


/* v70 Percentile page ordering */
#percentile .percentile-breakpoints-panel {
  grid-column: 1 / -1;
}


/* v71 Percentile side-by-side calculator and rank */
#percentile .dashboard-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}
@media (max-width: 900px) {
  #percentile .dashboard-grid {
    grid-template-columns: 1fr;
  }
}


/* v72 Percentile equal-height top panels */
#percentile .dashboard-grid {
  align-items: stretch;
}
#percentile .dashboard-grid > .panel:nth-child(1),
#percentile .dashboard-grid > .panel:nth-child(2) {
  align-self: stretch;
  height: 100%;
}
#percentile .dashboard-grid > .panel:nth-child(1) {
  display: flex;
  flex-direction: column;
}
#percentile .dashboard-grid > .panel:nth-child(1) .percentile-result {
  margin-top: auto;
}
#percentile .percentile-breakpoints-panel {
  align-self: start;
}
@media (max-width: 900px) {
  #percentile .dashboard-grid > .panel:nth-child(1),
  #percentile .dashboard-grid > .panel:nth-child(2) {
    height: auto;
  }
  #percentile .dashboard-grid > .panel:nth-child(1) .percentile-result {
    margin-top: 18px;
  }
}


/* v73 Percentile stacked horizontal layout */
#percentile .dashboard-grid {
  grid-template-columns: 1fr;
  align-items: start;
}
#percentile .dashboard-grid > .panel:nth-child(1),
#percentile .dashboard-grid > .panel:nth-child(2) {
  align-self: start;
  height: auto;
}
#percentile .dashboard-grid > .panel:nth-child(1) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
  grid-template-areas:
    "header header"
    "form result"
    "actions result";
  gap: 16px 24px;
  align-items: start;
}
#percentile .dashboard-grid > .panel:nth-child(1) > .section-header {
  grid-area: header;
  margin-bottom: 0;
}
#percentile .dashboard-grid > .panel:nth-child(1) > .percentile-form {
  grid-area: form;
  margin-bottom: 0;
}
#percentile .dashboard-grid > .panel:nth-child(1) > .percentile-actions {
  grid-area: actions;
  margin: 0;
}
#percentile .dashboard-grid > .panel:nth-child(1) > .percentile-result {
  grid-area: result;
  margin-top: 0;
  align-self: stretch;
}
#percentile .dashboard-grid > .panel:nth-child(1) > .percentile-result .result-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#percentile .dashboard-grid > .panel:nth-child(2) {
  display: grid;
  grid-template-columns: minmax(260px, .55fr) minmax(0, 1fr);
  grid-template-areas:
    "rank-header rank-header"
    "gauge cards";
  gap: 18px 24px;
}
#percentile .dashboard-grid > .panel:nth-child(2) > .section-header {
  grid-area: rank-header;
  margin-bottom: 0;
}
#percentile .dashboard-grid > .panel:nth-child(2) > .percentile-gauge {
  grid-area: gauge;
  align-self: center;
}
#percentile .dashboard-grid > .panel:nth-child(2) > #percentileSummaryCards {
  grid-area: cards;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-self: stretch;
}
#percentile .percentile-breakpoints-panel {
  grid-column: 1 / -1;
}
@media (max-width: 1100px) {
  #percentile .dashboard-grid > .panel:nth-child(2) > #percentileSummaryCards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  #percentile .dashboard-grid > .panel:nth-child(1),
  #percentile .dashboard-grid > .panel:nth-child(2) {
    display: block;
  }
  #percentile .dashboard-grid > .panel:nth-child(1) > .percentile-result {
    margin-top: 18px;
  }
  #percentile .dashboard-grid > .panel:nth-child(2) > #percentileSummaryCards {
    grid-template-columns: 1fr;
  }
}

/* v76 tighter budget summary cards */
#budget .budget-summary-cards > div:nth-child(1) strong { line-height: 1; }


/* v77 draggable individual accounts */
.compact-account-row {
  grid-template-columns: 24px minmax(115px, 1.1fr) minmax(120px, .9fr) minmax(90px, 125px) 28px;
}
.account-drag-handle {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted-2);
  cursor: grab;
  user-select: none;
  font-size: .78rem;
  letter-spacing: -.18em;
  padding-right: 3px;
}
.account-drag-handle:active { cursor: grabbing; }
.account-drag-handle:hover {
  color: var(--brand);
  border-color: rgba(37, 99, 235, .35);
  background: rgba(37, 99, 235, .07);
}
.compact-account-row.account-dragging {
  opacity: .55;
  transform: scale(.995);
}
.compact-account-row.account-drag-over {
  box-shadow: inset 0 3px 0 var(--brand);
  background: transparent;
}
.compact-account-row.account-drop-after {
  box-shadow: inset 0 -3px 0 var(--brand);
  background: transparent;
}
.account-rows.account-list-drag-over {
  outline: 0;
  outline-offset: 0;
  background: transparent;
  box-shadow: inset 0 3px 0 var(--brand);
}
body.night-mode .account-drag-handle {
  color: #cbd5e1;
  border-color: var(--border-strong);
  background: rgba(148, 163, 184, .08);
}
body.night-mode .account-drag-handle:hover {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, .5);
  background: rgba(96, 165, 250, .12);
}
body.night-mode .compact-account-row.account-drag-over,
body.night-mode .compact-account-row.account-drop-after,
body.night-mode .account-rows.account-list-drag-over {
  background: transparent;
}
@media (max-width: 760px) {
  .compact-account-row {
    grid-template-columns: 1fr;
  }
  .account-drag-handle {
    width: 100%;
    justify-content: center;
  }
}


/* v78 show full account names in Projected by account type selector */
.embedded-account-projection-header {
  grid-template-columns: 1fr;
  align-items: start;
}
.embedded-account-projection .account-projection-form {
  width: 100%;
  max-width: none;
  grid-template-columns: 1fr;
}
.embedded-account-projection .account-projection-form .field,
.embedded-account-projection #projectionAccountSelect {
  width: 100%;
  max-width: none;
}
.embedded-account-projection #projectionAccountSelect {
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  line-height: 1.2;
  white-space: normal;
  text-overflow: clip;
}


/* v79 place account selector to the right in embedded account projection */
.embedded-account-projection-header {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 620px);
  align-items: start;
}
.embedded-account-projection .account-projection-form {
  justify-self: end;
  width: 100%;
  max-width: 620px;
}
.embedded-account-projection .account-projection-form .field {
  width: 100%;
}
.embedded-account-projection .account-projection-form select {
  width: 100%;
}
@media (max-width: 900px) {
  .embedded-account-projection-header {
    grid-template-columns: 1fr;
  }
  .embedded-account-projection .account-projection-form {
    justify-self: stretch;
    max-width: none;
  }
}


/* v81 budget row drag-and-drop ordering */
.budget-draggable-row {
  grid-template-columns: 24px minmax(0, 1fr) minmax(120px, 170px) 44px;
  align-items: center;
}
.budget-row-drag-handle {
  color: var(--muted-2);
  font-weight: 900;
  letter-spacing: -0.18em;
  cursor: grab;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-height: 34px;
  padding-right: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  transition: color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.budget-row-drag-handle:hover,
.budget-row-drag-handle:focus-visible {
  color: var(--brand);
  border-color: rgba(37, 99, 235, .42);
  background: rgba(37, 99, 235, .08);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
  outline: none;
}
.budget-row-drag-handle:active { cursor: grabbing; }
.budget-draggable-row.dragging {
  opacity: .55;
}
.budget-draggable-row.drag-over {
  outline: 2px dashed rgba(37, 99, 235, .45);
  outline-offset: 3px;
  border-radius: 10px;
}
body.night-mode .budget-row-drag-handle {
  color: #94a3b8;
  border-color: var(--border-strong);
  background: rgba(148, 163, 184, .08);
}
body.night-mode .budget-row-drag-handle:hover,
body.night-mode .budget-row-drag-handle:focus-visible {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, .5);
  background: rgba(96, 165, 250, .12);
}
body.night-mode .budget-draggable-row.drag-over {
  outline-color: rgba(96, 165, 250, .55);
}
@media (max-width: 720px) {
  .budget-draggable-row {
    grid-template-columns: 24px 1fr;
  }
  .budget-draggable-row input,
  .budget-draggable-row .remove-row {
    grid-column: 2;
  }
}

/* v81 final budget row grid override */
.budget-grid .budget-draggable-row, .allocation-list .budget-draggable-row { grid-template-columns: 24px minmax(0, 1fr) minmax(120px, 170px) 44px; }
@media (max-width: 720px) { .budget-grid .budget-draggable-row, .allocation-list .budget-draggable-row { grid-template-columns: 24px 1fr; } }


/* v82 editable overarching account category titles */
.category-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.category-title-input {
  min-width: 0;
  width: min(280px, 42vw);
  max-width: 100%;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 10px;
  padding: 8px 12px;
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.1;
  outline: none;
}
.category-title-input::placeholder {
  color: rgba(255,255,255,0.82);
}
.category-title-input:focus {
  background: rgba(255,255,255,0.24);
  border-color: rgba(255,255,255,0.75);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.16);
}
body:not(.night-mode) .category-title-input {
  color: #ffffff;
}
@media (max-width: 720px) {
  .category-title-input {
    width: min(220px, 56vw);
    font-size: 0.95rem;
    padding: 7px 10px;
  }
}


/* v83 editable category header titles */
.account-group-header .category-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
.account-group-header .drag-handle {
  flex: 0 0 auto;
}
.account-group-header .category-title-input {
  min-width: 90px;
  width: min(290px, 34vw);
  max-width: 100%;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #ffffff;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  padding: 6px 8px;
  outline: none;
}
.account-group-header .category-title-input:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}
.account-group-header .category-title-input:focus {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.7);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.16);
}
.account-group-header .category-title-input::selection {
  background: rgba(255,255,255,0.34);
}
@media (max-width: 760px) {
  .account-group-header .category-title-input {
    width: min(230px, 46vw);
    font-size: 0.96rem;
  }
}


/* v84 external car valuation link */
.car-external-value-panel {
  margin-top: 20px;
}
.external-value-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(20, 184, 166, .06)),
    var(--panel-soft);
}
.external-value-card h4 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  letter-spacing: -.035em;
}
.external-value-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.external-value-link {
  white-space: nowrap;
  text-decoration: none;
}
body.night-mode .external-value-card {
  border-color: rgba(148, 163, 184, .24);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .16), rgba(20, 184, 166, .10)),
    var(--panel-soft);
}
body.night-mode .external-value-card p {
  color: #cbd5e1;
}
@media (max-width: 760px) {
  .external-value-card {
    flex-direction: column;
    align-items: stretch;
  }
  .external-value-link {
    width: 100%;
    text-align: center;
  }
}


/* v88 settings tab top alignment and cleanup */
#settings.active-view {
  display: block;
  padding-top: 0;
  margin-top: 0;
}
#settings > .panel:first-child {
  margin-top: 0;
}
#settings .panel {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}


/* v89: move recommended max car budget to top of affordability section */
.car-result-top {
  margin-top: 0;
  margin-bottom: 18px;
}



/* v90: tighten percentile summary cards to remove extra white space */
#percentileSummaryCards {
  gap: 16px;
  align-items: start;
}
#percentileSummaryCards > div {
  min-height: 0 !important;
  height: auto !important;
  padding: 18px 28px 20px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 10px !important;
}
#percentileSummaryCards > div span {
  line-height: 1.15;
  margin: 0;
}
#percentileSummaryCards > div strong {
  line-height: 1.05;
  margin: 0;
}



/* v91 inflation-adjusted projection values */
.projection-age-controls {
  grid-template-columns: minmax(145px, 170px) minmax(145px, 170px) minmax(145px, 170px) minmax(240px, 1fr);
}
.projection-summary-cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.projection-summary-cards > div:nth-child(5) {
  border-top: 4px solid var(--brand);
}
#projection .projection-summary-cards > div:nth-child(5) {
  border: 2px solid var(--brand);
  border-top-width: 8px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .10);
}
body.night-mode #projection .projection-summary-cards > div:nth-child(5) {
  border-color: var(--brand);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .16);
}
.projection-group-total-stack {
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: right;
}
.projection-group-total-stack div {
  display: grid;
  gap: 2px;
}
.projection-group-total-stack span {
  font-size: .68rem !important;
  opacity: .85;
}
.projection-group-total-stack strong {
  color: inherit;
  font-size: .95rem;
  letter-spacing: -.02em;
}
#projection .projection-assumptions-wrap th,
#projection .projection-assumptions-wrap td {
  vertical-align: middle;
}
@media (max-width: 1250px) {
  .projection-summary-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .projection-group-total-stack {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
@media (max-width: 900px) {
  .projection-age-controls,
  .projection-summary-cards {
    grid-template-columns: 1fr;
  }
  .projection-group-label {
    align-items: flex-start;
    flex-direction: column;
  }
  .projection-group-total-stack {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }
}



/* v92 align Future Value age and inflation inputs */
#projection .projection-age-controls {
  align-items: start;
}
#projection .projection-age-controls > .field {
  align-self: start;
}
#projection .projection-age-controls > .field input {
  min-height: 58px;
}
#projection .projection-age-controls > .field small {
  display: block;
  min-height: 1.45em;
  margin-top: 8px;
}
#projection .projection-age-controls > .age-helper-card {
  align-self: start;
}
@media (min-width: 901px) {
  #projection .projection-age-controls {
    grid-template-columns: minmax(160px, 190px) minmax(160px, 190px) minmax(160px, 190px) minmax(240px, 1fr);
  }
}



/* v93: keep projected net worth value inside the Future Value card */
#projection .future-value-grid .metric-card--primary .metric-value,
#projection .future-value-grid .metric-card--primary .milestone-amount,
#projection .future-value-grid .metric-card--primary .primary-metric-value {
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

#projection .future-value-grid .metric-card--primary,
#projection .future-value-grid .milestone-card--primary,
#projection .future-value-grid .future-value-primary-card {
  overflow: hidden;
}

@media (max-width: 900px) {
  #projection .future-value-grid .metric-card--primary .metric-value,
  #projection .future-value-grid .metric-card--primary .milestone-amount,
  #projection .future-value-grid .metric-card--primary .primary-metric-value {
    font-size: clamp(2.35rem, 9vw, 4.25rem);
  }
}




/* v94: force Future Value projected net worth amount to fit inside its card */
#projection #projectionCards.projection-summary-cards > div:first-child {
  overflow: hidden !important;
  min-width: 0 !important;
}

#projection #projectionCards.projection-summary-cards > div:first-child strong {
  display: block !important;
  max-width: 100% !important;
  min-width: 0 !important;
  font-size: clamp(2.25rem, 3.15vw, 3.75rem) !important;
  line-height: 0.95 !important;
  letter-spacing: -0.085em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
}

/* Keep all Future Value card amounts from crowding their cards on narrower screens */
#projection #projectionCards.projection-summary-cards > div strong {
  max-width: 100%;
  overflow-wrap: normal;
}

@media (max-width: 1250px) {
  #projection #projectionCards.projection-summary-cards > div:first-child strong {
    font-size: clamp(2.1rem, 5vw, 3.25rem) !important;
  }
}

@media (max-width: 760px) {
  #projection #projectionCards.projection-summary-cards > div:first-child strong {
    font-size: clamp(2rem, 10vw, 3rem) !important;
    letter-spacing: -0.075em !important;
  }
}

/* v95: make Future Value card amount typography consistent and keep values inside cards */
#projection #projectionCards.projection-summary-cards > div {
  min-width: 0 !important;
}

#projection #projectionCards.projection-summary-cards > div strong,
#projection #projectionCards.projection-summary-cards > div:first-child strong {
  display: block !important;
  max-width: 100% !important;
  min-width: 0 !important;
  font-size: clamp(1.45rem, 1.75vw, 2.05rem) !important;
  line-height: 1.05 !important;
  letter-spacing: -0.06em !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  font-variant-numeric: tabular-nums !important;
}

#projection #projectionCards.projection-summary-cards > div span {
  font-size: .78rem !important;
  line-height: 1.18 !important;
}

#projection #projectionCards.projection-summary-cards > div small {
  font-size: .82rem !important;
  line-height: 1.35 !important;
}

@media (max-width: 1250px) {
  #projection #projectionCards.projection-summary-cards > div strong,
  #projection #projectionCards.projection-summary-cards > div:first-child strong {
    font-size: clamp(1.55rem, 3.2vw, 2.05rem) !important;
  }
}

@media (max-width: 760px) {
  #projection #projectionCards.projection-summary-cards > div strong,
  #projection #projectionCards.projection-summary-cards > div:first-child strong {
    font-size: clamp(1.65rem, 8vw, 2.15rem) !important;
  }
}

/* v96: split Projection assumptions so payoff fields only appear for liabilities */
#projection .projection-assumptions-wrap {
  padding: 0;
}

#projection .projection-assumptions-section {
  min-width: max-content;
}

#projection .projection-assumptions-section + .projection-assumptions-section {
  border-top: 1px solid var(--border);
  margin-top: 18px;
  padding-top: 18px;
}

#projection .projection-assumptions-subhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px 8px;
}

#projection .projection-assumptions-subhead h4 {
  margin: 4px 0 0;
  font-size: 1rem;
  letter-spacing: -.025em;
}

#projection .projection-assumptions-subhead p:not(.eyebrow) {
  margin: 6px 0 0;
}

#projection .projection-assumptions-wrap table {
  margin: 0;
}

#projection .projection-assumptions-wrap .projection-assets-table {
  min-width: 920px;
}

#projection .projection-assumptions-wrap .projection-liabilities-table {
  min-width: 1120px;
}

#projection .projection-assets-table th:last-child,
#projection .projection-assets-table td:last-child {
  padding-right: 24px;
}

body.night-mode #projection .projection-assumptions-section + .projection-assumptions-section {
  border-color: var(--border);
}


/* v98: compact liabilities table so all columns fit without horizontal scrolling */
#projection .projection-assumptions-section {
  min-width: 0;
}
#projection .projection-assumptions-wrap table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
#projection .projection-assumptions-wrap .projection-assets-table,
#projection .projection-assumptions-wrap .projection-liabilities-table {
  min-width: 0;
}
#projection .projection-assumptions-wrap .projection-liabilities-table th,
#projection .projection-assumptions-wrap .projection-liabilities-table td {
  padding: 10px 12px;
  font-size: .9rem;
  white-space: normal;
  word-break: break-word;
}
#projection .projection-liabilities-table th {
  line-height: 1.15;
}
#projection .projection-liabilities-table td small {
  font-size: .72rem;
  line-height: 1.25;
}
#projection .projection-liabilities-table .return-input,
#projection .projection-liabilities-table .payoff-years-input {
  width: 100%;
  max-width: 82px;
}
#projection .projection-liabilities-table .inline-payoff-control,
#projection .projection-liabilities-table .inline-payoff-payment {
  min-width: 0;
  gap: 3px;
}
#projection .projection-liabilities-table .inline-payoff-payment strong,
#projection .projection-liabilities-table .inline-payoff-control strong {
  font-size: .82rem;
}
#projection .projection-liabilities-table .projection-group-total-stack {
  gap: 12px;
}
#projection .projection-liabilities-table .projection-group-total-stack span {
  font-size: .62rem !important;
}
#projection .projection-liabilities-table .projection-group-total-stack strong {
  font-size: .82rem;
}
#projection .projection-liabilities-table th:nth-child(1),
#projection .projection-liabilities-table td:nth-child(1) { width: 21%; }
#projection .projection-liabilities-table th:nth-child(2),
#projection .projection-liabilities-table td:nth-child(2) { width: 11%; }
#projection .projection-liabilities-table th:nth-child(3),
#projection .projection-liabilities-table td:nth-child(3) { width: 9%; }
#projection .projection-liabilities-table th:nth-child(4),
#projection .projection-liabilities-table td:nth-child(4) { width: 10%; }
#projection .projection-liabilities-table th:nth-child(5),
#projection .projection-liabilities-table td:nth-child(5) { width: 12%; }
#projection .projection-liabilities-table th:nth-child(6),
#projection .projection-liabilities-table td:nth-child(6) { width: 9%; }
#projection .projection-liabilities-table th:nth-child(7),
#projection .projection-liabilities-table td:nth-child(7) { width: 10%; }
#projection .projection-liabilities-table th:nth-child(8),
#projection .projection-liabilities-table td:nth-child(8) { width: 10%; }
@media (max-width: 1180px) {
  #projection .projection-assumptions-wrap {
    overflow-x: auto;
  }
  #projection .projection-assumptions-wrap .projection-liabilities-table {
    min-width: 980px;
  }
}

/* v101: payoff timeline can be entered in months or years */
.payoff-timeline-fields {
  display: grid;
  grid-template-columns: minmax(58px, 76px) minmax(76px, 88px);
  gap: 6px;
  align-items: center;
}
.payoff-timeline-fields .payoff-years-input {
  max-width: 76px;
}
.payoff-timeline-fields .payoff-unit-select {
  max-width: 88px;
  padding-left: 8px;
  padding-right: 8px;
  font-weight: 850;
}
#projection .projection-liabilities-table .payoff-timeline-fields .return-input {
  max-width: none;
}
#projection .projection-liabilities-table .payoff-timeline-fields .payoff-years-input {
  max-width: 76px;
}
#projection .projection-liabilities-table .payoff-timeline-fields .payoff-unit-select {
  max-width: 88px;
}
#projection .projection-liabilities-table th:nth-child(7),
#projection .projection-liabilities-table td:nth-child(7) { width: 13%; }
#projection .projection-liabilities-table th:nth-child(1),
#projection .projection-liabilities-table td:nth-child(1) { width: 19%; }
#projection .projection-liabilities-table th:nth-child(5),
#projection .projection-liabilities-table td:nth-child(5) { width: 11%; }

/* v102: give payoff timeline values enough room beside the custom arrows */
#projection .projection-liabilities-table th:nth-child(1),
#projection .projection-liabilities-table td:nth-child(1) { width: 18%; }
#projection .projection-liabilities-table th:nth-child(2),
#projection .projection-liabilities-table td:nth-child(2) { width: 10%; }
#projection .projection-liabilities-table th:nth-child(4),
#projection .projection-liabilities-table td:nth-child(4) { width: 9%; }
#projection .projection-liabilities-table th:nth-child(5),
#projection .projection-liabilities-table td:nth-child(5) { width: 10%; }
#projection .projection-liabilities-table th:nth-child(6),
#projection .projection-liabilities-table td:nth-child(6) { width: 8%; }
#projection .projection-liabilities-table th:nth-child(7),
#projection .projection-liabilities-table td:nth-child(7) { width: 17%; }

#projection .projection-liabilities-table .payoff-timeline-control {
  width: 100%;
}

#projection .projection-liabilities-table .payoff-timeline-fields {
  grid-template-columns: minmax(104px, 1fr) minmax(78px, 88px);
  gap: 8px;
  width: 100%;
}

#projection .projection-liabilities-table .payoff-timeline-fields .input-enhanced.number-enhanced {
  width: 100%;
  min-width: 104px;
}

#projection .projection-liabilities-table .payoff-timeline-fields .input-enhanced.number-enhanced > input.payoff-years-input {
  max-width: none;
  width: 100%;
  min-width: 104px;
  padding-left: 12px;
  padding-right: 46px;
  text-align: center;
}

#projection .projection-liabilities-table .payoff-timeline-fields .input-enhanced.number-enhanced .stepper-buttons {
  right: 10px;
}

#projection .projection-liabilities-table .payoff-timeline-fields .payoff-unit-select {
  width: 100%;
  max-width: none;
  text-align: left;
}


/* Landing page */
.landing-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 32rem),
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.14), transparent 28rem),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 52%, #ffffff 100%);
}
.landing-shell {
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 24px 0 34px;
}
.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}
.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 950;
  letter-spacing: -0.04em;
}
.landing-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.landing-nav a {
  color: #4b5565;
  text-decoration: none;
  font-weight: 850;
  padding: 10px 12px;
  border-radius: 999px;
}
.landing-nav a:hover {
  background: var(--brand-soft);
  color: var(--brand);
}
.landing-hero {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  gap: 48px;
  align-items: center;
  padding: 54px 0 62px;
}
.landing-hero-copy h1 {
  margin: 12px 0 0;
  font-family: var(--display-font);
  font-size: clamp(3.4rem, 7.8vw, 6.4rem);
  line-height: .9;
  letter-spacing: -.078em;
  color: var(--ink);
  max-width: 900px;
}
.landing-lede {
  margin: 24px 0 0;
  color: #4b5565;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.65;
  max-width: 680px;
}
.landing-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.landing-cta .primary-btn,
.landing-cta .ghost-btn,
.landing-final-cta .primary-btn,
.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.landing-primary,
.landing-secondary {
  min-height: 48px;
}
.landing-trust-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  color: var(--muted);
  font-weight: 760;
}
.landing-trust-note::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 5px var(--success-soft);
}
.landing-preview {
  align-self: stretch;
  display: grid;
  align-items: center;
}
.preview-window {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.88);
  border-radius: 28px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.14);
  overflow: hidden;
  padding: 18px;
  transform: rotate(1.4deg);
}
.preview-window-bar {
  display: flex;
  gap: 7px;
  padding: 4px 2px 14px;
}
.preview-window-bar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d7deeb;
}
.preview-hero-card {
  padding: 24px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .18), transparent 15rem),
    linear-gradient(135deg, #eff6ff, #f0fdfa);
}
.preview-hero-card span,
.preview-card-grid span {
  color: var(--muted-2);
  font-weight: 900;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.preview-hero-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(2.7rem, 6vw, 4rem);
  letter-spacing: -.07em;
  line-height: .95;
}
.preview-hero-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}
.preview-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.preview-card-grid div {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}
.preview-card-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.24rem;
  letter-spacing: -.04em;
}
.preview-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 120px;
  padding: 18px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}
.preview-chart span {
  flex: 1;
  min-height: 22px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, var(--brand), var(--asset-fund));
}
.landing-section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}
.landing-section-header {
  max-width: 720px;
  margin-bottom: 28px;
}
.landing-section-header h2,
.landing-privacy h2,
.landing-final-cta h2 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
  letter-spacing: -.065em;
}
.landing-section-header p:not(.eyebrow) {
  margin: 14px 0 0;
  line-height: 1.65;
}
.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.landing-feature-card,
.landing-steps div,
.privacy-card,
.landing-final-cta {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}
.landing-feature-card {
  padding: 22px;
}
.feature-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 950;
}
.landing-feature-card h3,
.landing-steps h3,
.privacy-card h3 {
  margin: 18px 0 0;
  font-size: 1.08rem;
  letter-spacing: -.03em;
}
.landing-feature-card p,
.landing-steps p,
.landing-privacy p,
.privacy-card li {
  color: var(--muted);
  line-height: 1.58;
}
.landing-how {
  padding-top: 54px;
}
.landing-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.landing-steps div {
  padding: 24px;
}
.landing-steps strong {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #111318;
  color: #fff;
}
.landing-privacy {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(320px, .72fr);
  gap: 34px;
  align-items: center;
}
.privacy-card {
  padding: 24px;
}
.privacy-card ul {
  margin: 16px 0 0;
  padding-left: 20px;
}
.privacy-card li + li {
  margin-top: 10px;
}
.landing-final-cta {
  text-align: center;
  padding: 46px 24px;
  margin: 34px 0;
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, .16), transparent 17rem),
    linear-gradient(135deg, #eff6ff, #ffffff);
}
.landing-final-cta h2 {
  margin-bottom: 24px;
}
.landing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 24px 0 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .92rem;
}
.landing-footer a {
  color: var(--brand);
  font-weight: 850;
  text-decoration: none;
}
body.night-mode .landing-body,
body.night-mode .preview-window,
body.night-mode .preview-card-grid div,
body.night-mode .preview-chart,
body.night-mode .landing-feature-card,
body.night-mode .landing-steps div,
body.night-mode .privacy-card,
body.night-mode .landing-final-cta {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--border);
}
@media (max-width: 980px) {
  .landing-hero,
  .landing-privacy {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .landing-hero {
    min-height: auto;
    padding: 38px 0 52px;
  }
  .landing-feature-grid,
  .landing-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .landing-shell {
    width: min(100% - 28px, 1180px);
    padding-top: 14px;
  }
  .landing-header,
  .landing-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .landing-nav {
    justify-content: flex-start;
  }
  .landing-hero-copy h1 {
    font-size: clamp(2.8rem, 18vw, 4.2rem);
  }
  .landing-feature-grid,
  .landing-steps,
  .preview-card-grid {
    grid-template-columns: 1fr;
  }
  .preview-window {
    transform: none;
  }
}

/* Landing page guided tour update */
.landing-tour-body {
  overflow-x: hidden;
}
.landing-tour-shell {
  width: min(1280px, calc(100vw - 48px));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.landing-tour-main {
  flex: 1;
  display: grid;
  align-items: center;
  padding: 24px 0 38px;
}
.landing-tour-nav .landing-nav-btn {
  border: 0;
  color: #4b5565;
  background: transparent;
  text-decoration: none;
  font-weight: 850;
  padding: 10px 12px;
  border-radius: 999px;
}
.landing-tour-nav .landing-nav-btn:hover,
.landing-tour-nav .landing-nav-btn.active {
  background: var(--brand-soft);
  color: var(--brand);
}
.landing-tour-frame {
  position: relative;
  min-height: min(760px, calc(100vh - 190px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 22px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--border);
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, .15), transparent 24rem),
    radial-gradient(circle at bottom left, rgba(37, 99, 235, .12), transparent 22rem),
    rgba(255, 255, 255, .78);
  box-shadow: 0 30px 90px rgba(15, 23, 42, .10);
  overflow: hidden;
}
.tour-progress-wrap {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 2;
}
.tour-progress-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-2);
  font-size: .78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.tour-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(226, 231, 239, .92);
  overflow: hidden;
}
.tour-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--asset-fund));
  transition: width .28s ease;
}
.tour-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tour-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #cbd5e1;
  transition: width .2s ease, background .2s ease;
}
.tour-dot.active {
  width: 34px;
  background: var(--brand);
}
.tour-slide {
  display: none;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .82fr);
  align-items: center;
  gap: clamp(28px, 5vw, 68px);
  position: relative;
  z-index: 2;
}
.tour-slide.active {
  display: grid;
  animation: tourFadeIn .22s ease both;
}
@keyframes tourFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.tour-copy h1,
.tour-copy h2 {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: clamp(3rem, 7vw, 6.2rem);
  line-height: .88;
  letter-spacing: -.078em;
}
.tour-copy h1 {
  font-family: var(--display-font);
}
.tour-copy h2 {
  max-width: 760px;
}
.tour-copy h1:focus,
.tour-copy h2:focus {
  outline: none;
}
.tour-lede {
  margin: 24px 0 0;
  max-width: 700px;
  color: #4b5565;
  font-size: clamp(1.06rem, 1.8vw, 1.28rem);
  line-height: 1.65;
}
.tour-bullet-list {
  display: grid;
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  max-width: 720px;
}
.tour-bullet-list li {
  position: relative;
  padding-left: 28px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.48;
  font-weight: 720;
}
.tour-bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .42em;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 5px var(--brand-soft);
}
.tour-visual-card {
  padding: clamp(20px, 2.5vw, 30px);
  border: 1px solid var(--border);
  border-radius: 30px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 28px 70px rgba(15, 23, 42, .12);
}
.tour-window-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.tour-window-bar span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #d7deeb;
}
.tour-section-label,
.tour-hero-metric span,
.tour-mini-grid span,
.tour-budget-card span,
.tour-projection-main span {
  color: var(--muted-2);
  font-size: .78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.tour-section-label {
  margin-bottom: 18px;
}
.tour-hero-metric {
  padding: 26px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .18), transparent 14rem),
    linear-gradient(135deg, #eff6ff, #f0fdfa);
}
.tour-hero-metric strong,
.tour-projection-main strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  line-height: .92;
  letter-spacing: -.075em;
}
.tour-hero-metric small,
.tour-projection-main small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.4;
}
.tour-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.tour-mini-grid div,
.tour-account-row,
.tour-total-row,
.tour-budget-card,
.tour-tool-pill {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}
.tour-mini-grid div {
  padding: 18px;
}
.tour-mini-grid strong,
.tour-budget-card strong,
.tour-total-row strong,
.tour-account-row strong {
  display: block;
  margin-top: 8px;
  font-size: 1.24rem;
  letter-spacing: -.04em;
}
.accounts-visual,
.budget-visual,
.projection-visual,
.tools-visual,
.privacy-visual {
  display: grid;
  gap: 12px;
}
.tour-account-row,
.tour-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
}
.tour-account-row span,
.tour-total-row span {
  color: #344054;
  font-weight: 850;
}
.tour-account-row.asset-row {
  border-left: 6px solid var(--asset-current);
}
.tour-account-row.liability-row {
  border-left: 6px solid var(--danger);
}
.tour-total-row {
  color: #fff;
  background: #111318;
  border-color: #111318;
}
.tour-total-row span,
.tour-total-row strong {
  color: #fff;
}
.tour-budget-card {
  padding: 18px 20px;
}
.tour-budget-card.income { border-left: 7px solid var(--success); }
.tour-budget-card.expense { border-left: 7px solid var(--danger); }
.tour-budget-card.allocation { border-left: 7px solid var(--asset-long); }
.tour-budget-card.leftover { border-left: 7px solid var(--brand); }
.tour-projection-main {
  padding: 26px;
  border: 2px solid var(--asset-current);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .14), transparent 14rem),
    linear-gradient(180deg, #ffffff, #eff6ff);
}
.tour-chart {
  display: flex;
  align-items: end;
  gap: 12px;
  height: 170px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fff;
}
.tour-chart span {
  flex: 1;
  min-height: 28px;
  border-radius: 999px 999px 10px 10px;
  background: linear-gradient(180deg, var(--brand), var(--asset-fund));
}
.tour-tool-pill {
  padding: 16px 18px;
  color: #344054;
  font-weight: 900;
  border-left: 7px solid var(--brand);
}
.tour-tool-pill:nth-child(3) { border-left-color: var(--asset-fund); }
.tour-tool-pill:nth-child(4) { border-left-color: var(--asset-long); }
.tour-tool-pill:nth-child(5) { border-left-color: var(--accent-purple); }
.tour-tool-pill:nth-child(6) { border-left-color: var(--accent-pink); }
.tour-tool-pill:nth-child(7) { border-left-color: var(--success); }
.tour-privacy-lock {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 2rem;
  font-weight: 950;
}
.privacy-visual h3 {
  margin: 8px 0 0;
  font-size: 1.55rem;
  letter-spacing: -.045em;
}
.privacy-visual p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.tour-final-btn {
  margin-top: 8px;
  width: max-content;
  text-decoration: none;
}
.tour-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}
.tour-back-btn,
.tour-next-btn {
  min-height: 48px;
}
.tour-back-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}
.tour-next-btn {
  min-width: min(100%, 260px);
}
.tour-final-next {
  box-shadow: 0 16px 34px rgba(37, 99, 235, .28);
}
.landing-tour-footer {
  margin-top: auto;
}
body.night-mode .landing-tour-frame,
body.night-mode .tour-visual-card,
body.night-mode .tour-mini-grid div,
body.night-mode .tour-account-row,
body.night-mode .tour-budget-card,
body.night-mode .tour-tool-pill,
body.night-mode .tour-chart,
body.night-mode .tour-projection-main {
  background: var(--panel);
  border-color: var(--border);
  color: var(--ink);
}
body.night-mode .tour-lede,
body.night-mode .tour-bullet-list li,
body.night-mode .tour-account-row span,
body.night-mode .tour-tool-pill,
body.night-mode .privacy-visual p {
  color: var(--muted);
}
@media (max-width: 1040px) {
  .landing-tour-frame {
    min-height: auto;
  }
  .tour-slide,
  .tour-slide.active {
    grid-template-columns: 1fr;
  }
  .tour-visual-card {
    max-width: none;
  }
}
@media (max-width: 680px) {
  .landing-tour-shell {
    width: min(100% - 28px, 1280px);
  }
  .landing-tour-main {
    padding: 12px 0 28px;
  }
  .landing-tour-frame {
    padding: 18px;
    border-radius: 24px;
  }
  .tour-progress-topline,
  .tour-controls,
  .tour-mini-grid {
    align-items: stretch;
    flex-direction: column;
  }
  .tour-copy h1,
  .tour-copy h2 {
    font-size: clamp(2.7rem, 17vw, 4.2rem);
  }
  .tour-lede {
    font-size: 1rem;
  }
  .tour-controls,
  .tour-back-btn,
  .tour-next-btn,
  .tour-final-btn {
    width: 100%;
  }
  .tour-mini-grid {
    grid-template-columns: 1fr;
  }
}

/* v106 landing tour: keep the walkthrough frame and Next button stable on desktop */
@media (min-width: 1041px) {
  .landing-tour-frame {
    height: clamp(700px, calc(100vh - 190px), 780px);
    min-height: 0;
  }

  .tour-slide,
  .tour-slide.active {
    height: 100%;
    min-height: 0;
  }

  .tour-copy {
    align-self: center;
  }

  .tour-visual-card {
    align-self: stretch;
    height: 100%;
    min-height: 0;
    display: grid;
    align-content: center;
    gap: 12px;
  }

  .tour-controls {
    min-height: 52px;
  }

  .tour-next-btn {
    width: 310px;
    min-width: 310px;
    text-align: center;
    white-space: nowrap;
  }
}

/* v107: keep double-digit liability interest rates readable beside custom steppers */
#projection .projection-liabilities-table th:nth-child(6),
#projection .projection-liabilities-table td:nth-child(6) {
  width: 12%;
  min-width: 118px;
}

#projection .projection-liabilities-table td:nth-child(6) {
  overflow: visible;
}

#projection .projection-liabilities-table td:nth-child(6) .input-enhanced.number-enhanced {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  margin-left: auto;
}

#projection .projection-liabilities-table td:nth-child(6) .input-enhanced.number-enhanced > input.return-input {
  width: 100%;
  min-width: 0;
  max-width: none;
  padding-left: 12px;
  padding-right: 40px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

#projection .projection-liabilities-table td:nth-child(6) .input-enhanced.number-enhanced .stepper-buttons {
  right: 8px;
  width: 22px;
}

@media (max-width: 1180px) {
  #projection .projection-assumptions-wrap .projection-liabilities-table {
    min-width: 1040px;
  }
}

/* v108: align Projection liability input controls across each row */
#projection .projection-liabilities-table tbody tr.projection-account-row > td:nth-child(6),
#projection .projection-liabilities-table tbody tr.projection-account-row > td:nth-child(7) {
  vertical-align: top;
  padding-top: 18px;
}

#projection .projection-liabilities-table tbody tr.projection-account-row > td:nth-child(6) .input-enhanced.number-enhanced,
#projection .projection-liabilities-table tbody tr.projection-account-row > td:nth-child(7) .payoff-timeline-fields {
  margin-top: 0;
}

#projection .projection-liabilities-table tbody tr.projection-account-row > td:nth-child(7) .inline-payoff-control {
  align-content: start;
  gap: 6px;
}

#projection .projection-liabilities-table tbody tr.projection-account-row > td:nth-child(7) .inline-payoff-control small {
  display: block;
  min-height: 18px;
}

/* v109 landing tour: reserve a real footer area for Back/Next controls */
.landing-tour-frame {
  overflow: visible;
}

.tour-slide {
  min-height: 0;
}

.tour-copy,
.tour-visual-card {
  min-width: 0;
}

@media (min-width: 1041px) {
  .landing-tour-frame {
    grid-template-rows: auto minmax(0, 1fr) 64px;
  }

  .tour-slide,
  .tour-slide.active {
    height: auto;
    min-height: 0;
    max-height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 2px 4px 8px;
    scrollbar-width: thin;
  }

  .tour-slide::-webkit-scrollbar {
    width: 8px;
  }

  .tour-slide::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
  }

  .tour-slide::-webkit-scrollbar-track {
    background: transparent;
  }

  .tour-controls {
    align-self: end;
    min-height: 64px;
    padding-top: 10px;
    border-top: 1px solid rgba(226, 231, 239, .78);
    background: linear-gradient(180deg, rgba(255, 255, 255, .58), rgba(255, 255, 255, .92));
    backdrop-filter: blur(12px);
  }

  .tour-back-btn,
  .tour-next-btn {
    align-self: center;
  }
}

@media (max-width: 1040px) {
  .tour-controls {
    position: sticky;
    bottom: 0;
    padding-top: 12px;
    border-top: 1px solid rgba(226, 231, 239, .85);
    background: linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .96));
    backdrop-filter: blur(12px);
  }
}

body.night-mode .tour-controls {
  border-top-color: var(--border);
  background: linear-gradient(180deg, rgba(16, 24, 38, .72), rgba(16, 24, 38, .96));
}

/* v109.1: on smaller screens, keep controls in normal flow so they never cover content. */
@media (max-width: 1040px) {
  .tour-controls {
    position: static;
  }
}

/* v110 landing tour: remove the visible white control bar while keeping reserved space for navigation buttons */
.tour-controls {
  background: transparent !important;
  border-top: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

@media (min-width: 1041px) {
  .tour-controls {
    padding-top: 0;
  }
}

@media (max-width: 1040px) {
  .tour-controls {
    padding-top: 10px;
  }
}

body.night-mode .tour-controls {
  background: transparent !important;
  border-top: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* v111 landing tour: remove internal scrolling and compact each step so instructions fit without scrolling */
.landing-tour-frame {
  overflow: visible;
}

.tour-slide,
.tour-slide.active {
  overflow: visible !important;
}

@media (min-width: 1041px) {
  .landing-tour-main {
    padding: 18px 0 28px;
  }

  .landing-tour-frame {
    height: clamp(700px, calc(100vh - 170px), 820px);
    grid-template-rows: auto minmax(0, 1fr) 64px;
    gap: 16px;
    padding: clamp(20px, 2.4vw, 28px);
  }

  .tour-slide,
  .tour-slide.active {
    max-height: none !important;
    padding: 0;
    align-items: center;
    gap: clamp(24px, 4vw, 54px);
  }

  .tour-copy h1,
  .tour-copy h2 {
    margin-top: 8px;
    font-size: clamp(2.55rem, 4.8vw, 5.15rem);
    line-height: .94;
    letter-spacing: -.072em;
  }

  .tour-lede {
    margin-top: 16px;
    max-width: 700px;
    font-size: clamp(.98rem, 1.35vw, 1.12rem);
    line-height: 1.46;
  }

  .tour-bullet-list {
    gap: 8px;
    margin-top: 18px;
    max-width: 700px;
  }

  .tour-bullet-list li {
    padding-left: 24px;
    font-size: .95rem;
    line-height: 1.34;
  }

  .tour-bullet-list li::before {
    top: .36em;
    width: 9px;
    height: 9px;
    box-shadow: 0 0 0 4px var(--brand-soft);
  }

  .tour-progress-wrap {
    gap: 8px;
  }

  .tour-visual-card {
    padding: clamp(18px, 2vw, 24px);
    border-radius: 26px;
    gap: 10px;
  }

  .tour-window-bar {
    margin-bottom: 12px;
  }

  .tour-section-label {
    margin-bottom: 12px;
  }

  .tour-hero-metric,
  .tour-projection-main {
    padding: 20px;
    border-radius: 22px;
  }

  .tour-hero-metric strong,
  .tour-projection-main strong {
    margin-top: 8px;
    font-size: clamp(2.35rem, 4.2vw, 3.8rem);
  }

  .tour-hero-metric small,
  .tour-projection-main small {
    margin-top: 8px;
    line-height: 1.3;
  }

  .tour-mini-grid {
    gap: 10px;
    margin-top: 10px;
  }

  .tour-mini-grid div,
  .tour-account-row,
  .tour-total-row,
  .tour-budget-card,
  .tour-tool-pill {
    border-radius: 16px;
  }

  .tour-mini-grid div {
    padding: 14px;
  }

  .tour-mini-grid strong,
  .tour-budget-card strong,
  .tour-total-row strong,
  .tour-account-row strong {
    margin-top: 6px;
    font-size: 1.14rem;
  }

  .tour-account-row,
  .tour-total-row {
    padding: 12px 16px;
  }

  .tour-budget-card,
  .tour-tool-pill {
    padding: 13px 16px;
  }

  .tour-chart {
    height: clamp(120px, 18vh, 150px);
    padding: 14px;
  }

  .tour-privacy-lock {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    font-size: 1.65rem;
  }

  .privacy-visual h3 {
    margin-top: 4px;
    font-size: 1.35rem;
  }

  .privacy-visual p {
    line-height: 1.42;
  }

  .tour-final-btn {
    margin-top: 4px;
  }

  .tour-controls {
    min-height: 64px;
    padding-top: 0;
  }
}

@media (max-width: 1040px) {
  .landing-tour-frame {
    min-height: auto;
  }

  .tour-slide,
  .tour-slide.active {
    overflow: visible !important;
    padding: 0;
  }
}

@media (max-height: 760px) and (min-width: 1041px) {
  .landing-tour-frame {
    height: 680px;
    gap: 14px;
    padding: 20px 24px;
  }

  .tour-copy h1,
  .tour-copy h2 {
    font-size: clamp(2.35rem, 4.2vw, 4.45rem);
  }

  .tour-lede {
    margin-top: 14px;
    font-size: .98rem;
    line-height: 1.38;
  }

  .tour-bullet-list {
    margin-top: 14px;
    gap: 7px;
  }

  .tour-bullet-list li {
    font-size: .9rem;
    line-height: 1.28;
  }

  .tour-visual-card {
    padding: 18px;
  }

  .tour-account-row,
  .tour-total-row,
  .tour-budget-card,
  .tour-tool-pill {
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .tour-chart {
    height: 115px;
  }
}


/* Easier Dashboard target date controls */
.target-date-field {
  min-width: 0;
}
.target-date-controls {
  display: grid;
  grid-template-columns: minmax(120px, 1.25fr) minmax(92px, .75fr);
  gap: 10px;
  align-items: center;
}
.target-date-controls select {
  min-height: 43px;
  font-weight: 850;
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: var(--ink);
}
.target-date-controls select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
}
.target-date-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.target-date-note {
  display: block;
  margin-top: 2px;
  line-height: 1.35;
}
body.night-mode .target-date-controls select {
  background: var(--panel-soft);
  color: var(--ink);
  border-color: var(--border-strong);
}

@media (max-width: 760px) {
  .target-date-controls {
    grid-template-columns: 1fr;
  }
}

/* v113: align Dashboard target and due date controls */
.dashboard-goal-editor {
  align-items: start;
}
.dashboard-goal-editor > .field {
  align-content: start;
  align-self: start;
}
.dashboard-goal-editor > .field > input,
.dashboard-goal-editor > .field > .money-input,
.dashboard-goal-editor > .field > .input-enhanced,
.target-date-controls {
  margin-top: 0;
}
.target-date-controls select {
  min-height: 56px;
  border-radius: 14px;
  padding-top: 12px;
  padding-bottom: 12px;
}
#dashboardTargetInput {
  min-height: 56px;
  border-radius: 14px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.target-date-note {
  margin-top: 8px;
}

/* v114: add breathing room between Dashboard date controls and target progress */
.dashboard-goal-layout {
  grid-template-columns: minmax(520px, 640px) minmax(280px, 1fr);
  column-gap: 28px;
  align-items: start;
}
.dashboard-goal-editor {
  gap: 28px;
}
.dashboard-goal-progress {
  min-width: 0;
}

@media (max-width: 980px) {
  .dashboard-goal-layout {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 18px;
  }
  .dashboard-goal-editor {
    gap: 12px;
  }
}

/* v115: make the Dashboard Target input less wide while preserving alignment */
@media (min-width: 981px) {
  .dashboard-goal-editor {
    grid-template-columns: minmax(240px, 300px) minmax(320px, 1fr);
  }

  .dashboard-goal-editor > .field:first-child {
    max-width: 300px;
  }

  #dashboardTargetInput {
    width: 100%;
  }
}


/* v116: make Dashboard Target amount box compact at every screen size */
.dashboard-target-field {
  width: 100%;
  max-width: 230px;
  justify-self: start;
}

#dashboardTargetInput {
  width: 230px;
  max-width: 100%;
}

.target-date-field {
  max-width: 360px;
}

.target-date-controls {
  grid-template-columns: minmax(160px, 220px) minmax(100px, 130px);
  justify-content: start;
}

@media (min-width: 981px) {
  .dashboard-goal-editor {
    grid-template-columns: 230px minmax(280px, 360px);
  }

  .dashboard-goal-editor > .dashboard-target-field {
    max-width: 230px;
  }

  .dashboard-goal-editor > .target-date-field {
    max-width: 360px;
  }
}

@media (max-width: 980px) {
  .dashboard-target-field {
    max-width: 230px;
  }

  .target-date-field {
    max-width: 360px;
  }
}

/* Authentication pages and app account controls */
.auth-protected:not(.auth-ready) .app-shell {
  opacity: 0;
  pointer-events: none;
}
.auth-protected.auth-ready .app-shell,
html.auth-ready .auth-protected .app-shell {
  opacity: 1;
  pointer-events: auto;
}
.auth-body {
  min-height: 100vh;
}
.auth-page-shell {
  width: min(1160px, calc(100vw - 40px));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.auth-header {
  padding-top: 18px;
}
.auth-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(280px, 1fr);
  gap: 28px;
  align-items: center;
  padding: 54px 0 72px;
}
.auth-card,
.auth-side-card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.auth-card {
  padding: 30px;
}
.auth-card-copy h1 {
  margin: 8px 0 12px;
  font-family: var(--display-font);
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: .94;
  letter-spacing: -.065em;
}
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  margin: 24px 0 18px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.auth-tab {
  border: 0;
  border-radius: 10px;
  padding: 11px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}
.auth-tab.active {
  background: #111318;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(17, 19, 24, 0.10);
}
.auth-form {
  display: none;
  gap: 14px;
}
.auth-form.active {
  display: grid;
}
.auth-submit {
  width: 100%;
  margin-top: 4px;
}
.auth-message {
  min-height: 20px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}
.auth-message.error { color: var(--danger); }
.auth-message.success { color: var(--success); }
.auth-message.warning { color: var(--warning); }
.auth-message.info { color: var(--brand); }
.auth-support-links {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 800;
}
.auth-support-links a {
  color: var(--brand);
  text-decoration: none;
}
.auth-side-card {
  padding: 30px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .12), transparent 18rem),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(240,253,250,.78));
}
.auth-side-card h2 {
  margin: 14px 0 10px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -.055em;
}
.auth-side-card p {
  color: var(--muted);
  line-height: 1.6;
}
.auth-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 850;
}
.auth-user-pill strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: .86rem;
}
.auth-form input:disabled,
.auth-form button:disabled {
  opacity: .55;
  cursor: not-allowed;
}
body.night-mode .auth-card,
body.night-mode .auth-side-card,
body.night-mode .auth-tabs,
body.night-mode .auth-user-pill {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--border);
}
body.night-mode .auth-tab.active {
  background: #f3f6fc;
  color: #0b111b;
}
body.night-mode .auth-side-card {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .18), transparent 18rem),
    linear-gradient(180deg, var(--panel), var(--panel-soft));
}
@media (max-width: 860px) {
  .auth-main {
    grid-template-columns: 1fr;
    padding: 30px 0 48px;
  }
  .auth-card,
  .auth-side-card {
    border-radius: 22px;
    padding: 22px;
  }
  .auth-user-pill {
    max-width: 100%;
  }
}

/* v36 header/navigation layout fix
   Keeps every app tab visible by moving navigation to its own full-width row
   whenever the header has too many controls to fit on one line. */
.site-header-inner {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "brand actions"
    "nav nav";
  row-gap: 12px;
  column-gap: 20px;
  padding: 10px 0 12px;
}
.site-header-inner .brand { grid-area: brand; }
.site-header-inner .nav-list {
  grid-area: nav;
  justify-content: flex-start;
  width: 100%;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: thin;
}
.site-header-inner .nav-list::-webkit-scrollbar {
  display: block;
  height: 6px;
}
.site-header-inner .nav-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
}
.site-header-inner .topbar-actions {
  grid-area: actions;
  justify-content: flex-end;
  min-width: 0;
}
.site-header-inner .nav-btn {
  padding: 9px 13px;
}

@media (max-width: 1180px) {
  .site-header-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "actions"
      "nav";
    gap: 12px;
    padding: 14px 0;
  }
  .site-header-inner .brand,
  .site-header-inner .topbar-actions,
  .site-header-inner .nav-list {
    justify-content: flex-start;
  }
}

/* v37 single-row header + account settings panel
   Moves the email/account display out of the header and into Settings. */
.site-header-inner {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand nav actions";
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}
.site-header-inner .brand { grid-area: brand; }
.site-header-inner .nav-list {
  grid-area: nav;
  justify-content: center;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 2px 0 4px;
  scrollbar-width: thin;
}
.site-header-inner .topbar-actions {
  grid-area: actions;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: max-content;
}
.site-header-inner .nav-btn {
  padding: 8px 10px;
  font-size: clamp(.78rem, 1vw, .95rem);
}
.site-header-inner .ghost-btn,
.site-header-inner .primary-btn,
.site-header-inner .calculator-toggle-btn,
.site-header-inner .notes-toggle-btn {
  padding: 9px 12px;
  white-space: nowrap;
}
.auth-user-pill { display: none !important; }

.settings-account-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(240px, auto);
  gap: 18px;
  align-items: start;
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff, #f8fbff);
}
.settings-account-copy h3 { margin: 4px 0 8px; }
.settings-account-copy p:last-child { margin: 0; }
.settings-account-summary {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.settings-account-summary span {
  color: var(--muted);
  font-weight: 900;
}
.settings-account-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}
.password-update-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.password-update-form .small {
  grid-column: 1 / -1;
  margin: 0;
}
.password-update-form .small.success-text { color: var(--success); }
.password-update-form .small.error-text { color: var(--danger); }
body.night-mode .settings-account-panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-soft));
  border-color: var(--border);
}
body.night-mode .settings-account-summary { background: var(--panel); }

@media (max-width: 1180px) {
  .site-header-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "nav"
      "actions";
    align-items: stretch;
  }
  .site-header-inner .brand,
  .site-header-inner .nav-list,
  .site-header-inner .topbar-actions { justify-content: flex-start; }
  .site-header-inner .topbar-actions {
    flex-wrap: wrap;
    min-width: 0;
  }
}
@media (max-width: 760px) {
  .settings-account-panel,
  .password-update-form {
    grid-template-columns: 1fr;
  }
  .settings-account-summary {
    justify-self: stretch;
  }
}
.password-update-form.is-disabled {
  opacity: .72;
}
.password-update-form input:disabled,
.password-update-form button:disabled {
  cursor: not-allowed;
  opacity: .6;
}


/* MoneyWise update: hide/remove the floating Ask AI widget. */
.ai-agent { display: none !important; }


/* Legal/footer and delete-data controls */
.legal-footer {
  width: min(1360px, calc(100vw - 48px));
  margin: 0 auto;
}
.legal-footer nav {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.legal-footer a {
  color: var(--brand);
  font-weight: 850;
  text-decoration: none;
}
.app-footer,
.auth-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px 0 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .92rem;
}
.app-footer p,
.auth-footer p,
.landing-footer p { margin: 0; }
.legal-page-shell {
  width: min(1080px, calc(100vw - 48px));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.legal-document {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  padding: clamp(26px, 5vw, 52px);
  margin: 30px 0 28px;
}
.legal-document h1 {
  margin: 8px 0 8px;
  font-family: var(--display-font);
  font-size: clamp(2.7rem, 6vw, 4.8rem);
  letter-spacing: -.07em;
  line-height: .95;
}
.legal-document h2 {
  margin: 28px 0 10px;
  font-size: 1.22rem;
  letter-spacing: -.03em;
}
.legal-document p {
  color: #384152;
  line-height: 1.65;
  margin: 0 0 12px;
}
.legal-document a { color: var(--brand); font-weight: 850; }
.danger-strong {
  font-weight: 950;
  border-color: #fca5a5;
}
.delete-data-modal .delete-warning {
  color: var(--danger);
  font-size: 1.05rem;
  margin: 8px 0 10px;
}
.delete-data-modal .modal-actions {
  margin-top: 20px;
}
@media (max-width: 780px) {
  .app-footer,
  .auth-footer,
  .landing-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .legal-footer nav { justify-content: flex-start; }
}

/* v119 arbitrary-precision calculator */
.calculator-display {
  overflow-x: auto;
  text-overflow: clip;
  white-space: nowrap;
  direction: ltr;
  scrollbar-width: thin;
}
.calculator-display:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}


/* v120 Dashboard retirement goal calculator */
.retirement-goal-panel {
  margin: 0 0 20px;
  background:
    radial-gradient(circle at top right, rgba(139, 92, 246, .12), transparent 20rem),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,243,255,.72));
  border-color: rgba(139, 92, 246, .24);
}
.retirement-goal-header {
  margin-bottom: 16px;
}
.retirement-goal-layout {
  display: grid;
  grid-template-columns: minmax(310px, 390px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.retirement-goal-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 145px;
  gap: 14px;
  align-items: start;
}
.retirement-goal-amount-field {
  min-width: 0;
}
#retirementGoalInput,
#retirementAgeInput {
  min-height: 56px;
  border-radius: 14px;
  padding-top: 12px;
  padding-bottom: 12px;
  font-weight: 850;
}
.retirement-source-note {
  grid-column: 1 / -1;
  padding: 14px 15px;
  border: 1px solid rgba(139, 92, 246, .20);
  border-left: 4px solid var(--accent-purple);
  border-radius: 14px;
  background: rgba(255,255,255,.70);
}
.retirement-source-note strong {
  display: block;
  font-size: .9rem;
}
.retirement-source-note p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.42;
}
.retirement-goal-summary {
  min-width: 0;
  display: grid;
  gap: 16px;
}
.retirement-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.retirement-stat-card {
  min-width: 0;
  min-height: 126px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-top: 5px solid var(--asset-current);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
  box-shadow: var(--shadow-soft);
}
.retirement-stat-card > span {
  display: block;
  color: var(--muted-2);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.retirement-stat-card > strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.3rem, 2.1vw, 2rem);
  line-height: 1.05;
  letter-spacing: -.05em;
  overflow-wrap: anywhere;
}
.retirement-stat-card > small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.38;
}
.retirement-projected-card {
  border-top-color: var(--accent-purple);
}
.retirement-gap-card {
  border-top-color: var(--asset-long);
}
.retirement-gap-card.positive-gap {
  border-top-color: var(--success);
  background: linear-gradient(180deg, #ffffff, var(--success-soft));
}
.retirement-gap-card.positive-gap > strong {
  color: var(--success);
}
.retirement-gap-card.negative-gap {
  border-top-color: var(--danger);
  background: linear-gradient(180deg, #ffffff, var(--danger-soft));
}
.retirement-gap-card.negative-gap > strong {
  color: var(--danger);
}
.retirement-progress-comparison {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.68);
}
.retirement-progress-row {
  display: grid;
  gap: 7px;
}
.retirement-progress-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 850;
}
.retirement-progress-row > div:first-child strong {
  color: var(--ink);
  font-size: .96rem;
}
.retirement-track {
  height: 11px;
  border: 1px solid rgba(148, 163, 184, .26);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .08);
}
.projected-retirement-track .progress-fill {
  background: linear-gradient(90deg, var(--accent-purple), var(--asset-fund));
}
body.night-mode .retirement-goal-panel {
  background:
    radial-gradient(circle at top right, rgba(139, 92, 246, .18), transparent 20rem),
    var(--panel);
  border-color: rgba(167, 139, 250, .30);
}
body.night-mode .retirement-source-note,
body.night-mode .retirement-stat-card,
body.night-mode .retirement-progress-comparison {
  background: var(--panel-soft);
  color: var(--ink);
  border-color: var(--border);
}
body.night-mode .retirement-gap-card.positive-gap {
  background: rgba(5, 150, 105, .14);
  border-top-color: #10b981;
}
body.night-mode .retirement-gap-card.negative-gap {
  background: rgba(220, 38, 38, .14);
  border-top-color: #ef4444;
}
body.night-mode .retirement-source-note p,
body.night-mode .retirement-stat-card > small,
body.night-mode .retirement-progress-row > div:first-child {
  color: var(--muted);
}
@media (max-width: 1100px) {
  .retirement-goal-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .retirement-goal-controls,
  .retirement-stat-grid {
    grid-template-columns: 1fr;
  }
  .retirement-source-note {
    grid-column: auto;
  }
  .retirement-stat-card {
    min-height: 0;
  }
}

/* v121 immutable snapshot history and current balances */
.snapshot-mode-note {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
}
.snapshot-mode-note strong {
  flex: 0 0 auto;
  font-size: .92rem;
}
.snapshot-mode-note span {
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.4;
  text-align: right;
}
.snapshot-mode-note.current-mode {
  border-color: rgba(37, 99, 235, .28);
  background: linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(20, 184, 166, .06));
}
.snapshot-mode-note.current-mode strong { color: var(--brand); }
.snapshot-mode-note.history-mode {
  border-color: rgba(245, 158, 11, .30);
  background: linear-gradient(135deg, rgba(245, 158, 11, .10), rgba(251, 191, 36, .05));
}
.snapshot-mode-note.history-mode strong { color: var(--warning); }
.account-drag-disabled {
  cursor: default;
  opacity: .35;
  letter-spacing: 0;
}
#networth input:disabled,
#networth select:disabled {
  opacity: 1;
  color: var(--ink);
  background: var(--panel-soft);
  border-style: dashed;
  cursor: default;
}
#deleteSnapshotBtn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
body.night-mode .snapshot-mode-note.current-mode {
  background: linear-gradient(135deg, rgba(37, 99, 235, .18), rgba(20, 184, 166, .10));
  border-color: rgba(96, 165, 250, .34);
}
body.night-mode .snapshot-mode-note.history-mode {
  background: linear-gradient(135deg, rgba(245, 158, 11, .16), rgba(251, 191, 36, .08));
  border-color: rgba(251, 191, 36, .30);
}
@media (max-width: 760px) {
  .snapshot-mode-note {
    display: grid;
    gap: 5px;
  }
  .snapshot-mode-note span { text-align: left; }
}
#addCategoryBtn:disabled {
  opacity: .45;
  cursor: not-allowed;
}


/* v122 first-login Accounts onboarding */
.accounts-onboarding {
  position: fixed;
  z-index: 120;
  width: min(350px, calc(100vw - 24px));
  padding: 18px;
  border: 1px solid rgba(37, 99, 235, .26);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .12), transparent 13rem),
    #ffffff;
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
}
.accounts-onboarding[hidden] { display: none !important; }
.accounts-onboarding .eyebrow {
  margin: 0 34px 5px 0;
  color: var(--brand);
}
.accounts-onboarding > strong {
  display: block;
  margin-right: 28px;
  font-size: 1.12rem;
  letter-spacing: -.03em;
}
.accounts-onboarding > p:not(.eyebrow) {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.48;
}
.accounts-onboarding-start {
  width: 100%;
  justify-content: center;
}
.accounts-onboarding-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}
.accounts-onboarding-close:hover {
  color: var(--ink);
  border-color: var(--brand);
}
.accounts-onboarding-arrow {
  position: absolute;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-left: 1px solid rgba(37, 99, 235, .26);
  border-top: 1px solid rgba(37, 99, 235, .26);
  transform: translateX(-50%) rotate(45deg);
}
.accounts-onboarding[data-placement="below"] .accounts-onboarding-arrow {
  top: -10px;
}
.accounts-onboarding[data-placement="above"] .accounts-onboarding-arrow {
  bottom: -10px;
  transform: translateX(-50%) rotate(225deg);
}
.nav-btn.onboarding-target {
  position: relative;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 5px rgba(37, 99, 235, .15), 0 14px 28px rgba(37, 99, 235, .24);
  animation: accounts-onboarding-pulse 1.7s ease-in-out infinite;
}
@keyframes accounts-onboarding-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(37, 99, 235, .14), 0 12px 24px rgba(37, 99, 235, .20); }
  50% { box-shadow: 0 0 0 9px rgba(37, 99, 235, .06), 0 16px 32px rgba(37, 99, 235, .28); }
}
body.night-mode .accounts-onboarding {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .22), transparent 13rem),
    var(--panel);
  color: var(--ink);
  border-color: rgba(96, 165, 250, .45);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .48);
}
body.night-mode .accounts-onboarding-arrow {
  background: var(--panel);
  border-color: rgba(96, 165, 250, .45);
}
body.night-mode .accounts-onboarding-close {
  background: var(--panel-soft);
  color: var(--muted);
  border-color: var(--border);
}
@media (prefers-reduced-motion: reduce) {
  .nav-btn.onboarding-target { animation: none; }
}
@media (max-width: 760px) {
  .accounts-onboarding {
    width: min(330px, calc(100vw - 24px));
    padding: 16px;
  }
}


/* =========================================================
   Money-Wise Liquid Glass system — full-site visual refresh
   ========================================================= */
:root {
  --bg: #eef3ff;
  --panel: rgba(255, 255, 255, .42);
  --panel-soft: rgba(255, 255, 255, .24);
  --ink: #101828;
  --muted: #667085;
  --muted-2: #8993a6;
  --border: rgba(255, 255, 255, .48);
  --border-strong: rgba(255, 255, 255, .72);
  --brand: #3d7cff;
  --brand-2: #6d5efc;
  --brand-soft: rgba(106, 154, 255, .16);
  --shadow: 0 24px 70px rgba(31, 41, 55, .14), 0 6px 22px rgba(31, 41, 55, .08);
  --shadow-soft: 0 14px 42px rgba(31, 41, 55, .10), inset 0 1px 0 rgba(255, 255, 255, .55);
  --radius: 26px;
  --radius-sm: 16px;
  --glass-blur: blur(24px) saturate(180%);
  --glass-blur-strong: blur(30px) saturate(190%);
  --glass-highlight: inset 0 1px 0 rgba(255,255,255,.74), inset 0 -1px 0 rgba(255,255,255,.14);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --display-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}
html { background: #eef3ff; }
body,
.landing-body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 8%, rgba(116, 172, 255, .50), transparent 0 26rem),
    radial-gradient(circle at 87% 12%, rgba(138, 206, 255, .44), transparent 0 22rem),
    radial-gradient(circle at 78% 70%, rgba(155, 124, 255, .22), transparent 0 26rem),
    radial-gradient(circle at 18% 86%, rgba(45, 212, 191, .18), transparent 0 22rem),
    linear-gradient(180deg, #f9fbff 0%, #eef4ff 42%, #f7f9ff 100%);
  background-attachment: fixed;
  font-family: var(--font);
}
body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
  filter: blur(12px);
}
body::before {
  width: 34rem;
  height: 34rem;
  right: -10rem;
  top: 3rem;
  background: radial-gradient(circle, rgba(255,255,255,.76) 0%, rgba(255,255,255,.16) 55%, transparent 72%);
}
body::after {
  width: 26rem;
  height: 26rem;
  left: -8rem;
  bottom: 3rem;
  background: radial-gradient(circle, rgba(255,255,255,.48) 0%, rgba(255,255,255,.12) 55%, transparent 72%);
}
.app-shell,
.landing-shell,
.landing-tour-shell,
.auth-page-shell,
.legal-page-shell,
.auth-footer,
.app-footer { position: relative; z-index: 1; }

.site-header,
.landing-header {
  background: rgba(255,255,255,.17) !important;
  border-color: rgba(255,255,255,.34) !important;
  backdrop-filter: var(--glass-blur-strong) !important;
  -webkit-backdrop-filter: var(--glass-blur-strong) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.48), 0 10px 35px rgba(31,41,55,.05) !important;
}
.brand-mark {
  border-radius: 14px !important;
  color: #1140a4 !important;
  background: linear-gradient(145deg, rgba(255,255,255,.62), rgba(255,255,255,.20)) !important;
  border: 1px solid rgba(255,255,255,.64) !important;
  box-shadow: var(--shadow-soft), var(--glass-highlight) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.nav-btn,
.landing-nav a,
.landing-nav button {
  border-radius: 999px !important;
  border: 1px solid transparent !important;
  background: rgba(255,255,255,.08) !important;
  color: #475467 !important;
}
.nav-btn:hover,
.landing-nav a:hover,
.landing-nav button:hover {
  background: rgba(255,255,255,.42) !important;
  border-color: rgba(255,255,255,.52) !important;
  color: #1f2937 !important;
  box-shadow: var(--glass-highlight) !important;
}
.nav-btn.active,
.landing-nav .active {
  color: #12295b !important;
  background: linear-gradient(180deg, rgba(255,255,255,.66), rgba(255,255,255,.30)) !important;
  border-color: rgba(255,255,255,.72) !important;
  box-shadow: 0 10px 30px rgba(61,124,255,.18), var(--glass-highlight) !important;
}

.panel,
.metric-card,
.hero-summary,
.summary-tile,
.account-group,
.table-wrap,
.toggle-card,
.notice,
.modal,
.calculator-widget,
.notes-widget,
.accounts-onboarding,
.settings-guide-card,
.external-value-card,
.car-hero-result,
.percentile-result .result-card,
.retirement-stat-card,
.age-helper-card,
.contribution-summary,
.embedded-account-projection,
.projection-summary-chart,
.landing-tour-frame,
.tour-visual-card,
.auth-card,
.auth-side-card,
.legal-document {
  background: linear-gradient(180deg, rgba(255,255,255,.56), rgba(255,255,255,.28)) !important;
  border: 1px solid rgba(255,255,255,.50) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
}
.panel,
.metric-card,
.hero-summary,
.account-group,
.table-wrap,
.toggle-card,
.notice,
.retirement-stat-card,
.settings-guide-card,
.external-value-card,
.landing-tour-frame,
.tour-visual-card,
.auth-card,
.auth-side-card,
.legal-document { border-radius: 24px !important; }
.panel,
.metric-card,
.summary-tile,
.tour-visual-card,
.auth-card,
.auth-side-card,
.accounts-onboarding { position: relative; overflow: hidden; }
.panel::before,
.metric-card::after,
.tour-visual-card::before,
.auth-card::before,
.auth-side-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.40), transparent 34%, transparent 66%, rgba(255,255,255,.12));
  opacity: .72;
}
.panel > *,
.metric-card > *,
.tour-visual-card > *,
.auth-card > *,
.auth-side-card > * { position: relative; z-index: 1; }

.primary-btn,
.ghost-btn,
.danger-ghost,
.calculator-toggle-btn,
.notes-toggle-btn,
.ghost-icon-btn,
.category-add-btn,
.btn {
  border-radius: 999px !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--glass-highlight);
}
.primary-btn {
  background: linear-gradient(135deg, rgba(61,124,255,.86), rgba(109,94,252,.84)) !important;
  border-color: rgba(255,255,255,.34) !important;
  box-shadow: 0 12px 34px rgba(61,124,255,.25), inset 0 1px 0 rgba(255,255,255,.32) !important;
}
.ghost-btn,
.calculator-toggle-btn,
.notes-toggle-btn,
.ghost-icon-btn {
  background: rgba(255,255,255,.38) !important;
  border-color: rgba(255,255,255,.56) !important;
  color: #344054 !important;
}
.ghost-btn:hover,
.calculator-toggle-btn:hover,
.notes-toggle-btn:hover,
.ghost-icon-btn:hover { background: rgba(255,255,255,.58) !important; }
.danger-ghost { background: rgba(255,255,255,.38) !important; border-color: rgba(240,68,56,.24) !important; }

input,
select,
textarea,
.calculator-display {
  background: rgba(255,255,255,.38) !important;
  border: 1px solid rgba(255,255,255,.58) !important;
  border-radius: 15px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.64), 0 1px 2px rgba(15,23,42,.05) !important;
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
}
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(93,144,255,.78) !important;
  box-shadow: 0 0 0 4px rgba(61,124,255,.16), inset 0 1px 0 rgba(255,255,255,.72) !important;
  background: rgba(255,255,255,.54) !important;
}

.hero-summary { overflow: hidden; }
.summary-tile { background: rgba(255,255,255,.24) !important; }
.summary-tile + .summary-tile { border-color: rgba(255,255,255,.40) !important; }
.progress-track,
.bar,
.gauge-track { background: rgba(255,255,255,.30) !important; border-color: rgba(255,255,255,.44) !important; box-shadow: inset 0 1px 3px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.58); }

.account-group-header,
th { backdrop-filter: blur(18px) saturate(170%); -webkit-backdrop-filter: blur(18px) saturate(170%); }
.account-row,
td,
.editable-row,
.projection-contribution-row { border-color: rgba(255,255,255,.34) !important; }
.table-wrap { overflow: auto; }
tbody tr:hover td { background: rgba(255,255,255,.28); }
.modal::backdrop { background: rgba(42,54,82,.30); backdrop-filter: blur(12px) saturate(140%); }
.toast { border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%); }

.landing-tour-frame,
.auth-card,
.auth-side-card,
.legal-document { box-shadow: 0 28px 85px rgba(31,41,55,.13), inset 0 1px 0 rgba(255,255,255,.60) !important; }
.tour-progress-track { background: rgba(255,255,255,.34) !important; border: 1px solid rgba(255,255,255,.44); }
.tour-dot { border-color: rgba(255,255,255,.64) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.60); }
.auth-tabs { background: rgba(255,255,255,.26) !important; border: 1px solid rgba(255,255,255,.40); backdrop-filter: blur(18px); }
.auth-tab { border-radius: 999px !important; }
.auth-tab.active { background: rgba(255,255,255,.62) !important; color: #18376f !important; box-shadow: 0 10px 25px rgba(61,124,255,.14), var(--glass-highlight); }
.legal-document { padding: clamp(24px, 5vw, 56px) !important; }
.legal-footer,
.app-footer,
.landing-footer { border-color: rgba(255,255,255,.34) !important; }

body.night-mode {
  --bg: #07101f;
  --panel: rgba(13, 23, 42, .52);
  --panel-soft: rgba(16, 29, 52, .34);
  --ink: #edf4ff;
  --muted: #b7c4d8;
  --muted-2: #93a4bd;
  --border: rgba(173, 202, 255, .18);
  --border-strong: rgba(173, 202, 255, .28);
  background:
    radial-gradient(circle at 10% 8%, rgba(61,124,255,.30), transparent 0 28rem),
    radial-gradient(circle at 88% 10%, rgba(45,212,191,.18), transparent 0 24rem),
    radial-gradient(circle at 70% 80%, rgba(155,124,255,.18), transparent 0 28rem),
    linear-gradient(180deg, #07101f 0%, #081326 48%, #06101f 100%) !important;
}
body.night-mode .site-header { background: rgba(7,16,31,.34) !important; }
body.night-mode .panel,
body.night-mode .metric-card,
body.night-mode .hero-summary,
body.night-mode .summary-tile,
body.night-mode .account-group,
body.night-mode .table-wrap,
body.night-mode .toggle-card,
body.night-mode .notice,
body.night-mode .modal,
body.night-mode .calculator-widget,
body.night-mode .notes-widget,
body.night-mode .accounts-onboarding,
body.night-mode .settings-guide-card,
body.night-mode .external-value-card,
body.night-mode .retirement-stat-card,
body.night-mode .embedded-account-projection,
body.night-mode .projection-summary-chart {
  background: linear-gradient(180deg, rgba(20,34,58,.62), rgba(11,23,42,.40)) !important;
  border-color: rgba(173,202,255,.18) !important;
}
body.night-mode input,
body.night-mode select,
body.night-mode textarea,
body.night-mode .ghost-btn,
body.night-mode .calculator-toggle-btn,
body.night-mode .notes-toggle-btn {
  background: rgba(18,34,58,.54) !important;
  border-color: rgba(173,202,255,.20) !important;
  color: var(--ink) !important;
}
body.night-mode .nav-btn.active { background: rgba(232,240,255,.84) !important; color: #0b1730 !important; }

@media (max-width: 760px) {
  .panel,
  .metric-card,
  .landing-tour-frame,
  .tour-visual-card,
  .auth-card,
  .auth-side-card,
  .legal-document { border-radius: 20px !important; }
}

/* Standalone Budget calculator, safely scoped inside the app's Budget view. */

#budget{
      --bg: #eef3ff;
      --bg-alt: #f8fbff;
      --panel: rgba(255, 255, 255, 0.40);
      --panel-strong: rgba(255, 255, 255, 0.56);
      --panel-soft: rgba(255, 255, 255, 0.22);
      --panel-deep: rgba(17, 25, 40, 0.42);
      --ink: #101828;
      --muted: #667085;
      --muted-2: #8993a6;
      --border: rgba(255, 255, 255, 0.46);
      --border-strong: rgba(255, 255, 255, 0.72);
      --line: rgba(15, 23, 42, 0.08);
      --brand: #3d7cff;
      --brand-2: #6d5efc;
      --brand-soft: rgba(106, 154, 255, 0.14);
      --asset-current: #3d7cff;
      --asset-fund: #2dd4bf;
      --asset-long: #f7b741;
      --accent-purple: #9b7cff;
      --success: #12b76a;
      --success-soft: rgba(18, 183, 106, 0.14);
      --danger: #f04438;
      --danger-soft: rgba(240, 68, 56, 0.14);
      --warning: #f79009;
      --warning-soft: rgba(247, 144, 9, 0.14);
      --shadow: 0 24px 70px rgba(31, 41, 55, 0.14), 0 6px 22px rgba(31, 41, 55, 0.08);
      --shadow-soft: 0 14px 42px rgba(31, 41, 55, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.55);
      --radius: 28px;
      --radius-sm: 18px;
      --radius-md: 22px;
      --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
      --display-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
      --green: var(--success);
      --green-dark: #0b8c51;
      --green-soft: var(--success-soft);
      --blue: var(--brand);
      --blue-soft: var(--brand-soft);
      --amber: var(--asset-long);
      --amber-soft: var(--warning-soft);
      --coral: var(--danger);
      --coral-soft: var(--danger-soft);
      --paper: var(--bg);
      --card: var(--panel);
      --glass-blur: blur(24px) saturate(180%);
      --glass-blur-strong: blur(30px) saturate(190%);
      --glass-highlight: inset 0 1px 0 rgba(255,255,255,.74), inset 0 -1px 0 rgba(255,255,255,.14);
      color-scheme: light;
    }
#budget *{ box-sizing: border-box; }
#budget button, #budget input{ font: inherit; }
#budget button{ cursor: pointer; }
#budget h1, #budget h2, #budget h3, #budget p{ margin-top: 0; }
#budget .app-shell{ position: relative; z-index: 1; min-height: 100vh; }
#budget .site-header{
      position: sticky;
      top: 0;
      z-index: 30;
      background: rgba(255,255,255,.16);
      border-bottom: 1px solid rgba(255,255,255,.30);
      backdrop-filter: var(--glass-blur-strong);
      -webkit-backdrop-filter: var(--glass-blur-strong);
      box-shadow: 0 1px 0 rgba(255,255,255,.42);
    }
#budget .site-header::after{
      content: "";
      position: absolute;
      inset: auto 0 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
      opacity: .7;
    }
#budget .site-header-inner{
      width: min(1360px, calc(100vw - 48px));
      min-height: 74px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: auto minmax(0,1fr) auto;
      align-items: center;
      gap: 24px;
    }
#budget .brand{ display: inline-flex; align-items: center; gap: 14px; min-width: max-content; }
#budget .brand-mark{
      width: 40px;
      height: 40px;
      border-radius: 14px;
      display: grid;
      place-items: center;
      background: linear-gradient(145deg, rgba(255,255,255,.56), rgba(255,255,255,.18));
      border: 1px solid rgba(255,255,255,.58);
      backdrop-filter: var(--glass-blur);
      -webkit-backdrop-filter: var(--glass-blur);
      color: #1140a4;
      font-weight: 900;
      font-size: 1rem;
      box-shadow: var(--shadow-soft), var(--glass-highlight);
    }
#budget .brand-name{ margin: 0; font-size: 1.08rem; font-weight: 800; letter-spacing: -.04em; }
#budget .nav-list{
      display: flex;
      gap: 10px;
      align-items: center;
      justify-content: center;
      min-width: 0;
      overflow-x: auto;
      scrollbar-width: none;
    }
#budget .nav-list::-webkit-scrollbar{ display: none; }
#budget .nav-btn{
      border: 1px solid transparent;
      color: #475467;
      background: rgba(255,255,255,.08);
      padding: 10px 14px;
      border-radius: 999px;
      font-weight: 700;
      white-space: nowrap;
      transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
    }
#budget .nav-btn:hover{
      background: rgba(255,255,255,.38);
      border-color: rgba(255,255,255,.45);
      color: #1f2937;
      box-shadow: var(--glass-highlight);
    }
#budget .nav-btn.active{
      background: linear-gradient(180deg, rgba(255,255,255,.60), rgba(255,255,255,.28));
      border-color: rgba(255,255,255,.68);
      color: #12295b;
      box-shadow: 0 10px 30px rgba(61,124,255,.18), var(--glass-highlight);
    }
#budget .topbar-actions{ display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
#budget .content{
      width: min(1360px, calc(100vw - 48px));
      margin: 0 auto;
      padding: 26px 0 56px;
      min-width: 0;
    }
#budget .page-heading{
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      gap: 24px;
      margin-bottom: 22px;
    }
#budget .page-heading h1{
      margin: 6px 0 8px;
      font-size: clamp(2rem, 4vw, 3.15rem);
      line-height: .98;
      letter-spacing: -.06em;
      font-weight: 800;
    }
#budget .page-heading .lede{ max-width: 880px; margin: 0; color: var(--muted); }
#budget .headline-points{
      display: flex;
      flex-wrap: wrap;
      gap: 8px 18px;
      list-style: none;
      padding: 0;
      margin: 14px 0 0;
      color: var(--muted);
      font-size: .82rem;
      font-weight: 700;
    }
#budget .headline-points li{
      position: relative;
      padding-left: 14px;
      white-space: nowrap;
    }
#budget .headline-points li::before{
      content: "•";
      position: absolute;
      left: 0;
      top: 0;
      color: var(--brand);
      font-weight: 900;
    }
#budget .toolbar{ display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
#budget .eyebrow{
      margin: 0;
      text-transform: uppercase;
      letter-spacing: .13em;
      font-size: .76rem;
      font-weight: 800;
      color: var(--muted-2);
    }
#budget .btn{
      border: 1px solid rgba(255,255,255,.46);
      border-radius: 999px;
      padding: 10px 16px;
      font-weight: 700;
      transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
      backdrop-filter: var(--glass-blur);
      -webkit-backdrop-filter: var(--glass-blur);
      box-shadow: var(--glass-highlight);
    }
#budget .btn:hover{ transform: translateY(-1px); }
#budget .btn-primary{
      color:#fff;
      background: linear-gradient(135deg, rgba(61,124,255,.78), rgba(109,94,252,.76));
      box-shadow: 0 12px 34px rgba(61,124,255,.24), inset 0 1px 0 rgba(255,255,255,.30);
    }
#budget .btn-primary:hover{ box-shadow: 0 16px 38px rgba(61,124,255,.30), inset 0 1px 0 rgba(255,255,255,.30); }
#budget .btn-dark, #budget .btn-ghost{
      color:#344054;
      background: rgba(255,255,255,.36);
      border-color: rgba(255,255,255,.50);
    }
#budget .btn-dark:hover, #budget .btn-ghost:hover{
      background: rgba(255,255,255,.52);
      border-color: rgba(255,255,255,.72);
    }
#budget .btn-small{ padding: 8px 12px; font-size: 13px; }
#budget .hero{
      display: grid;
      grid-template-columns: minmax(0,1.55fr) minmax(300px,.65fr);
      gap: 20px;
      margin-bottom: 20px;
    }
#budget .hero-copy, #budget .hero-side, #budget .panel, #budget .metric-card{
      background: linear-gradient(180deg, rgba(255,255,255,.54), rgba(255,255,255,.28));
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow-soft);
      backdrop-filter: var(--glass-blur);
      -webkit-backdrop-filter: var(--glass-blur);
      position: relative;
      overflow: hidden;
    }
#budget .hero-copy::before, #budget .hero-side::before, #budget .panel::before, #budget .metric-card::after{
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background: linear-gradient(180deg, rgba(255,255,255,.40), transparent 34%, transparent 66%, rgba(255,255,255,.12));
      opacity: .8;
    }
#budget .hero-copy{
      padding: 25px 27px;
      background: linear-gradient(135deg, rgba(255,255,255,.52), rgba(231,241,255,.28));
    }
#budget .hero-copy::after{
      content:"";
      position:absolute;
      right:-70px;
      bottom:-105px;
      width:260px;
      height:260px;
      border-radius:50%;
      background: radial-gradient(circle at 35% 35%,rgba(20,184,166,.28),rgba(37,99,235,.10) 52%,transparent 72%);
    }
#budget .hero-copy h2{
      position: relative;
      z-index: 1;
      margin: 5px 0 8px;
      font-size: clamp(1.55rem,3vw,2.25rem);
      letter-spacing: -.045em;
      font-weight: 800;
    }
#budget .hero-copy p:not(.eyebrow){ position:relative; z-index:1; max-width:780px; margin:0; color:var(--muted); }
#budget .hero-side{
      padding: 23px;
      color:#fff;
      background: linear-gradient(135deg, rgba(23,34,62,.68) 0%, rgba(39,49,74,.54) 100%);
      display:flex;
      flex-direction:column;
      justify-content:space-between;
      gap:20px;
    }
#budget .hero-side .kicker{ color:#d2d9e6; font-size:.78rem; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
#budget .hero-side .big-number{ margin-top:4px; font-family:var(--display-font); font-size:clamp(2.4rem,4.4vw,3.65rem); line-height:1; letter-spacing:-.065em; font-weight: 800; }
#budget .hero-side .subtext{ margin:8px 0 0; color:#d2d9e6; font-size:.83rem; }
#budget .mini-track{ height:10px; border-radius:999px; background:rgba(255,255,255,.12); overflow:hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.10); }
#budget .mini-track > span{ display:block; width:0; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--asset-fund),#22c55e); transition:width .25s ease; }
#budget .summary-grid{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
#budget .metric-card{
      min-height:132px;
      padding:20px;
      display:flex;
      flex-direction:column;
      justify-content:space-between;
      position:relative;
      overflow:hidden;
    }
#budget .metric-card::before{
      content:"";
      position:absolute;
      right:-36px;
      top:-36px;
      width:120px;
      height:120px;
      border-radius:50%;
      background: radial-gradient(circle, rgba(255,255,255,.65), rgba(255,255,255,.08) 65%, transparent 72%);
      pointer-events:none;
    }
#budget .metric-card:nth-child(1){
      background: linear-gradient(135deg, rgba(133, 197, 255, .52), rgba(255,255,255,.42));
      border-color: rgba(133, 197, 255, .50);
      box-shadow: 0 16px 40px rgba(61,124,255,.14), var(--shadow-soft);
    }
#budget .metric-card:nth-child(2){
      background: linear-gradient(135deg, rgba(255, 161, 168, .46), rgba(255,255,255,.40));
      border-color: rgba(255, 161, 168, .50);
      box-shadow: 0 16px 40px rgba(240,68,56,.12), var(--shadow-soft);
    }
#budget .metric-card:nth-child(3){
      background: linear-gradient(135deg, rgba(132, 228, 184, .48), rgba(255,255,255,.40));
      border-color: rgba(132, 228, 184, .50);
      box-shadow: 0 16px 40px rgba(18,183,106,.12), var(--shadow-soft);
    }
#budget .metric-card:nth-child(4){
      background: linear-gradient(135deg, rgba(255, 210, 118, .48), rgba(255,255,255,.40));
      border-color: rgba(255, 210, 118, .52);
      box-shadow: 0 16px 40px rgba(247,144,9,.12), var(--shadow-soft);
    }
#budget .metric-label{ color:var(--muted-2); font-weight:800; font-size:.76rem; text-transform:uppercase; letter-spacing:.09em; position: relative; z-index:1; }
#budget .metric-value{ margin-top:9px; font-size:clamp(1.65rem,2.5vw,2.25rem); font-weight:800; letter-spacing:-.055em; font-variant-numeric:tabular-nums; position: relative; z-index:1; }
#budget .metric-note{ margin-top:8px; color:var(--muted); font-size:.8rem; line-height:1.4; position: relative; z-index:1; }
#budget .dashboard{ display:grid; grid-template-columns:minmax(360px,.82fr) minmax(650px,1.35fr); gap:20px; align-items:start; }
#budget .column{ min-width:0; }
#budget .panel{ overflow:hidden; margin-bottom:20px; }
#budget .panel-head{
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:16px;
      padding:22px 24px 18px;
      border-bottom:1px solid rgba(255,255,255,.34);
      position: relative;
      z-index:1;
    }
#budget .panel-title{ margin:4px 0 0; font-size:1.2rem; letter-spacing:-.03em; font-weight: 750; }
#budget .panel-subtitle{ margin:7px 0 0; color:var(--muted); font-size:.84rem; }
#budget .panel-body{ padding:22px 24px 24px; position: relative; z-index:1; }
#budget .dashboard .column:first-child .panel, #budget .dashboard .column:last-child .panel{ border-top: 1px solid rgba(255,255,255,.44); }
#budget .field-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#budget .field{ min-width:0; }
#budget .field label{ display:block; margin-bottom:7px; color:var(--muted-2); font-weight:800; font-size:.76rem; text-transform:uppercase; letter-spacing:.08em; }
#budget .minimal-field .input-with-prefix{
      background: transparent !important;
      border: 0 !important;
      box-shadow: none !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }
#budget .minimal-field .input-with-prefix::before{
      left: 8px;
      color: #385a91;
      top: 52%;
      font-weight: 900;
    }
#budget .minimal-field .money-input{
      appearance: textfield;
      -webkit-appearance: none;
      -moz-appearance: textfield;
      background: linear-gradient(90deg, rgba(61,124,255,.15), rgba(109,94,252,.08) 62%, transparent 100%) !important;
      border: none !important;
      border-bottom: 1.5px solid rgba(61,124,255,.28) !important;
      border-radius: 12px 12px 0 0 !important;
      padding: 10px 8px 8px 26px !important;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.52) !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      color: #13294b !important;
      font-size: 1.05rem;
      font-weight: 850;
      letter-spacing: -.015em;
    }
#budget .minimal-field .money-input::-webkit-outer-spin-button, #budget .minimal-field .money-input::-webkit-inner-spin-button{
      -webkit-appearance: none;
      margin: 0;
    }
#budget .minimal-field .money-input:focus{
      background: linear-gradient(90deg, rgba(61,124,255,.22), rgba(109,94,252,.12) 62%, transparent 100%) !important;
      border: none !important;
      border-bottom: 1.5px solid rgba(61,124,255,.72) !important;
      box-shadow: 0 2px 0 0 rgba(61,124,255,.22), inset 0 1px 0 rgba(255,255,255,.62) !important;
    }
#budget .money-input, #budget .text-input, #budget .percent-input{
      width:100%; min-width:0; border:1px solid rgba(255,255,255,.54); background:rgba(255,255,255,.34); color:var(--ink); border-radius:16px; padding:12px 14px; outline:none;
      backdrop-filter: blur(18px) saturate(170%);
      -webkit-backdrop-filter: blur(18px) saturate(170%);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.58), 0 1px 2px rgba(15,23,42,.05);
    }
#budget .money-input::placeholder, #budget .text-input::placeholder, #budget .percent-input::placeholder{ color: #98a2b3; }
#budget .money-input:focus, #budget .text-input:focus, #budget .percent-input:focus{
      border-color: rgba(93, 144, 255, .76);
      box-shadow: 0 0 0 4px rgba(61,124,255,.16), inset 0 1px 0 rgba(255,255,255,.72);
      background: rgba(255,255,255,.48);
    }
#budget .input-with-prefix{ position:relative; }
#budget .input-with-prefix::before{ content:"$"; position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--muted); font-weight:800; z-index: 1; }
#budget .input-with-prefix input{ padding-left:30px; }
#budget .section-label{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin:20px 0 10px; color:#252b37; font-size:.88rem; font-weight:800; }
#budget .expense-table, #budget .allocation-list{ display:grid; gap:6px; }
#budget .expense-row{
      display:grid;
      grid-template-columns:24px minmax(0,1fr) 130px 36px;
      gap:8px;
      align-items:center;
      padding: 7px;
      border-radius: 18px;
      background: rgba(255,255,255,.20);
      border: 1px solid rgba(255,255,255,.26);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
    }
#budget .budget-draggable-row.dragging{
      opacity:.55;
      transform:scale(.995);
    }
#budget .budget-draggable-row.drag-over{
      outline:none;
      box-shadow:inset 0 2px 0 var(--brand), inset 0 1px 0 rgba(255,255,255,.35);
    }
#budget .budget-draggable-row.drop-after{
      box-shadow:inset 0 -2px 0 var(--asset-fund), inset 0 1px 0 rgba(255,255,255,.35);
    }
#budget .icon-btn{
      width:36px;
      height:36px;
      border:1px solid rgba(240,68,56,.18);
      border-radius:12px;
      color:var(--danger);
      background:rgba(255,255,255,.36);
      font-weight:900;
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.56);
    }
#budget .icon-btn:hover{ background:rgba(240,68,56,.12); }
#budget .expense-rollup{
      display: grid;
      grid-template-columns: minmax(0,1fr) 130px 36px;
      gap: 8px;
      align-items: center;
      margin-top: 6px;
      padding: 8px 7px 2px;
      color: var(--ink);
      font-size: 1rem;
    }
#budget .expense-rollup span{
      grid-column: 1;
      color: var(--ink);
      font-weight: 600;
      letter-spacing: -.01em;
    }
#budget .expense-rollup strong{
      grid-column: 2;
      justify-self: end;
      width: 100%;
      text-align: right;
      font-size: 1.18rem;
      font-weight: 800;
      letter-spacing: -.03em;
      font-variant-numeric: tabular-nums;
    }
#budget .savings-goal-heading{
      margin-bottom: 2px;
      color: var(--ink);
      font-size: 1rem;
      font-weight: 800;
      letter-spacing: -.02em;
    }
#budget .totals-box{
      display:grid;
      gap:10px;
      margin-top:17px;
      padding:16px;
      border:1px solid rgba(255,255,255,.44);
      border-radius:20px;
      background:linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,.16));
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.58);
    }
#budget .total-line{ display:flex; align-items:center; justify-content:space-between; gap:16px; }
#budget .total-line strong{ font-size:1rem; font-variant-numeric:tabular-nums; }
#budget .formula-note{
      margin-top: 2px;
      color: var(--muted);
      font-size: .78rem;
      line-height: 1.35;
    }
#budget .total-line.highlight{
      margin:2px -2px -2px;
      padding:12px 13px;
      border-radius:14px;
      color:#08634b;
      background:linear-gradient(180deg, rgba(18,183,106,.14), rgba(18,183,106,.08));
      border: 1px solid rgba(18,183,106,.16);
    }
#budget .cashflow-bar{ display:grid; gap:9px; margin-top:18px; }
#budget .stacked-bar{
      display:flex;
      height:14px;
      border-radius:999px;
      background:rgba(255,255,255,.26);
      overflow:hidden;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.60), inset 0 0 0 1px rgba(15,23,42,.04);
    }
#budget .stacked-bar span{ min-width:0; transition:width .25s ease; }
#budget .stacked-bar .expenses{ background:linear-gradient(90deg, #ff7a70, #f04438); }
#budget .stacked-bar .spend{ background:linear-gradient(90deg, #ffd36a, #f7b741); }
#budget .stacked-bar .save{ background:linear-gradient(90deg, #46ddaa, #12b76a); }
#budget .bar-key{ display:flex; gap:14px; flex-wrap:wrap; color:var(--muted); font-size:.76rem; }
#budget .key-item{ display:inline-flex; align-items:center; gap:6px; }
#budget .key-dot{ width:8px; height:8px; border-radius:3px; }
#budget .fund-summary{ display:grid; grid-template-columns:minmax(400px,1.05fr) minmax(315px,.95fr); gap:16px; align-items:stretch; }
#budget .source-card{
      border-radius:24px;
      padding:18px;
      background: linear-gradient(135deg, rgba(22, 32, 62, 0.66) 0%, rgba(57, 67, 104, 0.48) 100%);
      color:#fff;
      border: 1px solid rgba(255,255,255,.14);
      box-shadow: 0 18px 48px rgba(17,24,39,.18), inset 0 1px 0 rgba(255,255,255,.22);
      backdrop-filter: blur(24px) saturate(170%);
      -webkit-backdrop-filter: blur(24px) saturate(170%);
      position: relative;
      overflow: hidden;
    }
#budget .source-card::before{
      content: "";
      position: absolute;
      inset: -2rem auto auto -2rem;
      width: 12rem;
      height: 12rem;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(255,255,255,.14), transparent 68%);
      pointer-events: none;
    }
#budget .source-card label{ color:#d0d7e6; }
#budget .source-card .money-input, #budget .source-card .text-input{
      color:#fff;
      background:rgba(255,255,255,.10);
      border-color:rgba(255,255,255,.16);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(0,0,0,.12);
    }
#budget .source-card .money-input::placeholder, #budget .source-card .text-input::placeholder{ color: rgba(255,255,255,.56); }
#budget .source-card .money-input:focus, #budget .source-card .text-input:focus{ border-color:#9ac1ff; box-shadow:0 0 0 4px rgba(96,165,250,.16), inset 0 1px 0 rgba(255,255,255,.22); background: rgba(255,255,255,.14); }
#budget .source-card .input-with-prefix::before{ color:#d8deea; }
#budget .source-card .btn-dark{ color:#fff; background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.16); }
#budget .source-card .btn-dark:hover{ background:rgba(255,255,255,.18); border-color: rgba(255,255,255,.26); }
#budget .obligations{ display:grid; gap:6px; margin-top:14px; }
#budget .obligation-row{
      display:grid;
      grid-template-columns:minmax(0,1fr) minmax(96px,120px) 38px;
      gap:8px;
      align-items:center;
      padding: 8px;
      border-radius: 18px;
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.08);
    }
#budget .source-card .icon-btn{ color:#fecaca; background:rgba(220,38,38,.16); border-color:rgba(254,202,202,.18); }
#budget .source-card .remove-obligation{
      display: grid;
      place-items: center;
      width: 38px;
      height: 42px;
      color: #ffe1e1;
      background: rgba(240,68,56,.24);
      border-color: rgba(255,205,205,.24);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 18px rgba(105, 20, 28, .18);
      flex: 0 0 auto;
    }
#budget .source-card .remove-obligation:hover{
      color: #fff;
      background: rgba(240,68,56,.42);
      border-color: rgba(255,220,220,.38);
      transform: translateY(-1px);
    }
#budget .source-card .remove-obligation svg{
      width: 17px;
      height: 17px;
      fill: none;
      stroke: currentColor;
      stroke-width: 1.8;
      stroke-linecap: round;
      stroke-linejoin: round;
      pointer-events: none;
    }
#budget .available-box{ margin-top:15px; padding-top:14px; border-top:1px solid rgba(255,255,255,.14); }
#budget .available-box .label{ color:#c2cada; font-size:.76rem; font-weight:800; text-transform:uppercase; letter-spacing:.09em; }
#budget .available-box .value{ margin-top:3px; font-family:var(--display-font); font-size:2.35rem; font-weight:800; letter-spacing:-.06em; }
#budget .donut-card{
      display:grid;
      grid-template-columns:178px minmax(0,1fr);
      gap:20px;
      align-items:center;
      padding:18px;
      border:1px solid rgba(255,255,255,.46);
      border-radius:24px;
      background:linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.20));
      backdrop-filter: blur(22px) saturate(170%);
      -webkit-backdrop-filter: blur(22px) saturate(170%);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.56);
    }
#budget .donut{ width:170px; height:170px; border-radius:50%; display:grid; place-items:center; position:relative; box-shadow:inset 0 0 0 1px rgba(15,23,42,.04), 0 10px 30px rgba(31,41,55,.08); }
#budget .donut::before{ content:""; width:116px; height:116px; border-radius:50%; background:rgba(255,255,255,.76); box-shadow:inset 0 1px 0 rgba(255,255,255,.84), inset 0 0 0 1px rgba(255,255,255,.62); backdrop-filter: blur(20px); }
#budget .donut-center{ position:absolute; z-index:1; text-align:center; }
#budget .donut-center .small{ color:var(--muted-2); text-transform:uppercase; letter-spacing:.08em; font-size:.7rem; font-weight:800; }
#budget .donut-center .amount{ margin-top:3px; font-size:1.35rem; font-weight:800; letter-spacing:-.04em; }
#budget .legend{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px 14px; }
#budget .legend-item{ display:flex; align-items:center; gap:8px; min-width:0; }
#budget .legend-swatch{ width:10px; height:10px; border-radius:3px; flex:0 0 auto; box-shadow: 0 0 0 2px rgba(255,255,255,.56); }
#budget .legend-name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:.78rem; }
#budget .allocation-header, #budget .allocation-row{ display:grid; grid-template-columns:24px minmax(150px,1.2fr) 90px 120px 125px 105px 34px; gap:8px; align-items:center; }
#budget .allocation-header::before{ content:""; }
#budget .allocation-header{ padding:0 3px 3px; color:var(--muted-2); font-size:.69rem; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
#budget .allocation-row{
      padding:10px;
      border:1px solid rgba(255,255,255,.44);
      border-radius:18px;
      background:linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,.18));
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.52);
    }
#budget .allocation-row.over{ border-color:rgba(240,68,56,.30); background:linear-gradient(180deg, rgba(255,245,245,.54), rgba(255,255,255,.20)); }
#budget .allocation-row.under{ border-color:rgba(61,124,255,.28); }
#budget .target-percent-display, #budget .variance{ font-weight:700; white-space:nowrap; font-variant-numeric:tabular-nums; }
#budget .target-percent-display{
      color: var(--muted);
      text-align: center;
      padding: 10px 4px;
    }
#budget .variance.positive{ color:var(--success); }
#budget .variance.negative{ color:var(--danger); }
#budget .allocation-footer{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:14px; }
#budget .mini-stat{
      padding:14px;
      border-radius:18px;
      border:1px solid rgba(255,255,255,.42);
      background:linear-gradient(180deg, rgba(255,255,255,.30), rgba(255,255,255,.18));
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.54);
    }
#budget .mini-stat .label{ color:var(--muted-2); font-size:.69rem; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
#budget .mini-stat .value{ margin-top:4px; font-size:1.2rem; font-weight:800; letter-spacing:-.035em; font-variant-numeric:tabular-nums; }
#budget .mini-stat.good{ background:linear-gradient(180deg, rgba(18,183,106,.14), rgba(255,255,255,.18)); border-color:rgba(18,183,106,.22); }
#budget .mini-stat.warn{ background:linear-gradient(180deg, rgba(240,68,56,.12), rgba(255,255,255,.18)); border-color:rgba(240,68,56,.22); }
#budget .status-line{ min-height:20px; margin:10px 2px 0; color:var(--muted); font-size:.78rem; }
#budget .status-line.error{ color:var(--danger); font-weight:700; }
#budget .footnote{ width:min(1360px,calc(100vw - 48px)); margin:0 auto; padding:0 0 26px; color:var(--muted); font-size:.76rem; text-align:center; }
@media (max-width:1180px){#budget .site-header-inner{ grid-template-columns:auto 1fr; }
#budget .nav-list{ grid-column:1/-1; grid-row:2; justify-content:flex-start; padding-bottom:10px; }
#budget .dashboard{ grid-template-columns:1fr; }
#budget .summary-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }}
@media (max-width:860px){#budget .site-header-inner, #budget .content, #budget .footnote{ width:min(100% - 24px,1360px); }
#budget .site-header-inner{ gap:12px; padding:10px 0; }
#budget .topbar-actions{ display:none; }
#budget .page-heading{ align-items:flex-start; flex-direction:column; }
#budget .hero{ grid-template-columns:1fr; }
#budget .fund-summary, #budget .donut-card{ grid-template-columns:1fr; }
#budget .donut-card{ justify-items:center; }
#budget .legend{ width:100%; }
#budget .allocation-header{ display:none; }
#budget .allocation-row{ grid-template-columns:24px 1fr 78px 32px; grid-template-areas:"drag name pct remove" "drag target actual actual" "drag variance variance variance"; }
#budget .allocation-row .budget-row-drag-handle{ grid-area:drag; align-self:stretch; }
#budget .allocation-row .category-name{ grid-area:name; }
#budget .allocation-row .target-percent-display{ grid-area:pct; }
#budget .allocation-row .target-field{ grid-area:target; }
#budget .allocation-row .actual-field{ grid-area:actual; }
#budget .allocation-row .variance{ grid-area:variance; font-size:.76rem; }
#budget .allocation-row .remove-allocation{ grid-area:remove; }
#budget .allocation-footer{ grid-template-columns:1fr 1fr; }}
@media (max-width:560px){#budget .content{ padding-top:18px; }
#budget .nav-btn{ padding:8px 11px; font-size:.82rem; }
#budget .page-heading h1{ font-size:2rem; }
#budget .summary-grid, #budget .field-grid{ grid-template-columns:1fr; }
#budget .hero-copy, #budget .hero-side, #budget .panel-head, #budget .panel-body{ padding-left:18px; padding-right:18px; }
#budget .expense-row{ grid-template-columns:24px minmax(0,1fr) 105px 36px; }
#budget .expense-rollup{ grid-template-columns:minmax(0,1fr) 105px 36px; }
#budget .obligation-row{
        grid-template-columns:minmax(0,1fr) 32px;
        grid-template-areas:
          "name remove"
          "amount amount";
      }
#budget .obligation-row .obligation-name{ grid-area:name; }
#budget .obligation-row > .input-with-prefix{ grid-area:amount; }
#budget .obligation-row .remove-obligation{ grid-area:remove; }
#budget .legend, #budget .allocation-footer{ grid-template-columns:1fr; }
#budget .donut-card{ padding:14px; }}
@media print{#budget .site-header, #budget .toolbar, #budget .icon-btn, #budget .btn, #budget .footnote{ display:none !important; }
#budget .content{ width:100%; padding:0; }
#budget .hero-copy, #budget .hero-side, #budget .panel, #budget .metric-card{ box-shadow:none; background:#fff; backdrop-filter:none; }}


#budget.liquid-budget-view { max-width: none; margin: 0; padding-bottom: 8px; }
#budget .page-heading { padding-top: 2px; }
#budget .toolbar { align-self: flex-start; }
#budget .dashboard { margin-top: 0; }
#budget .panel { padding: 0; }
#budget .metric-card { padding: 20px; }
#budget .money-input,
#budget .text-input { color: var(--ink); }
#budget .source-card .money-input,
#budget .source-card .text-input { color: #fff !important; }
#budget .allocation-row input { min-width: 0; }
#budget .allocation-row .icon-btn,
#budget .expense-row .icon-btn { width: 36px; }
#budget .status-line { min-height: 22px; }
#budget .empty-budget-note { color: var(--muted); padding: 12px; text-align: center; }
@media (max-width: 760px) {
  #budget .page-heading { align-items: flex-start; }
  #budget .toolbar { justify-content: flex-start; }
}

/* v124 stronger full-card outlines for key summary metrics */
/* Match the Projection milestone treatment: a colored perimeter plus a thicker top edge. */
#projection .account-projection-cards > div,
#car .car-summary-cards > div,
#networth .account-total-strip > div {
  border-style: solid !important;
  border-width: 2px !important;
  border-top-width: 7px !important;
  background: linear-gradient(180deg, rgba(255,255,255,.68), rgba(255,255,255,.32)) !important;
  box-shadow:
    0 12px 28px rgba(31, 41, 55, .08),
    inset 0 1px 0 rgba(255,255,255,.78) !important;
}

/* Individual Account Projection */
#projection .account-projection-cards > div:nth-child(1) {
  border-color: var(--brand) !important;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .13), inset 0 1px 0 rgba(255,255,255,.78) !important;
}
#projection .account-projection-cards > div:nth-child(2) {
  border-color: var(--asset-current) !important;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .13), inset 0 1px 0 rgba(255,255,255,.78) !important;
}
#projection .account-projection-cards > div:nth-child(3) {
  border-color: var(--asset-long) !important;
  box-shadow: 0 12px 28px rgba(245, 158, 11, .13), inset 0 1px 0 rgba(255,255,255,.78) !important;
}
#projection .account-projection-cards > div:nth-child(4) {
  border-color: var(--accent-purple) !important;
  box-shadow: 0 12px 28px rgba(139, 92, 246, .13), inset 0 1px 0 rgba(255,255,255,.78) !important;
}
#projection .account-projection-cards > div:nth-child(5) {
  border-color: var(--accent-pink) !important;
  box-shadow: 0 12px 28px rgba(236, 72, 153, .13), inset 0 1px 0 rgba(255,255,255,.78) !important;
}

/* Car affordability summary */
#car .car-summary-cards > div:nth-child(1) {
  border-color: var(--brand) !important;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .13), inset 0 1px 0 rgba(255,255,255,.78) !important;
}
#car .car-summary-cards > div:nth-child(2) {
  border-color: var(--asset-fund) !important;
  box-shadow: 0 12px 28px rgba(20, 184, 166, .13), inset 0 1px 0 rgba(255,255,255,.78) !important;
}
#car .car-summary-cards > div:nth-child(3) {
  border-color: var(--asset-long) !important;
  box-shadow: 0 12px 28px rgba(245, 158, 11, .13), inset 0 1px 0 rgba(255,255,255,.78) !important;
}
#car .car-summary-cards > div:nth-child(4) {
  border-color: var(--accent-purple) !important;
  box-shadow: 0 12px 28px rgba(139, 92, 246, .13), inset 0 1px 0 rgba(255,255,255,.78) !important;
}

/* Accounts totals strip */
#networth .account-total-strip > div {
  border-top-width: 6px !important;
}
#networth .account-total-strip > div:nth-child(1) {
  border-color: var(--asset-current) !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .12), inset 0 1px 0 rgba(255,255,255,.78) !important;
}
#networth .account-total-strip > div:nth-child(2) {
  border-color: var(--danger) !important;
  box-shadow: 0 10px 24px rgba(220, 38, 38, .12), inset 0 1px 0 rgba(255,255,255,.78) !important;
}
#networth .account-total-strip > div:nth-child(3) {
  border-color: var(--asset-long) !important;
  box-shadow: 0 10px 24px rgba(245, 158, 11, .12), inset 0 1px 0 rgba(255,255,255,.78) !important;
}
#networth .account-total-strip > div:nth-child(4) {
  border-color: var(--danger) !important;
  box-shadow: 0 10px 24px rgba(220, 38, 38, .12), inset 0 1px 0 rgba(255,255,255,.78) !important;
}

body.night-mode #projection .account-projection-cards > div,
body.night-mode #car .car-summary-cards > div,
body.night-mode #networth .account-total-strip > div {
  background: linear-gradient(180deg, rgba(21,31,48,.88), rgba(12,18,28,.78)) !important;
  box-shadow: 0 14px 30px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08) !important;
}

@media (max-width: 760px) {
  #projection .account-projection-cards > div,
  #car .car-summary-cards > div,
  #networth .account-total-strip > div {
    border-top-width: 6px !important;
  }
}

/* v123: stronger full-color outlines for summary cards that were too subtle */
#networth .account-total-strip > div,
#car .car-summary-cards > div,
#projection .account-projection-cards > div {
  border-style: solid !important;
  border-width: 2px !important;
  border-top-width: 7px !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,.30)) !important;
  box-shadow: 0 12px 28px rgba(31,41,55,.08), inset 0 1px 0 rgba(255,255,255,.72) !important;
}

/* Accounts summary */
#networth .account-total-strip > div:nth-child(1) {
  border-color: var(--asset-current) !important;
  box-shadow: 0 12px 28px rgba(37,99,235,.12), inset 0 1px 0 rgba(255,255,255,.72) !important;
}
#networth .account-total-strip > div:nth-child(2) {
  border-color: var(--danger) !important;
  box-shadow: 0 12px 28px rgba(220,38,38,.11), inset 0 1px 0 rgba(255,255,255,.72) !important;
}
#networth .account-total-strip > div:nth-child(3) {
  border-color: var(--asset-long) !important;
  box-shadow: 0 12px 28px rgba(245,158,11,.11), inset 0 1px 0 rgba(255,255,255,.72) !important;
}
#networth .account-total-strip > div:nth-child(4) {
  border-color: var(--danger) !important;
  box-shadow: 0 12px 28px rgba(220,38,38,.11), inset 0 1px 0 rgba(255,255,255,.72) !important;
}

/* Car affordability summary */
#car .car-summary-cards > div:nth-child(1) {
  border-color: var(--asset-current) !important;
  box-shadow: 0 12px 28px rgba(37,99,235,.12), inset 0 1px 0 rgba(255,255,255,.72) !important;
}
#car .car-summary-cards > div:nth-child(2) {
  border-color: var(--asset-fund) !important;
  box-shadow: 0 12px 28px rgba(20,184,166,.12), inset 0 1px 0 rgba(255,255,255,.72) !important;
}
#car .car-summary-cards > div:nth-child(3) {
  border-color: var(--asset-long) !important;
  box-shadow: 0 12px 28px rgba(245,158,11,.12), inset 0 1px 0 rgba(255,255,255,.72) !important;
}
#car .car-summary-cards > div:nth-child(4) {
  border-color: var(--accent-purple) !important;
  box-shadow: 0 12px 28px rgba(139,92,246,.12), inset 0 1px 0 rgba(255,255,255,.72) !important;
}

/* Individual account projection summary */
#projection .account-projection-cards > div:nth-child(1) {
  border-color: var(--brand) !important;
  box-shadow: 0 12px 28px rgba(37,99,235,.12), inset 0 1px 0 rgba(255,255,255,.72) !important;
}
#projection .account-projection-cards > div:nth-child(2) {
  border-color: var(--asset-current) !important;
  box-shadow: 0 12px 28px rgba(37,99,235,.12), inset 0 1px 0 rgba(255,255,255,.72) !important;
}
#projection .account-projection-cards > div:nth-child(3) {
  border-color: var(--asset-long) !important;
  box-shadow: 0 12px 28px rgba(245,158,11,.12), inset 0 1px 0 rgba(255,255,255,.72) !important;
}
#projection .account-projection-cards > div:nth-child(4) {
  border-color: var(--accent-purple) !important;
  box-shadow: 0 12px 28px rgba(139,92,246,.12), inset 0 1px 0 rgba(255,255,255,.72) !important;
}
#projection .account-projection-cards > div:nth-child(5) {
  border-color: var(--accent-pink) !important;
  box-shadow: 0 12px 28px rgba(236,72,153,.12), inset 0 1px 0 rgba(255,255,255,.72) !important;
}

body.night-mode #networth .account-total-strip > div,
body.night-mode #car .car-summary-cards > div,
body.night-mode #projection .account-projection-cards > div {
  background: linear-gradient(180deg, rgba(20,34,58,.72), rgba(11,23,42,.48)) !important;
  box-shadow: 0 14px 32px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.08) !important;
}

/* v123: stronger category styling for Budget summary cards */
#budget #budgetTotals > *,
#budget .budget-summary-cards > * {
  border-width: 2px !important;
  border-style: solid !important;
  border-radius: 18px !important;
  border-color: rgba(226, 231, 239, 0.95) !important;
  border-top-width: 8px !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96)) !important;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08) !important;
}

#budget #budgetTotals > *:nth-child(1),
#budget .budget-summary-cards > *:nth-child(1) {
  border-color: #059669 !important;
  background: linear-gradient(180deg, #f2fff8 0%, #e7f9ef 100%) !important;
  box-shadow: 0 16px 34px rgba(5, 150, 105, 0.16) !important;
}
#budget #budgetTotals > *:nth-child(1) span,
#budget #budgetTotals > *:nth-child(1) small,
#budget .budget-summary-cards > *:nth-child(1) span,
#budget .budget-summary-cards > *:nth-child(1) small {
  color: #2d6a4f !important;
}
#budget #budgetTotals > *:nth-child(1) strong,
#budget .budget-summary-cards > *:nth-child(1) strong {
  color: #064e3b !important;
}

#budget #budgetTotals > *:nth-child(2),
#budget .budget-summary-cards > *:nth-child(2) {
  border-color: #dc2626 !important;
  background: linear-gradient(180deg, #fff7f7 0%, #ffefef 100%) !important;
  box-shadow: 0 16px 34px rgba(220, 38, 38, 0.14) !important;
}
#budget #budgetTotals > *:nth-child(2) span,
#budget #budgetTotals > *:nth-child(2) small,
#budget .budget-summary-cards > *:nth-child(2) span,
#budget .budget-summary-cards > *:nth-child(2) small {
  color: #8f4a45 !important;
}
#budget #budgetTotals > *:nth-child(2) strong,
#budget .budget-summary-cards > *:nth-child(2) strong {
  color: #7f1d1d !important;
}

#budget #budgetTotals > *:nth-child(3),
#budget .budget-summary-cards > *:nth-child(3) {
  border-color: #f59e0b !important;
  background: linear-gradient(180deg, #fffaf1 0%, #fff1da 100%) !important;
  box-shadow: 0 16px 34px rgba(245, 158, 11, 0.16) !important;
}
#budget #budgetTotals > *:nth-child(3) span,
#budget #budgetTotals > *:nth-child(3) small,
#budget .budget-summary-cards > *:nth-child(3) span,
#budget .budget-summary-cards > *:nth-child(3) small {
  color: #8d6320 !important;
}
#budget #budgetTotals > *:nth-child(3) strong,
#budget .budget-summary-cards > *:nth-child(3) strong {
  color: #7c2d12 !important;
}

#budget #budgetTotals > *:nth-child(4),
#budget .budget-summary-cards > *:nth-child(4) {
  border-color: #8b5cf6 !important;
  background: linear-gradient(180deg, #faf7ff 0%, #f2edff 100%) !important;
  box-shadow: 0 16px 34px rgba(139, 92, 246, 0.16) !important;
}
#budget #budgetTotals > *:nth-child(4) span,
#budget #budgetTotals > *:nth-child(4) small,
#budget .budget-summary-cards > *:nth-child(4) span,
#budget .budget-summary-cards > *:nth-child(4) small {
  color: #62538c !important;
}
#budget #budgetTotals > *:nth-child(4) strong,
#budget .budget-summary-cards > *:nth-child(4) strong {
  color: #312e81 !important;
}

body.night-mode #budget #budgetTotals > *,
body.night-mode #budget .budget-summary-cards > * {
  background: linear-gradient(180deg, rgba(17, 26, 39, 0.92), rgba(12, 18, 28, 0.95)) !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24) !important;
}
body.night-mode #budget #budgetTotals > *:nth-child(1),
body.night-mode #budget .budget-summary-cards > *:nth-child(1) {
  border-color: #10b981 !important;
  background: linear-gradient(180deg, rgba(5, 150, 105, 0.18), rgba(6, 78, 59, 0.24)) !important;
}
body.night-mode #budget #budgetTotals > *:nth-child(1) span,
body.night-mode #budget #budgetTotals > *:nth-child(1) small,
body.night-mode #budget .budget-summary-cards > *:nth-child(1) span,
body.night-mode #budget .budget-summary-cards > *:nth-child(1) small { color: #bbf7d0 !important; }
body.night-mode #budget #budgetTotals > *:nth-child(1) strong,
body.night-mode #budget .budget-summary-cards > *:nth-child(1) strong { color: #ecfdf5 !important; }

body.night-mode #budget #budgetTotals > *:nth-child(2),
body.night-mode #budget .budget-summary-cards > *:nth-child(2) {
  border-color: #ef4444 !important;
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.14), rgba(127, 29, 29, 0.24)) !important;
}
body.night-mode #budget #budgetTotals > *:nth-child(2) span,
body.night-mode #budget #budgetTotals > *:nth-child(2) small,
body.night-mode #budget .budget-summary-cards > *:nth-child(2) span,
body.night-mode #budget .budget-summary-cards > *:nth-child(2) small { color: #fecaca !important; }
body.night-mode #budget #budgetTotals > *:nth-child(2) strong,
body.night-mode #budget .budget-summary-cards > *:nth-child(2) strong { color: #fef2f2 !important; }

body.night-mode #budget #budgetTotals > *:nth-child(3),
body.night-mode #budget .budget-summary-cards > *:nth-child(3) {
  border-color: #f59e0b !important;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.14), rgba(124, 45, 18, 0.24)) !important;
}
body.night-mode #budget #budgetTotals > *:nth-child(3) span,
body.night-mode #budget #budgetTotals > *:nth-child(3) small,
body.night-mode #budget .budget-summary-cards > *:nth-child(3) span,
body.night-mode #budget .budget-summary-cards > *:nth-child(3) small { color: #fde68a !important; }
body.night-mode #budget #budgetTotals > *:nth-child(3) strong,
body.night-mode #budget .budget-summary-cards > *:nth-child(3) strong { color: #fffbeb !important; }

body.night-mode #budget #budgetTotals > *:nth-child(4),
body.night-mode #budget .budget-summary-cards > *:nth-child(4) {
  border-color: #8b5cf6 !important;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.16), rgba(49, 46, 129, 0.24)) !important;
}
body.night-mode #budget #budgetTotals > *:nth-child(4) span,
body.night-mode #budget #budgetTotals > *:nth-child(4) small,
body.night-mode #budget .budget-summary-cards > *:nth-child(4) span,
body.night-mode #budget .budget-summary-cards > *:nth-child(4) small { color: #ddd6fe !important; }
body.night-mode #budget #budgetTotals > *:nth-child(4) strong,
body.night-mode #budget .budget-summary-cards > *:nth-child(4) strong { color: #f5f3ff !important; }


/* v125: correctly target the NEW Budget tab summary-grid cards.
   These selectors intentionally use semantic classes and direct-child fallbacks. */
#budget > .summary-grid > .metric-card,
#budget .summary-grid > .budget-summary-card {
  border-style: solid !important;
  border-width: 3px !important;
  border-top-width: 10px !important;
  border-radius: 22px !important;
  overflow: hidden !important;
  backdrop-filter: blur(22px) saturate(175%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(175%) !important;
}

/* Monthly Income — green */
#budget > .summary-grid > .metric-card:nth-child(1),
#budget .budget-summary-income {
  border-color: #16a34a !important;
  background-color: #dcfce7 !important;
  background-image: linear-gradient(145deg, rgba(134,239,172,.66) 0%, rgba(240,253,244,.96) 58%, rgba(255,255,255,.88) 100%) !important;
  box-shadow: 0 18px 42px rgba(22,163,74,.22), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
#budget > .summary-grid > .metric-card:nth-child(1) .metric-label,
#budget > .summary-grid > .metric-card:nth-child(1) .metric-note,
#budget .budget-summary-income .metric-label,
#budget .budget-summary-income .metric-note { color: #166534 !important; }
#budget > .summary-grid > .metric-card:nth-child(1) .metric-value,
#budget .budget-summary-income .metric-value { color: #052e16 !important; }

/* Fixed Expenses — red */
#budget > .summary-grid > .metric-card:nth-child(2),
#budget .budget-summary-expenses {
  border-color: #dc2626 !important;
  background-color: #fee2e2 !important;
  background-image: linear-gradient(145deg, rgba(254,202,202,.72) 0%, rgba(254,242,242,.97) 58%, rgba(255,255,255,.88) 100%) !important;
  box-shadow: 0 18px 42px rgba(220,38,38,.20), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
#budget > .summary-grid > .metric-card:nth-child(2) .metric-label,
#budget > .summary-grid > .metric-card:nth-child(2) .metric-note,
#budget .budget-summary-expenses .metric-label,
#budget .budget-summary-expenses .metric-note { color: #991b1b !important; }
#budget > .summary-grid > .metric-card:nth-child(2) .metric-value,
#budget .budget-summary-expenses .metric-value { color: #450a0a !important; }

/* Savings Target — orange */
#budget > .summary-grid > .metric-card:nth-child(3),
#budget .budget-summary-savings {
  border-color: #f59e0b !important;
  background-color: #fef3c7 !important;
  background-image: linear-gradient(145deg, rgba(253,230,138,.76) 0%, rgba(255,251,235,.97) 58%, rgba(255,255,255,.88) 100%) !important;
  box-shadow: 0 18px 42px rgba(245,158,11,.22), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
#budget > .summary-grid > .metric-card:nth-child(3) .metric-label,
#budget > .summary-grid > .metric-card:nth-child(3) .metric-note,
#budget .budget-summary-savings .metric-label,
#budget .budget-summary-savings .metric-note { color: #92400e !important; }
#budget > .summary-grid > .metric-card:nth-child(3) .metric-value,
#budget .budget-summary-savings .metric-value { color: #451a03 !important; }

/* Available to Invest — purple */
#budget > .summary-grid > .metric-card:nth-child(4),
#budget .budget-summary-available {
  border-color: #8b5cf6 !important;
  background-color: #ede9fe !important;
  background-image: linear-gradient(145deg, rgba(196,181,253,.72) 0%, rgba(245,243,255,.97) 58%, rgba(255,255,255,.88) 100%) !important;
  box-shadow: 0 18px 42px rgba(139,92,246,.22), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
#budget > .summary-grid > .metric-card:nth-child(4) .metric-label,
#budget > .summary-grid > .metric-card:nth-child(4) .metric-note,
#budget .budget-summary-available .metric-label,
#budget .budget-summary-available .metric-note { color: #6d28d9 !important; }
#budget > .summary-grid > .metric-card:nth-child(4) .metric-value,
#budget .budget-summary-available .metric-value { color: #2e1065 !important; }

/* Preserve clear category coding in Night Mode. */
body.night-mode #budget .budget-summary-income {
  border-color: #22c55e !important;
  background-image: linear-gradient(145deg, rgba(22,163,74,.38), rgba(6,78,59,.52)) !important;
}
body.night-mode #budget .budget-summary-expenses {
  border-color: #ef4444 !important;
  background-image: linear-gradient(145deg, rgba(220,38,38,.36), rgba(127,29,29,.52)) !important;
}
body.night-mode #budget .budget-summary-savings {
  border-color: #f59e0b !important;
  background-image: linear-gradient(145deg, rgba(245,158,11,.34), rgba(120,53,15,.54)) !important;
}
body.night-mode #budget .budget-summary-available {
  border-color: #a78bfa !important;
  background-image: linear-gradient(145deg, rgba(139,92,246,.38), rgba(76,29,149,.54)) !important;
}
body.night-mode #budget .budget-summary-card .metric-value { color: #ffffff !important; }
body.night-mode #budget .budget-summary-card .metric-label,
body.night-mode #budget .budget-summary-card .metric-note { color: rgba(255,255,255,.82) !important; }

/* v124: stronger outlined cards for Percentile summary metrics */
#percentile #percentileSummaryCards > * {
  min-height: 150px !important;
  padding: 26px 28px 24px !important;
  border: 2px solid rgba(226, 231, 239, 0.96) !important;
  border-top-width: 8px !important;
  border-radius: 22px !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96)) !important;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08) !important;
}
#percentile #percentileSummaryCards > * span {
  color: var(--muted-2) !important;
  font-size: .82rem !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
}
#percentile #percentileSummaryCards > * strong {
  color: var(--ink) !important;
  font-size: clamp(1.75rem, 2.5vw, 2.35rem) !important;
  letter-spacing: -.05em !important;
}

#percentile #percentileSummaryCards > *:nth-child(1) {
  border-color: #3b82f6 !important;
  box-shadow: 0 16px 34px rgba(59, 130, 246, 0.14) !important;
}
#percentile #percentileSummaryCards > *:nth-child(2) {
  border-color: #14b8a6 !important;
  box-shadow: 0 16px 34px rgba(20, 184, 166, 0.14) !important;
}
#percentile #percentileSummaryCards > *:nth-child(3) {
  border-color: #f59e0b !important;
  box-shadow: 0 16px 34px rgba(245, 158, 11, 0.14) !important;
}
#percentile #percentileSummaryCards > *:nth-child(4) {
  border-color: #8b5cf6 !important;
  box-shadow: 0 16px 34px rgba(139, 92, 246, 0.14) !important;
}

body.night-mode #percentile #percentileSummaryCards > * {
  background: linear-gradient(180deg, rgba(17, 26, 39, 0.92), rgba(12, 18, 28, 0.95)) !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24) !important;
}
body.night-mode #percentile #percentileSummaryCards > *:nth-child(1) {
  border-color: #60a5fa !important;
  box-shadow: 0 16px 34px rgba(59, 130, 246, 0.20) !important;
}
body.night-mode #percentile #percentileSummaryCards > *:nth-child(2) {
  border-color: #2dd4bf !important;
  box-shadow: 0 16px 34px rgba(20, 184, 166, 0.20) !important;
}
body.night-mode #percentile #percentileSummaryCards > *:nth-child(3) {
  border-color: #fbbf24 !important;
  box-shadow: 0 16px 34px rgba(245, 158, 11, 0.20) !important;
}
body.night-mode #percentile #percentileSummaryCards > *:nth-child(4) {
  border-color: #a78bfa !important;
  box-shadow: 0 16px 34px rgba(139, 92, 246, 0.20) !important;
}

/* v125: keep Percentile summary values contained inside cards */
#percentile #percentileSummaryCards > * {
  min-width: 0 !important;
  overflow: hidden !important;
}
#percentile #percentileSummaryCards > * strong {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  font-size: clamp(1.55rem, 2.2vw, 2.15rem) !important;
  line-height: 1.02 !important;
  letter-spacing: -.045em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  font-variant-numeric: tabular-nums !important;
}
#percentile #percentileSummaryCards > *:nth-child(1) strong {
  font-size: clamp(1.8rem, 2.8vw, 2.6rem) !important;
}
#percentile #percentileSummaryCards > *:nth-child(3) strong,
#percentile #percentileSummaryCards > *:nth-child(4) strong {
  font-size: clamp(1.4rem, 1.9vw, 1.95rem) !important;
}

@media (max-width: 1350px) {
  #percentile #percentileSummaryCards > * {
    padding-left: 22px !important;
    padding-right: 22px !important;
  }
  #percentile #percentileSummaryCards > * strong {
    font-size: clamp(1.35rem, 2vw, 1.9rem) !important;
  }
  #percentile #percentileSummaryCards > *:nth-child(1) strong {
    font-size: clamp(1.65rem, 2.5vw, 2.3rem) !important;
  }
  #percentile #percentileSummaryCards > *:nth-child(3) strong,
  #percentile #percentileSummaryCards > *:nth-child(4) strong {
    font-size: clamp(1.25rem, 1.75vw, 1.7rem) !important;
  }
}

@media (max-width: 1100px) {
  #percentile #percentileSummaryCards > * strong,
  #percentile #percentileSummaryCards > *:nth-child(3) strong,
  #percentile #percentileSummaryCards > *:nth-child(4) strong {
    font-size: clamp(1.55rem, 3.4vw, 2.2rem) !important;
  }
}

@media (max-width: 640px) {
  #percentile #percentileSummaryCards > * {
    padding: 22px 20px !important;
  }
  #percentile #percentileSummaryCards > * strong,
  #percentile #percentileSummaryCards > *:nth-child(1) strong,
  #percentile #percentileSummaryCards > *:nth-child(3) strong,
  #percentile #percentileSummaryCards > *:nth-child(4) strong {
    font-size: clamp(1.5rem, 8vw, 2.15rem) !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}

/* v126: make Percentile summary values uniform across all four cards */
#percentile #percentileSummaryCards > * strong,
#percentile #percentileSummaryCards > *:nth-child(1) strong,
#percentile #percentileSummaryCards > *:nth-child(3) strong,
#percentile #percentileSummaryCards > *:nth-child(4) strong {
  font-size: clamp(1.65rem, 2.1vw, 2.15rem) !important;
  line-height: 1.02 !important;
  letter-spacing: -.045em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
}

@media (max-width: 1350px) {
  #percentile #percentileSummaryCards > * strong,
  #percentile #percentileSummaryCards > *:nth-child(1) strong,
  #percentile #percentileSummaryCards > *:nth-child(3) strong,
  #percentile #percentileSummaryCards > *:nth-child(4) strong {
    font-size: clamp(1.45rem, 1.9vw, 1.9rem) !important;
  }
}

@media (max-width: 1100px) {
  #percentile #percentileSummaryCards > * strong,
  #percentile #percentileSummaryCards > *:nth-child(1) strong,
  #percentile #percentileSummaryCards > *:nth-child(3) strong,
  #percentile #percentileSummaryCards > *:nth-child(4) strong {
    font-size: clamp(1.65rem, 3.2vw, 2rem) !important;
  }
}

@media (max-width: 640px) {
  #percentile #percentileSummaryCards > * strong,
  #percentile #percentileSummaryCards > *:nth-child(1) strong,
  #percentile #percentileSummaryCards > *:nth-child(3) strong,
  #percentile #percentileSummaryCards > *:nth-child(4) strong {
    font-size: clamp(1.45rem, 7vw, 2rem) !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}

/* v127: stable, uniform Percentile value sizing without clipping */
#percentile #percentileSummaryCards > * {
  min-width: 0 !important;
  overflow: visible !important;
}
#percentile #percentileSummaryCards > * strong,
#percentile #percentileSummaryCards > *:nth-child(1) strong,
#percentile #percentileSummaryCards > *:nth-child(2) strong,
#percentile #percentileSummaryCards > *:nth-child(3) strong,
#percentile #percentileSummaryCards > *:nth-child(4) strong {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  font-family: var(--font) !important;
  font-size: 34px !important;
  font-weight: 900 !important;
  line-height: 1.05 !important;
  letter-spacing: -1.2px !important;
  font-variant-numeric: tabular-nums !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
@media (max-width: 1100px) {
  #percentile #percentileSummaryCards > * strong,
  #percentile #percentileSummaryCards > *:nth-child(1) strong,
  #percentile #percentileSummaryCards > *:nth-child(2) strong,
  #percentile #percentileSummaryCards > *:nth-child(3) strong,
  #percentile #percentileSummaryCards > *:nth-child(4) strong {
    font-size: 32px !important;
  }
}
@media (max-width: 640px) {
  #percentile #percentileSummaryCards > * strong,
  #percentile #percentileSummaryCards > *:nth-child(1) strong,
  #percentile #percentileSummaryCards > *:nth-child(2) strong,
  #percentile #percentileSummaryCards > *:nth-child(3) strong,
  #percentile #percentileSummaryCards > *:nth-child(4) strong {
    font-size: 28px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}


/* v128: reduce bright white glare in Dark Mode so values/data are easier to read */
body.night-mode {
  --panel: rgba(10, 18, 33, 0.92) !important;
  --panel-soft: rgba(14, 24, 42, 0.88) !important;
  --border: rgba(120, 149, 196, 0.26) !important;
  --border-strong: rgba(140, 170, 220, 0.34) !important;
  background:
    radial-gradient(circle at 10% 8%, rgba(61,124,255,.10), transparent 0 26rem),
    radial-gradient(circle at 88% 10%, rgba(45,212,191,.06), transparent 0 22rem),
    radial-gradient(circle at 70% 80%, rgba(155,124,255,.05), transparent 0 24rem),
    linear-gradient(180deg, #050b15 0%, #07101d 52%, #050b15 100%) !important;
}

body.night-mode .site-header {
  background: rgba(5, 10, 18, 0.78) !important;
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

/* Make dark-mode cards and panels more opaque/darker */
body.night-mode .panel,
body.night-mode .metric-card,
body.night-mode .hero-summary,
body.night-mode .summary-tile,
body.night-mode .account-group,
body.night-mode .table-wrap,
body.night-mode .toggle-card,
body.night-mode .notice,
body.night-mode .modal,
body.night-mode .calculator-widget,
body.night-mode .notes-widget,
body.night-mode .accounts-onboarding,
body.night-mode .settings-guide-card,
body.night-mode .external-value-card,
body.night-mode .retirement-stat-card,
body.night-mode .embedded-account-projection,
body.night-mode .projection-summary-chart,
body.night-mode .car-hero-result,
body.night-mode .percentile-result .result-card,
body.night-mode .auth-card,
body.night-mode .auth-side-card,
body.night-mode .landing-tour-frame,
body.night-mode .tour-visual-card,
body.night-mode .legal-document {
  background: linear-gradient(180deg, rgba(16, 27, 46, 0.92), rgba(9, 18, 33, 0.88)) !important;
  border-color: rgba(140, 170, 220, 0.24) !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.26) !important;
}

/* Remove the bright glass sheen overlay in dark mode */
body.night-mode .panel::before,
body.night-mode .metric-card::after,
body.night-mode .tour-visual-card::before,
body.night-mode .auth-card::before,
body.night-mode .auth-side-card::before {
  background: none !important;
  opacity: 0 !important;
}

/* Keep cards from blending into the page */
body.night-mode .summary-tile,
body.night-mode .mini-row,
body.night-mode .breakdown-row,
body.night-mode .account-row,
body.night-mode .liabilities-panel .total-mini,
body.night-mode .projection-contribution-row,
body.night-mode .contribution-summary div,
body.night-mode .contribution-monthly-equivalent,
body.night-mode .empty-contribution-plan {
  background: rgba(18, 30, 51, 0.86) !important;
  border-color: rgba(140, 170, 220, 0.18) !important;
}

/* Inputs/buttons less glary */
body.night-mode input,
body.night-mode select,
body.night-mode textarea,
body.night-mode .ghost-btn,
body.night-mode .calculator-toggle-btn,
body.night-mode .notes-toggle-btn,
body.night-mode .ghost-icon-btn,
body.night-mode .danger-ghost,
body.night-mode .category-add-btn,
body.night-mode .btn {
  background: rgba(18, 32, 56, 0.84) !important;
  border-color: rgba(140, 170, 220, 0.24) !important;
  color: var(--ink) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 2px 8px rgba(0,0,0,0.18) !important;
}
body.night-mode input:focus,
body.night-mode select:focus,
body.night-mode textarea:focus {
  background: rgba(22, 38, 65, 0.94) !important;
  border-color: rgba(96, 165, 250, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(37,99,235,.14), inset 0 1px 0 rgba(255,255,255,.05) !important;
}

/* Preserve the white projection charts from v9, but only there */
body.night-mode #projectionChart,
body.night-mode #projectionAccountChart {
  background: #fbfdff !important;
}


/* v129: Budget tab dark-mode contrast improvements */
body.night-mode #budget {
  color: var(--ink);
}
body.night-mode #budget .page-heading .lede,
body.night-mode #budget .headline-points,
body.night-mode #budget .headline-points li,
body.night-mode #budget .panel-subtitle,
body.night-mode #budget .formula-note,
body.night-mode #budget .bar-key,
body.night-mode #budget .legend-name,
body.night-mode #budget .status-line,
body.night-mode #budget .footnote {
  color: #c8d4e8 !important;
}
body.night-mode #budget .field label,
body.night-mode #budget .metric-label,
body.night-mode #budget .section-label,
body.night-mode #budget .allocation-header,
body.night-mode #budget .mini-stat .label,
body.night-mode #budget .available-box .label,
body.night-mode #budget .donut-center .small,
body.night-mode #budget .expense-rollup span {
  color: #aebed8 !important;
}
body.night-mode #budget .metric-value,
body.night-mode #budget .panel-title,
body.night-mode #budget .savings-goal-heading,
body.night-mode #budget .total-line,
body.night-mode #budget .total-line strong,
body.night-mode #budget .expense-rollup strong,
body.night-mode #budget .available-box .value,
body.night-mode #budget .donut-center .amount,
body.night-mode #budget .mini-stat .value,
body.night-mode #budget .target-percent-display,
body.night-mode #budget .target-percent-display strong,
body.night-mode #budget .variance,
body.night-mode #budget .variance strong {
  color: #f2f7ff !important;
}

/* Brighter income/spend input styling */
body.night-mode #budget .minimal-field .input-with-prefix::before,
body.night-mode #budget .input-with-prefix::before {
  color: #8fb4ff !important;
}
body.night-mode #budget .minimal-field .money-input {
  background: linear-gradient(90deg, rgba(61,124,255,.24), rgba(109,94,252,.14) 62%, rgba(12,22,40,.12) 100%) !important;
  border-bottom: 2px solid rgba(96,165,250,.58) !important;
  color: #f4f8ff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08) !important;
}
body.night-mode #budget .minimal-field .money-input:focus {
  background: linear-gradient(90deg, rgba(61,124,255,.30), rgba(109,94,252,.18) 62%, rgba(12,22,40,.16) 100%) !important;
  border-bottom-color: rgba(147,197,253,.92) !important;
  box-shadow: 0 2px 0 0 rgba(61,124,255,.22), inset 0 1px 0 rgba(255,255,255,.10) !important;
}

/* General budget inputs */
body.night-mode #budget .money-input,
body.night-mode #budget .text-input,
body.night-mode #budget .percent-input {
  background: rgba(18, 34, 58, 0.94) !important;
  border-color: rgba(150, 179, 228, 0.34) !important;
  color: #eef4ff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 1px 2px rgba(0,0,0,.14) !important;
}
body.night-mode #budget .money-input::placeholder,
body.night-mode #budget .text-input::placeholder,
body.night-mode #budget .percent-input::placeholder {
  color: #8fa0b9 !important;
}
body.night-mode #budget .money-input:focus,
body.night-mode #budget .text-input:focus,
body.night-mode #budget .percent-input:focus {
  background: rgba(22, 41, 69, 0.98) !important;
  border-color: rgba(147,197,253,.72) !important;
}

/* Expense and allocation rows */
body.night-mode #budget .expense-row,
body.night-mode #budget .allocation-row,
body.night-mode #budget .totals-box,
body.night-mode #budget .donut-card,
body.night-mode #budget .mini-stat {
  background: linear-gradient(180deg, rgba(31, 46, 74, 0.92), rgba(19, 30, 51, 0.90)) !important;
  border-color: rgba(150, 179, 228, 0.30) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 18px rgba(0,0,0,.16) !important;
}
body.night-mode #budget .budget-draggable-row.drag-over {
  box-shadow: inset 0 2px 0 #60a5fa, inset 0 1px 0 rgba(255,255,255,.06), 0 8px 18px rgba(0,0,0,.16) !important;
}
body.night-mode #budget .budget-draggable-row.drop-after {
  box-shadow: inset 0 -2px 0 #2dd4bf, inset 0 1px 0 rgba(255,255,255,.06), 0 8px 18px rgba(0,0,0,.16) !important;
}
body.night-mode #budget .expense-row .text-input,
body.night-mode #budget .expense-row .money-input,
body.night-mode #budget .allocation-row .text-input,
body.night-mode #budget .allocation-row .money-input,
body.night-mode #budget .allocation-row .percent-input {
  color: #eef4ff !important;
}
body.night-mode #budget .total-line.highlight {
  color: #d9fff0 !important;
  background: linear-gradient(180deg, rgba(18,183,106,.18), rgba(18,183,106,.12)) !important;
  border-color: rgba(52, 211, 153, .26) !important;
}

/* Right-side source card and obligations */
body.night-mode #budget .source-card {
  background: linear-gradient(135deg, rgba(24, 38, 68, 0.92) 0%, rgba(31, 45, 78, 0.88) 100%) !important;
  border-color: rgba(150, 179, 228, 0.24) !important;
  box-shadow: 0 18px 48px rgba(6,10,20,.22), inset 0 1px 0 rgba(255,255,255,.08) !important;
}
body.night-mode #budget .source-card::before {
  background: radial-gradient(circle, rgba(255,255,255,.05), transparent 68%) !important;
}
body.night-mode #budget .source-card label,
body.night-mode #budget .source-card .panel-title,
body.night-mode #budget .source-card .panel-subtitle,
body.night-mode #budget .source-card,
body.night-mode #budget .source-card .section-label {
  color: #eaf1ff !important;
}
body.night-mode #budget .source-card .money-input,
body.night-mode #budget .source-card .text-input {
  background: rgba(13, 26, 48, 0.90) !important;
  border-color: rgba(173,202,255,.26) !important;
  color: #ffffff !important;
}
body.night-mode #budget .obligation-row {
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(173,202,255,.14) !important;
}
body.night-mode #budget .obligation-row .text-input,
body.night-mode #budget .obligation-row .money-input {
  color: #eef4ff !important;
}

/* Buttons/icons */
body.night-mode #budget .btn-dark,
body.night-mode #budget .btn-ghost,
body.night-mode #budget .icon-btn {
  color: #eef4ff !important;
}
body.night-mode #budget .icon-btn {
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.20) !important;
}
body.night-mode #budget .icon-btn:hover {
  background: rgba(240,68,56,.18) !important;
}


/* v130: Budget heading white in Dark Mode and remove Budget action toolbar */
body.night-mode #budget .page-heading h1 {
  color: #ffffff !important;
}
body.night-mode #budget .page-heading .eyebrow {
  color: #d8e2f2 !important;
}
#budget .toolbar,
body.night-mode #budget .toolbar {
  display: none !important;
}


/* v131: Budget donut card dark-mode contrast */
body.night-mode #budget .donut-card h3 {
  color: #ffffff !important;
}
body.night-mode #budget .donut-card .panel-subtitle {
  color: #d7e1f0 !important;
}
body.night-mode #budget .donut-center .small {
  color: #9fb2cf !important;
}
body.night-mode #budget .donut-center .amount {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
}
body.night-mode #budget .donut::before {
  background: rgba(230, 238, 248, 0.90) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92), inset 0 0 0 1px rgba(255,255,255,.72) !important;
}


/* v132: restore readable Estimated rank card in Percentile tab (Dark Mode) */
body.night-mode #percentile .percentile-result .result-card {
  background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%) !important;
  border-color: #bfdbfe !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255,255,255,.45) !important;
  color: #111827 !important;
}
body.night-mode #percentile .percentile-result .result-card .metric-label {
  color: #64748b !important;
}
body.night-mode #percentile .percentile-result .result-card strong {
  color: #0f172a !important;
  text-shadow: none !important;
  opacity: 1 !important;
}
body.night-mode #percentile .percentile-result .result-card p,
body.night-mode #percentile .percentile-result .result-card .muted {
  color: #475569 !important;
  opacity: 1 !important;
}


/* v133: readable highlighted age row in Percentile table for Dark Mode */
body.night-mode #percentile .highlight-row td,
body.night-mode #percentileTable .highlight-row td,
body.night-mode #percentile table .highlight-row td {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.24), rgba(37, 99, 235, 0.18)) !important;
  color: #f8fbff !important;
  border-top-color: rgba(147, 197, 253, 0.55) !important;
  border-bottom-color: rgba(147, 197, 253, 0.55) !important;
}
body.night-mode #percentile .highlight-row td strong,
body.night-mode #percentileTable .highlight-row td strong,
body.night-mode #percentile table .highlight-row td strong {
  color: #ffffff !important;
}
body.night-mode #percentile .highlight-row td:first-child,
body.night-mode #percentileTable .highlight-row td:first-child,
body.night-mode #percentile table .highlight-row td:first-child {
  font-weight: 900;
}


/* v129 dashboard history chart: match Projection chart readability in Dark Mode */
body.night-mode #netWorthChart {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}


/* v139: restore color coding and contrast for dark-mode landing tour visuals */
body.night-mode .intro-visual .tour-hero-metric {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.18), transparent 13rem),
    radial-gradient(circle at bottom left, rgba(45, 212, 191, 0.10), transparent 12rem),
    linear-gradient(135deg, rgba(238, 245, 255, 0.96), rgba(226, 236, 252, 0.92)) !important;
  border: 1px solid rgba(214, 225, 243, 0.96) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255,255,255,0.86) !important;
}

body.night-mode .intro-visual .tour-hero-metric span {
  color: #7c8fb0 !important;
}

body.night-mode .intro-visual .tour-hero-metric strong {
  color: #13294b !important;
  text-shadow: 0 1px 0 rgba(255,255,255,0.30);
}

body.night-mode .intro-visual .tour-hero-metric small {
  color: #60708b !important;
}

body.night-mode .accounts-visual .tour-account-row,
body.night-mode .budget-visual .tour-budget-card,
body.night-mode .tools-visual .tour-tool-pill {
  color: #edf4ff !important;
  border-color: rgba(120, 146, 196, 0.28) !important;
}

body.night-mode .accounts-visual .tour-account-row span,
body.night-mode .budget-visual .tour-budget-card span,
body.night-mode .tools-visual .tour-tool-pill {
  color: #d7e3f6 !important;
}

body.night-mode .accounts-visual .tour-account-row strong,
body.night-mode .budget-visual .tour-budget-card strong {
  color: #ffffff !important;
}

body.night-mode .accounts-visual .tour-account-row.asset-row {
  background: linear-gradient(180deg, rgba(24, 38, 66, 0.94), rgba(17, 30, 54, 0.92)) !important;
  border-left: 7px solid #3b82f6 !important;
  box-shadow: inset 10px 0 0 rgba(59,130,246,0.16), 0 10px 22px rgba(0,0,0,0.18) !important;
}

body.night-mode .accounts-visual .tour-account-row.liability-row {
  background: linear-gradient(180deg, rgba(47, 24, 33, 0.94), rgba(38, 18, 26, 0.92)) !important;
  border-left: 7px solid #ef4444 !important;
  box-shadow: inset 10px 0 0 rgba(239,68,68,0.18), 0 10px 22px rgba(0,0,0,0.18) !important;
}

body.night-mode .accounts-visual .tour-total-row {
  background: linear-gradient(135deg, #020817 0%, #08111f 100%) !important;
  border-color: rgba(96, 165, 250, 0.24) !important;
  box-shadow: 0 12px 26px rgba(0,0,0,0.22) !important;
}

body.night-mode .budget-visual .tour-budget-card.income {
  background: linear-gradient(180deg, rgba(15, 60, 53, 0.92), rgba(10, 45, 40, 0.90)) !important;
  border-left: 7px solid #10b981 !important;
  box-shadow: inset 10px 0 0 rgba(16,185,129,0.16), 0 10px 22px rgba(0,0,0,0.18) !important;
}

body.night-mode .budget-visual .tour-budget-card.expense {
  background: linear-gradient(180deg, rgba(57, 26, 31, 0.92), rgba(42, 18, 23, 0.90)) !important;
  border-left: 7px solid #ef4444 !important;
  box-shadow: inset 10px 0 0 rgba(239,68,68,0.16), 0 10px 22px rgba(0,0,0,0.18) !important;
}

body.night-mode .budget-visual .tour-budget-card.allocation {
  background: linear-gradient(180deg, rgba(49, 29, 74, 0.92), rgba(37, 20, 56, 0.90)) !important;
  border-left: 7px solid #8b5cf6 !important;
  box-shadow: inset 10px 0 0 rgba(139,92,246,0.16), 0 10px 22px rgba(0,0,0,0.18) !important;
}

body.night-mode .budget-visual .tour-budget-card.leftover {
  background: linear-gradient(180deg, rgba(22, 39, 78, 0.92), rgba(15, 29, 60, 0.90)) !important;
  border-left: 7px solid #38bdf8 !important;
  box-shadow: inset 10px 0 0 rgba(56,189,248,0.16), 0 10px 22px rgba(0,0,0,0.18) !important;
}

body.night-mode .tools-visual .tour-tool-pill:nth-child(2) {
  background: linear-gradient(180deg, rgba(22, 39, 78, 0.92), rgba(15, 29, 60, 0.90)) !important;
  border-left-color: #3b82f6 !important;
  box-shadow: inset 10px 0 0 rgba(59,130,246,0.15), 0 10px 22px rgba(0,0,0,0.18) !important;
}
body.night-mode .tools-visual .tour-tool-pill:nth-child(3) {
  background: linear-gradient(180deg, rgba(18, 52, 52, 0.92), rgba(12, 38, 38, 0.90)) !important;
  border-left-color: #14b8a6 !important;
  box-shadow: inset 10px 0 0 rgba(20,184,166,0.15), 0 10px 22px rgba(0,0,0,0.18) !important;
}
body.night-mode .tools-visual .tour-tool-pill:nth-child(4) {
  background: linear-gradient(180deg, rgba(64, 45, 18, 0.92), rgba(49, 34, 13, 0.90)) !important;
  border-left-color: #f59e0b !important;
  box-shadow: inset 10px 0 0 rgba(245,158,11,0.15), 0 10px 22px rgba(0,0,0,0.18) !important;
}
body.night-mode .tools-visual .tour-tool-pill:nth-child(5) {
  background: linear-gradient(180deg, rgba(40, 23, 63, 0.92), rgba(30, 16, 48, 0.90)) !important;
  border-left-color: #8b5cf6 !important;
  box-shadow: inset 10px 0 0 rgba(139,92,246,0.15), 0 10px 22px rgba(0,0,0,0.18) !important;
}
body.night-mode .tools-visual .tour-tool-pill:nth-child(6) {
  background: linear-gradient(180deg, rgba(21, 46, 72, 0.92), rgba(14, 33, 54, 0.90)) !important;
  border-left-color: #38bdf8 !important;
  box-shadow: inset 10px 0 0 rgba(56,189,248,0.15), 0 10px 22px rgba(0,0,0,0.18) !important;
}
body.night-mode .tools-visual .tour-tool-pill:nth-child(7) {
  background: linear-gradient(180deg, rgba(18, 54, 45, 0.92), rgba(12, 39, 32, 0.90)) !important;
  border-left-color: #22c55e !important;
  box-shadow: inset 10px 0 0 rgba(34,197,94,0.15), 0 10px 22px rgba(0,0,0,0.18) !important;
}


/* v140: soften landing header corners and highlight public nav buttons */
.landing-header {
  border: 1px solid rgba(255,255,255,.34) !important;
  border-radius: 34px !important;
  padding: 22px 26px !important;
  overflow: hidden;
}

.landing-tour-nav .landing-nav-btn,
.landing-tour-nav > a:not(.landing-nav-login),
.auth-header .landing-nav > a:not(.landing-nav-login) {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,245,249,0.92)) !important;
  border: 1px solid rgba(255,255,255,0.98) !important;
  color: #475467 !important;
  box-shadow: 0 8px 20px rgba(15,23,42,0.08), inset 0 1px 0 rgba(255,255,255,0.86) !important;
}

.landing-tour-nav .landing-nav-btn:hover,
.landing-tour-nav .landing-nav-btn.active,
.landing-tour-nav > a:not(.landing-nav-login):hover,
.auth-header .landing-nav > a:not(.landing-nav-login):hover {
  background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
  border-color: rgba(226,232,240,0.98) !important;
  color: #1f2937 !important;
  box-shadow: 0 10px 24px rgba(15,23,42,0.10), inset 0 1px 0 rgba(255,255,255,0.92) !important;
}

.landing-tour-nav .landing-nav-login,
.auth-header .landing-nav .landing-nav-login {
  background: linear-gradient(90deg, #4f7df5 0%, #6b5df6 100%) !important;
  border: 1px solid rgba(196,181,253,0.44) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 28px rgba(99,102,241,0.24), inset 0 1px 0 rgba(255,255,255,0.20) !important;
}

.landing-tour-nav .landing-nav-login:hover,
.auth-header .landing-nav .landing-nav-login:hover {
  background: linear-gradient(90deg, #5e89ff 0%, #786cff 100%) !important;
  color: #ffffff !important;
  border-color: rgba(221,214,254,0.60) !important;
  box-shadow: 0 14px 30px rgba(99,102,241,0.28), inset 0 1px 0 rgba(255,255,255,0.24) !important;
}

body.night-mode .landing-header {
  border-color: rgba(140,170,220,.22) !important;
  background: linear-gradient(180deg, rgba(36, 48, 72, 0.88), rgba(30, 41, 59, 0.82)) !important;
  box-shadow: 0 18px 40px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,.06) !important;
}

body.night-mode .landing-tour-nav .landing-nav-btn,
body.night-mode .landing-tour-nav > a:not(.landing-nav-login),
body.night-mode .auth-header .landing-nav > a:not(.landing-nav-login) {
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(241,245,249,0.90)) !important;
  border-color: rgba(255,255,255,0.96) !important;
  color: #475467 !important;
}

body.night-mode .landing-tour-nav .landing-nav-btn:hover,
body.night-mode .landing-tour-nav .landing-nav-btn.active,
body.night-mode .landing-tour-nav > a:not(.landing-nav-login):hover,
body.night-mode .auth-header .landing-nav > a:not(.landing-nav-login):hover {
  background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
  color: #1f2937 !important;
}

body.night-mode .landing-tour-nav .landing-nav-login,
body.night-mode .auth-header .landing-nav .landing-nav-login {
  background: linear-gradient(90deg, #4f7df5 0%, #6b5df6 100%) !important;
  color: #ffffff !important;
  border-color: rgba(196,181,253,0.54) !important;
}


/* v141: hide the public tour briefly while checking a known returning user */
body.returning-auth-check .landing-shell {
  visibility: hidden;
}

/* v142: simplify the Projection contribution summary in Dark Mode */
#projection .contribution-summary {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible !important;
}

body.night-mode #projection .contribution-summary > div {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #d8e0ea !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24) !important;
}

body.night-mode #projection .contribution-summary > div span {
  color: #64748b !important;
}

body.night-mode #projection .contribution-summary > div strong {
  color: #0f172a !important;
}

/* v143: emphasize the Individual Account Projection selector */
#projection .embedded-account-projection .account-projection-form .field > span {
  color: var(--brand);
  font-size: .8rem;
  letter-spacing: .11em;
}

#projection .embedded-account-projection #projectionAccountSelect {
  min-height: 58px;
  padding: 12px 52px 12px 16px;
  border: 3px solid rgba(37, 99, 235, .72);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .99), rgba(239, 246, 255, .98));
  color: #0f172a;
  font-size: clamp(1.08rem, 1.4vw, 1.28rem);
  font-weight: 950;
  box-shadow:
    0 0 0 5px rgba(37, 99, 235, .08),
    0 14px 30px rgba(37, 99, 235, .14);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

#projection .embedded-account-projection #projectionAccountSelect:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  background: #ffffff;
  box-shadow:
    0 0 0 6px rgba(37, 99, 235, .11),
    0 18px 34px rgba(37, 99, 235, .19);
}

#projection .embedded-account-projection #projectionAccountSelect:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow:
    0 0 0 6px rgba(59, 130, 246, .22),
    0 18px 36px rgba(37, 99, 235, .22);
  outline: none;
}

body.night-mode #projection .embedded-account-projection .account-projection-form .field > span {
  color: #93c5fd;
}

body.night-mode #projection .embedded-account-projection #projectionAccountSelect {
  color-scheme: light;
  background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%) !important;
  color: #0f172a !important;
  border-color: #60a5fa !important;
  box-shadow:
    0 0 0 5px rgba(96, 165, 250, .15),
    0 16px 36px rgba(0, 0, 0, .34) !important;
}

body.night-mode #projection .embedded-account-projection #projectionAccountSelect:hover,
body.night-mode #projection .embedded-account-projection #projectionAccountSelect:focus {
  background: #ffffff !important;
  border-color: #93c5fd !important;
  box-shadow:
    0 0 0 6px rgba(96, 165, 250, .24),
    0 20px 42px rgba(0, 0, 0, .38) !important;
}

/* v157: clear pass/fail colors for the Car 20/4/10 checklist */
#car .car-rule-cards > .pass-card {
  background: linear-gradient(180deg, rgba(236, 253, 245, .98), rgba(209, 250, 229, .92)) !important;
  border: 2px solid #22c55e !important;
  border-top-width: 7px !important;
  box-shadow: 0 14px 30px rgba(22, 163, 74, .16), inset 0 1px 0 rgba(255, 255, 255, .80) !important;
}

#car .car-rule-cards > .warn-card {
  background: linear-gradient(180deg, rgba(254, 242, 242, .98), rgba(254, 226, 226, .92)) !important;
  border: 2px solid #ef4444 !important;
  border-top-width: 7px !important;
  box-shadow: 0 14px 30px rgba(220, 38, 38, .15), inset 0 1px 0 rgba(255, 255, 255, .80) !important;
}

#car .car-rule-cards > .pass-card span,
#car .car-rule-cards > .pass-card small {
  color: #166534 !important;
}

#car .car-rule-cards > .pass-card strong {
  color: #14532d !important;
}

#car .car-rule-cards > .warn-card span,
#car .car-rule-cards > .warn-card small {
  color: #b91c1c !important;
}

#car .car-rule-cards > .warn-card strong {
  color: #7f1d1d !important;
}

body.night-mode #car .car-rule-cards > .pass-card {
  background: linear-gradient(180deg, rgba(6, 78, 59, .78), rgba(6, 55, 45, .92)) !important;
  border-color: #34d399 !important;
  box-shadow: 0 16px 34px rgba(16, 185, 129, .18), inset 0 1px 0 rgba(167, 243, 208, .13) !important;
}

body.night-mode #car .car-rule-cards > .warn-card {
  background: linear-gradient(180deg, rgba(127, 29, 29, .72), rgba(69, 10, 10, .92)) !important;
  border-color: #f87171 !important;
  box-shadow: 0 16px 34px rgba(239, 68, 68, .18), inset 0 1px 0 rgba(254, 202, 202, .12) !important;
}

body.night-mode #car .car-rule-cards > .pass-card span,
body.night-mode #car .car-rule-cards > .pass-card small {
  color: #a7f3d0 !important;
}

body.night-mode #car .car-rule-cards > .pass-card strong {
  color: #ecfdf5 !important;
}

body.night-mode #car .car-rule-cards > .warn-card span,
body.night-mode #car .car-rule-cards > .warn-card small {
  color: #fecaca !important;
}

body.night-mode #car .car-rule-cards > .warn-card strong {
  color: #fff1f2 !important;
}

/* v145: keep the Individual Account Projection selector in its right-side position on one horizontal row */
#projection .embedded-account-projection-header {
  grid-template-columns: minmax(0, 1fr) minmax(540px, 760px);
  align-items: start;
}

#projection .embedded-account-projection .account-projection-form {
  justify-self: end;
  width: 100%;
  max-width: 760px;
}

#projection .embedded-account-projection #projectionAccountSelect {
  width: 100%;
  max-width: none;
  min-height: 58px;
  height: 58px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
  font-size: clamp(.92rem, 1.05vw, 1.08rem);
}

@media (max-width: 1100px) {
  #projection .embedded-account-projection-header {
    grid-template-columns: minmax(0, 1fr) minmax(460px, 1fr);
  }
}

@media (max-width: 900px) {
  #projection .embedded-account-projection-header {
    grid-template-columns: 1fr;
  }

  #projection .embedded-account-projection .account-projection-form {
    justify-self: stretch;
    max-width: none;
  }
}

@media (max-width: 760px) {
  #projection .embedded-account-projection #projectionAccountSelect {
    font-size: .9rem;
    padding-left: 14px;
    padding-right: 44px;
  }
}

/* v146: widen the Individual Account Projection selector so the full account label remains visible */
#projection .embedded-account-projection-header {
  grid-template-columns: minmax(250px, 1fr) minmax(700px, 920px);
  gap: 22px;
}

#projection .embedded-account-projection .account-projection-form {
  width: 100%;
  max-width: 920px;
}

#projection .embedded-account-projection #projectionAccountSelect {
  width: 100%;
  max-width: none;
  font-size: clamp(.88rem, .95vw, 1rem);
  padding-left: 16px;
  padding-right: 50px;
  text-overflow: clip;
}

@media (max-width: 1220px) {
  #projection .embedded-account-projection-header {
    grid-template-columns: minmax(220px, .75fr) minmax(620px, 1.55fr);
  }
}

@media (max-width: 1050px) {
  #projection .embedded-account-projection-header {
    grid-template-columns: 1fr;
  }

  #projection .embedded-account-projection .account-projection-form {
    justify-self: stretch;
    max-width: none;
  }
}

@media (max-width: 760px) {
  #projection .embedded-account-projection #projectionAccountSelect {
    font-size: .84rem;
    padding-left: 12px;
    padding-right: 42px;
  }
}

/* v147: expand the Individual Account Projection selector for long account labels */
#projection .embedded-account-projection-header {
  grid-template-columns: minmax(130px, .3fr) minmax(860px, 1100px);
  gap: 18px;
}

#projection .embedded-account-projection .account-projection-form {
  width: 100%;
  max-width: 1100px;
}

#projection .embedded-account-projection #projectionAccountSelect {
  width: 100%;
  max-width: none;
  font-size: clamp(.8rem, .82vw, .94rem);
  padding-left: 16px;
  padding-right: 48px;
  letter-spacing: -.015em;
}

@media (max-width: 1320px) {
  #projection .embedded-account-projection-header {
    grid-template-columns: minmax(120px, .22fr) minmax(760px, 1.78fr);
  }
}

@media (max-width: 1120px) {
  #projection .embedded-account-projection-header {
    grid-template-columns: 1fr;
  }

  #projection .embedded-account-projection .account-projection-form {
    justify-self: stretch;
    max-width: none;
  }
}

@media (max-width: 760px) {
  #projection .embedded-account-projection {
    padding-inline: 10px;
  }

  #projection .embedded-account-projection #projectionAccountSelect {
    font-size: .78rem;
    padding-left: 12px;
    padding-right: 40px;
  }
}

/* v148: give the account-detail copy room and keep the selector cleanly positioned to the right */
#projection .embedded-account-projection-header {
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

#projection .embedded-account-projection-header > div:first-child {
  width: 100%;
  max-width: 340px;
  min-width: 0;
}

#projection .embedded-account-projection-header > div:first-child h4,
#projection .embedded-account-projection-header > div:first-child p {
  max-width: 100%;
}

#projection .embedded-account-projection .account-projection-form {
  justify-self: stretch;
  width: 100%;
  max-width: none;
  min-width: 0;
}

#projection .embedded-account-projection #projectionAccountSelect {
  width: 100%;
  max-width: none;
  min-width: 0;
  font-size: clamp(.8rem, .82vw, .92rem);
}

@media (max-width: 900px) {
  #projection .embedded-account-projection-header {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  #projection .embedded-account-projection-header > div:first-child {
    max-width: none;
  }

  #projection .embedded-account-projection .account-projection-form {
    justify-self: stretch;
  }
}

/* v149: remove native browser number spinners when custom steppers are present */
.input-enhanced.number-enhanced > input[type="number"] {
  -webkit-appearance: none !important;
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

.input-enhanced.number-enhanced > input[type="number"]::-webkit-inner-spin-button,
.input-enhanced.number-enhanced > input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Safari-specific reinforcement for the Projection liability controls. */
#projection .projection-liabilities-table .input-enhanced.number-enhanced > input[type="number"]::-webkit-inner-spin-button,
#projection .projection-liabilities-table .input-enhanced.number-enhanced > input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  display: none !important;
}

/* v150: keep every Asset return assumption value left-aligned with its custom arrows on the right */
#projection .projection-assets-table tbody tr.projection-account-row > td:last-child {
  overflow: visible;
  vertical-align: top;
  padding-top: 18px;
}

#projection .projection-assets-table tbody tr.projection-account-row > td:last-child .input-enhanced.number-enhanced {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  margin-left: auto;
}

#projection .projection-assets-table tbody tr.projection-account-row > td:last-child .input-enhanced.number-enhanced > input.return-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding-left: 12px;
  padding-right: 40px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

#projection .projection-assets-table tbody tr.projection-account-row > td:last-child .input-enhanced.number-enhanced .stepper-buttons {
  right: 8px;
  width: 22px;
}

/* v151: round the embedded Projected Net Worth forecast so it matches the rest of the interface */
#projection .projection-summary-chart {
  padding: 22px;
  border-radius: 24px !important;
  overflow: hidden;
}

#projection .projection-summary-chart .section-header {
  margin-top: 0;
}

#projection #projectionChart {
  border-radius: 20px !important;
  overflow: hidden;
}

body.night-mode #projection .projection-summary-chart {
  border-color: rgba(140, 170, 220, 0.24) !important;
}

@media (max-width: 760px) {
  #projection .projection-summary-chart {
    padding: 16px;
    border-radius: 20px !important;
  }

  #projection #projectionChart {
    border-radius: 16px !important;
  }
}

/* v152: keep the global deletion Undo toast above every tab and fully inside the viewport */
.toast {
  z-index: 10000;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: max-content;
  max-width: min(430px, calc(100vw - 32px));
  box-sizing: border-box;
  overflow: visible;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.toast.has-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 14px;
  min-width: min(320px, calc(100vw - 32px));
}

.toast-message {
  min-width: 0;
  line-height: 1.35;
}

.toast-action {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: 78px;
  border-color: rgba(255, 255, 255, 0.34);
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.30);
}

.toast-action:hover {
  background: linear-gradient(135deg, #1d4ed8, #6d28d9);
}

body.night-mode .toast {
  background: #111c31;
  color: #f8fbff;
  border-color: rgba(96, 165, 250, 0.34);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.52);
}

body.night-mode .toast-action {
  border-color: rgba(255, 255, 255, 0.32);
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #ffffff;
}

body.night-mode .toast-action:hover {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
}

@media (max-width: 520px) {
  .toast,
  .toast.has-action {
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    min-width: 0;
  }
}


/* v153 Money-Wise brand refresh */
.brand-mark {
  overflow: hidden;
  padding: 0;
}
.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* v154: Projection Window card color refresh
   Replace the gray glass treatment with a blue/purple Money-Wise accent so the
   Projection Window card matches the rest of the Projection tab. */
#projection .age-helper-card {
  background:
    radial-gradient(circle at top right, rgba(155, 124, 255, .20), transparent 72%),
    linear-gradient(135deg, rgba(61, 124, 255, .16), rgba(109, 94, 252, .12)) !important;
  border-color: rgba(93, 144, 255, .42) !important;
  box-shadow:
    0 12px 34px rgba(61, 124, 255, .12),
    inset 0 1px 0 rgba(255, 255, 255, .45) !important;
}

#projection .age-helper-card span {
  color: #5b78ad;
}

#projection .age-helper-card strong {
  color: #17356f;
}

#projection .age-helper-card small {
  color: #60708d;
}

body.night-mode #projection .age-helper-card {
  background:
    radial-gradient(circle at top right, rgba(155, 124, 255, .30), transparent 72%),
    linear-gradient(135deg, rgba(24, 61, 119, .82), rgba(58, 42, 126, .72)) !important;
  border-color: rgba(96, 165, 250, .56) !important;
  box-shadow:
    0 14px 38px rgba(37, 99, 235, .24),
    inset 0 1px 0 rgba(255, 255, 255, .18) !important;
}

body.night-mode #projection .age-helper-card span {
  color: #a9c7ff;
}

body.night-mode #projection .age-helper-card strong {
  color: #f7fbff;
}

body.night-mode #projection .age-helper-card small {
  color: #cfdbef;
}


/* v158 header alignment refinement */
.site-header .brand,
.site-header .nav-list,
.site-header .topbar-actions {
  min-height: 44px;
}
.site-header .brand {
  display: inline-flex;
  align-items: center;
}
.site-header .nav-list,
.site-header .topbar-actions {
  display: flex;
  align-items: center;
}
.site-header .nav-btn,
.site-header .primary-btn,
.site-header .ghost-btn,
.site-header .danger-ghost,
.site-header .calculator-toggle-btn,
.site-header .notes-toggle-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
}
.site-header .nav-btn {
  padding-top: 0;
  padding-bottom: 0;
}
.site-header .nav-btn-info {
  min-width: 48px;
  padding-top: 0;
  padding-bottom: 0;
}
.site-header .primary-btn,
.site-header .ghost-btn,
.site-header .danger-ghost,
.site-header .calculator-toggle-btn,
.site-header .notes-toggle-btn {
  padding-top: 0;
  padding-bottom: 0;
}


/* v159 true single-line header alignment
   Removes the desktop nav scrollbar/padding that was shifting the center tabs upward
   relative to the logo and right-side controls. */
@media (min-width: 1181px) {
  .site-header-inner {
    width: min(1440px, calc(100vw - 24px));
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand nav actions";
    align-items: center;
    column-gap: 10px;
    row-gap: 0;
    padding: 10px 0;
  }

  .site-header-inner .brand,
  .site-header-inner .nav-list,
  .site-header-inner .topbar-actions {
    align-self: center;
    min-height: 42px;
    height: 42px;
    margin: 0;
  }

  .site-header-inner .brand {
    display: inline-flex;
    align-items: center;
  }

  .site-header-inner .nav-list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .site-header-inner .nav-list::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  .site-header-inner .topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .site-header .nav-btn,
  .site-header .primary-btn,
  .site-header .ghost-btn,
  .site-header .danger-ghost,
  .site-header .calculator-toggle-btn,
  .site-header .notes-toggle-btn {
    height: 42px;
    min-height: 42px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
  }

  .site-header .nav-btn {
    padding: 0 10px;
  }

  .site-header .nav-btn-info {
    min-width: 42px;
    width: 42px;
    padding: 0;
  }

  .site-header .primary-btn,
  .site-header .ghost-btn,
  .site-header .danger-ghost,
  .site-header .calculator-toggle-btn,
  .site-header .notes-toggle-btn {
    padding: 0 12px;
  }
}


/* v159 password recovery */
.auth-text-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}
.forgot-password-link {
  justify-self: end;
  margin-top: -6px;
  font-size: .86rem;
}
.auth-back-link {
  justify-self: center;
  margin-top: 2px;
}
.auth-text-link:hover,
.auth-text-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-form-heading {
  display: grid;
  gap: 7px;
  margin-bottom: 2px;
}
.auth-form-heading h2 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -.035em;
}
.auth-form-heading p {
  margin: 0;
  line-height: 1.55;
}
.reset-password-card .auth-card-copy h1 {
  font-size: clamp(2rem, 5vw, 3.55rem);
}
.reset-password-status-note {
  margin: 4px 0 0;
  font-size: .82rem;
  line-height: 1.45;
}
.reset-password-success-actions {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}
.reset-password-success-actions[hidden] {
  display: none !important;
}
.password-reset-complete .field,
.password-reset-complete > .auth-submit {
  display: none;
}
.reset-login-button {
  width: 100%;
  text-align: center;
  text-decoration: none;
}
body.night-mode .auth-text-link {
  color: #9fc0ff;
}


/* v160 clickable Money-Wise brand returns to Dashboard */
.site-header .brand-dashboard-link {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
}
.site-header .brand-dashboard-link:hover .brand-mark {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
}
.site-header .brand-dashboard-link:hover h1 {
  color: var(--brand);
}
.site-header .brand-dashboard-link:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .32);
  outline-offset: 5px;
}
.site-header .brand-dashboard-link .brand-mark,
.site-header .brand-dashboard-link h1 {
  transition: transform .18s ease, box-shadow .18s ease, color .18s ease;
}


/* v161 dark-mode account type dropdown readability */
/*
   Safari/Chromium render <datalist> suggestions with browser UI. Giving the
   searchable account-type inputs an explicit dark color scheme keeps the
   suggestion text readable against the dark popup surface.
*/
body.night-mode input[list="accountSubtypeList"],
body.night-mode .account-subtype-input,
body.night-mode #newAccountSubtype {
  color-scheme: dark;
  color: #f3f7ff;
  caret-color: #f3f7ff;
}

/* Browsers that allow option styling will use the same Money-Wise dark palette. */
body.night-mode #accountSubtypeList,
body.night-mode #accountSubtypeList option,
body.night-mode datalist option {
  background-color: #162133 !important;
  color: #f3f7ff !important;
}

/* Keep native select menus readable in Dark Mode too. */
body.night-mode select,
body.night-mode select option {
  color-scheme: dark;
}
body.night-mode select option {
  background-color: #162133;
  color: #f3f7ff;
}


/* v162 custom account-type autocomplete: fixes Safari black datalist text in Dark Mode */
.account-type-suggestions {
  position: fixed;
  z-index: 2147483000;
  max-height: 270px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .24);
  overscroll-behavior: contain;
}
.account-type-suggestions[hidden] {
  display: none !important;
}
.account-type-suggestion {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 10px 12px;
  background: transparent;
  color: #111827;
  text-align: left;
  font: inherit;
  font-weight: 760;
  line-height: 1.25;
  cursor: pointer;
}
.account-type-suggestion:hover,
.account-type-suggestion.highlighted {
  background: #eaf1ff;
  color: #1d4ed8;
}
.account-type-no-results {
  padding: 10px 12px;
  color: var(--muted);
  font-size: .88rem;
}
body.night-mode .account-type-suggestions {
  background: #111a27;
  color: #f8fbff;
  border-color: #405574;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .52);
  color-scheme: dark;
}
body.night-mode .account-type-suggestion {
  background: transparent;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}
body.night-mode .account-type-suggestion:hover,
body.night-mode .account-type-suggestion.highlighted {
  background: #1e3a66;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}
body.night-mode .account-type-no-results {
  color: #c6d0e0;
}


/* v163 account-type autocomplete positioning fix
   Keep the custom suggestion list inside modal dialogs so Safari shows it
   in the dialog top layer, while preserving white option text in Dark Mode. */
.modal form {
  position: relative;
  overflow: visible !important;
}
.account-type-suggestions[data-anchor-mode="dialog"] {
  position: absolute;
  z-index: 2147483000;
}
body.night-mode .account-type-suggestions[data-anchor-mode="dialog"],
body.night-mode .account-type-suggestions[data-anchor-mode="dialog"] .account-type-suggestion {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
body.night-mode .account-type-suggestions[data-anchor-mode="dialog"] .account-type-suggestion {
  background: #111a27;
}
body.night-mode .account-type-suggestions[data-anchor-mode="dialog"] .account-type-suggestion:hover,
body.night-mode .account-type-suggestions[data-anchor-mode="dialog"] .account-type-suggestion.highlighted {
  background: #1e3a66;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}


/* v164 expanded custom category color picker */
#categoryDialog {
  width: min(620px, calc(100vw - 28px));
}
#categoryDialog form {
  gap: 16px;
}
.category-color-picker-section {
  display: grid;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.category-color-picker-heading {
  display: grid;
  gap: 7px;
  padding-top: 12px;
}
.category-color-picker-heading h4 {
  margin: 3px 0 0;
  font-size: 1.12rem;
  letter-spacing: -.025em;
}
.category-color-picker-heading > p {
  margin: 0;
}
.category-color-list {
  display: grid;
  gap: 10px;
  max-height: min(440px, 47vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 5px 2px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, .48) transparent;
}
.category-color-option {
  position: relative;
  min-height: 62px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.category-color-option:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, .48);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}
.category-color-option:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}
.category-color-option.selected {
  border-color: #3b82f6;
  background: linear-gradient(180deg, rgba(37, 99, 235, .08), rgba(79, 70, 229, .055)), #ffffff;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, .18), 0 10px 24px rgba(37, 99, 235, .10);
}
.category-color-swatch {
  width: 34px;
  height: 34px;
  justify-self: center;
  border-radius: 999px;
  background: var(--category-swatch);
  border: 2px solid rgba(148, 163, 184, .62);
  box-shadow: 0 2px 7px rgba(15, 23, 42, .18);
}
.category-color-option strong {
  justify-self: center;
  font-size: 1rem;
  letter-spacing: -.015em;
}
.category-color-option-icon {
  width: 34px;
  height: 34px;
  justify-self: center;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  color: #3b82f6;
  font-size: 1.28rem;
  font-weight: 850;
  line-height: 1;
}
.category-color-option.selected .category-color-option-icon {
  background: rgba(37, 99, 235, .16);
  color: #2563eb;
}
body.night-mode #categoryDialog .category-color-picker-section {
  border-color: #2a3950;
}
body.night-mode #categoryDialog .category-color-option {
  background: #19263b;
  color: #f8fafc;
  border-color: #32425b;
  box-shadow: none;
}
body.night-mode #categoryDialog .category-color-option:hover {
  background: #1c2b43;
  border-color: #44618a;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .20);
}
body.night-mode #categoryDialog .category-color-option.selected {
  background: #1b2b46;
  border-color: #3b82f6;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .18), 0 10px 24px rgba(0, 0, 0, .20);
}
body.night-mode #categoryDialog .category-color-swatch {
  border-color: #60708a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .36);
}
body.night-mode #categoryDialog .category-color-option-icon {
  background: #1d365d;
  color: #93c5fd;
}
body.night-mode #categoryDialog .category-color-option.selected .category-color-option-icon {
  background: #294f86;
  color: #dbeafe;
}
@media (max-width: 640px) {
  #categoryDialog {
    width: min(100% - 20px, 620px);
  }
  #categoryDialog form {
    padding: 20px;
  }
  .category-color-list {
    max-height: 46vh;
  }
  .category-color-option {
    min-height: 58px;
    grid-template-columns: 42px minmax(0, 1fr) 38px;
    border-radius: 16px;
  }
  .category-color-swatch,
  .category-color-option-icon {
    width: 32px;
    height: 32px;
  }
}


/* v168 Accounts heading info dialog */
.accounts-heading-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  max-width: 100%;
}
.accounts-heading-row h3 {
  margin: 0 !important;
  line-height: 1.15;
}
.accounts-heading-info-btn {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #60a5fa;
  color: #08111f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(37, 99, 235, .22);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.accounts-heading-info-btn:hover,
.accounts-heading-info-btn:focus-visible,
.accounts-heading-info-btn.active {
  background: #7db7ff;
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .16), 0 8px 18px rgba(37, 99, 235, .24);
  outline: none;
}

/* Use a native dialog/top layer so the help box can never sit behind or blend with account cards. */
.accounts-guidance-dialog {
  width: min(620px, calc(100vw - 36px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 1px solid #93c5fd;
  border-radius: 18px;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #0f172a;
  box-shadow: 0 28px 80px rgba(2, 6, 23, .38);
  overflow: hidden;
  opacity: 1 !important;
}
.accounts-guidance-dialog::backdrop {
  background: rgba(2, 6, 23, .68);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.accounts-guidance-dialog-inner {
  padding: 20px 22px 22px;
  background: #ffffff !important;
  opacity: 1 !important;
}
.accounts-guidance-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.accounts-guidance-dialog-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
}
.accounts-guidance-dialog-title strong {
  font-size: 1rem;
  letter-spacing: -.02em;
}
.accounts-guidance-dialog-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #60a5fa;
  color: #08111f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
}
.accounts-guidance-close {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}
.accounts-guidance-close:hover,
.accounts-guidance-close:focus-visible {
  background: #e2e8f0;
  color: #0f172a;
  outline: none;
}
.accounts-guidance-dialog p {
  margin: 0;
  color: #334155 !important;
  font-size: .96rem;
  line-height: 1.6;
}
.accounts-guidance-dialog .projection-note-link {
  color: #6d28d9;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
}
body.night-mode .accounts-heading-info-btn {
  background: #60a5fa;
  color: #08111f;
}
body.night-mode .accounts-heading-info-btn:hover,
body.night-mode .accounts-heading-info-btn:focus-visible,
body.night-mode .accounts-heading-info-btn.active {
  background: #7db7ff;
}
body.night-mode .accounts-guidance-dialog,
body.night-mode .accounts-guidance-dialog-inner {
  background: #111f33 !important;
  background-color: #111f33 !important;
  color: #f8fafc;
  opacity: 1 !important;
}
body.night-mode .accounts-guidance-dialog {
  border-color: #4f8ee8;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .72);
}
body.night-mode .accounts-guidance-dialog-title,
body.night-mode .accounts-guidance-dialog-title strong {
  color: #f8fafc;
}
body.night-mode .accounts-guidance-dialog p {
  color: #dbe6f5 !important;
}
body.night-mode .accounts-guidance-dialog .projection-note-link {
  color: #c4b5fd;
}
body.night-mode .accounts-guidance-close {
  background: #1c2b42;
  border-color: #344862;
  color: #dbe6f5;
}
body.night-mode .accounts-guidance-close:hover,
body.night-mode .accounts-guidance-close:focus-visible {
  background: #253854;
  color: #ffffff;
}
@media (max-width: 760px) {
  .accounts-heading-row { gap: 8px; }
  .accounts-heading-info-btn {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 1rem;
  }
  .accounts-guidance-dialog {
    width: min(560px, calc(100vw - 24px));
    border-radius: 16px;
  }
  .accounts-guidance-dialog-inner {
    padding: 18px;
  }
}

/* The old full-width Accounts guidance and current/saved-mode banners stay removed. */
#networth .accounts-current-value-note,
#networth .snapshot-mode-note {
  display: none !important;
}


/* v170 Budget investment categories are linked to Accounts */
#budget .budget-account-select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 38px 9px 12px;
  border-radius: 12px;
  font-weight: 750;
  cursor: pointer;
  text-overflow: ellipsis;
}
#budget .budget-account-select optgroup {
  font-weight: 800;
}
#budget .budget-account-select option {
  font-weight: 650;
}
body.night-mode #budget .budget-account-select {
  background: rgba(22, 41, 69, 0.96) !important;
  border-color: rgba(150, 179, 228, 0.34) !important;
  color: #eef4ff !important;
  color-scheme: dark;
}
body.night-mode #budget .budget-account-select:focus {
  background: rgba(22, 41, 69, 0.98) !important;
  border-color: rgba(147,197,253,.72) !important;
}
@media (max-width: 860px) {
  #budget .allocation-row .budget-account-select { grid-area: name; }
}


/* v173: mobile-style dark chart surfaces on Home and Projection */
body.night-mode #netWorthChart,
body.night-mode #projectionChart,
body.night-mode #projectionAccountChart {
  background: #101a2c !important;
  border: 1px solid rgba(126, 158, 210, 0.28) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025), 0 10px 24px rgba(0,0,0,0.14) !important;
}


/* v174: Percentile Estimated rank card matches dark-mode app styling */
body.night-mode #percentile .percentile-result .result-card {
  background:
    radial-gradient(circle at top right, rgba(94, 234, 212, 0.10), transparent 14rem),
    linear-gradient(135deg, rgba(30, 49, 88, 0.98) 0%, rgba(24, 40, 73, 0.98) 55%, rgba(22, 58, 79, 0.98) 100%) !important;
  border: 1px solid rgba(96, 165, 250, 0.52) !important;
  border-top: 3px solid rgba(96, 165, 250, 0.78) !important;
  border-radius: 22px !important;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 0 1px rgba(96,165,250,0.10) !important;
  color: #f8fbff !important;
}
body.night-mode #percentile .percentile-result .result-card .metric-label {
  color: #c8d8f7 !important;
  letter-spacing: .11em !important;
}
body.night-mode #percentile .percentile-result .result-card strong {
  color: #f8fbff !important;
  text-shadow: 0 2px 10px rgba(7, 14, 32, 0.26) !important;
  opacity: 1 !important;
}
body.night-mode #percentile .percentile-result .result-card p,
body.night-mode #percentile .percentile-result .result-card .muted {
  color: #d5e0f3 !important;
  opacity: 1 !important;
}

/* v175: mobile-inspired filled summary cards across desktop Dark Mode */
/* The desktop summary cards now use the same tinted glass surfaces, accent-colored
   values, and softly glowing borders as the native mobile app. */
@media (min-width: 761px) {
  body.night-mode #networth .account-total-strip > div,
  body.night-mode #projection #projectionCards.projection-summary-cards > div,
  body.night-mode #projection .account-projection-cards > div,
  body.night-mode #percentile #percentileSummaryCards > div,
  body.night-mode #budget > .summary-grid > .budget-summary-card,
  body.night-mode #car .car-summary-cards > div {
    position: relative !important;
    overflow: hidden !important;
    border-width: 1.5px !important;
    border-top-width: 7px !important;
    border-style: solid !important;
    border-radius: 20px !important;
    box-shadow: 0 14px 30px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }

  /* Accounts — blue / red / amber / red */
  body.night-mode #networth .account-total-strip > div:nth-child(1) {
    border-color: #3b82f6 !important;
    background: radial-gradient(circle at top right, rgba(59,130,246,.18), transparent 62%), linear-gradient(135deg, rgba(27,61,116,.80), rgba(12,27,52,.95)) !important;
    box-shadow: 0 16px 34px rgba(59,130,246,.18), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #networth .account-total-strip > div:nth-child(2) {
    border-color: #ef4444 !important;
    background: radial-gradient(circle at top right, rgba(239,68,68,.16), transparent 62%), linear-gradient(135deg, rgba(83,35,48,.82), rgba(35,18,31,.96)) !important;
    box-shadow: 0 16px 34px rgba(239,68,68,.16), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #networth .account-total-strip > div:nth-child(3) {
    border-color: #f59e0b !important;
    background: radial-gradient(circle at top right, rgba(245,158,11,.16), transparent 62%), linear-gradient(135deg, rgba(83,61,25,.82), rgba(39,29,18,.96)) !important;
    box-shadow: 0 16px 34px rgba(245,158,11,.16), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #networth .account-total-strip > div:nth-child(4) {
    border-color: #ef4444 !important;
    background: radial-gradient(circle at top right, rgba(239,68,68,.14), transparent 62%), linear-gradient(135deg, rgba(72,31,43,.80), rgba(31,17,29,.96)) !important;
    box-shadow: 0 16px 34px rgba(239,68,68,.15), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #networth .account-total-strip > div:nth-child(1) strong { color: #78a9ff !important; }
  body.night-mode #networth .account-total-strip > div:nth-child(2) strong,
  body.night-mode #networth .account-total-strip > div:nth-child(4) strong { color: #ff858d !important; }
  body.night-mode #networth .account-total-strip > div:nth-child(3) strong { color: #ffc15a !important; }

  /* Projection milestones — blue / purple / teal / red / blue */
  body.night-mode #projection #projectionCards.projection-summary-cards > div:nth-child(1) {
    border-color: #3b82f6 !important;
    background: radial-gradient(circle at top right, rgba(59,130,246,.20), transparent 62%), linear-gradient(135deg, rgba(28,63,122,.84), rgba(13,28,53,.96)) !important;
    box-shadow: 0 17px 36px rgba(59,130,246,.19), inset 0 1px 0 rgba(255,255,255,.07) !important;
    transform: none !important;
  }
  body.night-mode #projection #projectionCards.projection-summary-cards > div:nth-child(2) {
    border-color: #8b5cf6 !important;
    background: radial-gradient(circle at top right, rgba(139,92,246,.18), transparent 62%), linear-gradient(135deg, rgba(59,45,105,.84), rgba(26,23,52,.96)) !important;
    box-shadow: 0 17px 36px rgba(139,92,246,.18), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #projection #projectionCards.projection-summary-cards > div:nth-child(3) {
    border-color: #22c7b8 !important;
    background: radial-gradient(circle at top right, rgba(34,199,184,.18), transparent 62%), linear-gradient(135deg, rgba(24,78,80,.84), rgba(12,38,47,.96)) !important;
    box-shadow: 0 17px 36px rgba(34,199,184,.17), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #projection #projectionCards.projection-summary-cards > div:nth-child(4) {
    border-color: #ef4444 !important;
    background: radial-gradient(circle at top right, rgba(239,68,68,.17), transparent 62%), linear-gradient(135deg, rgba(82,34,47,.84), rgba(34,18,31,.96)) !important;
    box-shadow: 0 17px 36px rgba(239,68,68,.16), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #projection #projectionCards.projection-summary-cards > div:nth-child(5) {
    border-color: #4f8cff !important;
    background: radial-gradient(circle at top right, rgba(79,140,255,.17), transparent 62%), linear-gradient(135deg, rgba(27,57,105,.84), rgba(13,27,50,.96)) !important;
    box-shadow: 0 17px 36px rgba(79,140,255,.17), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #projection #projectionCards.projection-summary-cards > div:nth-child(1) strong,
  body.night-mode #projection #projectionCards.projection-summary-cards > div:nth-child(5) strong { color: #7cb0ff !important; }
  body.night-mode #projection #projectionCards.projection-summary-cards > div:nth-child(2) strong { color: #b69cff !important; }
  body.night-mode #projection #projectionCards.projection-summary-cards > div:nth-child(3) strong { color: #49d8c9 !important; }
  body.night-mode #projection #projectionCards.projection-summary-cards > div:nth-child(4) strong { color: #ff858d !important; }

  /* Individual account projection — blue / blue / amber / purple / pink */
  body.night-mode #projection .account-projection-cards > div:nth-child(1),
  body.night-mode #projection .account-projection-cards > div:nth-child(2) {
    border-color: #3b82f6 !important;
    background: radial-gradient(circle at top right, rgba(59,130,246,.17), transparent 62%), linear-gradient(135deg, rgba(27,59,112,.82), rgba(13,28,51,.96)) !important;
  }
  body.night-mode #projection .account-projection-cards > div:nth-child(3) {
    border-color: #f59e0b !important;
    background: radial-gradient(circle at top right, rgba(245,158,11,.17), transparent 62%), linear-gradient(135deg, rgba(82,60,24,.82), rgba(39,29,18,.96)) !important;
  }
  body.night-mode #projection .account-projection-cards > div:nth-child(4) {
    border-color: #8b5cf6 !important;
    background: radial-gradient(circle at top right, rgba(139,92,246,.17), transparent 62%), linear-gradient(135deg, rgba(59,44,103,.82), rgba(27,23,52,.96)) !important;
  }
  body.night-mode #projection .account-projection-cards > div:nth-child(5) {
    border-color: #ec4899 !important;
    background: radial-gradient(circle at top right, rgba(236,72,153,.16), transparent 62%), linear-gradient(135deg, rgba(87,33,69,.82), rgba(39,18,41,.96)) !important;
  }
  body.night-mode #projection .account-projection-cards > div:nth-child(1) strong,
  body.night-mode #projection .account-projection-cards > div:nth-child(2) strong { color: #7cb0ff !important; }
  body.night-mode #projection .account-projection-cards > div:nth-child(3) strong { color: #ffc15a !important; }
  body.night-mode #projection .account-projection-cards > div:nth-child(4) strong { color: #b69cff !important; }
  body.night-mode #projection .account-projection-cards > div:nth-child(5) strong { color: #ff7fbd !important; }

  /* Percentile reference cards — blue / teal / amber / purple */
  body.night-mode #percentile #percentileSummaryCards > div:nth-child(1) {
    border-color: #60a5fa !important;
    background: radial-gradient(circle at top right, rgba(96,165,250,.19), transparent 62%), linear-gradient(135deg, rgba(27,58,108,.84), rgba(13,28,50,.96)) !important;
  }
  body.night-mode #percentile #percentileSummaryCards > div:nth-child(2) {
    border-color: #2dd4bf !important;
    background: radial-gradient(circle at top right, rgba(45,212,191,.18), transparent 62%), linear-gradient(135deg, rgba(24,77,76,.84), rgba(12,38,45,.96)) !important;
  }
  body.night-mode #percentile #percentileSummaryCards > div:nth-child(3) {
    border-color: #fbbf24 !important;
    background: radial-gradient(circle at top right, rgba(251,191,36,.18), transparent 62%), linear-gradient(135deg, rgba(82,62,24,.84), rgba(40,30,18,.96)) !important;
  }
  body.night-mode #percentile #percentileSummaryCards > div:nth-child(4) {
    border-color: #a78bfa !important;
    background: radial-gradient(circle at top right, rgba(167,139,250,.18), transparent 62%), linear-gradient(135deg, rgba(60,47,105,.84), rgba(27,23,52,.96)) !important;
  }
  body.night-mode #percentile #percentileSummaryCards > div:nth-child(1) strong { color: #8abbff !important; }
  body.night-mode #percentile #percentileSummaryCards > div:nth-child(2) strong { color: #4ddccb !important; }
  body.night-mode #percentile #percentileSummaryCards > div:nth-child(3) strong { color: #ffc65f !important; }
  body.night-mode #percentile #percentileSummaryCards > div:nth-child(4) strong { color: #bca5ff !important; }

  /* Budget — green / red / amber / blue, matching the mobile dashboard */
  body.night-mode #budget > .summary-grid > .budget-summary-card:nth-child(1) {
    border-color: #22b889 !important;
    background-color: transparent !important;
    background-image: radial-gradient(circle at top right, rgba(34,184,137,.20), transparent 62%), linear-gradient(135deg, rgba(21,79,73,.86), rgba(11,37,45,.96)) !important;
    box-shadow: 0 17px 36px rgba(34,184,137,.17), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #budget > .summary-grid > .budget-summary-card:nth-child(2) {
    border-color: #ef5a62 !important;
    background-color: transparent !important;
    background-image: radial-gradient(circle at top right, rgba(239,90,98,.19), transparent 62%), linear-gradient(135deg, rgba(86,36,48,.86), rgba(36,19,31,.96)) !important;
    box-shadow: 0 17px 36px rgba(239,90,98,.16), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #budget > .summary-grid > .budget-summary-card:nth-child(3) {
    border-color: #d89a2b !important;
    background-color: transparent !important;
    background-image: radial-gradient(circle at top right, rgba(216,154,43,.19), transparent 62%), linear-gradient(135deg, rgba(82,61,27,.86), rgba(39,30,20,.96)) !important;
    box-shadow: 0 17px 36px rgba(216,154,43,.16), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #budget > .summary-grid > .budget-summary-card:nth-child(4) {
    border-color: #4d88e8 !important;
    background-color: transparent !important;
    background-image: radial-gradient(circle at top right, rgba(77,136,232,.20), transparent 62%), linear-gradient(135deg, rgba(29,59,108,.86), rgba(13,29,53,.96)) !important;
    box-shadow: 0 17px 36px rgba(77,136,232,.17), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #budget > .summary-grid > .budget-summary-card:nth-child(1) .metric-value { color: #45e0ad !important; }
  body.night-mode #budget > .summary-grid > .budget-summary-card:nth-child(2) .metric-value { color: #ff858d !important; }
  body.night-mode #budget > .summary-grid > .budget-summary-card:nth-child(3) .metric-value { color: #ffc15a !important; }
  body.night-mode #budget > .summary-grid > .budget-summary-card:nth-child(4) .metric-value { color: #82adff !important; }
  body.night-mode #budget > .summary-grid > .budget-summary-card .metric-label,
  body.night-mode #budget > .summary-grid > .budget-summary-card .metric-note {
    color: #aebbd2 !important;
  }

  /* Car summary — blue / teal / amber */
  body.night-mode #car .car-summary-cards > div:nth-child(1) {
    border-color: #3b82f6 !important;
    background: radial-gradient(circle at top right, rgba(59,130,246,.18), transparent 62%), linear-gradient(135deg, rgba(27,59,112,.84), rgba(13,28,51,.96)) !important;
  }
  body.night-mode #car .car-summary-cards > div:nth-child(2) {
    border-color: #22c7b8 !important;
    background: radial-gradient(circle at top right, rgba(34,199,184,.18), transparent 62%), linear-gradient(135deg, rgba(24,78,80,.84), rgba(12,38,47,.96)) !important;
  }
  body.night-mode #car .car-summary-cards > div:nth-child(3) {
    border-color: #f59e0b !important;
    background: radial-gradient(circle at top right, rgba(245,158,11,.18), transparent 62%), linear-gradient(135deg, rgba(82,60,24,.84), rgba(39,29,18,.96)) !important;
  }
  body.night-mode #car .car-summary-cards > div:nth-child(1) strong { color: #7cb0ff !important; }
  body.night-mode #car .car-summary-cards > div:nth-child(2) strong { color: #49d8c9 !important; }
  body.night-mode #car .car-summary-cards > div:nth-child(3) strong { color: #ffc15a !important; }

  /* Keep the card labels subdued like the mobile app. */
  body.night-mode #networth .account-total-strip > div span,
  body.night-mode #projection #projectionCards.projection-summary-cards > div span,
  body.night-mode #projection .account-projection-cards > div span,
  body.night-mode #percentile #percentileSummaryCards > div span,
  body.night-mode #car .car-summary-cards > div span {
    color: #aebbd2 !important;
  }
}


/* v176: remove bright top-right highlight from Budget summary cards in Dark Mode */
body.night-mode #budget > .summary-grid > .budget-summary-card:nth-child(1) {
  background-image: linear-gradient(135deg, rgba(21,79,73,.90), rgba(11,37,45,.98)) !important;
}
body.night-mode #budget > .summary-grid > .budget-summary-card:nth-child(2) {
  background-image: linear-gradient(135deg, rgba(86,36,48,.90), rgba(36,19,31,.98)) !important;
}
body.night-mode #budget > .summary-grid > .budget-summary-card:nth-child(3) {
  background-image: linear-gradient(135deg, rgba(82,61,27,.90), rgba(39,30,20,.98)) !important;
}
body.night-mode #budget > .summary-grid > .budget-summary-card:nth-child(4) {
  background-image: linear-gradient(135deg, rgba(29,59,108,.90), rgba(13,29,53,.98)) !important;
}


/* v177: remove the decorative top-right orb from Budget summary cards */
body.night-mode #budget > .summary-grid > .budget-summary-card::before,
body.night-mode #budget > .summary-grid > .metric-card::before {
  content: none !important;
  display: none !important;
  background: none !important;
  width: 0 !important;
  height: 0 !important;
}


/* v179: desktop notes can open for viewing/editing */
.notes-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.note-card {
  cursor: pointer;
}
.note-card.note-card-active {
  border-color: rgba(96, 165, 250, 0.85);
  box-shadow: 0 0 0 1px rgba(96,165,250,0.18), 0 12px 24px rgba(37,99,235,.12);
}
body.night-mode .note-card.note-card-active {
  border-color: rgba(96, 165, 250, 0.95);
  box-shadow: 0 0 0 1px rgba(96,165,250,0.22), 0 14px 28px rgba(0,0,0,.28);
}


/* v180: New note action while editing an existing desktop note */
.notes-new-btn {
  border: 1px solid rgba(96, 165, 250, .42);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 850;
  color: var(--brand);
  background: var(--brand-soft);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.notes-new-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, .68);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .14);
}
body.night-mode .notes-new-btn {
  color: #9ec5ff;
  background: rgba(37, 99, 235, .16);
  border-color: rgba(96, 165, 250, .40);
}
body.night-mode .notes-new-btn:hover {
  background: rgba(37, 99, 235, .24);
}


/* v182: custom remove-account dialog styled like the mobile app */
.account-remove-dialog {
  border: none;
  padding: 0;
  background: transparent;
  width: min(100% - 32px, 720px);
  max-width: 720px;
  color: #eaf1ff;
}
.account-remove-dialog::backdrop {
  background: rgba(3, 8, 23, 0.60);
  backdrop-filter: blur(14px) saturate(130%);
}
.account-remove-dialog-card {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 34px 30px 28px;
  text-align: center;
  border: 1px solid rgba(123, 157, 214, 0.28);
  background:
    radial-gradient(circle at top center, rgba(87, 38, 59, 0.12), transparent 10rem),
    linear-gradient(180deg, rgba(20, 31, 59, 0.98), rgba(14, 23, 43, 0.98));
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255,255,255,0.08);
}
.account-remove-dialog-icon {
  width: 78px;
  height: 78px;
  border-radius: 999px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  font-size: 2.25rem;
  font-weight: 800;
  color: #ff9aa0;
  background: radial-gradient(circle at 35% 35%, rgba(255, 157, 167, 0.18), rgba(89, 33, 50, 0.82));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.account-remove-dialog h3 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 2.8vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: #f7fbff;
}
.account-remove-dialog p {
  margin: 0 auto;
  max-width: 520px;
  font-size: 1.18rem;
  line-height: 1.45;
  color: #d3def1;
}
.account-remove-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}
.account-remove-cancel-btn,
.account-remove-confirm-btn {
  min-height: 74px;
  border-radius: 24px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.account-remove-cancel-btn:hover,
.account-remove-confirm-btn:hover {
  transform: translateY(-1px);
}
.account-remove-cancel-btn {
  color: #f6fbff;
  border-color: rgba(37, 99, 235, 0.72);
  background: linear-gradient(180deg, rgba(26, 44, 82, 0.96), rgba(18, 31, 62, 0.96));
  box-shadow: 0 16px 34px rgba(18, 45, 105, 0.24), inset 0 0 0 2px rgba(59, 130, 246, 0.48), inset 0 1px 0 rgba(255,255,255,0.06);
}
.account-remove-confirm-btn {
  color: #ff9aa0;
  border-color: rgba(201, 85, 104, 0.52);
  background: linear-gradient(180deg, rgba(79, 36, 50, 0.96), rgba(56, 26, 38, 0.96));
  box-shadow: 0 16px 34px rgba(80, 28, 44, 0.24), inset 0 1px 0 rgba(255,255,255,0.05);
}
@media (max-width: 640px) {
  .account-remove-dialog {
    width: min(100% - 24px, 560px);
  }
  .account-remove-dialog-card {
    border-radius: 26px;
    padding: 28px 20px 22px;
  }
  .account-remove-dialog-actions {
    grid-template-columns: 1fr;
  }
  .account-remove-cancel-btn,
  .account-remove-confirm-btn {
    min-height: 64px;
    font-size: 1.2rem;
  }
  .account-remove-dialog p {
    font-size: 1.02rem;
  }
}


/* v183: make remove-account dialog more compact on desktop */
.account-remove-dialog {
  width: min(100% - 32px, 540px);
  max-width: 540px;
}
.account-remove-dialog-card {
  border-radius: 26px;
  padding: 26px 24px 22px;
}
.account-remove-dialog-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  font-size: 1.9rem;
}
.account-remove-dialog h3 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 2.2vw, 1.95rem);
}
.account-remove-dialog p {
  max-width: 430px;
  font-size: 1rem;
  line-height: 1.4;
}
.account-remove-dialog-actions {
  gap: 12px;
  margin-top: 22px;
}
.account-remove-cancel-btn,
.account-remove-confirm-btn {
  min-height: 58px;
  border-radius: 20px;
  font-size: 1.15rem;
}


/* v184: size the remove-account dialog like the original browser confirmation */
.account-remove-dialog {
  width: min(100% - 32px, 480px);
  max-width: 480px;
}
.account-remove-dialog-card {
  border-radius: 22px;
  padding: 16px 18px 16px;
}
.account-remove-dialog-icon {
  width: 38px;
  height: 38px;
  margin: 0 auto 7px;
  font-size: 1.25rem;
}
.account-remove-dialog h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  line-height: 1.1;
}
.account-remove-dialog p {
  max-width: 420px;
  font-size: .90rem;
  line-height: 1.35;
}
.account-remove-dialog-actions {
  gap: 10px;
  margin-top: 13px;
}
.account-remove-cancel-btn,
.account-remove-confirm-btn {
  min-height: 42px;
  border-radius: 15px;
  font-size: .98rem;
}



/* v191: remove-account dialog follows the active light/dark theme */
body:not(.night-mode) .account-remove-dialog {
  color: #172033;
}
body:not(.night-mode) .account-remove-dialog::backdrop {
  background: rgba(51, 65, 85, 0.28);
  backdrop-filter: blur(10px) saturate(115%);
}
body:not(.night-mode) .account-remove-dialog-card {
  border-color: rgba(148, 163, 184, 0.34);
  background:
    radial-gradient(circle at top center, rgba(239, 68, 68, 0.06), transparent 10rem),
    linear-gradient(180deg, rgba(255,255,255,0.99), rgba(248,250,252,0.99));
  box-shadow:
    0 28px 65px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.95);
}
body:not(.night-mode) .account-remove-dialog-icon {
  color: #dc2626;
  background: linear-gradient(180deg, #fff1f2, #ffe4e6);
  border: 1px solid rgba(220, 38, 38, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
body:not(.night-mode) .account-remove-dialog h3 {
  color: #111827;
}
body:not(.night-mode) .account-remove-dialog p {
  color: #5b667a;
}
body:not(.night-mode) .account-remove-cancel-btn {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.34);
  background: linear-gradient(180deg, #ffffff, #eff6ff);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.10), inset 0 0 0 1px rgba(59, 130, 246, 0.10);
}
body:not(.night-mode) .account-remove-confirm-btn {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.28);
  background: linear-gradient(180deg, #fff7f7, #fee2e2);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.10), inset 0 1px 0 rgba(255,255,255,0.85);
}
body:not(.night-mode) .account-remove-cancel-btn:hover {
  background: linear-gradient(180deg, #f8fbff, #dbeafe);
  border-color: rgba(37, 99, 235, 0.52);
}
body:not(.night-mode) .account-remove-confirm-btn:hover {
  background: linear-gradient(180deg, #fff1f2, #fecaca);
  border-color: rgba(220, 38, 38, 0.46);
}
body.night-mode .account-remove-dialog {
  color: #eaf1ff;
}

/* v185: custom desktop dark-mode dropdown menus */
.mw-native-select-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
}
.mw-select-trigger {
  width: 100%;
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(150, 179, 228, 0.34);
  background: linear-gradient(180deg, rgba(18, 34, 60, 0.98), rgba(12, 24, 44, 0.98));
  color: #eef4ff;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  font-weight: 750;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}
.mw-select-trigger:hover,
.mw-select-trigger:focus-visible,
.mw-select-trigger.is-open {
  border-color: rgba(96, 165, 250, 0.78);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12), inset 0 1px 0 rgba(255,255,255,0.05);
  outline: none;
}
.mw-select-trigger-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mw-select-trigger-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  position: relative;
}
.mw-select-trigger-icon span {
  position: absolute;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: #8fb6ff;
  top: 7px;
}
.mw-select-trigger-icon span:first-child { transform: translateX(-3px) rotate(45deg); }
.mw-select-trigger-icon span:last-child { transform: translateX(3px) rotate(-45deg); }
.mw-select-trigger.is-open .mw-select-trigger-icon span:first-child { transform: translateX(-3px) rotate(-45deg); }
.mw-select-trigger.is-open .mw-select-trigger-icon span:last-child { transform: translateX(3px) rotate(45deg); }
.mw-custom-select-portal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
}
.mw-custom-select-menu {
  position: fixed;
  pointer-events: auto;
  overflow: auto;
  padding: 12px;
  border-radius: 26px;
  border: 1px solid rgba(110, 142, 202, 0.28);
  background: linear-gradient(180deg, rgba(19, 30, 58, 0.985), rgba(14, 24, 45, 0.985));
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255,255,255,0.06);
}
.mw-custom-select-group {
  padding: 8px 10px 6px;
  font-size: .92rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #90a4c7;
}
.mw-custom-select-option {
  width: 100%;
  min-height: 66px;
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid rgba(74, 101, 152, 0.28);
  background: linear-gradient(180deg, rgba(23, 38, 70, 0.98), rgba(18, 30, 56, 0.98));
  color: #f4f8ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  font-size: 1.02rem;
  font-weight: 800;
  margin-bottom: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.mw-custom-select-option:last-child { margin-bottom: 0; }
.mw-custom-select-option:hover:not(:disabled),
.mw-custom-select-option:focus-visible {
  outline: none;
  border-color: rgba(96, 165, 250, 0.68);
  background: linear-gradient(180deg, rgba(28, 47, 86, 0.99), rgba(20, 34, 63, 0.99));
}
.mw-custom-select-option.is-selected {
  border-color: rgba(64, 131, 255, 0.85);
  background: linear-gradient(180deg, rgba(28, 48, 92, 0.99), rgba(22, 39, 73, 0.99));
}
.mw-custom-select-option:disabled {
  opacity: .55;
  cursor: default;
}
.mw-custom-select-option-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mw-custom-select-option-accessory {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(29, 56, 104, 0.82);
  color: #dbe7ff;
  font-size: 1.3rem;
  line-height: 1;
}
.mw-custom-select-option.is-selected .mw-custom-select-option-accessory {
  background: rgba(52, 94, 182, 0.96);
  color: #ffffff;
}
.target-date-controls .mw-select-trigger { min-height: 43px; }
.payoff-timeline-fields .mw-select-trigger.payoff-unit-select {
  max-width: 88px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: .94rem;
}
.payoff-timeline-fields .mw-select-trigger.payoff-unit-select .mw-select-trigger-label { white-space: nowrap; }
#budget .mw-select-trigger.budget-account-select {
  min-height: 44px;
  border-radius: 12px;
  padding: 9px 12px;
}
#projection .projection-contribution-row .mw-select-trigger { min-height: 46px; }
#snapshotSelect + .mw-select-trigger { min-width: 290px; }
#projectionAccountSelect + .mw-select-trigger { min-width: 320px; }
#carLoanMonths + .mw-select-trigger { min-width: 180px; }


/* v186: refine desktop custom dropdown sizing and fix Projection overlap */
.mw-select-trigger {
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  border-radius: 14px;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.95rem;
  font-weight: 680;
  letter-spacing: -0.01em;
}
.mw-select-trigger-label {
  line-height: 1.2;
}
.mw-select-trigger-icon {
  width: 14px;
  height: 14px;
}
.mw-select-trigger-icon span {
  width: 8px;
  top: 6px;
}
.mw-custom-select-menu {
  padding: 10px;
  border-radius: 22px;
}
.mw-custom-select-group {
  padding: 6px 8px 5px;
  font-size: 0.8rem;
  font-weight: 800;
}
.mw-custom-select-option {
  min-height: 54px;
  padding: 11px 14px;
  border-radius: 18px;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.22;
}
.mw-custom-select-option-accessory {
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
}
.target-date-controls .mw-select-trigger {
  min-height: 40px;
  font-size: 0.92rem;
}
#budget .mw-select-trigger.budget-account-select,
.payoff-timeline-fields .mw-select-trigger.payoff-unit-select,
#projection .projection-contribution-row .mw-select-trigger {
  min-width: 0;
  max-width: 100%;
}
#projection .projection-contribution-row .mw-select-trigger {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 700;
}
#projection .projection-contribution-row .mw-select-trigger .mw-select-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.projection-contribution-row.compact-contribution-row {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.84fr) minmax(118px, 0.72fr) minmax(118px, 0.72fr) minmax(145px, 0.8fr) 108px;
  gap: 12px;
}
.projection-contribution-row.compact-contribution-row .field,
.projection-contribution-row.compact-contribution-row > * {
  min-width: 0;
}
.projection-contribution-row.compact-contribution-row .field {
  grid-template-rows: 18px 42px;
  gap: 6px;
}
.projection-contribution-row.compact-contribution-row .field span {
  min-height: 18px;
  font-size: 0.88rem;
}
.projection-contribution-row.compact-contribution-row input,
.projection-contribution-row.compact-contribution-row select,
.projection-contribution-row.compact-contribution-row .contribution-remove-btn {
  min-height: 42px;
  height: 42px;
}
.projection-contribution-row.compact-contribution-row .contribution-monthly-equivalent {
  min-height: 66px;
  height: 66px;
}
.projection-contribution-row.compact-contribution-row .contribution-monthly-equivalent strong {
  font-size: 1rem;
}
@media (max-width: 1320px) {
  .projection-contribution-row.compact-contribution-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* v187: compact custom dropdown rows + allow scrolling inside open menus */
.mw-select-trigger {
  min-height: 39px;
  border-radius: 12px;
  padding: 7px 11px;
  font-size: 0.9rem;
  font-weight: 620;
}
.mw-custom-select-menu {
  padding: 8px;
  border-radius: 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 155, 226, .58) rgba(13, 25, 48, .45);
}
.mw-custom-select-menu::-webkit-scrollbar {
  width: 8px;
}
.mw-custom-select-menu::-webkit-scrollbar-track {
  background: rgba(13, 25, 48, .45);
  border-radius: 999px;
}
.mw-custom-select-menu::-webkit-scrollbar-thumb {
  background: rgba(111, 155, 226, .58);
  border-radius: 999px;
  border: 2px solid rgba(13, 25, 48, .45);
}
.mw-custom-select-group {
  padding: 5px 8px 4px;
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: .07em;
}
.mw-custom-select-option {
  min-height: 43px;
  padding: 8px 11px;
  border-radius: 14px;
  gap: 9px;
  font-size: 0.86rem;
  font-weight: 620;
  margin-bottom: 6px;
  line-height: 1.12;
}
.mw-custom-select-option-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mw-custom-select-option-accessory {
  width: 28px;
  height: 28px;
  font-size: 0.95rem;
}
.target-date-controls .mw-select-trigger {
  min-height: 38px;
  font-size: 0.88rem;
}
#projection .projection-contribution-row .mw-select-trigger {
  min-height: 39px;
  padding: 7px 10px;
  font-size: 0.86rem;
  font-weight: 620;
}
#budget .mw-select-trigger.budget-account-select {
  min-height: 39px;
  padding: 7px 10px;
  font-size: 0.88rem;
  font-weight: 620;
}
.payoff-timeline-fields .mw-select-trigger.payoff-unit-select {
  min-height: 38px;
  padding: 6px 8px;
  font-size: 0.86rem;
  font-weight: 620;
}


/* v188: use the Accounts account-type dropdown visual language everywhere in desktop Dark Mode */
@media (min-width: 768px) {
  body.night-mode .mw-select-trigger {
    min-width: 0;
    max-width: 100%;
    min-height: 38px;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid #405574;
    background: #111a27;
    color: #f8fbff;
    font-size: 0.84rem;
    font-weight: 620;
    letter-spacing: 0;
    box-shadow: none;
  }
  body.night-mode .mw-select-trigger:hover,
  body.night-mode .mw-select-trigger:focus-visible,
  body.night-mode .mw-select-trigger.is-open {
    border-color: #55709a;
    background: #142033;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
  }
  body.night-mode .mw-select-trigger-label {
    line-height: 1.18;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.night-mode .mw-select-trigger-icon {
    width: 12px;
    height: 12px;
  }
  body.night-mode .mw-select-trigger-icon span {
    width: 7px;
    height: 1.5px;
    top: 5px;
    background: #b8c9e3;
  }

  body.night-mode .mw-custom-select-menu {
    padding: 6px;
    border: 1px solid #405574;
    border-radius: 14px;
    background: #111a27;
    color: #f8fbff;
    box-shadow: 0 20px 55px rgba(0, 0, 0, .52);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: #405574 #111a27;
  }
  body.night-mode .mw-custom-select-menu::-webkit-scrollbar {
    width: 7px;
  }
  body.night-mode .mw-custom-select-menu::-webkit-scrollbar-track {
    background: #111a27;
  }
  body.night-mode .mw-custom-select-menu::-webkit-scrollbar-thumb {
    background: #405574;
    border-radius: 999px;
    border: 1px solid #111a27;
  }

  body.night-mode .mw-custom-select-group {
    padding: 7px 10px 4px;
    color: #8f9caf;
    font-size: 0.72rem;
    font-weight: 760;
    letter-spacing: .06em;
    text-transform: none;
  }
  body.night-mode .mw-custom-select-option {
    width: 100%;
    min-height: 36px;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 620;
    line-height: 1.2;
    box-shadow: none;
  }
  body.night-mode .mw-custom-select-option + .mw-custom-select-option {
    margin-top: 1px;
  }
  body.night-mode .mw-custom-select-option:hover:not(:disabled),
  body.night-mode .mw-custom-select-option:focus-visible,
  body.night-mode .mw-custom-select-option.is-selected {
    background: #1e3a66;
    color: #ffffff;
    border: 0;
    outline: none;
  }
  body.night-mode .mw-custom-select-option:disabled {
    opacity: .48;
  }
  body.night-mode .mw-custom-select-option-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* The Accounts autocomplete has no oversized chevrons/check bubbles; match that cleaner look. */
  body.night-mode .mw-custom-select-option-accessory {
    display: none;
  }

  /* Keep compact controls compact in the Projection/Budget tables. */
  body.night-mode #projection .projection-contribution-row .mw-select-trigger,
  body.night-mode #budget .mw-select-trigger.budget-account-select,
  body.night-mode .payoff-timeline-fields .mw-select-trigger.payoff-unit-select,
  body.night-mode .target-date-controls .mw-select-trigger {
    min-height: 38px;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 620;
  }
}


/* v189: make Accounts account-type dropdown typography match all other desktop Dark Mode dropdowns */
@media (min-width: 768px) {
  body.night-mode .account-type-suggestion,
  body.night-mode .account-type-suggestions[data-anchor-mode="dialog"] .account-type-suggestion {
    padding: 8px 10px;
    font-size: 0.82rem;
    font-weight: 620;
    line-height: 1.2;
    letter-spacing: 0;
  }
  body.night-mode .account-type-no-results {
    font-size: 0.82rem;
    font-weight: 620;
  }
}


/* v190: Projection investing-plan dropdown text + centered chevrons */
@media (min-width: 768px) {
  body.night-mode #projection .projection-contributions-panel .mw-select-trigger,
  body.night-mode #projection .projection-contributions-panel .mw-select-trigger-label {
    color: #ffffff !important;
    opacity: 1 !important;
  }

  /* Replace the two-bar caret with one clean centered chevron. */
  body.night-mode .mw-select-trigger-icon {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 18px;
    position: relative;
  }
  body.night-mode .mw-select-trigger-icon span {
    display: none !important;
  }
  body.night-mode .mw-select-trigger-icon::after {
    content: "⌄";
    display: block;
    color: #cfe0ff;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
    transform: translateY(-1px);
    transform-origin: center;
    transition: transform .16s ease;
  }
  body.night-mode .mw-select-trigger.is-open .mw-select-trigger-icon::after {
    transform: translateY(1px) rotate(180deg);
  }

  /* Keep the Projection controls visually balanced after the icon cleanup. */
  body.night-mode #projection .projection-contribution-row .mw-select-trigger {
    padding-right: 11px;
    align-items: center;
  }
}


/* v191: make dropdown chevrons truly centered */
@media (min-width: 768px) {
  body.night-mode .mw-select-trigger {
    align-items: center;
  }
  body.night-mode .mw-select-trigger-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    position: relative;
    top: 0;
  }
  body.night-mode .mw-select-trigger-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2.2px solid #cfe0ff;
    border-bottom: 2.2px solid #cfe0ff;
    transform: translate(-50%, -58%) rotate(45deg);
    transform-origin: center;
    transition: transform .16s ease;
    box-sizing: border-box;
  }
  body.night-mode .mw-select-trigger.is-open .mw-select-trigger-icon::after {
    transform: translate(-50%, -42%) rotate(-135deg);
  }
}


/* v192: make Projection contribution summary cards match Money-Wise dark mode */
@media (min-width: 768px) {
  body.night-mode #projection .contribution-summary {
    gap: 16px;
  }
  body.night-mode #projection .contribution-summary > div {
    position: relative;
    overflow: hidden;
    padding: 18px 20px 16px !important;
    border-radius: 22px !important;
    border: 1px solid rgba(125, 156, 214, 0.24) !important;
    background: linear-gradient(180deg, rgba(20, 31, 57, 0.97), rgba(13, 22, 41, 0.97)) !important;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255,255,255,0.05) !important;
    color: #f8fbff !important;
  }
  body.night-mode #projection .contribution-summary > div::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.07), transparent 28%);
    opacity: .75;
  }
  body.night-mode #projection .contribution-summary > div:nth-child(1) {
    border-color: rgba(69, 128, 255, 0.44) !important;
    background: radial-gradient(circle at top right, rgba(54, 104, 214, 0.18), transparent 34%), linear-gradient(180deg, rgba(20, 34, 67, 0.98), rgba(13, 22, 44, 0.98)) !important;
  }
  body.night-mode #projection .contribution-summary > div:nth-child(2) {
    border-color: rgba(86, 209, 196, 0.34) !important;
    background: radial-gradient(circle at top right, rgba(38, 177, 160, 0.16), transparent 34%), linear-gradient(180deg, rgba(19, 38, 60, 0.98), rgba(13, 25, 42, 0.98)) !important;
  }
  body.night-mode #projection .contribution-summary > div:nth-child(3) {
    border-color: rgba(163, 145, 255, 0.36) !important;
    background: radial-gradient(circle at top right, rgba(125, 90, 230, 0.15), transparent 34%), linear-gradient(180deg, rgba(24, 35, 63, 0.98), rgba(14, 22, 41, 0.98)) !important;
  }
  body.night-mode #projection .contribution-summary > div span {
    display: block;
    color: #9eacc6 !important;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
  }
  body.night-mode #projection .contribution-summary > div strong {
    margin-top: 10px;
    color: #f8fbff !important;
    font-size: clamp(1.75rem, 2vw, 2.05rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
  }
  body.night-mode #projection .contribution-summary > div:nth-child(1) strong { color: #8fbcff !important; }
  body.night-mode #projection .contribution-summary > div:nth-child(2) strong { color: #67e1d1 !important; }
  body.night-mode #projection .contribution-summary > div:nth-child(3) strong { color: #c1b0ff !important; }
}


/* v193: searchable account dropdowns in Budget/Projection desktop dark mode */
body.night-mode .mw-custom-select-menu.is-searchable {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.night-mode .mw-custom-select-search {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 4px 4px 8px;
  background: #111a27;
}
body.night-mode .mw-custom-select-search-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #405574;
  background: #16243a;
  color: #f8fbff;
  font-size: 0.84rem;
  font-weight: 620;
  outline: none;
  box-shadow: none;
}
body.night-mode .mw-custom-select-search-input::placeholder {
  color: #8f9caf;
  opacity: 1;
}
body.night-mode .mw-custom-select-search-input:focus {
  border-color: #55709a;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}
body.night-mode .mw-custom-select-options {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
body.night-mode .mw-custom-select-empty {
  padding: 10px 12px;
  color: #c6d0e0;
  font-size: 0.82rem;
}


/* v194: color-coded Home summary cards in desktop dark mode */
@media (min-width: 761px) {
  body.night-mode #dashboard .hero-summary {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    gap: 14px !important;
    overflow: visible !important;
  }
  body.night-mode #dashboard .hero-summary .summary-tile {
    position: relative !important;
    overflow: hidden !important;
    min-height: 122px !important;
    border: 1.5px solid rgba(84, 111, 155, 0.95) !important;
    border-top-width: 7px !important;
    border-radius: 20px !important;
    box-shadow: 0 16px 34px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.07) !important;
    background: linear-gradient(135deg, rgba(19,37,69,.92), rgba(10,22,41,.98)) !important;
  }
  body.night-mode #dashboard .hero-summary .summary-tile + .summary-tile {
    border-left: 1.5px solid rgba(84, 111, 155, 0.95) !important;
  }
  body.night-mode #dashboard .hero-summary .summary-tile::before {
    content: none !important;
    display: none !important;
  }
  body.night-mode #dashboard .hero-summary .summary-tile .metric-label,
  body.night-mode #dashboard .hero-summary .summary-tile small {
    color: #aebbd2 !important;
  }

  body.night-mode #dashboard .hero-summary .asset-tile {
    border-color: #3b82f6 !important;
    background: radial-gradient(circle at top right, rgba(59,130,246,.18), transparent 62%), linear-gradient(135deg, rgba(27,61,116,.84), rgba(12,27,52,.98)) !important;
    box-shadow: 0 16px 34px rgba(59,130,246,.18), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #dashboard .hero-summary .asset-tile strong {
    color: #7cb0ff !important;
  }

  body.night-mode #dashboard .hero-summary .liability-tile {
    border-color: #ef4444 !important;
    background: radial-gradient(circle at top right, rgba(239,68,68,.16), transparent 62%), linear-gradient(135deg, rgba(82,34,47,.84), rgba(34,18,31,.98)) !important;
    box-shadow: 0 16px 34px rgba(239,68,68,.16), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #dashboard .hero-summary .liability-tile strong {
    color: #ff858d !important;
  }
  body.night-mode #dashboard .hero-summary .liability-tile {
    border-left-color: #ef4444 !important;
  }


  body.night-mode #dashboard .hero-summary .change-tile.change-positive {
    border-color: #22c7b8 !important;
    background: radial-gradient(circle at top right, rgba(34,199,184,.18), transparent 62%), linear-gradient(135deg, rgba(24,78,80,.84), rgba(12,38,47,.98)) !important;
    box-shadow: 0 16px 34px rgba(34,199,184,.17), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #dashboard .hero-summary .change-tile.change-positive strong {
    color: #49d8c9 !important;
  }
  body.night-mode #dashboard .hero-summary .change-tile.change-positive {
    border-left-color: #22c7b8 !important;
  }


  body.night-mode #dashboard .hero-summary .change-tile.change-negative {
    border-color: #ef4444 !important;
    background: radial-gradient(circle at top right, rgba(239,68,68,.16), transparent 62%), linear-gradient(135deg, rgba(82,34,47,.84), rgba(34,18,31,.98)) !important;
    box-shadow: 0 16px 34px rgba(239,68,68,.16), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #dashboard .hero-summary .change-tile.change-negative strong {
    color: #ff858d !important;
  }
  body.night-mode #dashboard .hero-summary .change-tile.change-negative {
    border-left-color: #ef4444 !important;
  }


  body.night-mode #dashboard .hero-summary .change-tile.change-neutral {
    border-color: #4f8cff !important;
    background: radial-gradient(circle at top right, rgba(79,140,255,.17), transparent 62%), linear-gradient(135deg, rgba(27,57,105,.84), rgba(13,27,50,.98)) !important;
    box-shadow: 0 16px 34px rgba(79,140,255,.17), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  body.night-mode #dashboard .hero-summary .change-tile.change-neutral strong {
    color: #7cb0ff !important;
  }
  body.night-mode #dashboard .hero-summary .change-tile.change-neutral {
    border-left-color: #4f8cff !important;
  }
}


/* v196: ensure each Home summary card keeps its own left border color */
@media (min-width: 761px) {
  body.night-mode #dashboard .hero-summary .summary-tile + .summary-tile.liability-tile {
    border-left: 1.5px solid #ef4444 !important;
  }
  body.night-mode #dashboard .hero-summary .summary-tile + .summary-tile.change-tile.change-positive {
    border-left: 1.5px solid #22c7b8 !important;
  }
  body.night-mode #dashboard .hero-summary .summary-tile + .summary-tile.change-tile.change-negative {
    border-left: 1.5px solid #ef4444 !important;
  }
  body.night-mode #dashboard .hero-summary .summary-tile + .summary-tile.change-tile.change-neutral {
    border-left: 1.5px solid #4f8cff !important;
  }
}


/* v198: align Budget investment totals with the allocation columns and make totals stand out */
#budget .allocation-footer .mini-stat {
  position: relative;
  overflow: hidden;
}
#budget .allocation-footer .mini-stat::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle at top right, rgba(255,255,255,.12), transparent 42%);
  opacity: .9;
}
#budget .allocation-footer .mini-stat > * {
  position: relative;
  z-index: 1;
}

@media (min-width: 861px) {
  #budget .allocation-footer {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
    align-items: stretch;
    margin-top: 14px !important;
  }
  #budget .allocation-footer .mini-stat {
    min-width: 0;
    padding: 12px 14px !important;
    border-radius: 16px !important;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  #budget .allocation-footer .mini-stat .label {
    font-size: .66rem !important;
    line-height: 1.15;
    letter-spacing: .06em;
  }
  #budget .allocation-footer .mini-stat .value {
    margin-top: 6px !important;
    font-size: 1rem !important;
    line-height: 1.1;
    white-space: nowrap;
  }
  #budget .allocation-footer .allocation-total-pct,
  #budget .allocation-footer .allocation-total-target,
  #budget .allocation-footer .allocation-total-actual,
  #budget .allocation-footer .allocation-total-remaining {
    grid-column: auto !important;
    grid-row: auto !important;
  }
}

/* On compact layouts, keep the two money totals directly below the Target $ / Actual $ columns. */
@media (max-width: 860px) {
  #budget .allocation-footer {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 10px !important;
    margin-top: 12px !important;
  }
  #budget .allocation-footer .allocation-total-target {
    grid-column: 1;
    grid-row: 1;
  }
  #budget .allocation-footer .allocation-total-actual {
    grid-column: 2;
    grid-row: 1;
  }
  #budget .allocation-footer .allocation-total-pct {
    grid-column: 1;
    grid-row: 2;
  }
  #budget .allocation-footer .allocation-total-remaining {
    grid-column: 2;
    grid-row: 2;
  }
  #budget .allocation-footer .mini-stat {
    min-width: 0;
    padding: 12px !important;
    min-height: 112px;
  }
  #budget .allocation-footer .mini-stat .label {
    font-size: .64rem !important;
    line-height: 1.2;
  }
  #budget .allocation-footer .mini-stat .value {
    font-size: 1.05rem !important;
  }
}

body.night-mode #budget .allocation-footer .allocation-total-pct {
  background: linear-gradient(135deg, rgba(56,117,240,.44), rgba(18,30,54,.94) 76%) !important;
  border-color: rgba(112,164,255,.55) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(31,80,187,.24) !important;
}
body.night-mode #budget .allocation-footer .allocation-total-target {
  background: linear-gradient(135deg, rgba(245,171,45,.34), rgba(56,36,12,.92) 76%) !important;
  border-color: rgba(255,198,91,.46) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(163,95,9,.24) !important;
}
body.night-mode #budget .allocation-footer .allocation-total-actual {
  background: linear-gradient(135deg, rgba(34,211,170,.34), rgba(12,51,48,.92) 76%) !important;
  border-color: rgba(66,233,197,.46) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(9,116,100,.24) !important;
}
body.night-mode #budget .allocation-footer .allocation-total-remaining {
  background: linear-gradient(135deg, rgba(139,92,246,.34), rgba(38,24,67,.92) 76%) !important;
  border-color: rgba(179,149,255,.46) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(90,55,166,.24) !important;
}
body.night-mode #budget .allocation-footer .allocation-total-pct.good,
body.night-mode #budget .allocation-footer .allocation-total-remaining.good {
  background: linear-gradient(135deg, rgba(34,197,94,.30), rgba(10,46,33,.94) 76%) !important;
  border-color: rgba(96,232,144,.46) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(21,128,61,.24) !important;
}
body.night-mode #budget .allocation-footer .allocation-total-pct.warn,
body.night-mode #budget .allocation-footer .allocation-total-remaining.warn {
  background: linear-gradient(135deg, rgba(239,68,68,.26), rgba(60,20,33,.94) 76%) !important;
  border-color: rgba(255,129,129,.44) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(153,27,27,.22) !important;
}
body.night-mode #budget .allocation-footer .mini-stat .label {
  color: rgba(228,237,255,.84) !important;
}
body.night-mode #budget .allocation-footer .mini-stat .value {
  color: #ffffff !important;
}


/* v198: tighten and align Budget total cards with the allocation row, and use one shared total-card color */
@media (min-width: 861px) {
  #budget .allocation-footer {
    display: grid !important;
    grid-template-columns: minmax(165px, 0.82fr) minmax(235px, 1fr) minmax(235px, 1fr) minmax(290px, 1.22fr) !important;
    gap: 16px !important;
    align-items: stretch;
    margin-top: 16px !important;
  }

  #budget .allocation-footer .allocation-total-pct,
  #budget .allocation-footer .allocation-total-target,
  #budget .allocation-footer .allocation-total-actual,
  #budget .allocation-footer .allocation-total-remaining {
    grid-column: auto !important;
    justify-self: stretch;
    width: 100%;
  }

  #budget .allocation-footer .mini-stat {
    padding: 14px 18px !important;
    min-height: 134px;
    border-radius: 22px !important;
  }

  #budget .allocation-footer .mini-stat .label {
    font-size: .72rem !important;
    line-height: 1.08;
    letter-spacing: .08em;
  }

  #budget .allocation-footer .mini-stat .value {
    margin-top: 10px !important;
    font-size: 1.18rem !important;
    line-height: 1.02;
  }
}

body.night-mode #budget .allocation-footer .mini-stat {
  background: linear-gradient(135deg, rgba(67,117,238,.42), rgba(20,35,66,.96) 76%) !important;
  border-color: rgba(120,166,255,.52) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 24px rgba(25,63,155,.28) !important;
}

body.night-mode #budget .allocation-footer .mini-stat::before {
  background: radial-gradient(circle at top right, rgba(255,255,255,.10), transparent 45%) !important;
  opacity: .7;
}

body.night-mode #budget .allocation-footer .mini-stat .label {
  color: rgba(222,234,255,.80) !important;
}

body.night-mode #budget .allocation-footer .mini-stat .value {
  color: #ffffff !important;
}

body.night-mode #budget .allocation-footer .allocation-total-pct.good,
body.night-mode #budget .allocation-footer .allocation-total-pct.warn,
body.night-mode #budget .allocation-footer .allocation-total-remaining.good,
body.night-mode #budget .allocation-footer .allocation-total-remaining.warn,
body.night-mode #budget .allocation-footer .allocation-total-pct,
body.night-mode #budget .allocation-footer .allocation-total-target,
body.night-mode #budget .allocation-footer .allocation-total-actual,
body.night-mode #budget .allocation-footer .allocation-total-remaining {
  background: linear-gradient(135deg, rgba(67,117,238,.42), rgba(20,35,66,.96) 76%) !important;
  border-color: rgba(120,166,255,.52) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 24px rgba(25,63,155,.28) !important;
}


/* v199: keep Budget total cards the same size as the previous cards while retaining the shared total-card styling */
@media (min-width: 861px) {
  #budget .allocation-footer {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
  }

  #budget .allocation-footer .mini-stat {
    min-height: 118px !important;
    padding: 14px 16px !important;
    border-radius: 20px !important;
  }

  #budget .allocation-footer .mini-stat .label {
    font-size: .69rem !important;
    line-height: 1.12 !important;
    letter-spacing: .07em !important;
  }

  #budget .allocation-footer .mini-stat .value {
    margin-top: 8px !important;
    font-size: 1.08rem !important;
    line-height: 1.05 !important;
    white-space: normal !important;
  }
}


/* v200: reduce Budget total card thickness/height so they match the previous slimmer cards */
@media (min-width: 861px) {
  #budget .allocation-footer {
    gap: 12px !important;
  }

  #budget .allocation-footer .mini-stat {
    min-height: 94px !important;
    padding: 12px 14px !important;
    border-radius: 18px !important;
  }

  #budget .allocation-footer .mini-stat .label {
    font-size: .66rem !important;
    line-height: 1.08 !important;
    letter-spacing: .07em !important;
  }

  #budget .allocation-footer .mini-stat .value {
    margin-top: 6px !important;
    font-size: 1rem !important;
    line-height: 1.02 !important;
  }
}


/* v202: improve Budget donut center readability and make legend labels fully readable */
#budget .donut-center .small {
  letter-spacing: .09em;
  font-size: .76rem;
  font-weight: 900;
}

#budget .donut-center .amount {
  margin-top: 4px;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -.045em;
}

#budget .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: flex-start;
}

#budget .legend-item {
  flex: 0 1 auto;
  max-width: 100%;
  align-items: center;
}

#budget .legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 5px;
}

#budget .legend-name {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.18;
  font-size: .98rem;
  font-weight: 500;
  color: var(--ink);
}

body.night-mode #budget .donut::before {
  background: linear-gradient(180deg, rgba(211, 223, 238, 0.96), rgba(194, 209, 228, 0.96)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 0 2px rgba(255,255,255,.72) !important;
}

body.night-mode #budget .donut-center .small {
  color: #8ea4c9 !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.22);
}

body.night-mode #budget .donut-center .amount {
  color: #ffffff !important;
  text-shadow: 0 2px 12px rgba(14, 23, 40, .42), 0 1px 2px rgba(14, 23, 40, .35), 0 0 1px rgba(14, 23, 40, .55);
}

body.night-mode #budget .legend-name {
  color: #dce7f8 !important;
}

@media (max-width: 900px) {
  #budget .legend {
    gap: 10px 14px;
  }

  #budget .legend-name {
    font-size: .92rem;
  }
}


/* v203: restructure Budget donut card for clearer desktop reading */
#budget .donut-card {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  grid-template-areas:
    "donut copy"
    "legend legend";
  gap: 16px 24px;
  align-items: start;
}

#budget .donut {
  grid-area: donut;
  justify-self: center;
  align-self: start;
  margin-top: 2px;
}

#budget .donut-copy {
  grid-area: copy;
  align-self: start;
  padding-top: 4px;
}

#budget .donut-copy h3 {
  line-height: 1.05;
}

#budget .legend {
  grid-area: legend;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  align-items: start;
  width: 100%;
  margin-top: 2px;
}

#budget .legend-item {
  min-width: 0;
  align-items: flex-start;
}

#budget .legend-name {
  font-size: .88rem;
  font-weight: 500;
  line-height: 1.18;
}

#budget .legend-swatch {
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

body.night-mode #budget .donut-center .amount {
  color: #223b66 !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.30), 0 2px 10px rgba(14, 23, 40, .14);
}

@media (max-width: 860px) {
  #budget .donut-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "donut"
      "copy"
      "legend";
    justify-items: center;
    gap: 16px;
  }

  #budget .donut-copy {
    text-align: center;
  }

  #budget .legend {
    grid-template-columns: 1fr;
  }
}

/* v192 final QA fixes: category deletion, neutral liability defaults, dialog focus, taller account-type menu */
.category-delete-btn,
.category-plus-btn {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
}
.category-delete-btn {
  display: inline-grid;
  place-items: center;
  padding: 0;
}
.category-delete-btn svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: currentColor;
  pointer-events: none;
}

/* Keep the account-type suggestion menu from being clipped by the Add Account dialog. */
#accountDialog,
#accountDialog form {
  overflow: visible !important;
}
.account-type-suggestions {
  max-height: min(440px, calc(100vh - 24px));
  scrollbar-gutter: stable;
}

/* Safari initially focuses the first dialog button. Focus the dialog instead and
   prevent that focus state from appearing as a stray blue edge on Cancel. */
.account-remove-dialog:focus {
  outline: none;
}
.account-remove-cancel-btn:focus,
.account-remove-confirm-btn:focus {
  outline: none;
}
.account-remove-cancel-btn:focus-visible,
.account-remove-confirm-btn:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}
.account-remove-confirm-btn:focus-visible {
  outline-color: rgba(220, 38, 38, 0.55);
}


/* v193 easier category drag-and-drop */
.account-group-header .drag-handle[data-drag-category] {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 9px;
  cursor: grab;
  font-size: .9rem;
  background: rgba(255,255,255,.15);
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.account-group-header .drag-handle[data-drag-category]:hover,
.account-group-header .drag-handle[data-drag-category]:focus-visible {
  background: rgba(255,255,255,.28);
  border-color: rgba(255,255,255,.62);
  box-shadow: 0 0 0 3px rgba(255,255,255,.12);
  outline: none;
}
.account-group-header .drag-handle[data-drag-category]:active { cursor: grabbing; }

.account-editor.category-drag-active .account-groups-grid {
  position: relative;
}
.account-editor.category-drag-active .draggable-category:not(.dragging) {
  transition: outline-color .1s ease, box-shadow .1s ease, transform .1s ease;
}
.account-editor.category-drag-active .draggable-category.drag-over,
.account-editor.category-drag-active .draggable-category.drop-after {
  outline: none;
}
.account-editor.category-drag-active .draggable-category.drag-over {
  box-shadow: 0 -5px 0 -2px #2563eb, var(--shadow-soft);
}
.account-editor.category-drag-active .draggable-category.drop-after {
  box-shadow: 0 5px 0 -2px #2563eb, var(--shadow-soft);
}
.category-drop-indicator {
  position: fixed;
  z-index: 10000;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 6px 18px rgba(37,99,235,.28);
  pointer-events: none;
}
.category-drop-indicator::before,
.category-drop-indicator::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2563eb;
  transform: translateY(-50%);
}
.category-drop-indicator::before { left: -2px; }
.category-drop-indicator::after { right: -2px; }
.category-drop-indicator span {
  position: absolute;
  left: 50%;
  bottom: 11px;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 999px;
  background: #ffffff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  box-shadow: 0 6px 18px rgba(15,23,42,.12);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .01em;
}
body.night-mode .category-drop-indicator {
  box-shadow: 0 0 0 2px rgba(15,23,42,.9), 0 6px 18px rgba(37,99,235,.4);
}
body.night-mode .category-drop-indicator span {
  background: #101826;
  color: #bfdbfe;
  border-color: #405574;
}


/* v194 two-dimensional, Safari-safe category sorting */
.account-group-header .drag-handle[data-drag-category] {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
body.category-pointer-dragging,
body.category-pointer-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
.account-editor.category-drag-active .draggable-category.dragging {
  opacity: .42;
  transform: scale(.985);
  filter: saturate(.72);
}
.category-drop-indicator.vertical {
  width: 6px;
  min-width: 6px;
  border-radius: 999px;
}
.category-drop-indicator.vertical::before,
.category-drop-indicator.vertical::after {
  left: 50%;
  right: auto;
  transform: translate(-50%, 0);
}
.category-drop-indicator.vertical::before { top: -2px; }
.category-drop-indicator.vertical::after { top: auto; bottom: -2px; }
.category-drop-indicator.vertical span {
  left: 12px;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
}
.category-drop-indicator.vertical[data-edge="right"] span {
  left: auto;
  right: 12px;
}


/* v195 account-row drag indicator cleanup
   Use one blue insertion line only; remove the dashed destination rectangle. */

/* v201: birthday-driven ages, account search, and stronger action buttons */

/* Budget actions should read as primary actions in Light Mode, matching Add Contribution. */
body:not(.night-mode) #budget #addExpenseBtn,
body:not(.night-mode) #budget #addAllocationBtn {
  color: #ffffff !important;
  background: linear-gradient(135deg, #5b8cff 0%, #7c63f6 100%) !important;
  border: 1px solid rgba(91, 140, 255, .72) !important;
  box-shadow: 0 12px 28px rgba(74, 108, 244, .22), inset 0 1px 0 rgba(255,255,255,.34) !important;
  font-weight: 850 !important;
}
body:not(.night-mode) #budget #addExpenseBtn:hover,
body:not(.night-mode) #budget #addAllocationBtn:hover {
  background: linear-gradient(135deg, #4f80f5 0%, #7458ef 100%) !important;
  border-color: rgba(73, 113, 234, .9) !important;
  box-shadow: 0 16px 34px rgba(74, 108, 244, .28), inset 0 1px 0 rgba(255,255,255,.38) !important;
  transform: translateY(-1px);
}

/* Projection contribution removal should be unmistakably destructive in Light Mode. */
body:not(.night-mode) #projection .projection-contribution-row .contribution-remove-btn {
  color: #dc2626 !important;
  background: linear-gradient(180deg, #fff7f7 0%, #ffe8e8 100%) !important;
  border: 1.5px solid #f6a7a7 !important;
  box-shadow: 0 8px 18px rgba(220, 38, 38, .10) !important;
  font-weight: 900 !important;
}
body:not(.night-mode) #projection .projection-contribution-row .contribution-remove-btn:hover {
  color: #b91c1c !important;
  background: linear-gradient(180deg, #ffecec 0%, #ffdada 100%) !important;
  border-color: #ef7777 !important;
  box-shadow: 0 10px 22px rgba(220, 38, 38, .16) !important;
  transform: translateY(-1px);
}

/* Search bars shared by Accounts and Projection. */
.account-search-wrap {
  position: relative;
  width: min(620px, 100%);
  margin: 2px 0 14px;
  z-index: 18;
}
.projection-account-search {
  margin-top: 18px;
  margin-bottom: 14px;
}
.account-search-field {
  position: relative;
  display: flex;
  align-items: center;
}
.account-search-field input[type="search"] {
  width: 100%;
  min-height: 48px;
  padding: 11px 44px 11px 44px;
  border: 1.5px solid #d6deea;
  border-radius: 15px;
  background: rgba(255,255,255,.96);
  color: var(--ink);
  box-shadow: 0 7px 20px rgba(15,23,42,.06), inset 0 1px 0 rgba(255,255,255,.75);
  font-weight: 720;
  appearance: none;
  -webkit-appearance: none;
}
.account-search-field input[type="search"]::-webkit-search-cancel-button {
  display: none;
}
.account-search-field input[type="search"]::placeholder {
  color: #8b97aa;
  font-weight: 650;
}
.account-search-field input[type="search"]:focus {
  border-color: #4b82f6;
  box-shadow: 0 0 0 4px rgba(59,130,246,.13), 0 10px 24px rgba(37,99,235,.10);
}
.account-search-icon {
  position: absolute;
  left: 15px;
  z-index: 2;
  color: #6f7d92;
  font-size: 1.25rem;
  line-height: 1;
  pointer-events: none;
}
.account-search-clear {
  position: absolute;
  right: 10px;
  z-index: 3;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #edf2f8;
  color: #566276;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}
.account-search-clear:hover { background: #e2e8f0; }
.account-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(430px, 55vh);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #cfdae8;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 58px rgba(15,23,42,.18);
  z-index: 250;
  overscroll-behavior: contain;
}
.account-search-results[hidden] { display: none !important; }
.account-search-result {
  width: 100%;
  display: grid;
  gap: 3px;
  text-align: left;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #172033;
  padding: 11px 12px;
}
.account-search-result:hover,
.account-search-result:focus-visible {
  outline: none;
  background: #eaf2ff;
}
.account-search-result strong {
  font-size: .94rem;
  line-height: 1.3;
}
.account-search-result strong span {
  color: #53627a;
  font-weight: 720;
}
.account-search-result small {
  color: #7b8799;
  font-size: .77rem;
  font-weight: 680;
}
.account-search-empty {
  padding: 13px 12px;
  color: var(--muted);
  font-weight: 700;
}
.account-search-hit {
  position: relative;
  z-index: 2;
  animation: moneywiseAccountSearchHit 1.8s ease-out;
}
@keyframes moneywiseAccountSearchHit {
  0%, 26% { box-shadow: 0 0 0 4px rgba(37,99,235,.28), 0 10px 30px rgba(37,99,235,.18); }
  100% { box-shadow: none; }
}

body.night-mode .account-search-field input[type="search"] {
  background: #142238 !important;
  border-color: #38639c !important;
  color: #f7f9ff !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.04) !important;
}
body.night-mode .account-search-field input[type="search"]::placeholder { color: #98a9c4; }
body.night-mode .account-search-icon { color: #b4c3db; }
body.night-mode .account-search-clear {
  background: #263b5c;
  color: #eef4ff;
}
body.night-mode .account-search-results {
  background: #101b2a;
  border-color: #3c577a;
  box-shadow: 0 26px 60px rgba(0,0,0,.48);
}
body.night-mode .account-search-result { color: #ffffff; }
body.night-mode .account-search-result:hover,
body.night-mode .account-search-result:focus-visible { background: #244475; }
body.night-mode .account-search-result strong span { color: #d8e3f3; }
body.night-mode .account-search-result small { color: #9eafc7; }

/* Birthday/age helper text stays compact under the editable age inputs. */
.age-source-note,
#settingsBirthdayAge {
  display: block;
  margin-top: 2px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .account-search-wrap { width: 100%; }
  .account-search-results { max-height: 46vh; }
}
.accounts-account-search { margin-top: 14px; }

/* v202: make account search unmistakable and keep the chosen account highlighted. */
.account-search-field {
  border-radius: 18px;
  padding: 3px;
  background: linear-gradient(135deg, rgba(47,109,246,.98), rgba(129,82,246,.92));
  box-shadow: 0 10px 28px rgba(67,97,238,.18), 0 0 0 1px rgba(91,110,255,.08);
}
.account-search-field input[type="search"] {
  border: 0 !important;
  min-height: 50px;
  border-radius: 15px;
  background: rgba(255,255,255,.97) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.84) !important;
}
.account-search-field input[type="search"]:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255,255,255,.72), inset 0 1px 0 rgba(255,255,255,.9) !important;
}
.account-search-icon { left: 18px; }
.account-search-clear { right: 13px; }

.account-row.account-search-selected {
  background: linear-gradient(90deg, rgba(219,234,254,.92), rgba(237,233,254,.86)) !important;
  outline: 3px solid rgba(59,130,246,.72);
  outline-offset: -2px;
  box-shadow: 0 10px 26px rgba(37,99,235,.18), inset 5px 0 0 #2563eb;
}
.projection-account-row.account-search-selected > td {
  background: linear-gradient(90deg, rgba(219,234,254,.96), rgba(237,233,254,.92)) !important;
  border-top: 3px solid rgba(59,130,246,.72) !important;
  border-bottom: 3px solid rgba(59,130,246,.72) !important;
}
.projection-account-row.account-search-selected > td:first-child {
  border-left: 3px solid rgba(59,130,246,.72) !important;
  box-shadow: inset 5px 0 0 #2563eb;
}
.projection-account-row.account-search-selected > td:last-child {
  border-right: 3px solid rgba(59,130,246,.72) !important;
}

body.night-mode .account-search-field {
  background: linear-gradient(135deg, #2f6df6, #8656f6);
  box-shadow: 0 12px 32px rgba(44,103,246,.28), 0 0 0 1px rgba(133,92,246,.28);
}
body.night-mode .account-search-field input[type="search"] {
  background: #142238 !important;
  color: #f7f9ff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
}
body.night-mode .account-row.account-search-selected {
  background: linear-gradient(90deg, rgba(37,74,132,.92), rgba(70,50,126,.84)) !important;
  outline-color: rgba(96,165,250,.92);
  box-shadow: 0 12px 30px rgba(0,0,0,.30), inset 5px 0 0 #60a5fa;
}
body.night-mode .projection-account-row.account-search-selected > td {
  background: linear-gradient(90deg, rgba(37,74,132,.94), rgba(70,50,126,.88)) !important;
  border-top-color: rgba(96,165,250,.95) !important;
  border-bottom-color: rgba(96,165,250,.95) !important;
}
body.night-mode .projection-account-row.account-search-selected > td:first-child {
  border-left-color: rgba(96,165,250,.95) !important;
  box-shadow: inset 5px 0 0 #60a5fa;
}
body.night-mode .projection-account-row.account-search-selected > td:last-child {
  border-right-color: rgba(96,165,250,.95) !important;
}


/* v203: improve light-mode overlay legibility + themed Accounts snapshot dropdown */
body:not(.night-mode) .calculator-widget,
body:not(.night-mode) .notes-widget {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.92)) !important;
  border-color: rgba(191, 208, 239, .72) !important;
  box-shadow: 0 28px 70px rgba(31, 41, 55, .20), inset 0 1px 0 rgba(255,255,255,.96) !important;
  backdrop-filter: blur(30px) saturate(155%) !important;
  -webkit-backdrop-filter: blur(30px) saturate(155%) !important;
}
body:not(.night-mode) .calculator-widget .calculator-display,
body:not(.night-mode) .calculator-widget .calculator-grid button:not(.calc-op):not(.calc-equals),
body:not(.night-mode) .calculator-widget .ghost-icon-btn,
body:not(.night-mode) .notes-widget .ghost-icon-btn,
body:not(.night-mode) .notes-widget .notes-form input,
body:not(.night-mode) .notes-widget .notes-form textarea,
body:not(.night-mode) .notes-widget .note-card,
body:not(.night-mode) .notes-widget .empty-notes {
  background: rgba(248, 251, 255, .94) !important;
  border-color: rgba(180, 200, 235, .58) !important;
  color: var(--ink) !important;
  backdrop-filter: blur(16px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(140%) !important;
}
body:not(.night-mode) .calculator-widget .calculator-grid .calc-action {
  background: rgba(227, 237, 255, .96) !important;
  color: #2563eb !important;
  border-color: rgba(147, 181, 245, .46) !important;
}
body:not(.night-mode) .notes-widget .note-card p,
body:not(.night-mode) .notes-widget .note-card-header small {
  color: #667085 !important;
}

/* The Accounts View selector uses the same custom menu structure in light and dark mode.
   In light mode, keep that structure but use a frosted Money-Wise surface instead of the
   browser-native macOS menu. */
body:not(.night-mode) #snapshotSelect + .mw-select-trigger {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(241,246,255,.92)) !important;
  border: 1px solid rgba(105, 145, 218, .34) !important;
  color: #1d2939 !important;
  box-shadow: 0 10px 28px rgba(31,41,55,.10), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #snapshotSelect + .mw-select-trigger:hover,
body:not(.night-mode) #snapshotSelect + .mw-select-trigger:focus-visible,
body:not(.night-mode) #snapshotSelect + .mw-select-trigger.is-open {
  border-color: rgba(61,124,255,.72) !important;
  background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(235,242,255,.97)) !important;
  box-shadow: 0 0 0 4px rgba(61,124,255,.12), 0 14px 34px rgba(31,41,55,.12) !important;
}
body:not(.night-mode) #snapshotSelect + .mw-select-trigger .mw-select-trigger-icon span {
  background: #477be7 !important;
}
body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] {
  border: 1px solid rgba(130, 158, 211, .38) !important;
  background: linear-gradient(180deg, rgba(252,253,255,.985), rgba(238,244,255,.985)) !important;
  box-shadow: 0 28px 70px rgba(31,41,55,.20), inset 0 1px 0 rgba(255,255,255,.96) !important;
  backdrop-filter: blur(28px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(150%) !important;
}
body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] .mw-custom-select-option {
  border-color: transparent !important;
  background: transparent !important;
  color: #1d2939 !important;
  box-shadow: none !important;
}
body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] .mw-custom-select-option:hover:not(:disabled),
body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] .mw-custom-select-option:focus-visible {
  border-color: rgba(103, 145, 222, .22) !important;
  background: rgba(219, 232, 255, .72) !important;
}
body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] .mw-custom-select-option.is-selected {
  border-color: rgba(61,124,255,.24) !important;
  background: linear-gradient(135deg, rgba(61,124,255,.16), rgba(109,94,252,.12)) !important;
  color: #163b87 !important;
}
body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] .mw-custom-select-option-accessory {
  background: rgba(61,124,255,.10) !important;
  color: #356fe8 !important;
}
body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] .mw-custom-select-option.is-selected .mw-custom-select-option-accessory {
  background: rgba(61,124,255,.20) !important;
  color: #174fbf !important;
}

/* v204: make the light-mode Accounts snapshot selector match the compact dark-mode format */
@media (min-width: 768px) {
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] {
    padding: 6px !important;
    border-radius: 14px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] .mw-custom-select-option {
    width: 100% !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #1d2939 !important;
    font-size: 0.82rem !important;
    font-weight: 620 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
  }

  body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] .mw-custom-select-option + .mw-custom-select-option {
    margin-top: 1px !important;
  }

  body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] .mw-custom-select-option:hover:not(:disabled),
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] .mw-custom-select-option:focus-visible,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] .mw-custom-select-option.is-selected {
    border: 0 !important;
    outline: none !important;
    background: #dce8ff !important;
    color: #153f86 !important;
  }

  body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] .mw-custom-select-option-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Dark mode uses a clean list with no right-side check/chevron bubbles. Match that exactly. */
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="snapshotSelect"] .mw-custom-select-option-accessory {
    display: none !important;
  }
}


/* v206 contextual information buttons and dialogs */
.context-info-heading-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}
.context-info-heading-row .panel-title {
  margin: 0;
}
.info-icon.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.accounts-guidance-dialog p + p {
  margin-top: 10px;
}
@media (max-width: 640px) {
  .context-info-heading-row {
    gap: 8px;
  }
  .context-info-heading-row .accounts-heading-info-btn {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }
}


/* v207 Fund distributions info button: match Accounts Net worth snapshots info button exactly */
#fundDistributionsInfoBtn {
  width: 30px !important;
  height: 30px !important;
  flex: 0 0 30px !important;
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #60a5fa !important;
  color: #08111f !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 1.08rem !important;
  font-style: italic !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: 0 5px 14px rgba(37, 99, 235, .22) !important;
  cursor: pointer;
}
#fundDistributionsInfoBtn:hover,
#fundDistributionsInfoBtn:focus-visible,
#fundDistributionsInfoBtn.active {
  background: #7db7ff !important;
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .16), 0 8px 18px rgba(37, 99, 235, .24) !important;
  outline: none;
}
body.night-mode #fundDistributionsInfoBtn {
  background: #60a5fa !important;
  color: #08111f !important;
}
body.night-mode #fundDistributionsInfoBtn:hover,
body.night-mode #fundDistributionsInfoBtn:focus-visible,
body.night-mode #fundDistributionsInfoBtn.active {
  background: #7db7ff !important;
}
@media (max-width: 640px) {
  #fundDistributionsInfoBtn {
    width: 28px !important;
    height: 28px !important;
    flex-basis: 28px !important;
    font-size: 1rem !important;
  }
}


/* v209: Home Target Progress due-date dropdowns use the same compact custom format in Light Mode as Dark Mode */
@media (min-width: 768px) {
  /* Trigger: preserve the light palette, but match Dark Mode's compact geometry and typography. */
  body:not(.night-mode) #dashboardTargetMonth + .mw-select-trigger,
  body:not(.night-mode) #dashboardTargetYear + .mw-select-trigger {
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 38px !important;
    padding: 6px 10px !important;
    border-radius: 12px !important;
    border: 1px solid #b7c7e4 !important;
    background: #f8fbff !important;
    color: #172033 !important;
    font-size: 0.82rem !important;
    font-weight: 620 !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
  }
  body:not(.night-mode) #dashboardTargetMonth + .mw-select-trigger:hover,
  body:not(.night-mode) #dashboardTargetMonth + .mw-select-trigger:focus-visible,
  body:not(.night-mode) #dashboardTargetMonth + .mw-select-trigger.is-open,
  body:not(.night-mode) #dashboardTargetYear + .mw-select-trigger:hover,
  body:not(.night-mode) #dashboardTargetYear + .mw-select-trigger:focus-visible,
  body:not(.night-mode) #dashboardTargetYear + .mw-select-trigger.is-open {
    border-color: #6f9bf2 !important;
    background: #f2f7ff !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10) !important;
  }
  body:not(.night-mode) #dashboardTargetMonth + .mw-select-trigger .mw-select-trigger-label,
  body:not(.night-mode) #dashboardTargetYear + .mw-select-trigger .mw-select-trigger-label {
    line-height: 1.18 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  body:not(.night-mode) #dashboardTargetMonth + .mw-select-trigger .mw-select-trigger-icon,
  body:not(.night-mode) #dashboardTargetYear + .mw-select-trigger .mw-select-trigger-icon {
    width: 12px !important;
    height: 12px !important;
  }
  body:not(.night-mode) #dashboardTargetMonth + .mw-select-trigger .mw-select-trigger-icon span,
  body:not(.night-mode) #dashboardTargetYear + .mw-select-trigger .mw-select-trigger-icon span {
    width: 7px !important;
    height: 1.5px !important;
    top: 5px !important;
    background: #617594 !important;
  }

  /* Menu: same density, radius, padding, row spacing, and selected-row treatment as Dark Mode. */
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetMonth"],
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetYear"] {
    padding: 6px !important;
    border: 1px solid #b7c7e4 !important;
    border-radius: 14px !important;
    background: #f8fbff !important;
    color: #172033 !important;
    box-shadow: 0 20px 55px rgba(31, 41, 55, .18) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    scrollbar-width: thin !important;
    scrollbar-color: #a9bddf #f8fbff !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetMonth"]::-webkit-scrollbar,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetYear"]::-webkit-scrollbar {
    width: 7px !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetMonth"]::-webkit-scrollbar-track,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetYear"]::-webkit-scrollbar-track {
    background: #f8fbff !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetMonth"]::-webkit-scrollbar-thumb,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetYear"]::-webkit-scrollbar-thumb {
    background: #a9bddf !important;
    border-radius: 999px !important;
    border: 1px solid #f8fbff !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetMonth"] .mw-custom-select-option,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetYear"] .mw-custom-select-option {
    width: 100% !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #172033 !important;
    font-size: 0.82rem !important;
    font-weight: 620 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetMonth"] .mw-custom-select-option + .mw-custom-select-option,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetYear"] .mw-custom-select-option + .mw-custom-select-option {
    margin-top: 1px !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetMonth"] .mw-custom-select-option:hover:not(:disabled),
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetMonth"] .mw-custom-select-option:focus-visible,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetMonth"] .mw-custom-select-option.is-selected,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetYear"] .mw-custom-select-option:hover:not(:disabled),
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetYear"] .mw-custom-select-option:focus-visible,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetYear"] .mw-custom-select-option.is-selected {
    background: #dce8ff !important;
    color: #153f86 !important;
    border: 0 !important;
    outline: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetMonth"] .mw-custom-select-option-label,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetYear"] .mw-custom-select-option-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  /* Dark Mode's date menus use the clean list treatment with no right-side check/chevron bubbles. */
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetMonth"] .mw-custom-select-option-accessory,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="dashboardTargetYear"] .mw-custom-select-option-accessory {
    display: none !important;
  }
}


/* v210: Projection Regular Investing Plan dropdowns — use the same compact custom
   dropdown structure in Light Mode as Dark Mode, while keeping a light palette. */
@media (min-width: 768px) {
  body:not(.night-mode) #projection .projection-contribution-row .mw-select-trigger {
    min-height: 38px !important;
    padding: 6px 10px !important;
    border: 1px solid rgba(145, 164, 196, .42) !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,.88) !important;
    color: #172033 !important;
    font-size: .82rem !important;
    font-weight: 620 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.96) !important;
    align-items: center !important;
  }
  body:not(.night-mode) #projection .projection-contribution-row .mw-select-trigger:hover,
  body:not(.night-mode) #projection .projection-contribution-row .mw-select-trigger:focus-visible,
  body:not(.night-mode) #projection .projection-contribution-row .mw-select-trigger.is-open {
    border-color: #7ea6ef !important;
    background: #f8fbff !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,.10), inset 0 1px 0 rgba(255,255,255,.98) !important;
  }
  body:not(.night-mode) #projection .projection-contribution-row .mw-select-trigger-label {
    color: #172033 !important;
    opacity: 1 !important;
  }
  body:not(.night-mode) #projection .projection-contribution-row .mw-select-trigger-icon {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
  }
  body:not(.night-mode) #projection .projection-contribution-row .mw-select-trigger-icon span {
    display: none !important;
  }
  body:not(.night-mode) #projection .projection-contribution-row .mw-select-trigger-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2.2px solid #334155;
    border-bottom: 2.2px solid #334155;
    transform: translate(-50%, -58%) rotate(45deg);
    transform-origin: center;
    transition: transform .16s ease;
    box-sizing: border-box;
  }
  body:not(.night-mode) #projection .projection-contribution-row .mw-select-trigger.is-open .mw-select-trigger-icon::after {
    transform: translate(-50%, -42%) rotate(-135deg);
  }

  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] {
    padding: 6px !important;
    border: 1px solid #c8d4e6 !important;
    border-radius: 14px !important;
    background: rgba(248,250,253,.99) !important;
    color: #172033 !important;
    box-shadow: 0 20px 55px rgba(31,41,55,.20) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    scrollbar-width: thin;
    scrollbar-color: #b8c7dc #f8fafc;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"]::-webkit-scrollbar {
    width: 7px;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"]::-webkit-scrollbar-track {
    background: #f8fafc;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"]::-webkit-scrollbar-thumb {
    background: #b8c7dc;
    border-radius: 999px;
    border: 1px solid #f8fafc;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-option {
    width: 100% !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #172033 !important;
    font-size: .82rem !important;
    font-weight: 620 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-option + .mw-custom-select-option {
    margin-top: 1px !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-option:hover:not(:disabled),
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-option:focus-visible,
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-option.is-selected {
    background: #dce9fb !important;
    color: #163b73 !important;
    border: 0 !important;
    outline: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-option:disabled {
    opacity: .48 !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-option-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  /* Match Dark Mode: no large check/arrow bubbles beside each account. */
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-option-accessory {
    display: none !important;
  }

  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"].is-searchable {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-search {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 4px 4px 8px !important;
    background: #f8fafd !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-search-input {
    width: 100% !important;
    min-height: 38px !important;
    padding: 8px 12px !important;
    border-radius: 10px !important;
    border: 1px solid #aebfd8 !important;
    background: #eef4fc !important;
    color: #172033 !important;
    font-size: .84rem !important;
    font-weight: 620 !important;
    outline: none !important;
    box-shadow: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-search-input::placeholder {
    color: #7a8aa3 !important;
    opacity: 1 !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-search-input:focus {
    border-color: #7ea6ef !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.10) !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-options {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="projection-contribution"] .mw-custom-select-empty {
    padding: 10px 12px !important;
    color: #64748b !important;
    font-size: .82rem !important;
  }
}


/* v211: Individual Account Projection selector — use the same custom dropdown
   structure in Light Mode as Dark Mode, while preserving a light palette. */
@media (min-width: 768px) {
  body:not(.night-mode) #projection #projectionAccountSelect + .mw-select-trigger {
    min-height: 58px !important;
    width: 100% !important;
    padding: 12px 16px !important;
    border: 2px solid #6ea0f7 !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f3f7fd 100%) !important;
    color: #172033 !important;
    font-size: clamp(.92rem, 1.05vw, 1.06rem) !important;
    font-weight: 800 !important;
    box-shadow: 0 0 0 5px rgba(37,99,235,.07), 0 10px 24px rgba(37,99,235,.10) !important;
  }
  body:not(.night-mode) #projection #projectionAccountSelect + .mw-select-trigger:hover,
  body:not(.night-mode) #projection #projectionAccountSelect + .mw-select-trigger:focus-visible,
  body:not(.night-mode) #projection #projectionAccountSelect + .mw-select-trigger.is-open {
    border-color: #4f8df6 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 5px rgba(37,99,235,.11), 0 14px 30px rgba(37,99,235,.14) !important;
  }
  body:not(.night-mode) #projection #projectionAccountSelect + .mw-select-trigger .mw-select-trigger-label {
    color: #172033 !important;
    opacity: 1 !important;
  }
  body:not(.night-mode) #projection #projectionAccountSelect + .mw-select-trigger .mw-select-trigger-icon {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
  }
  body:not(.night-mode) #projection #projectionAccountSelect + .mw-select-trigger .mw-select-trigger-icon span {
    display: none !important;
  }
  body:not(.night-mode) #projection #projectionAccountSelect + .mw-select-trigger .mw-select-trigger-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2.4px solid #334155;
    border-bottom: 2.4px solid #334155;
    transform: translate(-50%, -58%) rotate(45deg);
    transform-origin: center;
    transition: transform .16s ease;
    box-sizing: border-box;
  }
  body:not(.night-mode) #projection #projectionAccountSelect + .mw-select-trigger.is-open .mw-select-trigger-icon::after {
    transform: translate(-50%, -42%) rotate(-135deg);
  }

  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] {
    display: flex !important;
    flex-direction: column !important;
    padding: 10px !important;
    border: 1px solid #c4d2e6 !important;
    border-radius: 22px !important;
    background: #f8fafc !important;
    color: #172033 !important;
    box-shadow: 0 24px 58px rgba(31,41,55,.22), inset 0 1px 0 rgba(255,255,255,.96) !important;
    overflow: hidden !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-search {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 2px 2px 10px !important;
    background: #f8fafc !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-search-input {
    width: 100% !important;
    min-height: 46px !important;
    padding: 10px 14px !important;
    border-radius: 14px !important;
    border: 1.5px solid #8fb0dd !important;
    background: #eef4fc !important;
    color: #172033 !important;
    font-size: .94rem !important;
    font-weight: 650 !important;
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(37,99,235,.05) !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-search-input::placeholder {
    color: #7d8ca3 !important;
    opacity: 1 !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-search-input:focus {
    border-color: #5f8ed8 !important;
    box-shadow: 0 0 0 4px rgba(37,99,235,.09) !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-options {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin;
    scrollbar-color: #b8c7dc #f8fafc;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-options::-webkit-scrollbar {
    width: 7px;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-options::-webkit-scrollbar-track {
    background: #f8fafc;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-options::-webkit-scrollbar-thumb {
    background: #b8c7dc;
    border-radius: 999px;
    border: 1px solid #f8fafc;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-option {
    width: 100% !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 12px 14px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: #172033 !important;
    font-size: .94rem !important;
    font-weight: 720 !important;
    line-height: 1.25 !important;
    box-shadow: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-option + .mw-custom-select-option {
    margin-top: 2px !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-option:hover:not(:disabled),
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-option:focus-visible {
    background: #e8f0fb !important;
    color: #163b73 !important;
    outline: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-option.is-selected {
    background: #d8e7fb !important;
    color: #153f78 !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-option-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  /* Match the Dark Mode account-list format: selection is shown by row highlight,
     not by native checkmarks or large accessory bubbles. */
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-option-accessory {
    display: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-empty {
    padding: 12px 14px !important;
    color: #64748b !important;
    font-size: .9rem !important;
  }
}

/* v212: Individual Account Projection light-mode account menu — match Dark Mode row density. */
@media (min-width: 768px) {
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-option {
    min-height: 36px !important;
    padding: 8px 10px !important;
    border-radius: 9px !important;
    font-size: .82rem !important;
    font-weight: 620 !important;
    line-height: 1.2 !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="projectionAccountSelect"] .mw-custom-select-option + .mw-custom-select-option {
    margin-top: 1px !important;
  }
}


/* v213: Projection search-selected row should read as one unified highlight. */
#projection .projection-account-row.account-search-selected > td {
  background: #e8f0ff !important;
  border-top: 3px solid #4f8df7 !important;
  border-bottom: 3px solid #4f8df7 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  box-shadow: none !important;
}
#projection .projection-account-row.account-search-selected > td:first-child {
  border-left: 3px solid #4f8df7 !important;
  box-shadow: none !important;
}
#projection .projection-account-row.account-search-selected > td:last-child {
  border-right: 3px solid #4f8df7 !important;
}
body.night-mode #projection .projection-account-row.account-search-selected > td {
  background: #213d6a !important;
  border-top-color: #60a5fa !important;
  border-bottom-color: #60a5fa !important;
  border-left: 0 !important;
  border-right: 0 !important;
  box-shadow: none !important;
}
body.night-mode #projection .projection-account-row.account-search-selected > td:first-child {
  border-left: 3px solid #60a5fa !important;
  box-shadow: none !important;
}
body.night-mode #projection .projection-account-row.account-search-selected > td:last-child {
  border-right: 3px solid #60a5fa !important;
}


/* v214: Budget fund-distributions light-mode account dropdown — match Dark Mode formatting. */
@media (min-width: 768px) {
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] {
    display: flex !important;
    flex-direction: column !important;
    padding: 6px !important;
    border: 1px solid #c4d2e6 !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    color: #172033 !important;
    box-shadow: 0 20px 55px rgba(31,41,55,.22), inset 0 1px 0 rgba(255,255,255,.96) !important;
    overflow: hidden !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"].is-searchable {
    display: flex !important;
    flex-direction: column !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-search {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 4px 4px 8px !important;
    background: #f8fafc !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-search-input {
    width: 100% !important;
    min-height: 38px !important;
    padding: 8px 12px !important;
    border-radius: 10px !important;
    border: 1px solid #8fb0dd !important;
    background: #eef4fc !important;
    color: #172033 !important;
    font-size: .84rem !important;
    font-weight: 620 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.05) !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-search-input::placeholder {
    color: #7d8ca3 !important;
    opacity: 1 !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-search-input:focus {
    border-color: #55709a !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.10) !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-options {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin;
    scrollbar-color: #b8c7dc #f8fafc;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-options::-webkit-scrollbar {
    width: 7px;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-options::-webkit-scrollbar-track {
    background: #f8fafc;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-options::-webkit-scrollbar-thumb {
    background: #b8c7dc;
    border-radius: 999px;
    border: 1px solid #f8fafc;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-group {
    padding: 7px 10px 4px !important;
    color: #8f9caf !important;
    font-size: .72rem !important;
    font-weight: 760 !important;
    letter-spacing: .06em !important;
    text-transform: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-option {
    width: 100% !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #172033 !important;
    font-size: .82rem !important;
    font-weight: 620 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-option + .mw-custom-select-option {
    margin-top: 1px !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-option:hover:not(:disabled),
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-option:focus-visible,
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-option.is-selected {
    background: #d8e7fb !important;
    color: #153f78 !important;
    border: 0 !important;
    outline: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-option:disabled {
    color: #8f9caf !important;
    opacity: .8 !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-option-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-option-accessory {
    display: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="budget-allocation"] .mw-custom-select-empty {
    padding: 10px 12px !important;
    color: #64748b !important;
    font-size: .82rem !important;
  }
}


/* v215: Car loan-term light-mode dropdown — match Dark Mode formatting. */
@media (min-width: 768px) {
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] {
    display: flex !important;
    flex-direction: column !important;
    padding: 6px !important;
    border: 1px solid #c4d2e6 !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    color: #172033 !important;
    box-shadow: 0 20px 55px rgba(31,41,55,.22), inset 0 1px 0 rgba(255,255,255,.96) !important;
    overflow: hidden !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] .mw-custom-select-option {
    width: 100% !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 10px 18px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: #172033 !important;
    font-size: .96rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    box-shadow: none !important;
    justify-content: flex-start !important;
    text-align: left !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] .mw-custom-select-option + .mw-custom-select-option {
    margin-top: 4px !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] .mw-custom-select-option:hover:not(:disabled),
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] .mw-custom-select-option:focus-visible,
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] .mw-custom-select-option.is-selected {
    background: #d8e7fb !important;
    color: #153f78 !important;
    border: 0 !important;
    outline: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] .mw-custom-select-option-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] .mw-custom-select-option-accessory {
    display: none !important;
  }
}


/* v216: Car loan-term Light Mode — use the same density/structure as Dark Mode without dark trigger colors. */
@media (min-width: 768px) {
  body:not(.night-mode) #carLoanMonths + .mw-select-trigger {
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 38px !important;
    padding: 6px 10px !important;
    border-radius: 12px !important;
    border: 1px solid #9db3d2 !important;
    background: #ffffff !important;
    color: #172033 !important;
    font-size: .84rem !important;
    font-weight: 620 !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
  }
  body:not(.night-mode) #carLoanMonths + .mw-select-trigger:hover,
  body:not(.night-mode) #carLoanMonths + .mw-select-trigger:focus-visible,
  body:not(.night-mode) #carLoanMonths + .mw-select-trigger.is-open {
    border-color: #55709a !important;
    background: #f8fafc !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.10) !important;
  }
  body:not(.night-mode) #carLoanMonths + .mw-select-trigger .mw-select-trigger-label {
    color: #172033 !important;
    line-height: 1.18 !important;
  }
  body:not(.night-mode) #carLoanMonths + .mw-select-trigger .mw-select-trigger-icon span {
    width: 7px !important;
    height: 1.5px !important;
    top: 5px !important;
    background: #5f7596 !important;
  }

  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] {
    padding: 6px !important;
    border: 1px solid #c4d2e6 !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    color: #172033 !important;
    box-shadow: 0 20px 55px rgba(31,41,55,.22) !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] .mw-custom-select-option {
    min-height: 36px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #172033 !important;
    font-size: .82rem !important;
    font-weight: 620 !important;
    line-height: 1.2 !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] .mw-custom-select-option + .mw-custom-select-option {
    margin-top: 1px !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] .mw-custom-select-option:hover:not(:disabled),
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] .mw-custom-select-option:focus-visible,
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] .mw-custom-select-option.is-selected {
    background: #d8e7fb !important;
    color: #153f78 !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="car-loan-term"] .mw-custom-select-option-accessory {
    display: none !important;
  }
}


/* v217: Settings currency-symbol Light Mode dropdown — match Dark Mode structure/feel. */
@media (min-width: 768px) {
  body:not(.night-mode) #currencyInput + .mw-select-trigger {
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 38px !important;
    padding: 6px 10px !important;
    border-radius: 12px !important;
    border: 1px solid #9db3d2 !important;
    background: #ffffff !important;
    color: #172033 !important;
    font-size: .84rem !important;
    font-weight: 620 !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
  }
  body:not(.night-mode) #currencyInput + .mw-select-trigger:hover,
  body:not(.night-mode) #currencyInput + .mw-select-trigger:focus-visible,
  body:not(.night-mode) #currencyInput + .mw-select-trigger.is-open {
    border-color: #55709a !important;
    background: #f8fafc !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.10) !important;
  }
  body:not(.night-mode) #currencyInput + .mw-select-trigger .mw-select-trigger-label {
    color: #172033 !important;
    line-height: 1.18 !important;
  }
  body:not(.night-mode) #currencyInput + .mw-select-trigger .mw-select-trigger-icon span {
    width: 7px !important;
    height: 1.5px !important;
    top: 5px !important;
    background: #5f7596 !important;
  }

  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="settings-currency"] {
    display: flex !important;
    flex-direction: column !important;
    padding: 6px !important;
    border: 1px solid #c4d2e6 !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    color: #172033 !important;
    box-shadow: 0 20px 55px rgba(31,41,55,.22) !important;
    overflow: hidden !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="settings-currency"] .mw-custom-select-option {
    width: 100% !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #172033 !important;
    font-size: .82rem !important;
    font-weight: 620 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
    justify-content: flex-start !important;
    text-align: left !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="settings-currency"] .mw-custom-select-option + .mw-custom-select-option {
    margin-top: 1px !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="settings-currency"] .mw-custom-select-option:hover:not(:disabled),
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="settings-currency"] .mw-custom-select-option:focus-visible,
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="settings-currency"] .mw-custom-select-option.is-selected {
    background: #d8e7fb !important;
    color: #153f78 !important;
    border: 0 !important;
    outline: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="settings-currency"] .mw-custom-select-option-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-scope="settings-currency"] .mw-custom-select-option-accessory {
    display: none !important;
  }
}


/* ========================================================================
   v218 — Revised Accounts spreadsheet
   Replaces the previous card-based Accounts editor with the Excel-inspired
   snapshot grid while preserving Money-Wise data, Supabase sync, Projection
   account links, undo, account groups, and Light/Dark Mode.
   ======================================================================== */

#networth {
  --mw-sheet-bg: #ffffff;
  --mw-sheet-alt: #f8fbff;
  --mw-sheet-header: #0a1a2e;
  --mw-sheet-line: #dbe4f0;
  --mw-sheet-line-dark: #cbd7e6;
  --mw-sheet-ink: #172033;
  --mw-sheet-muted: #74839a;
  --mw-sheet-input: #f8fbff;
  --mw-new-column-bg: linear-gradient(180deg, rgba(76, 93, 230, .13), rgba(115, 76, 220, .09));
  --mw-new-column-border: #7657e8;
}

.mw-accounts-page {
  display: grid;
  gap: 0;
  min-width: 0;
}

.mw-accounts-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 16px;
}

.mw-accounts-title h1 {
  margin: 2px 0 0;
  font-size: 1.62rem;
  line-height: 1;
  letter-spacing: -.035em;
}
.mw-accounts-title > p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .86rem;
}

.mw-accounts-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mw-accounts-view-control,
.mw-accounts-action-btn {
  min-height: 54px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.mw-accounts-view-control {
  width: 225px;
  padding: 7px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.mw-accounts-view-control > span {
  color: var(--muted-2);
  font-size: .66rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}
.mw-accounts-view-control select {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 4px 0 0;
  min-height: 0;
  font-size: .78rem;
  font-weight: 900;
}

.mw-accounts-action-btn {
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}
.mw-accounts-action-btn.primary,
.mw-save-snapshot-btn {
  border-color: #6d73ff;
  background: linear-gradient(135deg, #6d4be4, #1f67ed);
  color: #fff;
  box-shadow: 0 0 20px rgba(87,85,255,.22), inset 0 1px 0 rgba(255,255,255,.10);
}
.mw-accounts-action-btn:hover,
.mw-save-snapshot-btn:hover {
  transform: translateY(-1px);
}

.mw-accounts-filter-wrap { position: relative; }
.mw-accounts-filter-menu {
  position: absolute;
  z-index: 60;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15,23,42,.18);
}
.mw-accounts-filter-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 10px 12px;
  border-radius: 9px;
  font-weight: 800;
}
.mw-accounts-filter-menu button:hover,
.mw-accounts-filter-menu button.selected {
  background: var(--brand-soft);
  color: var(--brand);
}

.mw-account-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 10px;
}

.mw-account-metric {
  min-height: 88px;
  border: 2px solid rgba(37,99,235,.42);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255,255,255,.98), rgba(239,246,255,.84));
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: 0 14px 34px rgba(15,23,42,.07);
}
.mw-account-metric.liability,
.mw-account-metric.ratio {
  border-color: rgba(220,38,38,.42);
  background: linear-gradient(160deg, rgba(255,255,255,.98), rgba(254,242,242,.88));
}
.mw-account-metric.net {
  border-color: rgba(5,150,105,.42);
  background: linear-gradient(160deg, rgba(255,255,255,.98), rgba(236,253,245,.88));
}

.mw-account-metric-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: #0d5cc4;
  font-size: 1.22rem;
  font-weight: 900;
}
.mw-account-metric.liability .mw-account-metric-icon,
.mw-account-metric.ratio .mw-account-metric-icon { background: #b31c36; }
.mw-account-metric.net .mw-account-metric-icon { background: #087a59; }

.mw-account-metric-copy {
  flex: 1;
  min-width: 0;
}
.mw-account-metric-copy > span {
  display: block;
  color: var(--muted-2);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}
.mw-account-metric-copy strong {
  display: block;
  margin-top: 3px;
  font-size: 1.34rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
}
.mw-account-metric.asset .mw-account-metric-copy strong { color: #2563eb; }
.mw-account-metric.liability .mw-account-metric-copy strong,
.mw-account-metric.ratio .mw-account-metric-copy strong { color: #dc2648; }
.mw-account-metric.net .mw-account-metric-copy strong { color: #059669; }

.mw-account-metric-change {
  text-align: right;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.mw-account-metric-change span { display: block; }
.mw-account-metric-change span.positive { color: #059669; }
.mw-account-metric-change span.negative { color: #dc2648; }
.mw-account-metric-change small {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: .62rem;
  font-weight: 700;
}

.mw-accounts-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.mw-accounts-search-box {
  width: 380px;
  max-width: 100%;
  height: 56px;
  border-radius: 18px;
  border: 1px solid #7069ff;
  background: linear-gradient(180deg, #f7f9ff, #eef4ff);
  box-shadow: 0 0 0 3px rgba(60,115,255,.15), 0 0 24px rgba(116,79,240,.15), inset 0 0 0 1px rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
}
.mw-accounts-search-icon {
  color: #637592;
  font-size: 1.1rem;
}
.mw-accounts-search-box input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  outline: 0;
  padding: 0;
  color: var(--ink);
  font-size: .94rem;
  font-weight: 750;
}
.mw-accounts-search-box input::placeholder { color: #8090a6; }
.mw-accounts-search-clear {
  border: 0;
  background: transparent;
  color: #77889e;
  font-size: 1.35rem;
  padding: 0 4px;
}

.mw-add-account-group-btn {
  height: 56px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid #8e94ff;
  background: linear-gradient(135deg, #4f75f1 0%, #635de9 55%, #8b55f1 100%);
  color: #fff;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 10px 24px rgba(76,78,232,.18);
}

.mw-snapshot-instruction {
  width: 320px;
  max-width: 100%;
  margin-left: auto;
  border: 2px solid rgba(77,121,220,.66);
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(54,94,183,.96), rgba(72,80,170,.97) 48%, rgba(111,78,176,.96));
  color: #f7f9ff;
  box-shadow: 0 12px 30px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.08);
}
.mw-snapshot-instruction > span {
  display: block;
  margin-bottom: 6px;
  color: #dbe8ff;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.mw-snapshot-instruction p {
  margin: 0;
  font-size: .76rem;
  line-height: 1.42;
  font-weight: 650;
}
.mw-snapshot-instruction strong { color: #fff; }

.mw-accounts-sheet-wrap { position: relative; min-width: 0; }
.mw-accounts-sheet {
  border: 1px solid var(--mw-sheet-line-dark);
  border-radius: 16px;
  background: var(--mw-sheet-bg);
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(15,23,42,.10);
}
.mw-accounts-sheet-scroll {
  overflow: auto;
  max-height: 68vh;
  /* Allow vertical wheel/trackpad scrolling to continue to the Accounts page
     once the table reaches its own top or bottom. Keep horizontal containment. */
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  scrollbar-color: #8291a8 transparent;
}

.mw-accounts-sheet-header,
.mw-cat-row,
.mw-account-row,
.mw-total-row,
.mw-net-row {
  display: grid;
  width: max-content;
  min-width: 100%;
}

.mw-accounts-sheet-header {
  position: sticky;
  top: 0;
  z-index: 14;
  background: var(--mw-sheet-header);
  border-bottom: 1px solid #173454;
}
.mw-accounts-sheet-header > div,
.mw-cat-row > div,
.mw-account-row > div,
.mw-total-row > div,
.mw-net-row > div {
  border-right: 1px solid var(--mw-sheet-line);
}
.mw-accounts-sheet-header > div {
  min-height: 50px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: #acbdd3;
  font-size: .66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.mw-accounts-sheet-header > div:first-child {
  position: sticky;
  left: 0;
  z-index: 20;
  justify-content: flex-start;
  background: var(--mw-sheet-header);
  box-shadow: 2px 0 0 #173454;
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: .01em;
}

.mw-snapshot-date-btn {
  border: 0;
  background: transparent;
  color: #f5f8ff;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  font-style: italic;
  font-weight: 850;
  text-transform: none;
}
.mw-snapshot-date-btn:hover,
.mw-snapshot-date-btn:focus {
  color: #fff;
  text-decoration: underline;
  outline: none;
}

.mw-new-column {
  background: var(--mw-new-column-bg) !important;
  box-shadow: inset 1px 0 var(--mw-new-column-border), inset -1px 0 var(--mw-new-column-border);
}
.mw-new-column.head { border-top: 1px solid #8d72ff; justify-content: center !important; }
.mw-new-account-values-badge {
  width: 100%;
  max-width: 110px;
  min-height: 38px;
  padding: 5px 10px 6px;
  border: 1px solid #927dff;
  border-radius: 18px;
  background: #6044e6;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
  line-height: 1;
  letter-spacing: .06em;
}
.mw-new-account-values-badge span {
  display: block;
  white-space: nowrap;
  color: #fff;
}
.mw-new-account-values-badge span:first-child { font-size: 7.5px; }
.mw-new-account-values-badge span:last-child { font-size: 8px; }

.mw-category-block { display: block; }
.mw-cat-row {
  min-height: 42px;
  color: #fff;
  background: linear-gradient(90deg, #0e56b7, #0b3f8e);
  font-size: 15px;
  font-weight: 850;
}
.mw-cat-row.funds { background: linear-gradient(90deg, #0b7d82, #0a666b); }
.mw-cat-row.noncurrent { background: linear-gradient(90deg, #905903, #734404); }
.mw-cat-row.liability { background: linear-gradient(90deg, #a01732, #7d1227); }
.mw-cat-row[style*="--mw-category-color"] {
  background: linear-gradient(90deg, var(--mw-category-color), color-mix(in srgb, var(--mw-category-color) 80%, #000));
}
.mw-cat-row > div {
  min-height: 42px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
}
.mw-cat-row > div:first-child {
  position: sticky;
  left: 0;
  z-index: 11;
  background: inherit;
  box-shadow: 2px 0 0 rgba(255,255,255,.10);
}

.mw-cat-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.mw-category-reorder-handle {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.34);
  background: rgba(5,18,39,.20);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: grab;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.mw-category-reorder-handle:hover {
  background: rgba(5,18,39,.34);
  border-color: rgba(255,255,255,.58);
}
.mw-category-reorder-handle:active { cursor: grabbing; }
.mw-category-reorder-handle .mw-handle-dots i { background: #f3f7ff; }
.mw-cat-row.category-dragging { opacity: .56; }
.mw-cat-row.category-drag-over {
  box-shadow: inset 0 4px 0 #dbe7ff, 0 -3px 12px rgba(59,130,246,.30);
}
.mw-cat-row.category-drop-after {
  box-shadow: inset 0 -4px 0 #dbe7ff, 0 3px 12px rgba(59,130,246,.30);
}
.mw-cat-collapse {
  width: 24px;
  height: 28px;
  flex: 0 0 24px;
  border: 0;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
}
.mw-cat-arrow {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  transition: transform .18s ease;
  transform-origin: 50% 50%;
}
.mw-cat-arrow svg { width: 16px; height: 16px; overflow: visible; display: block; }
.mw-cat-arrow polyline {
  fill: none;
  stroke: #e7eef9;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mw-cat-row.collapsed .mw-cat-arrow { transform: rotate(-90deg); }

.mw-category-title-input {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 1px solid transparent !important;
  border-radius: 7px;
  box-shadow: none !important;
  background: transparent !important;
  color: #fff !important;
  padding: 3px 7px !important;
  font-size: 15px !important;
  line-height: 1;
  font-weight: 850 !important;
}
.mw-category-title-input:hover { border-color: rgba(255,255,255,.28) !important; }
.mw-category-title-input:focus {
  border-color: rgba(255,255,255,.72) !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,.14) !important;
}
.mw-category-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.mw-add-account-btn,
.mw-category-delete-btn {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 0;
}
.mw-add-account-btn {
  border: 1px solid rgba(214,225,245,.62);
  background: linear-gradient(180deg, #fff, #edf3ff);
  color: #223756;
  font-size: 17px;
  line-height: 1;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 4px 12px rgba(10,25,50,.16);
}
.mw-category-delete-btn {
  border: 1px solid rgba(255,255,255,.32);
  background: rgba(7,20,42,.22);
  color: #fff;
}
.mw-category-delete-btn svg { width: 14px; height: 14px; fill: currentColor; }
.mw-category-delete-btn:hover { background: rgba(125,13,37,.48); }

.mw-account-row {
  background: var(--mw-sheet-bg);
  color: var(--mw-sheet-ink);
}
.mw-account-row:nth-child(odd) { background: var(--mw-sheet-alt); }
.mw-account-row.search-dim { opacity: .38; }
.mw-account-row.search-match {
  background: linear-gradient(90deg, rgba(42,87,217,.16), rgba(90,70,190,.13));
  box-shadow: inset 0 0 0 2px rgba(91,102,255,.26);
}
.mw-account-row.archived { opacity: .72; }
.mw-account-row.dragging { opacity: .45; }
.mw-account-row.drag-over { box-shadow: inset 0 3px 0 #5f6cff; }
.mw-account-row.drop-after { box-shadow: inset 0 -3px 0 #5f6cff; }
.mw-category-block.list-drag-over { box-shadow: inset 0 0 0 2px rgba(95,108,255,.48); }

.mw-account-row > div,
.mw-total-row > div,
.mw-net-row > div {
  min-height: 42px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--mw-sheet-line);
  display: flex;
  align-items: center;
}
.mw-account-row > div:first-child,
.mw-total-row > div:first-child,
.mw-net-row > div:first-child {
  position: sticky;
  left: 0;
  z-index: 7;
  background: inherit;
  box-shadow: 2px 0 0 var(--mw-sheet-line);
}
.mw-total-row > div:first-child,
.mw-net-row > div:first-child { z-index: 9; }

.mw-account-label {
  gap: 8px;
  min-width: 0;
}
.mw-reorder-handle {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 8px;
  border: 1px solid #a9b8cc;
  background: linear-gradient(180deg, #f4f7fb, #e8eef6);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: grab;
}
.mw-reorder-handle:active { cursor: grabbing; }
.mw-reorder-handle.disabled { cursor: default; opacity: .46; }
.mw-handle-dots {
  display: grid;
  grid-template-columns: repeat(2, 3px);
  grid-auto-rows: 3px;
  gap: 2px;
}
.mw-handle-dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #55657b;
}

.mw-account-link {
  min-width: 0;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
}
.mw-account-link > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--mw-sheet-ink);
  font-size: 14px;
  font-style: italic;
  font-weight: 850;
}
.mw-account-link:hover > span { text-decoration: underline; }
.mw-account-link small {
  flex: 0 0 auto;
  border: 1px solid #c9d3e0;
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--mw-sheet-muted);
  font-size: .58rem;
  font-style: normal;
  font-weight: 850;
}

.mw-value-cell { justify-content: flex-end; }
.mw-account-value-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  background: rgba(242,246,252,.82) !important;
  color: var(--mw-sheet-ink) !important;
  box-shadow: none !important;
  outline: none;
  padding: 7px 10px !important;
  text-align: right;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.mw-account-value-input:hover:not(:disabled) { border-color: #aab8cc !important; }
.mw-account-value-input:focus:not(:disabled) {
  border-color: #6868ff !important;
  box-shadow: 0 0 0 2px rgba(102,91,255,.15) !important;
}
.mw-account-value-input:disabled {
  opacity: .48;
  cursor: default;
}
.mw-value-cell.mw-new-column .mw-account-value-input {
  background: rgba(245,242,255,.80) !important;
}

.mw-total-row {
  color: #fff;
  background: linear-gradient(90deg, rgba(11,75,154,.96), rgba(16,48,90,.96));
  font-size: 14px;
  font-weight: 850;
}
.mw-total-row.funds { background: linear-gradient(90deg, rgba(4,111,117,.96), rgba(6,60,70,.96)); }
.mw-total-row.noncurrent { background: linear-gradient(90deg, rgba(146,82,6,.96), rgba(85,48,8,.96)); }
.mw-total-row.liability { background: linear-gradient(90deg, rgba(141,16,40,.96), rgba(81,14,29,.96)); }
.mw-total-row > div { justify-content: flex-end; border-bottom-color: rgba(255,255,255,.12); }
.mw-total-row > div:first-child { justify-content: flex-start; }

.mw-net-row {
  color: #0b8b65;
  background: linear-gradient(90deg, #e7f8f1, #eaf7f6);
  font-size: 14px;
  font-weight: 900;
}
.mw-net-row > div {
  min-height: 48px;
  justify-content: flex-end;
}
.mw-net-row > div:first-child { justify-content: flex-start; }

.mw-empty-category-row {
  min-height: 42px;
  padding: 10px 14px;
  color: var(--mw-sheet-muted);
  background: var(--mw-sheet-bg);
  border-bottom: 1px solid var(--mw-sheet-line);
  font-size: .8rem;
  font-style: italic;
}

.mw-accounts-sheet-footer {
  position: relative;
  min-height: 74px;
  overflow: hidden;
  padding: 14px 0;
  border-top: 1px solid var(--mw-sheet-line-dark);
  background: #f8fbff;
}
.mw-save-snapshot-btn {
  position: absolute;
  top: 14px;
  left: 0;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 900;
  white-space: nowrap;
}

/* Revised Accounts edit dialogs */
.mw-accounts-edit-dialog {
  width: min(460px, calc(100vw - 28px));
  max-width: none;
  border: 0;
  border-radius: 22px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}
.mw-accounts-edit-dialog::backdrop {
  background: rgba(4,12,28,.62);
  backdrop-filter: blur(7px);
}
.mw-accounts-edit-dialog-card {
  border: 1px solid #cbd7e7;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 85px rgba(15,23,42,.26);
  padding: 20px 22px;
}
.mw-accounts-edit-dialog-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fee2e8, #fecdd8);
  color: #be2444;
  font-size: 34px;
  font-weight: 900;
}
.mw-accounts-edit-dialog h3 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 1.1rem;
}
.mw-accounts-edit-dialog p {
  margin: 0 0 16px;
  color: var(--muted);
  text-align: center;
  font-size: .78rem;
  line-height: 1.42;
}
.mw-accounts-edit-dialog label {
  display: grid;
  gap: 6px;
  margin-bottom: 13px;
}
.mw-accounts-edit-dialog label > span {
  color: var(--muted-2);
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mw-accounts-edit-dialog input,
.mw-accounts-edit-dialog select {
  min-height: 42px;
  border: 1px solid #b7c5d9;
  border-radius: 12px;
  background: #f8fbff;
  color: #182235;
  padding: 0 12px;
  font-size: .86rem;
  font-weight: 700;
}
.mw-accounts-edit-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 6px;
}
.mw-dialog-btn {
  min-height: 44px;
  border: 1px solid #b9c7da;
  border-radius: 14px;
  background: #f7faff;
  color: #27364b;
  font-weight: 850;
}
.mw-dialog-btn.primary {
  border-color: #5575ed;
  background: linear-gradient(135deg, #2a63ec, #4a3ee8);
  color: #fff;
}
.mw-dialog-btn.remove {
  grid-column: 1 / -1;
  border-color: #e498a8;
  background: linear-gradient(180deg, #fff0f3, #ffe4e8);
  color: #bd2747;
}

/* Dark Mode mirrors the supplied revised prototype. */
body.night-mode #networth {
  --mw-sheet-bg: #071526;
  --mw-sheet-alt: #08182b;
  --mw-sheet-header: #0a1a2e;
  --mw-sheet-line: #102d49;
  --mw-sheet-line-dark: #173653;
  --mw-sheet-ink: #f1f6ff;
  --mw-sheet-muted: #8da2bf;
  --mw-sheet-input: rgba(2,11,27,.52);
  --mw-new-column-bg: linear-gradient(180deg, rgba(39,62,151,.50), rgba(37,23,94,.32));
  --mw-new-column-border: #6645ff;
}

body.night-mode .mw-accounts-view-control,
body.night-mode .mw-accounts-action-btn {
  border-color: #203a5c;
  background: #08172a;
  color: #eef4ff;
}
body.night-mode .mw-accounts-view-control select { color: #eef4ff; }
body.night-mode .mw-accounts-filter-menu {
  border-color: #263f60;
  background: #0b1b31;
}
body.night-mode .mw-accounts-filter-menu button { color: #dce7f6; }
body.night-mode .mw-accounts-filter-menu button:hover,
body.night-mode .mw-accounts-filter-menu button.selected {
  background: #142d50;
  color: #fff;
}

body.night-mode .mw-account-metric {
  border-color: #1d5aac;
  background: linear-gradient(160deg, #0a1c31, #081525);
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}
body.night-mode .mw-account-metric.liability,
body.night-mode .mw-account-metric.ratio {
  border-color: #7b2436;
  background: linear-gradient(160deg, #24101a, #10111b);
}
body.night-mode .mw-account-metric.net {
  border-color: #126d52;
  background: linear-gradient(160deg, #13211b, #10161b);
}
body.night-mode .mw-account-metric.asset .mw-account-metric-copy strong { color: #4a92ff; }
body.night-mode .mw-account-metric.liability .mw-account-metric-copy strong,
body.night-mode .mw-account-metric.ratio .mw-account-metric-copy strong { color: #ff5a74; }
body.night-mode .mw-account-metric.net .mw-account-metric-copy strong { color: #36d8a4; }

body.night-mode .mw-accounts-search-box {
  border-color: #6e67ff;
  background: linear-gradient(180deg, #102345, #0b1b34);
  box-shadow: 0 0 0 3px rgba(60,115,255,.28), 0 0 26px rgba(116,79,240,.30), inset 0 0 0 1px rgba(255,255,255,.04);
}
body.night-mode .mw-accounts-search-box input { color: #eef5ff !important; }
body.night-mode .mw-accounts-search-box input::placeholder { color: #a8b6ca; }
body.night-mode .mw-accounts-search-icon,
body.night-mode .mw-accounts-search-clear { color: #b7c8df; }

body.night-mode .mw-accounts-sheet {
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
body.night-mode .mw-account-row,
body.night-mode .mw-account-row:nth-child(odd) {
  color: var(--mw-sheet-ink);
}
body.night-mode .mw-reorder-handle {
  border-color: #3d5477;
  background: linear-gradient(180deg, #1a2c47, #17253d);
}
body.night-mode .mw-handle-dots i { background: #d3deef; }
body.night-mode .mw-account-link > span { color: #f2f7ff; }
body.night-mode .mw-account-link small {
  border-color: #415574;
  color: #9cb0cb;
}
body.night-mode .mw-account-value-input {
  border-color: transparent !important;
  background: rgba(2,11,27,.52) !important;
  color: #fff !important;
}
body.night-mode .mw-account-value-input:hover:not(:disabled) { border-color: #3d5276 !important; }
body.night-mode .mw-value-cell.mw-new-column .mw-account-value-input {
  background: rgba(14,18,54,.58) !important;
}
body.night-mode .mw-net-row {
  color: #42dfa8;
  background: linear-gradient(90deg, #07392f, #092a2a);
}
body.night-mode .mw-empty-category-row {
  background: #071526;
  color: #8da2bf;
}
body.night-mode .mw-accounts-sheet-footer {
  border-color: #173653;
  background: #071526;
}

body.night-mode .mw-accounts-edit-dialog-card {
  border-color: rgba(80,111,165,.65);
  background: linear-gradient(160deg, rgba(19,36,66,.99), rgba(8,23,44,.995));
  box-shadow: 0 20px 70px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.04);
}
body.night-mode .mw-accounts-edit-dialog { color: #eef4ff; }
body.night-mode .mw-accounts-edit-dialog p { color: #b6c3d6; }
body.night-mode .mw-accounts-edit-dialog label > span { color: #94a8c6; }
body.night-mode .mw-accounts-edit-dialog input,
body.night-mode .mw-accounts-edit-dialog select {
  border-color: #345173;
  background: #0b1b31;
  color: #eef4ff;
  color-scheme: dark;
}
body.night-mode .mw-dialog-btn {
  border-color: #2d4f8f;
  background: linear-gradient(180deg, #1b315e, #162a4f);
  color: #fff;
}
body.night-mode .mw-dialog-btn.remove {
  border-color: #a94d63;
  background: linear-gradient(180deg, rgba(117,33,51,.95), rgba(91,27,42,.95));
  color: #ff9aa8;
}

@media (max-width: 1200px) {
  .mw-account-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .mw-accounts-topbar { flex-direction: column; }
  .mw-accounts-actions { width: 100%; justify-content: flex-start; }
  .mw-accounts-view-control { width: min(100%, 260px); }
  .mw-accounts-search-box { width: 100%; }
  .mw-snapshot-instruction { width: 100%; margin-left: 0; }
  .mw-accounts-toolbar { align-items: stretch; }
  .mw-account-metrics { grid-template-columns: 1fr; }
  .mw-accounts-sheet-scroll { max-height: 72vh; }
}

@media (max-width: 560px) {
  .mw-accounts-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .mw-accounts-view-control { grid-column: 1 / -1; width: 100%; }
  .mw-accounts-action-btn { justify-content: center; padding-inline: 10px; }
  .mw-add-account-group-btn { width: 100%; justify-content: center; }
  .mw-account-metric { min-height: 80px; padding: 12px; }
  .mw-account-metric-icon { width: 40px; height: 40px; flex-basis: 40px; }
  .mw-account-metric-copy strong { font-size: 1.18rem; }
  .mw-accounts-sheet { border-radius: 13px; }
  .mw-accounts-edit-dialog-actions { grid-template-columns: 1fr; }
  .mw-dialog-btn.remove { grid-column: auto; }
}


/* v247: keep the Settings birthday date text white in Dark Mode */
body.night-mode #settingsBirthday,
body.night-mode #settingsBirthday::-webkit-datetime-edit,
body.night-mode #settingsBirthday::-webkit-datetime-edit-fields-wrapper,
body.night-mode #settingsBirthday::-webkit-datetime-edit-text,
body.night-mode #settingsBirthday::-webkit-datetime-edit-month-field,
body.night-mode #settingsBirthday::-webkit-datetime-edit-day-field,
body.night-mode #settingsBirthday::-webkit-datetime-edit-year-field {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}


/* v248: keep Accounts dropdowns inside the active dialog top layer so Safari/Chrome
   can display and interact with them instead of placing them behind the modal. */
.mw-custom-select-menu-dialog {
  position: absolute !important;
  z-index: 2147483000 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
#categoryDialog,
#accountDialog,
#accountsEditAccountDialog {
  overflow: visible !important;
}
#categoryDialog form,
#accountDialog form,
#accountsEditAccountDialog .mw-accounts-edit-dialog-card {
  overflow: visible !important;
}
.account-type-suggestions[data-anchor-mode="dialog"] {
  position: absolute !important;
  z-index: 2147483000 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}


/* v250 projection asset return assumptions info button */
.context-info-heading-row h4 {
  margin: 0;
}
.projection-info-heading-row {
  margin-top: 2px;
}


/* v251 Projection regression repair: keep dark controls readable while the
   custom steppers/select trigger initialize, and preserve the established
   Individual account projection dropdown styling. */
body.night-mode #projection input[type="number"] {
  color-scheme: dark;
}
body.night-mode #projection input[type="number"]::-webkit-inner-spin-button,
body.night-mode #projection input[type="number"]::-webkit-outer-spin-button {
  filter: invert(1) brightness(1.8) contrast(1.1);
}
@media (min-width: 768px) {
  body.night-mode #projection #projectionAccountSelect + .mw-select-trigger {
    width: 100% !important;
    min-height: 46px !important;
    padding: 8px 12px !important;
    border: 1px solid #405574 !important;
    border-radius: 12px !important;
    background: #111a27 !important;
    color: #ffffff !important;
    box-shadow: none !important;
  }
  body.night-mode #projection #projectionAccountSelect + .mw-select-trigger:hover,
  body.night-mode #projection #projectionAccountSelect + .mw-select-trigger:focus-visible,
  body.night-mode #projection #projectionAccountSelect + .mw-select-trigger.is-open {
    border-color: #55709a !important;
    background: #142033 !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.10) !important;
  }
  body.night-mode #projection #projectionAccountSelect + .mw-select-trigger .mw-select-trigger-label {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
  }
}


/* v253: fixed Projection info overlay avoids Safari native-dialog scroll jumps */
.projection-info-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, .68);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  overflow: auto;
}
.projection-info-overlay[hidden] {
  display: none !important;
}
.projection-info-dialog-card {
  position: relative;
  display: block;
  width: min(620px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  margin: 0;
  overflow: auto;
}


/* v254: keep Projection info card in the actual viewport in Safari */
.projection-info-overlay > .projection-info-dialog-card {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 1;
}

/* v255 Mission Statement footer control + modal */
.legal-footer .legal-footer-action {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 850;
  line-height: inherit;
  text-decoration: none;
  cursor: pointer;
}
.legal-footer .legal-footer-action:hover,
.legal-footer .legal-footer-action:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}
.mission-statement-dialog {
  width: min(640px, calc(100vw - 36px));
}
.mission-statement-dialog .mission-statement-copy {
  font-size: 1.02rem;
  line-height: 1.7;
}

/* v258: bring the color-filled Dark Mode summary-card treatment into Light Mode.
   Keep the light palette readable, but give each key metric card a visible tinted
   interior, accent-colored value, and soft color glow instead of a mostly white fill. */

/* Home summary: use the same separated-card composition as desktop Dark Mode. */
@media (min-width: 761px) {
  body:not(.night-mode) #dashboard .hero-summary {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    gap: 14px !important;
    overflow: visible !important;
  }
  body:not(.night-mode) #dashboard .hero-summary .summary-tile {
    position: relative !important;
    overflow: hidden !important;
    min-height: 122px !important;
    border: 1.5px solid rgba(59,130,246,.72) !important;
    border-top-width: 7px !important;
    border-radius: 20px !important;
    box-shadow: 0 16px 34px rgba(31,41,55,.10), inset 0 1px 0 rgba(255,255,255,.90) !important;
  }
  body:not(.night-mode) #dashboard .hero-summary .summary-tile + .summary-tile {
    border-left-width: 1.5px !important;
  }
  body:not(.night-mode) #dashboard .hero-summary .summary-tile::before {
    content: none !important;
    display: none !important;
  }
}

body:not(.night-mode) #dashboard .hero-summary .asset-tile {
  border-color: #3b82f6 !important;
  background: radial-gradient(circle at top right, rgba(59,130,246,.26), transparent 62%), linear-gradient(135deg, rgba(219,234,254,.96), rgba(239,246,255,.92)) !important;
  box-shadow: 0 16px 34px rgba(59,130,246,.16), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #dashboard .hero-summary .asset-tile strong { color: #1d4ed8 !important; }

body:not(.night-mode) #dashboard .hero-summary .liability-tile {
  border-color: #ef4444 !important;
  background: radial-gradient(circle at top right, rgba(239,68,68,.23), transparent 62%), linear-gradient(135deg, rgba(254,226,226,.96), rgba(255,241,242,.93)) !important;
  box-shadow: 0 16px 34px rgba(239,68,68,.14), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #dashboard .hero-summary .liability-tile strong { color: #be123c !important; }

body:not(.night-mode) #dashboard .hero-summary .change-tile.change-positive {
  border-color: #14b8a6 !important;
  background: radial-gradient(circle at top right, rgba(20,184,166,.24), transparent 62%), linear-gradient(135deg, rgba(204,251,241,.96), rgba(240,253,250,.93)) !important;
  box-shadow: 0 16px 34px rgba(20,184,166,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #dashboard .hero-summary .change-tile.change-positive strong { color: #047857 !important; }

body:not(.night-mode) #dashboard .hero-summary .change-tile.change-negative {
  border-color: #ef4444 !important;
  background: radial-gradient(circle at top right, rgba(239,68,68,.23), transparent 62%), linear-gradient(135deg, rgba(254,226,226,.96), rgba(255,241,242,.93)) !important;
  box-shadow: 0 16px 34px rgba(239,68,68,.14), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #dashboard .hero-summary .change-tile.change-negative strong { color: #be123c !important; }

body:not(.night-mode) #dashboard .hero-summary .change-tile.change-neutral {
  border-color: #4f8cff !important;
  background: radial-gradient(circle at top right, rgba(79,140,255,.23), transparent 62%), linear-gradient(135deg, rgba(224,235,255,.97), rgba(242,247,255,.94)) !important;
  box-shadow: 0 16px 34px rgba(79,140,255,.14), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #dashboard .hero-summary .change-tile.change-neutral strong { color: #2563eb !important; }

/* Accounts summary cards — blue / red / green / red. */
body:not(.night-mode) #networth .mw-account-metric {
  border-width: 2px !important;
  border-style: solid !important;
  box-shadow: 0 16px 34px rgba(31,41,55,.09), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #networth .mw-account-metric.asset {
  border-color: #3b82f6 !important;
  background: radial-gradient(circle at top right, rgba(59,130,246,.25), transparent 62%), linear-gradient(145deg, rgba(219,234,254,.96), rgba(239,246,255,.92)) !important;
  box-shadow: 0 16px 34px rgba(59,130,246,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #networth .mw-account-metric.liability,
body:not(.night-mode) #networth .mw-account-metric.ratio {
  border-color: #ef4444 !important;
  background: radial-gradient(circle at top right, rgba(239,68,68,.21), transparent 62%), linear-gradient(145deg, rgba(254,226,226,.96), rgba(255,241,242,.93)) !important;
  box-shadow: 0 16px 34px rgba(239,68,68,.13), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #networth .mw-account-metric.net {
  border-color: #10b981 !important;
  background: radial-gradient(circle at top right, rgba(16,185,129,.22), transparent 62%), linear-gradient(145deg, rgba(209,250,229,.96), rgba(240,253,244,.93)) !important;
  box-shadow: 0 16px 34px rgba(16,185,129,.14), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #networth .mw-account-metric.asset .mw-account-metric-copy strong { color: #1d4ed8 !important; }
body:not(.night-mode) #networth .mw-account-metric.liability .mw-account-metric-copy strong,
body:not(.night-mode) #networth .mw-account-metric.ratio .mw-account-metric-copy strong { color: #be123c !important; }
body:not(.night-mode) #networth .mw-account-metric.net .mw-account-metric-copy strong { color: #047857 !important; }

/* Shared filled treatment for the color-coded metric grids. */
body:not(.night-mode) #projection #projectionCards.projection-summary-cards > div,
body:not(.night-mode) #projection .account-projection-cards > div,
body:not(.night-mode) #percentile #percentileSummaryCards > div,
body:not(.night-mode) #budget > .summary-grid > .budget-summary-card,
body:not(.night-mode) #car .car-summary-cards > div {
  position: relative !important;
  overflow: hidden !important;
  border-style: solid !important;
  border-width: 2px !important;
  border-top-width: 7px !important;
  border-radius: 20px !important;
  box-shadow: 0 16px 34px rgba(31,41,55,.09), inset 0 1px 0 rgba(255,255,255,.92) !important;
}

/* Projection milestones — blue / purple / teal / red / blue. */
body:not(.night-mode) #projection #projectionCards.projection-summary-cards > div:nth-child(1) {
  border-color: #3b82f6 !important;
  background: radial-gradient(circle at top right, rgba(59,130,246,.26), transparent 62%), linear-gradient(135deg, rgba(219,234,254,.97), rgba(239,246,255,.93)) !important;
  box-shadow: 0 17px 36px rgba(59,130,246,.16), inset 0 1px 0 rgba(255,255,255,.92) !important;
  transform: none !important;
}
body:not(.night-mode) #projection #projectionCards.projection-summary-cards > div:nth-child(2) {
  border-color: #8b5cf6 !important;
  background: radial-gradient(circle at top right, rgba(139,92,246,.23), transparent 62%), linear-gradient(135deg, rgba(237,233,254,.97), rgba(248,245,255,.93)) !important;
  box-shadow: 0 17px 36px rgba(139,92,246,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #projection #projectionCards.projection-summary-cards > div:nth-child(3) {
  border-color: #14b8a6 !important;
  background: radial-gradient(circle at top right, rgba(20,184,166,.23), transparent 62%), linear-gradient(135deg, rgba(204,251,241,.97), rgba(240,253,250,.93)) !important;
  box-shadow: 0 17px 36px rgba(20,184,166,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #projection #projectionCards.projection-summary-cards > div:nth-child(4) {
  border-color: #ef4444 !important;
  background: radial-gradient(circle at top right, rgba(239,68,68,.22), transparent 62%), linear-gradient(135deg, rgba(254,226,226,.97), rgba(255,241,242,.93)) !important;
  box-shadow: 0 17px 36px rgba(239,68,68,.14), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #projection #projectionCards.projection-summary-cards > div:nth-child(5) {
  border-color: #4f8cff !important;
  background: radial-gradient(circle at top right, rgba(79,140,255,.23), transparent 62%), linear-gradient(135deg, rgba(224,235,255,.97), rgba(242,247,255,.94)) !important;
  box-shadow: 0 17px 36px rgba(79,140,255,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #projection #projectionCards.projection-summary-cards > div:nth-child(1) strong,
body:not(.night-mode) #projection #projectionCards.projection-summary-cards > div:nth-child(5) strong { color: #1d4ed8 !important; }
body:not(.night-mode) #projection #projectionCards.projection-summary-cards > div:nth-child(2) strong { color: #6d28d9 !important; }
body:not(.night-mode) #projection #projectionCards.projection-summary-cards > div:nth-child(3) strong { color: #0f766e !important; }
body:not(.night-mode) #projection #projectionCards.projection-summary-cards > div:nth-child(4) strong { color: #be123c !important; }

/* Individual account projection — blue / blue / amber / purple / pink. */
body:not(.night-mode) #projection .account-projection-cards > div:nth-child(1),
body:not(.night-mode) #projection .account-projection-cards > div:nth-child(2) {
  border-color: #3b82f6 !important;
  background: radial-gradient(circle at top right, rgba(59,130,246,.24), transparent 62%), linear-gradient(135deg, rgba(219,234,254,.97), rgba(239,246,255,.93)) !important;
  box-shadow: 0 16px 34px rgba(59,130,246,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #projection .account-projection-cards > div:nth-child(3) {
  border-color: #f59e0b !important;
  background: radial-gradient(circle at top right, rgba(245,158,11,.24), transparent 62%), linear-gradient(135deg, rgba(254,243,199,.97), rgba(255,251,235,.94)) !important;
  box-shadow: 0 16px 34px rgba(245,158,11,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #projection .account-projection-cards > div:nth-child(4) {
  border-color: #8b5cf6 !important;
  background: radial-gradient(circle at top right, rgba(139,92,246,.23), transparent 62%), linear-gradient(135deg, rgba(237,233,254,.97), rgba(248,245,255,.93)) !important;
  box-shadow: 0 16px 34px rgba(139,92,246,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #projection .account-projection-cards > div:nth-child(5) {
  border-color: #ec4899 !important;
  background: radial-gradient(circle at top right, rgba(236,72,153,.22), transparent 62%), linear-gradient(135deg, rgba(252,231,243,.97), rgba(253,242,248,.94)) !important;
  box-shadow: 0 16px 34px rgba(236,72,153,.14), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #projection .account-projection-cards > div:nth-child(1) strong,
body:not(.night-mode) #projection .account-projection-cards > div:nth-child(2) strong { color: #1d4ed8 !important; }
body:not(.night-mode) #projection .account-projection-cards > div:nth-child(3) strong { color: #b45309 !important; }
body:not(.night-mode) #projection .account-projection-cards > div:nth-child(4) strong { color: #6d28d9 !important; }
body:not(.night-mode) #projection .account-projection-cards > div:nth-child(5) strong { color: #be185d !important; }

/* Percentile summary — blue / teal / amber / purple. */
body:not(.night-mode) #percentile #percentileSummaryCards > div:nth-child(1) {
  border-color: #3b82f6 !important;
  background: radial-gradient(circle at top right, rgba(59,130,246,.24), transparent 62%), linear-gradient(135deg, rgba(219,234,254,.97), rgba(239,246,255,.93)) !important;
  box-shadow: 0 16px 34px rgba(59,130,246,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #percentile #percentileSummaryCards > div:nth-child(2) {
  border-color: #14b8a6 !important;
  background: radial-gradient(circle at top right, rgba(20,184,166,.23), transparent 62%), linear-gradient(135deg, rgba(204,251,241,.97), rgba(240,253,250,.93)) !important;
  box-shadow: 0 16px 34px rgba(20,184,166,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #percentile #percentileSummaryCards > div:nth-child(3) {
  border-color: #f59e0b !important;
  background: radial-gradient(circle at top right, rgba(245,158,11,.24), transparent 62%), linear-gradient(135deg, rgba(254,243,199,.97), rgba(255,251,235,.94)) !important;
  box-shadow: 0 16px 34px rgba(245,158,11,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #percentile #percentileSummaryCards > div:nth-child(4) {
  border-color: #8b5cf6 !important;
  background: radial-gradient(circle at top right, rgba(139,92,246,.23), transparent 62%), linear-gradient(135deg, rgba(237,233,254,.97), rgba(248,245,255,.93)) !important;
  box-shadow: 0 16px 34px rgba(139,92,246,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #percentile #percentileSummaryCards > div:nth-child(1) strong { color: #1d4ed8 !important; }
body:not(.night-mode) #percentile #percentileSummaryCards > div:nth-child(2) strong { color: #0f766e !important; }
body:not(.night-mode) #percentile #percentileSummaryCards > div:nth-child(3) strong { color: #b45309 !important; }
body:not(.night-mode) #percentile #percentileSummaryCards > div:nth-child(4) strong { color: #6d28d9 !important; }

/* Percentile estimated-rank card gets a light blue/teal interior instead of plain white. */
body:not(.night-mode) #percentile .percentile-result .result-card {
  background: radial-gradient(circle at top right, rgba(20,184,166,.19), transparent 34%), linear-gradient(135deg, rgba(219,234,254,.98) 0%, rgba(239,246,255,.96) 52%, rgba(224,250,247,.94) 100%) !important;
  border: 1.5px solid rgba(59,130,246,.56) !important;
  border-top: 5px solid #3b82f6 !important;
  border-radius: 22px !important;
  box-shadow: 0 18px 40px rgba(59,130,246,.13), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #percentile .percentile-result .result-card strong { color: #0f1f3d !important; }

/* Budget summary — green / red / amber / blue. */
body:not(.night-mode) #budget > .summary-grid > .budget-summary-card:nth-child(1) {
  border-color: #10b981 !important;
  background: radial-gradient(circle at top right, rgba(16,185,129,.24), transparent 62%), linear-gradient(135deg, rgba(209,250,229,.97), rgba(240,253,244,.94)) !important;
  box-shadow: 0 16px 34px rgba(16,185,129,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #budget > .summary-grid > .budget-summary-card:nth-child(2) {
  border-color: #ef4444 !important;
  background: radial-gradient(circle at top right, rgba(239,68,68,.22), transparent 62%), linear-gradient(135deg, rgba(254,226,226,.97), rgba(255,241,242,.94)) !important;
  box-shadow: 0 16px 34px rgba(239,68,68,.14), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #budget > .summary-grid > .budget-summary-card:nth-child(3) {
  border-color: #f59e0b !important;
  background: radial-gradient(circle at top right, rgba(245,158,11,.24), transparent 62%), linear-gradient(135deg, rgba(254,243,199,.97), rgba(255,251,235,.94)) !important;
  box-shadow: 0 16px 34px rgba(245,158,11,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #budget > .summary-grid > .budget-summary-card:nth-child(4) {
  border-color: #3b82f6 !important;
  background: radial-gradient(circle at top right, rgba(59,130,246,.24), transparent 62%), linear-gradient(135deg, rgba(219,234,254,.97), rgba(239,246,255,.94)) !important;
  box-shadow: 0 16px 34px rgba(59,130,246,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #budget > .summary-grid > .budget-summary-card:nth-child(1) .metric-value { color: #047857 !important; }
body:not(.night-mode) #budget > .summary-grid > .budget-summary-card:nth-child(2) .metric-value { color: #be123c !important; }
body:not(.night-mode) #budget > .summary-grid > .budget-summary-card:nth-child(3) .metric-value { color: #b45309 !important; }
body:not(.night-mode) #budget > .summary-grid > .budget-summary-card:nth-child(4) .metric-value { color: #1d4ed8 !important; }

/* Car affordability summary — blue / teal / amber. */
body:not(.night-mode) #car .car-summary-cards > div:nth-child(1) {
  border-color: #3b82f6 !important;
  background: radial-gradient(circle at top right, rgba(59,130,246,.24), transparent 62%), linear-gradient(135deg, rgba(219,234,254,.97), rgba(239,246,255,.94)) !important;
  box-shadow: 0 16px 34px rgba(59,130,246,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #car .car-summary-cards > div:nth-child(2) {
  border-color: #14b8a6 !important;
  background: radial-gradient(circle at top right, rgba(20,184,166,.23), transparent 62%), linear-gradient(135deg, rgba(204,251,241,.97), rgba(240,253,250,.94)) !important;
  box-shadow: 0 16px 34px rgba(20,184,166,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #car .car-summary-cards > div:nth-child(3) {
  border-color: #f59e0b !important;
  background: radial-gradient(circle at top right, rgba(245,158,11,.24), transparent 62%), linear-gradient(135deg, rgba(254,243,199,.97), rgba(255,251,235,.94)) !important;
  box-shadow: 0 16px 34px rgba(245,158,11,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #car .car-summary-cards > div:nth-child(1) strong { color: #1d4ed8 !important; }
body:not(.night-mode) #car .car-summary-cards > div:nth-child(2) strong { color: #0f766e !important; }
body:not(.night-mode) #car .car-summary-cards > div:nth-child(3) strong { color: #b45309 !important; }

/* Keep secondary labels readable over the stronger Light Mode fills. */
body:not(.night-mode) #dashboard .hero-summary .summary-tile .metric-label,
body:not(.night-mode) #projection #projectionCards.projection-summary-cards > div span,
body:not(.night-mode) #projection .account-projection-cards > div span,
body:not(.night-mode) #percentile #percentileSummaryCards > div span,
body:not(.night-mode) #budget > .summary-grid > .budget-summary-card .metric-label,
body:not(.night-mode) #car .car-summary-cards > div span {
  color: #65738a !important;
}

/* v259: color-highlight the Home retirement summary cards in both themes.
   Current net worth = blue, projected value = purple/teal, and the projected
   gap switches dynamically: red for a shortfall, green for a surplus/on-track result. */

/* Light Mode */
body:not(.night-mode) #dashboard .retirement-stat-card {
  border: 2px solid #3b82f6 !important;
  border-top-width: 7px !important;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.25), transparent 62%),
    linear-gradient(135deg, rgba(219,234,254,.97), rgba(239,246,255,.94)) !important;
  box-shadow: 0 16px 34px rgba(59,130,246,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #dashboard .retirement-stat-card > strong {
  color: #1d4ed8 !important;
}
body:not(.night-mode) #dashboard .retirement-projected-card {
  border-color: #8b5cf6 !important;
  background:
    radial-gradient(circle at top right, rgba(139,92,246,.23), transparent 62%),
    linear-gradient(135deg, rgba(237,233,254,.97), rgba(248,245,255,.94)) !important;
  box-shadow: 0 16px 34px rgba(139,92,246,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #dashboard .retirement-projected-card > strong {
  color: #6d28d9 !important;
}
body:not(.night-mode) #dashboard .retirement-gap-card {
  border-color: #f59e0b !important;
  background:
    radial-gradient(circle at top right, rgba(245,158,11,.22), transparent 62%),
    linear-gradient(135deg, rgba(254,243,199,.97), rgba(255,251,235,.94)) !important;
  box-shadow: 0 16px 34px rgba(245,158,11,.14), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #dashboard .retirement-gap-card > strong {
  color: #b45309 !important;
}
body:not(.night-mode) #dashboard .retirement-gap-card.negative-gap {
  border-color: #ef4444 !important;
  background:
    radial-gradient(circle at top right, rgba(239,68,68,.24), transparent 62%),
    linear-gradient(135deg, rgba(254,226,226,.98), rgba(255,241,242,.95)) !important;
  box-shadow: 0 16px 34px rgba(239,68,68,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #dashboard .retirement-gap-card.negative-gap > strong {
  color: #dc2626 !important;
}
body:not(.night-mode) #dashboard .retirement-gap-card.positive-gap {
  border-color: #10b981 !important;
  background:
    radial-gradient(circle at top right, rgba(16,185,129,.24), transparent 62%),
    linear-gradient(135deg, rgba(209,250,229,.98), rgba(240,253,244,.95)) !important;
  box-shadow: 0 16px 34px rgba(16,185,129,.15), inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body:not(.night-mode) #dashboard .retirement-gap-card.positive-gap > strong {
  color: #059669 !important;
}

/* Dark Mode */
body.night-mode #dashboard .retirement-stat-card {
  border: 2px solid #3b82f6 !important;
  border-top-width: 7px !important;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.27), transparent 66%),
    linear-gradient(135deg, rgba(22,55,100,.94), rgba(10,28,55,.94)) !important;
  box-shadow: 0 16px 34px rgba(18,68,145,.25), inset 0 1px 0 rgba(147,197,253,.09) !important;
}
body.night-mode #dashboard .retirement-stat-card > strong {
  color: #77aaff !important;
}
body.night-mode #dashboard .retirement-projected-card {
  border-color: #8b5cf6 !important;
  background:
    radial-gradient(circle at top right, rgba(139,92,246,.29), transparent 66%),
    linear-gradient(135deg, rgba(57,43,105,.94), rgba(27,24,61,.94)) !important;
  box-shadow: 0 16px 34px rgba(95,62,190,.22), inset 0 1px 0 rgba(196,181,253,.08) !important;
}
body.night-mode #dashboard .retirement-projected-card > strong {
  color: #b69cff !important;
}
body.night-mode #dashboard .retirement-gap-card {
  border-color: #f59e0b !important;
  background:
    radial-gradient(circle at top right, rgba(245,158,11,.27), transparent 66%),
    linear-gradient(135deg, rgba(76,49,13,.94), rgba(42,31,17,.94)) !important;
  box-shadow: 0 16px 34px rgba(160,102,16,.20), inset 0 1px 0 rgba(253,230,138,.07) !important;
}
body.night-mode #dashboard .retirement-gap-card > strong {
  color: #fbbf24 !important;
}
body.night-mode #dashboard .retirement-gap-card.negative-gap {
  border-color: #ef4444 !important;
  background:
    radial-gradient(circle at top right, rgba(239,68,68,.30), transparent 66%),
    linear-gradient(135deg, rgba(86,31,45,.96), rgba(48,20,32,.95)) !important;
  box-shadow: 0 16px 34px rgba(190,40,62,.23), inset 0 1px 0 rgba(254,202,202,.07) !important;
}
body.night-mode #dashboard .retirement-gap-card.negative-gap > strong {
  color: #ff7d88 !important;
}
body.night-mode #dashboard .retirement-gap-card.positive-gap {
  border-color: #10b981 !important;
  background:
    radial-gradient(circle at top right, rgba(16,185,129,.29), transparent 66%),
    linear-gradient(135deg, rgba(18,75,65,.96), rgba(12,43,40,.95)) !important;
  box-shadow: 0 16px 34px rgba(10,130,101,.22), inset 0 1px 0 rgba(167,243,208,.07) !important;
}
body.night-mode #dashboard .retirement-gap-card.positive-gap > strong {
  color: #45dfbd !important;
}

/* Keep labels/details legible on the richer fills. */
body:not(.night-mode) #dashboard .retirement-stat-card > span,
body:not(.night-mode) #dashboard .retirement-stat-card > small {
  color: #65738a !important;
}
body.night-mode #dashboard .retirement-stat-card > span {
  color: #b8c7df !important;
}
body.night-mode #dashboard .retirement-stat-card > small {
  color: #c5d0e2 !important;
}

/* =========================================================
   v260 first-login spotlight onboarding
   ========================================================= */
.accounts-onboarding-backdrop {
  position: fixed;
  z-index: 124;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(12, 22, 40, .48);
  backdrop-filter: blur(3px) saturate(.72);
  -webkit-backdrop-filter: blur(3px) saturate(.72);
  pointer-events: auto;
}
.accounts-onboarding-backdrop[hidden],
.accounts-onboarding-guide-arrow[hidden] {
  display: none !important;
}
body.night-mode .accounts-onboarding-backdrop {
  background: rgba(0, 5, 14, .66);
  backdrop-filter: blur(3px) saturate(.62);
  -webkit-backdrop-filter: blur(3px) saturate(.62);
}

/* The popup must sit above the spotlight fade. The Liquid Glass block earlier in
   this stylesheet changes it to position:relative, so restore the intended
   viewport positioning here. */
.accounts-onboarding {
  position: fixed !important;
  z-index: 132 !important;
  overflow: visible !important;
  background:
    radial-gradient(circle at top right, rgba(61, 124, 255, .16), transparent 13rem),
    rgba(255, 255, 255, .98) !important;
  border: 1px solid rgba(61, 124, 255, .30) !important;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .30), 0 0 0 1px rgba(255,255,255,.60) inset !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.night-mode .accounts-onboarding {
  background:
    radial-gradient(circle at top right, rgba(61, 124, 255, .24), transparent 13rem),
    #0d182a !important;
  border-color: rgba(111, 161, 255, .50) !important;
  box-shadow: 0 32px 90px rgba(0, 0, 0, .58), 0 0 0 1px rgba(140,180,255,.08) inset !important;
}

.accounts-onboarding-guide-arrow {
  position: fixed;
  inset: 0;
  z-index: 131;
  pointer-events: none;
  overflow: visible;
  color: #3d7cff;
  filter: drop-shadow(0 5px 8px rgba(37, 99, 235, .28));
}
.accounts-onboarding-guide-arrow-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.accounts-onboarding-guide-arrow-head {
  fill: currentColor;
  stroke: none;
}
body.night-mode .accounts-onboarding-guide-arrow {
  color: #79a7ff;
  filter: drop-shadow(0 5px 10px rgba(74, 130, 255, .42));
}

/* Keep the Accounts destination bright while the rest of the header recedes. */
body.accounts-onboarding-active {
  overflow: hidden;
}
body.accounts-onboarding-active .site-header .brand,
body.accounts-onboarding-active .site-header .nav-btn:not([data-view="networth"]),
body.accounts-onboarding-active .site-header .topbar-actions {
  opacity: .28;
  filter: saturate(.45);
  pointer-events: none;
  transition: opacity .2s ease, filter .2s ease;
}
body.accounts-onboarding-active .site-header .nav-btn[data-view="networth"] {
  opacity: 1;
  filter: none;
  pointer-events: auto;
}
.nav-btn.onboarding-target {
  z-index: 2;
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)) !important;
  border-color: rgba(255,255,255,.72) !important;
  box-shadow: 0 0 0 6px rgba(61, 124, 255, .18), 0 14px 34px rgba(37, 99, 235, .34) !important;
}
body.night-mode .nav-btn.onboarding-target {
  color: #ffffff !important;
  background: linear-gradient(135deg, #3d7cff, #755dff) !important;
  box-shadow: 0 0 0 6px rgba(91, 145, 255, .22), 0 16px 38px rgba(0, 0, 0, .34) !important;
}

@media (max-width: 760px) {
  .accounts-onboarding {
    width: min(330px, calc(100vw - 24px));
  }
  .accounts-onboarding-guide-arrow-line {
    stroke-width: 3.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .accounts-onboarding-guide-arrow { filter: none; }
}

/* v261 Accounts Light Mode dialog/select consistency
   Match the compact Dark Mode dropdown geometry while keeping Light Mode surfaces light,
   and keep Add Account Group actions contained inside the modal. */
@media (min-width: 768px) {
  body:not(.night-mode) .mw-select-trigger[data-select-id="newCategorySign"],
  body:not(.night-mode) .mw-select-trigger[data-select-id="accountsEditAccountGroup"] {
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 38px !important;
    padding: 6px 10px !important;
    border-radius: 12px !important;
    border: 1px solid #b7c5d9 !important;
    background: #f8fbff !important;
    color: #182235 !important;
    font-size: .84rem !important;
    font-weight: 620 !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
    align-items: center !important;
  }
  body:not(.night-mode) .mw-select-trigger[data-select-id="newCategorySign"]:hover,
  body:not(.night-mode) .mw-select-trigger[data-select-id="newCategorySign"]:focus-visible,
  body:not(.night-mode) .mw-select-trigger[data-select-id="newCategorySign"].is-open,
  body:not(.night-mode) .mw-select-trigger[data-select-id="accountsEditAccountGroup"]:hover,
  body:not(.night-mode) .mw-select-trigger[data-select-id="accountsEditAccountGroup"]:focus-visible,
  body:not(.night-mode) .mw-select-trigger[data-select-id="accountsEditAccountGroup"].is-open {
    border-color: #6f8eb8 !important;
    background: #f3f7fd !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10) !important;
    outline: none !important;
  }
  body:not(.night-mode) .mw-select-trigger[data-select-id="newCategorySign"] .mw-select-trigger-label,
  body:not(.night-mode) .mw-select-trigger[data-select-id="accountsEditAccountGroup"] .mw-select-trigger-label {
    color: #182235 !important;
    -webkit-text-fill-color: #182235 !important;
    line-height: 1.18 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  body:not(.night-mode) .mw-select-trigger[data-select-id="newCategorySign"] .mw-select-trigger-icon,
  body:not(.night-mode) .mw-select-trigger[data-select-id="accountsEditAccountGroup"] .mw-select-trigger-icon {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    top: 0 !important;
  }
  body:not(.night-mode) .mw-select-trigger[data-select-id="newCategorySign"] .mw-select-trigger-icon span,
  body:not(.night-mode) .mw-select-trigger[data-select-id="accountsEditAccountGroup"] .mw-select-trigger-icon span {
    display: none !important;
  }
  body:not(.night-mode) .mw-select-trigger[data-select-id="newCategorySign"] .mw-select-trigger-icon::after,
  body:not(.night-mode) .mw-select-trigger[data-select-id="accountsEditAccountGroup"] .mw-select-trigger-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2.2px solid #52709a;
    border-bottom: 2.2px solid #52709a;
    transform: translate(-50%, -58%) rotate(45deg);
    transform-origin: center;
    transition: transform .16s ease;
    box-sizing: border-box;
  }
  body:not(.night-mode) .mw-select-trigger[data-select-id="newCategorySign"].is-open .mw-select-trigger-icon::after,
  body:not(.night-mode) .mw-select-trigger[data-select-id="accountsEditAccountGroup"].is-open .mw-select-trigger-icon::after {
    transform: translate(-50%, -42%) rotate(-135deg);
  }

  body:not(.night-mode) .mw-custom-select-menu[data-select-id="newCategorySign"],
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="accountsEditAccountGroup"] {
    padding: 6px !important;
    border: 1px solid #b7c5d9 !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: #182235 !important;
    box-shadow: 0 20px 45px rgba(15, 23, 42, .18) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #b7c5d9 #ffffff;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="newCategorySign"] .mw-custom-select-option,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="accountsEditAccountGroup"] .mw-custom-select-option {
    width: 100% !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #182235 !important;
    font-size: .82rem !important;
    font-weight: 620 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="newCategorySign"] .mw-custom-select-option + .mw-custom-select-option,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="accountsEditAccountGroup"] .mw-custom-select-option + .mw-custom-select-option {
    margin-top: 1px !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="newCategorySign"] .mw-custom-select-option:hover:not(:disabled),
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="newCategorySign"] .mw-custom-select-option:focus-visible,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="newCategorySign"] .mw-custom-select-option.is-selected,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="accountsEditAccountGroup"] .mw-custom-select-option:hover:not(:disabled),
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="accountsEditAccountGroup"] .mw-custom-select-option:focus-visible,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="accountsEditAccountGroup"] .mw-custom-select-option.is-selected {
    background: #e8f0ff !important;
    color: #12295b !important;
    border: 0 !important;
    outline: none !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="newCategorySign"] .mw-custom-select-option-label,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="accountsEditAccountGroup"] .mw-custom-select-option-label {
    color: inherit !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="newCategorySign"] .mw-custom-select-option-accessory,
  body:not(.night-mode) .mw-custom-select-menu[data-select-id="accountsEditAccountGroup"] .mw-custom-select-option-accessory {
    display: none !important;
  }
}

/* Keep the Add Account Group modal within the viewport, with its action buttons
   inside the modal surface. Only the color list scrolls when space is limited. */
#categoryDialog {
  max-height: calc(100dvh - 32px) !important;
  overflow: hidden !important;
}
#categoryDialog form {
  width: 100%;
  max-height: calc(100dvh - 32px) !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  overflow: hidden !important;
}
#categoryDialog .category-color-picker-section {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
#categoryDialog .category-color-list {
  flex: 1 1 auto !important;
  min-height: 130px !important;
  max-height: none !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}
#categoryDialog .modal-actions {
  flex: 0 0 auto !important;
  position: relative !important;
  inset: auto !important;
  margin: 0 !important;
  padding-top: 14px !important;
  border-top: 1px solid var(--border) !important;
  background: transparent !important;
  z-index: 2;
}
body:not(.night-mode) #categoryDialog {
  background: #f8fbff !important;
  border: 1px solid #c8d4e5 !important;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .20) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body:not(.night-mode) #categoryDialog form {
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fc 100%) !important;
}
body:not(.night-mode) #categoryDialog .modal-actions {
  border-top-color: #d7e0ec !important;
}

@media (max-width: 767px) {
  #categoryDialog {
    max-height: calc(100dvh - 20px) !important;
  }
  #categoryDialog form {
    max-height: calc(100dvh - 20px) !important;
  }
  #categoryDialog .category-color-list {
    min-height: 110px !important;
  }
  #categoryDialog .modal-actions {
    flex-wrap: wrap;
  }
}

/* v262: Accounts account-type autocomplete typography parity.
   Light Mode now uses the same compact desktop row sizing and text scale as Dark Mode. */
@media (min-width: 768px) {
  body:not(.night-mode) .account-type-suggestion,
  body:not(.night-mode) .account-type-suggestions[data-anchor-mode="dialog"] .account-type-suggestion {
    padding: 8px 10px !important;
    font-size: 0.82rem !important;
    font-weight: 620 !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
  }
  body:not(.night-mode) .account-type-no-results {
    font-size: 0.82rem !important;
    font-weight: 620 !important;
  }
}

/* v263: Accounts search cleanup + opaque sticky search result label.
   Remove the inner glass/input capsule so the toolbar search reads as one field,
   and keep horizontally scrolling values from showing through the sticky account name. */
#networth .mw-accounts-search-box > input#accountsSpreadsheetSearch,
#networth .mw-accounts-search-box > input#accountsSpreadsheetSearch:focus,
#networth .mw-accounts-search-box > input#accountsSpreadsheetSearch:active {
  -webkit-appearance: none !important;
  appearance: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  height: auto !important;
}

#networth .mw-account-row.search-match {
  isolation: isolate;
}
#networth .mw-account-row.search-match > div:first-child {
  z-index: 18;
  overflow: hidden;
  background: linear-gradient(90deg, #e2ebff 0%, #eae6ff 100%) !important;
  box-shadow: 2px 0 0 #8ca0ff, inset 0 0 0 2px rgba(91,102,255,.22) !important;
}
body.night-mode #networth .mw-account-row.search-match > div:first-child {
  background: linear-gradient(90deg, #163467 0%, #242557 100%) !important;
  box-shadow: 2px 0 0 #526bda, inset 0 0 0 2px rgba(113,124,255,.34) !important;
}

/* v265: use one consistent Accounts search-highlight color across the full row.
   Keep the sticky account label opaque, but remove the left-to-right color shift so
   every highlighted cell reads as one unified selection. */
#networth .mw-account-row.search-match {
  box-shadow: inset 0 0 0 2px rgba(79,141,247,.34) !important;
}
#networth .mw-account-row.search-match > div {
  background: #e8f0ff !important;
}
#networth .mw-account-row.search-match .mw-account-value-input {
  background: rgba(255,255,255,.62) !important;
  border-color: rgba(79,141,247,.22) !important;
}
#networth .mw-account-row.search-match .mw-account-link > span {
  color: #17264a !important;
}
#networth .mw-account-row.search-match .mw-reorder-handle {
  background: linear-gradient(180deg, #edf3ff, #dfe9ff) !important;
  border-color: #aab9df !important;
}
body.night-mode #networth .mw-account-row.search-match {
  box-shadow: inset 0 0 0 2px rgba(96,165,250,.38) !important;
}
body.night-mode #networth .mw-account-row.search-match > div {
  background: #213d6a !important;
}
body.night-mode #networth .mw-account-row.search-match .mw-account-value-input {
  background: rgba(3,16,42,.72) !important;
  border-color: rgba(96,165,250,.28) !important;
}
body.night-mode #networth .mw-account-row.search-match .mw-account-link > span {
  color: #eef4ff !important;
}
body.night-mode #networth .mw-account-row.search-match .mw-reorder-handle {
  background: linear-gradient(180deg, #173665, #142a4c) !important;
  border-color: #48649a !important;
}


/* v267: read-only Current Finances overview from the Accounts toolbar */
.mw-current-finances-btn {
  min-height: 56px;
  border-color: #7c82ff;
  background: linear-gradient(135deg, #315fd5 0%, #5657d8 52%, #7a4ec2 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(65, 78, 204, .20), inset 0 1px 0 rgba(255,255,255,.16);
}
.mw-current-finances-btn:hover {
  border-color: #8f94ff;
  box-shadow: 0 14px 30px rgba(65, 78, 204, .26), inset 0 1px 0 rgba(255,255,255,.18);
}
.mw-current-finances-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: currentColor;
}

.mw-finances-overview-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 28px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  overflow: visible;
}
.mw-finances-overview-dialog::backdrop {
  background: rgba(4, 10, 24, .68);
  backdrop-filter: blur(8px);
}
.mw-finances-overview-card {
  max-height: min(88vh, 880px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cbd7e8;
  border-radius: 28px;
  background: #f7faff;
  box-shadow: 0 32px 90px rgba(15, 23, 42, .30), inset 0 1px 0 rgba(255,255,255,.92);
}
.mw-finances-overview-header {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px 22px;
  color: #ffffff;
  background:
    radial-gradient(circle at 86% 12%, rgba(214, 151, 255, .32), transparent 16rem),
    linear-gradient(135deg, #244fae 0%, #4658b8 50%, #7350ae 100%);
  border-bottom: 1px solid rgba(255,255,255,.16);
}
.mw-finances-overview-header .eyebrow {
  color: #d9e6ff;
  font-size: .68rem;
}
.mw-finances-overview-header h2 {
  margin: 5px 0 5px;
  color: #ffffff;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  letter-spacing: -.035em;
}
.mw-finances-overview-header p:last-child {
  max-width: 760px;
  margin: 0;
  color: #e8eeff;
  font-size: .82rem;
  line-height: 1.5;
}
.mw-finances-overview-close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 13px;
  background: rgba(255,255,255,.10);
  color: #ffffff;
  font-size: 1.65rem;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.mw-finances-overview-close:hover,
.mw-finances-overview-close:focus-visible {
  background: rgba(255,255,255,.18);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.14), inset 0 1px 0 rgba(255,255,255,.16);
}
.mw-finances-overview-body {
  min-height: 0;
  overflow: auto;
  padding: 22px 24px 26px;
}
.mw-finances-overview-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.mw-finances-overview-summary article {
  min-width: 0;
  padding: 16px 18px;
  border: 2px solid #bfd0ee;
  border-top-width: 4px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15,23,42,.07);
}
.mw-finances-overview-summary article.asset {
  border-color: #4d7ceb;
  background: linear-gradient(180deg, #f5f8ff, #edf4ff);
}
.mw-finances-overview-summary article.liability {
  border-color: #df4965;
  background: linear-gradient(180deg, #fff8fa, #fff0f3);
}
.mw-finances-overview-summary article.net {
  border-color: #20a57c;
  background: linear-gradient(180deg, #f3fcf9, #eaf9f4);
}
.mw-finances-overview-summary span {
  display: block;
  color: #69788f;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.mw-finances-overview-summary strong {
  display: block;
  margin-top: 7px;
  color: #172033;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.mw-finances-overview-summary article.liability strong { color: #c82645; }
.mw-finances-overview-summary article.net strong { color: #07845f; }

.mw-finances-overview-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.mw-finances-overview-group {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d8e1ee;
  border-top: 4px solid var(--finance-group-accent, #6d5dfc);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15,23,42,.06);
}
.mw-finances-overview-group-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid #e3e9f2;
  background: linear-gradient(180deg, #ffffff, #f6f9fd);
}
.mw-finances-overview-group-head > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mw-finances-overview-group-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: var(--finance-group-accent, #6d5dfc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--finance-group-accent, #6d5dfc) 16%, transparent);
}
.mw-finances-overview-group-head strong {
  min-width: 0;
  color: #1c2638;
  font-size: .82rem;
  font-weight: 900;
}
.mw-finances-overview-group-head > div strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mw-finances-overview-group-head > strong {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.mw-finances-overview-account-list {
  display: grid;
}
.mw-finances-overview-account-row {
  min-height: 49px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 13px;
  border-bottom: 1px solid #edf1f6;
}
.mw-finances-overview-account-row:last-child { border-bottom: 0; }
.mw-finances-overview-account-row > div { min-width: 0; }
.mw-finances-overview-account-row > div strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #222d40;
  font-size: .78rem;
  font-weight: 850;
}
.mw-finances-overview-account-row small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8390a5;
  font-size: .62rem;
  font-weight: 750;
}
.mw-finances-overview-account-row > span {
  color: #26364c;
  font-size: .78rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mw-finances-overview-account-row > span.liability { color: #c82645; }
.mw-finances-overview-group-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-top: 1px solid #dfe6f0;
  background: #f6f9fd;
  color: #506078;
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mw-finances-overview-group-total strong {
  color: #1d2a3f;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mw-finances-overview-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  place-items: center;
  min-height: 170px;
  padding: 28px;
  border: 1px dashed #c7d3e4;
  border-radius: 18px;
  background: #ffffff;
  text-align: center;
}
.mw-finances-overview-empty strong { color: #28354a; }
.mw-finances-overview-empty span { color: #7d899c; font-size: .82rem; }

body.night-mode .mw-finances-overview-card {
  border-color: #2f4a71;
  background: #08111f;
  box-shadow: 0 34px 96px rgba(0,0,0,.58), inset 0 1px 0 rgba(255,255,255,.04);
}
body.night-mode .mw-finances-overview-body { background: #08111f; }
body.night-mode .mw-finances-overview-summary article {
  box-shadow: 0 10px 26px rgba(0,0,0,.22);
}
body.night-mode .mw-finances-overview-summary article.asset {
  border-color: #4f7ee9;
  background: linear-gradient(180deg, #112952, #0d213f);
}
body.night-mode .mw-finances-overview-summary article.liability {
  border-color: #dc4965;
  background: linear-gradient(180deg, #3b1523, #2b111b);
}
body.night-mode .mw-finances-overview-summary article.net {
  border-color: #21a77e;
  background: linear-gradient(180deg, #103b31, #0c2d26);
}
body.night-mode .mw-finances-overview-summary span { color: #a9b8cf; }
body.night-mode .mw-finances-overview-summary strong { color: #f3f7ff; }
body.night-mode .mw-finances-overview-summary article.liability strong { color: #ff8da2; }
body.night-mode .mw-finances-overview-summary article.net strong { color: #67d7af; }
body.night-mode .mw-finances-overview-group {
  border-color: #273b57;
  border-top-color: var(--finance-group-accent, #7a70ff);
  background: #0d1828;
  box-shadow: 0 10px 26px rgba(0,0,0,.20);
}
body.night-mode .mw-finances-overview-group-head {
  border-bottom-color: #263a56;
  background: linear-gradient(180deg, #15243a, #101d30);
}
body.night-mode .mw-finances-overview-group-head strong,
body.night-mode .mw-finances-overview-account-row > div strong { color: #eef4ff; }
body.night-mode .mw-finances-overview-account-row { border-bottom-color: #1e3049; }
body.night-mode .mw-finances-overview-account-row small { color: #92a5c2; }
body.night-mode .mw-finances-overview-account-row > span { color: #dce8fb; }
body.night-mode .mw-finances-overview-account-row > span.liability { color: #ff879e; }
body.night-mode .mw-finances-overview-group-total {
  border-top-color: #29405f;
  background: #111f33;
  color: #a8b8cf;
}
body.night-mode .mw-finances-overview-group-total strong { color: #f1f6ff; }
body.night-mode .mw-finances-overview-empty {
  border-color: #304763;
  background: #0d1828;
}
body.night-mode .mw-finances-overview-empty strong { color: #eef4ff; }
body.night-mode .mw-finances-overview-empty span { color: #9aacc6; }

@media (max-width: 980px) {
  .mw-finances-overview-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .mw-finances-overview-dialog { width: min(100vw - 18px, 1120px); }
  .mw-finances-overview-card { max-height: 92vh; border-radius: 22px; }
  .mw-finances-overview-header { padding: 19px 18px 17px; gap: 14px; }
  .mw-finances-overview-header p:last-child { font-size: .75rem; }
  .mw-finances-overview-body { padding: 15px; }
  .mw-finances-overview-summary,
  .mw-finances-overview-groups { grid-template-columns: 1fr; }
  .mw-current-finances-btn { justify-content: center; }
}


/* v268: keep View Current Finances directly between Filters and New Snapshot */
.mw-accounts-toolbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  min-width: 0;
}
.mw-accounts-toolbar-end .mw-snapshot-instruction {
  margin-left: 0;
  flex: 0 0 320px;
}
.mw-current-finances-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* v268: Current Finances modal now goes straight to the read-only account overview. */
.mw-finances-overview-body {
  padding-top: 18px;
}

@media (max-width: 1180px) {
  .mw-accounts-toolbar-end {
    width: 100%;
    margin-left: 0;
  }
  .mw-accounts-toolbar-end .mw-snapshot-instruction {
    margin-left: auto;
  }
}

@media (max-width: 860px) {
  .mw-accounts-toolbar-end {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
  }
  .mw-accounts-toolbar-end .mw-current-finances-btn {
    width: 100%;
    justify-content: center;
  }
  .mw-accounts-toolbar-end .mw-snapshot-instruction {
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .mw-accounts-toolbar-end {
    grid-template-columns: 1fr;
  }
  .mw-accounts-toolbar-end .mw-accounts-filter-wrap,
  .mw-accounts-toolbar-end #accountsFilterBtn,
  .mw-accounts-toolbar-end .mw-current-finances-btn,
  .mw-accounts-toolbar-end .mw-snapshot-instruction {
    width: 100%;
  }
}

/* v270: full-width insertion line when reordering overarching Account Groups.
   The prior inset shadow sat behind the grid cells, so it could disappear while
   dragging. These pseudo-elements render above every cell—including the sticky
   Account column—so the drop position is unmistakable across the entire row. */
.mw-cat-row {
  position: relative;
}
.mw-cat-row.category-drag-over,
.mw-cat-row.category-drop-after {
  box-shadow: none;
}
.mw-cat-row.category-drag-over::before,
.mw-cat-row.category-drop-after::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 999px;
  background: #5f6cff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 0 10px rgba(95,108,255,.72);
  z-index: 40;
  pointer-events: none;
}
.mw-cat-row.category-drag-over::before {
  top: 0;
  transform: translateY(-2px);
}
.mw-cat-row.category-drop-after::after {
  bottom: 0;
  transform: translateY(2px);
}
body.night-mode .mw-cat-row.category-drag-over::before,
body.night-mode .mw-cat-row.category-drop-after::after {
  background: #6f8cff;
  box-shadow: 0 0 0 1px rgba(219,231,255,.24), 0 0 12px rgba(88,132,255,.82);
}

/* v271: restore the individual-account insertion line across the sticky Account cell.
   The spreadsheet's first cell is sticky and sits above the row background, which can
   hide a row-level inset shadow. Apply the insertion line to each visible cell instead
   so the blue guide is continuous through the account name and every value column. */
.mw-account-row.drag-over,
.mw-account-row.drop-after {
  box-shadow: none;
}
.mw-account-row.drag-over > div {
  box-shadow: inset 0 3px 0 #5f6cff;
}
.mw-account-row.drop-after > div {
  box-shadow: inset 0 -3px 0 #5f6cff;
}
.mw-account-row.drag-over > div:first-child {
  box-shadow: inset 0 3px 0 #5f6cff, 2px 0 0 var(--mw-sheet-line);
}
.mw-account-row.drop-after > div:first-child {
  box-shadow: inset 0 -3px 0 #5f6cff, 2px 0 0 var(--mw-sheet-line);
}
body.night-mode .mw-account-row.drag-over > div {
  box-shadow: inset 0 3px 0 #6f8cff;
}
body.night-mode .mw-account-row.drop-after > div {
  box-shadow: inset 0 -3px 0 #6f8cff;
}
body.night-mode .mw-account-row.drag-over > div:first-child {
  box-shadow: inset 0 3px 0 #6f8cff, 2px 0 0 var(--mw-sheet-line);
}
body.night-mode .mw-account-row.drop-after > div:first-child {
  box-shadow: inset 0 -3px 0 #6f8cff, 2px 0 0 var(--mw-sheet-line);
}


/* v272: match the six category drag-handle dots to each overarching Account Group color. */
.mw-cat-row .mw-category-reorder-handle .mw-handle-dots i {
  background: #0e56b7;
}
.mw-cat-row.funds .mw-category-reorder-handle .mw-handle-dots i {
  background: #0b7d82;
}
.mw-cat-row.noncurrent .mw-category-reorder-handle .mw-handle-dots i {
  background: #905903;
}
.mw-cat-row.liability .mw-category-reorder-handle .mw-handle-dots i {
  background: #a01732;
}
.mw-cat-row[style*="--mw-category-color"] .mw-category-reorder-handle .mw-handle-dots i {
  background: var(--mw-category-color);
}

/* v276 — Money-Wise snapshot calendar (avoids Safari's UTC-shifted native "today" highlight). */
.mw-snapshot-date-field {
  display: grid;
  gap: 6px;
  margin-bottom: 13px;
}
.mw-snapshot-date-field > span {
  color: var(--muted-2);
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mw-snapshot-date-picker {
  position: relative;
}
.mw-snapshot-date-trigger {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #b7c5d9;
  border-radius: 12px;
  background: #f8fbff;
  color: #182235;
  padding: 0 12px;
  font-size: .86rem;
  font-weight: 800;
  text-align: left;
}
.mw-snapshot-date-trigger:hover {
  border-color: #7293c7;
  background: #f2f7ff;
}
.mw-snapshot-date-trigger:focus-visible {
  outline: none;
  border-color: #3b6ef5;
  box-shadow: 0 0 0 4px rgba(59,110,245,.16);
}
.mw-snapshot-date-chevron {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #c9d5e5;
  border-radius: 9px;
  color: #50627d;
  font-size: .68rem;
}
.mw-snapshot-calendar {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  left: 0;
  width: min(314px, calc(100vw - 76px));
  padding: 12px;
  border: 1px solid #b8c8dc;
  border-radius: 15px;
  background: #ffffff;
  color: #182235;
  box-shadow: 0 20px 55px rgba(15,23,42,.25);
}
.mw-snapshot-calendar-header {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}
.mw-snapshot-calendar-header strong {
  text-align: center;
  font-size: .9rem;
  letter-spacing: -.01em;
}
.mw-snapshot-calendar-header button {
  width: 34px;
  height: 32px;
  border: 1px solid #d1dbea;
  border-radius: 9px;
  background: #f6f9fe;
  color: #33445e;
  font-size: 1.25rem;
  line-height: 1;
}
.mw-snapshot-calendar-header button:hover {
  border-color: #8ba8d4;
  background: #edf4ff;
}
.mw-snapshot-calendar-weekdays,
.mw-snapshot-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}
.mw-snapshot-calendar-weekdays {
  margin-bottom: 4px;
}
.mw-snapshot-calendar-weekdays span {
  display: grid;
  place-items: center;
  height: 24px;
  color: #7d8da5;
  font-size: .68rem;
  font-weight: 850;
}
.mw-snapshot-calendar-day {
  position: relative;
  min-width: 0;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #2e3b50;
  font-size: .78rem;
  font-weight: 750;
}
.mw-snapshot-calendar-day:hover {
  background: #edf4ff;
  color: #1e4fa8;
}
.mw-snapshot-calendar-day.outside-month {
  color: #b3bdcb;
}
.mw-snapshot-calendar-day.today {
  border-color: #2f70f5;
  color: #1457cb;
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(47,112,245,.08);
  font-weight: 950;
}
.mw-snapshot-calendar-day.selected {
  border-color: #4f46e5;
  background: linear-gradient(135deg, #2f70f5, #5947e9);
  color: #fff;
  box-shadow: 0 5px 14px rgba(59,85,205,.25);
  font-weight: 950;
}
.mw-snapshot-calendar-day.today.selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2f70f5, 0 5px 14px rgba(59,85,205,.25);
}
body.night-mode .mw-snapshot-date-field > span {
  color: #94a8c6;
}
body.night-mode .mw-snapshot-date-trigger {
  border-color: #345173;
  background: #0b1b31;
  color: #eef4ff;
}
body.night-mode .mw-snapshot-date-trigger:hover {
  border-color: #4d75a8;
  background: #102441;
}
body.night-mode .mw-snapshot-date-chevron {
  border-color: #345173;
  color: #d8e5f8;
}
body.night-mode .mw-snapshot-calendar {
  border-color: #345173;
  background: #0a192d;
  color: #eef4ff;
  box-shadow: 0 24px 65px rgba(0,0,0,.48);
}
body.night-mode .mw-snapshot-calendar-header strong {
  color: #eef4ff;
}
body.night-mode .mw-snapshot-calendar-header button {
  border-color: #29496f;
  background: #102541;
  color: #e8f1ff;
}
body.night-mode .mw-snapshot-calendar-header button:hover {
  border-color: #4b75ad;
  background: #173152;
}
body.night-mode .mw-snapshot-calendar-weekdays span {
  color: #8298b8;
}
body.night-mode .mw-snapshot-calendar-day {
  color: #dce8f8;
}
body.night-mode .mw-snapshot-calendar-day:hover {
  background: #132c4b;
  color: #fff;
}
body.night-mode .mw-snapshot-calendar-day.outside-month {
  color: #536782;
}
body.night-mode .mw-snapshot-calendar-day.today {
  border-color: #55a0ff;
  background: #0f315e;
  color: #79b8ff;
}
body.night-mode .mw-snapshot-calendar-day.selected {
  border-color: #7c6cff;
  background: linear-gradient(135deg, #2d6cf2, #6949df);
  color: #fff;
}
body.night-mode .mw-snapshot-calendar-day.today.selected {
  box-shadow: 0 0 0 2px #0a192d, 0 0 0 4px #55a0ff, 0 5px 14px rgba(45,108,242,.28);
}
@media (max-width: 560px) {
  .mw-snapshot-calendar {
    width: 100%;
  }
}

/* v277 — keep the custom snapshot calendar fully contained inside the Edit Snapshot modal. */
#accountsEditSnapshotDialog {
  max-height: calc(100vh - 28px);
  overflow-x: hidden;
  overflow-y: auto;
}
#accountsEditSnapshotDialog .mw-accounts-edit-dialog-card {
  overflow: visible;
}
#accountsEditSnapshotDialog .mw-snapshot-date-picker {
  display: grid;
  gap: 8px;
}
#accountsEditSnapshotDialog .mw-snapshot-calendar {
  position: static;
  inset: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  box-shadow: 0 14px 34px rgba(15,23,42,.18);
}
body.night-mode #accountsEditSnapshotDialog .mw-snapshot-calendar {
  box-shadow: 0 16px 38px rgba(0,0,0,.34);
}
@media (max-width: 560px) {
  #accountsEditSnapshotDialog {
    max-height: calc(100vh - 16px);
  }
  #accountsEditSnapshotDialog .mw-accounts-edit-dialog-card {
    padding: 18px 16px;
  }
}

/* v278 — Settings Target Due Date uses the same Money-Wise calendar as Accounts. */
.mw-settings-target-date-field {
  position: relative;
  min-width: 0;
}
.mw-settings-target-date-picker {
  width: 100%;
  position: relative;
}
.mw-settings-target-date-picker .mw-snapshot-date-trigger {
  min-height: 46px;
  border-radius: 10px;
  padding-inline: 12px;
  font-size: .96rem;
  font-weight: 800;
}
.mw-settings-target-date-picker .mw-snapshot-date-calendar,
.mw-settings-target-date-picker .mw-settings-target-date-calendar {
  top: calc(100% + 8px);
  width: 100%;
  max-width: 430px;
  min-width: min(314px, 100%);
  z-index: 80;
}
.mw-settings-target-date-calendar-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid #dbe4f0;
}
.mw-settings-target-date-calendar-footer button {
  border: 1px solid #cbd7e7;
  border-radius: 9px;
  background: #f6f9fe;
  color: #435775;
  padding: 7px 10px;
  font-size: .72rem;
  font-weight: 850;
}
.mw-settings-target-date-calendar-footer button:hover {
  border-color: #8ba8d4;
  background: #edf4ff;
  color: #1e4fa8;
}
body.night-mode .mw-settings-target-date-calendar-footer {
  border-top-color: #29496f;
}
body.night-mode .mw-settings-target-date-calendar-footer button {
  border-color: #29496f;
  background: #102541;
  color: #dce8f8;
}
body.night-mode .mw-settings-target-date-calendar-footer button:hover {
  border-color: #4b75ad;
  background: #173152;
  color: #fff;
}
@media (max-width: 760px) {
  .mw-settings-target-date-picker .mw-settings-target-date-calendar {
    width: 100%;
    max-width: none;
  }
}

/* v279 — keep Settings Target Due Date calendar in normal layout flow so data controls never overlap it. */
.mw-settings-target-date-picker {
  display: grid;
  gap: 8px;
}
.mw-settings-target-date-picker .mw-settings-target-date-calendar {
  position: static;
  inset: auto;
  top: auto;
  left: auto;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  z-index: auto;
  box-shadow: 0 14px 34px rgba(15,23,42,.18);
}
body.night-mode .mw-settings-target-date-picker .mw-settings-target-date-calendar {
  box-shadow: 0 16px 38px rgba(0,0,0,.34);
}

/* v280 — keep the Settings Target Due Date calendar compact and floating
   without changing the two-column Settings layout. The Settings grid is
   raised above later controls while the compact calendar is open so buttons
   such as Delete All Data can never paint over the calendar. */
#settings .settings-grid {
  position: relative;
  z-index: 6 !important;
  overflow: visible !important;
}

.mw-settings-target-date-picker {
  display: block;
  position: relative;
  overflow: visible;
}

.mw-settings-target-date-picker .mw-settings-target-date-calendar {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  width: min(314px, calc(100vw - 76px));
  max-width: 314px;
  min-width: 0;
  margin: 0;
  z-index: 5000;
  padding: 12px;
  box-shadow: 0 20px 55px rgba(15,23,42,.25);
}

body.night-mode .mw-settings-target-date-picker .mw-settings-target-date-calendar {
  box-shadow: 0 24px 65px rgba(0,0,0,.48);
}

/* Keep the compact Settings calendar visually identical to the Accounts
   calendar while retaining the Settings-only Clear date action. */
.mw-settings-target-date-picker .mw-settings-target-date-calendar-footer {
  padding-top: 8px;
  margin-top: 6px;
}

@media (max-width: 760px) {
  .mw-settings-target-date-picker .mw-settings-target-date-calendar {
    width: min(314px, calc(100vw - 52px));
    max-width: calc(100vw - 52px);
  }
}

@media (max-width: 420px) {
  .mw-settings-target-date-picker .mw-settings-target-date-calendar {
    width: 100%;
    max-width: none;
  }
}
