﻿@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&family=Space+Grotesk:wght@500;700;800&display=swap');

:root {
  --bg: #f2f2ef;
  --bg-accent: #e4ead8;
  --bg-accent-2: #d5dcc9;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-soft: rgba(246, 247, 242, 0.84);
  --text: #181a16;
  --muted: #64685f;
  --line: rgba(24, 26, 22, 0.12);
  --navy: #252923;
  --teal: #b8e64b;
  --cyan: #8e9587;
  --lime: #d7f487;
  --peach: #b7bcae;
  --danger: #c43b4b;
  --danger-soft: rgba(196, 59, 75, 0.13);
  --shadow: 0 24px 60px rgba(18, 20, 16, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

body[data-theme="dark"] {
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--teal) 18%, var(--bg-accent) 82%), transparent 30%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--teal) 12%, transparent), transparent 24%),
    radial-gradient(circle at bottom left, color-mix(in srgb, var(--lime) 14%, transparent), transparent 24%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 78%, white 22%) 0%, var(--bg) 100%);
  transition: background 0.25s ease, color 0.25s ease;
}

.page-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  width: 90px;
  height: 90px;
  border-radius: 18px;
  object-fit: cover;
  clip-path: inset(10% round 14px);
  transform: scale(1.12);
  box-shadow: 0 18px 38px rgba(0,0,0,0.24);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.theme-toggle:hover { transform: translateY(-1px); }

.utility-button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.utility-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--teal), var(--line) 45%);
  background: var(--surface-soft);
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
  padding: 28px;
  border-radius: 32px;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--navy) 38%, #343434 62%),
      color-mix(in srgb, var(--teal) 20%, #7a7a7a 80%)
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent);
  color: white;
  box-shadow: var(--shadow);
}
.hero-copy {
  position: relative;
  min-height: 210px;
  display: grid;
  align-content: center;
  gap: 18px;
}
.hero-expense-button {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--lime) 58%, rgba(255,255,255,0.22) 42%);
  background: color-mix(in srgb, var(--lime) 82%, white 18%);
  color: #11130f;
  border-radius: 999px;
  padding: 11px 14px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(0,0,0,0.16);
}
.hero-expense-button:hover {
  transform: translateY(-1px);
}
.hero-expense-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(17,19,15,0.12);
  font-size: 0.95rem;
  line-height: 1;
}
.hero-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.82);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1;
}
.hero-meta span + span {
  padding-left: 10px;
  border-left: 1px solid rgba(255,255,255,0.22);
}
body[data-theme="dark"] .hero {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--surface-strong) 90%, var(--bg-accent) 10%),
      color-mix(in srgb, var(--surface-soft) 76%, var(--teal) 24%)
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
}

.eyebrow, .section-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
}
.hero h2, .section-heading h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.02;
}
.hero h2 { max-width: 12ch; font-size: clamp(2.2rem, 4vw, 4rem); }
.banker-card {
  min-height: 280px;
  display: grid;
  align-content: start;
  gap: 10px;
}
.budget-workspace {
  display: grid;
  gap: 22px;
}

.budget-planner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 22px;
  align-items: stretch;
}
.budget-module-shell {
  display: grid;
  align-content: start;
  gap: 12px;
}
.analytics-module-heading {
  padding: 0 2px;
}

.budget-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.budget-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}
.budget-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.budget-analytics-button {
  min-height: 40px;
  padding: 9px 16px;
}
.budget-paycheck-field {
  margin: 0;
}
.budget-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.savings-calculator-card {
  display: grid;
  gap: 18px;
}

.savings-calculator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.savings-duration-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.savings-result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.budget-stat {
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}
.budget-stat span,
.budget-stat small {
  color: var(--muted);
  font-weight: 800;
}
.budget-stat span {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}
.budget-stat strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.3rem, 2vw, 2rem);
  line-height: 1;
}
.budget-stat.is-negative strong {
  color: var(--danger);
}
.budget-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
  gap: 22px;
  align-items: start;
}
.budget-bills-card {
  grid-row: span 2;
}
.budget-bill-list,
.budget-activity-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.budget-bill-row,
.budget-activity-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 150px) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
}
.budget-bill-row:nth-child(even),
.budget-activity-item:nth-child(even) {
  background: color-mix(in srgb, var(--line) 42%, var(--surface) 58%);
}
.budget-bill-row.is-paid {
  opacity: 0.72;
}
.budget-bill-row strong,
.budget-activity-item strong {
  display: block;
}
.budget-bill-row span,
.budget-activity-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}
.budget-bill-row input {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}
.budget-expense-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.budget-expense-form .full,
.budget-expense-form .primary-button {
  grid-column: 1 / -1;
}
.budget-expense-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 10px;
}
.budget-money-button {
  min-height: 52px;
  font-weight: 800;
}
.budget-activity-item {
  grid-template-columns: minmax(0, 1fr) auto;
}
.budget-activity-item > strong,
.budget-activity-actions > strong {
  font-family: "Space Grotesk", sans-serif;
}
.money-positive {
  color: var(--money-good);
}
.budget-activity-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.mini-action-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}
.mini-action {
  min-width: 0;
  padding: 7px 12px;
  font-size: 0.78rem;
  border-radius: 999px;
}
.mini-action-edit {
  border-color: transparent;
}
.mini-action-delete {
  border-color: transparent;
}

.hero-panel, .card {
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.hero-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
  border-radius: 24px;
  background: color-mix(in srgb, rgba(255, 255, 255, 0.14) 70%, var(--teal) 30%);
}
.stat-chip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
}
.stat-chip span, .hero-note { color: rgba(255, 255, 255, 0.8); }
.stat-chip strong { font-family: "Space Grotesk", sans-serif; font-size: 1.3rem; }

.tab-bar {
  display: inline-flex;
  gap: 10px;
  margin: 22px 0 18px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  backdrop-filter: blur(12px);
}
.tab-button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 12px 18px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.tab-button:hover { transform: translateY(-1px); }
.tab-button.is-active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--lime) 52%, white 48%), color-mix(in srgb, var(--teal) 66%, white 34%));
  color: #121212;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.28);
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 24px;
  border: 1px solid var(--line);
}
.overview-layout { align-items: start; }
.look-ahead-card { grid-column: 1 / 2; }
.due-card { grid-column: 2 / 3; grid-row: 1 / span 2; }

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}
.action-button-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.controls-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.field, .table-input, .primary-button, .ghost-button { font: inherit; }
.field { display: grid; gap: 8px; }
.field span { font-weight: 700; }
.field input, .field select, .table-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 13px 14px;
  font-weight: 700;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field select:focus, .table-input:focus {
  outline: none;
  border-color: rgba(90, 90, 90, 0.55);
  box-shadow: 0 0 0 5px rgba(90, 90, 90, 0.12);
  transform: translateY(-1px);
}
.field .select-shell + input { display: none; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--teal) 18%, transparent), transparent 34%),
    linear-gradient(135deg, var(--bg), color-mix(in srgb, var(--teal) 12%, var(--bg)));
}
.auth-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.auth-loading-card {
  min-height: 160px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.auth-logo {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}
.auth-brand span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.auth-brand h1 {
  margin: 2px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.35rem);
  line-height: 1.05;
}
.auth-copy {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 700;
}
.auth-form {
  display: grid;
  gap: 16px;
}
.auth-submit {
  width: 100%;
  min-height: 48px;
}
.auth-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}
.auth-switch {
  width: 100%;
  margin-top: 16px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}
.auth-alert {
  border: 1px solid color-mix(in srgb, var(--teal) 38%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--teal) 12%, transparent);
  color: var(--text);
  padding: 11px 12px;
  font-weight: 800;
}
.auth-alert.is-error {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
}

.select-shell { position: relative; }
.select-shell::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 10px;
  height: 10px;
  border-right: 2px solid color-mix(in srgb, var(--text) 72%, transparent);
  border-bottom: 2px solid color-mix(in srgb, var(--text) 72%, transparent);
  transform: translateY(-58%) rotate(45deg);
  pointer-events: none;
}
.select-shell select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 48px;
  line-height: 1.2;
  padding-right: 44px;
}

.helper-text { margin: 14px 0 0; color: var(--muted); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}
.summary-card {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  overflow: hidden;
  min-width: 0;
}
.summary-card span { font-weight: 700; }
.summary-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.35rem, 2.1vw, 2.35rem);
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.summary-detail {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary-card.due { background: linear-gradient(180deg, color-mix(in srgb, var(--teal) 18%, white 82%), color-mix(in srgb, var(--cyan) 12%, white 88%)); }
.summary-card.remaining { background: linear-gradient(180deg, color-mix(in srgb, var(--navy) 12%, white 88%), color-mix(in srgb, var(--cyan) 10%, white 90%)); }
.summary-card.count { background: linear-gradient(180deg, color-mix(in srgb, var(--peach) 44%, white 56%), color-mix(in srgb, var(--bg-accent-2) 44%, white 56%)); }
body[data-theme="dark"] .summary-card.due {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-soft) 82%, var(--lime) 18%),
    color-mix(in srgb, var(--surface-strong) 86%, var(--surface-soft) 14%)
  );
}
body[data-theme="dark"] .summary-card.remaining {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-soft) 84%, var(--cyan) 16%),
    color-mix(in srgb, var(--surface-strong) 86%, var(--surface-soft) 14%)
  );
}
body[data-theme="dark"] .summary-card.count {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-soft) 86%, var(--teal) 14%),
    color-mix(in srgb, var(--surface-strong) 88%, var(--surface-soft) 12%)
  );
}

.period-paydown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.period-paydown-card {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 92%, var(--navy) 8%);
}
.period-paydown-card p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.period-paydown-card strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.28rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.period-paydown-card span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}
.period-paydown-card.is-paid-down {
  background: color-mix(in srgb, var(--teal) 14%, var(--surface-strong) 86%);
}

.pay-period-clean {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}
.pay-period-clean-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}
.pay-period-clean-header span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}
.pay-period-clean-header strong {
  color: var(--text);
  font-size: 0.88rem;
  white-space: nowrap;
}
.pay-period-clean-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.pay-period-clean-card {
  min-width: 0;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 92%, var(--navy) 8%);
}
.pay-period-clean-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pay-period-clean-card strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pay-period-clean-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.pay-period-clean-card.is-paid {
  background: color-mix(in srgb, var(--teal) 14%, var(--surface-strong) 86%);
}
.pay-period-clean-card.is-still-due {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 22%, transparent);
}
.pay-period-clean-card.is-still-due strong {
  color: var(--danger);
}
.pay-period-clean-card.is-still-due.is-clear {
  background: color-mix(in srgb, var(--teal) 16%, var(--surface-strong) 84%);
  border-color: color-mix(in srgb, var(--teal) 32%, transparent);
}
.pay-period-clean-card.is-still-due.is-clear strong {
  color: color-mix(in srgb, var(--teal) 58%, var(--text) 42%);
}
.pay-period-clean-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 96%, var(--teal) 4%);
}
.pay-period-clean-footer span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}
.pay-period-clean-footer strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.pay-period-clean-footer.is-negative strong {
  color: var(--danger);
}

.look-ahead { padding: 0; }
.look-ahead-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.look-ahead-title-group { min-width: 0; }
.look-ahead-tools { display: grid; gap: 12px; justify-items: end; }
.look-ahead-header h3 { margin: 4px 0 0; font-family: "Space Grotesk", sans-serif; font-size: 1.25rem; }
.calendar-nav { display: inline-flex; gap: 8px; }
.calendar-nav-button { padding: 10px 14px; }
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.calendar-weekday {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.calendar-day {
  min-height: 106px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  display: grid;
  align-content: start;
  gap: 8px;
}
.calendar-day.is-outside { opacity: 0.4; }
.calendar-day.is-today {
  border: 2px solid color-mix(in srgb, var(--navy) 78%, var(--cyan) 22%);
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--surface-strong) 88%, transparent),
    0 0 0 2px color-mix(in srgb, var(--navy) 20%, transparent);
  background: color-mix(in srgb, var(--cyan) 10%, var(--surface-strong) 90%);
}
.calendar-today-badge {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--teal) 78%, white 22%),
    color-mix(in srgb, var(--lime) 82%, white 18%)
  );
  color: #151713;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}
.calendar-day-number { font-weight: 800; font-variant-numeric: tabular-nums; }
.calendar-day-bills { display: grid; gap: 6px; }
.calendar-bill-chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 8px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  color: var(--text);
  font-size: 0.76rem;
  line-height: 1.2;
}
.calendar-bill-chip span {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-bill-chip.is-auto { border: 1px solid color-mix(in srgb, var(--teal) 26%, transparent); }
.calendar-empty { color: var(--muted); font-size: 0.85rem; padding: 14px 4px 4px; }

/* â”€â”€ Payday cell â€” visibly green (Brandon) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.calendar-day.is-payday {
  border-color: color-mix(in srgb, var(--lime) 70%, transparent);
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--lime) 50%, var(--surface-strong) 50%),
    color-mix(in srgb, var(--teal) 22%, var(--surface-strong) 78%)
  );
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lime) 50%, transparent);
}
body[data-theme="dark"] .calendar-day.is-payday {
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--surface-soft) 68%, var(--lime) 32%),
    color-mix(in srgb, var(--surface-strong) 78%, var(--cyan) 22%)
  );
  border-color: color-mix(in srgb, var(--lime) 44%, var(--line) 56%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lime) 26%, transparent);
}
.calendar-payday-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lime) 40%, transparent);
  color: color-mix(in srgb, var(--text) 86%, #123a24 14%);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.due-list { display: grid; gap: 9px; margin-top: 14px; }
.due-item, .empty-state { border-radius: 14px; background: var(--surface-strong); border: 1px solid var(--line); }
.due-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}
.due-item.is-paid {
  background: color-mix(in srgb, var(--line) 70%, transparent);
}
.due-item.is-paid h3,
.due-item.is-paid p {
  opacity: 0.7;
}
.due-item h3 { margin: 0; font-size: 0.98rem; }
.due-item p, .empty-state { margin: 0; color: var(--muted); font-size: 0.82rem; }
.due-item strong { font-family: "Space Grotesk", sans-serif; font-size: 1.02rem; }
.due-item .expense-amount { color: var(--danger); }
.due-item .expense-amount.is-paid {
  color: var(--muted);
  opacity: 0.82;
}
.due-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.due-button-stack {
  display: grid;
  gap: 5px;
  justify-items: stretch;
}
.paid-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  z-index: 3;
  pointer-events: auto;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.paid-toggle:hover { transform: translateY(-1px); }
.paid-toggle.is-paid {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--lime) 60%, white 40%),
    color-mix(in srgb, var(--teal) 58%, white 42%)
  );
  color: #101010;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.paid-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  margin-left: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--navy) 18%, var(--surface-strong) 82%);
  color: var(--navy);
  border: 1px solid color-mix(in srgb, var(--navy) 20%, transparent);
  font-size: 0.72rem;
  font-weight: 800;
  vertical-align: middle;
}
.paid-pill {
  background: linear-gradient(135deg, color-mix(in srgb, var(--teal) 68%, white 32%), color-mix(in srgb, var(--lime) 58%, white 42%));
  color: #151713;
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line) 45%);
}
.empty-state { padding: 18px; }

.primary-button, .ghost-button {
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}
.primary-button:hover, .ghost-button:hover { transform: translateY(-1px); }
.primary-button {
  padding: 12px 16px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--teal) 78%, white 22%),
    color-mix(in srgb, var(--lime) 82%, white 18%)
  );
  color: #151713;
  border: 1px solid color-mix(in srgb, var(--navy) 18%, transparent);
  font-weight: 800;
}
.ghost-button {
  padding: 10px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--navy) 10%, transparent);
  color: var(--navy);
  font-weight: 700;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: rgba(18, 52, 74, 0.14);
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(17, 38, 49, 0.18);
  transition: transform 0.2s ease;
}
.toggle-label { font-weight: 700; color: var(--muted); }
.toggle input:checked + .toggle-track { background: linear-gradient(135deg, var(--navy), var(--teal)); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.toggle input:checked ~ .toggle-label { color: var(--navy); }

.table-wrap { overflow-x: hidden; margin-top: 18px; }
.bills-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 0;
}
.bills-table th {
  text-align: left;
  padding: 0 12px 14px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bills-table td { padding: 10px 12px; border-top: 1px solid var(--line); }
/* 7-col bills table: Name, Amount, Frequency, Due Date, Auto-pay, Notes, Actions */
.bills-table th:nth-child(1) { width: 22%; }
.bills-table th:nth-child(2) { width: 14%; }
.bills-table th:nth-child(3) { width: 13%; }
.bills-table th:nth-child(4) { width: 10%; }
.bills-table th:nth-child(5) { width: 8%; text-align: center; }
.bills-table th:nth-child(6) { width: 25%; }
.bills-table th:nth-child(7) { width: 8%; text-align: center; }
.bills-table td:nth-child(1) { width: 22%; }
.bills-table td:nth-child(2) { width: 14%; }
.bills-table td:nth-child(3) { width: 13%; }
.bills-table td:nth-child(4) { width: 10%; }
.bills-table td:nth-child(5) { width: 8%; text-align: center; }
.bills-table td:nth-child(6) { width: 25%; }
.bills-table td:nth-child(7) { width: 8%; text-align: center; }
/* 6-col debt table: Name, Balance, APR, Category, Min Payment, Actions */
.debt-table { table-layout: fixed; min-width: 0; }
.debt-table th { padding-inline: 8px; }
.debt-table td { padding-inline: 8px; }
.debt-table td:nth-child(1) { width: 23%; }
.debt-table td:nth-child(2) { width: 18%; }
.debt-table td:nth-child(3) { width: 11%; }
.debt-table td:nth-child(4) { width: 17%; }
.debt-table td:nth-child(5),
.debt-table th:nth-child(5) {
  width: 19%;
  min-width: 96px;
}
.debt-table td:nth-child(6),
.debt-table th:nth-child(6) {
  width: 10%;
  min-width: 66px;
}
.bills-table tr { animation: rise-in 0.32s ease both; }
.bills-table td, .bills-table th { vertical-align: middle; }
.bills-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--navy) 6%, transparent);
}
.bills-table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--surface-strong) 42%, transparent);
}
.bills-table tbody tr {
  border-radius: 14px;
}

.cell-view {
  min-height: 48px;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  font-weight: 700;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
  word-break: normal;
}
.debt-table .cell-view {
  min-width: 0;
  padding: 10px;
  font-size: 0.86rem;
}
.debt-table td:first-child .cell-view {
  min-width: 0;
  white-space: normal;
}
.debt-table .money-input {
  white-space: nowrap;
}
.debt-table td:nth-child(5) .cell-view {
  justify-content: center;
  min-width: 86px;
  padding-inline: 8px;
  white-space: nowrap;
}
.debt-table td:nth-child(6) .ghost-button {
  min-width: 50px;
  padding-inline: 10px !important;
}
.cell-view.is-empty, .cell-view.is-muted { color: var(--muted); }
.cell-view.is-empty { font-style: italic; font-weight: 400; }
.cell-view-note {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auto-pay-pill, .freq-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  line-height: 1;
  font-weight: 700;
}
.auto-pay-pill {
  min-width: 42px;
  padding: 7px 10px;
  font-size: 0.8rem;
}
.auto-pay-pill.is-on {
  background: linear-gradient(135deg, color-mix(in srgb, var(--teal) 72%, white 28%), color-mix(in srgb, var(--lime) 74%, white 26%));
  color: #151713;
  border: 1px solid color-mix(in srgb, var(--teal) 34%, transparent);
}
.auto-pay-pill.is-off {
  background: color-mix(in srgb, var(--line) 72%, var(--surface-strong) 28%);
  color: var(--muted);
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
}
.freq-tag {
  background: color-mix(in srgb, var(--navy) 14%, transparent);
  color: var(--navy);
  font-size: 0.8rem;
}
.category-filter {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  max-width: 100%;
  white-space: nowrap;
}
.debt-category-filter {
  width: fit-content;
  max-width: 100%;
  margin: 16px 0 4px;
}
.add-debt-button {
  flex: 0 0 auto;
  min-width: 118px;
}
.category-filter-button {
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 7px 8px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.category-filter-button:hover { transform: translateY(-1px); color: var(--text); }
.category-filter-button.is-active {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--teal) 78%, white 22%),
    color-mix(in srgb, var(--lime) 82%, white 18%)
  );
  color: #151713;
}
.payoff-card {
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(18, 20, 16, 0.05);
}
.payoff-card:nth-child(even) {
  background: color-mix(in srgb, var(--navy) 7%, var(--surface-strong) 93%);
}
.payoff-card:nth-child(odd) {
  background: color-mix(in srgb, var(--surface-strong) 96%, var(--teal) 4%);
}

.debt-layout .section-heading-row {
  align-items: start;
}
.debt-layout .action-button-row {
  flex: 1;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

@media (max-width: 1180px) {
  .debt-layout { grid-template-columns: 1fr; }
  .debt-table .cell-view { font-size: 0.92rem; }
  .budget-planner-grid,
  .budget-grid { grid-template-columns: 1fr; }
  .budget-bills-card { grid-row: auto; }
}

@media (max-width: 760px) {
  .budget-heading-row,
  .budget-card-header,
  .budget-stat-grid,
  .savings-calculator-grid,
  .savings-result-grid,
  .settings-section-grid,
  .settings-pay-grid,
  .budget-expense-form {
    grid-template-columns: 1fr;
  }
  .budget-card-header {
    flex-direction: column;
  }
  .pay-setup-summary-card {
    grid-template-columns: 1fr;
  }
  .pay-check-grid {
    grid-template-columns: 1fr;
  }
  .budget-bill-row {
    grid-template-columns: 1fr;
  }
  .budget-bill-row .paid-toggle {
    width: 100%;
  }
  .debt-table,
  .debt-table thead,
  .debt-table tbody,
  .debt-table tr,
  .debt-table th,
  .debt-table td {
    display: block;
    width: 100% !important;
  }
  .debt-table thead { display: none; }
  .debt-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
  }
  .debt-table td {
    border-top: none;
    padding: 0;
  }
  .debt-table td::before {
    content: attr(data-label);
    display: block;
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .debt-table td:first-child,
  .debt-table td:last-child {
    grid-column: 1 / -1;
  }
  .debt-table .cell-view {
    min-height: 44px;
  }
}

.inline-empty-state {
  margin: 18px 0 0;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  color: var(--muted);
  font-weight: 600;
}
.auto-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  margin-left: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--navy) 16%, var(--surface-strong) 84%);
  color: var(--navy);
  border: 1px solid color-mix(in srgb, var(--navy) 24%, transparent);
  font-size: 0.78rem;
  font-weight: 700;
  vertical-align: middle;
}
.freq-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  margin-left: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--peach) 28%, transparent);
  color: color-mix(in srgb, var(--text) 88%, #5f5f5f 12%);
  font-size: 0.74rem;
  font-weight: 700;
  vertical-align: middle;
}
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: color-mix(in srgb, var(--navy) 76%, var(--muted) 24%);
  border: none;
  font-size: 0.94rem;
  font-weight: 800;
  white-space: nowrap;
}
.extra-payment-box {
  display: grid;
  gap: 8px;
  margin: -4px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
}
.extra-payment-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}
.extra-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  margin-left: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lime) 26%, transparent);
  color: color-mix(in srgb, var(--teal) 75%, var(--text) 25%);
  font-size: 0.72rem;
  font-weight: 800;
  vertical-align: middle;
}
.extra-payment-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 150px);
  justify-content: end;
  gap: 10px;
  align-items: center;
  margin: 2px 0 12px;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.extra-payment-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}
.extra-payment-row .min-payment-note {
  display: inline-flex;
  margin: 0 8px 0 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--navy) 10%, var(--surface-strong) 90%);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 800;
  vertical-align: middle;
}
.interest-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.interest-bar > div {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}
.interest-bar.is-alert > div {
  background: var(--danger);
  opacity: 0.72;
}
.interest-bar.is-ok > div {
  background: color-mix(in srgb, var(--teal) 78%, var(--navy) 22%);
  opacity: 0.82;
}
.extra-payment-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
  font-weight: 800;
}
.money-negative { color: var(--danger) !important; }
.money-input { font-variant-numeric: tabular-nums; }

.dti-card { margin-top: 18px; }
.dti-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 14px;
  margin-top: 16px;
}
.dti-pill {
  align-self: start;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: color-mix(in srgb, var(--line) 65%, transparent);
  color: var(--muted);
}
.dti-pill.is-good {
  background: color-mix(in srgb, var(--lime) 28%, transparent);
  color: color-mix(in srgb, var(--teal) 70%, var(--text) 30%);
}
.dti-pill.is-watch {
  background: color-mix(in srgb, var(--peach) 34%, transparent);
  color: color-mix(in srgb, var(--text) 86%, #6a6a6a 14%);
}
.dti-pill.is-high {
  background: var(--danger-soft);
  color: var(--danger);
}
.dti-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.dti-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
}
.dti-summary span {
  color: var(--muted);
  font-weight: 700;
}
.dti-summary strong {
  font-family: "Space Grotesk", sans-serif;
  font-variant-numeric: tabular-nums;
}
.dti-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* â”€â”€ Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}
.modal-panel {
  width: min(520px, 100%);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
  animation: slideUp 0.22s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface-strong);
  z-index: 1;
}
.modal-title { margin: 0; font-family: "Space Grotesk", sans-serif; font-size: 1.25rem; font-weight: 700; }
.modal-close {
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 8px;
  border-radius: 10px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.modal-close:hover { color: var(--text); background: var(--line); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 22px;
  border-top: 1px solid var(--line);
}
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.modal-grid .full { grid-column: 1 / -1; }

/* â”€â”€ Tweaks panel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tweaks-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 230px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
  animation: slideUp 0.2s ease;
}
.tweaks-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
}
.tweaks-body { padding: 14px 16px; display: grid; gap: 14px; }
.tweaks-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

/* â”€â”€ Date inputs â€” fix black appearance (Brandon) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
input[type="date"] {
  color-scheme: light;
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: inherit;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
}
body[data-theme="dark"] input[type="date"] {
  color-scheme: dark;
}
input[type="date"]:focus {
  outline: none;
  border-color: rgba(90, 90, 90, 0.55);
  box-shadow: 0 0 0 5px rgba(90, 90, 90, 0.12);
}

/* â”€â”€ Search input â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.search-input {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  width: 190px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
  outline: none;
  border-color: rgba(90, 90, 90, 0.55);
  box-shadow: 0 0 0 4px rgba(90, 90, 90, 0.1);
}
.search-input::placeholder { color: var(--muted); font-weight: 400; }

/* â”€â”€ Category bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cat-bar { display: grid; gap: 10px; margin-top: 18px; }
.cat-bar-row { display: grid; gap: 6px; }
.cat-bar-meta { display: flex; justify-content: space-between; font-size: 0.88rem; font-weight: 700; }
.cat-bar-track { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--navy), var(--teal)); transition: width 0.5s ease; }

/* â”€â”€ Delete confirm â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.danger-ghost {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, opacity 0.15s;
}
.danger-ghost:hover { transform: translateY(-1px); opacity: 0.85; }

/* â”€â”€ Responsive â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 920px) {
  .hero, .layout { grid-template-columns: 1fr; }
  .hero h2 { max-width: none; }
  .hero-expense-button {
    position: static;
    width: fit-content;
  }
  .look-ahead-card, .due-card { grid-column: auto; grid-row: auto; }
  .table-wrap { overflow-x: auto; }
  .bills-table:not(.debt-table) { min-width: 780px; }
}
@media (max-width: 640px) {
  .page-shell { width: calc(100% - 20px); padding-top: 14px; }
  .topbar { align-items: start; flex-direction: column; }
  .topbar-actions { justify-content: flex-start; width: 100%; }
  .brand-logo { width: 76px; height: 76px; border-radius: 18px; }
  .hero, .card { padding: 18px; border-radius: 22px; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: 190px; }
  .hero-expense-button { width: 100%; }
  .hero-meta { border-radius: 14px; line-height: 1.25; }
  .hero-meta span + span { padding-left: 0; border-left: none; }
  .hero h2 { max-width: none; font-size: clamp(2rem, 10vw, 3rem); }
  .tab-bar { width: 100%; display: grid; grid-template-columns: 1fr 1fr 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .due-item { grid-template-columns: 1fr; gap: 10px; }
  .section-heading-row { flex-direction: column; align-items: start; }
  .action-button-row { width: 100%; }
  .search-input { width: 100%; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-grid .full { grid-column: 1; }
  .budget-expense-actions { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
  .bills-table:not(.debt-table) { min-width: 700px; }
  .dti-grid, .dti-summary { grid-template-columns: 1fr; }
}

.bills-table td:last-child .ghost-button { padding: 7px 12px !important; font-size: 0.8rem !important; }
.bills-table th:nth-child(5), .bills-table th:nth-child(7) { text-align: center; }

/* BillyHub settings, calendar counts, and payment tracking polish */
.settings-menu-wrap {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.settings-button {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.settings-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--lime) 45%, var(--line) 55%);
}

.settings-button.is-active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--lime) 52%, white 48%), color-mix(in srgb, var(--teal) 66%, white 34%));
  color: #121212;
  border-color: color-mix(in srgb, var(--teal) 62%, var(--line) 38%);
}
.account-pill {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 900;
}
.logout-button {
  padding-inline: 16px;
}

.settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 10px;
  min-width: 250px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-strong) 94%, var(--bg-accent) 6%);
  box-shadow: 0 18px 45px rgba(0,0,0,0.18);
}

.settings-menu button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.settings-menu button:hover {
  background: color-mix(in srgb, var(--lime) 22%, var(--surface-strong) 78%);
}

.settings-menu-section {
  display: grid;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.settings-subtitle {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.settings-option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-theme-grid .settings-chip {
  flex: 1 1 calc(50% - 4px);
}

.settings-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 88%, var(--bg-accent) 12%);
  color: var(--text);
  padding: 10px 12px;
  text-align: center;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.settings-chip:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--lime) 52%, var(--line) 48%);
  background: color-mix(in srgb, var(--lime) 18%, var(--surface-strong) 82%);
}

.settings-chip.is-active {
  border-color: color-mix(in srgb, var(--lime) 60%, var(--line) 40%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--lime) 72%, white 28%), color-mix(in srgb, var(--teal) 38%, var(--surface-strong) 62%));
  color: #151712;
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

.settings-page {
  max-width: 1120px;
}

.settings-page-card {
  display: grid;
  gap: 22px;
}

.settings-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.settings-block {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.settings-theme-block {
  gap: 8px;
  padding: 14px 18px;
}

.settings-block.full {
  grid-column: 1 / -1;
}

.settings-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-pay-block {
  order: -1;
  gap: 14px;
  background: color-mix(in srgb, var(--teal) 9%, var(--surface-strong) 91%);
}

.settings-pay-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-pay-summary,
.pay-setup-summary-card,
.calendar-pay-setup-pill {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--teal) 10%, var(--surface-strong) 90%);
}

.settings-pay-summary span,
.pay-setup-summary-card span,
.calendar-pay-setup-pill span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-pay-summary strong,
.pay-setup-summary-card strong,
.calendar-pay-setup-pill strong {
  font-family: "Space Grotesk", sans-serif;
}

.pay-setup-summary-card {
  grid-template-columns: minmax(0, 1fr) minmax(210px, 250px);
  align-items: start;
  gap: 12px 16px;
  margin-bottom: 12px;
}

.pay-setup-summary-card small {
  color: var(--muted);
  font-weight: 800;
}

.calendar-pay-setup-pill {
  min-width: 190px;
  padding: 9px 12px;
}

.pay-period-view-field {
  display: grid;
  gap: 5px;
}

.pay-period-view-field span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pay-period-view-field small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.pay-period-view-field select,
.pay-period-view-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-weight: 800;
}

.pay-period-card-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pay-period-card-main strong {
  font-size: 1.08rem;
}
.paycheck-amount-field {
  grid-column: auto;
}

.pay-check-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 250px);
  gap: 12px 16px;
  align-items: end;
}

.pay-check-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
}

.pay-check-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pay-check-card strong {
  font-family: "Space Grotesk", sans-serif;
}

.settings-page-theme-grid .settings-chip {
  flex: 1 1 130px;
  padding: 8px 10px;
  font-size: 0.8rem;
}

.settings-page-theme-grid {
  gap: 7px;
}

.settings-toggle {
  justify-content: start;
  width: fit-content;
}

.calendar-day {
  overflow: visible;
}

.calendar-day-count-wrap {
  position: relative;
  align-self: start;
}

.calendar-bill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 7px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lime) 28%, var(--surface-strong) 72%);
  border: 1px solid color-mix(in srgb, var(--lime) 42%, var(--line) 58%);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.calendar-bill-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: none;
  min-width: 210px;
  max-width: 280px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9faf4;
  box-shadow: 0 16px 38px rgba(0,0,0,0.18);
}

body[data-theme="dark"] .settings-menu,
body[data-theme="dark"] .calendar-bill-tooltip {
  background: color-mix(in srgb, var(--surface-strong) 90%, var(--bg-accent) 10%);
}

body[data-theme="dark"] .settings-chip {
  background: color-mix(in srgb, var(--surface-strong) 92%, var(--bg-accent) 8%);
}

body[data-theme="dark"] .settings-chip.is-active {
  border-color: color-mix(in srgb, var(--lime) 72%, var(--line) 28%);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--lime) 78%, white 22%),
    color-mix(in srgb, var(--teal) 54%, var(--surface-strong) 46%)
  );
  color: #141711;
  box-shadow: 0 14px 28px rgba(0,0,0,0.24);
}

.calendar-day-count-wrap:hover .calendar-bill-tooltip,
.calendar-day-count-wrap:focus-within .calendar-bill-tooltip {
  display: grid;
  gap: 8px;
}

.calendar-bill-tooltip-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  color: var(--text);
  font-size: 0.82rem;
}

.calendar-bill-tooltip-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-bill-tooltip-row strong {
  font-variant-numeric: tabular-nums;
}

.payment-modal-panel {
  max-width: 420px;
}
.confirm-modal-panel {
  max-width: 440px;
  background: var(--surface);
  border-color: color-mix(in srgb, var(--line) 72%, var(--lime) 28%);
}
.confirm-modal-copy {
  display: grid;
  gap: 8px;
  padding: 4px 0 2px;
}
.confirm-modal-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.98rem;
}
.confirm-modal-panel .modal-footer {
  border-top: 1px solid var(--line);
}

.payment-modal-summary {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  margin-bottom: 14px;
}

.payment-modal-summary strong {
  font-family: "Space Grotesk", sans-serif;
}

.payment-modal-summary span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.due-item-actions {
  min-width: 190px;
}

.paid-toggle.prepaid-toggle {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.paid-toggle.prepaid-toggle.is-paid {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--lime) 68%, white 32%),
    color-mix(in srgb, var(--teal) 42%, var(--lime) 58%)
  );
  border-color: color-mix(in srgb, var(--lime) 62%, var(--line) 38%);
  color: #151713;
}

.prepaid-pill {
  color: color-mix(in srgb, var(--text) 78%, var(--lime) 22%);
  border-color: color-mix(in srgb, var(--lime) 32%, transparent);
}

.app-footer {
  margin-top: 36px;
  text-align: right;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 720px) {
  .settings-menu-wrap,
  .settings-button {
    width: 100%;
  }

  .settings-menu {
    left: 0;
    right: auto;
    width: 100%;
  }

  .settings-theme-grid .settings-chip {
    flex-basis: 100%;
  }

  .app-footer {
    text-align: center;
  }
}

/* 2026 usability pass: contrast, compact command header, analytics, and mobile cards */
body[data-theme="dark"] {
  --surface: color-mix(in srgb, var(--surface-strong) 84%, white 10%);
  --surface-soft: color-mix(in srgb, var(--surface-strong) 74%, white 7%);
  --muted: color-mix(in srgb, var(--text) 76%, var(--bg) 24%);
  --line: color-mix(in srgb, var(--text) 20%, transparent);
}

body[data-theme="dark"] .tab-button,
body[data-theme="dark"] .section-kicker,
body[data-theme="dark"] .bills-table th,
body[data-theme="dark"] .field span,
body[data-theme="dark"] .toggle-label,
body[data-theme="dark"] .summary-detail,
body[data-theme="dark"] .dti-note,
body[data-theme="dark"] .min-payment-note {
  color: color-mix(in srgb, var(--text) 82%, var(--bg) 18%);
}

body[data-theme="dark"] .tab-button.is-active {
  color: #11130f;
}

body[data-theme="dark"] .card,
body[data-theme="dark"] .hero-panel,
body[data-theme="dark"] .cell-view,
body[data-theme="dark"] .payoff-card,
body[data-theme="dark"] .budget-bill-row,
body[data-theme="dark"] .budget-activity-item,
body[data-theme="dark"] .calendar-day {
  border-color: color-mix(in srgb, var(--text) 19%, transparent);
}

body[data-theme="dark"] .cell-view,
body[data-theme="dark"] .field input,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .search-input,
body[data-theme="dark"] .extra-payment-row input,
body[data-theme="dark"] .custom-priority-field input {
  background: color-mix(in srgb, var(--surface-strong) 82%, white 8%);
  color: var(--text);
}

body[data-theme="dark"] .bills-table tbody tr:nth-child(even),
body[data-theme="dark"] .bills-table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--surface-strong) 82%, white 5%);
}

.save-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.save-status span {
  min-width: 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero.hero-compact {
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: stretch;
  padding: 24px;
  overflow: hidden;
}
.hero.hero-compact * { min-width: 0; }
.hero-compact .hero-copy {
  min-height: 0;
  align-content: start;
  gap: 14px;
}
.hero-kicker {
  color: color-mix(in srgb, white 72%, var(--lime) 28%);
}
.hero-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}
.hero-compact .hero-expense-button {
  position: static;
  width: auto;
}
.hero-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.12);
  color: white;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.hero-secondary-button:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.18);
}
.hero-metrics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: stretch;
}
.hero-metrics-grid .stat-chip {
  min-height: 70px;
  align-items: start;
  flex-direction: column;
}
.hero-metrics-grid .stat-chip strong {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-metrics-grid .stat-chip.is-negative strong {
  color: var(--danger);
}

.budget-analytics-card {
  display: grid;
  gap: 18px;
}
.analytics-page {
  display: grid;
  gap: 18px;
}
.analytics-page-heading {
  margin-bottom: 0;
}
.budget-analytics-page-card {
  width: 100%;
}
.analytics-saved-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lime) 44%, var(--surface-strong) 56%);
  color: #12140f;
  font-weight: 900;
}
.analytics-saved-pill.is-negative {
  background: var(--danger-soft);
  color: var(--danger);
}
.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr) minmax(320px, 1fr);
  gap: 16px;
}
.analytics-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 220px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
}
.analytics-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.analytics-panel-heading span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.analytics-panel-heading strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
}
.category-analytics-list {
  display: grid;
  gap: 12px;
}
.category-analytics-row {
  display: grid;
  gap: 8px;
}
.category-analytics-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}
.analytics-bar {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
}
.analytics-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--lime));
}
.bill-progress-ring {
  width: 148px;
  height: 148px;
  justify-self: center;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface-strong) 0 55%, transparent 56%),
    conic-gradient(var(--lime) var(--progress), var(--line) 0);
}
.bill-progress-ring strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
}
.bill-progress-ring span {
  color: var(--muted);
  font-weight: 800;
}
.analytics-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.analytics-mini-grid div {
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.analytics-mini-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}
.monthly-trend-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  min-height: 156px;
  align-items: end;
}
.monthly-trend-column {
  display: grid;
  gap: 6px;
  min-width: 0;
  text-align: center;
}
.monthly-trend-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 4px;
  height: 96px;
  padding: 8px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1px solid var(--line);
}
.monthly-trend-bars span {
  display: block;
  min-height: 4px;
  border-radius: 999px 999px 3px 3px;
}
.monthly-trend-bars .is-inflow,
.trend-legend .is-inflow::before {
  background: var(--lime);
}
.monthly-trend-bars .is-outflow,
.trend-legend .is-outflow::before {
  background: var(--danger);
}
.monthly-trend-column strong {
  font-size: 0.8rem;
}
.monthly-trend-column small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}
.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.trend-legend span::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.payoff-strategy-controls,
.payoff-comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.strategy-button,
.comparison-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.strategy-button {
  padding: 10px 12px;
  font-weight: 900;
}
.strategy-button.is-active,
.comparison-card.is-active {
  border-color: color-mix(in srgb, var(--lime) 55%, var(--line) 45%);
  background: color-mix(in srgb, var(--lime) 25%, var(--surface-strong) 75%);
}
.comparison-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
}
.comparison-card span,
.comparison-card small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.comparison-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.04rem;
}
.payoff-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.payoff-method-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 172px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.payoff-method-card:hover {
  transform: translateY(-1px);
}
.payoff-method-card.is-active {
  border-color: color-mix(in srgb, var(--lime) 56%, var(--line) 44%);
  background: color-mix(in srgb, var(--lime) 19%, var(--surface-strong) 81%);
}
.payoff-method-card span,
.payoff-method-card small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.payoff-method-card p {
  margin: 0;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.45;
}
.payoff-method-card strong {
  align-self: end;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.12rem;
}
.payoff-method-note {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-strong) 82%, var(--lime) 18%);
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
}
.custom-priority-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
  font-weight: 800;
}
.custom-priority-field span {
  color: var(--muted);
}
.custom-priority-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  font-weight: 900;
}

.import-preview-panel {
  max-width: 640px;
}
.import-preview-summary {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}
.import-preview-summary span {
  color: var(--muted);
  font-weight: 700;
}
.import-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 90px;
  gap: 1px;
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
}
.import-preview-grid > * {
  padding: 11px 12px;
  background: var(--surface-strong);
}
.import-preview-head {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.import-preview-warning {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 760px) {
  .save-status {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    border-radius: 18px;
  }
  .save-status span {
    text-align: center;
  }
  .hero.hero-compact {
    padding: 18px;
  }
  .hero-action-row {
    display: grid;
    grid-template-columns: 1fr;
  }
  .hero-compact .hero-expense-button,
  .hero-secondary-button {
    width: 100%;
  }
  .hero-metrics-grid {
    grid-template-columns: 1fr;
  }
  .hero-metrics-grid .stat-chip {
    min-height: 0;
  }
  .hero-meta {
    display: grid;
    width: 100%;
    gap: 6px;
    border-radius: 16px;
  }
  .hero-meta span + span {
    padding-left: 0;
    border-left: none;
  }
  .payoff-strategy-controls,
  .payoff-comparison-grid,
  .payoff-method-grid,
  .analytics-mini-grid {
    grid-template-columns: 1fr;
  }
  .monthly-trend-chart {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .table-wrap {
    overflow-x: visible;
  }
  .bills-table,
  .bills-table thead,
  .bills-table tbody,
  .bills-table tr,
  .bills-table th,
  .bills-table td {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
  }
  .bills-table {
    min-width: 0 !important;
  }
  .bills-table thead {
    display: none;
  }
  .bills-table tbody {
    display: grid;
    gap: 12px;
  }
  .bills-table tr,
  .debt-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-strong) !important;
  }
  .bills-table td,
  .debt-table td {
    border-top: none;
    padding: 0;
  }
  .bills-table td::before,
  .debt-table td::before {
    content: attr(data-label);
    display: block;
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .bills-table td:first-child,
  .bills-table td:last-child,
  .bills-table td[data-label="Notes"],
  .debt-table td:first-child,
  .debt-table td:last-child {
    grid-column: 1 / -1;
  }
  .bills-table td:last-child .ghost-button,
  .debt-table td:last-child .ghost-button {
    width: 100%;
    min-height: 42px;
  }
  .cell-view,
  .debt-table .cell-view {
    min-height: 42px;
  }
}

@media (max-width: 460px) {
  .page-shell {
    width: calc(100% - 16px);
  }
  .hero-meta {
    display: grid;
    width: 100%;
  }
  .stat-chip {
    padding: 14px;
  }
  .import-preview-grid {
    grid-template-columns: minmax(0, 1fr) 72px 72px;
  }
}


