:root {
    --ink: #172033;
    --muted: #647087;
    --navy: #0d2444;
    --blue: #2563eb;
    --blue-dark: #194ebc;
    --blue-soft: #eaf1ff;
    --line: #dfe5ef;
    --surface: #ffffff;
    --background: #f4f7fb;
    --green: #138a61;
    --green-soft: #e6f7f0;
    --red: #c03a47;
    --red-soft: #fff0f1;
    --amber: #9a6500;
    --shadow: 0 18px 50px rgba(20, 35, 64, .09);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--background); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: inherit; }
button, input { font: inherit; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }

.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.94); border-bottom: 1px solid rgba(223,229,239,.9); backdrop-filter: blur(14px); }
.header-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 1px; }
.site-header nav { display: flex; align-items: center; gap: 20px; }
.site-header nav > a { text-decoration: none; font-size: 14px; font-weight: 650; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border: 1px solid var(--blue); border-radius: 11px; background: var(--blue); color: #fff; font-weight: 750; text-decoration: none; cursor: pointer; box-shadow: 0 8px 20px rgba(37,99,235,.18); transition: .18s ease; }
.button:hover { background: var(--blue-dark); border-color: var(--blue-dark); transform: translateY(-1px); }
.button-secondary { background: #fff; color: var(--navy); border-color: var(--line); box-shadow: none; }
.button-secondary:hover { background: #f7f9fc; border-color: #c9d2e1; }
.button-small { min-height: 38px; padding: 0 15px; }
.button-large { min-height: 52px; padding: 0 26px; }

.hero { padding: 86px 0 74px; color: #fff; background: radial-gradient(circle at 82% 10%, #245390 0, transparent 29%), linear-gradient(125deg, #081b35 0%, #0d2a52 66%, #0d3669 100%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .65fr); gap: 70px; align-items: center; }
.eyebrow { display: block; margin-bottom: 9px; color: #3f6fbb; font-size: 12px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.hero .eyebrow { color: #88b6ff; }
.hero h1, .analysis-header h1 { margin: 0; max-width: 760px; font-size: clamp(42px, 5.4vw, 72px); line-height: 1.02; letter-spacing: -.055em; }
.hero p { max-width: 710px; margin: 24px 0 0; color: #c7d6eb; font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-actions .button-secondary { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.24); }
.hero-actions .button-secondary:hover { background: rgba(255,255,255,.14); }
.hero-card { padding: 28px; border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius); background: rgba(255,255,255,.07); box-shadow: 0 20px 70px rgba(0,0,0,.2); }
.hero-card-label { display: block; color: #8fbcff; font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.hero-card strong { display: block; margin-top: 15px; font-size: 25px; letter-spacing: -.03em; }
.hero-card p { margin-top: 12px; font-size: 14px; line-height: 1.65; }

.content-section { padding: 68px 0; }
.content-section.compact { padding-top: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading h2, .panel-heading h2, .preview-panel h2, .result-heading h2 { margin: 0; font-size: 32px; letter-spacing: -.035em; }
.search-bar { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.search-bar input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 0 12px; color: var(--ink); font-size: 16px; }
.clear-link { align-self: center; padding: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.scenario-list { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.scenario-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 120px 28px; align-items: center; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .15s ease; }
.scenario-row:last-child { border-bottom: 0; }
.scenario-row:hover { background: #f9fbfe; }
.scenario-main, .scenario-metric { min-width: 0; }
.scenario-main strong, .scenario-main small, .scenario-metric strong, .scenario-metric small { display: block; }
.scenario-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.scenario-main small, .scenario-metric small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.scenario-metric { text-align: right; }
.scenario-metric strong { margin-top: 4px; font-size: 17px; }
.arrow { color: var(--blue); font-size: 22px; }
.empty-state, .setup-card { margin-top: 22px; padding: 42px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-align: center; }
.empty-state h3, .setup-card h3 { margin: 0 0 8px; }
.empty-state p, .setup-card p { color: var(--muted); }
.empty-state .button { margin-top: 10px; }
.setup-card { display: flex; gap: 20px; align-items: flex-start; text-align: left; }
.setup-icon { flex: 0 0 42px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--red-soft); color: var(--red); font-weight: 900; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.feature-grid article { padding: 28px; border-right: 1px solid var(--line); }
.feature-grid article:last-child { border: 0; }
.feature-grid span { color: var(--blue); font-size: 12px; font-weight: 850; }
.feature-grid h3 { margin: 14px 0 8px; font-size: 17px; }
.feature-grid p { margin: 0; color: var(--muted); font-size: 13px; }

.analysis-header { padding: 48px 0 42px; color: #fff; background: linear-gradient(122deg, #0a203e, #123b6e); }
.analysis-header .breadcrumb { display: flex; gap: 8px; margin-bottom: 30px; color: #9eb7d8; font-size: 12px; }
.analysis-header .breadcrumb a { color: #d4e4fb; }
.analysis-header .eyebrow { color: #8bbcff; }
.analysis-header h1 { max-width: 850px; font-size: clamp(32px, 4vw, 52px); }
.analysis-header p { margin: 14px 0 0; color: #c7d5e9; }
.analysis-title-row { display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.scenario-id { font-size: 13px; }
.copy-button { border: 0; padding: 0; background: none; color: #fff; text-decoration: underline; cursor: pointer; }

.analysis-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; align-items: start; padding: 34px 0 68px; }
.input-panel, .preview-panel, .result-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 12px 38px rgba(20,35,64,.06); }
.input-panel { padding: 30px; }
.panel-heading { display: flex; justify-content: space-between; align-items: end; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.autosave-note { color: var(--green); font-size: 12px; font-weight: 800; }
fieldset { min-width: 0; margin: 0; padding: 30px 0; border: 0; border-bottom: 1px solid var(--line); }
legend { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 20px; padding: 0; font-size: 17px; font-weight: 800; }
legend span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-size: 11px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-wide { grid-column: 1 / -1; }
.field-label { display: block; margin-bottom: 7px; color: #344056; font-size: 12px; font-weight: 750; }
.input-wrap { position: relative; display: block; }
.input-wrap input { width: 100%; min-height: 46px; padding: 10px 52px 10px 12px; border: 1px solid #cfd7e5; border-radius: 10px; outline: 0; color: var(--ink); background: #fbfcfe; transition: border-color .15s, box-shadow .15s; }
.input-wrap input[type="text"] { padding-right: 12px; }
.input-wrap input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fff; }
.input-suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; font-weight: 750; pointer-events: none; }
.field-help, .field-error { display: block; margin-top: 6px; font-size: 11px; }
.field-help { color: var(--muted); }
.field-error { color: var(--red); font-weight: 700; }
.check-field { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; cursor: pointer; }
.check-field input { margin-top: 4px; accent-color: var(--blue); }
.check-field strong, .check-field small { display: block; }
.check-field strong { font-size: 13px; }
.check-field small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.tax-warning { grid-column: 1 / -1; margin-bottom: 18px; padding: 14px 16px; border: 1px solid #eadcae; border-radius: 10px; background: #fff9e8; color: #70551a; font-size: 12px; }
.submit-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 28px; }
.submit-bar strong, .submit-bar small { display: block; }
.submit-bar small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.preview-panel { position: sticky; top: 98px; padding: 26px; color: #fff; background: var(--navy); border-color: #173b69; }
.preview-panel .eyebrow { color: #87b5ff; }
.preview-panel h2 { font-size: 25px; }
.preview-address { min-height: 40px; margin: 8px 0 20px; color: #b9cce4; font-size: 12px; }
.preview-primary { padding: 20px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.06); }
.preview-primary small, .preview-primary strong { display: block; }
.preview-primary small, .preview-grid small { color: #aebfd6; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.preview-primary strong { margin-top: 7px; color: #7ee0b8; font-size: 34px; letter-spacing: -.04em; }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 20px; background: rgba(255,255,255,.13); }
.preview-grid div { padding: 16px 8px; background: var(--navy); }
.preview-grid strong { display: block; margin-top: 5px; font-size: 15px; }
.preview-note { margin: 22px 0 0; color: #95a9c4; font-size: 10px; line-height: 1.55; }

.alert { margin-top: 18px; padding: 14px 16px; border-radius: 10px; font-size: 13px; }
.alert-success { border: 1px solid #b9e2d1; background: var(--green-soft); color: #0a6747; }
.alert-error { border: 1px solid #f0c6ca; background: var(--red-soft); color: #8d2430; }
.site-header + main > .shell > .alert { margin-top: 20px; }

.results-section { padding: 68px 0 80px; border-top: 1px solid var(--line); background: #eef3f9; }
.result-heading { align-items: center; }
.status-pill, .mode-tag { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 999px; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.status-good { background: var(--green-soft); color: var(--green); }
.status-bad { background: var(--red-soft); color: var(--red); }
.mode-tag { background: var(--blue-soft); color: var(--blue-dark); }
.metric-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.metric-card { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.metric-card.featured { color: #fff; border-color: var(--navy); background: var(--navy); }
.metric-card small, .metric-card strong, .metric-card span { display: block; }
.metric-card small { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.metric-card.featured small, .metric-card.featured span { color: #aebfd5; }
.metric-card strong { margin-top: 8px; font-size: 28px; letter-spacing: -.04em; }
.metric-card span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.result-grid { display: grid; gap: 24px; margin-top: 24px; }
.two-column { grid-template-columns: 1fr 1fr; }
.result-card { padding: 26px; box-shadow: none; }
.result-card.full-width { margin-top: 24px; }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.card-heading h3 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.card-heading p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.data-table { border-top: 1px solid var(--line); }
.data-row { display: flex; justify-content: space-between; gap: 20px; padding: 10px 2px; border-bottom: 1px solid #edf0f5; font-size: 12px; }
.data-row span { color: var(--muted); }
.data-row strong { white-space: nowrap; }
.data-total { margin-top: 4px; border-color: #cfd8e7; font-weight: 800; }
.data-total span { color: var(--ink); }
.limit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.limit-grid div { padding: 18px; border-radius: 12px; background: #f4f7fb; }
.limit-grid small, .limit-grid strong { display: block; }
.limit-grid small { min-height: 32px; color: var(--muted); font-size: 10px; }
.limit-grid strong { margin-top: 6px; font-size: 21px; }
.top-space { margin-top: 22px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
thead th { background: #f4f7fb; color: #4b5870; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
th:first-child, td:first-child { position: sticky; left: 0; text-align: left; background: #fff; }
thead th:first-child { background: #f4f7fb; z-index: 2; }
.heat-positive { color: #0c6f4e; background: #e9f8f1; font-weight: 750; }
.heat-negative { color: #a12c38; background: #fff0f1; font-weight: 750; }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.comparison-grid > div { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.comparison-grid span, .comparison-grid strong, .comparison-grid p { display: block; }
.comparison-grid span { color: var(--muted); font-size: 11px; }
.comparison-grid strong { margin-top: 12px; font-size: 25px; }
.comparison-grid strong small { display: inline; font-size: 11px; font-weight: 600; }
.comparison-grid p { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.projection-table .selected-year td, .projection-table .selected-year th { background: #eaf1ff; font-weight: 800; }

.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0; color: var(--muted); font-size: 11px; }
.footer-inner p { margin: 0; }

@media (max-width: 980px) {
    .hero-grid, .analysis-layout { grid-template-columns: 1fr; }
    .hero-grid { gap: 40px; }
    .preview-panel { position: static; order: -1; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .feature-grid article:nth-child(2) { border-right: 0; }
    .feature-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .two-column { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .shell { width: min(100% - 24px, 1180px); }
    .brand small, .site-header nav > a:not(.button) { display: none; }
    .hero { padding: 58px 0; }
    .hero h1 { font-size: 42px; }
    .hero-grid { gap: 28px; }
    .hero-actions { display: grid; }
    .section-heading, .analysis-title-row, .submit-bar { align-items: stretch; flex-direction: column; }
    .search-bar { grid-template-columns: 1fr; }
    .search-bar input { min-height: 48px; }
    .scenario-row { grid-template-columns: minmax(0, 1fr) 110px 20px; gap: 10px; padding: 17px 15px; }
    .hide-mobile { display: none; }
    .feature-grid, .field-grid, .metric-cards, .limit-grid, .comparison-grid { grid-template-columns: 1fr; }
    .feature-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
    .field-wide { grid-column: auto; }
    .input-panel, .result-card { padding: 20px; }
    .analysis-header { padding: 34px 0; }
    .analysis-header h1 { font-size: 34px; }
    .analysis-title-row .button { margin-top: 20px; }
    .submit-bar .button { width: 100%; margin-top: 14px; }
    .footer-inner { flex-direction: column; }
}
