/* "Water and marigold": deep teal for trust and money flow, marigold only for leaks, slate for data,
   red only for destructive actions. All text colours pass WCAG AA on white and on the page ground. */
:root {
  --ground: #F5F3EE;
  --surface: #FFFFFF;
  --line: #E4E0D6;
  --line-soft: #ECE8DF;
  --ink: #14232A;
  --muted: #53636A;
  --input-border: #869094;
  --primary: #0F5C5C;
  --primary-dark: #0B4747;
  --primary-soft: #E3F0EE;
  --primary-outline: #9CC4C0;
  --primary-on: #FFFFFF;
  --primary-on-muted: #CFE5E2;
  --leak: #B45309;
  --leak-strong: #9A4A07;
  --leak-soft: #FDF1E3;
  --leak-ramp-2: #D97706;
  --leak-ramp-3: #F2B45C;
  --leak-ramp-4: #F8D9A8;
  --data: #3F5A85;
  --data-soft: #EEF2F8;
  --data-outline: #C9D4E6;
  --unsure: #A39274;
  --chip: #EEEBE3;
  --danger: #B42318;
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
h1, h2, h3 { line-height: 1.2; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
:focus-visible { outline: 3px solid var(--primary-outline); outline-offset: 2px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a { padding: 10px 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.site-nav a[aria-current="page"] { background: var(--chip); }
.site-nav a.outline { color: var(--primary); border: 1px solid var(--primary-outline); font-weight: 700; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--input-border); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.button:hover { color: var(--ink); background: var(--ground); }
.button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-on); font-weight: 700; }
.button.primary:hover { background: var(--primary-dark); color: var(--primary-on); }
.button.large { min-height: 52px; font-size: 17px; border-radius: 14px; width: 100%; }
.button.danger { border-color: var(--danger); color: var(--danger); }
.button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.link-button { min-height: 40px; padding: 0; border: 0; background: transparent; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--chip); color: #3F4A4F; }
.chip.good { background: var(--primary-soft); color: var(--primary-dark); }
.alert { padding: 12px 14px; border-radius: 12px; background: var(--leak-soft); color: var(--leak-strong); font-weight: 600; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); }

/* Home */
.home { display: flex; gap: 48px; flex-wrap: wrap; align-items: flex-start; padding-top: 56px; padding-bottom: 72px; }
.home-pitch { flex: 1 1 380px; min-width: 0; padding-top: 8px; }
.eyebrow { margin: 0 0 12px; font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.home-pitch h1 { margin: 0 0 16px; font-size: clamp(32px, 5vw, 44px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 800; }
.home-pitch .lead { margin-bottom: 28px; font-size: 18px; color: var(--muted); max-width: 30em; }
.benefits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.benefits li { display: flex; gap: 12px; align-items: flex-start; }
.benefit-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); display: inline-flex; align-items: center; justify-content: center; color: var(--primary); }
.upload-card { flex: 1 1 440px; min-width: 0; padding: 28px; border-radius: 20px; box-shadow: 0 12px 40px rgba(20, 35, 42, 0.08); display: flex; flex-direction: column; gap: 18px; }
.upload-card h2 { margin: 0; font-size: 22px; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 28px 20px; border: 2px dashed var(--primary-outline); border-radius: 16px; background: #F1F7F6; cursor: pointer; }
.dropzone.dragging { background: var(--primary-soft); border-color: var(--primary); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:focus-within { outline: 3px solid var(--primary-outline); outline-offset: 2px; }
.dropzone-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-soft); display: inline-flex; align-items: center; justify-content: center; color: var(--primary); }
.file-list { list-style: none; margin: -6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-list:empty { display: none; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.file-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field label, .field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input[type="text"], .field input[type="password"], .field input[type="number"] { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--input-border); border-radius: 12px; font: inherit; color: var(--ink); background: var(--surface); }
.field input[type="number"] { width: 160px; }
.field .hint { margin-top: 6px; font-size: 14px; color: var(--muted); }
.options { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.options summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.options-body { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.privacy-line { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.privacy-line svg { flex: none; margin-top: 3px; color: var(--primary); }

.beta { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--leak-strong); background: var(--leak-soft); padding: 2px 8px; border-radius: 999px; }
.landing-band { padding: 56px 0; border-top: 1px solid var(--line); }
.landing-band.alt { background: var(--surface); }
.landing-title { margin: 0 0 20px; font-size: clamp(24px, 3.5vw, 30px); letter-spacing: -0.01em; }
.steps, .promises { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; }
.steps li, .promises li { flex: 1 1 240px; }
.steps h3, .promises h3 { margin: 10px 0 6px; font-size: 18px; }
.step-number { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: var(--primary-on); align-items: center; justify-content: center; font-weight: 800; }
.sample-preview { display: flex; gap: 32px; flex-wrap: wrap; align-items: center; }
.sample-preview > div:first-child { flex: 1 1 320px; }
.sample-card { flex: 1 1 380px; }
.faq { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.faq summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.faq details p { margin-top: 8px; }
.final-cta { text-align: center; }
.final-cta .container { display: flex; flex-direction: column; align-items: center; }

/* Results: section bar */
.section-bar { position: sticky; top: 0; z-index: 10; background: var(--ground); border-bottom: 1px solid var(--line); box-shadow: 0 6px 16px rgba(20, 35, 42, 0.05); }
.section-bar .container { display: flex; align-items: center; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
.section-links { display: flex; gap: 6px; overflow-x: auto; flex: 1 1 auto; min-width: 0; scrollbar-width: none; }
.section-links a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; white-space: nowrap; }
.section-links a .count { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--line); }
.section-links a[hidden] { display: none; }
.section-links a[aria-current="true"] { background: var(--primary); color: var(--primary-on); }
.section-links a[aria-current="true"] .count { background: rgba(255, 255, 255, 0.2); }
.bar-total { flex: none; display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.bar-total strong { color: var(--primary); }
.bar-total strong.short { color: var(--leak-strong); }

.results { display: flex; flex-direction: column; gap: 40px; padding-top: 32px; padding-bottom: 64px; }
.results section, .results [id] { scroll-margin-top: 72px; }
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.results-head h1 { margin: 2px 0 0; font-size: 34px; letter-spacing: -0.01em; }
.results-period { font-size: 15px; font-weight: 600; color: var(--muted); }

/* Results: the planner. Orange is the new commitment, so it stands apart from teal spare money. */
.plan-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.plan-row[hidden] { display: none; }
.planner { flex: 999 1 560px; min-width: 0; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.room { flex: 1 1 320px; min-width: 0; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.planner h2, .room h2 { margin: 0; font-size: 22px; }
.plan-modes { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-modes button, .presets button { min-height: 44px; padding: 0 16px; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600; background: var(--surface); color: var(--ink); border: 1px solid var(--input-border); cursor: pointer; }
.plan-modes button[aria-pressed="true"] { background: var(--primary); color: var(--primary-on); border-color: var(--primary); }
.presets button { min-height: 36px; padding: 0 12px; font-size: 14px; color: var(--primary); border-style: dashed; }
.plan-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.plan-fields[hidden] { display: none; }
.plan-field { display: flex; flex-direction: column; gap: 6px; }
.plan-field label { font-size: 14px; font-weight: 600; }
.plan-field input { min-height: 44px; padding: 0 12px; border: 1px solid var(--input-border); border-radius: 10px; font: inherit; font-size: 17px; background: var(--surface); color: var(--ink); }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-result { border-radius: 14px; background: var(--ground); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.plan-amount strong { font-size: 32px; }
.plan-verdict { font-weight: 700; color: var(--primary-dark); }
.plan-verdict.short { color: var(--leak-strong); }
.plan-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--chip); }
.plan-bar .seg, .plan-legend .key { display: block; background: var(--input-border); }
.plan-bar .away, .plan-legend .away { background: var(--data); }
.plan-bar .new, .plan-legend .new { background: var(--leak); }
.plan-bar .left, .plan-legend .left { background: var(--primary); }
.plan-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.plan-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.plan-legend .key { width: 10px; height: 10px; border-radius: 3px; }
.plan-facts { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.room-list { list-style: none; margin: 0; padding: 0; }
.room-list li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.room-list input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.room-list label { flex: 1; display: flex; flex-direction: column; }
.room-amount { white-space: nowrap; }
.room-total { padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); font-size: 14px; font-weight: 600; }

/* Results: spare money. Teal is money you have; marigold marks a month that came up short. */
.spare { display: flex; flex-direction: column; gap: 14px; }
.tile.highlight.short { background: var(--leak-strong); border-color: var(--leak-strong); }
.spare-months { margin: 0; padding: 18px 20px; }
.spare-chart { height: 160px; }
.spare-chart .bar { background: var(--primary); }
.spare-chart .short .bar { background: var(--leak); }
.spare-chart .short .value { color: var(--leak-strong); font-weight: 600; }
.results-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.section-title { margin: 0 0 4px; font-size: 24px; }
.section-intro { margin-bottom: 16px; color: var(--muted); }

/* Leaks */
.leaks { display: flex; flex-direction: column; gap: 16px; }
.leak-total { padding: 28px; border-radius: 20px; display: flex; flex-direction: column; gap: 18px; }
.leak-total-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
.leak-total h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--muted); }
.leak-amount { font-size: clamp(36px, 7vw, 48px); line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; color: var(--leak); }
.leak-amount span { font-size: 22px; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.leak-total.clear .leak-amount { color: var(--primary); }
.leak-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 3px; }
.leak-bar span:nth-child(1) { background: var(--leak); }
.leak-bar span:nth-child(2) { background: var(--leak-ramp-2); }
.leak-bar span:nth-child(3) { background: var(--leak-ramp-3); }
.leak-bar span:nth-child(n+4) { background: var(--leak-ramp-4); }
.leak { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; break-inside: avoid; }
.leak-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.leak-title { display: flex; gap: 14px; align-items: flex-start; min-width: 0; flex: 1 1 360px; }
.leak-rank { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--leak-soft); color: var(--leak-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.leak-title h3 { margin: 0 0 6px; font-size: 19px; }
.leak-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.leak-annual { text-align: right; }
.leak-annual strong { display: block; font-size: 24px; color: var(--leak); }
.leak-annual span { font-size: 13px; color: var(--muted); }
.leak-action { background: var(--ground); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.leak-action strong { flex: none; }
.leak-action span { flex: 1 1 280px; min-width: 0; }
.leak-action a { font-weight: 700; white-space: nowrap; }
.evidence summary { cursor: pointer; color: var(--primary); font-weight: 700; min-height: 40px; display: flex; align-items: center; }
.more-leaks > summary { cursor: pointer; font-weight: 700; color: var(--primary); min-height: 44px; display: flex; align-items: center; }
.more-leaks[open] > summary { margin-bottom: 16px; }
.more-leaks .leak + .leak { margin-top: 16px; }

/* Tables */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px; }
td { padding: 10px 8px; border-top: 1px solid var(--line-soft); vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.date { white-space: nowrap; color: var(--muted); }
td.narration { overflow-wrap: anywhere; width: 100%; }
td.amount { font-weight: 600; }
td.amount.in { color: var(--primary); }
.evidence table { margin-top: 6px; font-size: 14px; min-width: 480px; }

/* Regular payments */
.regular { display: flex; flex-direction: column; gap: 20px; }
.regular-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.regular-head h2 { margin: 0 0 4px; font-size: 24px; }
.regular-head .muted { max-width: 34em; }
.regular-total { text-align: right; }
.regular-total strong { display: block; font-size: 28px; font-weight: 800; }
.regular-total span { font-size: 14px; color: var(--muted); }
.regular-group h3 { margin: 0; font-size: 17px; }
.regular-group h3 .muted { font-weight: 600; }
.regular-table { margin-top: 6px; font-size: 15px; min-width: 560px; }
.regular-table .detail { font-size: 14px; color: var(--muted); }
.regular-table td.narration { width: auto; }
.regular-table tr.stopped td { color: var(--muted); }
.regular-table tr.stopped td.amount { font-weight: 400; }

/* Money map */
.tiles { display: flex; gap: 14px; flex-wrap: wrap; }
.tile { flex: 1 1 200px; padding: 18px 20px; }
.tile .label { font-size: 14px; color: var(--muted); }
.tile .value { font-size: 28px; font-weight: 800; }
.tile .sub { font-size: 14px; color: var(--muted); }
.tile.highlight { background: var(--primary); border-color: var(--primary); color: var(--primary-on); }
.tile.highlight .label, .tile.highlight .sub { color: var(--primary-on-muted); }
.panels { display: flex; gap: 14px; flex-wrap: wrap; align-items: stretch; margin-top: 14px; }
.panel { flex: 1 1 440px; min-width: 0; margin: 0; }
.panel h2, .panel h3, .panel figcaption { margin: 0 0 4px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--data); }
.swatch-line { width: 14px; border-top: 2px dashed var(--ink); }
.chart-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.chart { position: relative; height: 210px; display: flex; align-items: flex-end; gap: 12px; padding: 0 4px; border-bottom: 1px solid #C9C3B6; }
.chart-col { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.chart-col .value { font-size: 12px; color: var(--muted); }
.chart-col .bar { width: 100%; max-width: 48px; background: var(--data); border-radius: 6px 6px 0 0; }
.chart-col .income { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--ink); }
button.chart-col { border: 0; background: transparent; padding: 0; font: inherit; cursor: pointer; border-radius: 8px 8px 0 0; }
button.chart-col:hover .bar, .day-col:hover .bar { background: var(--primary); }
.day-chart { gap: 2px; padding: 0; }
.day-col { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; border: 0; padding: 0; background: transparent; font: inherit; cursor: pointer; border-radius: 4px 4px 0 0; }
.day-col.weekend { background: #F1EEE7; }
.day-col.uncovered { cursor: default; background: repeating-linear-gradient(135deg, transparent 0 4px, #ECE8DF 4px 6px); }
.day-col .bar { width: 100%; max-width: 18px; background: var(--data); border-radius: 3px 3px 0 0; }
.day-col .value { font-size: 11px; color: var(--muted); white-space: nowrap; }
.day-col[aria-pressed="true"] .bar { background: var(--ink); }
.day-col[aria-pressed="true"] { box-shadow: inset 0 -3px 0 var(--ink); }
.payday-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.weekend-swatch { width: 10px; height: 10px; border-radius: 3px; background: #E2DDD2; }
.day-labels { gap: 2px; padding: 6px 0 0; }
.day-labels span { flex: 1; min-width: 0; font-size: 12px; }
.month-select select { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--input-border); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; }
.day-chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: #FFFFFF; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.chart-labels { display: flex; gap: 12px; padding: 6px 4px 0; font-size: 13px; color: var(--muted); }
.chart-labels span { flex: 1; text-align: center; }
.chart-note { margin-top: 12px; font-size: 14px; color: var(--muted); }
.category-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.category-list li { display: grid; grid-template-columns: minmax(0, 10em) minmax(0, 1fr) 6.5em 3em; gap: 10px; align-items: center; font-size: 15px; }
.category-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-list .track { height: 10px; background: var(--chip); border-radius: 999px; overflow: hidden; }
.category-list .fill { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.category-list .fill.unsure { background: var(--unsure); }
.category-list .total { text-align: right; font-weight: 600; }
.category-list .share { text-align: right; color: var(--muted); }
.category-list li.has-payees { display: block; }
.category-list li.has-payees > details > summary { display: grid; grid-template-columns: minmax(0, 10em) minmax(0, 1fr) 6.5em 3em; gap: 10px; align-items: center; cursor: pointer; list-style: none; min-height: 32px; }
.category-list li.has-payees > details > summary::-webkit-details-marker { display: none; }
.category-list li.has-payees .name { color: var(--primary); font-weight: 700; }
.category-list li.has-payees .name::before { content: "▸ "; }
.category-list li.has-payees > details[open] > summary .name::before { content: "▾ "; }
.payees { margin: 10px -12px 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #FBFAF7; display: flex; flex-direction: column; gap: 10px; }
.payees p { margin: 0; }
.payee-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.payee-table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 8px; }
.payee-table td { padding: 10px 8px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.payee-table th:first-child, .payee-table td:first-child { padding-left: 0; }
.payee-table th:last-child, .payee-table td:last-child { padding-right: 0; }
.payee-table .num { text-align: right; white-space: nowrap; }
.payee-table .detail { font-size: 13px; color: var(--muted); }
.payee-table a { text-decoration: none; }
.payee-upi-inline { display: none; }
.payees-once > summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; color: var(--primary); font-weight: 700; min-height: 40px; align-items: center; border-top: 1px solid var(--line-soft); }
.payees-once > summary strong { color: var(--ink); }
.more-categories summary { cursor: pointer; color: var(--primary); font-weight: 700; min-height: 40px; display: flex; align-items: center; margin-top: 6px; }

.plain-list { list-style: none; margin: 12px 0 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.plain-list .detail { font-size: 14px; color: var(--muted); }
.suggestion { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--data-soft); border: 1px solid var(--data-outline); font-size: 14px; }
.suggestion table { font-size: 14px; margin-top: 6px; }

/* Survey */
.survey h2 { margin: 0 0 4px; font-size: 20px; }
.survey-question { border: 0; margin: 16px 0 0; padding: 0; }
.survey-question legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--input-border); border-radius: 999px; font-weight: 600; cursor: pointer; background: var(--surface); }
.choice input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-on); }
.choice input:focus-visible + span { outline: 3px solid var(--primary-outline); outline-offset: 2px; }
.survey form > .button { margin-top: 18px; }
.admin-table { font-size: 14px; min-width: 640px; }

/* Transactions */
.tx-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--input-border); border-radius: 12px; flex: 0 1 320px; min-width: 0; background: var(--surface); color: var(--muted); }
.search input { border: 0; outline: none; font: inherit; flex: 1; min-width: 0; background: transparent; color: var(--ink); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.filters button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--input-border); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.tx-table { font-size: 15px; min-width: 640px; }
.tx-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; color: var(--muted); }
.how summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.how-grid { display: flex; gap: 20px; flex-wrap: wrap; padding-top: 12px; }
.how-grid > div { flex: 1 1 280px; }
.how-grid ul { margin: 6px 0 0; padding-left: 18px; color: var(--leak-strong); font-size: 14px; }
.page-footer { font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }

/* History */
.history { display: flex; flex-direction: column; gap: 20px; padding-top: 32px; padding-bottom: 64px; }
.history h1 { margin: 0 0 4px; font-size: 30px; }
.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.history-item { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 20px; }
.history-item .what { flex: 1 1 260px; min-width: 0; }
.history-item .what strong { font-size: 17px; }
.history-item .leaks { flex: 0 1 180px; }
.history-item .leaks strong { color: var(--leak); }
.history-item .actions { display: flex; gap: 6px; align-items: center; }
.history-item form, .history-foot form { margin: 0; }
.empty { border: 1px dashed var(--input-border); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted); background: var(--surface); }
.history-foot { border-top: 1px solid var(--line); padding-top: 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); }

/* Guides */
.guide { max-width: 760px; padding-top: 32px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 16px; }
.guide h1 { margin: 0; font-size: 30px; }
.guide h2 { margin: 16px 0 0; font-size: 20px; }
.guide ol, .guide ul { margin: 0; padding-left: 22px; }
.guide li { margin-bottom: 8px; }

.site-footer { border-top: 1px solid var(--line); }
.site-footer .container { padding-top: 20px; padding-bottom: 20px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; gap: 16px; }

@media (max-width: 640px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .home { padding-top: 28px; gap: 28px; }
  .upload-card { padding: 20px; }
  .results { gap: 32px; padding-top: 20px; }
  .results-head h1 { font-size: 26px; }
  .results-actions { width: 100%; }
  .results-actions .button { flex: 1; }
  .bar-total { display: none; }
  .section-links a { border-radius: 999px; }
  .leak-total, .leak { padding: 18px; }
  .planner, .room { padding: 18px 16px; }
  .plan-amount strong { font-size: 28px; }
  .leak-annual, .regular-total { text-align: left; }
  .tile { flex-basis: calc(50% - 7px); padding: 14px; }
  .tile .value { font-size: 21px; }
  .category-list li, .category-list li.has-payees > details > summary { grid-template-columns: minmax(0, 1fr) 6.5em; }
  .category-list .track { grid-column: 1 / -1; grid-row: 2; }
  .category-list li.has-payees > details > summary { min-height: 44px; }
  .payees { margin-left: -8px; margin-right: -8px; }
  .payee-table .payee-upi { display: none; }
  .payee-upi-inline { display: inline; }
  .category-list .share { display: none; }
}

@media print {
  body { background: #FFFFFF; font-size: 11pt; }
  .site-header nav, .section-bar, .results-actions, .no-print, .site-footer nav { display: none !important; }
  .card { border-color: #CCCCCC; }
  .results { padding-top: 0; gap: 24px; }
  .leak, .tile, .panel, .regular-group { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
