/* Pump selector — the part Bootstrap 5 does not cover.
 *
 * Layout, forms, cards, buttons and alerts are Bootstrap; this file is only:
 *   1. brand colour tokens
 *   2. small bespoke visuals (section labels, chart legend, calc tiles)
 *   3. styling for markup that selector-ui.js injects at runtime
 *
 * Group 3 is load bearing. Those class names appear inside JavaScript template
 * strings, not in any template, so nothing flags it if a rule here is removed —
 * the panels simply render unstyled. Check selector-ui.js before deleting.
 */

:root {
  /* Vivid brand colours. Use these for graphics only - legend dots, the accent
     bar on section labels, chart series, checkbox accents. They are too light
     to put text in. */
  --qp-brand: #00aeef;
  --qp-brand-dk: #0090c8;

  /* Text-safe variants. Every one of these clears WCAG AA (4.5:1) against both
     white and Bootstrap's --bs-tertiary-bg (#f8f9fa), which is what the cards
     and calc tiles sit on. Measured, not eyeballed - see the contrast check in
     the notes below.
        --qp-brand-text  7.0:1    --qp-muted  5.55:1
        --qp-green       5.00:1   --qp-red    5.60:1
        --qp-amber       4.72:1   --qp-navy  14.20:1  --qp-steel 6.06:1 */
  --qp-brand-text: #0d5aa7;   /* the home banner's blue (Jon, 22 Sep 2026); was #007ba8 */
  --qp-navy: #1a2b3c;
  --qp-steel: #4a6580;
  --qp-muted: #556b7d;
  --qp-red: #b3352a;
  --qp-green: #198040;
  --qp-amber: #96591a;

  /* Legacy aliases.
     selector-ui.js was ported verbatim and builds inline styles containing
     var(--silver), var(--red), var(--brand), var(--smoke), var(--navy),
     var(--green) and var(--steel) - the names the original stylesheet used.
     Those names have to keep resolving or those declarations are invalid at
     computed-value time: colours silently fall back to inherited and borders
     vanish. Mapped to the text-safe variants, since the JS uses them on text. */
  --brand: var(--qp-brand);
  --brand-dk: var(--qp-brand-dk);
  --navy: var(--qp-navy);
  --charcoal: #2c3e50;
  --steel: var(--qp-steel);
  --silver: var(--qp-muted);
  --border: #d0dae4;
  --smoke: #eaf0f6;
  --white: #ffffff;
  --red: var(--qp-red);
  --red-bg: #fdf2f2;
  --red-bdr: #e5b7b7;
  --green: var(--qp-green);
  --amber: var(--qp-amber);
}

/* Bootstrap's primary is remapped on this page to the blue of the home page
   banner, #0d5aa7 (Jon, 22 Sep 2026) - the title, the System Design / Match a
   Duty switch, the buttons, the ticked boxes and the focus rings. The chart's
   own line and dot keep their colours: selector-ui.js draws them with fixed
   values and cannot be edited, and the legend has to match what it draws. */
:root {
  --bs-primary: #0d5aa7;
  --bs-primary-rgb: 13, 90, 167;
  --bs-link-color: #0d5aa7;
  --bs-link-color-rgb: 13, 90, 167;
  --bs-link-hover-color: #0a4886;
  --bs-link-hover-color-rgb: 10, 72, 134;
}

[data-bs-theme] .btn-primary {
  --bs-btn-bg: #0d5aa7;
  --bs-btn-border-color: #0d5aa7;
  --bs-btn-hover-bg: #0a4886;
  --bs-btn-hover-border-color: #0a4886;
  --bs-btn-active-bg: #0a4886;
  --bs-btn-active-border-color: #0a4886;
  --bs-btn-disabled-bg: #0d5aa7;
  --bs-btn-disabled-border-color: #0d5aa7;
  --bs-btn-focus-shadow-rgb: 13, 90, 167;
}

[data-bs-theme] .btn-outline-primary {
  --bs-btn-color: #0d5aa7;
  --bs-btn-border-color: #0d5aa7;
  --bs-btn-hover-bg: #0d5aa7;
  --bs-btn-hover-border-color: #0d5aa7;
  --bs-btn-active-bg: #0d5aa7;
  --bs-btn-active-border-color: #0d5aa7;
  --bs-btn-disabled-color: #0d5aa7;
  --bs-btn-disabled-border-color: #0d5aa7;
  --bs-btn-focus-shadow-rgb: 13, 90, 167;
}

.form-check-input:checked,
.form-check-input[type="checkbox"]:indeterminate {
  background-color: #0d5aa7;
  border-color: #0d5aa7;
}

.form-check-input:focus,
.form-control:focus,
.form-select:focus {
  border-color: #6a9bd0;
  box-shadow: 0 0 0 .25rem rgba(13, 90, 167, .25);
}

/* Card headers in the site's grey - the navigation bar's #eef1f4 - so the
   selector reads as part of the same site (Jon, 22 Sep 2026; they were navy
   with white text). Dark text on it, and the icon in the header blue: the
   brand cyan is too light to read on grey. */
.card > .card-header {
  background: #eef1f4;
  border-bottom: 1px solid var(--bs-border-color);
  color: var(--bs-emphasis-color);
}

.card > .card-header h2 {
  font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bs-emphasis-color);
}

.card-header-icon {
  width: 18px;
  height: 18px;
  color: var(--qp-header-blue, #0d5aa7);
  flex: 0 0 auto;
}

/* Small capitalised rule above each group of inputs. */
.section-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 1.5rem 0 .75rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--qp-brand-text);
}

.section-label::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--qp-brand-text);
}

.section-label.mt-0 { margin-top: 0; }

/* Explanatory paragraphs under filters and rules. */
.rule-note {
  margin: .5rem 0 0;
  font-size: .78rem;
  line-height: 1.45;
  color: var(--qp-muted);
}

/* Empty-state text, also injected by selector-ui.js. */
.calc-placeholder {
  margin: 0;
  font-size: .85rem;
  font-style: italic;
  color: var(--qp-muted);
}

/* ---------------------------------------------------------- calc tiles --- */

.calc-item {
  height: 100%;
  padding: .5rem .625rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: var(--bs-tertiary-bg);
}

.calc-item-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--qp-muted);
}

/* Barlow Condensed here is deliberate: it is what let the original fit figures
   like "1234.56 m/s" into a narrow tile without shrinking the type. */
.calc-item-value {
  font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--qp-navy);
}

/* Status modifiers, applied by selector-ui.js as well as in the template. */
.calc-item-value.highlight { color: var(--qp-brand-text); }
.calc-item-value.ok        { color: var(--qp-green); }
.calc-item-value.warn      { color: var(--qp-amber); }
.calc-item-value.danger    { color: var(--qp-red); }

/* -------------------------------------------------------------- chart --- */

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .75rem;
  color: var(--qp-steel);
}

.legend-item { display: flex; align-items: center; gap: .3rem; }
.legend-dot  { width: 9px; height: 9px; border-radius: 50%; }
.legend-line { width: 16px; height: 3px; border-radius: 2px; }

canvas { max-width: 100%; }

.chart-note {
  flex: 1 1 16rem;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--qp-steel);
}

.chart-note a { color: var(--qp-brand-text); }

.datasheet-link a {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--qp-brand-text);
}

.datasheet-link a:hover { text-decoration: underline; }
.datasheet-link svg { width: 14px; height: 14px; }

/* Toggled to .copied by selector-ui.js after a successful copy. */
.copy-btn.copied {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--qp-green);
  --bs-btn-border-color: var(--qp-green);
}

/* ------------------------------------------------- pump specification --- */

.spec-name {
  font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--qp-navy);
}

.spec-maker { font-size: .78rem; color: var(--qp-muted); margin-bottom: .75rem; }

/* The manufacturer's own code, e.g. SM390 behind SEMISOM 390. */
.spec-model {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-weight: 600;
  color: var(--qp-steel);
}

/* Columns that respond to the card, not the viewport - the panel is wider at
   1024px than at 1280px, because Bootstrap's xl breakpoint changes the page
   from one column to two, so a viewport media query would get this backwards.
   max-width caps it at three columns: on an ultrawide, auto-fit alone would put
   all seven specs on a single line. */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  max-width: 52rem;
  gap: 0 2rem;
  margin: 0;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .35rem 0;
  border-bottom: 1px solid var(--bs-border-color);
  font-size: .85rem;
}

.spec-row dt { font-weight: 400; color: var(--qp-muted); }
.spec-row dd { margin: 0; font-weight: 600; text-align: right; color: var(--qp-navy); }

/* Unpublished values read as a dash, never as a zero. */
.spec-none { color: var(--qp-muted); font-weight: 400; }
.spec-hint { color: var(--qp-muted); font-weight: 400; font-size: .78rem; }

.spec-datasheet {
  display: inline-block;
  margin-top: .75rem;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--qp-brand-text);
}

.spec-datasheet:hover { text-decoration: underline; }

/* One line per compared pump, under the chart - filled by selector-specs.js. */
.compare-links { border-top: 1px solid var(--bs-border-color); padding-top: .6rem; }
.compare-links-title {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--qp-muted);
  margin-bottom: .3rem;
}
.compare-links ul { list-style: none; margin: 0; padding: 0; }
.compare-links li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem 1rem;
  padding: .2rem 0;
  font-size: .82rem;
}
.compare-swatch { width: 14px; height: 3px; border-radius: 2px; flex: none; margin-right: -.5rem; }
.compare-name { font-weight: 600; color: var(--qp-navy); min-width: 10rem; }
.compare-links a { font-weight: 600; text-decoration: none; color: var(--qp-brand-text); }
.compare-links a:hover { text-decoration: underline; }

/* ------------------------------------- injected: alternative pumps list --- */

.alt-pumps-list { list-style: none; margin: 0; padding: 0; }

.alt-pumps-list li {
  padding: .5rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}

.alt-pumps-list li:last-child { border-bottom: 0; }

.alt-pumps-list li.alt-pump-item { cursor: pointer; }
.alt-pumps-list li.alt-pump-item:hover { background: var(--bs-tertiary-bg); }
.alt-pumps-list li.alt-pump-item.active { background: rgba(0, 174, 239, .08); }
.alt-pumps-list li.alt-pump-item.active .alt-pump-name { color: var(--qp-brand-text); }

.alt-pump-name { font-weight: 600; font-size: .85rem; color: var(--qp-navy); }
.alt-pump-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin: .2rem 0; }
.alt-pump-detail { font-size: .78rem; color: var(--qp-steel); }

.tag {
  display: inline-block;
  padding: .1rem .4rem;
  border-radius: 3px;
  background: var(--bs-secondary-bg);
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--qp-steel);
}

/* --------------------------------------------- injected: duty assist --- */

.duty-assist-col-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
  font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--qp-navy);
}

.duty-assist-tag {
  padding: .1rem .4rem;
  border-radius: 3px;
  background: var(--bs-secondary-bg);
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--qp-steel);
}

/* Solid rather than a 15% brand tint: the tint composites to #d9f3fd, which
   left the label at 4.14:1. Stated explicitly so the value is checkable. */
.duty-assist-tag-brand { background: #d9f3fd; color: #00658a; }

.duty-assist-pump-name {
  font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--qp-navy);
  margin-bottom: .25rem;
}

.duty-assist-detail-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .25rem 0;
  border-bottom: 1px solid var(--bs-border-color);
  font-size: .8rem;
}

.duty-assist-detail-row:last-child { border-bottom: 0; }
.duty-assist-detail-label { color: var(--qp-muted); }
.duty-assist-detail-value { font-weight: 600; color: var(--qp-navy); }
.duty-assist-detail-value.ok     { color: var(--qp-green); }
.duty-assist-detail-value.warn   { color: var(--qp-amber); }
.duty-assist-detail-value.danger { color: var(--qp-red); }

.duty-assist-summary { margin-top: .5rem; font-size: .78rem; color: var(--qp-steel); }

/* ------------------------------------------ injected: single-run notes --- */

.single-run-section { margin-top: .75rem; }

.single-run-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--qp-muted);
}

.single-run-label::before {
  content: "";
  width: 3px;
  height: 10px;
  border-radius: 2px;
  background: var(--qp-green);
}

.single-run-note { font-size: .78rem; color: var(--qp-steel); }

.single-run-warning {
  margin-top: .4rem;
  padding: .4rem .6rem;
  border-left: 3px solid var(--qp-amber);
  border-radius: 3px;
  background: rgba(230, 126, 34, .08);
  font-size: .78rem;
  color: var(--qp-steel);
}

.single-run-warning strong { color: var(--qp-amber); }

/* ------------------------------------------------ injected: warn boxes --- */

/* Hidden until selector-ui.js adds .danger and sets display. */
.warn-box { display: none; }

.warn-box.danger {
  padding: .75rem 1rem;
  border: 1px solid var(--bs-danger-border-subtle);
  border-left: 4px solid var(--qp-red);
  border-radius: var(--bs-border-radius);
  background: var(--bs-danger-bg-subtle);
  font-size: .85rem;
  color: var(--bs-danger-text-emphasis);
}

.warn-box.danger strong { color: var(--qp-red); }

/* --------------------------------- injected: compare / custom curve rows --- */

.cc-row, .cm-row { display: flex; align-items: center; gap: .25rem; margin-bottom: .25rem; }
.cc-row .cc-flow, .cc-row .cc-head { flex: 1 1 0; }

.cmp-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: rgba(0, 174, 239, .12);
  font-size: .72rem;
  color: var(--qp-brand-text);
}

.cmp-chip-x { cursor: pointer; font-weight: 700; }

/* Copy as Image: what to include (copy-options.js, 18 Nov 2026). */
.qp-copy-opts { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 320px; max-width: calc(100vw - 32px); text-align: left; }
.qp-copy-opts[hidden] { display: none; }

/* Curve colours you can change (curve-colours.js, 18 Nov 2026). */
.qp-colour-pick { cursor: pointer; }
.legend-item.qp-colour-pick:hover .legend-line,
.legend-item.qp-colour-pick:focus-visible .legend-line { outline: 2px solid var(--qp-header-blue, #0d5aa7); outline-offset: 2px; }

/* Specification panel: one tab per pump of ours on the chart (18 Nov 2026). */
.spec-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.spec-tab { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .6rem; font: inherit; font-size: .8rem; color: var(--qp-navy); background: #fff; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 999px; cursor: pointer; }
.spec-tab:hover { border-color: var(--qp-header-blue, #0d5aa7); }
.spec-tab-on { border: 2px solid var(--qp-header-blue, #0d5aa7); padding: calc(.2rem - 1px) calc(.6rem - 1px); font-weight: 600; }
.spec-tab-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
