/* A2A heat pump compressor explorer: the controls, the ranked list with its range bars, and the detail panels.
   Colours come from the site's --calc-* variables and type sizes from the --viz-text-* scale; emphasis comes from
   size and ink colour, since the site font ships in one weight. Labels, figures and notes use the body or UI size in
   the body text colour; the muted colour is kept for the axis ticks. The product photos sit on a fixed light mat
   because the catalogue photographs have white backgrounds. */
:root {
  --hpx-peak: #b23a48; --hpx-low: #2f6aa3; --hpx-mat: #f5f5f1;
  /* control outlines at 3:1 or more against the page; the selected segment is a raised tile on a darker track */
  --hpx-edge: color-mix(in srgb, var(--calc-muted) 75%, var(--calc-bg));
  --hpx-track: color-mix(in srgb, var(--calc-rule) 75%, var(--calc-bg)); --hpx-tile: var(--calc-bg);
}
:root[data-theme="dark"] { --hpx-peak: #ec7f8b; --hpx-low: #7fb0e0;
  --hpx-track: color-mix(in srgb, #000 30%, var(--calc-bg)); --hpx-tile: color-mix(in srgb, var(--calc-ink) 16%, var(--calc-bg)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --hpx-peak: #ec7f8b; --hpx-low: #7fb0e0;
  --hpx-track: color-mix(in srgb, #000 30%, var(--calc-bg)); --hpx-tile: color-mix(in srgb, var(--calc-ink) 16%, var(--calc-bg)); } }

.hpx-cap { font-size: var(--viz-text-body); font-weight: 400; color: var(--calc-ink); line-height: 1.25; }

/* Control panels: a grid of equal columns, the label above each control, every control 40 px tall and as wide as its
   cell. Labels share a top line and controls share a bottom line, so a label that wraps moves nothing else. The grid
   follows the width the explorer has, not the window: four columns from 900 px, two from 480 px, then one. */
#hpx-app { --hpx-h: 40px; container: hpx / inline-size; }
.hpx-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 24px; margin: 24px 0 0; }
.hpx-field { display: grid; grid-template-rows: auto auto; align-content: space-between; gap: 8px; min-width: 0; margin: 0; }
.hpx-field.w2 { grid-column: span 2; }
.hpx-field.w3 { grid-column: span 3; }
.hpx-field.w4 { grid-column: 1 / -1; }
.hpx-field select, .hpx-field input[type=search], .hpx-num {
  box-sizing: border-box; height: var(--hpx-h); width: 100%; margin: 0;
  font: inherit; font-size: var(--viz-text-body); color: var(--calc-ink); background: var(--calc-bg);
  border: 1px solid var(--hpx-edge); border-radius: 6px; padding: 0 12px; }
.hpx-field input[type=search]::placeholder { color: var(--calc-muted); opacity: 1; }
.hpx-field select:focus-visible, .hpx-field input:focus-visible { outline: 2px solid var(--calc-accent); outline-offset: 1px; }
.hpx-num { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hpx-num:focus-within { outline: 2px solid var(--calc-accent); outline-offset: 1px; }
.hpx-num input { flex: 1; width: 0; min-width: 0; height: 100%; border: 0; padding: 0; background: transparent; font: inherit; color: inherit; font-variant-numeric: tabular-nums; outline: none; }
.hpx-num span { color: var(--calc-text); }

/* Every choice, single or multiple, uses the same joined track; its segments share the cell's width equally. */
#hpx-app .hpx-seg.viz-chips { display: flex; flex-wrap: nowrap; box-sizing: border-box; height: var(--hpx-h); width: 100%; gap: 2px; padding: 3px;
  border: 1px solid var(--hpx-edge); border-radius: 6px; background: var(--hpx-track); }
#hpx-app .hpx-seg.viz-chips button { flex: 1 1 0; min-width: 0; justify-content: center; gap: 6px; height: 100%; padding: 0 6px; border: 0; border-radius: 4px;
  background: transparent; color: var(--calc-text); font-size: var(--viz-text-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hpx-app .hpx-seg.viz-chips button:hover:not(.on) { color: var(--calc-ink); background: color-mix(in srgb, var(--hpx-tile) 50%, transparent); }
#hpx-app .hpx-seg.viz-chips button.on { color: var(--calc-ink); background: var(--hpx-tile);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18), 0 0 0 1px color-mix(in srgb, var(--calc-ink) 14%, transparent); }
#hpx-app .hpx-seg.viz-chips button:focus-visible { outline: 2px solid var(--calc-accent); outline-offset: -2px; }

/* The on/off switch beside the design heat loss: it has no label above it, so it sits on the controls' line. */
.hpx-field.hpx-toggle { align-content: end; }
.hpx-switch { display: flex; align-items: center; gap: 12px; min-height: var(--hpx-h); cursor: pointer;
  font-size: var(--viz-text-body); color: var(--calc-ink); line-height: 1.25; }
.hpx-switch input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 44px; height: 24px; margin: 0;
  border-radius: 12px; background: var(--calc-muted); cursor: pointer; }
.hpx-switch input::before { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--calc-bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.hpx-switch input:checked { background: var(--calc-accent); }
.hpx-switch input:checked::before { transform: translateX(20px); }
.hpx-switch input:focus-visible { outline: 2px solid var(--calc-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .hpx-switch input, .hpx-switch input::before { transition: transform 180ms var(--viz-ease), background-color 180ms var(--viz-ease); }
}

.hpx-fit { margin: 32px 0 0; padding: 24px 0; border-top: 1px solid var(--calc-rule); border-bottom: 1px solid var(--calc-rule); }
.hpx-panel-title { margin: 0; color: var(--calc-ink); font-size: var(--viz-text-title); line-height: 1.3; }
.hpx-panel-title span { display: block; margin-top: 4px; color: var(--calc-text); font-size: var(--viz-text-body); }
#hpx-app .viz-note { font-size: var(--viz-text-body); color: var(--calc-text); max-width: 72ch; }
#hpx-summary { margin-top: 20px; }

/* Explanations stay closed until asked for: one line with a chevron that points down when open, the text indented
   under it. They sit beside the control or chart they explain. */
.hpx-more { max-width: 72ch; font-size: var(--viz-text-body); line-height: 1.5; color: var(--calc-text); }
.hpx-more > summary { list-style: none; display: flex; align-items: baseline; gap: 10px; width: fit-content; padding: 4px 0; cursor: pointer;
  color: var(--calc-ink); line-height: 1.35; }
.hpx-more > summary::-webkit-details-marker { display: none; }
.hpx-more > summary::before { content: ""; flex: none; width: .7em; height: .7em; background: currentColor; rotate: -90deg; translate: 0 .05em;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 5.5l5 5 5-5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain; }
.hpx-more[open] > summary::before { rotate: 0deg; }
.hpx-more > summary:hover { color: var(--calc-accent); }
.hpx-more > summary:focus-visible { outline: 2px solid var(--calc-accent); outline-offset: 2px; }
.hpx-more > :not(summary) { margin: 6px 0 0 calc(.7em + 10px); }
.hpx-more p + p { margin-top: 10px; }
.hpx-more b { font-weight: 400; color: var(--calc-ink); }
@media (prefers-reduced-motion: no-preference) { .hpx-more > summary::before { transition: rotate .2s; } }

/* What Published and Speed-based mean, beside the selector: closed, its line is level with the selector itself. */
.hpx-field.hpx-minfield { align-content: start; }
.hpx-hint { grid-column: span 3; align-self: start; margin: calc(var(--viz-text-body) * 1.25 + 8px) 0 0; }
.hpx-hint > summary { min-height: var(--hpx-h); box-sizing: border-box; align-items: center; padding: 0; }

/* The heat loss check's two tests: the closed line gives both figures, in the colours of their dashed lines. */
.hpx-tests { margin: 24px 0 0; }
.hpx-tests > p { margin: 0; max-width: 72ch; font-size: var(--viz-text-body); line-height: 1.5; color: var(--calc-text); }

/* Chart settings sit directly above the bars they change; the key to the bars opens under the count. */
.hpx-chartbar { margin-top: 32px; }
.hpx-key { margin: 6px 0 0; }

@container hpx (max-width: 899px) {
  .hpx-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hpx-field.w3, .hpx-field.hpx-toggle { grid-column: auto; }
  /* filters: the compressor types need the full width; Find and Supply share the row above them */
  .hpx-filters { grid-auto-flow: row dense; }
  .hpx-field.hpx-find { grid-column: auto; }
  .hpx-field.hpx-comp { grid-column: 1 / -1; }
  /* the minimum selector takes a full row, with its definition close beneath it */
  .hpx-field.hpx-minfield, .hpx-hint { grid-column: 1 / -1; }
  .hpx-hint { margin-top: -16px; }
  .hpx-hint > summary { min-height: 0; padding: 4px 0; }
}
@container hpx (max-width: 479px) {
  .hpx-panel { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .hpx-field.w2 { grid-column: auto; }
  .hpx-hint { margin-top: -12px; }
  /* the four compressor types take two rows of two */
  #hpx-app #hpx-types.hpx-seg.viz-chips { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: calc(var(--hpx-h) - 8px); height: auto; }
}
.hpx-peak { color: var(--hpx-peak); }
.hpx-low { color: var(--hpx-low); }

/* Each system is one row: photo, name, then one line per rating condition. Every line has its label, its bar on the
   shared scale and its own minimum, rated and maximum figures, so no mark on a bar needs a key. */
.hpx-cols { --cols: 72px minmax(0, 1fr) minmax(0, 2.2fr); --lc: 152px minmax(0, 1fr) repeat(3, 46px); }
.hpx-head { display: grid; grid-template-columns: var(--cols); gap: 16px; align-items: end; padding: 26px 6px 8px; border-bottom: 1px solid var(--calc-ink); }
.hpx-head h3 { grid-column: 1 / 3; margin: 0; font-size: var(--viz-text-title); font-weight: 400; color: var(--calc-ink); }
.hpx-head h3 span { font-size: var(--viz-text-body); color: var(--calc-text); margin-left: 10px; font-variant-numeric: tabular-nums; }
.hpx-axis { position: relative; height: 20px; }
.hpx-axis span { position: absolute; bottom: 0; transform: translateX(-50%); font-size: var(--viz-text-ui); color: var(--calc-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hpx-colh { font-size: var(--viz-text-ui); color: var(--calc-text); text-align: right; white-space: nowrap; }

.hpx-row { display: grid; grid-template-columns: var(--cols); gap: 16px; align-items: start; padding: 14px 6px; border-bottom: 1px solid var(--calc-rule); cursor: pointer; }
.hpx-row:hover, .hpx-row[aria-expanded="true"] { background: var(--calc-surface); }
.hpx-row:focus-visible { outline: 2px solid var(--calc-accent); outline-offset: -2px; }
.hpx-thumb { width: 72px; height: 52px; background: var(--hpx-mat); display: grid; place-items: center; overflow: hidden; }
.hpx-thumb img { max-width: 92%; max-height: 88%; object-fit: contain; margin: 0; }
.hpx-text { display: grid; gap: 4px; min-width: 0; }
.hpx-name { font-size: 1rem; color: var(--calc-ink); line-height: 1.3; overflow-wrap: anywhere; }
.hpx-meta { font-size: var(--viz-text-ui); color: var(--calc-text); line-height: 1.4; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.hpx-extra { color: var(--calc-ink); }
.hpx-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }
.hpx-fitword { font-size: var(--viz-text-ui); line-height: 1.4; color: var(--calc-text); }
.hpx-fitword.ok { color: var(--calc-accent); }
.hpx-fitword.bad { color: var(--hpx-peak); }

.hpx-lines { display: grid; gap: 6px; min-width: 0; }
.hpx-line { display: grid; grid-template-columns: var(--lc); column-gap: 10px; align-items: center; min-width: 0; }
.hpx-lab { font-size: var(--viz-text-body); color: var(--calc-text); white-space: nowrap; line-height: 1.25; }
.hpx-track { position: relative; height: 18px; }
.hpx-track .gl { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--calc-rule); }
.hpx-track .br { position: absolute; top: 4px; height: 10px; border-radius: 5px; }
.hpx-track .br.loss { opacity: .32; } /* the output the defrost allowance takes off, beyond the solid bar */
.hpx-track .ld { position: absolute; top: -3px; bottom: -3px; border-left: 1.5px dashed; }
.hpx-v { font-size: var(--viz-text-body); color: var(--calc-ink); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.25; }
.hpx-v.bad { color: var(--hpx-peak); }

.hpx-detail { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 24px; padding: 16px 6px 24px; border-bottom: 1px solid var(--calc-rule); font-size: var(--viz-text-body); }
.hpx-detail > div, .hpx-dgrid > div { min-width: 0; }
.hpx-dgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px 32px; align-items: start; }
.hpx-mat { background: var(--hpx-mat); display: grid; gap: 8px; place-items: center; padding: 8px; align-self: start; }
.hpx-mat img { max-width: 100%; max-height: 96px; margin: 0; }
.hpx-detail h4 { margin: 0 0 8px; }
.hpx-detail .hpx-gap { margin-top: 22px; }
.hpx-detail p { margin: 8px 0; color: var(--calc-text); max-width: 68ch; }
.hpx-detail .hpx-scroll { overflow-x: auto; }
/* The tables use ids so that the site's own table rules, which are stronger in its dark theme, do not apply. */
#hpx-app .hpx-detail table, #hpx-comptable { border-collapse: collapse; width: 100%; margin: 0; background: transparent; color: var(--calc-text); font-size: var(--viz-text-body); }
#hpx-app .hpx-detail :is(th, td) { padding: 5px 12px 5px 0; border-bottom: 1px solid var(--calc-rule); text-align: left; vertical-align: top; background: transparent; color: var(--calc-text); line-height: 1.35; font-weight: 400; }
#hpx-app .hpx-detail thead th { font-size: var(--viz-text-ui); border-bottom-color: var(--calc-ink); }
#hpx-app .hpx-detail :is(td, th).n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
#hpx-app .hpx-detail td.key { color: var(--calc-ink); }

.hpx-tablewrap { overflow-x: auto; }
#hpx-comptable { min-width: 820px; }
#hpx-comptable :is(th, td) { padding: 8px 14px 8px 0; border-bottom: 1px solid var(--calc-rule); text-align: left; vertical-align: top; background: transparent; color: var(--calc-text); font-weight: 400; }
#hpx-comptable thead th { font-size: var(--viz-text-ui); border-bottom-color: var(--calc-ink); }
#hpx-comptable td.code { white-space: nowrap; color: var(--calc-ink); }
.hpx-ct td.n { white-space: nowrap; font-variant-numeric: tabular-nums; }
#hpx-comptable .grp td { padding-top: 20px; color: var(--calc-ink); }
.hpx-ct .parts { display: grid; gap: 4px; }
.hpx-ct .pn { white-space: nowrap; color: var(--calc-ink); }
.hpx-ct small { font-size: var(--viz-text-ui); color: var(--calc-text); }
.hpx-empty { padding: 24px 6px; color: var(--calc-text); }

/* Medium widths: the lines move under the model name so the bars keep a readable length. */
@media (max-width: 1180px) {
  .hpx-head, .hpx-row { grid-template-columns: 72px minmax(0, 1fr); }
  .hpx-head h3 { grid-column: 1 / -1; }
  .hpx-head .hpx-lhead { grid-column: 1 / -1; }
  .hpx-row { grid-template-areas: "img text" "lines lines"; row-gap: 12px; }
  .hpx-row .hpx-thumb { grid-area: img; }
  .hpx-row .hpx-text { grid-area: text; }
  .hpx-row .hpx-lines { grid-area: lines; }
}
@media (max-width: 760px) {
  .hpx-cols { --lc: minmax(0, 1fr) repeat(3, 40px); }
  .hpx-head { grid-template-columns: minmax(0, 1fr); }
  .hpx-head h3, .hpx-head .hpx-lhead { grid-column: 1; }
  .hpx-row { grid-template-columns: 72px minmax(0, 1fr); grid-template-areas: "img text" "lines lines"; row-gap: 12px; }
  .hpx-row .hpx-thumb { grid-area: img; }
  .hpx-row .hpx-text { grid-area: text; }
  .hpx-row .hpx-lines { grid-area: lines; gap: 8px; }
  /* label and figures on one line, the bar full width beneath them */
  .hpx-line { row-gap: 2px; column-gap: 8px; }
  .hpx-lab { white-space: normal; }
  .hpx-line > .hpx-lab, .hpx-lhead > span:first-child { grid-column: 1; grid-row: 1; }
  .hpx-line > .hpx-track, .hpx-lhead > .hpx-axis { grid-column: 1 / -1; grid-row: 2; }
  .hpx-detail { grid-template-columns: minmax(0, 1fr); }
  .hpx-dgrid { grid-template-columns: minmax(0, 1fr); }
  .hpx-mat { grid-auto-flow: column; justify-content: start; }
}
@media (prefers-reduced-motion: no-preference) { .hpx-row { transition: background-color 180ms cubic-bezier(0.22, 1, 0.36, 1); } }
