:root {
  --bg: #f7f4ee;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #17201c;
  --muted: #69746f;
  --line: #ded8cd;
  --green: #2f7d5c;
  --green-soft: #dff0e7;
  --teal: #267b88;
  --sun: #f5b84b;
  --coral: #de6b55;
  --coral-soft: #f9e4df;
  --blue: #4569a8;
  --shadow: 0 18px 48px rgba(40, 48, 44, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(47, 125, 92, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(245, 184, 75, 0.16), transparent 40%),
    var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
a.primary-button {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  border-right: 1px solid rgba(23, 32, 28, 0.08);
  background: rgba(255, 253, 248, 0.78);
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius);
  color: white;
  background: linear-gradient(145deg, var(--green), var(--teal));
  font-weight: 800;
}

.brand-name,
.brand-subtitle,
.eyebrow,
.metric-card p,
.panel-label,
.panel-note {
  margin: 0;
}

.brand-name {
  font-weight: 800;
}

.brand-subtitle,
.panel-note,
.topbar-copy,
.metric-card span,
.chart-caption,
.focus-card p,
.crusher-hero p,
.upload-zone span {
  color: var(--muted);
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.nav-item svg,
.icon-button svg,
.primary-button svg,
.upload-zone svg {
  width: 19px;
  height: 19px;
}

.nav-item.active {
  color: var(--ink);
  background: var(--green-soft);
}

.sidebar-panel,
.section-block,
.metric-card,
.crusher-hero {
  border: 1px solid rgba(23, 32, 28, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 10px 30px rgba(40, 48, 44, 0.07);
}

.sidebar-panel {
  margin-top: auto;
  padding: 18px;
}

.panel-number {
  margin: 7px 0 0;
  font-size: 32px;
  font-weight: 800;
}

.mini-meter {
  height: 8px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe5da;
}

.mini-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--sun));
}

.main-area {
  min-width: 0;
  padding: 28px;
}

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

.topbar h1 {
  margin: 4px 0 8px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.icon-button,
.primary-button,
.secondary-button,
.danger-button,
.text-button {
  border: 0;
  border-radius: var(--radius);
  font-weight: 800;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: 0 8px 18px rgba(40, 48, 44, 0.08);
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
}

.primary-button {
  color: white;
  background: var(--green);
  text-decoration: none;
}

.secondary-button {
  color: var(--green);
  background: var(--green-soft);
}

.danger-button {
  color: #9f2d1f;
  background: #f8ded8;
}

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

.view {
  display: none;
}

.active-view {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  min-height: 150px;
  padding: 18px;
}

.income-quick-form {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.income-quick-form label {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.income-quick-form div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.income-quick-form input {
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.income-quick-form button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  color: var(--green);
  background: white;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin: 18px 0 8px;
  font-size: 34px;
}

.metric-card.income {
  color: white;
  background: linear-gradient(145deg, #2f7d5c, #236d78);
}

.metric-card.income span,
.metric-card.income p {
  color: rgba(255, 255, 255, 0.82);
}

.metric-card.attention {
  background: #fff4db;
}

.content-grid,
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.overview-grid {
  grid-template-columns: minmax(300px, 0.78fr) minmax(460px, 1.22fr);
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 16px;
  align-items: start;
}

.content-grid.bottom {
  margin-top: 16px;
}

.section-block {
  padding: 20px;
}

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

.section-heading h2,
.crusher-hero h2,
.focus-card h3 {
  margin: 5px 0 0;
}

.runway-list,
.debt-bars,
.tracked-list,
.strategy-grid,
.status-stack,
.target-picker-list {
  display: grid;
  gap: 10px;
}

.runway-item,
.tracked-item,
.strategy-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(23, 32, 28, 0.08);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.runway-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.runway-item.is-paid {
  border-color: rgba(47, 125, 92, 0.25);
  background: linear-gradient(0deg, rgba(223, 240, 231, 0.48), rgba(223, 240, 231, 0.48)), var(--surface-strong);
}

.runway-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.runway-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 172px;
}

.paid-toggle {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(47, 125, 92, 0.24);
  border-radius: var(--radius);
  color: var(--green);
  background: var(--green-soft);
  font-weight: 800;
  white-space: nowrap;
}

.paid-toggle.is-paid {
  color: white;
  background: var(--green);
}

.date-pill {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.runway-item h3,
.runway-item p,
.tracked-item h3,
.tracked-item p,
.strategy-card h3,
.strategy-card p {
  margin: 0;
}

.runway-item p,
.tracked-item p,
.strategy-card p {
  color: var(--muted);
  font-size: 14px;
}

.amount {
  font-weight: 800;
}

canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
}

.chart-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.debt-bars {
  gap: 0;
}

.debt-bars-header,
.debt-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.22fr) minmax(250px, 1.12fr) 78px 116px 92px;
  gap: 12px;
  align-items: center;
}

.debt-bars-header {
  padding: 0 14px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.debt-bars-header span:nth-child(2),
.debt-bars-header span:nth-child(3),
.debt-bars-header span:nth-child(4),
.debt-bars-header span:nth-child(5) {
  text-align: right;
}

.debt-bars-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.debt-row {
  width: 100%;
  min-height: 64px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.debt-row:last-child {
  border-bottom: 0;
}

.debt-name-cell,
.debt-balance-cell,
.heat-summary,
.heat-legend {
  display: flex;
  align-items: center;
  gap: 12px;
}

.debt-name-cell {
  min-width: 0;
}

.debt-name-cell strong,
.debt-name-cell small {
  display: block;
}

.debt-name-cell small,
.heat-summary span,
.heat-legend {
  color: var(--muted);
}

.creditor-logo {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.creditor-logo svg {
  width: 18px;
  height: 18px;
}

.creditor-logo.citi { background: #12649b; }
.creditor-logo.apple { background: #1f2422; }
.creditor-logo.home { background: #4aa89e; }
.creditor-logo.sleep { background: #295b8d; }
.creditor-logo.chase { background: #2f6aa3; }
.creditor-logo.capital { background: #4f7f96; }
.creditor-logo.target { background: #c94f45; }
.creditor-logo.other { background: #9da6a2; }
.creditor-logo.amazon { background: #222f3e; }
.creditor-logo.nordstrom { background: #171717; }
.creditor-logo.paypal { background: #1f7cc4; }
.creditor-logo.irs { background: #4f6f5d; font-size: 10px; }
.creditor-logo.image-logo {
  overflow: hidden;
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}

.creditor-logo.image-logo img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.debt-balance-cell {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(82px, auto);
  align-items: center;
}

.debt-balance-cell strong {
  min-width: 78px;
  text-align: right;
}

.debt-balance-track {
  display: block;
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe5da;
}

.debt-balance-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--teal));
}

.paid-down {
  color: var(--green);
  text-align: center;
}

.debt-bars-insight,
.heat-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(47, 125, 92, 0.12);
  border-radius: var(--radius);
  color: #0f5c41;
  background: linear-gradient(90deg, rgba(223, 240, 231, 0.78), rgba(223, 240, 231, 0.36));
  font-weight: 700;
}

.debt-bars-insight svg,
.heat-callout svg {
  width: 22px;
  height: 22px;
  color: rgba(47, 125, 92, 0.58);
}

.debt-bars-caption {
  margin-top: 14px;
}

.payoff-heatmap-block {
  margin: 16px 0;
}

.payoff-heatmap {
  display: grid;
  gap: 14px;
}

.heat-grid {
  display: grid;
  grid-template-columns: 96px repeat(6, minmax(76px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.heat-cell {
  display: grid;
  min-height: 64px;
  place-items: center;
  padding: 10px;
  border: 1px solid rgba(23, 32, 28, 0.08);
  border-radius: var(--radius);
  text-align: center;
}

.heat-cell.good {
  color: white;
  background: linear-gradient(145deg, #2f8b62, #1f6f51);
}

.heat-cell.steady {
  color: white;
  background: linear-gradient(145deg, #f3b43e, #eea92f);
}

.heat-cell.deep {
  color: white;
  background: linear-gradient(145deg, #54a66f, #0f6f4a);
}

.heat-cell strong {
  font-weight: 800;
}

.heat-cell strong {
  font-size: 14px;
}

.heat-month,
.heat-row-label {
  display: grid;
  align-items: center;
  min-height: 34px;
  font-weight: 700;
}

.heat-month {
  justify-items: center;
}

.heat-row-label {
  color: var(--ink);
  font-size: 14px;
}

.heat-legend {
  justify-content: flex-start;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 800;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
}

.legend-dot.good { background: var(--green); }
.legend-dot.steady { background: var(--sun); }
.legend-dot.deep { background: #0f6f4a; }

.focus-card {
  display: grid;
  gap: 14px;
}

.crusher-ring-wrap {
  display: grid;
  place-items: center;
  padding: 4px 0 0;
}

.crusher-ring {
  display: grid;
  width: min(310px, 100%);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface-strong) 0 60%, transparent 61%),
    conic-gradient(var(--green) 0 var(--ring-progress), #dcebe2 var(--ring-progress) 100%);
  box-shadow: inset 0 0 0 1px rgba(23, 32, 28, 0.04);
}

.crusher-ring-center {
  display: grid;
  place-items: center;
  text-align: center;
}

.crusher-ring-center strong {
  max-width: 210px;
  font-size: clamp(30px, 4vw, 39px);
  line-height: 1;
  white-space: nowrap;
}

.crusher-ring-center span,
.crusher-ring-center small,
.ring-stat span {
  color: var(--muted);
}

.crusher-ring-center i {
  width: 64px;
  height: 1px;
  margin: 12px 0;
  background: var(--line);
}

.crusher-ring-center b {
  color: var(--green);
  font-size: 21px;
}

.ring-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ring-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.ring-stat-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.ring-stat-icon svg {
  width: 20px;
  height: 20px;
}

.ring-stat-icon.money,
.ring-stat-icon.projection {
  color: var(--green);
}

.ring-stat-icon.target {
  color: #d89916;
}

.ring-stat span,
.ring-stat strong {
  display: block;
}

.ring-stat span {
  font-size: 12px;
}

.ring-stat strong {
  color: var(--green);
  font-size: 17px;
}

.ring-stat:nth-child(2) strong {
  color: #d89916;
}

.ring-callout {
  padding: 12px;
  border: 1px solid rgba(47, 125, 92, 0.12);
  border-radius: var(--radius);
  color: #0f5c41;
  background: linear-gradient(90deg, rgba(223, 240, 231, 0.78), rgba(223, 240, 231, 0.36));
  text-align: center;
  font-weight: 700;
}

.status-stack div {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
}

.paid { background: var(--green); }
.soon { background: var(--sun); }
.watch { background: var(--coral); }

.calendar-block {
  min-height: 720px;
}

.calendar-side {
  position: sticky;
  top: 24px;
}

.calendar-controls,
.week-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.week-controls .icon-button {
  width: 38px;
  height: 38px;
}

.week-controls .icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.calendar-action-list {
  display: grid;
  gap: 10px;
}

.calendar-action {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.calendar-action h3,
.calendar-action p {
  margin: 0;
}

.calendar-action p:not(.eyebrow) {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.mini-actions {
  display: flex;
  gap: 8px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays span {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-grid {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.calendar-grid.week-view {
  grid-template-columns: repeat(7, minmax(120px, 1fr));
}

.calendar-day {
  min-height: 116px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
}

.week-day {
  min-height: 420px;
}

.mini-empty {
  margin-top: 8px;
  padding: 10px;
  font-size: 12px;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-date {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.holiday {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.bill-chip {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: var(--green-soft);
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.bill-chip.creditor {
  background: var(--coral-soft);
}

.bill-chip.paid {
  color: var(--green);
  background: #eaf7ef;
}

.segmented-control {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius);
  background: #ebe5da;
}

.segmented-control button {
  min-width: 74px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-weight: 800;
}

.segmented-control .selected {
  background: var(--surface-strong);
}

.crusher-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(47, 125, 92, 0.14), rgba(245, 184, 75, 0.18)),
    var(--surface);
}

.target-picker {
  margin-bottom: 16px;
}

.target-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.target-option input {
  width: 18px;
  height: 18px;
}

.target-option strong,
.target-option span {
  display: block;
}

.target-option span {
  color: var(--muted);
  font-size: 14px;
}

.crusher-score {
  min-width: 210px;
  padding: 20px;
  border-radius: var(--radius);
  color: white;
  background: var(--green);
}

.crusher-score span,
.crusher-score strong {
  display: block;
}

.crusher-score strong {
  margin-top: 6px;
  font-size: 36px;
}

.strategy-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.strategy-card {
  grid-template-columns: minmax(0, 1fr);
}

.empty-state {
  padding: 18px;
  border: 1px dashed #cabfad;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
  font-weight: 700;
}

.import-block {
  max-width: 920px;
}

.bank-import-block {
  margin-top: 16px;
}

.upload-zone {
  display: grid;
  min-height: 210px;
  place-items: center;
  padding: 28px;
  border: 2px dashed #cabfad;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
  text-align: center;
}

.file-input {
  max-width: 320px;
  color: var(--muted);
  font-weight: 700;
}

.upload-zone svg {
  width: 42px;
  height: 42px;
  color: var(--green);
}

.compact-upload {
  min-height: 160px;
}

.import-controls,
.import-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.import-controls label {
  display: grid;
  gap: 6px;
  min-width: 240px;
  color: var(--muted);
  font-weight: 800;
}

.import-controls select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.import-controls p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.cloud-status,
.sync-note {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  font-weight: 700;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.connection-badge.offline,
.connection-badge.error {
  color: #9f2d1f;
  background: #f8ded8;
}

.connection-badge.connecting {
  color: #805a12;
  background: #fff4db;
}

.connection-badge.online {
  color: var(--green);
  background: var(--green-soft);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.subtle-action {
  opacity: 0.82;
}

.review-table {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.review-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.review-row.header {
  color: var(--muted);
  background: #f1ece3;
  font-weight: 800;
}

.review-row input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
}

.bank-discovery-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.bank-discovery-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.bank-discovery-card label,
.discovery-fields label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bank-discovery-card input,
.bank-discovery-card select,
.discovery-fields input,
.discovery-fields select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.discovery-approve {
  grid-row: 1 / span 2;
  align-self: center;
  justify-items: center;
}

.discovery-approve input {
  width: 18px;
  min-height: 18px;
}

.discovery-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.discovery-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
}

.discovery-main {
  min-width: 0;
}

.discovery-fields {
  display: grid;
  grid-column: 2;
  grid-template-columns: minmax(130px, 0.75fr) minmax(150px, 0.9fr) minmax(170px, 1fr) minmax(90px, 0.45fr) minmax(120px, 0.55fr);
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.bill-form {
  display: grid;
  gap: 14px;
}

.household-setup {
  margin-bottom: 16px;
}

.household-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
}

.household-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.household-form input,
.household-form select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.preset-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.preset-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--green);
  background: var(--surface-strong);
  font-weight: 800;
}

.form-status {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  font-weight: 700;
}

.bill-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.bill-form input,
.bill-form select,
.drawer-edit-form input,
.drawer-edit-form select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface-strong);
}

.logo-url-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: center;
}

.logo-preview {
  display: grid;
  width: 52px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-strong);
}

.logo-preview img {
  width: 76%;
  height: 76%;
  object-fit: contain;
}

.logo-preview svg {
  width: 20px;
  height: 20px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bill-drawer,
.utility-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10;
  width: min(430px, 100vw);
  height: 100vh;
  padding: 24px;
  overflow-y: auto;
  transform: translateX(105%);
  transition: transform 180ms ease;
  border-left: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.bill-drawer.open,
.utility-drawer.open {
  transform: translateX(0);
}

.close-drawer {
  margin-left: auto;
}

.drawer-title {
  margin: 22px 0 4px;
  font-size: 30px;
}

.drawer-meta {
  margin: 0 0 24px;
  color: var(--muted);
}

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

.drawer-stat {
  padding: 14px;
  border-radius: var(--radius);
  background: #f4efe6;
}

.drawer-stat span,
.drawer-stat strong {
  display: block;
}

.drawer-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.drawer-stat strong {
  margin-top: 6px;
  font-size: 20px;
}

.drawer-actions {
  display: grid;
  gap: 10px;
}

.quick-search {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.quick-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.drawer-edit-form {
  display: grid;
  gap: 12px;
  margin: 16px 0 20px;
}

.drawer-edit-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.drawer-toggle-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .brand-block div:not(.brand-mark),
  .nav-item span,
  .sidebar-panel {
    display: none;
  }

  .metric-grid,
  .strategy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .overview-grid,
  .settings-grid,
  .calendar-layout,
  .household-form {
    grid-template-columns: 1fr;
  }

  .discovery-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-side {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 12px;
  }

  .brand-block {
    flex: 0 0 auto;
  }

  .nav-list {
    display: flex;
    min-width: max-content;
  }

  .nav-item {
    width: 48px;
    justify-content: center;
  }

  .main-area {
    padding: 18px;
  }

  .topbar,
  .crusher-hero,
  .chart-caption {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .metric-grid,
  .overview-grid,
  .ring-stat-grid,
  .strategy-grid,
  .drawer-stats {
    grid-template-columns: 1fr;
  }

  .debt-bars,
  .payoff-heatmap {
    overflow-x: auto;
  }

  .debt-bars-header,
  .debt-row {
    min-width: 790px;
  }

  .heat-grid {
    min-width: 680px;
  }

  .bank-discovery-card {
    grid-template-columns: 1fr;
  }

  .runway-item,
  .runway-main,
  .runway-actions {
    grid-template-columns: 1fr;
  }

  .runway-actions {
    justify-content: space-between;
    min-width: 0;
  }

  .discovery-approve {
    grid-row: auto;
    justify-items: start;
  }

  .discovery-fields {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  .calendar-day {
    min-height: 94px;
    padding: 6px;
  }

  .calendar-block {
    min-height: auto;
    overflow-x: auto;
  }

  .calendar-block .section-heading {
    min-width: 620px;
  }

  .calendar-controls {
    align-items: flex-end;
    flex-direction: column;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 620px;
  }

  .calendar-grid.week-view {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .calendar-block.week-active .section-heading,
  .calendar-block.week-active .calendar-weekdays {
    min-width: 0;
  }

  .week-day {
    min-height: 120px;
  }

  .bill-chip {
    padding: 6px;
    font-size: 11px;
  }
}
