:root {
  --navy: #0b1d3a;
  --gold: #c7a648;
  --cream: #f8f6f1;
  --white: #fffefa;
  --slate: #4a5568;
  --muted: #7a8394;
  --line: #e4ded3;
  --pink: #d6457a;       /* slow months / Pink Line (validated vs --ok-bar) */
  --pink-wash: #fbe9ef;
  --ok-bar: #3d7cc9;     /* months at or above 55% full */
  --warn: #9a5b00;
  --warn-wash: #fff4e0;
  --r: 14px;
  /* One spacing scale for every screen. It breathes on a normal laptop
     and tightens only on short windows, so primary buttons stay above the fold. */
  --s-top: clamp(16px, 3.6vh, 40px);
  --s-gap: clamp(10px, 2vh, 20px);
  --s-card: clamp(14px, 2.6vh, 24px);
  --s-actions: clamp(14px, 3vh, 28px);
}
@media (max-height: 680px) {
  :root { --s-top: 14px; --s-gap: 10px; --s-card: 14px; --s-actions: 14px; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--navy); }
body { font: 16px/1.55 Inter, system-ui, -apple-system, sans-serif; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 28px; border-bottom: 1px solid var(--line); background: var(--white); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; letter-spacing: .01em; }
.brand span { color: var(--gold); }
.dots { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.dots li { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots li.done { background: var(--gold); }
.dots li.now { background: var(--navy); }

main { max-width: 820px; margin: 0 auto; padding: var(--s-top) 24px 80px; }
.screen { display: none; animation: in .35s ease; }
.screen.active { display: block; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12.5px; font-weight: 700; color: var(--gold); margin: 0 0 10px; }
h1 { font-size: clamp(30px, min(4.6vw, 6vh), 46px); line-height: 1.1; margin: 0 0 12px; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: clamp(24px, min(3.4vw, 4.4vh), 32px); line-height: 1.2; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { margin: 0 0 10px; font-size: 17px; }
.lede { font-size: clamp(15.5px, 2.5vh, 18px); color: var(--slate); margin: 0 0 var(--s-gap); }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.fine { font-size: 13px; color: var(--muted); margin: 18px 0 0; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s-card) 24px; margin: var(--s-gap) 0; }
.card.callout { border-left: 4px solid var(--gold); }
.checks { margin: 0 0 12px; padding-left: 20px; }
.checks li { margin: 6px 0; }
.privacy { margin: 10px 0 0; font-size: 14px; color: var(--slate); }

.field { display: block; margin: 16px 0 0; }
.field span { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.field em { font-style: normal; color: var(--gold); font-weight: 600; }
.field small { display: block; font-weight: 400; color: var(--muted); }
input, select { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }

.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: var(--s-actions); }
.actions .btn:only-child { margin-left: auto; }
.btn { font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 14px 26px; background: var(--gold); color: var(--navy); cursor: pointer; }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--slate); padding-left: 4px; }
.link { font: inherit; background: none; border: 0; color: var(--navy); text-decoration: underline; cursor: pointer; padding: 0; }

.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: clamp(24px, 6vh, 52px) 20px; border: 2px dashed #cfc6b6; border-radius: var(--r); background: var(--white); cursor: pointer; text-align: center; }
.drop.over { border-color: var(--gold); background: #fffaf0; }
.drop-big { font-weight: 700; font-size: 18px; }
.drop-small { color: var(--muted); font-size: 14px; }
.alert { background: var(--warn-wash); color: var(--warn); border-radius: 10px; padding: 14px 16px; margin-top: 16px; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.summary-grid div { background: var(--cream); border-radius: 10px; padding: 12px 14px; }
.summary-grid b { display: block; font-size: 20px; }
.summary-grid span { font-size: 13px; color: var(--muted); }
.units-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14.5px; }
.units-row input { width: 90px; padding: 8px 10px; }

.hero-num { font-size: clamp(56px, 11vw, 104px); font-weight: 800; letter-spacing: -.035em; line-height: 1; margin: 18px 0 18px; font-variant-numeric: tabular-nums; }
.hero-num.pink { color: var(--pink); }
.hero-num.xl { font-size: clamp(64px, 14vw, 132px); }

.drops { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.drops th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; padding: 0 0 8px; }
.drops td { padding: 8px 0; border-top: 1px solid var(--line); }
.drops td.r, .drops th.r { text-align: right; }

.chart-card { position: relative; margin: 18px 0 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px 14px; }
.chart-card figcaption { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #ece7dd; stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; }
.chart .month { fill: var(--slate); font-size: 11.5px; }
.chart .slow-tag { fill: var(--pink); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.chart .threshold { stroke: var(--navy); stroke-width: 1.5; stroke-dasharray: 0; opacity: .55; }
.key-line { display: inline-block; width: 18px; height: 0; border-top: 1.5px solid rgba(11,29,58,.55); vertical-align: middle; margin-right: 2px; }
.key-pink { color: var(--slate); border-bottom: 3px solid var(--pink); }
.chart .hit { fill: transparent; cursor: default; }
.tip { position: absolute; pointer-events: none; background: var(--navy); color: #fff; font-size: 13px; padding: 7px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); }
.table-view { margin-top: 10px; font-size: 13.5px; }
.table-view summary { cursor: pointer; color: var(--muted); }
.table-view table { border-collapse: collapse; margin-top: 8px; }
.table-view td, .table-view th { padding: 4px 16px 4px 0; text-align: left; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.split div { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(14px, 2.4vh, 20px) 20px; }
.split b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.split span { color: var(--muted); font-size: 14px; }
.split .big { border-color: var(--pink); box-shadow: inset 0 0 0 1px var(--pink); }

.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.tier { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.tier h3 { display: flex; justify-content: space-between; align-items: baseline; }
.tier h3 small { font-weight: 500; color: var(--muted); font-size: 13px; }
.ladder { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.rung { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: var(--cream); }
.rung .k { font-weight: 700; }
.rung .k small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.rung .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rung.batna { background: #eef2f8; }
.rung.pinkline { background: var(--pink-wash); }
.rung.pinkline .v { color: var(--pink); }
.op { text-align: center; color: var(--muted); font-weight: 700; line-height: 1; }
.tier-foot { margin-top: 12px; font-size: 13.5px; color: var(--slate); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); background: var(--warn-wash); padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.flag { background: var(--warn-wash); color: var(--warn); border-radius: 10px; padding: 12px 14px; margin-top: 14px; font-size: 14.5px; }
.window b.big { font-size: 22px; }
.legend-defs { display: grid; gap: 6px; margin-top: 18px; font-size: 14px; color: var(--slate); }
.comp-input { display: flex; gap: 10px; align-items: center; margin: 8px 0 14px; }
.comp-input input { max-width: 160px; }

@media (max-width: 640px) {
  .grid2, .tiers, .split, .summary-grid { grid-template-columns: 1fr; }
  .top { padding: 14px 16px; }
  .dots { display: none; }
}

@media print {
  .top, .actions, .drop, #useSample, .table-view summary { display: none !important; }
  body { background: #fff; }
  .screen { display: block !important; break-inside: avoid; page-break-after: always; animation: none; }
  .screen[data-step="start"], .screen[data-step="upload"] { display: none !important; }
  .card, .tier, .chart-card, .split div { border-color: #ccc; }
}

.legend { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--slate); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -8px; vertical-align: -1px; }
.sw.pink { background: var(--pink); }
.sw.blue { background: var(--ok-bar); }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 16px; }
.actions.tight { margin-top: 16px; justify-content: flex-end; }
.result { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 20px; }
.result .price { font-size: clamp(48px, 9vw, 76px); font-weight: 800; color: var(--pink); letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.result .why { font-size: 16px; color: var(--slate); margin: 8px 0 14px; }
.result .pms { font-size: 15px; margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.facts div { background: var(--cream); border-radius: 10px; padding: 10px 12px; }
.facts b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.facts span { font-size: 12.5px; color: var(--muted); }
.timing { border-radius: 10px; padding: 12px 14px; font-size: 15px; background: #eef2f8; }
.priced { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.priced th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding-bottom: 8px; }
.priced td { padding: 8px 0; border-top: 1px solid var(--line); }
.priced .r { text-align: right; }
.priced .x { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
@media (max-width: 640px) { .grid3, .facts { grid-template-columns: 1fr; } }

.split .label { display: block; color: var(--muted); font-size: 14px; }
.split p { margin: 8px 0 0; font-size: 14.5px; color: var(--slate); }
.split.two-up { margin-top: 18px; }
.big-num { font-size: 40px !important; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.split.two-up .label { font-weight: 600; color: var(--navy); }
details.proof summary { cursor: pointer; font-weight: 600; }
details.proof[open] summary { margin-bottom: 14px; }
.facts span.basis { display: block; font-size: 11.5px; margin-top: 1px; }

.cal-wrap { margin-bottom: 6px; }
.cal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.field-label { font-weight: 600; font-size: 14.5px; }
.sw.check { width: auto; height: auto; background: none; color: var(--navy); font-size: 11px; font-weight: 800; margin-right: -4px; }
.cal-months { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cal-months button { flex: 0 0 auto; font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: #fff; color: var(--slate); border-radius: 999px; padding: 6px 12px; cursor: pointer; position: relative; }
.cal-months button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.cal-months button .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--pink); margin-left: 6px; vertical-align: 1px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 4px 0; }
.cal button { font: inherit; font-size: 14.5px; font-variant-numeric: tabular-nums; aspect-ratio: 1.6; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); cursor: pointer; position: relative; }
.cal button:hover:not(:disabled) { border-color: var(--gold); }
.cal button.slow { background: var(--pink-wash); border-color: #f1c3d3; color: #8f1f48; font-weight: 700; }
.cal button.sel { outline: 2.5px solid var(--navy); outline-offset: 1px; }
.cal button.done::after { content: "✓"; position: absolute; top: 2px; right: 5px; font-size: 10px; font-weight: 800; color: var(--navy); }
.cal button:disabled { background: transparent; border-color: transparent; color: #c8c2b6; cursor: default; }
.cal .blank { visibility: hidden; }
.cal-picked { margin: 12px 0 0; font-size: 15px; color: var(--slate); min-height: 1.4em; }
.cal-picked b { color: var(--navy); }
@media (max-width: 640px) { .cal button { font-size: 13px; aspect-ratio: 1; } }

div.fine p { margin: 0 0 6px; }

/* ── Layout pieces that keep each screen's main button above the fold ── */
/* Inline field + button (start screen, calculator) */
.start-row, .calc-row { display: flex; align-items: flex-end; gap: 14px; }
.start-row .field, .calc-row .field { flex: 1; margin: 0; }
.start-row .btn, .calc-row .btn { flex: none; }
.calc-row { margin-top: var(--s-gap); }
.start .checks li { margin: 4px 0; }

/* Floor: four cost fields in one row, results side by side */
.floor .grid2 { grid-template-columns: repeat(4, 1fr); gap: 0 14px; align-items: end; }
.floor .grid2 .field { margin: 0; }
.floor .field em { white-space: nowrap; }
.floor .split.two-up { margin-top: 0; }
.floor .big-num { font-size: clamp(30px, 5vh, 40px) !important; }

/* Calculator: the calendar scales with window height */
.pl .cal-head { margin-bottom: 8px; }
.pl .cal-months { gap: 5px; margin-bottom: clamp(8px, 1.6vh, 14px); }
.pl .cal-months button { font-size: 12.5px; padding: 4px 10px; }
.pl .cal { gap: 3px; }
.pl .cal .dow { padding: 2px 0; font-size: 11px; }
.pl .cal button { aspect-ratio: auto; height: clamp(26px, 4vh, 38px); font-size: 14px; border-radius: 8px; }
.pl .cal-picked { margin-top: clamp(6px, 1.2vh, 12px); }

@media (max-width: 900px) and (min-width: 641px) { .floor .grid2 { grid-template-columns: 1fr 1fr; gap: 12px 14px; } }
@media (max-width: 640px) {
  .start-row, .calc-row { flex-direction: column; align-items: stretch; }
  .floor .grid2 { grid-template-columns: 1fr; gap: 12px; }
  .pl .cal button { height: 40px; }
}
.pl .cal-months { align-items: center; flex-wrap: nowrap; }
.pl .cal-months .yr { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; margin: 0 2px 0 6px; }
.pl .cal-months .yr:first-child { margin-left: 0; }
@media (max-width: 900px) { .pl .cal-months { flex-wrap: wrap; } }

/* Upload: once a file is read, the drop zone shrinks so "See my leak" stays above the fold */
.screen:has(#fileSummary:not([hidden])) .drop { padding: 14px 20px; flex-direction: row; justify-content: center; gap: 10px; }
.screen:has(#fileSummary:not([hidden])) .drop-big { font-size: 15px; }
.screen:has(#fileSummary:not([hidden])) .drop-big::before { content: "Different file? "; font-weight: 400; color: var(--slate); }
.summary-grid { grid-template-columns: 1fr 1fr 1.5fr; }
.summary-grid div { padding: 10px 14px; }
@media (max-width: 640px) { .summary-grid { grid-template-columns: 1fr; } }
/* Month buttons share the row evenly, lined up with the calendar below */
.pl .cal-months { gap: 4px; }
.pl .cal-months button { flex: 1 1 0; min-width: 0; padding: 4px 0; text-align: center; }
.pl .cal-months button .dot { margin-left: 4px; }
/* Floor labels: name, then the tag, then the hint, the same on every field */
.floor .field em { display: block; }
.summary-grid b { font-size: 18px; white-space: nowrap; }
.floor .grid2 { align-items: stretch; }
.floor .grid2 .field { display: flex; flex-direction: column; }
.floor .grid2 .field input { margin-top: auto; }
.floor .grid2 .field > span { margin-bottom: 8px; }
@media (max-width: 900px) {
  .pl .cal-months { display: grid; grid-template-columns: repeat(6, 1fr); }
  .pl .cal-months .yr { display: none; }
  .pl .cal-months button { padding: 6px 0; }
}
.nowrap { white-space: nowrap; }
.split p .nowrap { color: inherit; font-size: inherit; }

/* Multi-night pricing */
.cal-picked .link { margin-left: 6px; }
.result .for-nights { margin: 2px 0 6px; font-size: 14.5px; color: var(--slate); }
.nowrap { white-space: nowrap; }

/* Leak page: adjustable slow season line */
.split .slow-line { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; color: var(--slate); }
.split .slow-line select { display: inline-block; width: auto; min-width: 0; height: auto; font: inherit; font-weight: 700; color: var(--navy); padding: 3px 6px; margin: 0 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.split .slow-line small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
