@import url('/calculator-base.css');
@import url('/site-footer.css');

body { background: #fff; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.page-content a, .calculator-form .helper a { color: var(--blue); font-weight: 600; }
.page-content a:hover, .calculator-form .helper a:hover { color: var(--navy); }
.site-header { position: relative; z-index: 20; background: #fff; }
.page-intro { width: min(75%, 1050px); max-width: none; margin: 0 auto; padding: clamp(1.35rem, 3vw, 2.5rem) 0 2.5rem; background: transparent; }
.breadcrumb { align-items: center; margin: 0 0 1.3rem; font-size: .78rem; }
.breadcrumb a { display: inline-flex; align-items: center; gap: .35rem; color: var(--blue); text-decoration: none; }
.breadcrumb a::before { content: ''; width: .82rem; height: .82rem; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='m3 10 9-7 9 7v10a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='m3 10 9-7 9 7v10a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E") center / contain no-repeat; }
.page-intro h1, .heater-diagram-heading h2, .content-section h2 { width: 100%; max-width: none; }
.page-intro h1 { margin-bottom: .55rem; font-size: clamp(2.55rem, 5.2vw, 4.8rem); }
.page-intro > p:last-child { max-width: none; color: #426474; font-size: 1.06rem; line-height: 1.62; }

.calculator-shell, .results-section { width: min(75%, 1050px); max-width: none; margin-right: auto; margin-left: auto; padding: 0; }
.calculator-shell { margin-top: 0; }
.calculator-head { align-items: center; padding: 1.35rem 1.5rem; border: 1px solid var(--line); border-radius: 13px 13px 0 0; background: var(--navy); }
.calculator-head .eyebrow { color: #7ce4dc; }
.calculator-head h2 { font-size: clamp(1.3rem, 2vw, 1.65rem); }
.calculator-head > p { max-width: 410px; color: #d4ebec; font-size: .84rem; line-height: 1.55; }
.mode-tabs { overflow: hidden; border-color: var(--line); }
.mode-tabs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mode-tab { min-height: 64px; padding: .75rem .8rem; border-right-color: var(--line); color: #365f70; background: #fff; font-size: .78rem; text-align: left; }
.mode-tab small { margin-top: .18rem; color: #67808d; font-size: .66rem; line-height: 1.35; }
.mode-tab.active { color: #fff; background: var(--blue); }
.mode-tab.active small { color: #e5fbf9; }
.calculator-layout { grid-template-columns: minmax(0, 1fr); border-color: var(--line); border-radius: 0 0 13px 13px; }
.calculator-form { min-width: 0; padding: 1.5rem; }
fieldset legend { display: flex; align-items: center; margin-bottom: 1.15rem; line-height: 1.25; }
legend span { flex: 0 0 25px; margin-right: .55rem; background: var(--blue); }
.field-grid { gap: 1rem; }
.field label { font-size: .82rem; }
.calculator-form :is(input, select) { min-height: 43px; border: 1px solid #c7d7dc; color: var(--ink); background: #fff; font-size: .86rem; }
.calculator-form select { padding-right: 3rem; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%230b3150' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; background-size: .8rem; }
.calculator-form :is(input, select):focus { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); outline: none; }
.calculator-form .compound :is(input, select):focus { box-shadow: none; }
.unit-display { min-height: 43px; border-color: #c7d7dc; background: #eef5f6; }
.helper { font-size: .71rem; }
.builder-wrap > .helper, #tankless-builder > .helper { margin: .65rem 0 1rem; }
#tankless-direct { margin-top: 1.15rem; }
#storage-direct, #hpwh-direct { margin-top: 1.15rem; }
.subsection { margin-top: 1.35rem; padding-top: 1.25rem; }
.subsection h3 { font-size: .92rem; }
.form-actions { margin-top: 1.45rem; }
.primary-button { background: var(--blue); }
.primary-button:hover { background: #008b82; }
.text-button { font-size: .78rem; }
.demand-wrap { overflow-x: auto; border: 1px solid #dbe8eb; border-radius: 8px; }
.demand-table { min-width: 620px; }
.demand-table th { padding: .7rem; color: #446775; background: #f3f9f9; font-size: .64rem; }
.demand-table td { padding: .65rem .7rem; color: #365f70; font-size: .74rem; }
.demand-table input { min-height: 38px; }

.results-section { margin-top: 3rem; }
.results-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.result-header { padding: 1.35rem 1.5rem 1rem; }
.result-header h2 { font-size: clamp(1.3rem, 2vw, 1.65rem); }
.result-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.copy-button { display: inline-flex; align-items: center; justify-content: center; gap: .43rem; min-height: 2.4rem; padding: .5rem .75rem; border: 1px solid #bcd9d7; border-radius: 7px; color: var(--blue); background: #fff; font-size: .72rem; }
.copy-button:hover { color: #fff; border-color: var(--blue); background: var(--blue); }
.copy-button svg { width: .95rem; height: .95rem; flex: 0 0 .95rem; }
.primary-result { margin-top: 0; padding: 1.45rem 1.5rem; border-radius: 0; background: var(--navy); }
.result-label { color: #7ce4dc; }
.result-summary { color: #d4ebec; font-size: .86rem; }
.metric-grid { gap: .75rem; padding: 1.2rem 1.5rem; border: 0; border-radius: 0; background: #fff; }
.metric-grid article { min-height: 6.5rem; padding: .85rem; border: 1px solid #dbe8eb; border-radius: 8px; background: #fbfdfd; }
.metric-grid span { color: #54717e; }
.metric-grid strong { color: var(--navy); }
.result-model-check { margin: 0 1.5rem 1.2rem; padding: 1rem; border: 1px solid #dbe8eb; border-radius: 8px; background: #fbfdfd; }
.result-model-check h3 { margin: 0 0 .35rem; color: var(--navy); font-size: .92rem; }
.result-model-check > p { margin: 0; color: #526f7e; font-size: .82rem; line-height: 1.55; }
.result-model-check .field { max-width: 27rem; margin-top: .85rem; }
.result-model-check .field label { font-size: .78rem; }
.result-model-check input { min-height: 43px; border: 1px solid #c7d7dc; color: var(--ink); background: #fff; font-size: .86rem; }
.result-model-check input:focus { border-color: var(--blue); box-shadow: none; outline: none; }
.result-model-check .helper { margin-top: .38rem; font-size: .71rem; }
.candidate-status { min-height: 1.1rem; margin: .5rem 0 0 !important; color: #08776f !important; font-size: .78rem !important; font-weight: 600; }
.result-details { padding: 0 1.5rem 1.4rem; }
.result-note { margin-top: 0; border-left-color: var(--blue); background: #eff9f8; }
.math-details { margin-top: 1rem; border-color: var(--line); border-radius: 8px; }
.math-details summary { display: flex; align-items: center; justify-content: space-between; min-height: 2.8rem; padding: 0 .9rem; color: var(--navy); font-size: .78rem; font-weight: 600; list-style: none; }
.math-details summary::-webkit-details-marker { display: none; }
.math-details summary::after { content: '+'; color: var(--blue); font-size: 1.15rem; font-weight: 700; }
.math-details[open] summary::after { content: '−'; }
.math-details > div { padding: 0 .9rem .9rem; }

.page-body-layout { display: grid; grid-template-columns: minmax(0, 1fr) 245px; grid-template-areas: 'content sidebar'; gap: 3.5rem; align-items: start; width: min(75%, 1050px); margin: 3.4rem auto 0; padding-bottom: 3rem; }
.page-content { display: flex; flex-direction: column; grid-area: content; min-width: 0; }
.page-content > * { width: auto; max-width: none; margin: 0; padding: 0; }
.page-content > * + * { margin-top: 2.65rem; }
.page-sidebar { position: sticky; top: 1.5rem; grid-area: sidebar; }
.page-toc { padding: 1.15rem; border: 0; border-radius: 12px; background: var(--blue); }
.toc-intro { margin-bottom: .9rem; }
.page-toc-label { margin: 0 0 .2rem; color: #fff; font-size: .9rem; font-weight: 700; }
.toc-intro > p:last-child { margin: 0; color: #e3fffc; font-size: .68rem; line-height: 1.5; }
.page-toc ol { display: grid; gap: .48rem; margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.page-toc li { counter-increment: toc; }
.page-toc a { display: flex; align-items: center; gap: .65rem; min-height: 3.15rem; padding: .5rem .55rem; border: 0; border-radius: 7px; color: #fff; background: rgba(255,255,255,.1); font-size: .71rem; font-weight: 600; line-height: 1.35; text-decoration: none; }
.page-toc a::before { content: counter(toc, decimal-leading-zero); display: grid; width: 1.7rem; height: 1.7rem; flex: 0 0 1.7rem; place-items: center; border-radius: 50%; color: #08776f; background: #fff; font-size: .58rem; font-weight: 700; }
.page-toc a:hover, .page-toc a:focus-visible { color: #fff; background: rgba(255,255,255,.18); outline-color: #fff; }
.heater-diagrams { display: grid; gap: 3rem; width: auto; max-width: none; margin: 0; }
.heater-diagram-panel { display: grid; gap: 1rem; }
.heater-diagram-heading .eyebrow { margin: 0 0 .55rem; }
.heater-diagram-heading h2, .content-section h2 { margin: 0 0 .75rem; font-size: clamp(1.55rem, 2.7vw, 2.1rem); line-height: 1.2; }
.heater-illustration { display: grid; gap: .7rem; width: min(100%, 620px); margin: .15rem auto 0; }
.heater-illustration img { display: block; width: 100%; height: auto; object-fit: contain; }
.heater-illustration figcaption { color: #647d89; font-size: .76rem; line-height: 1.5; }
.heater-diagram-copy { display: grid; gap: .8rem; }
.heater-diagram-copy p { max-width: none; margin: 0; color: #526f7e; font-size: .92rem; line-height: 1.7; }
.copy-grid { gap: .75rem; border: 0; overflow: visible; }
.copy-grid article { min-height: 0; padding: 1rem; border: 1px solid #dbe8eb; border-radius: 9px; background: #fff; }
.copy-grid h3 { font-size: .92rem; }
.example-list { display: grid; gap: 2rem; }
.example-list article { padding: 0; border: 0; background: transparent; }
.example-list h3 { margin: 0 0 .55rem; color: var(--navy); font-size: 1.05rem; }
.example-list p { max-width: none; margin: 0; color: #526f7e; font-size: .91rem; line-height: 1.65; }
.example-list p + p { margin-top: .65rem; }
.example-list .example-calculation { padding-left: .8rem; border-left: 3px solid var(--blue); color: #365f70; }
.example-list .example-decision { color: var(--navy); }
.plain-section-list { display: grid; gap: 1.55rem; }
.plain-section-list article { padding: 0; border: 0; background: transparent; }
.plain-section-list h3 { margin: 0 0 .55rem; color: var(--navy); font-size: 1.05rem; }
.plain-section-list p { max-width: none; margin: 0; color: #526f7e; font-size: .91rem; line-height: 1.65; }
.stacked-card-list { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.stacked-card-list article { min-height: 0; padding: 1rem; border: 1px solid #dbe8eb; border-radius: 9px; background: #fff; }
.stacked-card-list h3 { margin: 0 0 .45rem; color: var(--navy); font-size: .92rem; }
.stacked-card-list p { margin: 0; color: #526f7e; font-size: .91rem; line-height: 1.65; }
.copy-grid p, .content-section :is(p, li) { font-size: .91rem; line-height: 1.65; }
.section-intro { max-width: 48rem; margin: -.15rem 0 1.15rem; color: #526f7e; font-size: .91rem; line-height: 1.65; }
.section-followup { margin: 1rem 0 0; color: #365f70; font-size: .91rem; line-height: 1.65; }
.section-followup a { color: var(--blue); font-weight: 600; }
.reviewed-date { margin: -.45rem 0 .8rem; color: #647d89; font-size: .76rem; font-weight: 400; }
.table-wrap { border-color: var(--line); border-radius: 9px; }
.table-wrap table { min-width: 700px; }
.table-wrap th { padding: .82rem .9rem; color: var(--navy); background: #edf7f6; }
.table-wrap td { padding: .88rem .9rem; color: #365f70; }
.source-list { gap: .65rem; }
.source-list li { padding: .85rem .95rem; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 7px; background: #fff; font-size: .82rem; line-height: 1.6; }
#heater-faqs .faq-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
#heater-faqs .faq-grid details { padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: none; }
#heater-faqs .faq-grid summary { display: flex; align-items: center; justify-content: space-between; min-height: 0; padding: 0; color: var(--navy); font-size: .9rem; font-weight: 600; list-style: none; cursor: pointer; }
#heater-faqs .faq-grid summary::-webkit-details-marker { display: none; }
#heater-faqs .faq-grid summary::after { content: '+'; color: var(--blue); font-size: 1.1rem; font-weight: 700; }
#heater-faqs .faq-grid details[open] summary::after { content: '−'; }
#heater-faqs .faq-grid p { padding: 0; margin: .7rem 0 0; color: #526f7e; font-size: .88rem; line-height: 1.7; }

.print-report { display: none; }
@media print {
  @page { margin: 16mm; }
  body { color: #000; background: #fff; font-size: 10pt; }
  .site-header, .page-intro, .calculator-shell, .page-body-layout, .site-footer { display: none !important; }
  main, .results-section, .results-card { display: block !important; width: 100% !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
  .results-section[hidden] { display: none !important; }
  .print-report { display: block; margin-bottom: 1.25rem; }
  .print-report-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: .45rem; border-bottom: 1px solid #80949a; color: var(--navy); }
  .print-report-header p { margin: 0; font-weight: 700; }
  .print-report-title { margin: .7rem 0 1rem; color: var(--navy); font-size: 22pt; font-weight: 700; }
  .print-input-summary { padding: .85rem 1rem; border: 1px solid #b9cbd0; border-radius: 7px; }
  .print-input-summary h2 { margin: 0 0 .45rem; color: var(--navy); font-size: 12pt; }
  .print-input-summary dl { display: grid; grid-template-columns: 1fr 1fr; gap: .38rem 1rem; margin: 0; }
  .print-input-summary div { display: grid; grid-template-columns: 45% 1fr; gap: .35rem; }
  .print-input-summary dt { color: #526a74; font-weight: 600; }
  .print-input-summary dd { margin: 0; }
  .result-header { padding: 0 0 .7rem; }
  .result-header .eyebrow, .result-actions, .math-details { display: none !important; }
  .result-header h2 { font-size: 16pt; }
  .primary-result { padding: .9rem 1rem; color: #000; background: #eef6f5 !important; border: 1px solid #b9d8d3; }
  .primary-result :is(p, .result-label, .result-summary) { color: #000 !important; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); padding: .85rem 0; }
  .metric-grid article { min-height: 0; break-inside: avoid; }
  .result-details { padding: 0; }
  .result-note { margin: 0; }
}

@media (max-width: 900px) {
  .calculator-layout { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-body-layout { gap: 2.5rem; }
}
@media (max-width: 767px) {
  .page-intro, .calculator-shell, .results-section { width: auto; margin-right: clamp(1.25rem, 8vw, 10rem); margin-left: clamp(1.25rem, 8vw, 10rem); }
  .page-intro { padding-top: 1.25rem; padding-bottom: 2rem; }
  .breadcrumb { margin-bottom: 1rem; }
  .page-intro h1 { font-size: 2.5rem; }
  .page-intro > p:last-child { font-size: .96rem; }
  .calculator-head { display: block; padding: 1.15rem; }
  .calculator-head > p { margin-top: .7rem; text-align: left; }
  .mode-tabs.three { grid-template-columns: 1fr; }
  .mode-tab { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .mode-tab:last-child { border-bottom: 0; }
  .calculator-form { padding: 1.15rem; }
  .field-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .primary-button, .text-button { width: 100%; }
  .results-section { margin-top: 2.4rem; }
  .result-header { align-items: flex-start; padding: 1.15rem 1.15rem .9rem; }
  .copy-button { min-width: 2.5rem; padding: .6rem; }
  .copy-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .primary-result { padding: 1.2rem 1.15rem; }
  .metric-grid { grid-template-columns: 1fr; padding: 1rem 1.15rem; }
  .metric-grid article { min-height: 0; }
  .result-model-check { margin: 0 1.15rem 1rem; padding: .9rem; }
  .result-details { padding: 0 1.15rem 1.15rem; }
  .page-body-layout { grid-template-columns: 1fr; grid-template-areas: 'sidebar' 'content'; gap: 2.4rem; width: auto; margin: 2.4rem clamp(1.25rem, 8vw, 10rem) 0; padding-bottom: 2.4rem; }
  .page-sidebar { position: static; }
  .page-content > * + * { margin-top: 2.25rem; }
  .heater-diagrams { gap: 2.5rem; }
  .heater-illustration { width: min(100%, 520px); }
  .copy-grid { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
}
