@font-face { font-family: Roboto; src: url("assets/Roboto-Regular.ttf"); }
@font-face { font-family: Roboto; src: url("assets/Roboto-Medium.ttf"); font-weight: 500; }

:root { --mint: #8ccfc5; --mint-deep: #6db9af; --navy: #545b70; --navy-dark: #464d61; --gray: #73798a; --mist: #f5f6f8; --line: #dce0e5; --ink: #303545; }
* { box-sizing: border-box; }
body { margin: 0; padding-top: 72px; background: var(--navy); color: var(--ink); font: 16px Roboto, Arial, sans-serif; }
.app-shell { max-width: 1180px; margin: 30px auto; background: #fff; }
.app-header { display: flex; align-items: center; gap: 26px; min-height: 86px; padding: 18px 42px; background: var(--navy); border-top: 2px solid var(--mint); }
.brand { display: flex; align-items: center; gap: 10px; height: 54px; text-decoration: none; }
.brand:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.brand-word { width: 160px; height: 54px; background: #fff; -webkit-mask: url("assets/zellhoff-logo-ci.png") left center / auto 54px no-repeat; mask: url("assets/zellhoff-logo-ci.png") left center / auto 54px no-repeat; }
.brand-icon { width: 58px; height: 54px; background: var(--mint); -webkit-mask: url("assets/zellhoff-logo-ci.png") right center / auto 54px no-repeat; mask: url("assets/zellhoff-logo-ci.png") right center / auto 54px no-repeat; }
.eyebrow { margin: 0 0 3px; color: var(--mint); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.app-header h1 { margin: 0; color: #fff; font-size: 22px; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; }
.intro { padding: 62px 42px 56px; background: var(--mint); text-align: center; }
.intro h2, .section h2 { margin: 0; font-weight: 500; }
.intro h2 { max-width: 760px; margin: auto; color: #fff; font-size: 42px; line-height: 1.05; letter-spacing: .025em; text-transform: uppercase; }
.intro p { max-width: 650px; margin: 22px auto 0; color: var(--navy); font-size: 19px; line-height: 1.45; }
.content { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; padding: 42px; }
.section { padding: 27px 0; border-top: 1px solid var(--line); }
.section:first-child { padding-top: 0; border-top: 0; }
.section h2 { margin-bottom: 20px; color: var(--navy); font-size: 18px; letter-spacing: .06em; text-transform: uppercase; }
label { display: block; margin: 16px 0 7px; color: var(--navy); font-weight: 500; }
label span { color: var(--gray); font-weight: 400; }
input, select { width: 100%; height: 45px; padding: 8px 11px; border: 1px solid #c6cbd4; border-radius: 0; background: #fff; color: var(--ink); font: inherit; }
input:hover, select:hover { border-color: var(--mint-deep); }
input:focus, select:focus { outline: 2px solid var(--mint); outline-offset: 1px; border-color: var(--mint); }
form input[type="checkbox"] { accent-color: var(--mint); }
.input-with-unit { position: relative; }
.input-with-unit input { padding-right: 48px; }
.input-unit { position: absolute; top: 50%; transform: translateY(-50%); color: var(--gray); font-size: inherit; pointer-events: none; }
.input-stepper { position: absolute; top: 1px; right: 1px; bottom: 1px; display: grid; width: 27px; grid-template-rows: 1fr 1fr; background: #fff; }
.input-stepper button { border: 0; background: transparent; color: var(--gray); font-size: 10px; line-height: 1; cursor: pointer; }
.input-stepper button:hover, .input-stepper button:focus-visible { background: var(--mist); color: var(--navy); outline: 0; }
.input-with-unit input::-webkit-inner-spin-button, .input-with-unit input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input-with-unit input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.help { margin: 7px 0 0; color: var(--gray); font-size: 13px; line-height: 1.45; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.peak-power-fields > div > label { display: flex; align-items: flex-start; min-height: 42px; }
.checkbox-control-row { display: flex; align-items: center; gap: 9px; margin: 16px 0 7px; color: var(--navy); }
.checkbox-control-row > input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; }
.checkbox-control-copy { display: flex; align-items: center; gap: 5px; }
.checkbox-control-copy label { margin: 0; }
.checkbox-control-copy .peak-info-button { flex: 0 0 auto; margin: 0; }
.efficiency-fieldset { margin: 18px 0 0; padding: 0; border: 0; }
.efficiency-fieldset legend { margin-bottom: 9px; color: var(--navy); font-weight: 500; }
.efficiency-labels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.efficiency-label { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin: 0; padding: 7px 10px 7px 13px; color: #fff; cursor: pointer; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); transition: transform .12s ease, filter .12s ease, box-shadow .12s ease; }
.efficiency-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.efficiency-label:has(input:focus-visible) { filter: drop-shadow(0 0 2px var(--navy)); }
.efficiency-label:has(input:checked) { z-index: 1; filter: drop-shadow(0 3px 2px rgb(48 53 69 / 24%)); transform: translateY(-2px); }
.efficiency-label:has(input:checked)::after { position: absolute; right: 10px; bottom: 0; left: 0; height: 6px; background: #4b315f; content: ""; }
.efficiency-label.class-a { background: #158444; }
.efficiency-label.class-b { background: #69a936; }
.efficiency-label.class-c { background: #e0b600; }
.efficiency-label.class-d { background: #eb8125; }
.efficiency-label.class-e { background: #c83d34; }
.efficiency-letter { color: inherit; font-size: 21px; font-weight: 500; }
.efficiency-label span:last-child { color: inherit; font-size: 16px; font-weight: 700; white-space: nowrap; }
.efficiency-selection { margin: 11px 0 0; color: var(--gray); font-size: 13px; }
.efficiency-selection strong { color: var(--navy); }
.result-panel { align-self: start; margin-top: 0; padding: 32px 30px; background: var(--navy); border-top: 7px solid var(--mint); }
.result-label { margin: 0 0 9px; color: var(--mint); font-size: 18px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.primary-result { display: block; color: #fff; font-size: 56px; font-weight: 500; letter-spacing: -.045em; }
.result-panel hr { margin: 25px 0; border: 0; border-top: 1px solid rgb(255 255 255 / 22%); }
.result-row { display: flex; justify-content: space-between; gap: 16px; margin: 13px 0; color: #dde1e7; font-size: 14px; }
.result-row span { white-space: nowrap; }
.result-row output { color: #fff; font-weight: 500; text-align: right; }
.result-panel .help { color: #ccd1d9; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.pdf-export-button, .share-button, .reset-all-button, .peak-info-dialog button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 20px; border: 1px solid #fff; border-radius: 5px; background: #89cbc0; color: #000; font: inherit; font-size: 16px; line-height: 1.25; text-decoration: none; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.share-button { display: inline-flex; align-items: center; gap: 7px; }
.share-icon { width: 16px; height: 16px; fill: currentColor; flex: 0 0 auto; }
.pdf-export-button:hover, .share-button:hover, .reset-all-button:hover, .peak-info-dialog button:hover { background: #4f5469; color: #89cbc0; }
.pdf-export-button:focus-visible, .share-button:focus-visible, .reset-all-button:focus-visible, .peak-info-dialog button:focus-visible { background: #4f5469; color: #89cbc0; outline: 2px solid #89cbc0; outline-offset: 2px; }
.pdf-export-button:disabled { cursor: wait; opacity: .65; }
.pdf-title-dialog { width: min(440px, calc(100% - 32px)); }
.pdf-title-dialog form { display: grid; gap: 10px; }
.pdf-title-dialog label { margin: 0; }
.pdf-title-dialog input { margin: 0; }
.pdf-title-dialog .help { margin: -3px 0 4px; }
.pdf-title-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 5px; }
.pdf-title-dialog .pdf-title-actions button { float: none; }
.share-dialog { width: min(620px, calc(100% - 32px)); }
.share-dialog label { clear: both; padding-top: 8px; }
.share-dialog textarea { width: 100%; resize: vertical; padding: 10px; border: 1px solid #c6cbd4; color: var(--ink); font: 13px/1.4 monospace; }
.share-dialog .copy-share-link { float: none; margin-top: 12px; }
.share-status { min-height: 20px; margin: 10px 0 0; color: var(--navy); font-size: 13px; }
.official-guide-link { color: var(--navy); font-weight: 500; text-decoration-color: var(--mint-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.official-guide-link:hover, .official-guide-link:focus-visible { color: #4b315f; text-decoration-color: #4b315f; }
.peak-info-dialog.efficiency-info-dialog { width: min(720px, calc(100% - 32px)); max-width: 720px; max-height: calc(100vh - 32px); overflow: auto; }
.efficiency-loss-list { padding-left: 22px; line-height: 1.45; }
.efficiency-loss-list li + li { margin-top: 6px; }
.efficiency-peak-note { padding: 12px 14px; border-left: 4px solid #4b315f; background: #f5f6f8; }
.efficiency-flow-figure { clear: both; margin: 22px 0; }
.efficiency-flow { display: block; width: 100%; height: auto; }
.flow-background { fill: #f5f6f8; stroke: #dce0e5; stroke-width: 2; }
.flow-node rect { stroke-width: 3; }
.flow-node text { fill: #303545; font: 500 20px Roboto, Arial, sans-serif; text-anchor: middle; }
.flow-node .flow-node-detail { fill: #73798a; font-size: 14px; font-weight: 400; }
.flow-node-pv rect { fill: #80d3b9; stroke: #6db9af; }
.flow-node-center rect { fill: #545b70; stroke: #4b315f; }
.flow-node-center text { fill: #fff; }
.flow-node-center .flow-node-detail { fill: #80d3b9; }
.flow-node-converter rect { fill: #fff; stroke: #80d3b9; }
.flow-node-battery rect { fill: #fff; stroke: #4b315f; }
.flow-node-grid rect { fill: #545b70; stroke: #4b315f; }
.flow-node-grid text { fill: #fff; font-size: 16px; }
.flow-arrow { fill: none; stroke-linecap: round; stroke-width: 3; }
.flow-arrow-pv { stroke: #6db9af; marker-end: url(#arrow-mint); }
.flow-arrow-bidirectional { stroke: #4b315f; marker-start: url(#arrow-purple); marker-end: url(#arrow-purple); }
#arrow-mint path { fill: none; stroke: #6db9af; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
#arrow-purple path { fill: none; stroke: #4b315f; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.flow-legend text { fill: #73798a; font: 400 13px Roboto, Arial, sans-serif; }
.efficiency-flow-figure figcaption { margin-top: 8px; color: var(--gray); font-size: 13px; line-height: 1.45; }
.reset-area { padding: 0 42px 34px; text-align: right; }
.error { margin: 14px 0 0; color: #ffd1d5; font-size: 13px; }
footer { display: flex; justify-content: space-between; gap: 16px; padding: 18px 42px; background: var(--navy-dark); color: #fff; font-size: 14px; }
input.is-derived-invalid, select.is-manual { color: #9ca3af; background: #f3f4f6; border-color: #d8dce3; }
.sticky-result { position: fixed; z-index: 20; top: 0; right: 0; left: 0; display: grid; grid-template-columns: 1fr 1fr; width: min(760px, 100%); margin: auto; padding: 12px 20px; background: var(--navy-dark); border-bottom: 4px solid var(--mint); box-shadow: 0 8px 28px rgb(34 38 51 / 30%); color: #fff; }
.sticky-result div { display: flex; align-items: baseline; justify-content: center; gap: 13px; padding: 2px 18px; }
.sticky-result div + div { border-left: 1px solid rgb(255 255 255 / 22%); }
.sticky-result span { color: var(--mint); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.sticky-result output { font-size: 20px; font-weight: 500; text-align: right; }

@media (min-width: 761px) {
  body { padding-top: 0; }
  .sticky-result { display: none; }
  .result-panel { position: sticky; top: var(--result-panel-sticky-top, 24px); }
}

@media (max-width: 760px) {
  body { padding-top: 64px; }
  .app-shell { min-height: 100vh; margin: 0; }
  .app-header, .intro, .content { padding-right: 22px; padding-left: 22px; }
  .app-header { gap: 16px; min-height: 76px; }
  .brand { gap: 8px; height: 46px; }
  .brand-word { width: 137px; height: 46px; -webkit-mask-size: auto 46px; mask-size: auto 46px; }
  .brand-icon { width: 49px; height: 46px; -webkit-mask-size: auto 46px; mask-size: auto 46px; }
  .intro { padding-top: 45px; padding-bottom: 40px; }
  .intro h2 { font-size: 31px; }
  .intro p { font-size: 16px; }
  .content { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
  .result-panel { margin: 0; }
  .result-actions { justify-content: flex-start; }
  .result-row { gap: 10px; }
  .result-row span { white-space: normal; }
  .two-columns { grid-template-columns: 1fr; }
  .peak-power-fields > div > label { min-height: 0; }
  .efficiency-labels { grid-template-columns: repeat(5, minmax(54px, 1fr)); overflow-x: auto; padding: 3px; }
  form .checkbox-label { display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; width: 100%; gap: 18px; }
  form .checkbox-label input[type="checkbox"] { flex: 0 0 auto; width: 51px; height: 31px; margin: 0 0 0 auto; padding: 0; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; background-color: #b8bdc7; background-image: radial-gradient(circle at 15px 15px, #fff 0 12px, transparent 13px); box-shadow: inset 0 0 0 1px rgb(48 53 69 / 14%), 0 2px 5px rgb(34 38 51 / 18%); cursor: pointer; transition: background-color .18s ease; }
  form .checkbox-label input[type="checkbox"]:checked { background-color: #89cbc0; background-image: radial-gradient(circle at 36px 15px, #fff 0 12px, transparent 13px); }
  form .checkbox-label input[type="checkbox"]:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
  form .checkbox-control-row { flex-direction: row-reverse; justify-content: space-between; width: 100%; gap: 18px; }
  form .checkbox-control-row > input[type="checkbox"] { flex: 0 0 auto; width: 51px; height: 31px; margin: 0 0 0 auto; padding: 0; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; background-color: #b8bdc7; background-image: radial-gradient(circle at 15px 15px, #fff 0 12px, transparent 13px); box-shadow: inset 0 0 0 1px rgb(48 53 69 / 14%), 0 2px 5px rgb(34 38 51 / 18%); cursor: pointer; transition: background-color .18s ease; }
  form .checkbox-control-row > input[type="checkbox"]:checked { background-color: #89cbc0; background-image: radial-gradient(circle at 36px 15px, #fff 0 12px, transparent 13px); }
  form .checkbox-control-row > input[type="checkbox"]:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
  footer { flex-direction: column; padding: 16px 22px; }
  .primary-result { font-size: 44px; }
  .sticky-result { padding: 9px 12px; }
  .sticky-result div { display: block; padding: 0 10px; }
  .sticky-result span, .sticky-result output { display: block; text-align: center; }
  .sticky-result span { margin-bottom: 3px; font-size: 10px; }
  .sticky-result output { font-size: 16px; }
  .reset-area { padding: 0 22px 28px; }
  .reset-all-button { width: 100%; }
  .efficiency-info-dialog { padding: 20px; }
  .efficiency-flow .flow-node text { font-size: 27px; }
  .efficiency-flow .flow-node .flow-node-detail { font-size: 20px; }
  .efficiency-flow .flow-node-grid text { font-size: 21px; }
  .efficiency-flow .flow-legend text { font-size: 18px; }
}

@media (max-width: 440px) {
  .app-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .intro h2 { font-size: 27px; }
}
