:root {
  --ink: #0f2239;
  --muted: #66778c;
  --line: #dce5ed;
  --soft: #f5f8fb;
  --paper: #fff;
  --blue: #087be7;
  --blue-dark: #075cae;
  --teal: #119d8b;
  --purple: #6655d8;
  --green: #168263;
  --red: #bf4a4a;
  --shadow: 0 24px 65px rgba(9, 37, 68, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(circle at 85% 5%, #ddecfb 0, transparent 27%), #eef4f8; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: calc(1rem * var(--text-scale, 1)); }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.topbar { height: 72px; padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(24,53,83,.1); background: rgba(243,248,251,.88); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; color: white; border-radius: 12px; background: linear-gradient(145deg, #168ff5, #0757be); box-shadow: 0 8px 18px rgba(4,103,204,.25); }
.brand-mark svg { width: 25px; fill: currentColor; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: calc(0.875rem * var(--text-scale, 1)); letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: calc(0.875rem * var(--text-scale, 1)); }
.text-control { display: flex; align-items: center; gap: 10px; color: #43566d; font-size: calc(.875rem * var(--text-scale, 1)); font-weight: 700; white-space: nowrap; }
.age-slider { width: 132px; }
.text-control input { width: 100%; margin: 0; accent-color: var(--blue); }
.age-endpoints { display: flex; justify-content: space-between; gap: 4px; color: #6b7e91; font-size: calc(.75rem * var(--text-scale, 1)); font-weight: 500; }
.age-endpoints small { font-size: inherit; }
.text-control output { min-width: 32px; color: var(--blue-dark); text-align: right; }

main { width: min(1650px, calc(100% - 42px)); margin: auto; }
.hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 50px; padding: 54px 18px 35px; }
.eyebrow, .step { margin: 0 0 11px; color: #0a70cd; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.hero h1 { max-width: 900px; margin: 0; color: #0a1d34; font-size: clamp(35px, 4vw, 58px); line-height: 1.04; letter-spacing: -.055em; }
.hero h1 em { color: var(--blue); font-style: normal; }
.hero > div > p:last-child { max-width: 850px; margin: 18px 0 0; color: #5d6f84; font-size: calc(1rem * var(--text-scale, 1)); line-height: 1.6; }
.source-card { display: flex; align-items: center; gap: 12px; min-width: 290px; padding: 15px 18px; border: 1px solid #d5e1eb; border-radius: 14px; background: rgba(255,255,255,.8); box-shadow: 0 12px 32px rgba(20,55,90,.06); }
.source-card strong, .source-card small { display: block; }
.source-card strong { font-size: calc(0.875rem * var(--text-scale, 1)); }
.source-card small { max-width: 270px; margin-top: 3px; color: #8290a0; font-size: calc(0.875rem * var(--text-scale, 1)); }
.live-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #18a67b; box-shadow: 0 0 0 5px rgba(24,166,123,.11); }

.reverse-sizer { margin: 0 0 22px; padding: 26px 30px; border: 1px solid #cbdbe9; border-radius: 20px; background: #fff; box-shadow: 0 16px 44px rgba(9,37,68,.08); }
.reverse-heading { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 18px; }
.reverse-heading h2 { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2.1rem); letter-spacing: -.04em; }
.reverse-heading > p { max-width: 420px; margin: 0; color: var(--muted); line-height: 1.45; }
.reverse-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); gap: 25px; align-items: stretch; }
.reverse-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; align-content: start; }
.reverse-controls .field { min-width: 0; margin: 0; }
.reverse-result { min-width: 0; padding: 17px 20px; border: 1px solid #cbddec; border-radius: 14px; background: linear-gradient(135deg, #eef7ff, #fff); }
.reverse-kicker { margin: 0 0 8px; color: #1669af; font-size: calc(.875rem * var(--text-scale, 1)); font-weight: 800; }
.reverse-best { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.reverse-best h3 { margin: 0; font-size: calc(1.4rem * var(--text-scale, 1)); }
.reverse-best p { margin: 4px 0 0; color: var(--muted); font-size: calc(.875rem * var(--text-scale, 1)); }
.reverse-best > strong { font-size: calc(1.5rem * var(--text-scale, 1)); white-space: nowrap; }
.reverse-costline { margin: 10px 0 13px; color: #415b73; line-height: 1.4; }
.reverse-use { min-height: 42px; padding: 8px 14px; color: white; border: 0; border-radius: 9px; background: var(--blue-dark); font-weight: 750; cursor: pointer; }
.reverse-use:hover { background: #064b8e; }
.reverse-alternatives { margin-top: 16px; padding-top: 12px; border-top: 1px solid #d6e5f0; }
.reverse-alternatives > strong { display: block; margin-bottom: 7px; }
.reverse-alternatives > div { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px solid #e2ebf2; }
.reverse-alternatives small { display: block; margin-top: 3px; color: var(--muted); font-size: calc(.875rem * var(--text-scale, 1)); }
.reverse-alternatives b { white-space: nowrap; }
.reverse-count, .reverse-method { color: var(--muted); font-size: calc(.875rem * var(--text-scale, 1)); line-height: 1.5; }
.reverse-count { display: block; margin-top: 12px; }
.reverse-method { margin: 16px 0 0; }
.reverse-empty { margin: 0; color: #455b70; line-height: 1.5; }

.csv-section { margin-bottom: 22px; padding: 26px 30px; border: 1px solid #cbdbe9; border-radius: 20px; background: white; box-shadow: 0 16px 44px rgba(9,37,68,.08); }
.csv-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.csv-heading h2 { margin: 0; font-size: clamp(1.5rem,2.4vw,2.1rem); letter-spacing: -.04em; }
.csv-heading a { color: var(--blue-dark); font-weight: 750; white-space: nowrap; }
.csv-section > p { max-width: 1050px; margin: 12px 0 18px; color: var(--muted); line-height: 1.55; }
.csv-section code { color: #173e61; font-size: .9em; overflow-wrap: anywhere; }
.csv-controls { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 14px; }
.csv-controls .field { min-width: 0; }
.csv-controls input[type="file"] { display: block; width: 100%; padding: 9px; border: 1px solid #d2dce6; border-radius: 9px; font-size: calc(.875rem * var(--text-scale, 1)); }
.csv-controls input[type="file"]::file-selector-button { margin-right: 12px; padding: 7px 10px; color: #105991; border: 0; border-radius: 6px; background: #e7f3fd; font: inherit; font-weight: 750; cursor: pointer; }
.csv-error { padding: 10px 12px; color: #8d2929 !important; border: 1px solid #edc9c9; border-radius: 8px; background: #fff4f4; }
.csv-status { margin: 4px 0 12px; color: #40596e; font-weight: 700; }
.csv-results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 6px 0 14px; }
.csv-results-head .csv-status { margin: 0; }
.csv-export { flex: none; min-height: 42px; padding: 8px 15px; color: white; border: 0; border-radius: 9px; background: var(--blue-dark); font-weight: 750; cursor: pointer; }
.csv-export:hover { background: #064b8e; }
.csv-export:disabled { color: #758495; background: #e5ebf0; cursor: not-allowed; }
.csv-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.csv-total { padding: 16px; border: 1px solid #d7e4ed; border-radius: 12px; background: #f6faff; }
.csv-total h3 { margin: 0 0 10px; font-size: calc(1rem * var(--text-scale, 1)); }
.csv-total > strong { display: block; font-size: calc(1.5rem * var(--text-scale, 1)); }
.csv-monthly { display: block; margin-top: 5px; color: #0c649f; font-weight: 750; }
.csv-total dl { display: grid; gap: 5px; margin: 12px 0 0; }
.csv-total dl div { display: flex; justify-content: space-between; gap: 10px; color: #52687a; }
.csv-total dt, .csv-total dd { margin: 0; }
.csv-total dd { font-weight: 700; color: #223a51; white-space: nowrap; }
.csv-table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid #dae5ed; border-radius: 12px; }
.csv-table { width: 100%; min-width: 950px; border-collapse: collapse; }
.csv-table th, .csv-table td { padding: 11px 13px; border-bottom: 1px solid #e4ebf1; text-align: left; vertical-align: top; }
.csv-table th { color: #536a80; background: #f4f8fb; }
.csv-table tr:last-child td { border-bottom: 0; }
.csv-table td strong, .csv-table td small { display: block; }
.csv-table td small { margin-top: 4px; color: var(--muted); font-size: calc(.875rem * var(--text-scale, 1)); line-height: 1.35; }
.csv-table td:first-child { min-width: 210px; }
.csv-table td:not(:first-child) { min-width: 240px; }
.csv-table .csv-unmatched { color: #9c3f32; }
.csv-method { margin: 12px 0 0; color: var(--muted); font-size: calc(.875rem * var(--text-scale, 1)); line-height: 1.55; }

.workspace { display: grid; grid-template-columns: minmax(390px, 27%) minmax(0,1fr); min-height: 900px; overflow: hidden; border: 1px solid rgba(95,123,150,.24); border-radius: 23px; background: white; box-shadow: var(--shadow); }
.builder { padding: 26px; background: #f8fafc; border-right: 1px solid var(--line); }
.analysis { min-width: 0; padding: 26px 24px 28px; }
.section-heading, .analysis-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 23px; }
.section-heading h2, .analysis-head h2 { margin: -4px 0 0; font-size: calc(1.25rem * var(--text-scale, 1)); letter-spacing: -.035em; }
.link-button { padding: 2px; color: #64778a; border: 0; background: none; font-size: calc(0.875rem * var(--text-scale, 1)); text-decoration: underline; text-decoration-color: #bcc8d2; text-underline-offset: 3px; cursor: pointer; }

.field { display: block; margin-bottom: 15px; }
.field > span { display: block; min-height: 15px; margin-bottom: 6px; color: #43566d; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 750; }
.field-grid { display: grid; gap: 10px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
select, input[type="number"], input[type="search"] { width: 100%; min-height: 44px; padding: 7px 10px; color: var(--ink); border: 1px solid #d2dce6; border-radius: 9px; outline: 0; background: white; font-size: calc(0.875rem * var(--text-scale, 1)); transition: border .15s, box-shadow .15s; }
select:focus, input:focus { border-color: #4aa2ec; box-shadow: 0 0 0 3px rgba(22,128,224,.11); }
select { font-weight: 650; }
.segments { display: grid; grid-template-columns: 1fr 1fr; min-height: 44px; padding: 3px; border-radius: 9px; background: #e8eef3; }
.segments button { border: 0; border-radius: 7px; color: #728195; background: transparent; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 750; cursor: pointer; }
.segments button.active { color: #096abc; background: white; box-shadow: 0 2px 8px rgba(23,52,81,.12); }

.sku-preview { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 6px 10px; align-items: center; margin: 2px 0 17px; padding: 13px; border: 1px solid #d5e3ef; border-radius: 12px; background: linear-gradient(135deg, #edf7ff, #fff); }
.sku-icon { display: grid; grid-row: 1 / span 2; place-items: center; width: 38px; height: 38px; color: white; border-radius: 10px; background: linear-gradient(145deg, #1689e8, #0c5db8); font-weight: 850; }
.sku-main { min-width: 0; }
.sku-main strong, .sku-main span, .sku-rate strong, .sku-rate span { display: block; }
.sku-main strong { overflow: hidden; text-overflow: ellipsis; color: #17324e; font-size: calc(0.875rem * var(--text-scale, 1)); white-space: nowrap; }
.sku-main span { margin-top: 3px; color: #78889a; font-size: calc(0.875rem * var(--text-scale, 1)); }
.sku-rate { text-align: right; }
.sku-rate strong { font-size: calc(0.875rem * var(--text-scale, 1)); }
.sku-rate span { color: #8b98a7; font-size: calc(0.875rem * var(--text-scale, 1)); }
.rate-flags { display: flex; grid-column: 2 / 4; flex-wrap: wrap; gap: 5px; }
.rate-flags span, .availability span { padding: 3px 6px; border-radius: 999px; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 800; }
.rate-flags .available, .availability .ok { color: #176952; background: #e5f6f0; }
.rate-flags .unavailable, .availability .missing { color: #8b5e33; background: #fff0df; }
.suffix-input { position: relative; }
.suffix-input input { padding-right: 26px; }
.suffix-input i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #8795a4; font-size: calc(0.875rem * var(--text-scale, 1)); font-style: normal; }
.help { display: inline-grid; place-items: center; position: relative; width: 15px; height: 15px; margin-left: 2px; padding: 0; color: #77889a; border: 1px solid #b9c6d2; border-radius: 50%; background: white; font-size: calc(0.875rem * var(--text-scale, 1)); cursor: help; }
.help:hover::after, .help:focus::after { content: attr(data-tip); position: absolute; bottom: 21px; left: -30px; z-index: 50; width: 210px; padding: 8px 10px; color: white; border-radius: 8px; background: #11273f; box-shadow: 0 10px 24px rgba(0,0,0,.18); font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 500; line-height: 1.45; }
.add-button { width: 100%; min-height: 44px; padding: 9px; color: white; border: 0; border-radius: 10px; background: linear-gradient(110deg, #087be7, #1767c4); box-shadow: 0 9px 20px rgba(8,113,211,.22); font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 800; cursor: pointer; }
.add-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.add-button span { margin-right: 6px; font-size: calc(0.875rem * var(--text-scale, 1)); }
.builder-error { min-height: 14px; margin: 5px 0 0; color: var(--red); font-size: calc(0.875rem * var(--text-scale, 1)); }
.assumption-block { margin-top: 14px; padding: 16px 0 5px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.range-field { margin-bottom: 18px; }
.range-field > div, .range-field small { display: flex; align-items: center; justify-content: space-between; }
.range-field > div { margin-bottom: 8px; color: #44586e; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 750; }
.range-field output { color: #086fc9; font-weight: 850; }
.range-field small { margin-top: 6px; color: #97a4b2; font-size: calc(0.875rem * var(--text-scale, 1)); }
input[type="range"] { width: 100%; height: 4px; appearance: none; border-radius: 99px; background: linear-gradient(90deg, #1486e9 0 var(--value, 50%), #dbe4eb var(--value, 50%)); outline: none; }
input[type="range"]::-webkit-slider-thumb { width: 16px; height: 16px; appearance: none; border: 4px solid #1685e8; border-radius: 50%; background: white; box-shadow: 0 2px 7px rgba(13,73,129,.25); cursor: pointer; }
.method-note { margin-top: 14px; }
.method-note summary { color: #586b80; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 750; cursor: pointer; }
.method-note p { margin: 8px 0 0; color: #7e8d9e; font-size: calc(0.875rem * var(--text-scale, 1)); line-height: 1.55; }

.analysis-head { align-items: center; }
.reconcile { display: flex; align-items: center; gap: 6px; padding: 7px 10px; color: #26725e; border: 1px solid #cce9de; border-radius: 999px; background: #ecf8f4; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 800; }
.reconcile span { display: grid; place-items: center; width: 14px; height: 14px; color: white; border-radius: 50%; background: #1ba47c; font-size: calc(0.875rem * var(--text-scale, 1)); }
.reconcile.warning { color: #985f28; border-color: #f0d4b5; background: #fff4e8; }
.reconcile.warning span { background: #cf8741; }
.estate-meta { display: grid; grid-template-columns: repeat(4,1fr); margin-bottom: 14px; border: 1px solid #dfe7ed; border-radius: 12px; background: #f8fafc; }
.estate-meta > div { padding: 11px 14px; }
.estate-meta > div + div { border-left: 1px solid #dfe7ed; }
.estate-meta span, .estate-meta strong { display: block; }
.estate-meta span { color: #8b98a6; font-size: calc(0.875rem * var(--text-scale, 1)); letter-spacing: .08em; text-transform: uppercase; }
.estate-meta strong { margin-top: 4px; font-size: calc(0.875rem * var(--text-scale, 1)); }

.estate-table-wrap { position: relative; overflow-x: auto; min-height: 145px; border: 1px solid #dce5ec; border-radius: 13px; }
.estate-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.estate-table th { padding: 9px 10px; color: #8190a0; border-bottom: 1px solid #e3e9ee; background: #f7f9fb; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 800; text-align: left; letter-spacing: .06em; text-transform: uppercase; }
.estate-table td { padding: 10px; border-bottom: 1px solid #edf1f4; color: #42556b; font-size: calc(0.875rem * var(--text-scale, 1)); vertical-align: middle; }
.estate-table tr:last-child td { border-bottom: 0; }
.estate-table select, .estate-table input { height: 31px; padding: 0 6px; font-size: calc(0.875rem * var(--text-scale, 1)); }
.estate-table td:nth-child(2) { width: 94px; }
.estate-table td:nth-child(3), .estate-table td:nth-child(4), .estate-table td:nth-child(6), .estate-table td:nth-child(7) { width: 62px; }
.vm-cell { display: flex; align-items: flex-start; gap: 8px; min-width: 150px; }
.vm-cell > span { display: grid; place-items: center; flex: none; width: 28px; height: 28px; color: #086abb; border-radius: 8px; background: #e6f3ff; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 850; }
.vm-cell strong, .vm-cell small { display: block; }
.vm-cell strong { color: #1e344c; font-size: calc(0.875rem * var(--text-scale, 1)); }
.vm-cell small { margin-top: 2px; color: #8895a3; font-size: calc(0.875rem * var(--text-scale, 1)); }
.availability { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.availability span { padding: 2px 4px; font-size: calc(0.875rem * var(--text-scale, 1)); }
.row-monthly { white-space: nowrap; color: #263d55; }
.table-percent { position: relative; }
.table-percent input { padding-right: 17px; }
.table-percent span { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: #8c98a4; font-size: calc(0.875rem * var(--text-scale, 1)); }
.remove-row { padding: 3px 6px; color: #93a0ad; border: 0; background: none; font-size: calc(1.125rem * var(--text-scale, 1)); cursor: pointer; }
.remove-row:hover { color: var(--red); }
.empty-state { display: grid; place-items: center; align-content: center; min-height: 145px; color: #8795a4; }
.empty-state strong { color: #43576e; font-size: calc(0.875rem * var(--text-scale, 1)); }
.empty-state span { margin-top: 4px; font-size: calc(0.875rem * var(--text-scale, 1)); }

.cost-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); gap: 11px; margin-top: 14px; }
.cost-card { position: relative; min-width: 0; padding: 16px; overflow: hidden; border: 1px solid #dce4eb; border-radius: 13px; background: white; transition: transform .2s, box-shadow .2s, border .2s; }
.cost-card.recommended { transform: translateY(-2px); border-color: #68a9de; box-shadow: 0 10px 25px rgba(18,93,158,.12); }
.cost-card.recommended::before { content: "Best whole-estate option"; display: inline-block; margin-bottom: 10px; padding: 3px 6px; color: #176b59; border-radius: 999px; background: #e1f5ee; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.card-label { display: flex; align-items: center; gap: 8px; }
.option-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 850; }
.option-icon.payg { color: #5d6f82; background: #e9edf1; }
.option-icon.ri { color: #076abd; background: #e5f3ff; }
.option-icon.sp { color: #5b4fc6; background: #eceaff; }
.card-label strong, .card-label small { display: block; }
.card-label strong { font-size: calc(0.875rem * var(--text-scale, 1)); }
.card-label small { margin-top: 2px; color: #8a97a6; font-size: calc(0.875rem * var(--text-scale, 1)); }
.cost-value { margin-top: 15px; color: #0d2239; font-size: clamp(22px,2.2vw,29px); font-weight: 800; letter-spacing: -.05em; }
.term-caption { display: block; margin-top: 1px; color: #96a2ae; font-size: calc(0.875rem * var(--text-scale, 1)); }
.cost-bar { height: 5px; margin: 13px 0 11px; overflow: hidden; border-radius: 99px; background: #edf1f4; }
.cost-bar i { display: block; height: 100%; border-radius: inherit; transition: width .3s; }
[data-card="payg"] .cost-bar i { background: #9aa7b4; }
[data-card="ri"] .cost-bar i { background: linear-gradient(90deg,#1686e9,#55b5ed); }
[data-card="sp"] .cost-bar i { background: linear-gradient(90deg,#6656d7,#8098ed); }
.saving-line { display: flex; justify-content: space-between; gap: 8px; color: #8190a0; font-size: calc(0.875rem * var(--text-scale, 1)); }
.saving-line strong { color: #31475d; }
.saving-line .positive { color: var(--green); }
.saving-line .negative { color: var(--red); }
.cost-card > p { min-height: 24px; margin: 9px 0 0; padding-top: 9px; color: #7d8c9c; border-top: 1px solid #edf1f4; font-size: calc(0.875rem * var(--text-scale, 1)); line-height: 1.45; }

.decision-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: start; gap: 14px; margin-top: 14px; padding: 20px; color: white; border-radius: 15px; background: linear-gradient(120deg,#091d34,#12395b); box-shadow: 0 14px 30px rgba(8,37,65,.14); }
.decision-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(145deg,#1a86e5,#7056db); font-weight: 850; }
.decision-payg { background: linear-gradient(145deg,#6d7c8b,#41556b); }
.decision-ri { background: linear-gradient(145deg,#1289ea,#075aac); }
.decision-sp { background: linear-gradient(145deg,#4c80d9,#7558dc); }
.decision-hybrid { background: linear-gradient(145deg,#0f9a89,#2672cc); }
.decision-copy > p { margin: 0 0 4px; color: #78c2f4; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.decision-copy h3 { margin: 0; font-size: calc(1.125rem * var(--text-scale, 1)); letter-spacing: -.035em; }
.decision-copy ul { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 15px; margin: 10px 0 0; padding: 0; list-style: none; }
.decision-copy li { color: #bdcede; font-size: calc(0.875rem * var(--text-scale, 1)); line-height: 1.45; }
.decision-copy li span { margin-right: 5px; color: #58d0af; }
.decision-number { min-width: 130px; padding-left: 18px; border-left: 1px solid rgba(255,255,255,.13); text-align: right; }
.decision-number span, .decision-number strong, .decision-number small { display: block; }
.decision-number span { color: #88a5be; font-size: calc(0.875rem * var(--text-scale, 1)); text-transform: uppercase; }
.decision-number strong { margin-top: 5px; font-size: calc(1.3125rem * var(--text-scale, 1)); letter-spacing: -.04em; }
.decision-number small { margin-top: 3px; color: #61d3b3; font-size: calc(0.875rem * var(--text-scale, 1)); }

.model-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 11px; margin-top: 14px; }
.model-panel { min-height: 145px; padding: 15px; border: 1px solid #dfe6ec; border-radius: 13px; background: #fafcfd; }
.mini-head { display: flex; justify-content: space-between; margin-bottom: 12px; }
.mini-head strong { font-size: calc(0.875rem * var(--text-scale, 1)); }
.mini-head span { color: #8997a5; font-size: calc(0.875rem * var(--text-scale, 1)); }
.winner-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #edf1f3; }
.winner-list > div:last-child { border-bottom: 0; }
.winner-sku { color: #43566b; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 750; }
.winner-sku small { color: #8996a4; font-weight: 500; }
.winner-chip { padding: 4px 7px; border-radius: 999px; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 850; }
.winner-payg { color: #586b7f; background: #e9edf1; }
.winner-ri { color: #076abb; background: #e4f2ff; }
.winner-sp { color: #5e50ca; background: #ebe9ff; }
.no-winners { color: #8593a2; font-size: calc(0.875rem * var(--text-scale, 1)); }
.difference-grid { display: grid; grid-template-columns: .8fr 1fr 1fr; font-size: calc(0.875rem * var(--text-scale, 1)); }
.difference-grid > * { padding: 7px 5px; border-bottom: 1px solid #edf1f3; }
.difference-grid span { color: #8996a4; }
.difference-grid strong { color: #1675c2; }
.difference-grid b { color: #45586d; font-weight: 700; }
.analysis-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 14px; color: #8492a0; font-size: calc(0.875rem * var(--text-scale, 1)); }
.analysis-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.analysis-footer button { padding: 8px 11px; color: #155f9e; border: 1px solid #bed5e8; border-radius: 8px; background: #eef7ff; font-size: calc(0.875rem * var(--text-scale, 1)); font-weight: 800; cursor: pointer; }
.analysis-footer button:hover { background: #e0f0fd; }
.analysis-footer button:disabled { color: #8290a0; background: #edf1f4; cursor: not-allowed; }

.caveat-section { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 24px 10px 55px; color: #68798b; font-size: calc(0.875rem * var(--text-scale, 1)); }
.caveat-section p { margin: 0; line-height: 1.55; }
.caveat-section strong { color: #354b62; }
.caveat-section a { flex: none; color: #1269b4; font-weight: 750; text-decoration: none; }
.caveat-section a:hover { text-decoration: underline; }
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 80; padding: 10px 15px; color: white; border: 1px solid #31495e; border-radius: 9px; background: #0d2239; box-shadow: 0 12px 30px rgba(0,0,0,.25); font-size: calc(0.875rem * var(--text-scale, 1)); opacity: 0; transform: translate(-50%,20px); transition: .24s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1120px) {
  main { width: min(960px,calc(100% - 26px)); }
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .source-card { width: fit-content; }
  .reverse-layout { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .builder { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .topbar { height: auto; min-height: 64px; padding: 10px 15px; flex-wrap: wrap; gap: 10px; }
  .brand small { display: none; }
  .age-slider { width: 120px; }
  .reverse-sizer { padding: 20px 17px; }
  .csv-section { padding: 20px 17px; }
  .csv-controls { grid-template-columns: 1fr 1fr; }
  .csv-controls .field:first-child { grid-column: 1 / -1; }
  .csv-totals { grid-template-columns: 1fr; }
  .reverse-heading { display: block; }
  .reverse-heading > p { margin-top: 8px; }
  .reverse-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { width: min(100% - 16px,680px); }
  .hero { padding: 38px 8px 28px; }
  .hero h1 { font-size: 38px; }
  .hero > div > p:last-child { font-size: calc(1rem * var(--text-scale, 1)); }
  .workspace { border-radius: 17px; }
  .builder, .analysis { padding: 22px 17px; }
  .estate-meta { grid-template-columns: 1fr 1fr; }
  .estate-meta > div:nth-child(3) { border-left: 0; border-top: 1px solid #dfe7ed; }
  .estate-meta > div:nth-child(4) { border-top: 1px solid #dfe7ed; }
  .cost-cards, .model-grid { grid-template-columns: 1fr; }
  .decision-card { grid-template-columns: auto 1fr; }
  .decision-number { grid-column: 1 / 3; padding: 12px 0 0; border-top: 1px solid rgba(255,255,255,.13); border-left: 0; text-align: left; }
  .decision-copy ul { grid-template-columns: 1fr; }
  .caveat-section { align-items: flex-start; flex-direction: column; gap: 10px; }
  .analysis-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 460px) {
  .csv-results-head { align-items: flex-start; flex-direction: column; }
  .csv-heading { display: block; }
  .csv-heading a { display: inline-block; margin-top: 12px; }
  .csv-controls { grid-template-columns: 1fr; }
  .csv-controls .field:first-child { grid-column: auto; }
  .field-grid.two { grid-template-columns: 1fr; }
  .reverse-controls { grid-template-columns: 1fr; }
  .reverse-best { display: block; }
  .reverse-best > strong { display: block; margin-top: 10px; }
  .source-card { min-width: 0; width: 100%; }
  .analysis-head { align-items: flex-start; flex-direction: column; }
  .sku-preview { grid-template-columns: 38px minmax(0,1fr); }
  .sku-rate { grid-column: 2; text-align: left; }
  .rate-flags { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) { *,*::before,*::after { transition: none !important; scroll-behavior: auto !important; } }
