/*
 * The Product Selector in clampon.com's design (product_selector_page.html).
 *
 * The element builds its own markup and brings its own styles.css; this file comes after
 * both that and the site's Tailwind CSS and restyles the element with the site's colours
 * (the theme variables of theme/static_src/src/styles.css), type sizes and components: the
 * answers as the site's tag filters (articles/components/filter_button.html), the buttons as
 * the hero's, the question toggles as the accordions'. Plain CSS rather than Tailwind classes:
 * the element's markup is made in its JavaScript, out of reach of the templates.
 *
 * Every rule is scoped to .product-selector (his root) or to the page's own wrappers.
 */

/* --- the element ---------------------------------------------------------------------------- */

.product-selector {
  /* The element's variables, for its own rules left as they are. */
  --primary-color: rgb(var(--decorative));
  --border-color: rgb(var(--primary-text) / 0.15);
  --text-main: rgb(var(--primary-text));
  --text-sub: rgb(var(--primary-text) / 0.75);
  --bg-card: rgb(var(--secondary));

  min-height: 0;
  padding: 0;
  background: none;
  color: rgb(var(--primary-text));
  font-family: inherit;
}

/* Who supplies a part: the fill of its drawing's halo and of its swatch in the legend, and the
   halo's edge, drawn solid, dashed or dotted so that it doesn't rest on colour alone. The edges
   are half transparent (ClampOn, 29 October 2026: they took too much attention); the line style
   still tells them apart. The page sets its own colours on its wrapper
   (product_selector_page.html, data.COLOURS); these are the defaults. */
.product-selector-page {
  --selector-clampon-fill: #bf7f3180;
  --selector-clampon-edge: #c44b0080;
  --selector-customer-fill: #3286c150;
  --selector-customer-edge: #2f74a880;
  --selector-shared-fill: #a0a0a050;
  --selector-shared-edge: #6b6b6b80;
}

/* --- before the selector's code has run --------------------------------------------------- */

/* Until its modules have loaded, the element is empty. It takes the room the selector will take,
   so the products and the contact form under it don't jump down when it appears, and shows where
   the questions and the diagram's grey box will be. The heights are the usual ones: the row of
   question buttons, every choice from 1280 px (selector.js), and a phone's answers button over
   the diagram drawn top to bottom. */
clampon-product-selector:not(:defined) {
  --selector-questions: 6.5rem;
  display: block;
  min-height: 50rem;
  background:
    linear-gradient(rgb(var(--secondary)), rgb(var(--secondary))) 0 0 / 100% var(--selector-questions) no-repeat,
    linear-gradient(rgb(var(--secondary)), rgb(var(--secondary))) 0 100% / 100% calc(100% - var(--selector-questions) - 1.5rem) no-repeat;
  border-radius: 1.5rem;
}

@media (min-width: 1280px) {
  .product-selector-page:not([data-selector-mode="one"]) clampon-product-selector:not(:defined) {
    --selector-questions: 26rem;
    min-height: 66rem;
  }
}

@media (max-width: 767px) {
  clampon-product-selector:not(:defined) {
    --selector-questions: 4rem;
    min-height: 60rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  clampon-product-selector:not(:defined) {
    animation: selector-waiting 1.2s ease-in-out infinite alternate;
  }

  @keyframes selector-waiting {
    from {
      opacity: 1;
    }
    to {
      opacity: 0.55;
    }
  }
}

/* The page's hero has the heading. */
.product-selector > header > h1 {
  display: none;
}

.product-selector > header {
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.product-selector #buttons {
  gap: 0.75rem;
  margin-left: 0;
}

/* --- buttons: the hero's two kinds (hero/blocks/style_2/hero_with_background_color.html) ---- */

.product-selector .button {
  align-self: auto;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: 0.375rem;
  outline: 1px solid rgb(var(--primary-text));
  outline-offset: 0;
  background: rgb(var(--primary-text) / 0.1);
  color: rgb(var(--primary-text));
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  transition: all 0.15s ease;
}

/* "Contact sales about this configuration" is wider than a small phone (320 px). */
@media (max-width: 767px) {
  .product-selector .button {
    white-space: normal;
  }
}

.product-selector .button:hover,
.product-selector .button:focus-visible {
  border-color: transparent;
  outline-color: transparent;
  background: rgb(var(--primary-text));
  color: rgb(var(--primary-bg));
}

.product-selector .button:focus-visible {
  outline: 2px solid rgb(var(--decorative));
  outline-offset: 2px;
}

/* The main action: dark, like the hero's first button. */
.product-selector .button[id$="contact-sales"] {
  outline-color: transparent;
  background: rgb(var(--primary-text));
  color: rgb(var(--primary-bg));
}

.product-selector .button[id$="contact-sales"]:hover {
  outline-color: rgb(var(--primary-text));
  background: rgb(var(--primary-text) / 0.1);
  color: rgb(var(--primary-text));
}

/* Collapse all, Expand all: the same, smaller. */
.product-selector #buttons .button {
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
}

.product-selector .button * {
  color: inherit;
}

/* --- the questions -------------------------------------------------------------------------- */

.product-selector #selections {
  border-top: 1px solid var(--border-color);
}

.product-selector .option,
.product-selector .option-collapsed {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.product-selector .option:hover {
  background: none;
}

/* Wide screens: the question beside its answers, one line each. */
@media (min-width: 1024px) {
  .product-selector .option {
    grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
    align-items: start;
    column-gap: 1.5rem;
  }

  .product-selector .option > .question-header {
    min-height: 2.75rem;
  }

  /* Collapsed, a question is one line: "Location: Onshore". */
  .product-selector .option.option-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-selector .option-collapsed > .question-header {
    min-height: 0;
  }
}

/* An h2 in the element's markup; the site's h2 is a display size. */
.product-selector h2.question-header {
  margin: 0;
  color: rgb(var(--primary-text));
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.3;
  hyphens: none;
}

@media (min-width: 1024px) {
  .product-selector h2.question-header {
    font-size: 1.25rem;
  }
}

.product-selector .question-toggle {
  gap: 0.75rem;
  padding: 0.25rem 0;
  color: inherit;
  font-weight: inherit;
}

.product-selector .question-toggle:hover {
  color: inherit;
}

.product-selector .question-toggle [id$="-label"] {
  text-decoration: underline 1px transparent;
  text-underline-offset: 4px;
  transition: all 0.3s ease;
}

.product-selector .question-toggle:hover [id$="-label"],
.product-selector .question-toggle:focus-visible [id$="-label"] {
  text-decoration-color: rgb(var(--decorative));
  text-underline-offset: 8px;
}

.product-selector .question-toggle:focus-visible {
  outline: 2px solid rgb(var(--decorative));
  outline-offset: 4px;
  border-radius: 0.25rem;
}

/* The chevron in a circle, as on the site's accordions (icons/arrow-down-circle.svg). */
.product-selector .question-chevron {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.3rem;
  border: 1px solid rgb(var(--decorative));
  border-radius: 9999px;
  color: rgb(var(--decorative));
  stroke-width: 1.5;
}

.product-selector .selected-value {
  margin-left: 0;
  color: rgb(var(--primary-text) / 0.75);
  font-weight: 300;
}

/* The question and its answer take the button's colour (not the theme's text colour for every
   element, [class*="theme-"] *); the label and the answer set their own. */
.product-selector .question-toggle :is(.question-title, .selected-value-text) {
  color: inherit;
}

/* "••" on an answer that can measure more than one thing at once (patch 0020), in the corner of
   its tag. */
.product-selector .card-dual {
  top: 0.2rem;
  right: 0.3rem;
  color: rgb(var(--decorative));
  font-size: 1.125rem;
  line-height: 0.5;
  letter-spacing: 0.25em;
  /* The spacing after the second dot too: back into the corner. */
  margin-right: -0.25em;
}

/* --- answers: the site's tag filters -------------------------------------------------------- */

.product-selector .card-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: auto;
  max-width: 100%;
  font-family: inherit;
}

.product-selector .card-wrapper {
  display: block;
  height: auto;
}

.product-selector .card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  height: auto;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  outline: 1px solid rgb(var(--decorative));
  outline-offset: 0;
  background: rgb(var(--secondary));
  color: rgb(var(--secondary-text));
  transition: all 0.15s ease;
}

.product-selector .card:hover {
  border-color: transparent;
  outline-width: 2px;
  transform: none;
  box-shadow: none;
}

/* Can't be chosen (patch 0018): its content faded (styles.css) and a fainter edge. Hovered or
   pressed, it says why (0021), in the site's dark tag. */
.product-selector .card.disabled {
  outline-color: rgb(var(--decorative) / 0.35);
}

.product-selector .card.disabled:hover {
  outline-width: 1px;
}

.product-selector .card.disabled[data-reason]:is(:hover, .show-reason)::after {
  padding: 0.375rem 0.625rem;
  border-radius: 0.375rem;
  background: rgb(var(--black));
  color: rgb(var(--light-grey));
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 400;
  white-space: normal;
}

/* Kept on the screen (selector.js, setUpReasons). */
.product-selector .card.disabled[data-reason][data-reason-align="start"]:is(:hover, .show-reason)::after {
  left: 0;
  transform: none;
}

.product-selector .card.disabled[data-reason][data-reason-align="end"]:is(:hover, .show-reason)::after {
  left: auto;
  right: 0;
  transform: none;
}

/* A question with nothing to choose: "Not needed for this system" in place of its answers. */
.product-selector .option-not-needed {
  color: rgb(var(--primary-text) / 0.6);
  font-size: 0.9375rem;
  font-style: normal;
}

/* Chosen: the dark ("opposite") tag. */
.product-selector .radio-card-input:checked + .card,
.product-selector .checkbox-card-input:checked + .card {
  outline: 1px solid transparent;
  background: rgb(var(--black));
  color: rgb(var(--light-grey));
}

.product-selector .radio-card-input:checked + .card:hover,
.product-selector .checkbox-card-input:checked + .card:hover {
  outline: 2px solid rgb(var(--decorative));
}

.product-selector .radio-card-input:focus-visible + .card,
.product-selector .checkbox-card-input:focus-visible + .checkbox-card {
  outline: 2px solid rgb(var(--decorative));
  outline-offset: 2px;
}

/* The element's dot on the chosen radio card: the dark tag says it. */
.product-selector .radio-card-input:checked + .card::before {
  content: none;
}

.product-selector .card .card-content {
  display: block;
  height: auto;
  /* Not the theme's text colour for every element ([class*="theme-"] *): the card's. */
  color: inherit;
}

.product-selector .card .card-title {
  overflow: visible;
  color: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
}

@media (min-width: 1024px) {
  .product-selector .card .card-title {
    font-size: 1.0625rem;
  }
}

.product-selector .card .card-description {
  color: inherit;
  font-size: 0.875rem;
}

/* Checkboxes keep a box, so they read as more-than-one choices. */
.product-selector .checkbox-indicator {
  position: static;
  flex: 0 0 auto;
  order: -1;
  width: 1rem;
  height: 1rem;
  border: 1px solid currentColor;
  border-radius: 0.25rem;
  background: transparent;
}

.product-selector .checkbox-tick {
  width: 0.75rem;
  height: 0.75rem;
}

.product-selector .checkbox-card-input:checked + .checkbox-card .checkbox-indicator {
  border-color: rgb(var(--decorative));
  background: rgb(var(--decorative));
}

.product-selector .checkbox-card-input:checked + .checkbox-card .checkbox-tick {
  color: #fff;
}

/* --- remarks: an "i" or "!" in the site's orange -------------------------------------------- */

.product-selector .remark-icon,
.product-selector .remark-indicator {
  width: 1.25rem;
  height: 1.25rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
}

.product-selector .remark-icon.remark-info,
.product-selector .remark-indicator.remark-info {
  border: 1px solid rgb(var(--decorative));
  background: rgb(var(--primary-bg));
  color: rgb(var(--primary-text));
}

.product-selector .remark-icon.remark-exclamation,
.product-selector .remark-indicator.remark-exclamation {
  border: 1px solid rgb(var(--decorative));
  background: rgb(var(--decorative));
  color: #fff;
}

/* A dual measurement: "••", first in the list. */
.product-selector .remark-icon.remark-dual {
  border: 0;
  background: none;
  color: rgb(var(--decorative));
  font-size: 1.375rem;
  letter-spacing: 0.25em;
}

.product-selector .inline-remark {
  margin-left: 0.25rem;
  border-radius: 9999px;
}

.product-selector .inline-remark:focus-visible,
.product-selector .remark-indicator:focus-visible {
  outline: 2px solid rgb(var(--decorative));
  outline-offset: 2px;
}

.product-selector .remarks-list {
  gap: 0.75rem;
}

.product-selector .remark-item {
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.4;
}

@media (min-width: 1024px) {
  .product-selector .remark-item {
    font-size: 1.125rem;
  }
}

.product-selector .remark-item > .remark-icon {
  margin-top: 0.1em;
}

.product-selector .remark-link {
  color: inherit;
  font-size: inherit;
  text-decoration: underline 1px rgb(var(--decorative));
  text-underline-offset: 4px;
  transition: all 0.3s ease;
}

.product-selector .remark-link:hover,
.product-selector .remark-link:focus-visible {
  color: inherit;
  text-underline-offset: 8px;
}

/* --- the diagram ---------------------------------------------------------------------------- */

.product-selector .diagram-section {
  margin-top: 2rem;
}

.product-selector .diagram-actions {
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.product-selector #selection-actions {
  gap: 0.75rem;
}

/* On the site the diagram has the page's width already, and a layer over the page would sit
   under the site's menu: no "Show full page". */
.product-selector #diagram-fullscreen-toggle {
  display: none;
}

/* The diagram, its remarks and the legend in one grey box, like the site's product images. */
.product-selector .diagram-shell {
  padding: 0.75rem 0.75rem 1.25rem;
  border-radius: 1.5rem;
  background: rgb(var(--secondary));
}

@media (min-width: 768px) {
  .product-selector .diagram-shell {
    padding: 1.5rem 2rem 2rem;
  }
}

/* ui/diagramViewport.js fits the diagram to this box's width: no padding of its own. */
.product-selector .diagram-and-remarks {
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
  padding: 0;
}

.product-selector .diagram-frame {
  width: 100%;
}

.product-selector #diagram {
  margin-inline: auto;
  padding: 4rem 2.5rem 5rem;
  color: rgb(var(--primary-text));
}

.product-selector .diagram-scroll-hint {
  color: rgb(var(--primary-text) / 0.75);
  font-size: 0.875rem;
  font-weight: 300;
}

.product-selector .diagram-label {
  color: rgb(var(--primary-text));
  font-family: inherit;
  font-weight: 400;
}

.product-selector .diagram-label * {
  color: inherit;
}

/* A part with a product page (selector.js links its name). */
.product-selector .diagram-label-link {
  /* One box around a name on two lines, for the focus ring. */
  display: inline-block;
  color: inherit;
  font-weight: inherit;
  text-decoration: underline 1px rgb(var(--decorative));
  text-underline-offset: 4px;
  transition: all 0.3s ease;
}

.product-selector .diagram-label-link:hover,
.product-selector .diagram-label-link:focus-visible {
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

.product-selector .diagram-label-link:focus-visible {
  outline: 2px solid rgb(var(--decorative));
  outline-offset: 2px;
  border-radius: 0.125rem;
}

.product-selector .connector-zone-label {
  color: rgb(var(--primary-text) / 0.75);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.product-selector .matrix-connector {
  background: rgb(var(--primary-text) / 0.3);
}

/* The drawings' halo has the class "outline", which is also Tailwind's outline utility
   (outline-style: solid): it framed every drawing in black. */
.product-selector .outline {
  outline: none;
}

/* The halo in full (his own is faded until hovered), in the page's colours, with an edge per
   supplier. Each drawing sets its own stroke on the halo inline, and his code its own fill
   (his data/ownership.js), hence !important. */
.product-selector .diagram-svg svg path.outline,
.product-selector .diagram-svg svg:not(:hover) path.outline {
  opacity: 1;
}

.product-selector .diagram-matrix-node .diagram-svg .outline {
  stroke-width: 1.5px !important;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

.product-selector .diagram-matrix-node[data-ownership="clampon"] .diagram-svg .outline {
  fill: var(--selector-clampon-fill) !important;
  stroke: var(--selector-clampon-edge) !important;
}

.product-selector .diagram-matrix-node[data-ownership="customer"] .diagram-svg .outline {
  fill: var(--selector-customer-fill) !important;
  stroke: var(--selector-customer-edge) !important;
  stroke-dasharray: 6 4;
}

.product-selector .diagram-matrix-node[data-ownership="shared"] .diagram-svg .outline {
  fill: var(--selector-shared-fill) !important;
  stroke: var(--selector-shared-edge) !important;
  stroke-dasharray: 1 4;
  stroke-linecap: round;
}

/* --- the legend ----------------------------------------------------------------------------- */

.product-selector .ownership-legend {
  gap: 0.75rem 1.5rem;
  margin-top: 1.5rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--border-color);
}

.product-selector .legend-item {
  gap: 0.5rem;
  border-radius: 0.25rem;
  color: rgb(var(--primary-text));
  font-size: 0.875rem;
  font-weight: 400;
}

@media (min-width: 1024px) {
  .product-selector .legend-item {
    font-size: 1rem;
  }
}

.product-selector .legend-item:focus-visible {
  outline: 2px solid rgb(var(--decorative));
  outline-offset: 4px;
}

.product-selector .legend-color {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  border: 1.5px solid;
  border-radius: 0.375rem;
}

.product-selector .legend-color.clampon {
  border-color: var(--selector-clampon-edge);
  background: var(--selector-clampon-fill);
}

.product-selector .legend-color.customer {
  border-color: var(--selector-customer-edge);
  background: var(--selector-customer-fill);
  border-style: dashed;
}

.product-selector .legend-color.shared {
  border-color: var(--selector-shared-edge);
  background: var(--selector-shared-fill);
  border-style: dotted;
  border-width: 2px;
}

/* --- under the diagram: "Copy link" and "Contact sales" -------------------------------------- */

/* The element's row of actions, moved under the legend (selector.js, setUpActions): the page's
   "Copy link" at the left, his "Contact sales" at the right. His "Copy configuration summary"
   (the answers as text) gives way to the link. */
.product-selector .diagram-shell > .diagram-actions {
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.product-selector .diagram-actions:has(> [data-selector-copy]) .copy-button {
  display: none;
}

/* "Copy link": a link's look (the site's: an orange underline that moves down on hover), with
   an icon. Its labels in one cell, so that "Link copied" doesn't change its width. */
.product-selector .selector-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border: 0;
  background: none;
  color: rgb(var(--primary-text));
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  cursor: pointer;
}

.product-selector .selector-copy-icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
}

.product-selector .selector-copy-labels {
  display: grid;
  justify-items: start;
}

.product-selector .selector-copy-labels > span {
  grid-area: 1 / 1;
  visibility: hidden;
  text-decoration: underline 1px transparent;
  text-underline-offset: 4px;
  /* Not visibility: the label going would stay while the next one shows. */
  transition: text-decoration-color 0.3s ease, text-underline-offset 0.3s ease;
}

.product-selector .selector-copy:not([data-copy]) [data-copy-label="ready"],
.product-selector .selector-copy[data-copy="done"] [data-copy-label="done"],
.product-selector .selector-copy[data-copy="failed"] [data-copy-label="failed"] {
  visibility: visible;
}

.product-selector .selector-copy:hover .selector-copy-labels > span,
.product-selector .selector-copy:focus-visible .selector-copy-labels > span {
  text-decoration-color: rgb(var(--decorative));
  text-underline-offset: 8px;
}

.product-selector .selector-copy:focus-visible {
  outline: 2px solid rgb(var(--decorative));
  outline-offset: 4px;
  border-radius: 0.25rem;
}

/* "Contact sales": the hero's dark button, with the site's orange arrow, which moves on hover
   like the product cards' (icons/arrow-right.svg, internal.svg). */
.product-selector .button[id$="contact-sales"] {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.product-selector .button[id$="contact-sales"]::after {
  --selector-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 17'%3E%3Cpath d='M11.5 1 19 8.5m0 0L11.5 16M19 8.5H1' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  content: "";
  flex: none;
  width: 1.125rem;
  height: 1rem;
  background: rgb(var(--decorative));
  -webkit-mask: var(--selector-arrow) center / contain no-repeat;
  mask: var(--selector-arrow) center / contain no-repeat;
  transition: transform 0.15s ease;
}

.product-selector .button[id$="contact-sales"]:hover::after,
.product-selector .button[id$="contact-sales"]:focus-visible::after {
  transform: translateX(0.25rem);
}

/* On a phone: "Contact sales" the width of the box, "Copy link" over it. */
@media (max-width: 767px) {
  .product-selector .diagram-shell > .diagram-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .product-selector .diagram-shell > .diagram-actions > .selector-copy {
    align-self: center;
  }

  .product-selector .diagram-shell .button[id$="contact-sales"] {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* --- the page around it --------------------------------------------------------------------- */

.product-selector-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 0.75rem;
}

.product-selector-page [data-selector-example] {
  color: rgb(var(--primary-text) / 0.75);
}

/* Tailwind's display classes (grid, flex) would show what selector.js hides. */
#selector-products[hidden],
#selector-products [hidden] {
  display: none;
}

/* --- the questions as a row of choices over the diagram -------------------------------------- */

/* Each question is a button that says its answer ("Location: Offshore Topside"); pressing it opens
   its choices over the page, below it, and choosing one closes them again (selector.js). So the
   questions take a line or two, and the diagram stays in view under them while the visitor
   chooses. A phone has all of them in a sheet instead ("the questions in a sheet"). The element's
   questions collapse and expand by themselves: selector.js starts them collapsed and keeps one
   open at a time, so the element's Collapse all / Expand all are not needed. */
.product-selector > header {
  display: none;
}

.product-selector #selections {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0;
  border: 0;
}

.product-selector #selections > .option,
.product-selector #selections > .option.option-collapsed {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.product-selector #selections h2.question-header {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 0;
  font-size: 0.9375rem;
  font-weight: 400;
}

.product-selector #selections .question-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  outline: 1px solid rgb(var(--decorative) / 0.6);
  background: rgb(var(--secondary));
  color: rgb(var(--secondary-text));
  white-space: nowrap;
}

.product-selector #selections .question-toggle:hover {
  outline: 2px solid rgb(var(--decorative));
}

.product-selector #selections .question-toggle:focus-visible {
  outline: 2px solid rgb(var(--decorative));
  outline-offset: 2px;
}

.product-selector #selections .question-toggle [id$="-label"] {
  color: rgb(var(--secondary-text) / 0.75);
  text-decoration: none;
}

.product-selector #selections .question-toggle .selected-value {
  color: rgb(var(--secondary-text));
  font-weight: 500;
}

/* The answer stays while the question's choices are open, and takes the room of its longest
   answer (patch 0019): the buttons keep their text and width, and don't move. A disabled
   question says "–". */
.product-selector #selections .question-answer {
  display: inline;
  color: rgb(var(--secondary-text) / 0.75);
}

/* A caret after the answer, pointing down; up while its choices are open. */
.product-selector #selections .question-chevron {
  display: none;
}

.product-selector #selections .question-toggle::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin: -0.2rem 0 0 0.375rem;
  border-right: 1.5px solid rgb(var(--decorative));
  border-bottom: 1.5px solid rgb(var(--decorative));
  transform: rotate(45deg);
}

/* The question whose choices are open. */
.product-selector #selections .question-toggle[aria-expanded="true"] {
  background: rgb(var(--black));
  color: rgb(var(--light-grey));
  outline-color: transparent;
}

.product-selector #selections .question-toggle[aria-expanded="true"] :is([id$="-label"], .question-answer, .selected-value) {
  color: inherit;
}

.product-selector #selections .question-toggle[aria-expanded="true"]::after {
  margin-top: 0.25rem;
  border-color: rgb(var(--light-grey));
  transform: rotate(-135deg);
}

/* The choices, over the page below their question. */
.product-selector #selections > .option > [role="radiogroup"],
.product-selector #selections > .option > [role="group"] {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 30;
  width: max-content;
  max-width: min(32rem, calc(100vw - 2rem));
  padding: 1rem;
  border-radius: 1rem;
  background: rgb(var(--primary));
  box-shadow:
    0 0 0 1px rgb(var(--primary-text) / 0.1),
    0 1rem 2.5rem -0.5rem rgb(0 0 0 / 0.25);
}

.product-selector #selections .card-group {
  gap: 0.5rem;
}

.product-selector #selections .card {
  padding: 0.5rem 0.875rem;
}

.product-selector #selections .card .card-title {
  font-size: 0.9375rem;
  line-height: 1.35;
}

/* All choices (the switch on): every question with its answers, a panel of columns over the
   diagram, each question a small heading over its answers; Measurement, with the most answers,
   takes two columns. The questions don't open and close here. A phone lists them. */
.product-selector-page[data-selector-mode="all"] .product-selector #selections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1.25rem 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.product-selector-page[data-selector-mode="all"] .product-selector #selections > .option {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 0.5rem;
}

.product-selector-page[data-selector-mode="all"] .product-selector #selections > .option > .question-header {
  min-height: 0;
}

.product-selector-page[data-selector-mode="all"] .product-selector #selections .question-toggle {
  padding: 0;
  border-radius: 0;
  outline: 0;
  background: none;
  color: rgb(var(--primary-text));
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: none;
}

.product-selector-page[data-selector-mode="all"] .product-selector #selections .question-toggle [id$="-label"] {
  color: inherit;
}

.product-selector-page[data-selector-mode="all"] .product-selector #selections .question-toggle::after {
  content: none;
}

/* Each question's answers show under it here. */
.product-selector-page[data-selector-mode="all"] .product-selector #selections .question-answer {
  display: none;
}

.product-selector-page[data-selector-mode="all"] .product-selector #selections > .option > [role="radiogroup"],
.product-selector-page[data-selector-mode="all"] .product-selector #selections > .option > [role="group"] {
  position: static;
  width: auto;
  max-width: none;
  max-height: none;
  overflow: visible;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

@media (min-width: 768px) {
  .product-selector-page[data-selector-mode="all"] .product-selector #selections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .product-selector-page[data-selector-mode="all"] .product-selector #selections {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .product-selector-page[data-selector-mode="all"] .product-selector #selections {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .product-selector-page[data-selector-mode="all"] .product-selector #selections > .option:has([id$="-measurement-toggle"]) {
    grid-column: span 2;
  }
}

/* The switch: "Show all choices", on or off. */
.product-selector-page .selector-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.25rem 0;
  color: rgb(var(--primary-text));
  font-size: 0.875rem;
  cursor: pointer;
}

.product-selector-page .selector-switch[hidden] {
  display: none;
}

.product-selector-page .selector-switch::before {
  content: "";
  flex: 0 0 auto;
  width: 2.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background:
    radial-gradient(circle at 0.625rem 50%, rgb(var(--primary)) 0.4rem, transparent 0.45rem),
    rgb(var(--primary-text) / 0.35);
  transition: background 0.2s ease;
}

.product-selector-page .selector-switch[aria-checked="true"]::before {
  background:
    radial-gradient(circle at 1.625rem 50%, rgb(var(--primary)) 0.4rem, transparent 0.45rem),
    rgb(var(--decorative));
}

.product-selector-page .selector-switch:focus-visible {
  outline: 2px solid rgb(var(--decorative));
  outline-offset: 4px;
  border-radius: 0.25rem;
}

/* --- on a phone: the questions in a sheet, a remark in a dialog ------------------------------- */

/* The answers in one button, "Your answers" and "Change" over them; pressing it opens the sheet
   (selector.js, setUpSheet): every question with its answers, one under the other, as with all
   choices, scrolling between the sheet's heading and its button. */
.product-selector-page .selector-answers {
  display: none;
}

@media (max-width: 767px) {
  .product-selector-page .selector-switch {
    display: none;
  }

  .product-selector-page .selector-answers:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.25rem 1rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    outline: 1px solid rgb(var(--decorative) / 0.6);
    background: rgb(var(--secondary));
    color: rgb(var(--secondary-text));
    text-align: left;
    transition: outline 0.15s ease;
  }

  .product-selector-page .selector-answers:hover {
    outline: 2px solid rgb(var(--decorative));
  }

  .product-selector-page .selector-answers:focus-visible {
    outline: 2px solid rgb(var(--decorative));
    outline-offset: 2px;
  }

  .product-selector-page .selector-answers-heading {
    grid-column: 1;
    grid-row: 1;
    color: rgb(var(--secondary-text) / 0.75);
    font-size: 0.8125rem;
  }

  /* An answer at a time to a line ("Zone 0" together), a dot between them. */
  .product-selector-page .selector-answers-list {
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
  }

  .product-selector-page .selector-answers-list > span:not(:last-child)::after {
    content: "·";
    content: "·" / "";
    margin: 0 0.375rem;
    color: rgb(var(--decorative));
  }

  /* "Change", and a caret pointing up to the sheet. */
  .product-selector-page .selector-answers-change {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    text-decoration: underline 1px rgb(var(--decorative));
    text-underline-offset: 4px;
  }

  .product-selector-page .selector-answers-change::after {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    margin-top: 0.25rem;
    border-top: 1.5px solid rgb(var(--decorative));
    border-left: 1.5px solid rgb(var(--decorative));
    transform: rotate(45deg);
  }
}

/* The sheet and the remarks' dialog: modal <dialog>s from the bottom of the screen, which
   selector.js moves into the element (so the element's and these styles for the questions and
   the remarks apply in them). They only open on a phone. */
.product-selector :is(.selector-sheet, .selector-info) {
  width: 100%;
  max-width: none;
  max-height: 85vh;
  max-height: 85dvh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-radius: 1.25rem 1.25rem 0 0;
  background: rgb(var(--primary));
  color: rgb(var(--primary-text));
  box-shadow: 0 -0.75rem 2.5rem rgb(0 0 0 / 0.25);
}

.product-selector .selector-sheet[open] {
  display: flex;
  flex-direction: column;
}

.product-selector :is(.selector-sheet, .selector-info)::backdrop {
  background: rgb(0 0 0 / 0.4);
}

@media (prefers-reduced-motion: no-preference) {
  .product-selector :is(.selector-sheet, .selector-info)[open] {
    animation: selector-sheet-in 0.25s ease;
  }
}

@keyframes selector-sheet-in {
  from {
    transform: translateY(100%);
  }
}

/* No scrolling the page under them. */
html:has(.product-selector :is(.selector-sheet, .selector-info)[open]) {
  overflow: hidden;
}

/* The element's section of questions, in the sheet. */
.product-selector .selector-sheet > section {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
}

.product-selector-page[data-selector-mode="all"] .product-selector .selector-sheet #selections {
  padding: 0;
  border: 0;
}

/* A heading and a close button at the top of both. */
.product-selector .selector-sheet-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.product-selector .selector-sheet-title {
  margin: 0;
  color: rgb(var(--primary-text));
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.3;
}

.product-selector .selector-sheet-title:focus {
  outline: none;
}

/* A cross in a circle, as the site's accordions' chevron. */
.product-selector .selector-close {
  position: relative;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgb(var(--decorative));
  border-radius: 9999px;
  color: rgb(var(--primary-text));
}

.product-selector .selector-close::before,
.product-selector .selector-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.875rem;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.product-selector .selector-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.product-selector .selector-close:hover,
.product-selector .selector-close:focus-visible {
  background: rgb(var(--decorative));
  color: #fff;
}

.product-selector .selector-close:focus-visible {
  outline: 2px solid rgb(var(--decorative));
  outline-offset: 2px;
}

/* "Show the system", the main action: dark, as "Contact sales". */
.product-selector .selector-sheet-foot {
  display: flex;
  flex: 0 0 auto;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-color);
}

.product-selector .selector-sheet-done {
  flex: 1 1 auto;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  background: rgb(var(--primary-text));
  color: rgb(var(--primary-bg));
  font-size: 1rem;
}

.product-selector .selector-sheet-done:focus-visible {
  outline: 2px solid rgb(var(--decorative));
  outline-offset: 2px;
}

/* The remarks of a part or a question (copies of the list's items, styled as there), each
   "Learn more" on a line of its own. */
.product-selector .selector-info-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
  list-style: none;
}

.product-selector .selector-info .remark-item {
  flex-wrap: wrap;
  line-height: 1.45;
}

.product-selector .selector-info .remark-item > span:not(.remark-icon) {
  flex: 1 1 0;
  min-width: 0;
}

.product-selector .selector-info .remark-link {
  flex-basis: 100%;
  margin-left: 2rem;
}

@media (min-width: 768px) {
  .product-selector #diagram {
    --diagram-padding-top: 2rem;
    padding-block: var(--diagram-padding-top) 4.5rem;
  }
}

/* --- the diagram in motion ------------------------------------------------------------------ */

/* selector.js runs one pulse of signal from the sensor out to the last part: each part lights
   up while the signal is in it, a dot runs along each wired connection (.flow-pulse), and across
   a wireless link the parts of the wireless sign light up in turn (.flow-wireless, the drawing
   put in place of the element's background image). It also lets the parts that are new since the last
   diagram rise in (.is-new, --enter-step). Nothing moves for visitors who ask for less motion. */
.product-selector .wireless-connector .flow-wireless {
  display: block;
  width: 100%;
  height: 100%;
}

.product-selector .matrix-connector {
  overflow: visible;
}

.product-selector .flow-pulse {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin: -0.25rem 0 0 -0.25rem;
  border-radius: 9999px;
  background: rgb(var(--decorative));
  box-shadow: 0 0 0.375rem 0.125rem rgb(var(--decorative) / 0.55);
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .product-selector .diagram-matrix-node.is-new {
    /* backwards, not both: once in, the legend can dim it again. */
    animation: selector-enter 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
    animation-delay: calc(var(--enter-step, 0) * 0.08s);
  }
}

@keyframes selector-enter {
  from {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* The diagram's box scrolls sideways only. overflow-x: auto alone makes it auto vertically too,
   and a browser rounding its height a pixel short then showed a vertical scrollbar. */
.product-selector .diagram-viewport {
  overflow-y: hidden;
}

/* --- from a tablet up: the zone change as a line down the diagram ----------------------------- */

/* Where the zone changes: a dashed line down the diagram's box, at the top of it the zone before
   named to its left and the one after to its right (a phone's, turned; patch 0015 has each zone in
   a span). The line is the zone's label. Its connection fills the main line's row, the line across
   its middle, so the label starts at the top of the row and reaches up through the diagram's
   padding to the box's edge; downwards it runs on, and the diagram cuts it off at its bottom. Only
   the main line changes zone, before any branch: the line has its column to itself. */
@media (min-width: 768px) {
  .product-selector #diagram {
    overflow-y: clip;
  }

  .product-selector #diagram :is(.matrix-connector, .wireless-connector):has(> .connector-zone-label) {
    align-self: stretch;
    height: auto;
  }

  .product-selector #diagram .matrix-connector:has(> .connector-zone-label) {
    background: linear-gradient(rgb(var(--primary-text) / 0.3) 0 0) center / 100% 4px no-repeat;
  }

  .product-selector #diagram .connector-zone-label {
    top: calc(-1 * var(--diagram-padding-top));
    bottom: -50rem;
    left: 50%;
    display: grid;
    grid-template-columns: 0;
    align-content: start;
    padding-top: 0.5rem;
    transform: none;
    line-height: 1.1;
    white-space: nowrap;
  }

  /* Both names start at the line: the one before moved its own width and a gap to the left. */
  .product-selector #diagram :is(.connector-zone-from, .connector-zone-to) {
    grid-area: 1 / 1;
    justify-self: start;
  }

  .product-selector #diagram .connector-zone-from {
    transform: translateX(calc(-100% - 0.625rem));
  }

  .product-selector #diagram .connector-zone-to {
    transform: translateX(0.625rem);
  }

  .product-selector #diagram .connector-zone-label::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-left: 1px dashed rgb(var(--primary-text) / 0.45);
  }

  .product-selector #diagram .connector-zone-separator {
    display: none;
  }
}

/* --- on a phone: the diagram top to bottom ---------------------------------------------------- */

/* The element's grid turned on its side: each part's and connection's row and column swapped
   (patch 0015 gives them as --diagram-row and --diagram-column; his inline grid-row and
   grid-column need !important). The parts one under the other, each name under its drawing; a
   branch in a second column, beside the main line; the connections in the rows between. The
   columns are as wide as each other: the branch's elbow runs from the middle of one to the middle
   of the other. The element fits it to the width as it is drawn (ui/diagramViewport.js). */
@media (max-width: 767px) {
  .product-selector #diagram {
    --vertical-gap: 1.5rem;
    grid-auto-columns: 1fr;
    column-gap: var(--vertical-gap);
    row-gap: 0.5rem;
    min-height: 0;
    padding: 1rem 0.25rem 1.5rem;
  }

  .product-selector #diagram > * {
    grid-row: var(--diagram-column) !important;
    grid-column: var(--diagram-row) !important;
  }

  /* Two columns fit a phone: the widest drawings (PC, tablet and phone) a little smaller. */
  .product-selector #diagram .diagram-svg {
    max-width: 9rem;
  }

  .product-selector #diagram .diagram-label {
    position: static;
    justify-content: center;
    margin-top: 0.5rem;
    max-width: 9rem;
  }

  /* A connection: a line down the middle of its column. */
  .product-selector #diagram .matrix-connector.straight,
  .product-selector #diagram .wireless-connector {
    justify-self: stretch;
    width: auto;
    height: 2.5rem;
    margin: 0;
    background-color: transparent;
  }

  .product-selector #diagram .matrix-connector.straight::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    margin-left: -2px;
    background: rgb(var(--primary-text) / 0.3);
  }

  /* The wireless sign points down: as a drawing (selector.js puts it in place of the element's
     background image, which stays if the drawing can't be fetched). */
  .product-selector #diagram .wireless-connector .flow-wireless {
    width: 2.5rem;
    height: 2.5rem;
    margin-inline: auto;
    transform: rotate(90deg);
  }

  /* The branch: from the middle of the main line's column across to the middle of the branch's,
     and down into it (both columns, a quarter in from each side, less a quarter of the gap). */
  .product-selector #diagram > .matrix-connector.diagonal {
    grid-column: 1 / span 2 !important;
    justify-self: stretch;
    align-self: stretch;
    width: auto;
    height: auto;
    margin: 0 calc(25% - var(--vertical-gap) / 4 - 2px) 0 calc(25% - var(--vertical-gap) / 4);
    border-top: 4px solid rgb(var(--primary-text) / 0.3);
    border-right: 4px solid rgb(var(--primary-text) / 0.3);
    border-top-right-radius: 0.75rem;
    background: none;
    transform: none;
  }

  .product-selector #diagram .flow-pulse {
    top: 0;
    left: 50%;
  }

  /* Where the zone changes: a dashed line across the grey box, at the end of it the zone above
     named over it and the one below under it (patch 0015 has each zone in a span). The line is
     the zone's label, set out from the middle of its connection to the box's edges: the box
     (.diagram-viewport, the diagram centred in it) is the container for cqw. Only the main line
     changes zone, before any branch: the names, at the right, have the row to themselves. With a
     branch, the main line's middle is half a column and half the gap left of the box's. Scaled
     down (--diagram-scale), the box is that much wider inside. */
  .product-selector .diagram-viewport {
    container-type: inline-size;
  }

  .product-selector #diagram :is(.matrix-connector, .wireless-connector):has(> .connector-zone-label) {
    height: 4.5rem;
  }

  .product-selector #diagram .wireless-connector:has(> .connector-zone-label) .flow-wireless {
    margin-top: 1rem;
  }

  .product-selector #diagram .connector-zone-label {
    --zone-shift: 0px;
    top: 0;
    bottom: 0;
    left: calc(50% + var(--zone-shift) - 50cqw / var(--diagram-scale, 1));
    /* A little short of the right edge, or rounding makes the box scroll. */
    width: calc(100cqw / var(--diagram-scale, 1) - 4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 1.25rem;
    padding-right: 0.5rem;
    transform: none;
    line-height: 1.1;
    white-space: nowrap;
  }

  .product-selector #diagram:has(> .diagonal) .connector-zone-label {
    --zone-shift: calc((100% + var(--vertical-gap)) / 2);
  }

  .product-selector #diagram .connector-zone-label::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    border-top: 1px dashed rgb(var(--primary-text) / 0.45);
  }

  .product-selector #diagram .connector-zone-separator {
    display: none;
  }
}

/* --- the contact form's "Your system" -------------------------------------------------------- */

/* What the form sends besides the visitor's details (selector.js, showForm): the answers as a
   two-column list and the parts. */
#contact .selector-summary {
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  background: rgb(var(--primary));
}

#contact .selector-summary-answers {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.375rem 1.5rem;
  margin: 0;
  font-size: 0.9375rem;
}

#contact .selector-summary-answers[hidden],
#contact [data-selector-summary-parts][hidden],
#contact [data-selector-summary-empty][hidden] {
  display: none;
}

#contact .selector-summary-answers dt {
  color: rgb(var(--primary-text) / 0.75);
}

#contact .selector-summary-answers dd {
  margin: 0;
  font-weight: 500;
}

#contact .selector-summary-subheading {
  margin-bottom: 0.375rem;
  color: rgb(var(--primary-text) / 0.75);
}

#contact .selector-summary-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

#contact .selector-summary-parts li {
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  outline: 1px solid rgb(var(--decorative) / 0.5);
}
