:root {
  --navy-900: #07111c;
  --navy-800: #0b1b2b;
  --navy-700: #122438;
  --charcoal: #1a2230;
  --ink: #0a1320;
  --paper: #f5f4ef;
  --paper-2: #ecebe4;
  --white: #ffffff;
  --line: #e4e2d8;
  --line-strong: #d3d0c4;
  --muted: #6b6f78;
  --muted-2: #94989f;
  --pink: #ff5a8a;
  --pink-soft: #ffe1eb;
  --pink-deep: #c8316b;
  --green: #1f9d6b;
  --green-soft: #d8f1e3;
  --amber: #c98a2b;
  --amber-soft: #fbe9c8;
  --shadow-card: 0 1px 0 rgba(11, 27, 43, 0.04), 0 8px 24px -12px rgba(11, 27, 43, 0.18);
  --shadow-lift: 0 2px 0 rgba(11, 27, 43, 0.04), 0 18px 40px -18px rgba(11, 27, 43, 0.35);
  --radius-card: 18px;
  --radius-input: 12px;
  --radius-chip: 999px;
  --font-display: "General Sans", "Satoshi", -apple-system, system-ui, sans-serif;
  --font-body: "Satoshi", -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(255, 90, 138, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(11, 27, 43, 0.06), transparent 60%),
    var(--paper);
  min-height: 100vh;
}

button { font: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }

[hidden],
.field[hidden],
.avatar[hidden] {
  display: none !important;
}

.app {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px 40px;
}

/* ============ TOP BAR ============ */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy-800);
  text-decoration: none;
  min-width: 172px;
  padding-right: 6px;
}

.logo {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.brand-logo {
  height: 84px;
  width: auto;
  display: block;
}



.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 118px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--navy-800);
}

.brand-sub {
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
}

.tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--paper-2);
  padding: 3px;
  border-radius: 12px;
  justify-self: start;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: -0.005em;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.tab:hover { color: var(--navy-800); }

.tab.is-active {
  background: var(--white);
  color: var(--navy-800);
  box-shadow: 0 1px 0 rgba(11, 27, 43, 0.04), 0 4px 10px -4px rgba(11, 27, 43, 0.2);
}

.household {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatars {
  display: inline-flex;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--white);
  border: 2px solid var(--white);
}

.avatar-s { background: var(--pink); }
.avatar-b { background: var(--navy-800); margin-left: -10px; }

.household-meta { line-height: 1.15; }
.household-name { font-weight: 700; font-size: 13px; color: var(--navy-800); }
.household-cycle { font-size: 11px; color: var(--muted); }

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.demo-start {
  border: 0;
  background: var(--navy-800);
  color: var(--white);
  padding: 9px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 8px 18px -14px rgba(11, 27, 43, 0.65);
  transition: transform 140ms ease, background 160ms ease, box-shadow 160ms ease;
}

.demo-start:hover {
  background: var(--charcoal);
  box-shadow: 0 12px 26px -16px rgba(11, 27, 43, 0.75);
}

.demo-start:active { transform: translateY(1px); }

.presentation-toggle {
  border: 1px solid rgba(255, 90, 138, 0.34);
  background: var(--pink-soft);
  color: var(--pink-deep);
  padding: 9px 11px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  transition: transform 140ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.presentation-toggle:hover {
  border-color: var(--pink);
  background: #ffd4e3;
}

.presentation-toggle:active { transform: translateY(1px); }

.reset-demo,
.script-export {
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--navy-800);
  padding: 9px 11px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  transition: transform 140ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.reset-demo:hover,
.script-export:hover {
  border-color: rgba(255, 90, 138, 0.42);
  background: var(--pink-soft);
  color: var(--pink-deep);
}

.reset-demo:active,
.script-export:active { transform: translateY(1px); }

.reset-demo.is-reset,
.script-export.is-exported,
.btn-secondary.is-reset {
  border-color: rgba(31, 157, 107, 0.32);
  background: var(--green-soft);
  color: var(--green);
}

/* ============ PRESENTATION MODE ============ */
body.presentation-active {
  background:
    radial-gradient(900px 480px at 88% -12%, rgba(255, 90, 138, 0.10), transparent 60%),
    var(--paper);
}

body.presentation-active .app {
  max-width: 1180px;
  padding-top: 20px;
}

body.presentation-active .topbar {
  grid-template-columns: auto 1fr;
  padding: 0 2px;
  margin-bottom: 18px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.presentation-active .tabs,
body.presentation-active .household,
body.presentation-active #resetDemo,
body.presentation-active #exportScript {
  display: none;
}

body.presentation-active .top-actions {
  justify-self: end;
}

body.presentation-active .presentation-toggle {
  background: var(--white);
  color: var(--navy-800);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}

body.presentation-active .presentation-toggle::before {
  content: "●";
  color: var(--green);
  margin-right: 7px;
}

body.presentation-active .view-header {
  margin-top: 0;
}

body.presentation-active .footnote {
  opacity: 0.72;
}

/* ============ VIEWS ============ */
.view { display: none; animation: fadeIn 220ms ease; }
.view.is-active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.admin-option {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  text-align: left;
  border: 1px solid rgba(16, 47, 83, 0.14);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--white) 0%, #f8fbff 100%);
  color: var(--navy-800);
  padding: 18px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 140ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.admin-option:hover,
.admin-option:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 90, 138, 0.42);
  box-shadow: 0 18px 34px -24px rgba(11, 27, 43, 0.46);
  outline: 0;
}

.admin-option span {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-option small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.income-bubble {
  background-color: #003b5c;
  background-image: linear-gradient(135deg, #002f4f, #005b7f);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 1px 0 rgba(0, 47, 79, 0.18), 0 18px 40px -22px rgba(0, 47, 79, 0.65);
}

.income-bubble .lede {
  color: rgba(255, 255, 255, 0.72);
}

.income-eyebrow {
  color: rgba(255, 255, 255, 0.76);
}

.income-display {
  color: var(--white);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 700;
  color: var(--pink-deep);
  margin: 0 0 5px;
}

.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-size: clamp(23px, 2.3vw, 30px);
  margin: 0;
  color: var(--navy-800);
}

.income-bubble .income-display {
  color: var(--white);
}

.income-bubble .income-eyebrow {
  color: rgba(255, 255, 255, 0.76);
}

.lede {
  margin: 5px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  max-width: 56ch;
}

.countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: var(--navy-800);
  color: var(--white);
  border-radius: 16px;
  min-width: 96px;
  box-shadow: var(--shadow-lift);
}

.countdown-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

/* ============ KPI ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.kpi {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 13px 14px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.kpi.income-bubble {
  background-color: #003b5c;
  background-image: linear-gradient(135deg, #002f4f, #005b7f);
  border-color: rgba(255, 255, 255, 0.14);
}

.kpi header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.005em;
}

.kpi-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 2.9vw, 34px);
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--navy-800);
  font-variant-numeric: tabular-nums;
}

.kpi-foot {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.kpi-primary { background: linear-gradient(135deg, #b42318, #e5484d); color: var(--white); border-color: #b42318; }
.kpi-primary .kpi-label, .kpi-primary .kpi-foot { color: rgba(255, 255, 255, 0.72); }
.kpi-primary .kpi-value { color: var(--white); }
.income-bubble::after,
.kpi-primary::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 200px;
  height: 200px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.24), transparent);
  pointer-events: none;
}

.chip-income {
  color: #003b5c;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.92);
}

.kpi-accent {
  background: linear-gradient(135deg, #c47a12, #f4b740);
  color: var(--white);
  border-color: #c47a12;
}
.kpi-accent .kpi-label,
.kpi-accent .kpi-foot {
  color: rgba(255, 255, 255, 0.78);
}
.kpi-accent .kpi-value {
  color: var(--white);
}
.kpi-everyday {
  background: linear-gradient(135deg, #16875f, #33b87a);
  color: var(--white);
  border-color: #16875f;
}
.kpi-everyday .kpi-label,
.kpi-everyday .kpi-foot {
  color: rgba(255, 255, 255, 0.78);
}
.kpi-everyday .kpi-value {
  color: var(--white);
}
.kpi-everyday.is-shortfall {
  border-color: rgba(200, 49, 107, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #fff6f9 100%);
  color: var(--ink);
}
.kpi-everyday.is-shortfall .kpi-label,
.kpi-everyday.is-shortfall .kpi-foot {
  color: var(--muted);
}
.kpi-everyday.is-shortfall .kpi-value {
  color: var(--pink-deep);
}

.chip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-chip);
}

.chip-bills { background: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.9); }
.chip-savings { background: var(--pink-soft); color: var(--pink-deep); }
.chip-everyday { background: var(--green-soft); color: var(--green); }
.is-shortfall .chip-everyday { background: var(--pink-soft); color: var(--pink-deep); }

.dashboard-chart-card {
  margin-bottom: 12px;
}

.split-chart {
  display: grid;
  gap: 13px;
}

.split-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  align-items: center;
  gap: 14px;
}

.split-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 800;
}

.split-label strong {
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.split-track {
  display: flex;
  width: 100%;
  height: 22px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(11, 27, 43, 0.05);
}

.split-seg {
  display: block;
  min-width: 0;
  height: 100%;
  transition: width 320ms ease;
}

.split-stack-labeled .split-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  line-height: 1.15;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.38);
}

.split-stack-labeled .split-seg:last-child { border-right: 0; }

.split-stack-labeled .split-seg > span {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chart-income {
  background-color: #003b5c;
  background-image: linear-gradient(135deg, #002f4f, #005b7f);
}

.chart-bills { background: linear-gradient(135deg, #b42318, #e5484d); }
.chart-goals { background: linear-gradient(135deg, #c47a12, #f4b740); }
.chart-surplus { background: linear-gradient(135deg, #16875f, #33b87a); }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend em {
  color: var(--navy-800);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.legend-income { background: #003b5c; }
.legend-bills { background: #e5484d; }
.legend-goals { background: #f4b740; }
.legend-surplus { background: #33b87a; }

.goal-tracker-card {
  margin-bottom: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf8f1 100%);
}

.goal-tracker-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.goal-tracker-summary > div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px 12px;
}

.goal-tracker-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.goal-tracker-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.goal-target-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 5px;
}

.goal-target-bar {
  display: flex;
  width: 100%;
  min-height: 42px;
  border-radius: 18px;
  background: var(--paper-2);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(11, 27, 43, 0.06);
}

.goal-target-seg {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: var(--white);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  line-height: 1.15;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.38);
}

.goal-target-seg span {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.goal-color-0 { background: linear-gradient(135deg, #c47a12, #f4b740); }
.goal-color-1 { background: linear-gradient(135deg, #9b4d12, #d89135); }
.goal-color-2 { background: linear-gradient(135deg, #b6871f, #ffd36a); color: #3d2a05; }
.goal-color-3 { background: linear-gradient(135deg, #7c5b17, #bd8a2b); }

.goal-target-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.goal-expected-row {
  margin-top: 12px;
}

.goal-expected-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}

.goal-expected-track {
  height: 22px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(11, 27, 43, 0.06);
}

.goal-expected-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #16875f, #33b87a);
  transition: width 320ms ease;
}

.goal-tracker-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.goal-tracker-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.goal-tracker-item strong {
  color: var(--navy-800);
  font-variant-numeric: tabular-nums;
}

/* ============ CARDS ============ */
.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 12px;
}

.grid-2-tight { grid-template-columns: 1fr 1fr; }

.dashboard-reminders-grid {
  grid-template-columns: 1fr;
}

.things-card {
  border-color: rgba(16, 47, 83, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--navy-800);
}

.muted { color: var(--muted); font-size: 13px; }
.muted.small { font-size: 13px; margin-top: 0; }

/* ============ FORMULA + BAR ============ */
.formula {
  background: var(--paper);
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
}

.formula-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  font-variant-numeric: tabular-nums;
}

.formula-row.is-sub .formula-label { color: var(--muted); }

.formula-row.is-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-strong);
  font-weight: 700;
}

.formula-label { font-size: 13px; }
.formula-val { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--navy-800); }
.formula-row.is-total .formula-val { color: var(--green); font-size: 18px; }

.bar {
  display: flex;
  width: 100%;
  height: 14px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 8px;
}

.bar[hidden] {
  display: none;
}

.bar-seg { display: block; height: 100%; flex: 0 0 auto; transition: width 320ms ease; }
.seg-bills { background: var(--navy-800); }
.seg-savings { background: var(--pink); }
.seg-everyday { background: var(--green); }

.bar-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.bar-context {
  color: var(--navy-800);
  font-weight: 800;
}

.bar-legend em { color: var(--navy-800); font-style: normal; font-weight: 600; margin-left: 4px; }

.bar-legend.is-amounts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.bar-legend.is-amounts .bar-context {
  grid-column: 1 / -1;
}

.bar-legend.is-amounts span:not(.bar-context) {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  justify-content: space-between;
}

.bar-legend.is-amounts .dot {
  display: none;
}

.bar-legend.is-amounts em {
  margin-left: 8px;
  font-weight: 800;
}

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-bills { background: var(--navy-800); }
.dot-savings { background: var(--pink); }
.dot-everyday { background: var(--green); }
.dot-shortfall { background: var(--pink-deep); }

.explainer {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.shortfall-note {
  margin: 7px 0 0;
  padding: 8px 9px;
  border: 1px solid rgba(200, 49, 107, 0.22);
  background: var(--pink-soft);
  color: var(--pink-deep);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

/* ============ REMINDERS ============ */
.reminders { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }

.reminders li {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 2px;
  border-bottom: 1px solid var(--line);
}

.reminders li:last-child { border-bottom: 0; }

.rem-date {
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 0 4px;
  line-height: 1;
}

.rem-date .d { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--navy-800); }
.rem-date .m { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-top: 2px; }

.rem-main { line-height: 1.25; }
.rem-name { font-weight: 600; color: var(--navy-800); font-size: 14px; }
.rem-sub { font-size: 12px; color: var(--muted); }

.rem-amount { font-family: var(--font-display); font-weight: 700; color: var(--navy-800); font-variant-numeric: tabular-nums; }

.todo-action {
  color: var(--pink-deep);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.things-list .things-item {
  grid-template-columns: 40px 1fr;
  align-items: start;
}

.todo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.todo-bubble {
  border: 1px solid rgba(16, 47, 83, 0.14);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy-800);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 18px -16px rgba(11, 27, 43, 0.45);
  transition: transform 140ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.todo-bubble:hover,
.todo-bubble:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 90, 138, 0.42);
  outline: 0;
}

.todo-add,
.todo-save {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: var(--white);
}

.todo-paid {
  background: #e8f6ec;
  border-color: rgba(56, 133, 83, 0.28);
  color: #25633d;
}

.todo-paid.is-disabled,
.todo-paid:disabled {
  background: #f1f1f1;
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.todo-secondary {
  background: var(--paper);
  color: var(--muted);
}

.todo-amount-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed rgba(16, 47, 83, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.todo-money-input {
  max-width: 150px;
}

.empty-reminder {
  display: block !important;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 2px !important;
}

/* ============ FORM FIELDS ============ */
.field-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.005em;
}

.label-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.tooltip-icon {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(16, 47, 83, 0.18);
  border-radius: 50%;
  background: var(--white);
  color: var(--navy-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  position: relative;
}

.tooltip-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 9px);
  width: min(320px, 78vw);
  padding: 10px 11px;
  border-radius: 12px;
  background: var(--navy-800);
  color: var(--white);
  box-shadow: var(--shadow-card);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 30;
}

.tooltip-icon:hover::after,
.tooltip-icon:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.field input,
.field select,
.money-input {
  border: 1px solid var(--line-strong);
  background: var(--white);
  border-radius: var(--radius-input);
  padding: 11px 12px;
  font-size: 15px;
  color: var(--navy-800);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input:focus,
.field select:focus,
.money-input:focus-within {
  outline: 0;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-soft);
}

.variable-history {
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.variable-history > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.variable-history-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.variable-history-panel[hidden] {
  display: none !important;
}

.bill-history-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(16, 47, 83, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--navy-800);
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.bill-history-toggle:hover,
.bill-history-toggle:focus-visible {
  border-color: rgba(255, 90, 138, 0.38);
  box-shadow: 0 0 0 3px var(--pink-soft);
  outline: 0;
}

.bill-history-label {
  display: grid;
  gap: 3px;
  text-align: left;
}

.bill-history-summary {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
}

.bill-history-toggle strong {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--navy-800);
  color: var(--white);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.variable-history-panel {
  margin-top: 10px;
}

.variable-history-panel > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.guided-history-inputs {
  grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.variable-history .money-input {
  padding: 0 8px;
}

.variable-history .money-input input {
  min-width: 0;
  padding: 8px 0;
  font-size: 13px;
}

.guided-history-inputs .gb-history-amt::placeholder {
  font-size: 10px;
  letter-spacing: -0.04em;
  opacity: 0.78;
}

.bill-average-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.money-input {
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.money-input .money-prefix {
  color: var(--muted);
  margin-right: 6px;
  font-weight: 600;
}

.money-input input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 11px 0;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.money-input input:focus { outline: none; }

/* ============ ROWS (goals & bills) ============ */
.rows { display: flex; flex-direction: column; gap: 10px; }

.row-goal {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 150px 150px 116px 36px;
  gap: 10px;
  align-items: center;
}

.row-goal .money-input { padding: 0 10px; }

.row-goal .g-date {
  border: 1px solid var(--line-strong);
  background: var(--white);
  border-radius: var(--radius-input);
  padding: 11px 12px;
  font-size: 14px;
}

.row-goal .g-date:focus {
  outline: 0;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-soft);
}

.goal-per-pay {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  line-height: 1.1;
}

.goal-per-pay span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.goal-per-pay strong {
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.btn-icon {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.btn-icon:hover { color: var(--pink-deep); border-color: var(--pink); background: var(--pink-soft); }

.btn-ghost {
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--navy-800);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.btn-ghost:hover { border-color: var(--pink); color: var(--pink-deep); background: var(--pink-soft); }

.btn {
  border: 0;
  background: var(--navy-800);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 120ms ease, background 160ms ease;
}

.btn:hover { background: var(--charcoal); }
.btn:active { transform: translateY(1px); }

.btn.is-locked {
  background: #334155;
}


.card-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 14px;
}

.card-total strong {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--navy-800);
  font-variant-numeric: tabular-nums;
}

/* ============ BILLS TABLE ============ */
.table-wrap { overflow-x: auto; }

.bills-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.bills-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  padding: 0 8px 10px;
  border-bottom: 1px solid var(--line);
}

.bills-table td {
  padding: 8px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.bills-table tbody tr:last-child td { border-bottom: 0; }

.bills-table input,
.bills-table select {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--navy-800);
  transition: border-color 140ms ease, background 140ms ease;
  font-variant-numeric: tabular-nums;
}

.bills-table input:hover,
.bills-table select:hover { background: var(--paper); }

.bills-table input:focus,
.bills-table select:focus {
  outline: 0;
  border-color: var(--pink);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--pink-soft);
}

.bills-table tfoot td {
  padding: 14px 8px 4px;
  font-weight: 600;
  color: var(--muted);
  border-top: 1px dashed var(--line-strong);
  border-bottom: 0;
}

.bills-table tfoot .right { text-align: right; color: var(--navy-800); font-size: 16px; }
.bills-table tfoot strong { font-family: var(--font-display); font-size: 18px; font-variant-numeric: tabular-nums; }

td.col-amount { width: 260px; min-width: 260px; }
td.col-freq { width: 128px; }
td.col-type { width: 150px; }
td.col-date { width: 150px; }
td.col-perpay { width: 120px; font-family: var(--font-display); color: var(--navy-800); font-variant-numeric: tabular-nums; }
td.col-cat { width: 130px; }
td.col-remove { width: 44px; text-align: right; }

.bills-table .variable-history-inputs {
  grid-template-columns: 1fr;
}

.bill-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.bill-type-toggle label {
  position: relative;
  display: flex;
}

.bill-type-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bill-type-toggle span {
  width: 100%;
  padding: 9px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  line-height: 1;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.bill-type-toggle input:checked + span {
  border-color: rgba(255, 90, 138, 0.42);
  background: var(--pink-soft);
  color: var(--pink-deep);
}

.bill-type-toggle input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--pink-soft);
}

/* ============ GUIDED SET UP ============ */
.guided-setup-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.setup-stepper-card {
  background: var(--navy-800);
  color: var(--white);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  box-shadow: var(--shadow-lift);
  position: static;
}

.setup-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.66);
}

.setup-progress-label strong {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -0.01em;
}

.setup-meter {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  margin: 10px 0 12px;
}

.setup-meter span {
  display: block;
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--pink), #ffc2d3);
  border-radius: inherit;
  transition: width 180ms ease;
}

.setup-step-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.setup-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.setup-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-weight: 800;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.setup-step span:last-child {
  font-size: 13px;
  font-weight: 700;
}

.setup-step.is-active {
  background: var(--white);
  color: var(--navy-800);
}

.setup-step.is-active .setup-step-num {
  background: var(--pink-soft);
  color: var(--pink-deep);
}

.setup-step.is-profile-step {
  background: #dff0ff;
  border-color: rgba(66, 153, 225, 0.42);
  color: #0b3f67;
}

.setup-step.is-profile-step .setup-step-num {
  background: #8ecbff;
  color: #052f4f;
}

.setup-step.is-profile-step.is-active {
  background: #cfe8ff;
  color: #052f4f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.setup-callout {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.setup-callout strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pink-soft);
}

.setup-callout p {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}

.setup-wizard-card {
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

.setup-panel {
  flex: 1;
}

.setup-panel h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--navy-800);
}

.setup-panel > .muted {
  margin: 0 0 18px;
}

.setup-field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.guided-income-panel {
  background-color: #003b5c;
  background-image: linear-gradient(135deg, #002f4f, #005b7f);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 1px 0 rgba(0, 47, 79, 0.18), 0 18px 40px -22px rgba(0, 47, 79, 0.65);
}

.guided-income-panel .eyebrow,
.guided-income-panel h2,
.guided-income-panel .muted {
  color: var(--white);
}

.guided-income-panel .muted {
  opacity: 0.78;
}

.guided-income-panel .field > span {
  color: rgba(255, 255, 255, 0.84);
}

.guided-income-panel .money-input,
.guided-income-panel input,
.guided-income-panel select {
  background: var(--white);
}

.auth-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--paper) 0%, var(--white) 100%);
  margin-top: 18px;
}

.auth-mode-row {
  margin-top: 0;
}

.auth-stage {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--white);
}

.auth-stage .setup-field-row {
  margin-top: 0;
}

.auth-action-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-between;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
}

.auth-action-card span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.auth-action-card strong {
  font-family: var(--font-display);
  color: var(--navy-800);
  font-size: 17px;
  letter-spacing: -0.01em;
}

.new-password-stage .btn {
  margin-top: 12px;
}

.profile-status {
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--pink-soft);
  color: var(--pink-deep);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.profile-status.is-complete {
  background: rgba(32, 160, 111, 0.12);
  color: var(--green);
}

.profile-details-note {
  margin: 18px 0 0;
}

.currency-preview {
  padding: 15px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 16px;
}

.currency-preview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.currency-preview strong {
  display: block;
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.currency-preview p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.setup-card-head {
  align-items: flex-start;
  gap: 14px;
}

.setup-card-head .eyebrow {
  margin-bottom: 4px;
}

.setup-card-head h2 {
  margin: 0 0 4px;
}

.setup-card-head .muted {
  margin: 0;
}

.guided-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guided-row {
  display: grid;
  grid-template-columns: minmax(132px, 1fr) minmax(108px, 0.6fr) minmax(122px, 0.7fr) minmax(140px, 0.8fr) minmax(124px, 0.7fr) minmax(118px, 0.65fr) 36px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.guided-row.guided-goal-row {
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 0.9fr) minmax(145px, 0.8fr) minmax(120px, 0.65fr) 36px;
}

.guided-row .field {
  gap: 4px;
}

.guided-row .field input,
.guided-row .field select,
.guided-row .money-input {
  background: var(--white);
  padding-top: 9px;
  padding-bottom: 9px;
}

.guided-row .money-input {
  padding: 0 10px;
}

.guided-row .money-input input {
  padding: 9px 0;
}

.guided-row .variable-history {
  grid-column: 1 / -2;
  margin-top: 0;
}

.guided-row .guided-history {
  align-self: start;
}

.per-pay-pill {
  min-height: 62px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--white);
}

.per-pay-pill span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.per-pay-pill strong {
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px dashed var(--line-strong);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.review-card {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.review-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.review-card strong {
  display: block;
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.review-card-wide {
  grid-column: 1 / -1;
  background: var(--navy-800);
  border-color: var(--navy-800);
}

.review-card-wide.is-surplus {
  background: linear-gradient(135deg, #1f8f5d 0%, #45aa72 100%);
  border-color: rgba(31, 143, 93, 0.75);
  box-shadow: 0 18px 34px rgba(31, 143, 93, 0.22);
}

.review-card-wide.is-shortfall {
  background: linear-gradient(135deg, #a13544 0%, #d45462 100%);
  border-color: rgba(161, 53, 68, 0.75);
  box-shadow: 0 18px 34px rgba(161, 53, 68, 0.18);
}

.review-card-wide span {
  color: rgba(255, 255, 255, 0.68);
}

.review-card-wide strong {
  color: var(--white);
  font-size: 24px;
}

.review-celebration {
  margin-top: 16px;
}

.review-celebration[hidden] {
  display: none;
}

.review-success-moment {
  display: grid;
  grid-template-areas:
    "badge copy"
    "badge split";
  grid-template-columns: minmax(130px, 0.7fr) minmax(220px, 1.3fr);
  gap: 8px 12px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(31, 143, 93, 0.32);
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.34), transparent 34%),
    linear-gradient(135deg, #146b4b 0%, #1f8f5d 48%, #55b979 100%);
  box-shadow: 0 26px 52px rgba(31, 143, 93, 0.28);
  overflow: hidden;
  position: relative;
}

.review-success-moment::before,
.review-success-moment::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.review-success-moment::before {
  width: 190px;
  height: 190px;
  right: -72px;
  top: -84px;
}

.review-success-moment::after {
  width: 130px;
  height: 130px;
  left: -52px;
  bottom: -56px;
}

.success-badge {
  grid-area: badge;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 0 0 1px rgba(31, 143, 93, 0.08), 0 20px 34px rgba(0, 0, 0, 0.12);
  color: #146b4b;
  position: relative;
  z-index: 1;
  text-align: center;
}

.success-badge span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 143, 93, 0.12);
  color: #146b4b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.success-badge strong {
  max-width: 150px;
  color: #0f4f39;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.04;
}

.success-copy {
  grid-area: copy;
  align-self: center;
  position: relative;
  z-index: 1;
  color: var(--white);
}

.success-copy strong {
  display: block;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.04;
  margin-bottom: 5px;
}

.success-copy p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  line-height: 1.3;
}

.success-split {
  grid-area: split;
  position: relative;
  z-index: 1;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.12);
}

.success-split-head,
.success-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.success-split-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.success-split-head strong {
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.success-bars {
  display: flex;
  height: 12px;
  margin: 6px 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 46, 84, 0.08);
}

.success-bar {
  display: block;
  width: 0;
  min-width: 0;
  transition: width 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

.success-bar-bills { background: #c4464f; }
.success-bar-savings { background: #f3bb3f; }
.success-bar-surplus { background: #1f8f5d; }

.success-legend {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.success-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--navy-700);
  font-size: 10px;
  font-weight: 800;
}

.success-legend strong {
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
}

.success-legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.legend-bills { background: #c4464f; }
.legend-savings { background: #f3bb3f; }
.legend-surplus { background: #1f8f5d; }

.review-success-moment.is-firing {
  animation: success-pop 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.review-success-moment.is-firing .success-badge {
  animation: badge-pop 860ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes success-pop {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
    box-shadow: 0 10px 20px rgba(31, 143, 93, 0.12);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 26px 52px rgba(31, 143, 93, 0.28);
  }
}

@keyframes badge-pop {
  0% {
    transform: scale(0.86);
  }
  58% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 720px) {
  .review-success-moment {
    grid-template-columns: 1fr;
  }

  .success-badge {
    min-height: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .review-success-moment.is-firing,
  .review-success-moment.is-firing .success-badge,
  .success-bar {
    animation: none;
    transition: none;
  }
}

/* ============ NOTIFICATION (PHONE) ============ */
.phone {
  display: flex;
  justify-content: center;
}

.phone-frame {
  width: 100%;
  max-width: 360px;
  background: var(--navy-900);
  border-radius: 38px;
  padding: 14px;
  box-shadow: var(--shadow-lift), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  position: relative;
}

.phone-notch {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 96px; height: 22px;
  background: #000;
  border-radius: 0 0 14px 14px;
  z-index: 1;
}

.phone-screen {
  background: linear-gradient(180deg, #122036 0%, #0c1a2b 100%);
  border-radius: 28px;
  padding: 42px 12px 16px;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.push-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.push-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.push-logo { width: 56px; height: 56px; object-fit: contain; image-rendering: -webkit-optimize-contrast; }
.push-app { font-weight: 700; font-size: 12px; color: var(--navy-800); }
.push-time { font-size: 11px; color: var(--muted); }

.push-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--navy-800);
  margin-bottom: 2px;
}

.push-body {
  font-size: 13px;
  color: var(--charcoal);
  line-height: 1.4;
}

.email-card {
  background: var(--white);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-from { display: flex; align-items: center; gap: 10px; }

.email-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--navy-800);
  color: var(--white);
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}

.email-name { font-size: 13px; font-weight: 700; color: var(--navy-800); }
.email-sub { font-size: 11px; color: var(--muted); }

.email-subject {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--navy-800);
}

.email-body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--charcoal);
  white-space: pre-wrap;
}

.notify-side { display: flex; flex-direction: column; gap: 16px; }

.due-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }

.due-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

.due-list li:last-child { border-bottom: 0; }

.due-name { font-weight: 600; color: var(--navy-800); font-size: 14px; }
.due-meta { font-size: 12px; color: var(--muted); }
.due-amt { font-family: var(--font-display); font-weight: 600; color: var(--navy-800); font-variant-numeric: tabular-nums; }

.actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.copy-status { font-size: 13px; color: var(--green); font-weight: 600; opacity: 0; transition: opacity 200ms ease; }
.copy-status.show { opacity: 1; }

.footnote {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: 0.02em;
}

/* ============ GUIDED DEMO ============ */
body.demo-active { overflow-x: hidden; }

.demo-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(7, 17, 28, 0.36);
  backdrop-filter: blur(2px);
  animation: demoFade 160ms ease;
}

.demo-focus {
  position: relative;
  z-index: 95;
  border-radius: var(--radius-card);
  box-shadow:
    0 0 0 4px rgba(255, 90, 138, 0.34),
    0 22px 60px -18px rgba(7, 17, 28, 0.55) !important;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.demo-panel {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 110;
  width: min(420px, calc(100vw - 32px));
  background: var(--white);
  border: 1px solid rgba(255, 90, 138, 0.22);
  border-radius: 22px;
  box-shadow: 0 24px 80px -24px rgba(7, 17, 28, 0.55);
  padding: 18px;
  animation: demoRise 180ms ease;
}

.demo-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.demo-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 50%;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.demo-close:hover {
  color: var(--pink-deep);
  border-color: var(--pink);
  background: var(--pink-soft);
}

.demo-meter {
  height: 6px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 16px;
}

.demo-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--pink), var(--pink-deep));
  border-radius: inherit;
  transition: width 180ms ease;
}

.demo-eyebrow { margin-top: 0; }

.demo-panel h2 {
  margin: 0;
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.demo-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.demo-panel blockquote {
  margin: 14px 0 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--navy-800);
  font-size: 14px;
  line-height: 1.45;
}

.demo-panel blockquote::before {
  content: "";
}

.demo-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-secondary,
.btn-demo-edit {
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--navy-800);
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
}

.btn-secondary:hover,
.btn-demo-edit:hover {
  border-color: var(--pink);
  background: var(--pink-soft);
  color: var(--pink-deep);
}

.btn-demo-edit {
  background: var(--pink-soft);
  color: var(--pink-deep);
  border-color: rgba(255, 90, 138, 0.34);
}

@keyframes demoFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes demoRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============ RESPONSIVE ============ */
@media (max-width: 920px) {
  .app { padding: 16px 16px 60px; }
  .topbar { grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  .tabs { justify-self: stretch; }
  .tab { flex: 1; padding: 9px 6px; }
  .admin-grid { grid-template-columns: 1fr; }
  .household { justify-self: start; }
  .top-actions {
    justify-self: stretch;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .demo-start,
  .reset-demo,
  .script-export,
  .presentation-toggle { width: 100%; }
  .view-header { flex-direction: column; align-items: flex-start; }
  .countdown { align-self: flex-start; flex-direction: row; gap: 10px; padding: 10px 14px; }
  .countdown-num { font-size: 22px; }
  .countdown-label { margin-top: 0; }
  .kpi-grid { grid-template-columns: 1fr; }
  .split-row { grid-template-columns: 1fr; gap: 7px; }
  .goal-tracker-summary,
  .goal-tracker-list { grid-template-columns: 1fr; }
  .grid-2, .grid-2-tight { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .row-goal { grid-template-columns: 1fr; }
  .row-goal .btn-icon { width: 100%; }
  .guided-setup-shell { grid-template-columns: 1fr; }
  .setup-stepper-card { padding: 12px; }
  .setup-step-list {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }
  .setup-step {
    grid-template-columns: 24px 1fr;
    gap: 6px;
    padding: 8px;
    text-align: left;
  }
  .setup-step span:last-child { font-size: 12px; }
  .guided-row,
  .guided-row.guided-goal-row { grid-template-columns: 1fr; }
  .guided-row .btn-icon { width: 100%; }
}

@media (max-width: 640px) {
  .display { font-size: 24px; }
  .kpi-value { font-size: 32px; }
  .card { padding: 18px; }
  .review-grid { grid-template-columns: 1fr; }
  .wizard-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .wizard-actions .btn,
  .wizard-actions .btn-secondary { width: 100%; }
  .demo-panel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    padding: 16px;
  }
  .demo-panel h2 { font-size: 19px; }
  .demo-actions { justify-content: stretch; }
  .demo-actions .btn,
  .demo-actions .btn-secondary,
  .demo-actions .btn-demo-edit { flex: 1; padding-left: 10px; padding-right: 10px; }

  /* Bills become a stacked card grid on mobile */
  .bills-table thead { display: none; }
  .bills-table, .bills-table tbody, .bills-table tfoot { display: block; }
  .bills-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr 36px;
    grid-template-areas:
      "name name remove"
      "amount freq remove"
      "type type type"
      "date cat cat"
      "perpay perpay perpay";
    gap: 6px 8px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
  }
  .bills-table td { padding: 0; border: 0; width: auto !important; }
  .bills-table td:nth-child(1) { grid-area: name; }
  .bills-table td:nth-child(2) { grid-area: amount; }
  .bills-table td:nth-child(3) { grid-area: freq; }
  .bills-table td:nth-child(4) { grid-area: type; }
  .bills-table td:nth-child(5) { grid-area: date; }
  .bills-table td:nth-child(6) { grid-area: perpay; padding: 8px 10px; border-radius: 10px; background: var(--paper); }
  .bills-table td:nth-child(7) { grid-area: cat; }
  .bills-table td:nth-child(8) { grid-area: remove; align-self: start; }

  .bills-table input, .bills-table select { background: var(--paper); border-color: var(--line); }
  .bills-table tfoot tr { display: flex; justify-content: space-between; padding: 14px 8px 0; }
}

/* ---------- Auth gate (sign in / sign up) ---------- */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top, #1b2742 0%, #0a1024 70%);
  overflow-y: auto;
}
.auth-gate[hidden] { display: none; }
.auth-gate-card {
  width: 100%;
  max-width: 640px;
  background: rgba(15, 22, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 32px 32px 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  color: #fff;
}
.auth-gate-brand { display: flex; justify-content: center; margin-bottom: 16px; }
.auth-gate-brand .brand-logo { height: 84px; width: auto; }
.auth-gate-title { font-size: 1.5rem; margin: 0 0 6px; text-align: center; color: #fff; }
.auth-gate-sub { margin: 0 0 20px; text-align: center; color: rgba(255,255,255,0.7); font-size: 0.95rem; }
.auth-gate .auth-panel { display: block; }
.auth-gate .profile-status { margin-top: 14px; color: rgba(255,255,255,0.85); font-size: 0.9rem; }

/* Amount bubble highlight when a bill has been confirmed paid via Things To Do */
.money-input.is-paid {
  background: #dcfce7;
  border-color: #16a34a;
}
.money-input.is-paid input,
.money-input.is-paid .money-prefix {
  color: #166534;
}
