@font-face {
    font-family: Montserrat;
    src: url('montserrat-regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: Montserrat;
    src: url('montserrat-semibold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}
:root {
    color-scheme: light;
    --ink: #24211e;
    --muted: #635549;
    --line: #e4ddd5;
    --page: #faf8f5;
    --accent: #942b25;
    --accent-deep: #79231e;
    --light: #f1e9df;
    --white: #fff;
    --radius: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 14px/1.6 Montserrat, Arial, sans-serif; }
a { color: var(--accent-deep); text-underline-offset: .2em; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.wrap { width: min(1124px, calc(100% - 56px)); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.site-nav { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-nav a { font-size: 13px; font-weight: 600; }
.site-nav .brand img { display: block; width: clamp(120px, 16vw, 170px); height: auto; }
.page-head { padding: 46px 0 30px; display: flex; justify-content: space-between; align-items: end; gap: 12px 28px; }
.page-head h1 { margin: 0; font-size: clamp(30px, 5.5vw, 40px); letter-spacing: -.035em; line-height: 1.18; }
.page-head h1 span { color: var(--accent); }
.page-head p { margin: 12px 0 0; color: var(--muted); max-width: 630px; }
.page-head > a { flex-shrink: 0; font-size: 14px; padding-bottom: 1px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 317px); align-items: start; gap: 20px; }
.calculator, .results { display: grid; gap: 16px; min-width: 0; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 3vw, 26px); min-width: 0; box-shadow: 0 6px 30px #3d2b1910; }
h2 { margin: 0 0 14px; line-height: 1.24; font-size: clamp(20px, 3vw, 23px); letter-spacing: -.023em; }
h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.32; }
p { margin: 0 0 10px; }
.panel > :last-child, .help:last-child { margin-bottom: 0; }
.help { color: var(--muted); font-size: 13px; line-height: 1.55; margin-block: 9px 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0 12px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 12px; margin-top: 13px; }
.fields label { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-width: 0; font-size: 13px; font-weight: 650; }
.fields input:not([type="checkbox"]), select { width: 100%; min-height: 46px; border: 1px solid #807064; background: var(--white); color: var(--ink); border-radius: 7px; padding: 7px 9px; font-size: 16px; font-weight: 400; }
select { padding-right: 5px; }
::placeholder { color: var(--muted); font-size: .85em; }
.zone { border: 1px solid var(--line); background: var(--page); border-radius: 10px; padding: 2px 13px 12px; margin-bottom: 12px; }
.zone legend { color: var(--accent-deep); padding: 0 6px; font-size: 14px; font-weight: 750; }
.zone .zone-top { margin-top: 4px; }
.text-button { background: transparent; padding: 5px 0; border: 0; color: var(--accent-deep); text-decoration: underline; text-underline-offset: .18em; font-size: 13px; }
.remove-zone { margin-top: 7px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: 8px 12px; min-height: 42px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; font-weight: 700; }
.button-primary { background: var(--accent); color: white; padding: 10px 18px; width: 100%; box-shadow: 0 4px 12px #932c2621; }
.button-primary:hover { background: var(--accent-deep); }
.button-light { background: var(--white); color: var(--accent-deep); border-color: #a68f7c; }
.button-light:hover { border-color: var(--accent); }
.button:disabled { opacity: .55; cursor: wait; }
.error, .notes { color: #763c22; }
.error { margin: 9px 0 0; }
.summary { position: sticky; top: 16px; background: linear-gradient(145deg, #faf7f2, #f0e9df); }
.calculate-bar { margin-bottom: 16px; }
.metrics { margin: 10px 0 14px; }
.metrics > div { display: flex; align-items: baseline; justify-content: space-between; gap: 5px 14px; border-bottom: 1px solid var(--line); padding: 11px 0; }
.metrics dt { color: var(--muted); font-size: 13px; }
.metrics dd { margin: 0; text-align: right; font-size: 18px; font-weight: 760; font-variant-numeric: tabular-nums; }
.details-link { display: block; font-weight: 650; font-size: 14px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.report-actions .button { min-height: 36px; font-size: 12px; padding-inline: 8px; }
.results { margin: 24px 0 44px; scroll-margin-top: 14px; }
.table-wrap { overflow: auto; }
table { width: 100%; min-width: 790px; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; text-align: left; }
th, td { border-bottom: 1px solid var(--line); padding: 9px 7px; }
th { background: var(--light); font-weight: 650; }
.notes { background: #fdf4e9; border: 1px solid #efddc9; border-radius: 8px; margin: 12px 0 0; padding: 9px 12px 9px 29px; font-size: 14px; }
.notes li + li { margin-top: 4px; }
.filters { margin: 12px 0; }
.fields .checkbox { flex-direction: row; align-items: center; justify-content: flex-start; min-height: 43px; align-self: end; }
.checkbox input { accent-color: var(--accent); width: 17px; height: 17px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(245px, 100%), 1fr)); gap: 8px; margin-top: 8px; }
.product { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 11px; overflow-wrap: anywhere; }
.product p { margin: 5px 0 0; font-size: 13px; }
.product .status { font-weight: 680; color: var(--accent-deep); }
@media (max-width: 860px) {
    .workspace { grid-template-columns: minmax(0, 1fr); }
    .summary { position: static; }
    .page-head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 540px) {
    .wrap { width: calc(100% - 24px); }
    .page-head { padding: 24px 0 19px; }
    .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .fields label:has(select), .fields label:has([data-field="name"]), .fields .checkbox { grid-column: span 2; }
    .metrics dd { font-size: 16px; }
}

/* Water heater selector */
.page-head { padding-top: clamp(25px, 5vw, 46px); }
.workspace { grid-template-columns: minmax(0, 1.72fr) minmax(275px, 1fr); }
.panel-heading h2 { margin-bottom: 12px; }
.type-picker legend, .input-section legend, summary { font-weight: 600; }
.type-picker legend { margin-bottom: 6px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--page); border: 1px solid var(--line); border-radius: 9px; }
.segmented label { display: block; position: relative; cursor: pointer; text-align: center; }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; cursor: pointer; }
.segmented span { min-height: 42px; display: grid; place-items: center; padding: 6px; border: 1px solid transparent; border-radius: 6px; font-weight: 600; }
.segmented input:checked + span { border-color: #d3b3a6; background: var(--white); color: var(--accent-deep); }
.segmented input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 1px; }
fieldset.input-section { border-top: 1px solid var(--line); }
.input-section { margin-top: 16px; }
.input-section legend { padding: 0 8px 0 0; }
.input-section legend + .help { margin-top: 0; }
.fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.demand-fields [aria-invalid="true"] { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.three-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
summary { cursor: pointer; color: var(--accent-deep); }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.presets button { min-height: 40px; background: var(--white); border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px; color: var(--accent-deep); font-size: 12px; }
.presets button:hover { border-color: var(--accent); }
.summary .lead { margin: 0; font-size: clamp(29px, 4vw, 40px); color: var(--accent-deep); line-height: 1.22; font-weight: 600; letter-spacing: -.03em; }
.summary .lead-label { margin: 3px 0 13px; color: var(--muted); font-size: 13px; }
.summary .button-primary { margin-top: 12px; text-decoration: none; }
.summary .button-primary:focus-visible { outline-offset: 4px; }
.metrics { margin: 0; }
.metrics > div { padding-block: 8px; }
.metrics dd { font-size: 16px; }
.result-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.catalog-date { margin: 0 0 6px; }
.filters { grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); }
.filters .checkbox { padding-bottom: 1px; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; gap: 12px; }
.product { display: flex; flex-direction: column; padding: 15px; background: #fff; min-width: 0; }
.product-media { display: grid; grid-template-rows: minmax(0, 1fr); place-items: center; height: 156px; margin: 0 0 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.product-media:has(figcaption) { grid-template-rows: minmax(0, 1fr) auto; gap: 4px; }
.product-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-media figcaption { color: var(--muted); font-size: 12px; }
.product .product-no-photo { margin: 0; color: var(--muted); }
.product .product-result { color: var(--accent-deep); font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.product h3 { margin-bottom: 5px; }
.product .product-detail { color: var(--muted); }
.product .product-shop { margin-top: auto; padding-top: 10px; font-weight: 600; }
.product .product-link { align-self: flex-start; margin-top: 8px; font-size: 12px; }
#show-more { margin-top: 14px; }
.methodology p { margin-top: 10px; }
#print-root { position: fixed; top: 0; left: -230mm; width: 210mm; pointer-events: none; }
.print-page { background: white; color: #24211e; width: 210mm; height: 297mm; padding: 13mm 15mm; display: flex; flex-direction: column; font: 13px/1.43 Arial, sans-serif; }
.print-page header img { display: block; width: 38mm; height: auto; }
.print-page h1 { font-size: 26px; margin: 4mm 0 1mm; line-height: 1.2; }
.print-page h2 { font-size: 16px; margin: 3.8mm 0 1.2mm; color: #79231e; }
.print-page p { margin-bottom: 2.2mm; }
.print-page table { min-width: 0; font: inherit; }
.print-page th, .print-page td { padding: 1.2mm 1mm; background: white; border-color: #e4ddd5; }
.print-page th { width: 47%; }
.print-page footer { margin-top: auto; padding-top: 3mm; border-top: 1px solid #e4ddd5; }
.print-page footer a { display: inline-flex; align-items: center; gap: 3mm; }
.print-page footer img { width: 23mm; height: 23mm; image-rendering: pixelated; }
@media (max-width: 820px) {
    .workspace { grid-template-columns: minmax(0, 1fr); }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
    .product-grid, .filters { grid-template-columns: minmax(0, 1fr); }
    .filters .checkbox, .fields label:has(select) { grid-column: 1 / -1; }
    .demand-fields { grid-template-columns: minmax(0, 1fr); }
    .three-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-nav a { font-size: 12px; }
}
@page { size: A4; margin: 0; }
@media print {
    body > :not(#print-root) { display: none !important; }
    body { background: white; }
    #print-root { position: static; }
    .print-page { print-color-adjust: exact; }
    .print-page + .print-page { break-before: page; }
}
