.pv-calculator {
  --pv-paper: #f2f3ee;
  --pv-white: #fff;
  --pv-ink: #132345;
  --pv-blue: #3348cf;
  --pv-muted: #4a5872;
  --pv-line: #c7ced8;
  --pv-input-line: #7786a3;
  --pv-yellow: #f4dc6a;
  --pv-warning: #fff1c2;
  --pv-error: #8c2c23;
  background: var(--pv-paper);
  color: var(--pv-ink);
}

.pv-calculator [hidden] { display: none !important; }

.pv-main {
  width: min(1240px, calc(100% - clamp(36px, 8vw, 144px)));
  margin-inline: auto;
}

.pv-intro { padding-block: clamp(20px, 4vw, 45px) clamp(30px, 5vw, 62px); }
.pv-breadcrumb { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: .79rem; color: var(--pv-muted); }
.pv-breadcrumb a, .pv-method a, .pv-support a, .pv-field a, .pv-error a { text-underline-offset: .2em; }
.pv-intro h1 {
  margin: clamp(25px, 4vw, 42px) 0 15px;
  font-size: clamp(2.65rem, 6vw, 6.2rem);
  line-height: .98;
  letter-spacing: -.062em;
  font-weight: 650;
  text-wrap: balance;
}
.pv-intro p { max-width: 55ch; margin: 0; color: var(--pv-muted); font-size: clamp(1rem, 1.55vw, 1.21rem); line-height: 1.6; }

.pv-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 3.3vw, 48px);
  align-items: start;
  padding-bottom: clamp(38px, 7vw, 82px);
}
.pv-form { padding: clamp(18px, 3vw, 36px); border: 1px solid var(--pv-line); background: var(--pv-white); }
.pv-form fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.pv-form legend { padding: 0; margin-bottom: 20px; font-size: 1.48rem; font-weight: 650; letter-spacing: -.025em; }
.pv-field { display: grid; align-content: start; gap: 6px; margin-bottom: 19px; min-inline-size: 0; }
.pv-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 15px; }
.pv-field label { font-weight: 650; font-size: .94rem; line-height: 1.35; }
.pv-field label span { font-weight: 400; color: var(--pv-muted); }
.pv-field :is(input, select) {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 8px 11px;
  color: var(--pv-ink);
  background-color: var(--pv-white);
  border: 1px solid var(--pv-input-line);
  border-radius: 3px;
  font: inherit;
  font-size: 1rem;
}
.pv-field input::placeholder { color: var(--pv-muted); }
.pv-field small { color: var(--pv-muted); font-size: .83rem; line-height: 1.45; }
.pv-field [aria-invalid="true"] { border-color: var(--pv-error); box-shadow: inset 0 0 0 1px var(--pv-error); }
.pv-roof-input { grid-column: 1 / -1; }
.pv-roof-input input { max-width: 230px; }

.pv-details { border-top: 1px solid var(--pv-line); }
.pv-details > summary {
  cursor: pointer;
  min-height: 44px;
  padding-block: 13px;
  font-weight: 650;
  font-size: .93rem;
  line-height: 1.45;
}
.pv-details > summary::marker { color: var(--pv-blue); }
.pv-advanced-fields { padding-top: 4px; }
.pv-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 12px; }
.pv-actions button { cursor: pointer; min-height: 44px; font: inherit; font-size: .93rem; font-weight: 650; }
.pv-actions button:disabled { cursor: default; }
.pv-primary { padding: 10px 16px; background: var(--pv-blue); color: white; border: 1px solid var(--pv-blue); border-radius: 3px; }
.pv-primary:hover:not(:disabled) { background: #2639a9; }
.pv-plain { padding: 5px 0; color: var(--pv-blue); background: transparent; border: 0; text-decoration: underline; text-underline-offset: .25em; }
.pv-error { margin: 8px 0 0; color: var(--pv-error); font-size: .91rem; font-weight: 650; }

.pv-result { min-width: 0; }
.pv-result-panel { padding: clamp(22px, 3.2vw, 40px); background: var(--pv-ink); color: white; }
.pv-result-panel h2 { margin: 0 0 12px; font-size: clamp(1.45rem, 2.4vw, 2rem); letter-spacing: -.03em; }
.pv-result-panel h2:focus { outline: 2px solid var(--pv-yellow); outline-offset: 5px; }
.pv-result-panel p { line-height: 1.55; }
.pv-result-panel #result-empty { color: #d7e1f6; min-height: 95px; }
.pv-result-context { color: #d7e1f6; font-size: .86rem; margin-bottom: 16px; }
.pv-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.pv-metrics > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; border-top: 1px solid #ffffff55; padding-top: 12px; }
.pv-metrics dt { color: #d7e1f6; font-size: .79rem; line-height: 1.35; margin-top: 4px; }
.pv-metrics dd { margin: 0; color: var(--pv-yellow); font-size: clamp(1.26rem, 2.9vw, 2.5rem); font-weight: 650; letter-spacing: -.045em; line-height: 1.1; overflow-wrap: anywhere; }
.pv-production { display: grid; gap: 8px; border-top: 1px solid #ffffff55; margin-top: 20px; padding-top: 14px; }
.pv-production > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.pv-production span { font-size: .85rem; }
.pv-production strong { font-size: .96rem; }
.pv-result-note { margin: 13px 0 0; color: #d7e1f6; font-size: .83rem; }
.pv-roof-note { margin: 12px 0 0; padding: 10px 12px; background: var(--pv-warning); color: var(--pv-ink); font-size: .83rem; }
#result-stale { margin: 0 0 12px; }

.pv-result-details { padding-inline: clamp(16px, 2.2vw, 26px); border: 1px solid var(--pv-line); border-top: 0; background: var(--pv-white); }
.pv-result-details ul { margin-top: 0; padding-inline-start: 20px; font-size: .87rem; line-height: 1.55; }
.pv-result-details li + li { margin-top: 6px; }
.pv-month-body { padding-bottom: 14px; }
.pv-month-table { border-collapse: collapse; width: 100%; font-size: .81rem; }
.pv-month-table caption { text-align: left; color: var(--pv-muted); padding: 0 0 8px; }
.pv-month-table th, .pv-month-table td { padding: 3px 0; text-align: left; font-variant-numeric: tabular-nums; }
.pv-month-table th[scope="row"] { font-weight: 500; padding-right: 10px; }
.pv-month-table td:last-child { padding-left: 9px; width: 5ch; text-align: right; }
.pv-month-table meter { width: 100%; height: .68rem; accent-color: var(--pv-blue); }
.pv-month-table meter::-webkit-meter-bar { border: 0; border-radius: 0; background: #e6ebf8; }
.pv-month-table meter::-webkit-meter-optimum-value { background: var(--pv-blue); }
.pv-month-table meter::-moz-meter-bar { background: var(--pv-blue); }

.pv-method { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px clamp(28px, 8vw, 110px); border-top: 1px solid var(--pv-line); padding-block: clamp(28px, 5vw, 58px); }
.pv-method :is(h2, h3) { margin: 0 0 14px; font-size: clamp(1.3rem, 2.4vw, 2rem); line-height: 1.15; letter-spacing: -.03em; }
.pv-method p, .pv-support { color: var(--pv-muted); font-size: .94rem; line-height: 1.6; margin-block: 0 12px; }
.pv-method-links { display: flex; flex-direction: column; align-items: start; gap: 7px; }
.pv-method a, .pv-field a, .pv-support a { color: var(--pv-blue); }
.pv-main :is(a, button, input, select, summary):focus-visible { outline: 2px solid var(--pv-blue); outline-offset: 3px; }
.pv-main :is(input, select, summary, h2) { scroll-margin-top: calc(var(--top, 72px) + 12px); }
.pv-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 765px) {
  .pv-workbench, .pv-method { grid-template-columns: minmax(0, 1fr); }
  .pv-title-break { display: none; }
  .pv-result-panel #result-empty { min-height: 0; }
}

@media (max-width: 380px) {
  .pv-workbench .pv-field-grid { grid-template-columns: minmax(0, 1fr); }
}
