/*
 * app.css — what the new Hyperion interface adds to the style sheets of
 * Hyperion Health, which it uses by reference:
 *
 *   ../health/css/altamus.css   tokens and components (.btn, .card, .tag, .field, .dialog, .menu, .toast, .table)
 *   ../health/css/next.css      layout (.nx-shell, .nx-header, .nx-hero, .nx-content, .nx-section, .nx-card, .nx-grid)
 *
 * Every class here starts with `hx-`. Colours come from the tokens of
 * altamus.css, so the light and the dark theme both work without rules of
 * their own; phones are the same breakpoint as next.css (below 720px).
 *
 * 1. Shell additions   2. Page states   3. Site tabs   4. Level bar
 * 5. Key-value rows    6. Embedded frame   7. Phones
 */

/* ============================================================ 1. Shell additions */

/* The room of the scrollbar is kept on every page, whether it scrolls or not: the content, centred in the window, is
   at the same place on every page (a page that scrolls would be half a scrollbar to the left of one that does not). */
.nx-main {
  scrollbar-gutter: stable;
}

/* The window itself never scrolls (the shell is as tall as it, and .nx-main scrolls under the header): its scrollbar,
   the browser's plain one, is drawn the way the panels draw theirs, thin and rounded, on the page's background. */
.nx-main::-webkit-scrollbar {
  width: 10px;
}

.nx-main::-webkit-scrollbar-track {
  background: transparent;
}

.nx-main::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-text-muted) 45%, transparent);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
}

.nx-main::-webkit-scrollbar-thumb:hover {
  background-color: color-mix(in srgb, var(--color-text-muted) 70%, transparent);
}

@supports not selector(::-webkit-scrollbar) {
  .nx-main {
    scrollbar-width: thin;
  }
}

/* Installed (manifest.json): the shell is as tall as the window it is shown in, by html and body (100%), not by 100dvh. In
   the installed app on Android, Chrome counts Android's navigation bar in 100dvh: the shell was that much taller than the
   window, and the bottom bar was below it, out of sight (2026-11-03). A browser tab keeps 100dvh. */
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
  .nx-shell {
    height: 100%;
  }
}

/* The box of what a page places absolutely (the visually hidden fields, headings and table heads): without it they
   are placed in the window, and one below its bottom made the window scroll beside the page (two scrollbars). */
.nx-main {
  position: relative;
}

/* The map behind the header of a site page (components/site-backdrop.js): light grey streets on black, of which
   `screen` keeps the lines alone; strongest in the top right corner and faded out from there. Decoration only. */
.hx-hero--map {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hx-hero--map > .nx-hero__inner {
  position: relative;
  z-index: 1;
}

.hx-hero-map {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 0;
  width: min(100%, 1100px);
  pointer-events: none;
  opacity: 0.85;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(farthest-side at 100% 0%, #000 0%, rgba(0, 0, 0, 0.7) 45%, transparent 100%);
  mask-image: radial-gradient(farthest-side at 100% 0%, #000 0%, rgba(0, 0, 0, 0.7) 45%, transparent 100%);
}

.hx-hero-map[hidden],
.hx-hero-map__credit[hidden] {
  display: none;
}

/* Whose map it is, where the fade leaves it readable. */
.hx-hero-map__credit {
  position: absolute;
  top: 4px;
  right: 8px;
  z-index: 1;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

/* The temperature and the installation pictures of a site (pages/site.js): the top right corner of the header, under
   the credit of the map. */
.hx-site-corner {
  position: absolute;
  top: 22px;
  right: 8px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

/* Navigation entries are links here (they open in a new tab), where next.css styles buttons. */
.hx-navlink {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.hx-navlink:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
  border-radius: 6px;
}

.nx-brand .tag {
  margin-left: 2px;
}

.hx-hero__controls:empty {
  display: none;
}

/* next.css gives these a `display`, which would keep a `hidden` one on the page. */
.nx-content[hidden],
.nx-grid[hidden],
.hx-tabs[hidden] {
  display: none;
}

/* A card that is a link, not a button. */
a.nx-card {
  text-decoration: none;
}

.hx-card__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}

/* ============================================================ 2. Page states */

/* Loading, empty and error states that fill the page (or a tab) and centre their content. */
.hx-page-state {
  flex-direction: column;
  gap: 16px;
  min-height: min(60vh, 480px);
  text-align: center;
}

/* One shimmer for every loading placeholder of this interface. */
.hx-skeleton__line,
.hx-inv-skeleton {
  display: block;
  background: linear-gradient(90deg, var(--color-skeleton) 25%, var(--color-skeleton-highlight) 50%, var(--color-skeleton) 75%);
  background-size: 200% 100%;
  animation: hx-shimmer 1.4s linear infinite;
}

@keyframes hx-shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-skeleton__line,
  .hx-inv-skeleton {
    animation: none;
  }
}

/* ============================================================ 3. Site tabs */

/* The bar under the hero of a site page; it stays in view while the tab scrolls. */
.hx-tabs {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0 clamp(16px, 4vw, 40px);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.hx-tabs__list {
  display: flex;
  gap: 4px;
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.hx-tabs__list::-webkit-scrollbar {
  display: none;
}

.hx-tabs__tab {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px 8px 0 0;
}

.hx-tabs__tab:first-child {
  margin-left: -16px;
}

.hx-tabs__tab:hover {
  color: var(--color-heading);
  background: var(--color-accent-hover);
}

.hx-tabs__tab:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-tabs__tab.is-selected {
  color: var(--color-accent-text);
}

.hx-tabs__tab.is-selected::after {
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  height: 3px;
  content: '';
  background: var(--color-accent);
  border-radius: 3px 3px 0 0;
}

/* The body of a tab. A tab appends its own root here (usually a `.nx-content`). */
.hx-tab {
  min-height: 240px;
}

/* "Needs attention" of a site, under the tabs and over the tab that shows (pages/site.js): the first part of the
   content, on the background of the page and as wide as `.nx-content`, its list a card as on the Sites page. Rows are
   `.nx-queue__item`. The tab under it starts with its own top padding. */
.hx-site-events[hidden] {
  display: none;
}

.hx-site-events__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1280px;
  padding: 20px clamp(16px, 4vw, 40px) 0;
  margin: 0 auto;
}

.hx-site-events__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.hx-site-events__title {
  margin: 0;
}

/* The heading is "Needs attention" with its count, as on the Sites page (`.nx-section__title`): the toggle that folds
   the rows away (the look of `.hx-ov-section__toggle`). */
.hx-site-events__toggle {
  flex-wrap: wrap;
  gap: 6px 10px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.hx-site-events__list[hidden] {
  display: none;
}

.hx-site-events__list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.hx-site-events__item {
  min-height: 60px;
}

.hx-site-events__item:hover {
  background: none;
}

/* A row that opens its event (for who has the Service page) answers to the pointer as a button does. */
.hx-site-events__item--opens {
  cursor: pointer;
}

.hx-site-events__item--opens:hover {
  background: var(--color-row-hover);
}

.hx-site-events__time {
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

@media (max-width: 719.98px) {
  .hx-site-events__item {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .hx-site-events__time {
    grid-column: 2;
  }

  /* A row without the big icon (Kyle 2026-10-31): one column, the time under the text. */
  .hx-site-events__item.is-plain {
    grid-template-columns: minmax(0, 1fr);
  }

  .hx-site-events__item.is-plain > .hx-site-events__time {
    grid-column: 1;
  }
}

/* ============================================================ 4. Level bar */

/* How full a boundary is: a track with a fill. Set the width of the fill in percent. */
.hx-level {
  position: relative;
  width: 100%;
  height: 8px;
  overflow: hidden;
  background: var(--color-lane-empty);
  border-radius: var(--radius-pill);
}

.hx-level__fill {
  display: block;
  height: 100%;
  background: var(--color-accent);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.hx-level--low .hx-level__fill {
  background: var(--status-warning);
}

.hx-level--full .hx-level__fill {
  background: var(--status-error);
}

.hx-level--unknown {
  background: repeating-linear-gradient(135deg, var(--color-lane-empty) 0 6px, transparent 6px 12px);
}

.hx-level--lg {
  height: 12px;
}

/* A limit on the bar (`marks` of levelBar): low limit (red) and target (dark). */
.hx-level__mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--color-heading);
}

.hx-level__mark--low {
  background: var(--status-error);
}

/* ============================================================ 5. Key-value rows */

.hx-kv {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.hx-kv__row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(0, 1fr);
  gap: 4px 24px;
  align-items: baseline;
  padding: 12px 0;
}

.hx-kv__row + .hx-kv__row {
  border-top: 1px solid var(--color-border);
}

.hx-kv__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.hx-kv__value {
  min-width: 0;
  margin: 0;
  font-size: 15px;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

/* A plain panel for rows and forms (a `.nx-card` is clickable; this is not). */
.hx-panel {
  padding: 8px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.hx-panel--padded {
  padding: 20px;
}

/* ============================================================ Connect an AI assistant, API reference (pages/connect.js, pages/api.js) */

/* The way to the reference, in the band of the API page: a link that looks as a button does. */
.hx-connect a.btn {
  text-decoration: none;
}

.hx-connect__panel > * + * {
  margin-top: 14px;
}

/* A line to copy: the text, then the button that copies it. */
.hx-connect__copy {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}

.hx-connect__code {
  flex: 1 1 260px;
  min-width: 0;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  color: var(--color-heading);
  overflow-wrap: anywhere;
  user-select: all;
  background: var(--color-hover);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

/* Several lines to copy (a configuration): as they are, with the button under them where there is no room beside. */
.hx-connect__code--block {
  margin: 0;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  overflow-wrap: normal;
}

.hx-connect__copy--block {
  align-items: flex-start;
}

/* The name of a tool, over how it is done there. */
.hx-connect__heading {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-connect__panel > .hx-connect__heading:not(:first-child) {
  padding-top: 14px;
  margin-top: 18px;
  border-top: 1px solid var(--color-border);
}

.hx-connect__steps,
.hx-connect__examples,
.hx-connect__facts {
  padding-left: 22px;
  margin: 0;
  line-height: 1.55;
}

.hx-connect__steps > li + li,
.hx-connect__examples > li + li,
.hx-connect__facts > li + li {
  margin-top: 8px;
}

.hx-connect__text {
  margin: 0;
}

.hx-connect__note {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.hx-connect__note > .bi {
  flex: none;
}

.hx-connect__abilities {
  margin-bottom: 16px;
}

/* A row that is read, not pressed. */
.hx-connect__ability {
  cursor: default;
}

.hx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}

/* ============================================================ 6. Embedded frame */

/* A page of the classic interface in a frame that fills the main area, edge to edge
   (pages/classic-page.js, which no route uses at present). The frame inside is the bridge's: `.hx-frame-wrap` > `iframe.hx-frame`,
   styled by classic-bridge.js. */
.hx-classic-page {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--color-bg);
}

/* ============================================================ 7. Phones */

@media (max-width: 719.98px) {
  .hx-tabs__tab {
    min-height: 48px;
    padding: 0 12px;
    font-size: 14px;
  }

  .hx-tabs__tab:first-child {
    margin-left: -12px;
  }

  .hx-tabs__tab.is-selected::after {
    right: 12px;
    left: 12px;
  }

  .hx-kv__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .hx-panel {
    padding: 4px 16px;
  }

  .hx-panel--padded {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-level__fill {
    transition: none;
  }
}

/* ============================================================ Devices tab (pages/site/devices.js) */

.hx-muted {
  color: var(--color-text-muted);
}

.hx-dev-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

/* "My sites / All" and "Edit my sites" of the Devices page, between the band and the view (pages/devices.js). */
.hx-dev-scope {
  padding-bottom: 0;
}

.hx-dev-scope[hidden] {
  display: none;
}

.hx-dev-scope + .nx-page__state + .hx-tab > .nx-content {
  /* As far under My sites | All as the first section of the Sites page: the gap of .nx-content (next.css), less the
     -20px of the bar. */
  padding-top: 44px;
}

@media (max-width: 719.98px) {
  .hx-dev-scope + .nx-page__state + .hx-tab > .nx-content {
    padding-top: 32px;
  }
}

/* On the Devices page the figures are in the band at the top (pages/devices.js). */
.hx-dev-hero-stats {
  margin-top: 28px;
}

/* Spaced as the figures of the other bands (next.css, `.nx-stats`). */
.hx-dev-hero-stats > .hx-dev-summary {
  gap: 14px;
}

.hx-dev-hero-stats[hidden],
.hx-dev-hero-stats:empty {
  display: none;
}

.hx-dev-summary:empty {
  display: none;
}

.hx-dev-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 16px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.hx-dev-tile--warn {
  border-color: var(--status-warning);
}

.hx-dev-tile__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hx-dev-tile__value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--color-heading);
  font-variant-numeric: tabular-nums;
}

.hx-dev-tile__note {
  min-height: 1.2em;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-dev-updated {
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-dev-updated--warn {
  color: var(--color-warning-text);
}

/* The removed routers of the Devices page (an administrator's), folded under the routers. */
.hx-dev-removed {
  margin-top: 12px;
}

.hx-dev-removed__toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
}

.hx-dev-removed__list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.hx-dev-removed__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 0;
  border-top: 1px solid var(--color-border);
}

.hx-dev-removed__name {
  font-weight: 600;
}

.hx-dev-removed__meta {
  flex: 1 1 12em;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-dev-removed__empty {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

/* In the band of the Devices page the note keeps the colour the band gives it (next.css, `.nx-hero__updated`). */
.nx-hero .hx-dev-updated:not(.hx-dev-updated--warn) {
  color: rgba(255, 255, 255, 0.75);
}

.hx-device-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
}

.hx-device {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 18px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--nx-item-color, var(--status-unknown));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.hx-device--skeleton {
  min-height: 62px;
}

/* A card is closed until its head is clicked: the name and the status, and the details under them. */
.hx-device-grid {
  align-items: start;
}

.hx-device__title {
  min-width: 0;
  margin: -18px -20px;
}

.hx-device.is-open .hx-device__title {
  margin-bottom: 0;
}

.hx-device__head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 14px 20px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: var(--radius-card);
}

.hx-device__head:hover {
  background: color-mix(in srgb, var(--color-heading) 5%, transparent);
}

.hx-device__head:focus-visible {
  outline: 2px solid var(--color-focus, var(--violet));
  outline-offset: -2px;
}

/* The card of one scanner on another page (`mountScannerCard`): always open, so its head is not a button. */
.hx-device__head--static,
.hx-device__head--static:hover {
  cursor: default;
  background: none;
}

/* When a running scan should be done, beside the name of a scanner's card (pages/site/devices.js; Kyle, 2026-11-20). */
.hx-device__eta {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--status-info);
  white-space: nowrap;
}

.hx-device__name {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

/* The status of a scanner on its card: a dot alone, its word in the tooltip (the colour is set per status). */
.hx-device__state {
  display: inline-flex;
  flex: none;
  align-self: center;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: help;
}

.hx-device__state .status-dot {
  width: 12px;
  height: 12px;
}

.hx-device__chevron {
  flex: none;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}

.hx-device.is-open .hx-device__chevron {
  transform: rotate(180deg);
}

/* The router and the power supply of a scanner (site/devices.js `deviceLinks`): small icons between its status and the
   chevron, outside the head (a button in a button is not allowed). The chevron is drawn over the right of the title. */
.hx-device__title--links {
  position: relative;
  display: flex;
  align-items: center;
}

.hx-device__title--links .hx-device__head {
  flex: 1;
  min-width: 0;
  padding-right: 4px;
}

.hx-device__title--links .hx-device__chevron {
  position: absolute;
  top: 0;
  right: 20px;
  bottom: 0;
  display: flex;
  align-items: center;
}

.hx-device__links {
  display: flex;
  flex: none;
  gap: 2px;
  padding-right: 44px;
}

.hx-device__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 8px;
}

.hx-device__link:hover {
  background: color-mix(in srgb, var(--color-heading) 8%, transparent);
}

/* The state of a router or a power supply on its own card: the same icon, not a button. */
.hx-device__link--state {
  flex: none;
  cursor: help;
}

.hx-device__link--state:hover {
  background: none;
}

.hx-device__link:focus-visible {
  outline: 2px solid var(--color-focus, var(--violet));
  outline-offset: 0;
}

.hx-device__link--online,
.hx-device__link--ok {
  color: var(--status-ok);
}

.hx-device__link--offline,
.hx-device__link--disconnected {
  color: var(--status-error);
}

.hx-device__link--low {
  color: var(--status-warning, var(--status-error));
}

.hx-device__link--unknown {
  color: var(--color-text-muted);
}

/* A router whose state is not known (nothing reports on it, or its source stopped): its Wi-Fi with a question mark over it
   (Kyle, 2026-11-06), on a scanner's card and on the router's own. */
.hx-device__link--unknown::after {
  position: absolute;
  top: 2px;
  right: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  color: var(--color-surface);
  content: "?";
  background: var(--color-text-muted);
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--color-surface);
}

/* An empty battery struck through: no reading for over an hour, or the scanner is offline. */
.hx-device__link--disconnected::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 22px;
  content: "";
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 0 0 1.5px var(--color-surface);
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* The card an icon of a scanner points to: a short shake and a ring in the accent colour (`revealCard`). */
.hx-device--wobble {
  animation: hx-device-wobble 0.6s ease-in-out;
}

@keyframes hx-device-wobble {
  0% {
    box-shadow: var(--shadow), 0 0 0 0 color-mix(in srgb, var(--color-accent) 0%, transparent);
    transform: none;
  }

  15% {
    box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--color-accent) 55%, transparent);
    transform: translateX(-4px) rotate(-1deg);
  }

  35% {
    transform: translateX(4px) rotate(1deg);
  }

  55% {
    transform: translateX(-3px) rotate(-0.6deg);
  }

  75% {
    box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--color-accent) 55%, transparent);
    transform: translateX(2px) rotate(0.3deg);
  }

  100% {
    box-shadow: var(--shadow), 0 0 0 0 color-mix(in srgb, var(--color-accent) 0%, transparent);
    transform: none;
  }
}

@keyframes hx-device-ring {
  0%,
  100% {
    box-shadow: var(--shadow), 0 0 0 0 color-mix(in srgb, var(--color-accent) 0%, transparent);
  }

  20%,
  75% {
    box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--color-accent) 55%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-device--wobble {
    animation-name: hx-device-ring;
  }
}

.hx-device__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hx-device__body[hidden] {
  display: none;
}

.hx-device__id {
  margin: -8px 0 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hx-device__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 0;
}

/* A fact that takes the whole width of the card: the schedule, with its strip of the week. */
.hx-device__fact--wide {
  grid-column: 1 / -1;
}

.hx-device__fact dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.hx-device__fact dd {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.hx-device__meters {
  display: grid;
  gap: 8px;
}

.hx-device__meter {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) minmax(0, 120px);
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.hx-device__meter-label {
  font-weight: 600;
  color: var(--color-text-muted);
}

.hx-device__meter-value {
  color: var(--color-text);
  text-align: right;
  white-space: nowrap;
}

.hx-device__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

/* Settings and Health of a scanner: they wrap as one. */
.hx-device__pair {
  display: flex;
  gap: 8px;
}

/* A scanner's card: its buttons in two columns of one width, Settings and Health a row of their own. */
.hx-device__actions:has(> .hx-device__pair) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hx-device__actions > .hx-device__pair {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
}

/* The Devices page (pages/devices.js): the cards of a site under its name. */
.hx-dev-group + .hx-dev-group {
  margin-top: 28px;
}

.hx-dev-group__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}

.hx-dev-group__title a {
  color: var(--color-heading);
  text-decoration: none;
}

.hx-dev-group__title a:hover {
  text-decoration: underline;
}

/* A site of the Devices page folds on its title (Kyle, 2026-11-13): its name and what it holds. */
.hx-dev-group__title.is-foldable {
  cursor: pointer;
}

.hx-dev-group__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: -4px -4px -4px -6px;
  padding: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
}

.hx-dev-group__toggle:hover {
  color: var(--color-heading);
  background: var(--color-hover);
}

.hx-dev-group__toggle:focus-visible {
  outline: 2px solid var(--color-focus, var(--violet));
  outline-offset: 2px;
}

.hx-dev-group__chevron {
  font-size: 13px;
  transition: transform 0.15s ease;
}

.hx-dev-group.is-collapsed .hx-dev-group__chevron {
  transform: rotate(-90deg);
}

.hx-dev-group__held {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.hx-dev-group.is-collapsed .hx-dev-group__title {
  margin-bottom: 0;
}

.hx-dev-client .hx-dev-group.is-collapsed {
  padding-top: 12px;
  padding-bottom: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .hx-dev-group__chevron {
    transition: none;
  }
}

/* The Devices page by client (as the Sites page: .hx-ov-group__head), then by site, each with its kinds of device. */
.hx-dev-client__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-heading);
}

.hx-dev-client__code {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Each site a panel of its own under its client (Kyle, 2026-11-05). */
.hx-dev-client .hx-dev-group {
  padding: 16px 18px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.hx-dev-client .hx-dev-group + .hx-dev-group {
  margin-top: 16px;
}

/* A folded client is its name alone. */
.hx-dev-client.is-collapsed .hx-dev-client__title {
  margin-bottom: 0;
}

.hx-dev-client + .hx-dev-client {
  margin-top: 28px;
}

.hx-dev-client.is-collapsed + .hx-dev-client {
  margin-top: 8px;
}

/* The bar above the Scanners of a site's Devices tab: Expand all, the filter, Updated, Refresh (Kyle, 2026-11-07). */
.hx-dev-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  margin: 0 0 12px;
}

.hx-dev-kind + .hx-dev-kind {
  margin-top: 16px;
}

.hx-dev-kind__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* The menu (⋮) of a kind of device, at the right of its title (Kyle, 2026-11-07): the options of that kind, in place of
   the buttons under it. Small and quiet; the title keeps its height. On the tab of one site it ends the section's actions. */
.hx-dev-kind__menu.icon-btn {
  width: 30px;
  height: 30px;
  font-size: 16px;
  color: var(--color-text-muted);
  border-radius: 8px;
}

.hx-dev-kind__menu.icon-btn:hover,
.hx-dev-kind__menu.icon-btn.is-open {
  color: var(--color-heading);
}

.hx-dev-kind__menu.icon-btn:focus-visible {
  outline: 2px solid var(--color-focus, var(--violet));
  outline-offset: 2px;
}

.hx-dev-kind__title .hx-dev-kind__menu {
  margin: -6px 0 -6px auto;
}

/* A kind of device of a site folds on its title (Kyle, 2026-11-06). */
.hx-dev-kind__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 2px 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
}

.hx-dev-kind__toggle:hover {
  color: var(--color-heading);
}

.hx-dev-kind__toggle:focus-visible {
  outline: 2px solid var(--color-focus, var(--violet));
  outline-offset: 2px;
}

.hx-dev-kind__chevron {
  font-size: 12px;
  transition: transform 0.15s ease;
}

.hx-dev-kind.is-collapsed .hx-dev-kind__chevron {
  transform: rotate(-90deg);
}

.hx-dev-kind.is-collapsed .hx-dev-kind__title {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hx-dev-kind__chevron {
    transition: none;
  }
}

/* A power supply card: a line for each scanner on it, its voltage now and its last week (phase 3). */
.hx-supply__scanners {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.hx-supply__scanner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  font-size: 13px;
}

.hx-supply__scanner-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hx-supply__scanner-none {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-supply__scanner-volts {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.hx-supply__scanner .hx-supply__spark {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  height: 36px;
}

.hx-dev-inline-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ============================================================ Account page (pages/account.js) */

.hx-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0 16px;
  border-bottom: 1px solid var(--color-border);
}

.hx-avatar {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-accent-text);
  background: var(--color-accent-selected);
  border-radius: 50%;
}

.hx-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hx-identity__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.hx-identity__name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-identity__user {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.hx-rows {
  margin: 0;
  list-style: none;
}

.hx-rows > li + li {
  border-top: 1px solid var(--color-border);
}

.hx-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 12px 0;
  font: inherit;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
}

.hx-row:hover .hx-row__label {
  color: var(--color-accent-text);
}

.hx-row:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 8px;
}

.hx-row__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 18px;
  color: var(--color-accent-text);
  background: var(--color-accent-selected);
  border-radius: 10px;
}

.hx-row__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hx-row__label {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-heading);
}

.hx-row__detail {
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-row__chevron {
  flex: none;
  color: var(--color-text-muted);
}

@media (max-width: 899.98px) {
  .hx-dev-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 719.98px) {
  .hx-dev-tile {
    padding: 12px 14px;
  }

  .hx-dev-tile__value {
    font-size: 24px;
  }

  .hx-device {
    padding: 16px;
  }

  .hx-device__actions .btn,
  .hx-device__pair {
    flex: 1 1 auto;
  }
}

/* ============================================================ Site tabs: Spaces and Materials (pages/site/spaces.js, materials.js) */

.hx-muted {
  color: var(--color-text-muted);
}

.hx-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font: inherit;
  font-weight: 600;
  color: var(--color-accent-text);
  cursor: pointer;
  background: none;
  border: 0;
}

.hx-link:hover {
  text-decoration: underline;
}

.hx-link:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Loading placeholders: a card or a row of lines (the lines shimmer, see "2. Page states"). */
.hx-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.hx-skeleton--row {
  padding: 16px 20px;
}

.hx-skeleton__line {
  height: 12px;
  border-radius: 6px;
}

.hx-skeleton__line--title {
  width: 40%;
  height: 18px;
}

.hx-skeleton__line--short {
  width: 60%;
}

/* Spaces: a card per space. */
.hx-space-list,
.hx-materials {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hx-space {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.hx-space__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.hx-space__name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-space__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 32px;
  margin: 0;
}

.hx-space__fact {
  min-width: 0;
}

.hx-space__label {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.hx-space__value {
  min-width: 0;
  margin: 0;
  font-size: 15px;
  color: var(--color-text);
}

.hx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hx-schedule {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

/* 24 columns (hours) by 7 rows (Sunday to Saturday), local time. */
.hx-strip {
  display: grid;
  flex: none;
  grid-template-columns: repeat(24, 1fr);
  gap: 1px;
  width: 144px;
}

.hx-strip__cell {
  height: 5px;
  background: var(--color-lane-empty);
  border-radius: 1px;
}

.hx-strip__cell.is-on {
  background: var(--color-accent);
}

.hx-space__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

/* The "Draft" pill beside "View 3D": a tag that opens the draft of the connector. */
.hx-space__draft {
  align-self: center;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.hx-space__draft:hover {
  filter: brightness(0.95);
}

.hx-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hx-form__lead {
  margin: 0;
  color: var(--color-text-muted);
}

.hx-confirm p {
  margin: 0 0 8px;
}

.hx-confirm ul {
  padding-left: 20px;
  margin: 0 0 12px;
}

/* The Scan now confirmation (scan-actions.js): what runs, what is measured, what it costs. */
.hx-confirm__label {
  font-weight: 700;
  color: var(--color-heading);
}

.hx-confirm__cost {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: var(--color-bg);
  border-radius: 10px;
}

.hx-confirm__cost strong {
  font-size: 20px;
  color: var(--color-heading);
  font-variant-numeric: tabular-nums;
}

/* Materials: a table that becomes cards on a phone. */
.hx-table {
  min-width: 720px;
  font-size: 14px;
}

.hx-table td {
  vertical-align: top;
}

.hx-table__actions {
  text-align: right;
  white-space: nowrap;
}

.hx-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--color-heading);
}

.hx-swatch {
  flex: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--color-border-strong, var(--color-text-muted));
  border-radius: 5px;
}

.hx-swatch--none {
  background: repeating-linear-gradient(135deg, var(--color-lane-empty) 0 4px, transparent 4px 8px);
}

.hx-figure {
  font-variant-numeric: tabular-nums;
}

.hx-sub {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: 0;
}

.hx-sort .bi {
  font-size: 11px;
  opacity: 0.7;
}

.hx-sort:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (max-width: 719.98px) {
  .hx-space {
    padding: 16px;
  }

  .hx-space__facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .hx-strip {
    width: 120px;
  }

  .hx-space__actions .btn {
    flex: 1 1 auto;
  }

  /* Rows of the materials table as cards: the label comes from `data-label`. */
  .hx-materials .table-scroll {
    overflow: visible;
  }

  .hx-table {
    min-width: 0;
    border: 0;
  }

  .hx-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .hx-table,
  .hx-table tbody,
  .hx-table tr,
  .hx-table td {
    display: block;
  }

  .hx-table tr {
    padding: 8px 16px;
    margin-bottom: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
  }

  .hx-table tr + tr td,
  .hx-table td {
    border-top: 0;
  }

  .hx-table td {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 6px 0;
    text-align: right;
  }

  .hx-table td::before {
    flex: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    content: attr(data-label);
  }

  .hx-table td.hx-table__name {
    justify-content: flex-start;
    padding: 8px 0;
    font-size: 16px;
    text-align: left;
  }

  .hx-table td.hx-table__name::before,
  .hx-table td.hx-table__actions::before {
    content: none;
  }

  .hx-table td.hx-table__actions {
    justify-content: flex-start;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid var(--color-border);
  }
}


/* ============================================================ Sites overview (pages/overview.js) */

.hx-ov-search {
  width: min(240px, 100%);
}

/* A row of the queue is a link here (it opens in a new tab), where next.css styles a button. */
.hx-ov-queue__item {
  text-decoration: none;
}

.hx-ov-queue__item:focus-visible,
.hx-ov-queue__more:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

/* "Newest by facility": the name of a site over its rows of "Needs attention". */
.hx-hl-queue__group {
  margin: 0;
  padding: 14px 16px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  /* A light rule above and below each site's name (Kyle 2026-10-31); the first, at the top of the list, only below. */
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  /* And a dark grey edge on the left (the colour of the name: Kyle 2026-10-31, dark grey or black), as wide as the
     coloured edge of the rows (4px), drawn inside so the name stays put. */
  box-shadow: inset 4px 0 0 var(--color-text-muted);
}

.hx-hl-queue__group:first-child {
  border-top: 0;
}

.hx-ov-queue__more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 20px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent-text);
  background: none;
  border: 0;
  border-top: 1px solid var(--color-border);
  cursor: pointer;
}

.hx-ov-queue__more:hover {
  background: var(--color-row-hover);
}

.hx-ov-time {
  white-space: nowrap;
}

/* The scope and "Edit my sites", first in the content. The negative margin takes it closer to what it governs. */
.hx-ov-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: -20px;
}

.hx-ov-toolbar[hidden] {
  display: none;
}

/* An option of a segmented control that does not apply ("My sites" with none ticked: site-scope.js `showScope`). */
.segmented__option[hidden] {
  display: none;
}

/*
 * The folded scopes (site-scope.js `showScope`): "Leased" and "Purchased" right after All (`.hx-scope__more--all`), "Site
 * visits" right after Resolutions (`.hx-scope__more--resolutions`). Each is unfolded while the option it folds into is
 * hovered or focused, while one of its family is (so the pointer can move onto them), or while one of its family is
 * pressed; once it opened under the pointer, until the pointer leaves the control (`is-open-all`, `is-open-resolutions`
 * of site-scope.js `keepOpenWhileHovered`; Kyle, 2026-11-13). Folding waits a moment, so a pointer that slips past does
 * not lose them. Folded, they are not focusable (visibility).
 */
.segmented__option.hx-scope__more {
  max-width: 0;
  padding-inline: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  transition: max-width 0.18s ease 0.35s, padding-inline 0.18s ease 0.35s, opacity 0.12s ease 0.35s, visibility 0s linear 0.53s;
}

.segmented:has(> .segmented__option[data-value='all']:hover) > .hx-scope__more--all,
.segmented:has(> .segmented__option[data-value='all']:focus-visible) > .hx-scope__more--all,
.segmented:has(> .hx-scope__more--all:hover) > .hx-scope__more--all,
.segmented:has(> .hx-scope__more--all:focus-visible) > .hx-scope__more--all,
.segmented:has(> .hx-scope__more--all[aria-pressed='true']) > .hx-scope__more--all,
.segmented:has(> .segmented__option[data-value='resolutions']:hover) > .hx-scope__more--resolutions,
.segmented:has(> .segmented__option[data-value='resolutions']:focus-visible) > .hx-scope__more--resolutions,
.segmented:has(> .hx-scope__more--resolutions:hover) > .hx-scope__more--resolutions,
.segmented:has(> .hx-scope__more--resolutions:focus-visible) > .hx-scope__more--resolutions,
.segmented:has(> .hx-scope__more--resolutions[aria-pressed='true']) > .hx-scope__more--resolutions,
.segmented.is-open-all > .hx-scope__more--all,
.segmented.is-open-resolutions > .hx-scope__more--resolutions {
  max-width: 10em;
  padding-inline: 12px;
  opacity: 1;
  visibility: visible;
  transition: max-width 0.18s ease, padding-inline 0.18s ease, opacity 0.12s ease 0.06s, visibility 0s;
}

/* While a folded scope is pressed, the option it folds into shows it is their parent, in the colour of a hovered option. */
.segmented:has(> .hx-scope__more--all[aria-pressed='true']) > .segmented__option[data-value='all'],
.segmented:has(> .hx-scope__more--resolutions[aria-pressed='true']) > .segmented__option[data-value='resolutions'] {
  background: var(--color-hover);
}

.segmented--sm:has(> .segmented__option[data-value='all']:hover) > .hx-scope__more--all,
.segmented--sm:has(> .segmented__option[data-value='all']:focus-visible) > .hx-scope__more--all,
.segmented--sm:has(> .hx-scope__more--all:hover) > .hx-scope__more--all,
.segmented--sm:has(> .hx-scope__more--all:focus-visible) > .hx-scope__more--all,
.segmented--sm:has(> .hx-scope__more--all[aria-pressed='true']) > .hx-scope__more--all,
.segmented--sm:has(> .segmented__option[data-value='resolutions']:hover) > .hx-scope__more--resolutions,
.segmented--sm:has(> .segmented__option[data-value='resolutions']:focus-visible) > .hx-scope__more--resolutions,
.segmented--sm:has(> .hx-scope__more--resolutions:hover) > .hx-scope__more--resolutions,
.segmented--sm:has(> .hx-scope__more--resolutions:focus-visible) > .hx-scope__more--resolutions,
.segmented--sm:has(> .hx-scope__more--resolutions[aria-pressed='true']) > .hx-scope__more--resolutions,
.segmented--sm.is-open-all > .hx-scope__more--all,
.segmented--sm.is-open-resolutions > .hx-scope__more--resolutions {
  padding-inline: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .segmented__option.hx-scope__more {
    transition: visibility 0s linear 0.35s;
  }
}

/* The title of "Needs attention" is a toggle, like a client group's. */
.hx-ov-section__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px 0 8px;
  margin-left: -8px;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.hx-ov-section__toggle:hover {
  background: var(--color-hover);
}

.hx-ov-section__toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

.hx-ov-section__toggle > .bi {
  flex: none;
  font-size: 16px;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}

.hx-ov-section__toggle[aria-expanded='false'] > .bi {
  transform: rotate(-90deg);
}

.nx-section.is-collapsed {
  margin-bottom: -16px;
}

.nx-section.is-collapsed > .nx-section__head {
  margin-bottom: 0;
}

/* next.css gives these a `display`, which would keep a `hidden` one on the page. */
.nx-section .nx-eyebrow[hidden],
.nx-section__body[hidden] {
  display: none;
}

/* The heading of the list of sites is for screen readers (the line above the groups is "Needs attention" and its buttons). */
.hx-ov-list > .nx-section__head {
  margin-bottom: 0;
}

/* "Needs attention" with "Show all charts" and "Collapse all" on its line, at the right; on a narrow screen the two
   wrap under it, together. Without anything to show the heading is away and the line keeps the buttons. */
.hx-ov-attention > .nx-section__head {
  align-items: center;
}

.hx-ov-attention > .nx-section__head > .nx-section__heading[hidden] {
  display: none;
}

/* The buttons sit at the right of the heading while they fit beside it (the head spreads its two parts); wrapped to a
   line of their own they start at the left. Without the heading they keep to the right. */
.hx-ov-attention > .nx-section__head > .nx-section__heading[hidden] + .nx-section__actions {
  margin-left: auto;
}

.hx-ov-attention.is-empty > .nx-section__head {
  min-height: 32px;
}

/* Nothing needs attention: the section is away, its buttons on the line of the scope (pages/overview.js). */
.hx-ov-attention[hidden] {
  display: none;
}

.hx-ov-toolbar__end:empty {
  display: none;
}

/* The heading keeps to one line: it is the buttons that wrap. */
.hx-ov-section__toggle > span {
  white-space: nowrap;
}

/* While the sites of a client are shown, the tags "Every site of Acme" (its x goes back to the scope) and "Active
   sites" (its x shows every site of the client, its + only the active ones again) after "Edit" beside My sites | All
   (site-scope.js `showScope`); on every page that has the control. */
.hx-scope__client {
  gap: 6px;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
  border: 0;
  appearance: none;
}

.hx-scope__client:hover {
  text-decoration: underline;
}

.hx-scope__client:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-scope__client > .bi-x-lg,
.hx-scope__client > .bi-plus-lg {
  font-size: 10px;
}

/* The same gap between clients, folded or not (Kyle, 2026-11-11: folding one under another folded must not move it). */
.hx-ov-groups {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hx-ov-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-heading);
}

.hx-ov-group.is-collapsed .hx-ov-group__head {
  margin-bottom: 0;
}

/* The summary band of the Sites page: a slim bar (label and controls) until it is opened. */
.hx-ov-hero__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px 0 8px;
  margin-left: -8px;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.hx-ov-hero__toggle:hover {
  background: var(--color-hover);
}

.hx-ov-hero__toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

.hx-ov-hero__toggle > .bi {
  flex: none;
  font-size: 14px;
  transition: transform 0.15s ease;
}

.hx-ov-hero__toggle[aria-expanded='false'] > .bi {
  transform: rotate(-90deg);
}

/* next.css gives the heading a `display`, which would keep a `hidden` one on the page. */
.hx-ov-hero .nx-hero__heading[hidden] {
  display: none;
}

/* The label and the controls are one slim row at the top, open or closed: opening the band adds the title, the lead
   and the figures under that row, each a full line, without moving the row. */
.nx-hero.hx-ov-hero {
  padding-top: 10px;
}

.nx-hero.hx-ov-hero.is-collapsed {
  padding-bottom: 10px;
}

.hx-ov-hero .nx-hero__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
}

.hx-ov-hero .nx-eyebrow {
  order: 0;
  margin-bottom: 0;
}

.hx-ov-hero .nx-hero__controls {
  flex: 1 1 auto;
  order: 1;
  justify-content: flex-end;
  margin-top: 0;
}

.hx-ov-hero .nx-hero__inner > :not(.nx-eyebrow, .nx-hero__controls) {
  flex: 0 0 100%;
  order: 2;
  min-width: 0;
}

.hx-ov-hero .nx-hero__heading {
  margin-top: 16px;
}

@media (max-width: 719.98px) {
  .hx-ov-hero .nx-hero__controls {
    flex-basis: 100%;
    justify-content: flex-start;
    padding-bottom: 4px;
  }
}

.hx-ov-group__toggle,
.hx-ov-group__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  font: inherit;
  color: inherit;
  text-align: left;
}

.hx-ov-group__toggle {
  padding: 0 12px 0 8px;
  margin-left: -8px;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.hx-ov-group__toggle:hover {
  background: var(--color-hover);
}

.hx-ov-group__toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

.hx-ov-group__toggle > .bi {
  flex: none;
  font-size: 14px;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}

.hx-ov-group__toggle[aria-expanded='false'] > .bi {
  transform: rotate(-90deg);
}

.hx-ov-group__name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hx-ov-group__code {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* The link beside the name of a client: every active site of the client in place of the scope; pressed while they are shown. */
.hx-ov-group__link {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  color: var(--color-text-muted);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.hx-ov-group__link:hover {
  color: var(--color-accent-text);
  background: var(--color-hover);
}

.hx-ov-group__link:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

.hx-ov-group__link.is-on {
  color: var(--color-accent-text);
  background: var(--color-accent-tint);
}

/* A site card: the title is the link and covers the card, so the whole card opens the site. */
.hx-ov-card {
  position: relative;
}

.hx-ov-card__link {
  text-decoration: none;
}

.hx-ov-card__link::after {
  position: absolute;
  inset: 0;
  content: '';
  border-radius: inherit;
}

.hx-ov-card__link:focus-visible {
  outline: none;
}

.hx-ov-card__link:focus-visible::after {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* A tap on a phone does not flash the card: no grey tap highlight over the link that covers it, and no hover
   (lifted, accent border) left on it after the tap, which a touch screen keeps until the next tap elsewhere. */
.hx-ov-card,
.hx-ov-card a,
.hx-ov-card button {
  -webkit-tap-highlight-color: transparent;
}

@media (hover: none) {
  .hx-ov-card.nx-card:not(:disabled):hover {
    border-color: var(--color-border);
    box-shadow: var(--shadow);
    transform: none;
  }
}

/* The address of a site: a link to Google Maps (parts.js) that reads as the text around it. */
.hx-address {
  color: inherit;
  text-decoration: none;
}

/* Not underlined at rest; under the pointer, or with the keyboard on it, it shows that it is a link. */
.hx-address:hover,
.hx-address:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* The rows of a card's tags, one per colour (pages/overview.js, arrangeTags): a break of no height ends a row. The rows
   are 6px apart by a margin under each tag, not the row gap, which would also open around the break; the tags' box
   takes the last margin back. */
/* Three lines at most, on every screen (Kyle 2026-10-31): the devices on top, then the worst colours, so what is cut off
   is the mildest. A line is a 24px tag and its 6px margin, so three lines end at 90px, where a fourth would start. */
.hx-ov-card__meta > .nx-card__tags {
  row-gap: 0;
  margin-bottom: -6px;
  max-height: 90px;
  overflow: hidden;
}

.hx-ov-card__meta > .nx-card__tags .tag {
  box-sizing: border-box;
  height: 24px;
  margin-bottom: 6px;
  /* A light border in the tag's own colour (Kyle 2026-10-31); inside the 24px, so the rows keep their height. */
  border: 1px solid color-mix(in srgb, var(--tag-color, var(--color-accent-text)) 35%, transparent);
}

.hx-ov-tagbreak {
  flex-basis: 100%;
  height: 0;
}

/* What has a tooltip or a click of its own lies above the link. */
.hx-ov-card__above {
  position: relative;
  z-index: 1;
}

.hx-ov-card__status {
  display: contents;
}

.hx-ov-card--skeleton {
  cursor: default;
  pointer-events: none;
}

.hx-ov-card--skeleton > .nx-skeleton:first-child {
  width: 60%;
  height: 20px;
}

/* The summary keeps its height while it loads, so the grid does not jump. */
.hx-ov-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 142px;
  padding-top: 12px;
  margin-top: 2px;
  border-top: 1px solid var(--color-border);
}

.hx-ov-summary__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

/* When the site was last measured, under the address. It keeps its line while the summary loads. */
.hx-ov-card__when {
  min-height: 20px;
  font-size: 13px;
  line-height: 20px;
  color: var(--color-text-muted);
}

/* The time of the newest measurement with "Scan now" beside it on the first row; the tags of the card with "Site 3D"
   right-aligned beside them on the second: a grid of two rows, the same place on every card (the time and the pill
   need the whole first row: a card is not wide enough for the button there too). On a phone the tags keep to one line,
   the count of devices last: it is the one pushed out when the open events and the state need the room. */
.hx-ov-card__meta {
  display: grid;
  grid-template-areas:
    'measured measured'
    'tags view';
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
}

/* When the site was measured, and "Scan now" beside it (the pill of a scan on demand); the pill wraps under the time
   only where even the whole row is too short for both. */
.hx-ov-card__measured {
  display: flex;
  flex-wrap: wrap;
  grid-area: measured;
  gap: 4px 10px;
  align-items: center;
  min-width: 0;
}

.hx-ov-card__meta > .btn {
  grid-area: view;
  justify-self: end;
}

.hx-ov-card__meta > .nx-card__tags {
  grid-area: tags;
}

@media (max-width: 719.98px) {
  /* A little less room between the tags and "Site 3D": a card of a phone is narrow. */
  .hx-ov-card__meta {
    column-gap: 8px;
  }

}

.hx-ov-summary__caption {
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-ov-summary__caption--warn {
  font-weight: 600;
  color: var(--color-text);
}

.hx-ov-summary__error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* One row per pile, as on the classic dashboard: bin and material, a level bar, the quantity. */
.hx-ov-piles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hx-ov-pile {
  display: grid;
  grid-template-columns: minmax(0, 34%) minmax(40px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.hx-ov-pile__label {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hx-ov-pile__name,
.hx-ov-pile__material {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hx-ov-pile__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

.hx-ov-pile__material {
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--color-text-muted);
}

.hx-ov-pile__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: 50%;
}

.hx-ov-pile__bar {
  position: relative;
  height: 14px;
  overflow: hidden;
  background: var(--color-lane-empty);
  border-radius: 4px;
}

.hx-ov-pile__bar > span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--status-ok);
  border-radius: 4px 0 0 4px;
}

.hx-ov-pile--mid .hx-ov-pile__bar > span {
  background: var(--status-warning);
}

.hx-ov-pile--low .hx-ov-pile__bar > span {
  min-width: 3px;
  background: var(--status-error);
}

.hx-ov-pile--stale .hx-ov-pile__bar > span {
  background: var(--status-unknown);
}

.hx-ov-pile--unknown .hx-ov-pile__bar {
  background: repeating-linear-gradient(135deg, var(--color-lane-empty) 0 4px, transparent 4px 8px);
}

.hx-ov-pile__value {
  min-width: 9ch;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-heading);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hx-ov-pile--stale .hx-ov-pile__value {
  color: var(--color-text-muted);
}


.hx-ov-piles__more {
  margin-left: -10px;
}

/* The trend of a pile (pages/overview.js `pileTrend`): a chevron at the end of its row opens, under the row, the line of
   its measurements over the last three weeks (components/sparkline.js). The chevrons have a column of their own on every
   row of the card, so the bars line up. */
.hx-ov-piles--trends > .hx-ov-pile {
  grid-template-columns: minmax(0, 34%) minmax(40px, 1fr) auto 28px;
  row-gap: 6px;
}

.hx-ov-pile__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font: inherit;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
}

.hx-ov-pile__toggle:hover {
  color: var(--color-text);
  background: var(--color-hover);
}

.hx-ov-pile__toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

.hx-ov-pile__toggle > .bi {
  font-size: 13px;
  transition: transform 0.15s ease;
}

.hx-ov-pile__toggle[aria-expanded='true'] > .bi {
  transform: rotate(180deg);
}

/* A finger needs 44px: the chevron's column is that wide, and its target reaches over the gaps above and below the row
   (not sideways, where the quantity has its own click). */
@media (pointer: coarse) {
  .hx-ov-piles--trends > .hx-ov-pile {
    grid-template-columns: minmax(0, 34%) minmax(40px, 1fr) auto 44px;
    column-gap: 6px;
  }

  .hx-ov-pile__toggle {
    position: relative;
    width: 44px;
    height: 32px;
  }

  .hx-ov-pile__toggle::after {
    position: absolute;
    inset: -6px 0;
    content: '';
  }
}

/* Under the row, across it: the line alone, no axis. */
.hx-ov-pile__trend {
  display: block;
  grid-column: 1 / -1;
  min-width: 0;
}

.hx-ov-pile__trend[hidden] {
  display: none;
}

.hx-hl-spark.hx-ov-pile__spark,
.hx-ov-pile__trend-skeleton {
  display: block;
  width: 100%;
  height: 36px;
}

/* A chart whose points open something on a click (components/sparkline.js `onPick`). */
.hx-hl-spark--picks {
  cursor: pointer;
}

.hx-ov-pile__trend-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-height: 36px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

/* The caption of the card, with "Show charts" at its right: at the bottom of the card, also when a card beside it is taller. */
.hx-ov-card > .hx-ov-summary {
  flex-grow: 1;
}

.hx-ov-summary__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: auto;
}

.hx-ov-summary__expand {
  margin-right: -10px;
  margin-left: auto;
}

/* A pile's name, bar and quantity open the 3D viewer: buttons that look like the text and bar they are. */
button.hx-ov-pile__name,
button.hx-ov-pile__bar,
button.hx-ov-pile__value {
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  border: 0;
}

button.hx-ov-pile__name,
button.hx-ov-pile__value {
  background: none;
}

button.hx-ov-pile__name {
  text-align: left;
}

button.hx-ov-pile__bar {
  display: block;
  width: 100%;
}

button.hx-ov-pile__name:hover,
button.hx-ov-pile__value:hover {
  color: var(--color-accent-text);
  text-decoration: underline;
}

button.hx-ov-pile__bar:hover {
  box-shadow: 0 0 0 2px var(--color-accent);
}

/* For who may edit, the material opens "Edit pile" (components/pile-naming.js), as the name does. */
button.hx-ov-pile__material {
  display: block;
  max-width: 100%;
  padding: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
}

button.hx-ov-pile__material:hover {
  color: var(--color-accent-text);
  text-decoration: underline;
}

button.hx-ov-pile__material:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

button.hx-ov-pile__name:focus-visible,
button.hx-ov-pile__bar:focus-visible,
button.hx-ov-pile__value:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-ov-summary__total {
  font-variant-numeric: tabular-nums;
}

.hx-ov-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 16px;
}

.hx-ov-empty__actions {
  justify-content: center;
}

@media (max-width: 719.98px) {
  .hx-ov-search {
    width: 100%;
  }

  .hx-ov-group__head {
    font-size: 17px;
  }

  .hx-ov-groups {
    gap: 24px;
  }

  .hx-ov-toolbar {
    margin-bottom: -12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-ov-group__toggle > .bi,
  .hx-ov-pile__toggle > .bi {
    transition: none;
  }
}

/* ============================================================ Inventory tab (pages/site/inventory.js, components/trend-chart.js) */

/* Every class of this block starts with "hx-inv-". */

.hx-inv {
  gap: 24px;
}

/* The state of the tab takes no room while it says nothing. */
.hx-inv-state:empty {
  display: none;
}

.hx-inv [hidden] {
  display: none !important;
}

/* ---- list head: Piles | Materials in place of the title (the title stays for screen readers) with the count and
   Refresh, then the time of the list (look-back, "As of", "Now"), then sort and the buttons of the list */

.hx-inv-piles .nx-section__heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Piles | Materials: both sides as wide (on a phone, the whole width of its line: below). */
.hx-inv-grouping .segmented {
  display: inline-grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
}

.hx-inv-piles > .nx-section__head {
  flex-direction: column;
  align-items: flex-start;
}

.hx-inv-time {
  --field-fill: var(--color-bg);
}

/* Refresh beside the title of the list: the icon alone, no border. */
.hx-inv-refresh.btn {
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 16px;
  color: var(--color-text-muted);
  letter-spacing: 0;
}

/* The count of the list: as wide as two digits, so the dash it shows before the piles are in (muted) and any number
   under 100 take the same room. */
.hx-inv-piles .nx-section__count {
  box-sizing: border-box;
  min-width: 38px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.hx-inv-piles .nx-section__count.is-placeholder {
  color: var(--color-text-muted);
}

/* Loading: the spinner the size of the icon, so the button keeps its size. */
.hx-inv-refresh .spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.hx-inv-refresh.btn:hover {
  color: var(--color-heading);
}

/* ---- list head: sort and the buttons of the list */

/* "Expand all", "Expand details" and "Export": one group. It takes the room left on its line, so where it wraps to a
   line of its own (the head is as wide as its contents until it wraps) its buttons share the whole width. */
.hx-inv-list-actions {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.hx-inv .nx-section__actions .hx-inv-list-actions .btn {
  flex: 1 1 auto;
}

.hx-inv-sort {
  width: 170px;
  --field-fill: var(--color-bg);
}

.hx-inv-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--color-text);
  background: color-mix(in srgb, var(--status-warning) 14%, transparent);
  border-radius: 10px;
}

/* ---- rows */

.hx-inv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hx-inv-row {
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.hx-inv-row.is-open {
  border-color: var(--color-accent);
  box-shadow: var(--shadow);
}

/*
 * The head of a row opens it. It holds a level bar (role="meter"), which may not be inside a
 * <button>: the button is an empty element stretched over the head, under its cells.
 */
.hx-inv-row__head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(140px, 1.4fr) minmax(130px, 0.8fr) minmax(170px, 1.2fr) 20px;
  gap: 8px 20px;
  align-items: center;
  min-height: 72px;
  padding: 14px 18px;
  text-align: left;
  cursor: pointer;
}

.hx-inv-row__head:hover {
  background: var(--color-accent-hover);
}

.hx-inv-row__head > :not(.hx-inv-row__toggle) {
  position: relative;
}

.hx-inv-row__toggle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
}

.hx-inv-row__toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
  border-radius: var(--radius-card);
}

.hx-inv-row__name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.hx-inv-row__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

/* "Edit pile" (components/pile-naming.js): the material, and beside it the pencil that opens "Edit material". */
.hx-pile-naming__material {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.hx-pile-naming__material > .field-group {
  flex: 1 1 auto;
  min-width: 0;
}

.hx-pile-naming__edit {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: 4px;
  padding: 0;
  font-size: 16px;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control, 6px);
}

.hx-pile-naming__edit:hover:not(:disabled) {
  color: var(--color-accent-text);
  background: var(--color-accent-hover);
}

.hx-pile-naming__edit:disabled {
  cursor: default;
  opacity: 0.45;
}

.hx-pile-naming__edit:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

/* Its API key (an administrator): the key itself, to be selected whole. */
.hx-pile-naming__key-value {
  font-size: 13px;
  user-select: all;
  overflow-wrap: anywhere;
}

/* Its maximum volume, and under it the ft³ that is stored (and why tons are not offered). */
.hx-pile-naming__capacity {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hx-pile-naming__hint {
  font-variant-numeric: tabular-nums;
}

/* The pencil beside the name of a pile: "Edit pile" (components/pile-naming.js). A button over the toggle of the row. */
.hx-inv-row__edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: -4px 0 -4px 4px;
  font-size: 14px;
  vertical-align: middle;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: var(--radius-control, 6px);
}

.hx-inv-row__edit:hover {
  color: var(--color-accent-text);
  background: var(--color-accent-hover);
}

.hx-inv-row__edit:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

.hx-inv-row__sub {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.hx-inv-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border: 1px solid var(--color-text-muted);
  border-radius: 50%;
}

.hx-inv-dot--none {
  border-style: dashed;
}

.hx-inv-row__level {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hx-inv-row__level .hx-level {
  height: 10px;
}

.hx-inv-row__percent {
  font-size: 12px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* A stale or missing measurement: the fill is grey, whatever the level. */
.hx-inv-level--stale .hx-level__fill {
  background: var(--status-unknown);
}

.hx-inv-value {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hx-inv-value__number {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-inv-value--none .hx-inv-value__number {
  color: var(--color-text-muted);
}

.hx-inv-value__unit {
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-inv-row__status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

/* When the pile was measured, and "Scan now" beside it (pages/site/inventory.js `rowScan`). */
.hx-inv-row__measured {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}

.hx-inv-row__measured > .hx-scan-pill {
  margin: 0;
}

/* The red triangle of a pile with stale data or none (components/contact-dialog.js `staleAlert`), beside when it was measured. */
.hx-inv-row__measured > .hx-ct-alertbtn {
  width: 22px;
  height: 22px;
  font-size: 13px;
}

/* The quiet pill of a scan on demand: "Scan now" beside when a pile was measured (Inventory tab), "Scan site" on a site
   card and "Scan now" in the history of a pile (Sites page). Not a toolbar button. */
.hx-scan-pill {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 1px 9px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-accent-text);
  cursor: pointer;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 999px;
}

.hx-scan-pill:hover {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  border-color: var(--color-accent);
}

.hx-scan-pill:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-scan-pill:disabled {
  color: var(--color-text-muted);
  cursor: default;
  background: none;
  border-color: var(--color-border);
  opacity: 0.7;
}

.hx-inv-when {
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-inv-row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hx-inv-row__tags:empty {
  display: none;
}

/* A long tag ("Scan requested · ETA 2:15 PM") wraps inside its column. */
.hx-inv-row__tags .tag {
  white-space: normal;
}

.hx-inv-row__chevron {
  justify-self: end;
  color: var(--color-text-muted);
}

/* ---- the open part of a row */

.hx-inv-row__detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--color-border);
}

.hx-inv-detail__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
}

.hx-inv-detail__body--wide {
  grid-template-columns: minmax(0, 1fr);
}

.hx-inv-detail__chart {
  min-width: 0;
}

.hx-inv-chart {
  position: relative;
  height: 220px;
}

.hx-inv-chart__canvas,
.hx-inv-chart__state {
  position: absolute;
  inset: 0;
}

.hx-inv-chart__state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
}

.hx-inv-thumb {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
  font-size: 12px;
}

/* A frame of a fixed size: pictures and the "no picture" state swap inside it, so the row never jumps. */
.hx-inv-thumb__frame {
  position: relative;
  height: 196px;
}

.hx-inv-thumb__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
}

/* As the classic dark mode shows its boundary renders (css/dark-mode.css, .pcd-boundary-thumb): the white render blends into the dark card. */
:root[data-theme='dark'] .hx-inv-thumb__image {
  background: transparent;
  mix-blend-mode: screen;
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .hx-inv-thumb__image {
    background: transparent;
    mix-blend-mode: screen;
    filter: invert(1);
  }
}

.hx-inv-thumb__image[hidden],
.hx-inv-thumb__none[hidden] {
  display: none;
}

.hx-inv-thumb__none {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  margin: 0;
  text-align: center;
  border: 1px dashed var(--color-border);
  border-radius: 10px;
}

/* Room for two lines, so a longer caption does not move what is below. */
.hx-inv-thumb__caption {
  min-height: 2.7em;
  line-height: 1.35;
}

.hx-inv-ledger tr.is-hovered > td {
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
}

.hx-inv-detail__state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  text-align: center;
}

.hx-inv-detail__ledger {
  position: relative;
  min-width: 0;
  overflow-x: auto;
}

.hx-inv-detail__title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* The recent measurements of an open row are folded: the title is what unfolds them. */
.hx-inv-detail__fold {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  margin: 0;
  list-style: none;
  cursor: pointer;
  border-radius: 6px;
}

.hx-inv-detail__fold::-webkit-details-marker {
  display: none;
}

.hx-inv-detail__fold:hover {
  color: var(--color-heading);
}

.hx-inv-detail__fold:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-inv-detail__fold .bi {
  transition: transform 0.15s ease;
}

.hx-inv-detail__ledger[open] > .hx-inv-detail__fold {
  margin-bottom: 6px;
}

.hx-inv-detail__ledger[open] > .hx-inv-detail__fold .bi {
  transform: rotate(90deg);
}

.hx-inv-detail__note {
  margin: 0;
  font-size: 13px;
}

.hx-inv-ledger {
  width: 100%;
}

.hx-inv-ledger td,
.hx-inv-ledger th {
  white-space: nowrap;
}

.hx-inv-ledger__action {
  width: 1%;
  text-align: right;
}

.hx-inv-change--up {
  color: var(--status-ok);
}

/* Piles inside an open material row. */
.hx-inv-subs {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hx-inv-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 12px 0;
  border-top: 1px solid var(--color-border);
}

.hx-inv-sub__main {
  display: grid;
  flex: 1 1 560px;
  grid-template-columns: minmax(110px, 1fr) minmax(120px, 1.2fr) minmax(110px, auto) minmax(150px, 1fr);
  gap: 8px 16px;
  align-items: center;
  min-width: 0;
}

.hx-inv-sub .hx-inv-row__title {
  font-size: 15px;
}

.hx-inv-sub .hx-inv-value__number {
  font-size: 17px;
}

/* ---- loading placeholders */

/* The shimmer itself is shared with `.hx-skeleton__line` (see "2. Page states"). */
.hx-inv-skeleton {
  border-radius: 8px;
}

.hx-inv-skeleton--title {
  width: 55%;
  height: 18px;
}

.hx-inv-skeleton--bar {
  width: 100%;
  height: 10px;
}

.hx-inv-skeleton--value {
  width: 90px;
  height: 22px;
  justify-self: end;
}

.hx-inv-skeleton--chart,
.hx-inv-skeleton--thumb {
  height: 220px;
}

.hx-inv-row--skeleton {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1fr;
  gap: 20px;
  align-items: center;
  min-height: 72px;
  padding: 14px 18px;
}

@media (max-width: 959.98px) {
  .hx-inv-row__head {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) auto 20px;
  }

  .hx-inv-row__head > .hx-inv-row__status {
    grid-row: 2;
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
  }
}

@media (max-width: 719.98px) {
  .hx-inv {
    gap: 20px;
  }

  /* Piles | Materials the whole width of its line, before the count and Refresh. */
  .hx-inv-piles .nx-section__heading {
    align-self: stretch;
  }

  .hx-inv-grouping {
    flex: 1 1 auto;
    min-width: 0;
  }

  .hx-inv-grouping .segmented {
    display: grid;
    width: 100%;
  }

  .hx-inv .nx-section__actions,
  .hx-inv-time {
    width: 100%;
  }

  .hx-inv .nx-section__actions .btn {
    flex: none;
  }

  .hx-inv-ledger td,
  .hx-inv-ledger th {
    padding-right: 6px;
    padding-left: 6px;
  }

  .hx-inv-ledger td:first-child {
    white-space: normal;
  }

  .hx-inv-sort {
    flex: 1 1 140px;
    width: auto;
  }

  .hx-inv-row__head {
    grid-template-columns: minmax(0, 1fr) auto 20px;
    gap: 10px 12px;
    padding: 12px 14px;
  }

  .hx-inv-row__head > .hx-inv-row__level {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .hx-inv-row__head > .hx-inv-row__status {
    grid-row: 3;
  }

  .hx-inv-row__detail {
    padding: 14px;
  }

  .hx-inv-detail__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .hx-inv-chart {
    height: 190px;
  }

  .hx-inv-thumb__frame {
    height: 160px;
  }

  .hx-inv-actions .btn {
    flex: 1 1 auto;
  }

  .hx-inv-sub__main {
    flex-basis: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hx-inv-sub__main > .hx-inv-row__level,
  .hx-inv-sub__main > .hx-inv-row__status {
    grid-column: 1 / -1;
  }

  .hx-inv-row--skeleton {
    grid-template-columns: 1fr auto;
  }

  .hx-inv-row--skeleton .hx-inv-skeleton--bar {
    grid-row: 2;
    grid-column: 1 / -1;
  }
}
/* ============================================================ end of the Inventory tab */

/* ---------------------------------------------------------------------------
   My sites: the star on a site card and the checklist dialog (pages/overview.js)
   --------------------------------------------------------------------------- */
/* The name of the site with the alert of its stale piles beside it (components/contact-dialog.js `staleSiteAlert`); the star keeps its room at the right. */
.hx-ov-card__head {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding-right: 36px;
}

.hx-ov-card__alert {
  display: inline-flex;
  flex: none;
}

.hx-ov-card__alert:empty {
  display: none;
}

.hx-ov-card__star {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 18px;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 50%;
}

.hx-ov-card__star:hover {
  color: var(--color-heading);
  background: var(--color-accent-hover);
}

.hx-ov-card__star.is-on {
  color: var(--status-warning);
}

.hx-mine {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hx-mine__lead,
.hx-mine__count,
.hx-mine__none {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-mine__search {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
}

.hx-mine__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.hx-mine__count {
  flex: 1;
  min-width: 12ch;
}

/* "Select all" and "Clear all" of one part, above its sites. */
/* "Select all" and "Clear all" for every site, beside the count. */
.hx-mine__every {
  display: flex;
  gap: 8px;
}

.hx-mine__part-tools {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 4px 8px 0;
}

.hx-mine__list {
  max-height: min(50vh, 420px);
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-field);
}

.hx-mine__none {
  padding: 16px;
}

/* The two parts of the list (with scanners, without): the kit's expander, its heading stuck to the
   top of the list while its sites scroll. */
.hx-mine__part + .hx-mine__part {
  border-top: 1px solid var(--color-border);
}

.hx-mine__part > summary {
  position: sticky;
  top: 0;
  z-index: 2;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 14px;
  background: var(--color-surface);
}

.hx-mine__part[open] > summary {
  border-bottom: 1px solid var(--color-border);
}

.hx-mine__part-title {
  flex: 1;
}

.hx-mine__tally {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.hx-mine__part .hx-mine__client {
  top: 44px;
}

/* The client's row is a checkbox row too: its tick is every site of the client that is shown.
   The box sits in the column of the sites' boxes; the band and the small capitals say it is the group's. */
.hx-mine__client {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 36px;
  padding: 4px 8px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--color-surface-sunken);
}

/* Sticky over the rows that scroll under it: the hover of a row must not make it see-through. */
.hx-mine__client:hover {
  color: var(--color-text);
  background: var(--color-surface-sunken);
}

@media (max-width: 599.98px) {
  .hx-mine__list {
    max-height: none;
  }
}

/* ---------------------------------------------------------------------------
   The history of a pile, in a dialog (components/pile-history.js; the trend and the
   picture are those of the Inventory tab, components/pile-trend.js)
   --------------------------------------------------------------------------- */
.hx-pile-history {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hx-pile-history__top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  justify-content: space-between;
}

.hx-pile-history__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

/* When the pile was measured, with "Scan now" beside it: they stay together, and take a line of their own on a phone. */
.hx-pile-history__measured {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
}

@media (max-width: 719.98px) {
  .hx-pile-history__measured {
    flex: 1 1 100%;
  }
}

.hx-pile-history__material {
  font-weight: 600;
  color: var(--color-heading);
}

.hx-pile-history__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.hx-pile-history__range {
  min-width: 150px;
}

/* "View 3D" is as tall as the look-back field beside it. */
.hx-pile-history__tools > .btn {
  align-self: stretch;
  min-height: 40px;
}

/* The room of the trend and the picture, so the dialog keeps its height while a history loads. */
.hx-pile-history__view {
  min-height: 252px;
}

@media (max-width: 719.98px) {
  .hx-pile-history__tools {
    flex: 1 1 100%;
  }

  .hx-pile-history__range {
    flex: 1 1 auto;
  }

  .hx-pile-history__view {
    min-height: 0;
  }
}

/* A card with all its piles unfolded: it lies over the cards below; the others keep their place and size. */
.hx-ov-card.is-unfolded {
  z-index: 5;
  align-self: start;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-lg);
}

.hx-ov-card.is-unfolded:hover {
  transform: none;
}

/* ============================================================ Map page (pages/map.js) */

/* The map fills the main area, edge to edge; the controls and the card lie over it. */
.hx-map {
  --hx-map-sheet: 0px;

  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--color-bg);
}

/* The map as the Map tab of a site (pages/site/map.js): under the tabs (the open events are hidden), down to the bottom of the
   main area (which ends above the bottom bar of a phone), and never lower than 420px; the page scrolls then. The parts
   above it keep their height. */
.nx-page:has(> .hx-tab > .hx-map--tab) {
  display: flex;
  flex-direction: column;
}

.nx-page:has(> .hx-tab > .hx-map--tab) > * {
  flex-shrink: 0;
}

.nx-page > .hx-tab:has(> .hx-map--tab) {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}

/* The open events of the site are not shown over the Map tab (pages/site.js). */
.nx-page--map > .hx-site-events {
  display: none;
}

.hx-map.hx-map--tab {
  flex: 1 0 auto;
  height: auto;
  min-height: 420px;
}

.hx-map__canvas {
  position: absolute;
  inset: 0;
}

.hx-map__canvas:focus {
  outline: none;
}

.hx-map__google {
  width: 100%;
  height: 100%;
}

/* Until the first tiles are drawn: the shimmer of the other placeholders, over the whole map. */
.hx-map__loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  background: linear-gradient(90deg, var(--color-skeleton) 25%, var(--color-skeleton-highlight) 50%, var(--color-skeleton) 75%);
  background-size: 200% 100%;
  animation: hx-shimmer 1.4s linear infinite;
}

.hx-map__state {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  background: var(--color-bg);
}

.hx-map__loading[hidden],
.hx-map__state[hidden],
.hx-map__bar[hidden],
.hx-map__notice[hidden],
.hx-map-card[hidden],
.hx-map-picker__list[hidden] {
  display: none;
}

/* The controls: the site picker and the buttons, in a row at the top. Google's own are at the bottom. */
.hx-map__bar {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  pointer-events: none;
}

.hx-map__bar > * {
  pointer-events: auto;
}

.hx-map-picker {
  position: relative;
  flex: 0 1 320px;
  min-width: 0;
}

.hx-map-picker .field__input {
  box-shadow: var(--shadow-raised);
}

.hx-map-picker__list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: min(50vh, 420px);
  padding: 6px 0;
  margin: 0;
  overflow: auto;
  list-style: none;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-menu);
  box-shadow: var(--shadow-raised);
}

.hx-map-picker__option {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  padding: 6px 14px;
  cursor: pointer;
}

.hx-map-picker__option:hover,
.hx-map-picker__option.is-active {
  background: var(--color-row-hover);
}

.hx-map-picker__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-heading);
}

.hx-map-picker__meta,
.hx-map-picker__more {
  font-size: 12px;
  line-height: 1.3;
  color: var(--color-text-muted);
}

.hx-map-picker__more {
  padding: 8px 14px;
}

/* An outline button on the map: opaque, so the map does not show through it. */
.btn.hx-map__tool {
  flex: none;
  min-height: 40px;
  background: var(--color-surface);
  box-shadow: var(--shadow-raised);
}

.btn.hx-map__tool:hover,
.btn.hx-map__tool.is-open {
  background: color-mix(in srgb, var(--color-heading) 8%, var(--color-surface));
}

.hx-map__edit {
  margin-left: auto;
}

.hx-map-layers .switch-row {
  padding-right: 0;
  padding-left: 0;
}

/* "Imagery" of the Layers menu (map-imagery.js): the source, and for an earlier release its day. */
.hx-map-layers__imagery[hidden],
.hx-map-imagery__earlier[hidden],
.hx-map-imagery__status[hidden],
.hx-map-imagery__note[hidden] {
  display: none;
}

.hx-map-imagery__earlier {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.hx-map-imagery__status {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--color-text-muted);
}

.hx-map-imagery__status > .btn {
  flex: none;
  margin-left: auto;
}

.hx-map-imagery__releases {
  display: grid;
  gap: 4px;
}

.hx-map-imagery__releases .checkbox-row {
  padding-right: 0;
  padding-left: 0;
}

.hx-map-imagery__releases:empty {
  display: none;
}

.hx-map-imagery__note {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-text-muted);
}

/* The credits of pictures that are not Google's: above Google's own line, to the left of the zoom buttons.
   Dark on light whatever the theme, as Google's line is. */
.hx-map-credits {
  position: absolute;
  right: 60px;
  bottom: 18px;
  z-index: 1;
  max-width: calc(100% - 68px);
  padding: 1px 6px;
  pointer-events: none;
  font-size: 10px;
  line-height: 14px;
  color: #1f1f1f;
  text-align: right;
  background: rgb(255 255 255 / 75%);
}

.hx-map-credits[hidden] {
  display: none;
}

/* What could not be loaded, said at the bottom of the map, above Google's credits. */
.hx-map__notice {
  position: absolute;
  bottom: calc(var(--hx-map-sheet) + 32px);
  left: 50%;
  z-index: 3;
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: calc(100% - 24px);
  padding: 6px 8px 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-menu);
  box-shadow: var(--shadow-raised);
  transform: translateX(-50%);
}

.hx-map__notice > .bi {
  color: var(--color-warning-text);
}

/* ---- Pins and shapes on the map. They lie on satellite pictures: white edges and a shadow, whatever the theme. */

/* A site: a dot centred on its position (the transform), in a 40px touch target; its name beside it when there is room. */
.hx-map-pin {
  --hx-pin-color: var(--purple);

  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transform: translateY(50%);
}

.hx-map-pin__dot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: 13px;
  line-height: 1;
  color: #FFFFFF;
  background: var(--hx-pin-color);
  border: 2.5px solid #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* The warning yellow is too light for a white icon. */
.hx-map-pin--warning .hx-map-pin__dot {
  color: var(--navy-900);
}

.hx-map-pin:hover .hx-map-pin__dot,
.hx-map-pin.is-selected .hx-map-pin__dot {
  width: 32px;
  height: 32px;
  font-size: 15px;
}

/* A service visit is planned for the site: a green ring around the pin (the badge of a scanner says the same). */
.hx-map-pin--planned .hx-map-pin__dot {
  box-shadow: 0 0 0 3px var(--status-ok), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.hx-map-pin.is-selected .hx-map-pin__dot {
  box-shadow: 0 0 0 3px var(--yellow), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.hx-map-pin--planned.is-selected .hx-map-pin__dot {
  box-shadow: 0 0 0 3px var(--yellow), 0 0 0 6px var(--status-ok), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.hx-map-pin__label {
  position: absolute;
  top: 50%;
  left: calc(50% + 15px);
  max-width: 220px;
  padding: 3px 9px;
  overflow: hidden;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: #FFFFFF;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  background: rgba(17, 31, 53, 0.86);
  border-radius: var(--radius-pill);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.15s ease;
}

.hx-map-pin__label.is-shown {
  opacity: 1;
}

/* Where the map ends on the right, the name is on the left of the dot. */
.hx-map-pin__label.is-left {
  right: calc(50% + 15px);
  left: auto;
}

/* A scanner, a solar panel, a battery, a Wi-Fi bridge: a small square badge in a 40px touch target. */
.hx-map-device {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transform: translateY(50%);
}

.hx-map-device__dot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: 14px;
  line-height: 1;
  color: var(--navy-900);
  background: #FFFFFF;
  border: 2px solid var(--navy-900);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.hx-map-device--scanner .hx-map-device__dot {
  width: 30px;
  height: 30px;
  font-size: 16px;
  color: #FFFFFF;
  background: var(--navy);
  border-color: #FFFFFF;
}

.hx-map-device--solar .hx-map-device__dot,
.hx-map-device--battery .hx-map-device__dot {
  background: var(--yellow);
}

.hx-map-device.is-selected .hx-map-device__dot {
  box-shadow: 0 0 0 3px var(--yellow), 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* The open events of the device: a dot of the level of the worst at the corner (pages/map.js `eventBadge`).
   More than one: their count in it. A visit planned for the worst: a green ring around it. */
.hx-map-device__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  pointer-events: none;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
}

.hx-map-device__badge--count {
  top: -2px;
  right: -2px;
  display: grid;
  place-items: center;
  width: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 3px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #FFFFFF;
  border-radius: 9px;
}

/* Yellow takes dark figures. */
.hx-map-device__badge--count.hx-map-device__badge--warning {
  color: var(--navy-900);
}

.hx-map-device__badge--planned {
  box-shadow: 0 0 0 2px var(--status-ok);
}

/* What is mounted with a scanner: the sun at the top left, the battery and the Wi-Fi at the bottom
   corners (the top right is the event's). They take no taps: the marker under them does. */
.hx-map-device__part {
  position: absolute;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  font-size: 10px;
  line-height: 1;
  color: var(--navy-900);
  pointer-events: none;
  background: #FFFFFF;
  border: 1px solid var(--navy-900);
  border-radius: 50%;
}

.hx-map-device__part--solar {
  top: 0;
  left: 0;
  background: var(--yellow);
}

.hx-map-device__part--battery {
  bottom: 0;
  left: 0;
  background: var(--yellow);
}

.hx-map-device__part--wifi {
  right: 0;
  bottom: 0;
}

/* The height of the pole, under the scanner. */
.hx-map-device__pole {
  position: absolute;
  top: calc(100% - 3px);
  left: 50%;
  padding: 0 5px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  color: var(--navy-900);
  white-space: nowrap;
  pointer-events: none;
  background: #FFFFFF;
  border: 1px solid var(--navy-900);
  border-radius: 8px;
  transform: translateX(-50%);
}

/* Where a scanner's GPS says it is (the layer "Scanner GPS positions"): a small round dot with a crosshair in a
   40px touch target, its name beside it (the label of a site pin); round and sky blue, not the square of a placed scanner. */
.hx-map-gps {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transform: translateY(50%);
}

.hx-map-gps__dot {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 12px;
  line-height: 1;
  color: #FFFFFF;
  background: #0284C7;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.hx-map-gps .hx-map-pin__label {
  left: calc(50% + 12px);
  font-size: 11px;
}

.hx-map-gps:hover .hx-map-gps__dot,
.hx-map-gps.is-selected .hx-map-gps__dot {
  width: 24px;
  height: 24px;
}

.hx-map-gps.is-selected .hx-map-gps__dot {
  box-shadow: 0 0 0 3px var(--yellow), 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* ---- The card of what was chosen on the map: a panel on a wide window, a sheet at the bottom on a phone. */
.hx-map-card {
  position: absolute;
  top: 64px;
  left: 12px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  width: 360px;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 64px - 36px);
  overflow: hidden;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
}

/* Just opened (pages/map.js `openCard`): the tap that opened it must not press one of its buttons. */
.hx-map-card.is-settling > * {
  pointer-events: none;
}

.hx-map-card__head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px 8px 0 16px;
}

.hx-map-card__heading {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.hx-map-card__eyebrow {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-accent-text);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.hx-map-card__title {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-map-card__title:focus {
  outline: none;
}

.hx-map-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 6px 16px 14px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-text);
}

.hx-map-card__muted {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* On the card of a GPS fix of a scanner with no location on the map: whether to add one there (pages/map.js). */
.hx-map-card__offer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--color-accent-tint);
  color: var(--color-text);
  font-size: 13px;
}

.hx-map-card__offer-actions {
  display: flex;
  gap: 8px;
}

/* On the card of a pile shown by its generated outline: that it is generated (pages/map.js). */
.hx-map-card__notice {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--color-accent-tint);
  color: var(--color-text);
  font-size: 13px;
}

.hx-map-card__notice > .bi {
  flex: none;
  color: var(--color-accent-text);
}

/* The action of the notice, on a line of its own under the text. */
.hx-map-card__notice-action {
  display: flex;
  margin-top: 8px;
}

/* A pill on a line of its own at the bottom of what a card says ("Use generated outline"). */
.hx-map-card__pill-row {
  display: flex;
}

/* A pill that takes something away ("Delete generated outline"). */
.hx-scan-pill--danger {
  color: var(--color-error-text);
  border-color: color-mix(in srgb, var(--color-error-text) 45%, transparent);
}

.hx-scan-pill--danger:hover {
  background: var(--color-error-tint);
  border-color: var(--color-error-text);
}

.hx-map-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hx-map-card__event {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
}

.hx-map-card__event > .bi {
  flex: none;
  color: var(--hx-event-color, var(--color-text-muted));
}

/* A line that opens its event (pages/map.js `eventLine`, for who has the Service page): a button that looks like the
   line, with the row hover of the page. */
.hx-map-card__event--opens {
  width: calc(100% + 12px);
  margin: 0 -6px;
  padding: 4px 6px;
  font: inherit;
  font-size: 13px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
}

.hx-map-card__event--opens:hover {
  background: var(--color-row-hover);
}

.hx-map-card__event--opens:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-map-card__event--opens[aria-busy='true'] {
  cursor: progress;
}

.hx-map-card__event > .spinner {
  flex: none;
  align-self: center;
}

/* Under an event on the card of a device: how far a visit is planned, and the event it is part of. */
.hx-map-card__event-meta {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-map-card__summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hx-map-card__summary:empty {
  display: none;
}

.hx-map-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-heading);
}

.hx-map-card__total {
  font-variant-numeric: tabular-nums;
}

.hx-map-card__material {
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-map-card__amount {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.hx-map-card__amount > strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-map-card__actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
}

.hx-map-card__actions:empty {
  display: none;
}

/* The card of a scanner from the Devices tab, in the card of its marker (pages/map.js `selectDevice`,
   site/devices.js `mountScannerCard`): the map's card is its frame and its title is its name. */
.hx-map-card__device {
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.hx-map-card__device .hx-device-single {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hx-map-card__device .hx-device {
  gap: 12px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.hx-map-card__device .hx-device__title {
  margin: 0;
}

.hx-map-card__device .hx-device__head {
  min-height: 0;
  padding: 0;
  border-radius: 0;
}

.hx-map-card__device .hx-device__name {
  display: none;
}

.hx-map-card__device .hx-device__body {
  gap: 12px;
}

.hx-map-card__device .hx-device__id {
  margin-top: -6px;
}

/* Two to a row on a phone too: the sheet is short. */
/* When a pile was measured, with "Scan now" beside it (the card of a pile). */
.hx-map-card__measured {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.hx-map-card__device .hx-device__facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

.hx-map-card__device .hx-device__meter {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.hx-map-card__device .hx-device__actions .btn,
.hx-map-card__device .hx-device__pair {
  flex: 1 1 auto;
}

.hx-map-card__device .hx-device-single__state {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-map-card__device .hx-device-single__note {
  margin: 0;
  font-size: 12.5px;
  color: var(--status-warning);
}

/* ---- Edit mode (map-edit.js): a toolbar under the controls, forms in the card, handles on the shapes. */

/* "Edit map" is "Done" while editing: filled, so the mode shows. */
.btn--primary.hx-map__tool,
.btn--primary.hx-map__tool:hover {
  color: var(--color-on-accent);
  background: var(--color-accent);
  border-color: transparent;
}

.btn--primary.hx-map__tool:hover {
  background: var(--color-accent-strong);
}

.hx-map-tools {
  position: absolute;
  top: 60px;
  left: 12px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  width: 600px;
  max-width: calc(100% - 24px);
  overflow: hidden;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-menu);
  box-shadow: var(--shadow-raised);
}

.hx-map-tools__row {
  display: flex;
  gap: 2px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.hx-map-tools__row::-webkit-scrollbar {
  display: none;
}

/* A tool: its icon over its name; the pressed one is the tool in use. */
.hx-map-tool {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 48px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 8px;
}

.hx-map-tool .bi {
  font-size: 18px;
  line-height: 1;
  color: var(--color-heading);
}

.hx-map-tool:hover {
  background: var(--color-hover);
}

.hx-map-tool:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-map-tool[aria-pressed='true'] {
  color: var(--color-on-accent-tint);
  background: var(--color-accent-tint);
}

.hx-map-tool[aria-pressed='true'] .bi {
  color: var(--color-on-accent-tint);
}

.hx-map-tool:disabled {
  cursor: default;
  opacity: 0.5;
}

/* What the tool expects, and the buttons of a drawing. */
.hx-map-tools__hint {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 4px 6px 4px 12px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
}

.hx-map-tools__text {
  flex: 1 1 200px;
  max-width: 420px;
}

.hx-map-tools__actions {
  display: flex;
  flex: none;
  gap: 2px;
  margin-left: auto;
}

.hx-map-tools__actions:empty {
  display: none;
}

.hx-map-tools__actions .btn {
  min-height: 36px;
}

/* On a wide window the card is under the toolbar. */
.hx-map.is-editing .hx-map-card {
  top: calc(68px + var(--hx-map-tools, 96px));
  max-height: calc(100% - 68px - var(--hx-map-tools, 96px) - 36px);
}

.hx-map-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 6px;
}

.hx-map-form__switches .switch-row {
  padding-right: 0;
  padding-left: 0;
}

.hx-map-form__key {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  align-items: center;
  font-size: 13px;
}

.hx-map-form__label {
  font-weight: 600;
  color: var(--color-text-muted);
}

.hx-map-form__link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--color-accent-text);
  overflow-wrap: anywhere;
}

.hx-map-form__key-actions {
  display: flex;
  margin-left: auto;
}

.hx-map-form__key-actions [hidden] {
  display: none;
}

/* A marker that is not saved yet: a dashed yellow ring. */
.hx-map-pin.is-draft .hx-map-pin__dot,
.hx-map-device.is-draft .hx-map-device__dot {
  outline: 2px dashed var(--yellow);
  outline-offset: 3px;
}

/* In edit mode pins and markers can be dragged. */
.hx-map.is-editing .hx-map-pin,
.hx-map.is-editing .hx-map-device {
  cursor: grab;
}

/* A point of a shape that is drawn or reshaped (components/map-draw.js): a dot in a target that is
   larger than it, centred on the point. The target is 40px for a finger (below) and smaller for a
   mouse, so the handles of a small shape do not lie on each other. */
.hx-map-vertex {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  cursor: grab;
  touch-action: none;
  transform: translateY(50%);
}

.hx-map-vertex > span {
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border: 3px solid var(--navy-900);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.hx-map-vertex.is-selected > span {
  width: 18px;
  height: 18px;
  background: var(--yellow);
}

/* While drawing: the point a tap on finishes the shape. */
.hx-map-vertex--finish {
  cursor: pointer;
}

.hx-map-vertex--finish > span {
  width: 20px;
  height: 20px;
  background: var(--purple);
  border-color: #FFFFFF;
}

/* The middle of a segment: dragged, it becomes a point. Its target is the smaller one, and on top. */
.hx-map-vertex--middle {
  width: 18px;
  height: 18px;
}

.hx-map-vertex--middle > span {
  width: 10px;
  height: 10px;
  border-width: 2px;
  opacity: 0.8;
}

/* ---- Measuring (map-measure.js): its panel is the card, with the numbers in lines; lengths on the segments. */

/* No "Measure" in edit mode: the two are never on together. */
.hx-map.is-editing .hx-map__measure {
  display: none;
}

.hx-map-measure .hx-map-card__head {
  align-items: center;
  padding-right: 12px;
}

.hx-map-measure .hx-map-card__body {
  padding-top: 8px;
}

.hx-map-measure__rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

/* What it is on the left, how much on the right; a line keeps its height when it has no value yet. */
.hx-map-measure__row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  min-height: 22px;
}

.hx-map-measure__row > dt {
  flex: none;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-map-measure__row > dd {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
  margin: 0;
  color: var(--color-heading);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* The same in the next unit, before the value; it gives way where the line is short. */
.hx-map-measure__row > dd > .hx-map-card__muted {
  order: -1;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
}

.hx-map-measure__row > dd > .hx-map-card__muted:empty {
  display: none;
}

.hx-map-measure__row:first-child > dd > strong {
  font-size: 17px;
}

.hx-map-measure__row.is-empty > dd {
  color: var(--color-text-muted);
}

/* The length of a segment, on its middle; a tap on it is a tap on the map. */
.hx-map-measure-label {
  padding: 1px 6px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: #FFFFFF;
  white-space: nowrap;
  pointer-events: none;
  background: rgba(17, 31, 53, 0.86);
  border-radius: 6px;
  transform: translateY(50%);
}

@media (pointer: coarse) {
  .hx-map-vertex {
    width: 40px;
    height: 40px;
  }

  .hx-map-vertex > span {
    width: 18px;
    height: 18px;
  }

  .hx-map-vertex.is-selected > span,
  .hx-map-vertex--finish > span {
    width: 24px;
    height: 24px;
  }

  .hx-map-vertex--middle {
    width: 28px;
    height: 28px;
  }

  .hx-map-vertex--middle > span {
    width: 12px;
    height: 12px;
  }
}

@media (max-width: 719.98px) {
  /* The map ends where the sheet begins, so Google's zoom buttons and credits are never under it. */
  .hx-map__canvas {
    bottom: var(--hx-map-sheet);
  }

  /* Two lines here: above Google's logo, not on it. */
  .hx-map-credits {
    bottom: 32px;
  }

  .hx-map__bar {
    top: 8px;
    right: 8px;
    left: 8px;
    gap: 6px;
  }

  .hx-map-picker {
    flex: 1 1 auto;
  }

  /* The buttons are their icons; their names are in `aria-label`. */
  .btn.hx-map__tool {
    min-width: 40px;
    padding: 0 10px;
  }

  .hx-map__tool .btn__label {
    display: none;
  }

  .hx-map__edit {
    margin-left: 0;
  }

  .hx-map-card {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    max-width: none;
    max-height: 58%;
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
  }

  .hx-map-card__actions > .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }

  /* "Done" keeps its name: the way out of edit mode has to be plain. */
  .hx-map.is-editing .hx-map__edit .btn__label {
    display: inline;
  }

  .hx-map-tools {
    top: 54px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
  }

  .hx-map-tool {
    min-width: 42px;
    padding: 4px 2px;
    font-size: 10px;
  }

  .hx-map-tools__text {
    max-width: none;
  }

  /* The switch of the unit, for a finger. */
  .hx-map-measure__unit .segmented__option {
    min-width: 44px;
    min-height: 40px;
  }

  /* The sheet is at the bottom, as outside edit mode. */
  .hx-map.is-editing .hx-map-card {
    top: auto;
    max-height: 58%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-map__loading {
    animation: none;
  }

  .hx-map-pin__label {
    transition: none;
  }
}

/* ============================================================ Billing page (pages/billing.js, components/invoice-view.js, components/stack-table.js) */

/* Several elements here have a `display` of their own, which would keep a `hidden` one on the page. */
.hx-bill [hidden] {
  display: none !important;
}

.hx-bill-search {
  width: min(240px, 100%);
}

.hx-bill-hero .nx-hero__lead[hidden],
.hx-bill-hero-stats[hidden] {
  display: none;
}

/* The headline is a sum of money: one line as long as there is room, figures of one width. */
.hx-bill-hero .nx-hero__title {
  max-width: none;
  font-variant-numeric: tabular-nums;
}

/* The scope, first in the content, close to the clients it governs. */
.hx-bill-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: -20px;
}

/* On the toolbar: the QuickBooks buttons, which invoices show, and the parent invoices (pages/billing.js).
   On a phone the QuickBooks buttons are one line, the rest the next: the break between them is a row of its own. */
.hx-bill-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* The toolbar stays one line, so the first client starts where it does on the Sites page: where the buttons do not fit
   they are their icons (their names and tooltips stay). */
@media (min-width: 720px) and (max-width: 1199.98px) {
  .hx-bill-tools .btn[data-focus^='quickbooks'] .btn__label {
    display: none;
  }
}

@media (min-width: 720px) and (max-width: 939.98px) {
  .hx-bill-tools .btn[data-focus='parents'] .btn__label {
    display: none;
  }
}

/* "Collapse all" where it is on the Sites page: a line of its own, as tall as the folded "Needs attention" there, and the
   first client as far under it. Without the button (no client can fold) the line is away. */
.hx-bill-list-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 44px;
  margin-bottom: 28px;
}

.hx-bill-list-head:has(> .hx-bill-expand[hidden]) {
  display: none;
}

.hx-bill-expand[hidden] {
  display: none;
}

/* What is on its way, where "Updated" stands in the band: a spinner beside its words. */
.hx-bill-hero .nx-hero__updated .spinner {
  vertical-align: -2px;
}

.hx-bill-break {
  display: none;
}

@media (max-width: 719.98px) {
  /* As far over the clients as My sites | All of the other pages is over their first section (.hx-ov-toolbar). */
  .hx-bill-toolbar,
  .hx-bill-notices {
    margin-bottom: -12px;
  }

  /* The break is a row of its own, so the room between the two lines is twice the gap: 8px, as on the Health page. */
  .hx-bill-tools {
    gap: 4px 8px;
    margin-left: 0;
  }

  /* As far from the first client as on the Sites page, and at the left as it is there. */
  .hx-bill-list-head {
    justify-content: flex-start;
    min-height: 32px;
    margin-bottom: 16px;
  }

  .hx-bill-tools .btn {
    gap: 6px;
    padding-right: 10px;
    padding-left: 10px;
    white-space: nowrap;
  }

  .hx-bill-break {
    display: block;
    flex-basis: 100%;
    height: 0;
  }
}

/* ---- small things: figures, secondary lines, links */

.hx-bill-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.hx-bill-nowrap {
  white-space: nowrap;
}

.hx-bill-muted {
  color: var(--color-text-muted);
}

/* The plans of a scanner (pages/billing.js): a facility-wide plan of the site, then its own, one a line. */
.hx-bill-facilityplan {
  display: block;
}

/*
 * The plan of a scanner with its pencil (pages/billing.js) and the select it becomes in place (editor.scannerPlanInline): one row of
 * the same shape for both, the text where the select goes, then a slot of two buttons (the pencil and a gap; Save and Cancel), so
 * the cell keeps its width and height when it is edited. The pencil is only where the table has columns and the pointer hovers.
 */
.hx-bill-planedit__row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.hx-bill-planedit__text {
  min-width: 0;
}

.hx-bill-plancell .hx-bill-planedit,
.hx-bill-planedit__gap {
  display: none;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.hx-bill-planedit__select {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: 32px;
  padding: 0 6px;
  font: inherit;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.hx-bill-planedit__row .icon-btn {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  font-size: 15px;
}

@container (min-width: 820.02px) {
  /* The columns keep their widths whatever is in them: a select in place does not move them. */
  .hx-bill-scannertable {
    table-layout: fixed;
  }

  .hx-bill-scannertable th:first-child {
    width: 30%;
  }

  /* The Plans table too: the Scanner column keeps its width when its text becomes a select; the Plan column takes the rest. */
  .hx-bill-plantable {
    table-layout: fixed;
  }

  .hx-bill-plantable th:nth-child(2) {
    width: 11%;
  }

  .hx-bill-plantable th:nth-child(3) {
    width: 26%;
  }

  .hx-bill-plantable th:nth-child(4) {
    width: 20%;
  }

  @media (hover: hover) and (pointer: fine) {
    .hx-bill-plancell .hx-bill-planedit,
    .hx-bill-planedit__gap {
      display: inline-flex;
    }

    /*
     * The text where the select goes, as high as it is and as far in as the text of the select (its border and padding: 7px),
     * only as wide as it needs (cut short when there is no room): the pencil right after it, the rest of the row empty. The
     * columns are fixed, so the cell keeps its size all the same.
     */
    .hx-bill-planedit__text {
      flex: 0 1 auto;
      overflow: hidden;
      height: 32px;
      padding: 0 2px 0 7px;
      line-height: 30px;
      white-space: nowrap;
      text-overflow: ellipsis;
      border: 1px solid transparent;
    }

    .hx-bill-planedit__gap {
      flex: 1 0 28px;
    }

    /* One way to change a plan on a desktop: the pencil of the cell. The dialog stays for a phone. */
    .hx-bill-table .hx-bill-actions:has(> .hx-bill-changeplans) {
      display: none;
    }
  }
}

.hx-bill-sub {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.hx-bill-late,
.hx-bill-sub.hx-bill-late {
  color: var(--color-error-text);
}

.hx-bill-link {
  font-weight: 600;
  color: var(--color-accent-text);
  text-decoration: none;
}

.hx-bill-link:hover {
  text-decoration: underline;
}

.hx-bill-link:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.hx-bill-invoice {
  font-variant-numeric: tabular-nums;
}

.hx-bill-hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.hx-bill-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* ---- notices: what did not arrive. As far from the clients as the toolbar is (.hx-bill-toolbar). */

.hx-bill-notices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: -20px;
}

.hx-bill-notices:empty {
  display: none;
}

.hx-bill-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  margin: 0;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-bill-notice > span:not(.spinner) {
  flex: 1 1 220px;
  min-width: 0;
}

.hx-bill-notice--error {
  color: var(--color-error-text);
  background: var(--color-error-tint);
  border-color: transparent;
}

/* ---- loading placeholders (the shimmer is `.hx-skeleton__line`) */

.hx-bill-loading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px;
}

.hx-bill-skeleton {
  height: 14px;
  border-radius: 6px;
}

.hx-bill-skeleton:nth-child(even) {
  width: 72%;
}

.hx-bill-skeleton--title {
  width: 40%;
  height: 28px;
}

.hx-bill-skeleton--block {
  width: 100%;
  height: 140px;
  border-radius: 12px;
}

.hx-bill-skeleton--meta {
  display: inline-block;
  width: 132px;
}

/* The kit's empty state has no padding of its own; here it stands alone in the card. */
.hx-bill-card > .empty-state {
  padding: 40px 24px;
}

.hx-bill-card > .empty-state:has(+ .hx-bill-empty__action) {
  padding-bottom: 16px;
}

.hx-bill-empty__action {
  display: flex;
  justify-content: center;
  padding-bottom: 24px;
}

/* ---- the table (components/stack-table.js): columns where there is room, stacked blocks where not */

.hx-bill-card {
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  container-type: inline-size;
}

.hx-bill-table {
  font-size: 14px;
  border-top: 0;
  border-bottom: 0;
}

.hx-bill-table th,
.hx-bill-table td {
  padding: 10px 14px;
  vertical-align: top;
}

.hx-bill-table thead th {
  white-space: nowrap;
}

.hx-bill-table tbody tr > *,
.hx-bill-table tfoot tr > * {
  border-top: 1px solid var(--color-border);
}

.hx-bill-table td.num,
.hx-bill-table td[data-label='PO'] .hx-bill-table__value,
.hx-bill-table__main .hx-bill-sub,
.hx-bill-group__head td .hx-bill-table__value {
  white-space: nowrap;
}

/* The description of a parent is the one cell of its row that may wrap. */
.hx-bill-group__head td[data-label='Description'] .hx-bill-table__value {
  white-space: normal;
}

.hx-bill-table td.is-blank {
  color: var(--color-text-muted);
}

.hx-bill-table .status-chip {
  white-space: nowrap;
}

.hx-bill-row:hover {
  background: var(--color-row-hover);
}

/* An overdue invoice is marked at the edge of its row. */
.hx-bill-row--overdue > td:first-child {
  box-shadow: inset 3px 0 0 var(--status-error);
}

.hx-bill-table tr.is-inactive td {
  color: var(--color-text-muted);
}

.hx-bill-table__empty td {
  padding: 20px 14px;
  color: var(--color-text-muted);
  text-align: center;
}

/* The row of a group: the parent invoice, and the toggle that folds its invoices away. A press anywhere on the row
   folds or unfolds it (pages/billing.js), as on its name. */
.hx-bill-group__head {
  cursor: pointer;
}

.hx-bill-group__head > * {
  font-weight: 600;
  color: var(--color-heading);
  vertical-align: middle;
  background: var(--color-surface-sunken);
}

.hx-bill-table .hx-bill-group__head > th {
  padding: 4px 6px;
  font-size: 14px;
}

.hx-bill-group__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px 0 8px;
  font: inherit;
  font-weight: 700;
  color: var(--color-heading);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.hx-bill-group__toggle:hover {
  background: var(--color-hover);
}

.hx-bill-group__toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

.hx-bill-group__toggle > .bi,
.hx-bill-site__head > .bi {
  flex: none;
  font-size: 16px;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}

.hx-bill-group__toggle[aria-expanded='false'] > .bi,
.hx-bill-site__head[aria-expanded='false'] > .bi {
  transform: rotate(-90deg);
}

.hx-bill-group__count,
.hx-bill-part__count {
  padding: 1px 9px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-accent-text);
  background: var(--color-accent-tint);
  border-radius: var(--radius-pill);
}

.hx-bill-total > * {
  font-weight: 700;
  color: var(--color-heading);
}

.hx-bill-table .hx-bill-total > * {
  border-top: 2px solid var(--color-border-strong);
}

.hx-bill-total > th {
  text-align: right;
}

@container (max-width: 820px) {
  .hx-bill-table,
  .hx-bill-table tbody,
  .hx-bill-table tfoot,
  .hx-bill-table td,
  .hx-bill-table tbody th,
  .hx-bill-table tfoot th {
    display: block;
  }

  /* The column headings stay for screen readers; every cell names its column itself. */
  .hx-bill-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .hx-bill-table tr {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    border-top: 1px solid var(--color-border);
  }

  .hx-bill-table tbody:first-of-type > tr:first-child {
    border-top: 0;
  }

  /* `.table.` twice over: the rules of the kit that draw a line between rows are as specific as that. */
  .table.hx-bill-table tbody tr > *,
  .table.hx-bill-table tfoot tr > *,
  .table.hx-bill-table tbody tr:first-child > td,
  .table.hx-bill-table .hx-bill-total > * {
    padding: 2px 0;
    border-top: 0;
  }

  .hx-bill-table td {
    display: grid;
    grid-template-columns: minmax(84px, auto) minmax(0, 1fr);
    gap: 12px;
    align-items: baseline;
    text-align: right;
    white-space: normal;
  }

  .hx-bill-table td::before {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-align: left;
    content: attr(data-label);
  }

  /* A value that is not there takes no line. */
  .hx-bill-table td.is-blank {
    display: none;
  }

  /* The cell that heads the block: no label, first, larger. */
  .hx-bill-table td.hx-bill-table__main {
    display: block;
    order: -1;
    padding-bottom: 4px;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--color-heading);
    text-align: left;
  }

  .hx-bill-table td.hx-bill-table__main::before {
    content: none;
  }

  /* Links are touch targets here. */
  .hx-bill-table .hx-bill-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .hx-bill-table__main .hx-bill-invoice {
    font-size: 17px;
  }

  .hx-bill-table .hx-bill-table__empty td {
    display: block;
    text-align: center;
  }

  .hx-bill-table .hx-bill-table__empty td::before {
    content: none;
  }

  .hx-bill-row--overdue > td:first-child {
    box-shadow: none;
  }

  .hx-bill-row--overdue {
    box-shadow: inset 3px 0 0 var(--status-error);
  }

  .hx-bill-group__head {
    background: var(--color-surface-sunken);
  }

  .hx-bill-table .hx-bill-group__head > th {
    padding: 0;
    margin-left: -8px;
  }

  /* "Edit" at the right, as the values over it. */
  .hx-bill-table .hx-bill-actions {
    justify-content: flex-end;
  }

  .hx-bill-table .hx-bill-actions .btn--text {
    margin-right: -10px;
    margin-left: 0;
  }

  .hx-bill-total > th {
    text-align: left;
  }
}

/* ---- the sites: by client, its name, a summary card, then a card per site (the open one with its panel in it) */

.hx-bill-sites {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hx-bill-card {
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.hx-bill-clientgroup {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* The same gap between clients, folded or not, as on the Sites page (Kyle, 2026-11-13): folding one does not move the
   others (.hx-bill-sites sets it). */

.hx-bill-clientgroup__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hx-bill-clientgroup__body[hidden],
.hx-bill-client__actions[hidden],
.hx-bill-client__panel[hidden] {
  display: none;
}

/* The name of the client, over its cards, as a group of the Sites page: the button that folds them. */
.hx-bill-client__name {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-bill-client__toggle,
.hx-bill-client__more {
  display: inline-flex;
  gap: 4px 10px;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px 0 6px;
  margin-left: -6px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 8px;
}

.hx-bill-client__toggle:hover,
.hx-bill-client__more:hover {
  background: var(--color-hover);
}

.hx-bill-client__toggle:focus-visible,
.hx-bill-client__more:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

.hx-bill-client__toggle > .bi,
.hx-bill-client__more > .bi {
  flex: none;
  font-size: 16px;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}

.hx-bill-client__toggle[aria-expanded='false'] > .bi,
.hx-bill-client__more[aria-expanded='false'] > .bi {
  transform: rotate(-90deg);
}

/* The name and the link of a client (the link is the one of the Sites page, `.hx-ov-group__link`). */
.hx-bill-client__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* The name and the code of a client, beside the chevron: they wrap under each other, not under the chevron. */
.hx-bill-client__words {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  align-items: baseline;
  min-width: 0;
}

/* A long name wraps in its button: the link and the count stay beside it. */
.hx-bill-client__title > .hx-bill-client__toggle {
  flex: 0 1 auto;
  /* As tall as the head of a client on the Sites page (.hx-ov-group__head). */
  min-height: 44px;
}

.hx-bill-client__title > .hx-ov-group__link,
.hx-bill-client__title > .nx-section__count {
  flex: none;
}

/* What the sites of a client owe, beside its name: only while it is folded (the summary card says it otherwise). */
.hx-bill-client__folded {
  font-size: 14px;
  font-weight: 400;
}

.hx-bill-clientgroup:not(.is-folded) .hx-bill-client__folded {
  display: none;
}

/* The dropdowns under the summary, side by side: "Actions", "Invoices" and "Proposals". */
.hx-bill-client__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
  margin: -6px 0;
}

.hx-bill-client__more {
  min-height: 36px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.hx-bill-client__more:disabled {
  cursor: default;
  background: none;
}

/* What Invoices or Proposals unfold, under the bar. */
.hx-bill-client__panel {
  min-width: 0;
}

.hx-bill-client__panel > .hx-bill-part__empty {
  margin: 0;
}

/* The summary card of a client: what its sites owe, then the buttons that act on all of them. */
.hx-bill-client {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px;
}

.hx-bill-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px 24px;
  margin: 0;
}

.hx-bill-figure dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hx-bill-figure dd {
  margin: 2px 0 0;
  text-align: left;
  font-size: 19px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-bill-figure.is-warn dd {
  color: var(--status-error);
}

/* The figures above the proposals of a client (Kyle, 2026-11-13), a line under them. */
.hx-bill-proposals__figures {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.hx-bill-figures__note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
}

/* The buttons that collect for every site listed under the client: they wrap where there is no room for a row. */
.hx-bill-client__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

/* A line between the figures and the dropdowns under them. */
.hx-bill-figures:has(+ .hx-bill-client__bar) {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

/* A row of the buttons of a client: the four that collect, then the statement, pricing and the two that act on them. */
.hx-bill-client__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

/* The invoices of a client (invoicesForClient of billing-edit.js): a block per site, with its transactions to tick. */
.hx-bill-batch {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hx-bill-batch__status {
  margin: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.hx-bill-batch__status strong {
  color: var(--color-heading);
}

.hx-bill-batch__site {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.hx-bill-batch__head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  font-size: 15px;
  cursor: pointer;
}

.hx-bill-batch__name {
  flex: 1 1 200px;
  min-width: 0;
  font-weight: 700;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-bill-batch__why {
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-bill-batch__why:empty {
  display: none;
}

.hx-bill-batch__carry {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

/* A site that gets no invoice: its transactions are greyed, and say so by the heading. */
.hx-bill-batch__site.is-skipped {
  background: var(--color-surface-sunken);
}

.hx-bill-batch__site.is-skipped > .hx-bill-pick,
.hx-bill-batch__site.is-skipped > .hx-bill-pick__sum,
.hx-bill-batch__site.is-skipped > .hx-bill-batch__carry {
  opacity: 0.6;
}

.hx-bill-batch__site.is-unread .hx-bill-batch__why {
  color: var(--color-error-text);
}

/* What a run for the sites of a client shows: how far it is, and at the end a row for each site. */
.hx-bill-progress {
  display: block;
  width: 100%;
  height: 8px;
  accent-color: var(--color-accent);
}

.hx-bill-collect__remark {
  display: block;
  max-width: 60ch;
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
}

.hx-bill-collect__remark + .hx-bill-collect__remark {
  margin-top: 4px;
}

/* The head of a site: the button that opens and closes it. */
.hx-bill-site__head {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  width: 100%;
  min-height: 60px;
  padding: 10px 20px;
  font: inherit;
  color: var(--color-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: 0;
}

.hx-bill-site__head:hover {
  background: var(--color-row-hover);
}

.hx-bill-site__head:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-bill-site.is-open > .hx-bill-site__head {
  border-bottom: 1px solid var(--color-border);
}

.hx-bill-site__name {
  min-width: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-bill-site__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 12px;
  font-size: 14px;
}

.hx-bill-site__owed {
  min-width: 92px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-bill-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px 20px 24px;
  background: var(--color-surface-sunken);
}

.hx-bill-panel__foot {
  margin: 0;
  font-size: 14px;
}

.hx-bill-panel__foot .hx-bill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

.hx-bill-part__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  min-height: 44px;
  margin-bottom: 6px;
}

.hx-bill-part__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--color-heading);
  letter-spacing: -0.01em;
}

.hx-bill-part__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* The switch of the kit is a row of a menu; here it stands beside a heading. */
.hx-bill-switch {
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
}

.hx-bill-switch .switch-row__label {
  flex: none;
}

.hx-bill-part__body {
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  container-type: inline-size;
}

.hx-bill-part__body > .hx-bill-notice {
  margin: 12px;
}

.hx-bill-part__empty {
  padding: 16px;
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.hx-bill-costs {
  padding: 2px 16px;
  border-bottom: 1px solid var(--color-border);
}

/* Label and figure side by side at every width (the rows of the kit stack on a phone). */
.hx-bill-costs .hx-kv__row {
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 4px 16px;
  padding: 9px 0;
}

.hx-bill-costs .hx-kv__value {
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
}

/* ---- the summary of an open site, under its buttons: folded at first, a line in its card says the short of it */

.hx-bill-sum {
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

/* The title of the summary is the button that folds its details, as the name of a client folds the client; the title of
   each other part of a site folds that part the same way. */
.hx-bill-sum__toggle,
.hx-bill-part__toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 0 10px 0 4px;
  margin-left: -4px;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 8px;
}

.hx-bill-sum__toggle:hover,
.hx-bill-part__toggle:hover {
  background: var(--color-hover);
}

.hx-bill-sum__toggle:focus-visible,
.hx-bill-part__toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

.hx-bill-sum__toggle > .bi,
.hx-bill-part__toggle > .bi {
  flex: none;
  font-size: 16px;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}

.hx-bill-sum__toggle[aria-expanded='false'] > .bi,
.hx-bill-part__toggle[aria-expanded='false'] > .bi {
  transform: rotate(-90deg);
}

/* The three figures of a site, each centered over the block of the details it comes from: as wide as those blocks (the
   card's edges), in three equal columns. */
.hx-bill-figures.hx-bill-sum__figures {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 -20px;
}

.hx-bill-sum__figures .hx-bill-figure {
  min-width: 0;
  padding: 0 16px;
  text-align: center;
}

.hx-bill-sum__figures .hx-bill-figure dd {
  text-align: center;
}

/* A press on the figures folds and unfolds the details too. */
.hx-bill-sum.hx-bill-client {
  cursor: pointer;
}

.hx-bill-sum.hx-bill-client:not(.is-open):hover {
  background: var(--color-row-hover);
}

.hx-bill-sum.hx-bill-client > .hx-bill-sum__body {
  margin: 0 -20px -16px;
  cursor: auto;
  border-top: 1px solid var(--color-border);
}

.hx-bill-sum__body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hx-bill-sum__body[hidden] {
  display: none;
}

.hx-bill-sum__block {
  min-width: 0;
  padding: 12px 16px;
}

.hx-bill-sum__block + .hx-bill-sum__block {
  border-left: 1px solid var(--color-border);
}

.hx-bill-sum__heading {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hx-bill-sum .hx-bill-costs {
  padding: 0;
  border-bottom: 0;
}

.hx-bill-sum .hx-bill-costs .hx-kv__row {
  grid-template-columns: auto minmax(0, 1fr);
  padding: 6px 0;
}

.hx-bill-sum .hx-bill-costs .hx-kv__value {
  text-align: right;
}

.hx-bill-sum .hx-bill-costs .hx-kv__label {
  white-space: nowrap;
}

.hx-bill-sum__block > .hx-bill-part__empty,
.hx-bill-sum__block > .hx-bill-notice {
  margin: 4px 0 0;
  padding: 0;
}

/* ---- the invoice viewer (components/invoice-view.js) */

.hx-invoice {
  display: flex;
  flex-direction: column;
  gap: 20px;
  container-type: inline-size;
}

.hx-invoice__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
}

.hx-invoice__issuer {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  font-style: normal;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.hx-invoice__issuer strong {
  color: var(--color-heading);
}

.hx-invoice__id {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}

.hx-invoice__number {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-heading);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hx-invoice__description {
  font-size: 14px;
  color: var(--color-text-muted);
}

.hx-invoice__facts .hx-kv__row {
  grid-template-columns: 110px minmax(0, 1fr);
  padding: 7px 0;
}

.hx-invoice__heading {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* The notes of an invoice: line by line, as they were typed (components/invoice-view.js). */
.hx-invoice__notes-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* The resolutions of the Service page a proposal was sent with (components/invoice-view.js, step 5b): a line each, its
   words then "Open event"; the buttons go under the words where there is no room. */
.hx-invoice__service-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hx-invoice__service-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-invoice__service-text {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* The details of the resolution and the lines of its events take the whole width, under its head. */
.hx-invoice__service-details,
.hx-invoice__service-none,
.hx-invoice__service-events {
  flex: 1 0 100%;
  order: 2;
  margin: 0;
  overflow-wrap: anywhere;
}

.hx-invoice__service-details {
  white-space: pre-line;
}

.hx-invoice__service-none {
  color: var(--color-text-muted);
}

.hx-invoice__service-events {
  padding-left: 18px;
  color: var(--color-text-muted);
}

.hx-invoice__service-actions {
  order: 1;
}

.hx-invoice__service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hx-invoice__payment {
  padding: 14px 16px;
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.hx-invoice__payment-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hx-invoice__payment-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  font-size: 15px;
  color: var(--color-text);
}

.hx-invoice__payment-line > .hx-bill-num {
  font-weight: 700;
  color: var(--color-heading);
}

.hx-invoice__paylink {
  margin-top: 12px;
}

.hx-invoice__table {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.hx-invoice__parts {
  padding-left: 18px;
  margin: 4px 0 0;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.hx-invoice__members {
  margin-top: 4px;
}

.hx-invoice__members > summary {
  width: fit-content;
  font-size: 12.5px;
  color: var(--color-text-muted);
  cursor: pointer;
}

.hx-invoice__totals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: flex-end;
  width: min(340px, 100%);
  margin: 0;
}

.hx-invoice__totals > div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 14px;
}

.hx-invoice__totals dt {
  color: var(--color-text-muted);
}

.hx-invoice__totals dd {
  margin: 0;
  color: var(--color-text);
}

.hx-invoice__totals > .is-strong {
  padding-top: 8px;
  margin-top: 4px;
  font-size: 17px;
  font-weight: 800;
  border-top: 2px solid var(--color-border-strong);
}

.hx-invoice__totals > .is-strong > * {
  color: var(--color-heading);
}

.hx-invoice__note {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: right;
}

.hx-invoice__retry {
  display: flex;
  justify-content: center;
}

/* The buttons that write sit in the footer like the others. */
.hx-invoice__actions {
  display: contents;
}

/* The footer of the invoice viewer on a phone (Kyle, 2026-11-04): Print, Download and Email on a row, a third each; "Pay by
   card" across; Edit and Close on the last row, half each. A button missing, the others of its row share the room. */
@media (max-width: 599.98px) {
  .dialog__footer:has([data-invoice-action="close"]) {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dialog__footer:has([data-invoice-action="close"]) [data-invoice-action] {
    grid-column: span 6;
    min-width: 0;
    margin: 0;
  }

  .dialog__footer:has([data-invoice-action="close"]) [data-invoice-action="print"],
  .dialog__footer:has([data-invoice-action="close"]) [data-invoice-action="download"],
  .dialog__footer:has([data-invoice-action="close"]) [data-invoice-action="email"] {
    order: 0;
    grid-column: span 2;
  }

  .dialog__footer:has([data-invoice-action="close"]) [data-invoice-action="email"] {
    order: 1;
  }

  .dialog__footer:has([data-invoice-action="close"]):not(:has([data-invoice-action="email"])) [data-invoice-action="print"],
  .dialog__footer:has([data-invoice-action="close"]):not(:has([data-invoice-action="email"])) [data-invoice-action="download"] {
    grid-column: span 3;
  }

  .dialog__footer:has([data-invoice-action="close"]) [data-invoice-action="pay"],
  .dialog__footer:has([data-invoice-action="close"]) [data-invoice-action="link"] {
    order: 2;
  }

  .dialog__footer:has([data-invoice-action="close"]) [data-invoice-action="edit"],
  .dialog__footer:has([data-invoice-action="close"]) [data-invoice-action="close"] {
    order: 3;
    grid-column: span 3;
  }

  .dialog__footer:has([data-invoice-action="close"]):not(:has([data-invoice-action="edit"])) [data-invoice-action="close"] {
    grid-column: span 6;
  }

  /* Print, Edit, Download and Close alone (a proposal opened from the Service page; Kyle, 2026-11-17): two rows of two,
     Print and Edit, then Download and Close. */
  .dialog__footer:has([data-invoice-action="close"]):has([data-invoice-action="edit"]):not(:has([data-invoice-action="email"], [data-invoice-action="link"], [data-invoice-action="pay"])) [data-invoice-action] {
    grid-column: span 3;
  }

  .dialog__footer:has([data-invoice-action="close"]):has([data-invoice-action="edit"]):not(:has([data-invoice-action="email"], [data-invoice-action="link"], [data-invoice-action="pay"])) [data-invoice-action="print"] {
    order: 0;
  }

  .dialog__footer:has([data-invoice-action="close"]):has([data-invoice-action="edit"]):not(:has([data-invoice-action="email"], [data-invoice-action="link"], [data-invoice-action="pay"])) [data-invoice-action="edit"] {
    order: 1;
  }

  .dialog__footer:has([data-invoice-action="close"]):has([data-invoice-action="edit"]):not(:has([data-invoice-action="email"], [data-invoice-action="link"], [data-invoice-action="pay"])) [data-invoice-action="download"] {
    order: 2;
  }

  .dialog__footer:has([data-invoice-action="close"]):has([data-invoice-action="edit"]):not(:has([data-invoice-action="email"], [data-invoice-action="link"], [data-invoice-action="pay"])) [data-invoice-action="close"] {
    order: 3;
  }
}

/* ---- the editor (billing-edit.js): ticks on the pending transactions, forms in dialogs */

/* A tick with room around it: a touch target where the rows are stacked. */
.hx-bill-check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
}

.hx-bill-selectbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  min-height: 48px;
  padding: 6px 14px;
  font-size: 13.5px;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.hx-bill-selectbar__count {
  flex: 1 1 160px;
  min-width: 0;
}

.hx-bill-table--tick th:first-child,
.hx-bill-table--tick td:first-child {
  width: 1%;
  padding-right: 0;
}

/* The buttons of a row stand under what the row says. */
.hx-bill-table .hx-bill-actions {
  display: flex;
  margin-top: 4px;
}

.hx-bill-table .hx-bill-actions .btn--text {
  margin-left: -10px;
}

/* A plan: its name and its tags on one line (pages/billing.js); its label and its buttons under it. */
.hx-bill-planline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
}

.hx-bill-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
}

.hx-bill-form [hidden],
.hx-bill-form__alert[hidden] {
  display: none;
}

.hx-bill-form__alert {
  margin-bottom: 6px;
}

.hx-bill-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px 12px;
}

.hx-bill-form__grid > .is-wide {
  grid-column: 1 / -1;
}

.hx-bill-form textarea.field__input {
  min-height: 104px;
  line-height: 1.4;
  resize: vertical;
}

.hx-bill-form__lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--color-text);
}

/* The "Proposal" tick and, beside it while ticked, the status select (Pending / Accepted / Declined). */
.hx-bill-form__proposal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.hx-bill-form__proposal-status {
  width: 180px;
  max-width: 100%;
}

.hx-bill-form__proposal-status[hidden] {
  display: none;
}

.hx-bill-form__note {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.hx-bill-form__heading {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--color-heading);
}

.hx-bill-form__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* What becomes of the transactions of an invoice that is deleted (deleteInvoice, from the invoice form). */
.hx-bill-form__choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.hx-bill-form__choices > legend {
  padding: 0;
  margin-bottom: 4px;
}

.hx-bill-form__choices > .hx-bill-atcost {
  align-self: flex-start;
}

.hx-bill-form__list {
  padding-left: 20px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
}

.hx-bill-form__addresses {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hx-bill-form__message {
  white-space: pre-wrap;
}

/* The transactions an invoice can take: a tick, what it is, what it comes to. */
.hx-bill-pick {
  padding: 0;
  margin: 0;
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-bill-pick__group,
.hx-bill-pick__none {
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-text-muted);
  background: var(--color-surface-sunken);
}

.hx-bill-pick__none {
  font-weight: 400;
}

.hx-bill-pick__row {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0 6px 0 14px;
}

.hx-bill-pick > li + li {
  border-top: 1px solid var(--color-border);
}

.hx-bill-pick__row > label {
  display: flex;
  flex: 1;
  gap: 12px;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 6px 0;
  font-size: 14px;
  cursor: pointer;
}

.hx-bill-pick__what {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* A transaction that came from QuickBooks (its expenses, bills and time): a small tag after what it is. */
.hx-bill-qb {
  display: inline-block;
  padding: 0 7px;
  margin-left: 8px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--color-accent-text);
  vertical-align: 1px;
  background: var(--color-accent-tint);
  border-radius: var(--radius-pill);
}

/* One the "Source" of "Edit transactions" of a client leaves out: listed, greyed, and it cannot be ticked. */
.hx-bill-pick__row.is-filtered > label {
  cursor: default;
  opacity: 0.55;
}

.hx-bill-pick__sum {
  margin: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.hx-bill-pick__sum strong {
  color: var(--color-heading);
  white-space: nowrap;
}

.hx-bill-review .hx-kv__row {
  grid-template-columns: minmax(84px, 120px) minmax(0, 1fr);
  gap: 4px 16px;
  padding: 9px 0;
}

/* ---- QuickBooks and card payments (billing-quickbooks.js, billing-pay.js) */

/* What has to be made in QuickBooks before an invoice can go up: a name, and the button that makes it. */
.hx-bill-form__steps {
  padding: 0;
  margin: 0;
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-bill-form__steps > li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 8px 14px;
  font-size: 14px;
}

.hx-bill-form__steps > li + li {
  border-top: 1px solid var(--color-border);
}

.hx-bill-form__steps > li > span:first-child {
  flex: 1 1 220px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hx-bill-form__lead > .bi {
  color: var(--status-ok);
}

/* Demo mode: what stands for a window or a form of somebody else (Intuit's sign-in, Braintree's card form). */
.hx-bill-standin {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface-sunken);
  border: 2px dashed var(--color-border-strong);
  border-radius: 10px;
}

.hx-bill-standin > p {
  margin: 0;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* Room for the label of a field, which stands on its border. */
.hx-bill-standin > p + * {
  margin-top: 6px;
}

.hx-pay__card {
  min-height: 72px;
}

/* Braintree draws its card form itself, dark on light: it stands on a light surface in dark mode too. */
.hx-pay__dropin {
  padding: 4px 12px 8px;
  color-scheme: light;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

/* A button that deletes stands apart from the ones that save, at the other end of the footer. */
.hx-bill-dialog .dialog__footer > .btn--danger:first-child:not(:last-child),
.dialog__footer > .hx-invoice__actions > .btn--danger {
  margin-right: auto;
}

/* The edit invoice/proposal form: View and Delete at the left end, Save and Close at the right (Kyle, 2026-11-04). */
.hx-bill-invoice-form .dialog__footer > [data-action="delete"] {
  margin-right: auto;
}

/* Save: tonal with an outline (Kyle, 2026-11-04). */
.hx-bill-invoice-form .dialog__footer > [data-action="submit"] {
  border-color: var(--color-accent);
}

@media (max-width: 599.98px) {
  /* On a phone: Delete and Save on a row, View and Close on the one under it, half each (Kyle, 2026-11-04). */
  .hx-bill-invoice-form .dialog__footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hx-bill-invoice-form .dialog__footer > .btn {
    order: 0;
    margin: 0;
  }

  .hx-bill-invoice-form .dialog__footer > [data-action="delete"] {
    order: 0;
  }

  .hx-bill-invoice-form .dialog__footer > .btn:not([data-action]) {
    order: 2;
  }

  .hx-bill-invoice-form .dialog__footer > [data-action="submit"] {
    order: 1;
  }

  .hx-bill-invoice-form .dialog__footer > [data-action="cancel"] {
    order: 3;
  }

  /* Three buttons (no View): Delete and Save on a row, Close under them across. */
  .hx-bill-invoice-form .dialog__footer > [data-action="delete"]:first-child:nth-last-child(3) ~ [data-action="cancel"] {
    grid-column: 1 / -1;
  }
}

/* Save and Cancel of the Health checks, side by side at the left end; Reset and Defaults at the right. */
.hx-hc-pair {
  display: flex;
  gap: 8px;
}

.dialog__footer > .hx-hc-pair {
  order: -1;
  margin-right: auto;
}

@container (max-width: 820px) {
  .hx-bill-check {
    min-width: 44px;
    min-height: 44px;
  }

  .hx-bill-table--tick td:first-child {
    width: auto;
    padding-right: 0;
  }
}

@media (max-width: 599.98px) {
  .hx-bill-selectbar .hx-bill-check,
  .hx-bill-pick .btn--sm,
  .hx-bill-form .btn--sm {
    min-height: 44px;
  }

  .hx-bill-form__grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  /* On a sheet the buttons share the row; one that deletes takes a row of its own, under them (Save and Cancel of the
     Health checks too, together). */
  .dialog__footer > .hx-hc-pair,
  .hx-bill-dialog .dialog__footer > .btn--danger:first-child:not(:last-child) {
    order: 1;
    flex-basis: 100%;
    margin-right: 0;
  }

  .hx-hc-pair > .btn {
    flex: 1 1 0;
    min-height: 48px;
  }
}

/* ---- phones */

@media (max-width: 719.98px) {
  .hx-bill-hero .nx-hero__refresh {
    min-height: 36px;
  }

  /* The search of the band as wide as the screen, as on the other pages (next.css `.nx-search`). */
  .hx-bill-search {
    width: 100%;
  }

  .hx-bill-site__head {
    grid-template-columns: 20px minmax(0, 1fr);
    padding: 10px 16px;
  }

  .hx-bill-site__meta {
    grid-column: 2;
    justify-content: flex-start;
  }

  .hx-bill-site__owed {
    min-width: 0;
  }

  /* The summary cards of a client and of a site, compact on a phone. */
  .hx-bill-client {
    gap: 10px;
    padding: 10px 12px;
  }

  .hx-bill-figures {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 12px;
  }

  .hx-bill-figure dt {
    font-size: 10.5px;
  }

  .hx-bill-figure dd {
    margin-top: 0;
    font-size: 15px;
  }

  .hx-bill-figures:has(+ .hx-bill-client__bar) {
    padding-bottom: 8px;
  }

  .hx-bill-client__toggle {
    min-height: 44px;
  }

  .hx-bill-client__bar {
    gap: 2px 8px;
    margin: -4px 0;
  }

  .hx-bill-client__more {
    min-height: 36px;
    font-size: 13px;
  }

  .hx-bill-client__folded {
    padding-left: 32px;
  }

  /* Each row of buttons of a client in two columns, not one under the other. */
  .hx-bill-client__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .hx-bill-client__row > .btn {
    gap: 4px;
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
    font-size: 12.5px;
  }

  /* An odd one at the end takes the whole row (with four buttons, none does). */
  .hx-bill-client__row > .btn:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .hx-bill-batch__site {
    padding: 12px;
  }

  .hx-bill-batch__head {
    min-height: 44px;
  }

  .hx-bill-panel {
    padding: 12px 12px 20px;
  }

  /* The buttons of a site on a phone: only while its Summary is open, as those of the other parts. */
  .hx-bill-sumpart:not(.is-open) > .hx-bill-part__head > .hx-bill-part__tools {
    display: none;
  }

  /* A folded part of a site on a phone: its title alone (its switch and buttons come back when it is open). */
  .hx-bill-part.is-folded > .hx-bill-part__head > .hx-bill-part__tools {
    display: none;
  }

  /* Folded parts stand close together: a list of titles. */
  .hx-bill-panel {
    gap: 12px;
  }

  .hx-bill-part.is-folded > .hx-bill-part__head,
  .hx-bill-sumpart:not(.is-open) > .hx-bill-part__head {
    margin-bottom: 0;
  }

  /* The Summary of a site on a phone: folded, its title and buttons only; open, the details alone (no figures over them). */
  .hx-bill-sumpart:not(.is-open) .hx-bill-sum {
    display: none;
  }

  .hx-bill-sumpart .hx-bill-sum.hx-bill-client {
    padding: 0;
    cursor: auto;
  }

  .hx-bill-sumpart .hx-bill-sum__figures {
    display: none;
  }

  .hx-bill-sumpart .hx-bill-sum.hx-bill-client > .hx-bill-sum__body {
    margin: 0;
    border-top: 0;
  }

  /* The figures of a site as those of a client on a phone: two a row, from the left. */
  .hx-bill-figures.hx-bill-sum__figures {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 12px;
    margin: 0;
  }

  .hx-bill-sum__figures .hx-bill-figure,
  .hx-bill-sum__figures .hx-bill-figure dd {
    padding: 0;
    text-align: left;
  }

  /* The summary of a site: its blocks one under the other, to the edges of its card. */
  .hx-bill-sum.hx-bill-client > .hx-bill-sum__body {
    margin: 0 -12px -10px;
  }

  .hx-bill-sum__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .hx-bill-sum__block + .hx-bill-sum__block {
    border-top: 1px solid var(--color-border);
    border-left: 0;
  }

  /* A switch of a part ("Show paid", "Show inactive") has a row of its own, its buttons under it. */
  .hx-bill-part__tools:has(> .hx-bill-switch),
  .hx-bill-part__tools > .hx-bill-switch {
    flex: 1 1 100%;
  }

  .hx-invoice__number {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-bill-sum__toggle > .bi,
  .hx-bill-part__toggle > .bi,
  .hx-bill-client__toggle > .bi,
  .hx-bill-client__more > .bi,
  .hx-bill-group__toggle > .bi,
  .hx-bill-site__head > .bi {
    transition: none;
  }
}

/* ============================================================ Health page (pages/health.js, components/sparkline.js, components/scanner-health.js) */

/* Every class of this block starts with "hx-hl-". */

/* Several elements here have a `display` of their own, which would keep a `hidden` one on the page. */
.hx-hl-hero .nx-hero__controls[hidden],
.hx-hl-stats[hidden],
.hx-hl-filter[hidden],
.hx-hl-site[hidden] {
  display: none;
}

/* ---- hero: the headline, the controls, the four figures that filter */

.hx-hl-hero .nx-hero__title {
  max-width: none;
}

/* The sentence that states the condition of the fleet (`.hx-hl-headline`) is written as the lead of every band. */

/* The range, the order and the menu: a bar of the page, under My sites | All. */
/* "Look back" and "Date" in the bar of the page, between My sites | All | Resolutions and List | Board | Lanes (Kyle,
   2026-11-11): the switch keeps the right end, the range is on its left. */
.hx-hl-range {
  margin-left: auto;
}

.hx-hl-sitebar > .hx-hb-view {
  margin-left: 0;
}

/* On a phone (Kyle, 2026-11-11): the sites, "Edit" and List | Board | Lanes flow together as on the Service page, the
   views at the right, on the line of the sites where they fit and under them where they do not; the range is under
   them, the width of the bar. */
@media (max-width: 719.98px) {
  /* The views at the right end of their line, as on the Service page (and as far under the sites: the gap of the bar). */
  .hx-hl-sitebar > .hx-hb-view {
    margin-left: auto;
  }

  /* The range a line of its own, with room for the labels on the top edge of "Look back" and "Date". */
  .hx-hl-sitebar > .hx-hl-range {
    flex: 1 0 100%;
    order: 1;
    margin-top: 8px;
    margin-left: 0;
  }
}

/* "Look back" and "Date" (the moment the lanes end), with "Now" while another is chosen: as in the scanner dialog
   (.hx-hl-detail__range-bar). */
.hx-hl-days,
.hx-inv-time {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
}

.hx-hl-days .field-group,
.hx-inv-time .field-group {
  margin: 0;
}

/* "Look back": wide enough for "120 days" and its arrow. */
.hx-hl-days select,
.hx-inv-time select {
  min-width: 120px;
}

.hx-hl-search {
  width: min(240px, 100%);
}

/* As wide as "Order" of the Service page (.hx-sv__field--sort): "Newest by facility", the default, fits. */
.hx-hl-sort {
  width: 170px;
}

/* The order and the filters of the notices, then "Acknowledge…" and "Create event" at the end, over the rows of the
   List (pages/health.js `$attentionPanel`, a panel as the Service page's: as far under the tabs as its toolbar). */
.hx-hl-attention-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding-top: 6px;
}

/* The count over the rows (`hx-ul__count`), while it says something. */
.hx-hl-status:empty {
  display: none;
}

.hx-hl-attention-tools:empty {
  display: none;
}

/* "Acknowledge…" and "Create event" at the right end. */
.hx-hl-attention-tools > .hx-hl-ack {
  margin-left: auto;
}

/* ---- The tabs of the List of the Health page (pages/health.js `ATTENTION_TABS`): the bar of the views of the Service
   page (`.hx-tabs.hx-sv__tabs`, its count `.hx-sv__tab-count`), in the same place; but buttons, not links, and
   Monitoring, Parked and Muted (`is-aside`) set a little apart. */
/* It sticks at the top of the page: over the coloured edge of the rows that scroll under it (`.hx-sv-queue__row.is-striped::before`,
   z-index 1). Not on the tab of a site, where the bar does not stick (`.hx-site-tabpage > .hx-sv__tabs`). */
.hx-hl-attention-tabs {
  z-index: 2;
}

.hx-hl-attention-tabs .hx-tabs__tab {
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
  appearance: none;
}

/* A thin rule between what needs attention (Symptoms) and what is set aside. */
.hx-hl-attention-tabs .hx-tabs__tab:not(.is-aside) + .hx-tabs__tab.is-aside {
  margin-left: 13px;
}

.hx-hl-attention-tabs .hx-tabs__tab:not(.is-aside) + .hx-tabs__tab.is-aside::before {
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: -9px;
  width: 1px;
  content: '';
  background: var(--color-border);
}

/* The range, should anything hide it. */
.hx-hl-days[hidden] {
  display: none;
}

/* "Filters" with nothing behind it (pages/health.js): not shown, on a phone too. */
.hx-hl-filters[hidden] {
  display: none !important;
}
/* ---- end of the tabs of "Current symptoms" */

.hx-hl-notice[hidden],
.hx-hl-sort[hidden],
.hx-hl-ack[hidden],
.hx-hl-create[hidden],
.hx-hl-attention-tools[hidden] {
  display: none;
}

/* "Filters": on a phone only (below), where the order and the filters are behind it. */
.hx-hl-filters {
  display: none;
}

/* The short label of "Acknowledge…" and "Create event" is for a phone (pages/health.js `shortLabel`). */
.hx-hl-label--short {
  display: none;
}

.hx-hl-filters__count {
  min-width: 20px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  color: var(--color-accent-text);
  text-align: center;
  background: color-mix(in srgb, var(--color-accent) 16%, transparent);
  border-radius: 999px;
}

.hx-hl-filters__count[hidden] {
  display: none;
}

/* Their names are not shown: what each is set to says what it is. The label stays for a screen reader. */
.field-group.hx-hl-sort .field > .field__label,
.field-group.hx-hl-notice .field > .field__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Without a label over them they need less room: as tall as the switches of the page (My sites | All, the range). */
.field-group.hx-hl-sort .field__input,
.field-group.hx-hl-notice .field__input {
  min-height: 36px;
  height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

/* The category and the severity of the notices the page is narrowed to, beside the order. */
.hx-hl-notice {
  width: 170px;
}

.hx-hl-time {
  white-space: nowrap;
}

/* A figure is a button: pressed, the page shows the scanners it counts. */
.hx-hl-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.hx-hl-stat:hover {
  background: rgba(255, 255, 255, 0.11);
}

.hx-hl-stat:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.hx-hl-stat[aria-pressed='true'] {
  background: rgba(255, 255, 255, 0.18);
  border-color: #ffffff;
  box-shadow: inset 0 -4px 0 var(--hx-hl-figure, #ffffff);
}

.hx-hl-stat__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hx-hl-stat__label::before {
  flex: none;
  width: 8px;
  height: 8px;
  content: '';
  background: var(--hx-hl-figure, #ffffff);
  border-radius: 50%;
}

.hx-hl-stat__value {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hx-hl-stat--attention {
  --hx-hl-figure: var(--status-error);
}

.hx-hl-stat--warning {
  --hx-hl-figure: var(--status-warning);
}

.hx-hl-stat--offline {
  --hx-hl-figure: var(--status-unknown);
}

.hx-hl-stat--healthy {
  --hx-hl-figure: var(--status-ok);
}

/* ---- needs attention */

/* A row is a button here (it opens the scanner), with the look next.css gives it. */
.hx-hl-queue__item {
  font: inherit;
}

.hx-hl-queue__item:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

/* The sliders beside the tag of a notice (a super-user's): the settings of the check behind it, for that scanner or
   space (health-checks.js openNoticeChecks). The row is then a div with the role of a button, so these can be a button. */
.hx-hl-queue__tune {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: -4px 0;
  padding: 0;
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
}

.hx-hl-queue__tune:hover {
  color: var(--color-accent-text);
  background: var(--color-accent-tint);
}

.hx-hl-queue__tune:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

/* ---- sites: the legend, the note of a filter */

/* At the bottom of the page, under the sites. */
.hx-hl-legend {
  gap: 6px 18px;
  padding-top: 16px;
  margin-top: 20px;
  border-top: 1px solid var(--color-border);
}

.hx-hl-swatch {
  flex: none;
  width: 6px;
  height: 14px;
  border-radius: 1px;
}

.hx-hl-swatch--ok {
  background: var(--status-ok);
}

.hx-hl-swatch--warning {
  background: var(--status-warning);
}

.hx-hl-swatch--error {
  background: var(--status-error);
}

.hx-hl-swatch--pending {
  background: var(--status-info);
}

.hx-hl-swatch--offline {
  width: 18px;
  background: color-mix(in srgb, var(--status-error) 16%, transparent);
}

.hx-hl-swatch--line {
  width: 18px;
  height: 0;
  border-top: 1px dashed var(--color-chart-grid);
  border-radius: 0;
}

.hx-hl-legend__axis {
  flex-basis: 100%;
}

.hx-hl-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
}

.hx-hl-empty:not([hidden]) {
  padding: 32px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

/* ---- a site: a card that folds, its level as the bar at its edge */

/* The rows of "Needs attention" have no coloured edge on this page while the icon carries the colour; a row without it
   (`is-plain`, Kyle 2026-10-31: every row now) has the edge again, as the cards of the other pages. */
.hx-hl .nx-queue__item:not(.is-plain)::before {
  content: none;
}

.hx-hl-sites {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hx-hl-site {
  min-width: 0;
  background: var(--color-surface);
  /* No coloured edge: the pill beside the name says how the site is doing. */
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.hx-hl-site__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  min-height: 56px;
  padding: 6px 20px 6px 6px;
  cursor: pointer;
}

.hx-hl-site__toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 16px;
  color: var(--color-text-muted);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.hx-hl-site__toggle:hover {
  background: var(--color-hover);
}

.hx-hl-site__toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-hl-site__toggle > .bi {
  transition: transform 0.15s ease;
}

.hx-hl-site__toggle[aria-expanded='false'] > .bi {
  transform: rotate(-90deg);
}

.hx-hl-site__title {
  display: flex;
  flex: 1 1 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  min-width: min(100%, 180px);
  padding: 6px 0;
  margin-left: -6px;
}

.hx-hl-site__name {
  min-width: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* The name folds the section, as the head it is on does. */
.hx-hl-site__link {
  color: var(--color-heading);
}

.hx-hl-site__head {
  cursor: pointer;
}

/* The way to the site: an icon beside its name. */
.hx-hl-site__jump {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: -6px;
  font-size: 14px;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: 8px;
}

.hx-hl-site__jump:hover {
  color: var(--color-accent-text);
  background: var(--color-hover);
}

.hx-hl-site__jump:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-hl--single .hx-hl-site__jump {
  display: none;
}

.hx-hl-site__pill {
  display: inline-flex;
}

/* A tag that is a button ("3 need attention", "2 open events" on the Health page; "2 open events" on a card or in the
   head of a client on the Sites page, and on the card of a site on the Map: components/open-events-dialog.js): it opens
   those rows in a dialog. As the tags that are not buttons: no border. */
.hx-hl-site__tagbtn,
.hx-ov-tagbtn {
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
  border: 0;
  appearance: none;
}

/* The devices tag of a Sites card is a link (pages/overview.js): no underline until hovered. */
a.hx-ov-tagbtn {
  text-decoration: none;
}

.hx-hl-site__tagbtn:hover,
.hx-ov-tagbtn:hover {
  text-decoration: underline;
}

.hx-hl-site__tagbtn:focus-visible,
.hx-ov-tagbtn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-hl-site__facts {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 12px;
  margin-left: auto;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-hl-site__body {
  padding: 2px 20px 16px;
  border-top: 1px solid var(--color-border);
  transition: opacity 0.15s ease;
}

/* ---- one site: the Health tab of the site page (pages/health.js, `mountSiteHealth`) */

/* Refresh and the time of the last answer, at the start of the bar over the tab (`.hx-hl-sitebar`; the Service tab of
   a site has them too), in place of the band of the page. */
.hx-hl-bar__refresh {
  min-height: 36px;
}

.hx-hl-bar__updated {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* The section of the site does not fold and is not named: its head is the verdict and the facts. */
.hx-hl--single .hx-hl-site__toggle,
.hx-hl--single .hx-hl-site__name {
  display: none;
}

.hx-hl--single .hx-hl-site__head {
  padding-left: 20px;
  cursor: default;
}

.hx-hl--single .hx-hl-site__title {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: 0;
}

@media (max-width: 599.98px) {
  .hx-hl--single .hx-hl-site__head {
    padding-left: 12px;
  }
}

/* A newer answer is on its way: what shows is the one before. */
.hx-hl-site.is-refreshing .hx-hl-site__body {
  opacity: 0.6;
}

.hx-hl-site__error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 12px 0 4px;
  font-size: 14px;
  color: var(--color-error-text);
}

.hx-hl-site__error--stale {
  color: var(--color-warning-text);
}

.hx-hl-site__none {
  margin: 14px 0 2px;
  font-size: 14px;
  color: var(--color-text-muted);
}

/* ---- a scanner: its name, then its lane of scans as wide as the lane of the site; its four charts are tucked under it */

.hx-hl-row,
.hx-hl-worst,
.hx-hl-space {
  display: grid;
  grid-template-columns: minmax(170px, 1.35fr) repeat(5, minmax(0, 1fr));
  column-gap: 20px;
}

/* A lane and, at its right, its caret. Every lane of a site is in one, so they all begin and end at the same place. */
.hx-hl-lanebox {
  display: flex;
  grid-column: 2 / -1;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hx-hl-lanebox > canvas {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
}

/* A lane with the events and resolutions of its time as dots just above it (components/lane-pins.js). */
.hx-hl-lanebox > .hx-hl-track {
  position: relative;
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  /* The marks are drawn from a quarter of the lane's height down (sparkline.js createStrip): the dots, 10px, end 2px
     above them, over the top of the lane. */
  padding-top: 6px;
}

.hx-hl-track > canvas {
  width: 100%;
}

/* The band the dots sit in, at the top of the track. */
.hx-hl-pins {
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
}

.hx-hl-pin {
  position: absolute;
  top: 0;
  width: 10px;
  height: 10px;
  border: 2px solid var(--hx-pin-color);
  border-radius: 50%;
  background: var(--hx-pin-color);
  padding: 0;
  transform: translateX(-50%);
  /* Lit, it grows upward: the gap over the lane stays. */
  transform-origin: 50% 100%;
  cursor: pointer;
}

/* A resolution: a ring, an event a dot. */
.hx-hl-pin--visit {
  background: var(--color-surface, transparent);
}

/* Scrubbed over on the lane, or under the pointer: lit. */
.hx-hl-pin.is-scrubbed,
.hx-hl-pin:hover {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hx-pin-color) 35%, transparent);
  transform: translateX(-50%) scale(1.35);
}

.hx-hl-pin:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

.hx-hl-pin--error { --hx-pin-color: var(--status-error); }
.hx-hl-pin--warning { --hx-pin-color: var(--status-warning); }
.hx-hl-pin--info { --hx-pin-color: var(--status-info); }
.hx-hl-pin--ok { --hx-pin-color: var(--status-ok); }

/* The caret: it unfolds what is under its lane, and turns when that shows. */
.hx-hl-caret {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--hx-hl-caret, 32px);
  height: var(--hx-hl-caret, 32px);
  padding: 0;
  font-size: 14px;
  color: var(--color-text-muted);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.hx-hl-caret:hover {
  color: var(--color-heading);
  background: var(--color-hover);
}

.hx-hl-caret:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

.hx-hl-caret > .bi {
  transition: transform 0.15s ease;
}

.hx-hl-caret[aria-expanded='false'] > .bi {
  transform: rotate(-90deg);
}

/* Nothing to unfold: it keeps its width, so the lane ends where the others end, and takes no height. */
.hx-hl-caret.is-idle {
  height: 0;
  visibility: hidden;
}

.hx-hl-row {
  row-gap: 12px;
  align-items: center;
  padding: 12px 8px;
  margin: 0 -8px;
  border-top: 1px solid var(--color-border);
  cursor: pointer;
}

.hx-hl-row:hover {
  background: var(--color-row-hover);
}

/* The lane of a scanner is as high as the lane of the site: a mark is the same size in both. */
.hx-hl-row .hx-hl-lanebox .hx-hl-strip {
  height: 22px;
}

/* The four charts, under the lane and no wider than it: four across. */
.hx-hl-row__charts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-column: 2 / -1;
  gap: 12px 20px;
  padding-right: calc(var(--hx-hl-caret, 32px) + 8px);
}

.hx-hl-row__charts[hidden] {
  display: none;
}

/* How the scans went, in words, under the name. */
.hx-hl-row__scans {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.hx-hl-row__id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.hx-hl-row__name {
  max-width: 100%;
  padding: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-heading);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.hx-hl-row__name:hover,
.hx-hl-row:hover .hx-hl-row__name {
  color: var(--color-accent-text);
}

.hx-hl-row__name:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.hx-hl-row__why {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--color-text-muted);
}

.hx-hl-tag--safe {
  --tag-color: var(--status-safe-mode);
}

/* A scanner or a space before the date it is checked from (Health checks): "Not checked until ...", no notice. */
.hx-hl-row__unchecked {
  font-weight: 500;
  white-space: normal;
}

.hx-hl-detail__dates {
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-hl-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* The name of the chart. */
.hx-hl-cell__label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* The verdict: a dot and a word, the number under the word. */
.hx-hl-verdict {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  column-gap: 6px;
  align-items: center;
  font-size: 13px;
  line-height: 1.3;
}

.hx-hl-verdict__word {
  overflow: hidden;
  font-weight: 700;
  color: var(--color-heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hx-hl-verdict__figure {
  grid-column: 2;
  min-height: 1.3em;
  overflow: hidden;
  font-size: 12px;
  color: var(--color-text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hx-hl-verdict--ok .status-dot {
  --chip-color: var(--status-ok);
}

.hx-hl-verdict--info .status-dot,
.hx-hl-verdict--pending .status-dot {
  --chip-color: var(--status-info);
}

.hx-hl-verdict--warning .status-dot {
  --chip-color: var(--status-warning);
}

.hx-hl-verdict--error .status-dot {
  --chip-color: var(--status-error);
}

/* The charts are drawn by components/sparkline.js at the size they are given here. */
.hx-hl-spark,
.hx-hl-strip,
.hx-hl-cell__none {
  display: block;
  width: 100%;
  height: 28px;
}

/* A finger along a chart moves its tooltip; up or down it scrolls the page. */
.hx-hl-spark {
  touch-action: pan-y;
}

.hx-hl-strip {
  border-radius: 3px;
  cursor: pointer;
  touch-action: pan-y;
}

.hx-hl-strip:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* No chart: the figure is not reliable on this site, or there is no pin to compare with. */
.hx-hl-cell__none {
  background: repeating-linear-gradient(-45deg, transparent 0 5px, var(--color-chart-band) 5px 10px);
  border-radius: 6px;
}

.hx-hl-row--skeleton {
  grid-template-columns: minmax(120px, 1.35fr) 2fr 3fr;
  cursor: default;
}

.hx-hl-row--skeleton:first-child {
  border-top: 0;
}

.hx-hl-row--skeleton:hover {
  background: none;
}

.hx-hl-row--skeleton .hx-skeleton__line {
  height: 14px;
  border-radius: 6px;
}

/* ---- all the scanners of a site as one lane (the worst at each time), and the button that unfolds their rows */

/* The lane that sums up the scanners or the spaces of a site is the head of that part: a band,
   so the break between the two parts is found at a glance when they are unfolded. */
.hx-hl-worst {
  align-items: center;
  /* Its lane keeps the left and right edge of the lanes under it: the padding is what the margin takes. */
  padding: 12px 11px 10px;
  margin: 12px -11px 0;
  background: color-mix(in srgb, var(--color-accent-text) 9%, transparent);
  border-radius: 8px;
}

.hx-hl-worst .hx-hl-lane {
  grid-column: 2 / -1;
}

.hx-hl-worst__id {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hx-hl-worst__name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-hl-worst__name > strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hx-hl-worst__name > .bi {
  align-self: center;
  font-size: 16px;
  color: var(--color-accent-text);
}

.hx-hl-worst__summary {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Drawn by components/sparkline.js (`createLane`) at the size it is given here. */
.hx-hl-lane {
  display: block;
  width: 100%;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  touch-action: pan-y;
}

.hx-hl-lane:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-hl-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px 0 6px;
  margin: 2px 0 4px -6px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-accent-text);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.hx-hl-more:hover {
  background: var(--color-accent-hover);
}

.hx-hl-more:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

.hx-hl-more > .bi {
  font-size: 12px;
  transition: transform 0.15s ease;
}

.hx-hl-more[aria-expanded='false'] > .bi {
  transform: rotate(-90deg);
}

/* The second button, under rows that show: it unfolds the ones without an issue. A step quieter, and set in under the rows. */
.hx-hl-more--quiet {
  min-height: 30px;
  margin: 2px 0 2px 6px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-hl-more--quiet:hover {
  color: var(--color-heading);
  background: var(--color-hover);
}

.hx-hl-more--quiet > .bi {
  font-size: 11px;
}

/* The row a cell of the lane led to: marked for a moment. */
.hx-hl-row.is-highlighted {
  animation: hx-hl-flash 2.4s ease-out;
}

@keyframes hx-hl-flash {
  0%,
  35% {
    background: var(--color-accent-tint);
  }

  100% {
    background: transparent;
  }
}

/* ---- the spaces of a site: one lane for all of them, like the scanners'; unfolded, a block per space with its boundaries */

.hx-hl-spaces {
  margin-top: 6px;
  border-top: 1px solid var(--color-border);
}

.hx-hl-worst__summary--warn {
  font-weight: 600;
  color: var(--color-error-text);
}

.hx-hl-spaceblock {
  padding: 8px 8px 6px;
  margin: 0 -8px;
  border-top: 1px solid var(--color-border);
}

/* The space a mark of the lane led to: marked for a moment, as a scanner's row is. */
.hx-hl-spaceblock.is-highlighted {
  animation: hx-hl-flash 2.4s ease-out;
}

.hx-hl-space {
  align-items: center;
  padding: 4px 0;
}

/* The lanes of a space and of its boundaries are as high as the lane of the site: a mark is the same size in all of them. */
.hx-hl-space .hx-hl-strip,
.hx-hl-bound .hx-hl-strip {
  grid-column: 2 / -1;
  height: 22px;
}

/* A boundary: its name and what its readings say, then a mark per reading under the marks of its space. */
.hx-hl-bound {
  display: grid;
  grid-template-columns: minmax(170px, 1.35fr) repeat(5, minmax(0, 1fr));
  column-gap: 20px;
  align-items: center;
  padding: 6px 0;
}

.hx-hl-bound__id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-left: 12px;
  border-left: 2px solid var(--color-border);
}

.hx-hl-bound__name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-heading);
  text-align: left;
  background: none;
  border: 0;
  overflow-wrap: anywhere;
}

/* A boundary opens its health (the boundary dialog) from anywhere on its row. */
.hx-hl-bound--opens {
  cursor: pointer;
}

.hx-hl-bound--opens .hx-hl-bound__name {
  cursor: pointer;
}

.hx-hl-bound--opens:hover .hx-hl-bound__name {
  color: var(--color-accent-text);
}

.hx-hl-bound__name:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.hx-hl-bound__name .status-dot {
  flex: none;
  transform: translateY(-1px);
}

.hx-hl-bound[data-level='ok'] .status-dot {
  --chip-color: var(--status-ok);
}

.hx-hl-bound[data-level='warning'] .status-dot {
  --chip-color: var(--status-warning);
}

.hx-hl-bound[data-level='error'] .status-dot {
  --chip-color: var(--status-error);
}

.hx-hl-bound__metrics {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.hx-hl-bound__metric--warn {
  font-weight: 600;
  color: var(--color-error-text);
}

.hx-hl-bound--skeleton {
  grid-template-columns: minmax(120px, 1.35fr) 5fr;
}

.hx-hl-bound--skeleton .hx-skeleton__line {
  height: 14px;
  border-radius: 6px;
}

.hx-hl-bounds__none {
  padding-left: 14px;
  margin: 2px 0 6px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-hl-space__id {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hx-hl-space__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-hl-space__counts {
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-hl-space__counts--warn {
  font-weight: 600;
  color: var(--color-error-text);
}

/* ---- the scanner dialog (components/scanner-health.js) */

.hx-hl-detail {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 320px;
}

.hx-hl-detail__skeleton {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hx-hl-detail__skeleton .hx-skeleton__line {
  height: 16px;
  border-radius: 6px;
}

.hx-hl-detail__skeleton .hx-skeleton__line:nth-child(2) {
  width: 60%;
}

.hx-hl-detail__skeleton .hx-hl-detail__skeleton-chart {
  height: 220px;
  border-radius: 10px;
}

.hx-hl-detail__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hx-hl-detail__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.hx-hl-detail__range {
  margin-left: auto;
}

/* What needs attention, in words: the colour of its severity at the edge. */
.hx-hl-detail__reasons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hx-hl-detail__reasons li {
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-text);
  background: var(--color-surface-sunken);
  border-left: 3px solid var(--status-warning);
  border-radius: 0 8px 8px 0;
}

.hx-hl-detail__reasons li.hx-hl-detail__reason--error {
  border-left-color: var(--status-error);
}

/* A notice and, for a super-user, the sliders of its check at its end. */
.hx-hl-detail__reasons li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.hx-hl-detail__reason-text {
  flex: 1 1 auto;
  min-width: 0;
}

.hx-hl-detail__reasons strong {
  color: var(--color-heading);
}

.hx-hl-detail__section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.hx-hl-detail__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-heading);
}

/* The head of a section that folds (the scans): a button of the chevron, the title and the count, the full width of
   the head; pressed, the whole list shows, pressed again the newest alone. */
.hx-hl-detail__toggle {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
}

.hx-hl-detail__toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.hx-hl-detail__chevron {
  display: inline-flex;
  font-size: 13px;
  color: var(--color-text-muted);
  transition: transform 150ms ease;
}

.hx-hl-detail__toggle[aria-expanded='true'] .hx-hl-detail__chevron {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .hx-hl-detail__chevron {
    transition: none;
  }
}

/* "Show all" under the newest scan, "Hide all" once they all show. */
.hx-hl-scans__less {
  margin: 6px 0 0 -8px;
}

.hx-hl-detail__metric {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
}

/* The metrics scroll sideways within the window where they do not fit, without a scroll bar: the arrows beside them
   (shown only then) move them along, as the tabs of the scanners (.hx-hl-tabs__list). */
.hx-hl-detail__metric-list {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.hx-hl-detail__metric-list::-webkit-scrollbar {
  display: none;
}

/* Without the frame of a segmented control: in a row that scrolls, the frame would end at the edge of the row, not
   round the metrics. The one shown keeps its tint. */
.hx-hl-detail__metric-list .segmented {
  flex-wrap: nowrap;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
}

.hx-hl-detail__metric-list .segmented__option {
  flex: 0 0 auto;
  white-space: nowrap;
}

.hx-hl-detail__metric-arrow {
  flex: 0 0 auto;
}

.hx-hl-detail__metric-arrow[hidden] {
  display: none;
}

/* On a phone: the two fields of the range side by side, and the metrics the width of the window. */
@media (max-width: 600px) {
  .hx-hl-detail__section-head > .hx-hl-detail__range-bar {
    display: grid;
    /* "Look back" as narrow as "60 days" and its arrow allow: the date and the time beside it need the room. */
    grid-template-columns: 96px minmax(0, 1fr);
    width: 100%;
  }

  .hx-hl-detail__section-head > .hx-hl-detail__range-bar select {
    min-width: 0;
    padding-right: 28px;
    background-position: right 8px center;
  }

  .hx-hl-detail__range-bar .field-group,
  .hx-hl-detail__range-bar input {
    min-width: 0;
    width: 100%;
  }

  .hx-hl-detail__metric {
    width: 100%;
    margin-left: 0;
  }
}

.hx-hl-detail__chart {
  position: relative;
  height: 240px;
}

.hx-hl-detail__chart-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.hx-hl-detail__note {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-hl-detail__facts .hx-kv__row {
  padding: 8px 0;
}

.hx-hl-detail__id {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.hx-hl-detail__id code {
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* The scans: a row each that opens to its point counts. */
.hx-hl-scans {
  padding: 0;
  margin: 0;
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-hl-scan + .hx-hl-scan {
  border-top: 1px solid var(--color-border);
}

.hx-hl-scans__legend,
.hx-hl-scan__head {
  display: grid;
  grid-template-columns: 16px 128px 52px 96px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
}

.hx-hl-scans__legend {
  padding: 0 13px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hx-hl-scan__head {
  width: 100%;
  min-height: 44px;
  padding: 6px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--color-text);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.hx-hl-scan__head:hover {
  background: var(--color-row-hover);
}

.hx-hl-scan__head:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

/* A scheduled scan that did not happen: the columns of a scan, and nothing to open. */
.hx-hl-scan__head--missed {
  cursor: default;
}

.hx-hl-scan__head--missed:hover {
  background: none;
}

.hx-hl-scan__chevron {
  font-size: 12px;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}

.hx-hl-scan__head[aria-expanded='false'] .hx-hl-scan__chevron {
  transform: rotate(-90deg);
}

.hx-hl-scan__time {
  font-weight: 600;
  color: var(--color-heading);
  white-space: nowrap;
}

.hx-hl-scan__duration,
/* The share of the points missing: the box of the scanner settings (.hx-sc-quality). */
.hx-hl-scan__quality {
  display: flex;
}

/* A scan with a file: its box opens it in 3D. */
.hx-hl-scan__quality--opens .hx-sc-quality {
  cursor: pointer;
  transition: box-shadow 0.12s ease;
}

.hx-hl-scan__quality--opens:hover .hx-sc-quality {
  box-shadow: 0 0 0 2px var(--color-focus);
}

.hx-hl-scan__flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  font-size: 13px;
}

.hx-hl-scan__more {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 12px 14px 40px;
}

.hx-hl-scan__more > p {
  margin: 0;
  font-size: 14px;
}

.hx-hl-scan__notes {
  padding-left: 18px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* The log: the newest lines first, in a box that scrolls. */
.hx-hl-logs {
  max-height: 300px;
  padding: 0;
  margin: 0;
  overflow: auto;
  font-size: 13px;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-hl-log {
  display: grid;
  grid-template-columns: 128px 24px minmax(0, 1fr);
  column-gap: 12px;
  align-items: baseline;
  padding: 6px 12px;
}

.hx-hl-log + .hx-hl-log {
  border-top: 1px solid var(--color-border);
}

.hx-hl-log__time {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.hx-hl-log__level {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.hx-hl-log__text {
  color: var(--color-text);
  overflow-wrap: anywhere;
}

/* ---- narrower windows: the name of a scanner above its charts, each chart under its own name */

@media (max-width: 959.98px) {
  .hx-hl-row__id {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
  }

  .hx-hl-row,
  .hx-hl-worst,
  .hx-hl-space,
  .hx-hl-bound {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 4px;
  }

  .hx-hl-row {
    row-gap: 8px;
  }

  .hx-hl-lanebox,
  .hx-hl-row__charts {
    grid-column: 1;
  }

  .hx-hl-worst__id,
  .hx-hl-space__id {
    flex-flow: row wrap;
    align-items: baseline;
    gap: 2px 10px;
  }

  /* The metrics of a boundary side by side, where its name has the width of the card. */
  .hx-hl-bound__metrics {
    flex-flow: row wrap;
    gap: 0 14px;
  }
}

@media (max-width: 719.98px) {
  /* Stacked, one under the other, with a little room above and below. A finger needs their full height. */
  .hx-hl-attention-tools {
    gap: 8px;
    padding: 4px 0 6px;
  }

  .field-group.hx-hl-sort .field__input,
  .field-group.hx-hl-notice .field__input {
    min-height: 40px;
    height: 40px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .hx-hl-search,
  .hx-hl-notice,
  .hx-hl-sort {
    width: 100%;
  }

  /* The order and the two filters are behind "Filters" (pages/health.js), folded at first; the tabs of the rows are not. */
  .hx-hl-filters {
    display: inline-flex;
    flex: 1 1 auto;
  }

  .hx-hl-filters[aria-expanded='true'] {
    color: var(--color-accent-text);
    border-color: var(--color-accent);
  }

  /* "Filters", "Acknowledge" and "Event" on one line: short labels, and a little less room around them. */
  .hx-hl-label--long {
    display: none;
  }

  .hx-hl-label--short {
    display: inline;
  }

  .hx-hl-attention-tools > .hx-hl-filters,
  .hx-hl-attention-tools > .hx-hl-ack,
  .hx-hl-attention-tools > .hx-hl-create {
    gap: 6px;
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
  }

  .hx-hl-attention-tools.is-filtered > .hx-hl-sort,
  .hx-hl-attention-tools.is-filtered > .hx-hl-notice {
    display: none;
  }

  /* "Acknowledge…" and "Create event" share the width of the inputs over them: side by side when they fit on one
     line, else one under the other, each the full width. (The tabs of the rows are over them, never behind "Filters".) */
  .hx-hl-attention-tools > .hx-hl-ack,
  .hx-hl-attention-tools > .hx-hl-create {
    flex: 1 1 auto;
    margin-left: 0;
  }

  /* "Look back" as narrow as "120 days" and its arrow allow, "Date" the rest of the row (as in the scanner dialog). */
  .hx-hl-days,
  .hx-inv-time {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
  }

  /* On the Health page "Date" is a day, not a moment: "Look back" and it share the row equally (Kyle, 2026-11-11). */
  .hx-hl-days {
    flex: 1 0 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* "Today", while another day is chosen: under "Look back", at the start of its row. */
  .hx-hl-days > .btn {
    justify-self: start;
  }

  .hx-hl-days select,
  .hx-inv-time select {
    min-width: 0;
    padding-right: 28px;
    background-position: right 8px center;
  }

  .hx-hl-days .field-group,
  .hx-hl-days input,
  .hx-inv-time .field-group,
  .hx-inv-time input {
    min-width: 0;
    width: 100%;
  }

  .hx-hl-site__facts {
    flex-basis: 100%;
    justify-content: flex-start;
    padding: 0 0 8px 50px;
    margin-left: 0;
  }

  .hx-hl-site__facts:empty {
    display: none;
  }

  .hx-hl-detail__range {
    flex-basis: 100%;
    margin-left: 0;
  }
}

/* ---- phones: a scanner is a compact card: its name, its status, how its scans went, then its lane and its caret */

@media (max-width: 599.98px) {
  .hx-hl-site__head {
    padding-right: 12px;
  }

  .hx-hl-site__body {
    padding: 2px 12px 12px;
  }

  /* The lane takes the width of the card, under the head; the button that unfolds the scanners is a touch target. */
  .hx-hl-lane,
  .hx-hl-space .hx-hl-strip,
  .hx-hl-bound .hx-hl-strip {
    height: 28px;
  }

  .hx-hl-more,
  .hx-hl-more--quiet {
    min-height: 44px;
  }

  /* A boundary is a compact card: its name, its metrics, its lane. */
  .hx-hl-bound {
    padding: 8px 0;
  }

  /* The caret is a touch target; every lane gives it, or what stands for it, the same room. */
  .hx-hl-site {
    --hx-hl-caret: 44px;
  }

  .hx-hl-lanebox {
    gap: 4px;
  }

  .hx-hl-row {
    padding: 14px 8px;
  }

  .hx-hl-row .hx-hl-lanebox .hx-hl-strip {
    height: 28px;
  }

  /* The four charts of a scanner, unfolded: two across, as wide as the card. */
  .hx-hl-row__charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    padding-right: 0;
  }

  .hx-hl-row--skeleton {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  /* A scan in the dialog: when it began and how it ended, then the rest under them. */
  .hx-hl-scans__legend {
    display: none;
  }

  .hx-hl-scan__head {
    grid-template-columns: 16px minmax(0, 1fr) auto auto;
    row-gap: 4px;
    padding: 10px 12px;
  }

  /* The time, how long it took and the box on one line, as columns; the flags (how it ended first) under them. */
  .hx-hl-scan__duration {
    grid-row: 1;
    grid-column: 3;
    justify-self: end;
    color: var(--color-text-muted);
  }

  .hx-hl-scan__quality {
    grid-row: 1;
    grid-column: 4;
    justify-self: end;
  }

  .hx-hl-scan__flags {
    grid-row: 2;
    grid-column: 2 / -1;
  }

  .hx-hl-scan__flags:empty {
    display: none;
  }

  .hx-hl-scan__more {
    padding-left: 12px;
  }

  .hx-hl-log {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 2px;
  }

  .hx-hl-log__text {
    grid-column: 1 / -1;
  }

  .hx-hl-detail__chart {
    height: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-hl-stat,
  .hx-hl-site__toggle > .bi,
  .hx-hl-site__body,
  .hx-hl-more > .bi,
  .hx-hl-caret > .bi,
  .hx-hl-scan__chevron {
    transition: none;
  }

  /* No fade: the row is marked until the mark is taken off. */
  .hx-hl-row.is-highlighted {
    background: var(--color-accent-tint);
    animation: none;
  }
}

/* ============================================================ end of the Health page */

/* ============================================================ Scanner configuration dialog
   components/scanner-config.js: an accordion of eight sections in a dialog (a full-screen sheet
   on a phone). Prefix `hx-sc-`. */

.hx-sc {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hx-sc-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  margin: 0;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sc-note {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-sc-empty {
  padding: 20px 0;
  margin: 0;
  color: var(--color-text-muted);
  text-align: center;
}

.hx-sc-state {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 16px 0;
  color: var(--color-text-muted);
}

.hx-sc-state--error {
  color: var(--color-error-text);
}

/* ---- the accordion */

.hx-sc-acc {
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.hx-sc-acc__item + .hx-sc-acc__item {
  border-top: 1px solid var(--color-border);
}

.hx-sc-acc__heading {
  margin: 0;
  font: inherit;
}

.hx-sc-acc__head {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-heading);
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 11px;
}

.hx-sc-acc__head:hover {
  background: var(--color-row-hover);
}

.hx-sc-acc__head:focus-visible,
.hx-sc-scan__head:focus-visible,
.hx-sc-hour:focus-visible,
.hx-sc-schedule__head:focus-visible,
.hx-sc-step:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-sc-acc__icon {
  font-size: 16px;
  color: var(--color-text-muted);
}

.hx-sc-acc__title {
  flex: 1;
  min-width: 0;
}

.hx-sc-chevron {
  font-size: 12px;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}

[aria-expanded='false'] > .hx-sc-chevron {
  transform: rotate(-90deg);
}

.hx-sc-acc__panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 14px 18px;
}

.hx-sc-acc__panel[hidden] {
  display: none;
}

/* ---- fields */

.hx-sc-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.hx-sc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.hx-sc-grid--wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.hx-sc-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.hx-sc-group__title {
  padding: 0;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hx-sc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hx-sc-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.hx-sc-field__control {
  display: flex;
  align-items: stretch;
  min-width: 0;
  background: var(--color-field-fill);
  border: 1px solid var(--color-field-outline);
  border-radius: var(--radius-field);
}

.hx-sc-field__control:focus-within {
  border-color: var(--color-focus);
  box-shadow: inset 0 0 0 1px var(--color-focus);
}

.hx-sc-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 6px 10px;
  font: inherit;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  background: none;
  border: 0;
  outline: none;
}

.hx-sc-input:disabled {
  color: var(--color-text-disabled);
}

.hx-sc-field__unit {
  display: flex;
  flex: none;
  align-items: center;
  padding: 0 10px 0 2px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-sc-toggle {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-field);
}

/* A servo value: steppers around the number, a slider under them. It moves the scanner. */
.hx-sc-servos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.hx-sc-field--servo .hx-sc-field__label {
  color: var(--status-ok);
}

.hx-sc-field--servo .hx-sc-input {
  text-align: center;
}

.hx-sc-step {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 40px;
  padding: 0;
  font-size: 14px;
  color: var(--color-heading);
  cursor: pointer;
  background: none;
  border: 0;
}

.hx-sc-step:first-child {
  border-right: 1px solid var(--color-border);
}

.hx-sc-step:last-child {
  border-left: 1px solid var(--color-border);
}

.hx-sc-step:hover:not(:disabled) {
  background: var(--color-row-hover);
}

.hx-sc-step:disabled {
  color: var(--color-text-disabled);
  cursor: not-allowed;
}

.hx-sc-range {
  width: 100%;
  min-height: 32px;
  margin: 0;
  accent-color: var(--status-ok);
}

/* A finger scrolling the dialog catches the slider and moves the scanner: on touch, the steppers and the number only. */
@media (hover: none) and (pointer: coarse) {
  .hx-sc-range {
    display: none;
  }
}

.hx-sc-live {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-sc-live--error {
  color: var(--color-error-text);
}

/* What the scanner answered to a servo value stays in view while the form scrolls. */
.hx-sc-form > .hx-sc-live:not(:empty) {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding: 8px 0;
  background: var(--color-surface-raised);
  border-top: 1px solid var(--color-border);
}

/* ---- diagnostics */

.hx-sc-facts .hx-kv__row {
  grid-template-columns: minmax(96px, 200px) minmax(0, 1fr);
  padding: 6px 0;
  font-size: 14px;
}

.hx-sc-facts .hx-kv__value {
  overflow-wrap: anywhere;
}

.hx-sc-status {
  display: flex;
}

.hx-sc-result {
  min-height: 96px;
  max-height: 240px;
  padding: 10px 12px;
  overflow: auto;
  font-size: 13px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sc-result p {
  margin: 0;
}

.hx-sc-result__empty {
  color: var(--color-text-muted);
}

.hx-sc-result__head {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin-bottom: 8px !important;
  color: var(--color-text-muted);
}

.hx-sc-result__head strong {
  color: var(--color-heading);
}

.hx-sc-result__wait,
.hx-sc-result__error {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hx-sc-result__error {
  color: var(--color-error-text);
}

.hx-sc-result__text {
  margin: 0;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hx-sc-result__list {
  display: grid;
  gap: 4px;
  margin: 0;
}

.hx-sc-result__list > div {
  display: grid;
  grid-template-columns: minmax(80px, 160px) minmax(0, 1fr);
  gap: 12px;
}

.hx-sc-result__list dt {
  color: var(--color-text-muted);
}

.hx-sc-result__list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.hx-sc-result__list ul {
  padding-left: 16px;
  margin: 0;
  columns: 2;
}

.hx-sc-cmd {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.hx-sc-cmd__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-heading);
}

.hx-sc-cmd__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hx-sc-cmd__buttons .btn {
  min-width: 52px;
  min-height: 36px;
}

.hx-sc-wifi {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding-top: 6px;
}

/* ---- schedule: an hour is a cell, seven days across, 24 hours down */

.hx-sc-schedule {
  display: grid;
  grid-template-columns: 52px repeat(7, minmax(0, 1fr));
  gap: 3px;
  max-width: 520px;
}

.hx-sc-schedule__head {
  min-height: 24px;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 4px;
}

.hx-sc-schedule__head--hour {
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.hx-sc-schedule__head:hover:not(:disabled) {
  color: var(--color-heading);
  background: var(--color-row-hover);
}

.hx-sc-hour {
  min-height: 22px;
  padding: 0;
  cursor: pointer;
  background: var(--color-lane-empty);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.hx-sc-hour[aria-pressed='true'] {
  background: var(--status-ok);
  border-color: var(--status-ok);
}

.hx-sc-hour:hover:not(:disabled) {
  border-color: var(--color-heading);
}

.hx-sc-hour:disabled,
.hx-sc-schedule__head:disabled {
  cursor: default;
}

/* ---- telemetry */

.hx-sc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
  padding-top: 6px;
}

.hx-sc-toolbar--fields,
.hx-sc-toolbar--events {
  align-items: center;
}

.hx-sc-toolbar--fields > .field-group {
  flex: 1 1 160px;
}

.hx-sc-count {
  flex: 1;
  align-self: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-sc-series {
  min-height: 120px;
}

.hx-sc-chart {
  position: relative;
  height: 280px;
}

.hx-sc-chart__state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hx-sc-table-wrap {
  max-height: 320px;
  overflow: auto;
  border-radius: 10px;
}

.hx-sc-table {
  font-size: 13px;
}

.hx-sc-table th {
  position: sticky;
  top: 0;
  background: var(--color-surface-raised);
}

.hx-sc-table th,
.hx-sc-table td {
  padding: 6px 10px;
  white-space: nowrap;
}

/* ---- scans */

.hx-sc-scans {
  padding: 0;
  margin: 0;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sc-scan + .hx-sc-scan {
  border-top: 1px solid var(--color-border);
}

.hx-sc-scans__legend,
.hx-sc-scan__head {
  display: grid;
  grid-template-columns: 16px minmax(120px, 1fr) minmax(0, auto) 48px 72px 72px 56px;
  column-gap: 10px;
  align-items: center;
}

.hx-sc-scans__legend {
  padding: 0 13px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hx-sc-scans__legend > span:nth-child(n + 4) {
  text-align: right;
}

.hx-sc-scan__head {
  width: 100%;
  min-height: 44px;
  padding: 6px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
}

.hx-sc-scan__head:hover {
  background: var(--color-row-hover);
}

.hx-sc-scan__time {
  font-weight: 600;
  color: var(--color-heading);
  white-space: nowrap;
}

.hx-sc-scan__state .tag {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hx-sc-scan__num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* The quality of a scan: its colour is the classic one (light in both themes), so the text is dark. */
/* Every box the same size, whatever its number ("–", "7", "100"). */
.hx-sc-quality {
  justify-self: end;
  box-sizing: border-box;
  width: 40px;
  padding: 2px 0;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1b2e4b;
  text-align: center;
  border-radius: 6px;
}

.hx-sc-quality--grey {
  filter: grayscale(1);
}

.hx-sc-quality--none {
  color: var(--color-text-muted);
}

/* The waiting upload file of an overdue scan (components/scan-dangling.js), under its row in both scanner dialogs; and
   of a missed scheduled scan, under its row in the Scanner Health dialog. */
.nx-dangling {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 0 12px 10px 40px;
  font-size: 13px;
}

.nx-dangling[hidden] {
  display: none;
}

.nx-dangling__line {
  flex: 1 1 260px;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.nx-dangling__icon {
  margin-right: 6px;
  color: var(--status-warning, #F5A524);
}

.nx-dangling__name {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 12px;
}

.nx-dangling__actions {
  flex: 0 0 auto;
}

@media (max-width: 600px) {
  .nx-dangling {
    padding-left: 12px;
  }
}

/* The space entries of a scan whose file was just processed (components/scan-space-entries.js): the offer to reprocess them. */
.nx-sse__group {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.nx-sse .nx-sse__scan {
  margin: 0;
}

.nx-sse .nx-sse__files {
  margin: 2px 0 6px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 12px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.nx-sse__entries {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nx-sse__entry {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 5px 0;
  font-size: 13px;
}

.nx-sse__label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nx-sse__state {
  color: var(--color-text-muted);
}

.nx-sse__entry--muted {
  color: var(--color-text-muted);
}

.nx-sse__state--waiting,
.nx-sse__state--adding,
.nx-sse__state--added {
  color: var(--status-info);
}

.nx-sse__state--started,
.nx-sse__state--done {
  color: var(--status-ok);
}

/* A calculation of the queue (components/recalculation-queue.js): running, waiting to be started again after a refusal. */
.nx-sse__state--running {
  color: var(--status-info);
}

.nx-sse__state--retrying {
  color: var(--status-warning);
}

/* "Leave out entries calculated since" of "Recalculate volumes" (components/recalculate-volumes.js). */
.nx-sse__leave {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 10px 0;
}

.nx-sse__leave-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.nx-sse .nx-sse__since {
  width: auto;
  max-width: 100%;
}

.nx-sse__leave .nx-sse__note {
  flex-basis: 100%;
  margin: 0;
}

.nx-sse__state--failed {
  color: var(--status-error);
}

/* An entry turned down because a calculation was running (components/scan-space-entries.js, recalculate-volumes.js). */
.nx-sse__state--busy {
  color: var(--status-warning);
}

/* The scans of the window under an entry ("Recalculate volumes", components/recalculate-volumes.js). */
.nx-sse__scans {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.nx-sse__entries--volumes .nx-sse__entry {
  border-top: 1px solid var(--color-border);
}

.nx-sse .nx-sse__problems p {
  margin: 8px 0 2px;
}

.nx-sse__problem-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
}

.nx-sse .nx-sse__note {
  color: var(--color-text-muted);
  font-size: 13px;
}

.nx-sse .nx-sse__status {
  margin-top: 12px;
  font-weight: 600;
}

.nx-sse [hidden] {
  display: none;
}

.hx-sc-scan__more {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 12px 14px 38px;
}

.hx-sc-scan__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 24px;
}

.hx-sc-scan__columns .hx-kv__row {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 3px 0;
  font-size: 13px;
}

.hx-sc-scan__notes {
  padding: 0;
  margin: 0;
  list-style: none;
}

/* ---- logs and events */

.hx-sc-logs,
.hx-sc-events {
  padding: 0;
  margin: 0;
  font-size: 13px;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sc-log {
  display: grid;
  grid-template-columns: 128px 24px minmax(0, 1fr);
  column-gap: 12px;
  align-items: baseline;
  padding: 6px 12px;
}

.hx-sc-log + .hx-sc-log,
.hx-sc-event + .hx-sc-event {
  border-top: 1px solid var(--color-border);
}

.hx-sc-log__time,
.hx-sc-event__time {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.hx-sc-log__level {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.hx-sc-log__text {
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.hx-sc-event {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
}

.hx-sc-event__icon {
  flex: none;
  margin-top: 2px;
  font-size: 16px;
}

.hx-sc-event__text {
  flex: 1;
  min-width: 0;
}

.hx-sc-event__text p {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.hx-sc-event__time {
  margin-left: 12px;
}

.hx-sc-event__resolution {
  color: var(--color-text-muted);
}

.hx-sc-reset {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hx-sc-reset p {
  margin: 0;
}

/* ---- the dialog of a space (components/space-config.js): what the classes above do not cover */

.hx-sc-push {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--color-border);
}

.hx-sc-push__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
}

.hx-sc-pins {
  padding: 0;
  margin: 0 0 10px;
  list-style: none;
}

.hx-sc-pin {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 2px 0;
}

/* The search window between its minus and plus buttons (the row of the settings of a scan, pcd-scan-configure.js). */
.hx-sc-window {
  max-width: 340px;
  align-items: center;
}

.hx-sc-notice + .hx-sc-pins {
  margin-top: 10px;
}

.hx-sc-pin + .hx-sc-pin {
  border-top: 1px solid var(--color-border);
}

.hx-sc-pin__name {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Pinned Boundaries, "Not in use": the unpinned ones (marked not in use: api/space_standards.php), under the ones in use. */
.hx-sc-unused {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--color-border);
}

.hx-sc-unused[hidden] {
  display: none;
}

.hx-sc-unused__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
}

.hx-sc-pins--unused .hx-sc-pin__name {
  display: flex;
  flex-direction: column;
}

.hx-sc-pin__when {
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-sc-pin__delete.btn,
.hx-sc-pin__delete {
  flex: none;
  color: var(--color-error-text);
}

.hx-sc-data .hx-sc-data__act {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

/* ---- phones: two fields across, a finger-sized hour, the counts of a scan under its time */

@media (max-width: 599.98px) {
  .hx-sc-dialog.dialog__body {
    padding-right: 12px;
    padding-left: 12px;
  }

  .hx-sc-acc__panel {
    padding: 6px 10px 16px;
  }

  .hx-sc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hx-sc-grid--wide,
  .hx-sc-servos,
  .hx-sc-scan__columns {
    grid-template-columns: minmax(0, 1fr);
  }

  /* One column: the line between the rows goes on between the two lists. */
  .hx-sc-scan__columns {
    row-gap: 0;
  }

  .hx-sc-scan__columns .hx-kv + .hx-kv {
    border-top: 1px solid var(--color-border);
  }

  .hx-sc-cmd {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .hx-sc-cmd__buttons .btn {
    min-height: 44px;
  }

  .hx-sc-wifi {
    grid-template-columns: minmax(0, 1fr);
  }

  .hx-sc-schedule {
    grid-template-columns: 44px repeat(7, minmax(0, 1fr));
  }

  .hx-sc-hour {
    min-height: 30px;
  }

  .hx-sc-schedule__head {
    min-height: 30px;
  }

  .hx-sc-toolbar > .hx-sc-field {
    flex: 1 1 100%;
  }

  .hx-sc-chart {
    height: 220px;
  }

  .hx-sc-scans__legend {
    display: none;
  }

  .hx-sc-scan__head {
    grid-template-columns: 16px minmax(0, 1fr) minmax(0, auto) 44px;
  }

  .hx-sc-scan__num {
    display: none;
  }

  .hx-sc-scan__more {
    padding-left: 12px;
  }

  .hx-sc-log {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 2px;
  }

  .hx-sc-log__text {
    grid-column: 1 / -1;
  }

  .hx-sc-result__list ul {
    columns: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-sc-chevron {
    transition: none;
  }
}

/* ============================================================ Space Schedules dialog
   components/client-spaces.js: one schedule for many spaces of a client. The grid, the notes, the states and the table
   come from the `hx-sc-` classes above, the strip from `hx-strip` (Spaces tab); this is what they do not cover. Prefix `hx-csp-`. */

.hx-csp {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hx-csp-client {
  max-width: 460px;
}

/* The editor: the week on the left, what to do with it on the right. A shorter hour than the dialog of one schedule has. */
.hx-csp-editor {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.hx-csp-editor[hidden] {
  display: none;
}

.hx-csp-editor__grid,
.hx-csp-editor__side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.hx-csp-editor .hx-sc-hour {
  min-height: 16px;
}

.hx-csp-editor .hx-sc-schedule__head {
  min-height: 18px;
}

.hx-csp-editor__side .btn--primary {
  align-self: flex-start;
}

.hx-csp-source {
  color: var(--color-heading);
}

.hx-csp-notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hx-csp-notes:empty {
  display: none;
}

/* ---- the table: it scrolls sideways where it does not fit */

.hx-csp-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-csp-table {
  min-width: 640px;
  margin: 0;
}

.hx-csp-table th {
  position: static;
}

.hx-csp-table .hx-csp-table__check {
  width: 1%;
}

.hx-csp-table .hx-csp-table__act {
  width: 1%;
  text-align: right;
}

.hx-csp-mini {
  display: block;
  padding: 4px;
  margin: -4px;
  font: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
}

.hx-csp-mini:hover {
  background: var(--color-row-hover);
}

.hx-csp-mini:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.hx-csp-scanners {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.hx-csp-warn {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--color-warning-text);
}

/* ---- the confirmation */

.hx-csp-confirm p {
  margin: 0 0 8px;
}

.hx-csp-list {
  padding-left: 20px;
  margin: 0 0 12px;
}

.hx-csp-list--scanners {
  padding-left: 0;
  list-style: none;
}

.hx-csp-muted {
  color: var(--color-text-muted);
}

@media (max-width: 767.98px) {
  .hx-csp-editor {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .hx-csp-editor .hx-sc-hour {
    min-height: 26px;
  }

  .hx-csp-editor .hx-sc-schedule__head {
    min-height: 26px;
  }

  .hx-csp-editor__side .btn--primary {
    align-self: stretch;
  }

  .hx-csp-client {
    max-width: none;
  }
}

/* ============================================================ Client materials dialog
   components/client-materials.js: the materials of a client, grouped by name, in an accordion whose rows line up in columns, with an
   editor for several copies at once. The accordion, the notes, the states and the table come from the `hx-sc-` and `hx-csp-` classes
   above; this is what they do not cover. Prefix `hx-cmt-`. */

/* ---- the rows: the toggle holds four columns, the stored tonnage sits beside it (a button cannot hold a button) */

.hx-cmt-labels,
.hx-cmt-row {
  display: flex;
  align-items: center;
}

.hx-cmt-labels {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.hx-cmt-labels__grid,
.hx-cmt-toggle {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 84px 140px 160px;
  gap: 12px;
  align-items: center;
}

.hx-cmt-labels__grid {
  flex: 1;
  min-width: 0;
  padding: 0 14px;
}

.hx-cmt-labels__stale,
.hx-cmt-cell--stale {
  flex: none;
  width: 200px;
  padding-right: 14px;
}

.hx-cmt-heading {
  flex: 1;
  min-width: 0;
}

.hx-cmt-toggle {
  width: 100%;
}

.hx-cmt-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  align-items: center;
  min-width: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text);
}

.hx-cmt-cell--name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-cmt-cell--stale {
  flex-wrap: nowrap;
  gap: 6px;
}

/* ---- the open group */

.hx-cmt-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.hx-cmt-apply {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.hx-cmt-apply__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-cmt-apply__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
}

.hx-cmt-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hx-cmt-field {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
}

.hx-cmt-field > .checkbox-row {
  padding-right: 0;
  padding-left: 0;
}

.hx-cmt-field__density {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 8px;
}

.hx-cmt-field__note {
  grid-column: 2 / -1;
}

/* ---- the color picker: what is chosen, and the palette under it */

.hx-cmt-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.hx-cmt-pick {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.hx-cmt-pick:hover {
  background: var(--color-row-hover);
}

.hx-cmt-pick:focus-visible,
.hx-cmt-chip:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-cmt-chosen {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.hx-cmt-pick__caret {
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-cmt-palette {
  display: grid;
  grid-template-columns: repeat(8, 28px);
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-cmt-palette[hidden] {
  display: none;
}

.hx-cmt-chip {
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  border: 1px solid var(--color-border-strong, var(--color-text-muted));
  border-radius: 6px;
}

.hx-cmt-chip[aria-checked='true'] {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

/* ---- the table of the copies */

.hx-cmt-table {
  min-width: 560px;
}

.hx-cmt-color {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.hx-cmt-actions {
  white-space: nowrap;
}

/* ---- the progress of a recompute */

.hx-cmt-progress {
  margin: 0 0 8px;
  font-weight: 700;
}

/* ---- phones: a group is a card, its figures under its name with their labels */

@media (max-width: 767.98px) {
  .hx-cmt-labels {
    display: none;
  }

  .hx-cmt-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hx-cmt-toggle {
    grid-template-columns: 14px repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .hx-cmt-cell--name {
    grid-column: 2 / -1;
  }

  .hx-cmt-cell--copies {
    grid-column: 2;
  }

  .hx-cmt-cell:not(.hx-cmt-cell--name)::before {
    width: 100%;
    font-size: 11px;
    color: var(--color-text-muted);
    content: attr(data-label);
  }

  .hx-cmt-cell--stale {
    flex-wrap: wrap;
    width: auto;
    padding: 0 14px 10px 40px;
  }

  .hx-cmt-field {
    grid-template-columns: minmax(0, 1fr);
  }

  .hx-cmt-field__note {
    grid-column: 1;
  }

  .hx-cmt-apply__actions .btn {
    width: 100%;
  }

  .hx-cmt-palette {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    width: 100%;
  }

  .hx-cmt-chip {
    width: auto;
    height: 32px;
  }
}

/* ============================================================ User logs dialog
   components/user-logs.js: a toolbar of filters over a table (components/stack-table.js, so
   the shared `hx-bill-table` rules make it stacked blocks where there is no room for columns).
   Prefix `hx-ul-`. */

.hx-ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
  container-type: inline-size;
}

.hx-ul__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  padding-top: 6px;
}

.hx-ul__field {
  flex: 1 1 180px;
  min-width: 0;
}

.hx-ul__field--find {
  flex: 2 1 240px;
}

/* The order is turned by the heading of "When"; this button stands for it where the table is stacked. */
.btn.hx-ul__order {
  display: none;
}

/* "Pictures" of the Service tab of one site (components/site-pictures.js): a section per event or resolution that has
   pictures, its kind, title and time over the pictures block of the detail dialogs. */
.hx-sv-pics {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hx-sv-pics__record {
  padding: 12px 16px 14px;
}

.hx-sv-pics__head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  margin-bottom: 8px;
}

.hx-sv-pics__kind {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.hx-sv-pics__title {
  font-weight: 600;
  color: var(--color-text);
}

.hx-sv-pics__when {
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-sv-pics__head > .btn {
  margin-left: auto;
}

/* Until its pictures are asked for (it is not near the screen yet): room for one row of tiles. */
.hx-sv-pics__slot:empty {
  min-height: 96px;
}

/* Under an event of a resolution card (pages/service.js `visitCard`): its scanners and spaces with their symptoms,
   indented past the icon of the event as the symptoms are under a scanner. */
.hx-sv-cards__symptoms {
  display: block;
  margin-left: 6px;
  padding-left: 12px;
}

.hx-sv-cards__symptoms > .hx-ev-about {
  margin-top: 0;
}

/* The events of a resolution card folded (components/open-events-dialog.js `resolutionRow` with `foldEvents`: "Needs
   attention" and its dialog, Kyle 2026-10-31): under the card's button, in line with its text, each event a line that
   opens to its symptoms; an event with no symptoms a plain line, set in by the chevron's width so the names line up. */
.hx-sv-cards__events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 20px 12px 80px;
}

/* A card without the big icon (`is-plain`: "Needs attention" and its dialog, Kyle 2026-10-31): its text, its events and
   the band of its answer all start at the button's own left padding, so the text lines up with the events' chevrons. */
.nx-queue__item.is-plain {
  grid-template-columns: minmax(0, 1fr) auto;
}

.hx-sv-cards__wrap.is-plain > .hx-sv-cards__events,
.hx-sv-cards__wrap.is-plain > .hx-sv-cards__answers {
  padding-left: 22px;
}

/* With events under it, the card's button keeps little room below its text: the events follow closely, and the
   button's hover background ends above them instead of running under the first (Kyle 2026-10-31). */
.hx-sv-cards__wrap.has-events > .nx-queue__item {
  padding-bottom: 4px;
}

.hx-sv-cards__event-fold > summary {
  display: flex;
  gap: 4px;
  align-items: baseline;
  cursor: pointer;
  list-style: none;
}

.hx-sv-cards__event-fold > summary::-webkit-details-marker {
  display: none;
}

.hx-sv-cards__event-fold > summary:hover .hx-ev-about__name {
  text-decoration: underline;
}

.hx-sv-cards__event-fold > summary:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.hx-sv-cards__event-chevron {
  flex: none;
  width: 14px;
  font-size: 11px;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}

.hx-sv-cards__event-fold[open] .hx-sv-cards__event-chevron {
  transform: rotate(90deg);
}

.hx-sv-cards__event-line {
  padding-left: 18px;
}

.hx-sv-cards__event-fold > .hx-sv-cards__symptoms {
  margin: 4px 0 2px 18px;
}

@media (max-width: 719.98px) {
  .hx-sv-cards__events {
    padding: 0 14px 12px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-sv-cards__event-chevron {
    transition: none;
  }
}

/* The card of a proposal in "Needs attention" with its answer (components/open-events-dialog.js `resolutionRow`): the
   card's own button, then a band of buttons under its text ("Accept…", "Decline…", "Contact Altamus"), beside the
   button and never in it. The stripe of the level runs down both. */
.hx-sv-cards__wrap {
  position: relative;
}

.hx-sv-cards__wrap::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: 4px;
  content: '';
  background: var(--nx-item-color, var(--status-unknown));
}

.hx-sv-cards__wrap + .hx-sv-cards__wrap,
.hx-sv-cards__wrap + .nx-queue__item,
.nx-queue__item + .hx-sv-cards__wrap {
  border-top: 1px solid var(--color-border);
}

.hx-sv-cards__answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 14px 80px;
}

.hx-sv-cards__answer-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hx-sv-cards__answer-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hx-sv-cards__ask {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.hx-sv-cards__ask > .bi {
  flex: none;
  margin-top: 2px;
}

.hx-sv-cards__wrap.is-busy .hx-sv-cards__answers {
  opacity: 0.7;
}

/* A phone: the band starts under the icon too, its buttons sharing the width. */
@media (max-width: 719.98px) {
  .hx-sv-cards__answers {
    padding: 0 14px 14px 22px;
  }

  .hx-sv-cards__answer-buttons > .btn {
    flex: 1 1 auto;
  }

  /* Accept and Decline: a line of their own across the card, half each. */
  .hx-sv-cards__answer-pair {
    flex: 1 1 100%;
  }
}


.hx-ul__count {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* The sites of the user the log is narrowed to: a title, how many, and the names as tags. */
.hx-ul__sites {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-ul__sites[hidden] {
  display: none;
}

.hx-ul__sites:focus,
.hx-ul__site-list:focus {
  outline: none;
}

.hx-ul__sites-head {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  align-items: baseline;
}

.hx-ul__sites-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-ul__sites-count,
.hx-ul__sites-legend,
.hx-ul__sites-state {
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-ul__sites-legend {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.hx-ul__sites-legend .bi {
  color: var(--status-info);
}

.hx-ul__sites-state {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin: 0;
}

.hx-ul__sites-state--error {
  color: var(--color-error-text);
}

.hx-ul__site-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hx-ul__site {
  gap: 5px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* A site that is a link to its page: the whole tag takes the pointer. */
.hx-ul__site--link {
  position: relative;
  cursor: pointer;
}

.hx-ul__site--link:hover {
  filter: brightness(1.15);
}

.hx-ul__site-link {
  color: inherit;
  text-decoration: none;
}

.hx-ul__site-link::after {
  position: absolute;
  inset: 0;
  content: '';
  border-radius: inherit;
}

.hx-ul__site-link:hover,
.hx-ul__site-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* The name of a user in a row: pressing it puts the name in the text filter, or takes it out. */
.hx-ul__user {
  padding: 2px 6px;
  margin: -2px -6px;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
}

.hx-ul__user:hover {
  color: var(--color-accent-text);
  text-decoration: underline;
}

.hx-ul__user[aria-pressed='true'] {
  color: var(--color-on-accent-tint);
  background: var(--color-accent-tint);
}

.hx-ul__user:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

.hx-ul__card {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-ul__table {
  font-size: 13.5px;
}

.hx-ul__table td[data-label='When'],
.hx-ul__table td[data-label='User'] {
  white-space: nowrap;
}

.hx-ul__table td[data-label='When'] {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.hx-ul__row:hover {
  background: var(--color-row-hover);
}

.hx-ul__sort {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
}

.hx-ul__sort:hover {
  color: var(--color-heading);
}

.hx-ul__sort:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.hx-ul__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  min-width: 0;
}

.hx-ul__line {
  overflow-wrap: anywhere;
}

.hx-ul__line--more {
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-ul__view {
  font-size: 13px;
}

.hx-ul__table th:last-child:has(.sr-only),
.hx-ul__table td.hx-ul__delete {
  width: 1%;
  padding-top: 5px;
  padding-bottom: 5px;
  text-align: right;
}

.hx-ul__delete .icon-btn {
  width: 32px;
  height: 32px;
  font-size: 15px;
}

.hx-ul__more {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.hx-ul__skeleton {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 0;
}

.hx-ul__skeleton .hx-skeleton__line {
  height: 18px;
}

/* Stacked (the breakpoint of `hx-bill-table`): the values are at the right, the delete button in
   the corner of the block, beside the action that heads it. */
@container (max-width: 820px) {
  .btn.hx-ul__order {
    display: inline-flex;
  }

  .hx-ul__details {
    align-items: flex-end;
  }

  .hx-ul__table td[data-label='When'] {
    color: inherit;
  }

  .hx-ul__row {
    position: relative;
  }

  .hx-ul__row:has(.hx-ul__delete) > .hx-bill-table__main {
    padding-right: 48px;
  }

  .table.hx-ul__table td.hx-ul__delete {
    position: absolute;
    top: 10px;
    right: 10px;
    display: block;
    width: auto;
    padding: 0;
  }

  .hx-ul__table td.hx-ul__delete::before {
    content: none;
  }
}

@media (max-width: 599.98px) {
  .hx-ul-dialog.dialog__body {
    padding-right: 12px;
    padding-left: 12px;
  }

  .hx-ul__toolbar > .hx-ul__field {
    flex: 1 1 100%;
  }

  .hx-ul__view {
    min-height: 44px;
  }

  /* A finger-sized target around the name, without a taller mark when it is pressed. */
  .hx-ul__user {
    position: relative;
  }

  .hx-ul__user::after {
    position: absolute;
    inset: -10px -6px;
    content: '';
  }

  .hx-ul__sites .btn {
    min-height: 44px;
  }

  .hx-ul__delete .icon-btn {
    width: 44px;
    height: 44px;
  }

  .table.hx-ul__table td.hx-ul__delete {
    top: 2px;
    right: 4px;
  }

  .hx-ul__more .btn {
    min-height: 44px;
  }
}

/* ============================================================ end of the User logs dialog */

/* ============================================================ User management dialog
   components/user-management.js: a toolbar over a list of users (one block per user, the
   actions beside it, under it where there is no room), and the form of a user in a second
   dialog. The skeleton and the page states are the shared ones. Prefix `hx-um-`. */

.hx-um {
  display: flex;
  flex-direction: column;
  gap: 12px;
  container-type: inline-size;
}

.hx-um__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  padding-top: 6px;
}

.hx-um__field {
  flex: 1 1 180px;
  min-width: 0;
}

.hx-um__field--find {
  flex: 2 1 240px;
}

.hx-um__toolbar > .hx-um__staff {
  flex: none;
}

.hx-um__toolbar > .hx-um__new {
  flex: none;
  margin-left: auto;
}

.hx-um__count {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-um__list {
  padding: 0;
  margin: 0;
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-um__row {
  display: flex;
  gap: 8px 16px;
  align-items: center;
  padding: 12px 14px;
}

.hx-um__row + .hx-um__row {
  border-top: 1px solid var(--color-border);
}

.hx-um__row:hover {
  background: var(--color-row-hover);
}

.hx-um__row[aria-busy='true'] .hx-um__who {
  opacity: 0.6;
}

.hx-um__who {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hx-um__name-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.hx-um__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-um__meta,
.hx-um__sites {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  align-items: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-um__username,
.hx-um__contact {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hx-um__contact,
.hx-um__sites {
  display: inline-flex;
  gap: 5px;
}

.hx-um__sites {
  display: flex;
  gap: 2px 6px;
}

.hx-um__elsewhere {
  padding: 1px 7px;
  font-size: 12px;
  border: 1px dashed var(--color-border);
  border-radius: 999px;
}

.hx-um__actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
}

.hx-um__actions .icon-btn {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

.hx-um__actions .icon-btn:disabled,
.hx-um__actions .btn:disabled {
  cursor: default;
  opacity: 0.5;
}

.hx-um__delete:hover:not(:disabled) {
  color: var(--color-error-text);
}

.hx-um__more {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

/* ----- the form of a user ----- */

.hx-um-form,
.hx-um-form__part {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hx-um-form {
  padding-top: 8px;
}

.hx-um-form__part {
  gap: 6px;
}

.hx-um-form [hidden] {
  display: none;
}

.hx-um-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 12px;
}

.hx-um-form__note {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* The username of a user that is there, and a role that cannot be changed: said, not typed. */
.hx-um-form__fixed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hx-um-form__fixed-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.hx-um-form__fixed-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

/* The password, and the button that shows it beside it. */
.hx-um-form__password {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.hx-um-form__password-field {
  flex: 1;
  min-width: 0;
}

.hx-um-form__reveal {
  flex: none;
  margin-top: 4px;
}

/* The sites: a list of ticks that scrolls when it is long. */
.hx-um-form__sites {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.hx-um-form__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-um-form__picked {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.hx-um-form__site-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}

.hx-um-form__site-find {
  flex: 1 1 200px;
  min-width: 0;
}

.hx-um-form__site-buttons {
  display: flex;
  flex: none;
  gap: 4px;
}

/* The parts of My sites (my-sites.js), with their headings stuck to the top while the sites scroll. */
.hx-um-form__picks {
  max-height: min(50vh, 360px);
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-um-form__picks > .hx-um-form__note {
  padding: 12px 14px;
}

.hx-um-form__pick {
  display: flex;
  min-height: 40px;
  padding: 6px 14px;
  margin: 0;
  cursor: pointer;
}

.hx-um-form__pick + .hx-um-form__pick {
  border-top: 1px solid var(--color-border);
}

.hx-um-form__pick:hover {
  background: var(--color-row-hover);
}

.hx-um-form__pick .checkbox-row__label {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* What the server refused: over the buttons. */
.hx-um-form__alert {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 14px;
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-error-text);
  background: var(--color-error-tint);
  border-radius: 10px;
}

.hx-um-form__alert > span {
  flex: 1 1 220px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hx-um-form__alert[hidden] {
  display: none;
}

/* No room for the actions beside the user: they go under, at the start. */
@container (max-width: 640px) {
  .hx-um__row {
    flex-direction: column;
    align-items: stretch;
  }

  .hx-um__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 599.98px) {
  .hx-um-dialog.dialog__body {
    padding-right: 12px;
    padding-left: 12px;
  }

  .hx-um__toolbar > .hx-um__field {
    flex: 1 1 100%;
  }

  .hx-um__toolbar > .hx-um__new {
    flex: 1 1 100%;
    min-height: 44px;
    margin-left: 0;
  }

  .hx-um__row {
    padding: 12px;
  }

  .hx-um__actions .icon-btn,
  .hx-um__actions .btn,
  .hx-um__more .btn,
  .hx-um-form__site-buttons .btn {
    min-height: 44px;
  }

  .hx-um__actions .icon-btn,
  .hx-um-form__reveal {
    width: 44px;
    height: 44px;
  }

  .hx-um-form__reveal {
    margin-top: 2px;
  }

  .hx-um-form__pick {
    min-height: 44px;
  }
}

/* ============================================================ end of the User management dialog */

/* ============================================================ System logs dialog
   components/scanner-logs.js, through components/log-dialog.js: the dialog of the user logs,
   with its `hx-ul-` rules. Only what those do not have is here. Prefix `hx-lg-`. */

.hx-lg__table td[data-label='Level'] {
  white-space: nowrap;
}

/* The names of a site and of a scanner are short: they keep some room beside a long message. */
.hx-lg__table td[data-label='Site'],
.hx-lg__table td[data-label='Scanner'] {
  min-width: 150px;
}

@container (max-width: 820px) {
  .hx-lg__table td[data-label='Site'],
  .hx-lg__table td[data-label='Scanner'] {
    min-width: 0;
  }
}

/* ============================================================ end of the System logs dialog */

/* ============================================================ Service page
   pages/service.js, components/service-detail.js and components/service-pictures.js: the events
   of the sites and the service visits that answer them, with their pictures. The toolbar, the count, the table and its pages are the ones of the
   logs (`hx-ul-` rules, components/stack-table.js); only what those do not have is here.
   Prefix `hx-sv-`. */

.hx-sv__content {
  gap: 16px;
  padding-top: 24px;
}

.hx-sv__stats:empty {
  display: none;
}

/* How many are open or planned, beside the name of a view. */
.hx-sv__tab-count {
  min-width: 22px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  color: var(--color-on-accent-tint);
  text-align: center;
  background: var(--color-accent-tint);
  border-radius: 999px;
}

.hx-sv__tab-count[hidden] {
  display: none;
}

/* My sites | All and "Edit my sites", over the toolbar: clear of the labels of its fields. */
/* My sites | All and "Edit my sites" of the Service page, above the bar of the views (pages/service.js): within the
   width of the content, as the tabs under it. */
.hx-sv__sitebar {
  max-width: 1280px;
  /* As far under the band as the same bar of the Sites, Health, Devices and Billing pages (the top of .nx-content),
     and the tabs as far under it as the first section there (24px; 20px on a phone). */
  padding: 36px clamp(16px, 4vw, 40px) 24px;
  margin: 0 auto;
}

.hx-sv__sitebar > .hx-sv__sites {
  margin-bottom: 0;
}

/* On a phone .nx-content starts 24px under the band (next.css): so does the bar. */
@media (max-width: 719.98px) {
  .hx-sv__sitebar {
    padding-top: 24px;
    padding-bottom: 20px;
  }
}

.hx-sv__toolbar > [hidden],
.hx-sv__note[hidden],
.hx-sv-hero .nx-hero__lead[hidden],
.hx-sv__stats[hidden] {
  display: none;
}

.hx-sv__toolbar > .hx-sv__field--level,
.hx-sv__toolbar > .hx-sv__field--sort {
  flex: 0 1 170px;
}

/* The fields of the toolbar of the Service page show no label (pages/service.js `hx-sv__bare`), as the order and the
   filters of "Needs attention" on the Health page: what each is set to says what it is, and the search field has a
   placeholder. The label stays for a screen reader. */
.field-group.hx-sv__bare .field > .field__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Without a label over them they need less room: as tall as the switches beside them. */
.field-group.hx-sv__bare .field__input {
  min-height: 36px;
  height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.hx-sv__scope {
  display: flex;
  flex: none;
}

.hx-sv__note {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* The Service and the Health tab of a site (pages/service.js `mountSiteEvents`, pages/health.js `mountSiteHealth`):
   laid out as their page (Kyle, 2026-11-11), the bar, the full-width bar of the views, the content; but the views do
   not stick there, under the tabs of the site, which do (`.hx-tabs`). */
.hx-site-tabpage > .hx-sv__tabs {
  position: static;
  z-index: auto;
}

/* "List | Board" at the right end of the bar of the sites (Kyle, 2026-11-10), as on the Health page. With the Board
   the bar of the views is not shown: the board follows the bar of the sites as far down as the tabs do. */
.hx-sv__sitebar + .hx-sv__tabs[hidden] + .hx-sv__content {
  padding-top: 0;
}

/* A row opens its record. */
.hx-sv__row {
  cursor: pointer;
}

.hx-sv__open {
  padding: 2px 0;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: 0;
}

.hx-sv__open:hover,
.hx-sv__row:hover .hx-sv__open {
  color: var(--color-accent-text);
  text-decoration: underline;
}

.hx-sv__open:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.hx-sv__table td[data-label='When'],
.hx-sv__table td[data-label='Arrival'] {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.hx-sv__table td[data-label='Level'],
.hx-sv__table td[data-label='Type'],
.hx-sv__table td[data-label='Visit'],
.hx-sv__table td[data-label='Status'],
.hx-sv__table td[data-label='Events'] {
  white-space: nowrap;
}

/* The names of a site, a device and a person are short: they keep some room beside the details. */
.hx-sv__table td[data-label='Site'] {
  min-width: 120px;
}

.hx-sv__table td[data-label='Device'],
.hx-sv__table td[data-label='Technician'] {
  min-width: 110px;
}

.hx-sv__table td[data-label='Details'] {
  min-width: 140px;
}

/* Where the columns still need more than the panel has (a window just wider than the one that stacks the rows),
   the table scrolls sideways within its card (which cuts off what runs over its edge) and no column is lost. */
.hx-sv__panel .hx-ul__card {
  overflow-x: auto;
}

.hx-sv__site {
  text-align: left;
  overflow-wrap: anywhere;
}

/* What was written can be very long: two lines of it, the rest in the detail. */
.hx-sv__clamp {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.hx-sv__events {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  justify-content: inherit;
}

/* The details of a row, and under them how many pictures it has. */
.hx-sv__details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hx-sv__pictures {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.hx-sv__none {
  color: var(--color-text-muted);
}

/* The buttons over the open events of a site page (pages/site.js): Service, Site summary. */
/* A row of "Needs attention" that opens an event (pages/overview.js, pages/health.js; service-dialogs.js): a
   button with the look next.css gives a row, as the link rows beside it. While its event is asked for a
   spinner stands in its icon. */
.hx-sv-queue__item {
  font: inherit;
}

.hx-sv-queue__item:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-sv-queue__item.is-loading {
  cursor: progress;
}

/* ---- the detail of an event or a visit (components/service-detail.js) */

.hx-sv-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* The columns of an event (below) go by the width of the detail, a window or a dialog. */
  container-type: inline-size;
}

/* The detail of an event: two columns where it is wide (its window opens twice as wide on a wide screen,
   components/service-frame.js): the tags, the facts, the details, the pictures and the related events left; the symptoms
   and the resolution right. One under the other where it is not. */
.hx-sv-detail__cols,
.hx-sv-detail__col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

@container (min-width: 760px) {
  .hx-sv-detail__cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px 32px;
    align-items: start;
  }

  /* The right column starts level with the left: its first part has no line over it. */
  .hx-sv-detail__col > .hx-sv-detail__part:first-child {
    padding-top: 0;
    border-top: 0;
  }

  /* The detail of a resolution and of an event (`--list`): as the forms (Kyle, 2026-11-13: "same behavior for the view
     resolution dialog", "the event dialog should have the same behaviors"). The LIST of its right column is the events
     of a resolution, the symptoms of an event (`LIST` below); the parts over it (the details, the pictures) keep their
     height. As high as its content, its window up to 90% of the page (components/service-frame.js, `fill`): the whole
     list, no scroll bar, reaching down to the foot of the left column when that is higher. A window of a fixed height
     (`.is-filled` of js/pcd/window.js: stopped at that 90%, resized, maximised): the columns take what is left of the
     body (the detail is a flex column), the right column is as tall as that, never under MIN, and the list takes what
     the parts over it leave and scrolls inside. `contain: size` keeps that list from making the row taller. */
  .hx-sv-detail__cols--list {
    align-items: stretch;
  }

  .hx-sv-detail__cols--list > .hx-sv-detail__col:last-child > * {
    flex: none;
  }

  /* LIST: the part that holds it, and the list. */
  .hx-sv-detail__cols--list > .hx-sv-detail__col:last-child > .hx-sv-detail__part:has(> .hx-sv-detail__events, > .hx-sv-detail__symptoms-list) {
    flex: 1 1 auto;
    min-height: 0;
  }

  .hx-sv-detail__cols--list > .hx-sv-detail__col:last-child > .hx-sv-detail__part > :is(.hx-sv-detail__events, .hx-sv-detail__symptoms-list) {
    flex: 1 1 auto;
    max-height: none;
  }

  .is-filled .hx-sv-detail__cols--list {
    flex: 1 0 auto;
  }

  .is-filled .hx-sv-detail__cols--list > .hx-sv-detail__col:last-child {
    contain: size;
    min-height: 400px;
  }

  .is-filled .hx-sv-detail__cols--list > .hx-sv-detail__col:last-child > .hx-sv-detail__part > :is(.hx-sv-detail__events, .hx-sv-detail__symptoms-list) {
    flex-basis: 0;
    min-height: 120px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .is-filled .hx-sv-detail__cols--list > .hx-sv-detail__col:last-child > .hx-sv-detail__part > .hx-sv-detail__events {
    padding-right: 4px;
  }
}

/* ---- a detail as a window (components/service-frame.js): one of the windows of js/pcd/window.js, as high as its
 * content and no higher than the page (the script gives it the limit): its body scrolls then, and its buttons stay. */

.hx-sv-window .hx-pcd-window__body {
  flex-direction: column;
}

/* The window itself has the focus (it just opened, or what had it was drawn again): said as for a button. */
.hx-sv-window:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-sv-window__body {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 20px 20px;
  overflow: auto;
  overscroll-behavior: contain;
}

.hx-sv-window__footer {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--color-border);
}

/* The other kinds of window (components/service-frame.js): the form of an event or of a visit
 * (components/service-forms.js), the scanner dialog of the Health page (components/scanner-health.js) and the
 * boundaries of a space (pages/health.js). Their content is the one of the dialog of the kit, drawn the same way:
 * nothing of it is scoped to the kit but the body, which places what is positioned in it, as `.dialog__body` does.
 * The form keeps its own container (`.hx-sv-form`): its two columns follow the width of the window. */
.hx-sv-window--form .hx-sv-window__body,
.hx-sv-window--scanner .hx-sv-window__body,
.hx-sv-window--boundaries .hx-sv-window__body,
.hx-sv-window--logs .hx-sv-window__body,
.hx-sv-window--scanner-config .hx-sv-window__body,
.hx-sv-window--router-config .hx-sv-window__body,
.hx-sv-window--supply-config .hx-sv-window__body,
.hx-sv-window--supply-types .hx-sv-window__body,
.hx-sv-window--supply-health .hx-sv-window__body {
  position: relative;
}

/* The body of a form is a flex column and the form takes all of it: higher than the form (resized, maximised), its two
   columns reach the foot of the window (`.hx-sv-form__cols`, below; Kyle, 2026-11-13). */
.hx-sv-window--form .hx-sv-form-host {
  display: flex;
  flex-direction: column;
}

.hx-sv-window--form .hx-sv-form-host > .hx-sv-form {
  flex: 1 0 auto;
}

.hx-sv-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hx-sv-detail__part {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.hx-sv-detail__heading {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-heading);
}

/* As it was written: its lines kept, a word without spaces broken. */
.hx-sv-detail__text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--color-text);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.hx-sv-detail__text.is-blank,
.hx-sv-detail__note {
  color: var(--color-text-muted);
}

.hx-sv-detail__note {
  padding: 10px 12px;
  margin: 0;
  font-size: 13.5px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sv-detail__link {
  text-align: left;
  overflow-wrap: anywhere;
}

/* The address of the site of a resolution: a link to Google Maps, coloured as the other links of the detail. */
.hx-sv-detail__site-address .hx-address {
  color: var(--color-accent-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* The on-site contacts of the site of a resolution: one a line, the phone a link to call. */
.hx-sv-detail__contact {
  display: block;
  overflow-wrap: anywhere;
}

/* "Billing proposal" of a resolution (step 5b): "P0048 · $12,500 · accepted" in tabular digits, then "Open". */
.hx-sv-detail__invoice {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
}

.hx-sv-detail__invoice-words {
  font-variant-numeric: tabular-nums;
}

/* The number is the link (Kyle 2026-10-30): it opens the billing proposal. */
.hx-sv-detail__invoice-open {
  font-variant-numeric: tabular-nums;
}

.hx-sv-detail__invoice-open[aria-busy="true"] {
  opacity: 0.6;
  cursor: progress;
}

/* The billing proposal in a Proposal section: a compact row, no space of its own under it. */
.hx-sv-detail__proposal .hx-kv__row {
  padding: 2px 0;
}

/* THE PROPOSAL of an event (step 6, Kyle 2026-10-29; components/service-detail.js): its words in tabular digits, the
   billing proposal, then what became of it (tinted by its state: accepted ok, declined muted) or what a standard user
   is asked; the hint over the buttons of an administrator is muted. */
.hx-sv-detail__proposal-line {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.hx-sv-detail__proposal-said,
.hx-sv-detail__proposal-ask {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sv-detail__proposal-said > .bi,
.hx-sv-detail__proposal-ask > .bi {
  flex: none;
  margin-top: 2px;
  color: var(--color-text-muted);
}

.hx-sv-detail__proposal--accepted .hx-sv-detail__proposal-said {
  background: color-mix(in srgb, var(--status-ok) 10%, var(--color-bg));
  border-color: color-mix(in srgb, var(--status-ok) 35%, var(--color-border));
}

.hx-sv-detail__proposal--accepted .hx-sv-detail__proposal-said > .bi {
  color: var(--status-ok);
}

.hx-sv-detail__proposal--declined .hx-sv-detail__proposal-said {
  color: var(--color-text-muted);
}

.hx-sv-detail__proposal-hint {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-sv-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hx-sv-detail__events {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hx-sv-detail__event {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sv-detail__event-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
}

.hx-sv-detail__event-title {
  min-width: 0;
  font-weight: 600;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-sv-detail__event-when {
  font-size: 12.5px;
  color: var(--color-text-muted);
}

/* "N symptoms" then "Reported …" of an event of a resolution, on one line where there is room (Kyle, 2026-11-13). */
.hx-sv-detail__event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  align-items: baseline;
}

/* The device of an Installation or a Removal, on its own lines under the head (components/service-detail.js; Kyle,
   2026-11-13): "P1 Hall North (synthetic-eos-12)", "Victron (HQ2231-DA)". */
.hx-sv-detail__event-devices {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hx-sv-detail__event-device {
  font-size: 13.5px;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

/* The symptoms of an event of a resolution fold under "3 symptoms" (Kyle, 2026-11-13): the chevron of the folds of the
   cards (.hx-sv-cards__event-chevron), turned while they show. */
.hx-sv-detail__symptoms-toggle {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  align-self: flex-start;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: 0;
}

.hx-sv-detail__symptoms-toggle:hover > span {
  text-decoration: underline;
}

.hx-sv-detail__symptoms-toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.hx-sv-detail__symptoms-toggle[aria-expanded='true'] > .hx-sv-cards__event-chevron {
  transform: rotate(90deg);
}

.hx-sv-detail__symptoms {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 18px;
}

.hx-sv-detail__symptoms[hidden],
.hx-sv-event-icons[hidden] {
  display: none;
}

/* ---- the symptoms of an event (components/service-detail.js): notices of the Health page acknowledged as symptoms
 * of it. A row: its tags and the name of the scanner or the space, then the rest of the notice, then who and when;
 * the parts of the head wrap on a phone, the Remove button stays at the end of its line. */

.hx-sv-detail__symptoms-state {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  font-size: 13.5px;
  color: var(--color-text-muted);
}

.hx-sv-detail__symptoms .hx-sv-detail__heading:focus {
  outline: none;
}

.hx-sv-detail__symptoms .hx-sv-detail__heading:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-sv-detail__symptoms-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* The list scrolls inside its own box, as the checklist of the form does (.hx-sv-form__picks). */
.hx-sv-detail__symptoms-list {
  display: flex;
  flex-direction: column;
  max-height: 264px;
  padding: 0;
  margin: 0;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sv-detail__symptom {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 10px 8px 10px 14px;
}

.hx-sv-detail__symptom + .hx-sv-detail__symptom {
  border-top: 1px solid var(--color-border);
}

.hx-sv-detail__symptom.is-removing {
  opacity: 0.55;
}

.hx-sv-detail__symptom-head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}

.hx-sv-detail__symptom-tags {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  min-width: 0;
  padding-top: 2px;
}

.hx-sv-detail__symptom-subject {
  min-width: 0;
  font-weight: 600;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

/* The link to the Health page's dialog of the symptom (a host with `tools.health`); the Remove button stays last. */
.hx-sv-detail__symptom-link {
  width: 32px;
  height: 32px;
  margin: -4px 0 -4px 0;
  font-size: 15px;
  color: var(--color-text-muted);
}

.hx-sv-detail__symptom-remove {
  width: 32px;
  height: 32px;
  margin: -4px -2px -4px 0;
  font-size: 15px;
  color: var(--color-text-muted);
}

.hx-sv-detail__symptom-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.hx-sv-detail__symptom-when {
  font-size: 12.5px;
  color: var(--color-text-muted);
}

/* ---- the related events of an event (components/service-detail.js): the events that are part of it, each a row
 * like a symptom (its tags, its title that opens it, Unlink at the end of its first line), and what it is about under
 * it. The dialog "Link an event…" lists the candidates the same way, with "Link". Wraps on a phone. */

.hx-sv-detail__related[hidden] {
  display: none;
}

.hx-sv-detail__related .hx-sv-detail__heading:focus {
  outline: none;
}

.hx-sv-detail__related .hx-sv-detail__heading:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-sv-detail__related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hx-sv-detail__related-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sv-detail__related-item.is-removing {
  opacity: 0.55;
}

.hx-sv-detail__related-head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}

.hx-sv-detail__related-tags {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  min-width: 0;
  padding-top: 2px;
}

.hx-sv-detail__related-title,
.hx-sv-detail__related-name {
  min-width: 0;
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
}

.hx-sv-detail__related-name {
  color: var(--color-heading);
}

.hx-sv-detail__related-unlink {
  flex: none;
  width: 32px;
  height: 32px;
  margin: -4px -2px -4px 0;
  font-size: 15px;
  color: var(--color-text-muted);
}

.hx-sv-detail__related-head > .btn {
  flex: none;
}

.hx-sv-detail__related-about {
  font-size: 12.5px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.hx-sv-detail__related > .hx-sv-detail__actions {
  margin-top: 2px;
}

.hx-sv-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.hx-sv-link > .hx-sv-detail__symptoms-lead,
.hx-sv-link > .hx-sv-detail__text {
  margin: 0;
}

/* ---- the pictures of an event or a visit (components/service-pictures.js): a block of the detail */

.hx-sv-pics {
  position: relative;
}

.hx-sv-pics [hidden] {
  display: none;
}

.hx-sv-pics__heading {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.hx-sv-pics__count {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.hx-sv-pics__notice:empty {
  display: none;
}

.hx-sv-pics__reload {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.hx-sv-pics__reload > span {
  flex: 1 1 200px;
  min-width: 0;
}

/* Tiles of one shape: as many beside each other as there is room for, three at least on a phone. */
.hx-sv-pics__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

/* In a detail and in the form of a resolution the grid is no higher than one row and a half of its tiles, and scrolls
   (Kyle, 2026-11-13: "limit it to 1.5x the height of the first row of images"); "Add pictures" and the rows of the
   files are under it, outside what scrolls. `--hx-sv-pics-row` is the height of its first tile, measured by the script
   (components/service-pictures.js): until it is, nothing is cut. Not on the Pictures tab of a site, a gallery. */
.hx-sv-detail .hx-sv-pics__grid,
.hx-sv-form .hx-sv-pics__grid {
  /* Each row as tall as its tiles: under a max-height a row of `auto` would be squeezed and the tiles overlap. */
  grid-auto-rows: max-content;
  max-height: calc(1.5 * var(--hx-sv-pics-row) + 8px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hx-sv-pics__tile {
  position: relative;
  aspect-ratio: 4 / 3;
  min-width: 0;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sv-pics__tile--skeleton {
  border-color: transparent;
}

.hx-sv-pics__tile.is-removing {
  opacity: 0.45;
}

.hx-sv-pics__open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
  background: none;
  border: 0;
  border-radius: inherit;
}

.hx-sv-pics__open:disabled {
  cursor: default;
}

.hx-sv-pics__open:focus-visible,
.hx-sv-pics__remove:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-sv-pics__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.15s ease;
}

.hx-sv-pics__open:hover .hx-sv-pics__img {
  transform: scale(1.04);
}

/* What stands in the place of a picture that cannot be shown. */
.hx-sv-pics__stand-in {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 6px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--color-text-muted);
  text-align: center;
  overflow-wrap: anywhere;
}

.hx-sv-pics__stand-in > .bi {
  font-size: 18px;
}

/* The ✕ of a picture that can be removed: on the picture, whatever the picture is. */
.hx-sv-pics__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  background: rgb(11 21 38 / 72%);
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 999px;
}

.hx-sv-pics__remove:hover {
  background: var(--color-error, #c62828);
}

.hx-sv-pics__remove:focus-visible {
  outline-color: #fff;
  outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--color-focus);
}

/* "Add pictures", and where files are dropped. */
.hx-sv-pics__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}

.hx-sv-pics__hint,
.hx-sv-pics__plan {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.hx-sv-pics__plan {
  font-weight: 600;
  color: var(--color-text);
}

/* A device without a pointer that hovers has nothing to drop. */
@media (hover: none) {
  .hx-sv-pics__hint:not(.is-full) {
    display: none;
  }
}

.hx-sv-pics--manage.is-drop::after {
  position: absolute;
  inset: 6px -8px -8px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-accent-text);
  pointer-events: none;
  content: 'Drop the pictures here';
  background: color-mix(in srgb, var(--color-surface-raised) 86%, transparent);
  border: 2px dashed var(--color-focus);
  border-radius: 12px;
}

/* The files that are on their way: one row each. */
.hx-sv-pics__queue {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sv-pics__row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 12px;
}

.hx-sv-pics__row + .hx-sv-pics__row {
  border-top: 1px solid var(--color-border);
}

.hx-sv-pics__row-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  font-size: 16px;
  color: var(--color-text-muted);
}

.hx-sv-pics__row.is-done .hx-sv-pics__row-icon {
  color: var(--color-ok-text, var(--color-accent-text));
}

.hx-sv-pics__row.is-failed .hx-sv-pics__row-icon,
.hx-sv-pics__row.is-refused .hx-sv-pics__row-icon,
.hx-sv-pics__row.is-skipped .hx-sv-pics__row-icon,
.hx-sv-pics__row.is-stopped .hx-sv-pics__row-icon,
.hx-sv-pics__row.is-failed .hx-sv-pics__row-state,
.hx-sv-pics__row.is-refused .hx-sv-pics__row-state,
.hx-sv-pics__row.is-skipped .hx-sv-pics__row-state {
  color: var(--color-error-text);
}

.hx-sv-pics__row-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hx-sv-pics__row-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hx-sv-pics__row-state {
  font-size: 12.5px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.hx-sv-pics__bar {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 4px;
  overflow: hidden;
  appearance: none;
  background: var(--color-skeleton);
  border: 0;
  border-radius: 999px;
}

.hx-sv-pics__bar::-webkit-progress-bar {
  background: var(--color-skeleton);
}

.hx-sv-pics__bar::-webkit-progress-value {
  background: var(--color-accent);
  transition: width 0.2s linear;
}

.hx-sv-pics__bar::-moz-progress-bar {
  background: var(--color-accent);
}

.hx-sv-pics__clear {
  align-self: flex-start;
  margin-left: -10px;
}

/* A picture shows large in the lightbox (components/lightbox.js, `hx-lightbox`). */

@media (prefers-reduced-motion: reduce) {
  .hx-sv-pics__img,
  .hx-sv-pics__bar::-webkit-progress-value {
    transition: none;
  }

  .hx-sv-pics__open:hover .hx-sv-pics__img {
    transform: none;
  }
}

/* ---- what a super-user changes (components/service-forms.js; the actions of a detail; "Log event" of pages/health.js) */

/* "New event" / "Plan a visit": the last of the toolbar, at its end. */
.hx-sv__toolbar > .hx-sv__new {
  flex: none;
  margin-left: auto;
}

/* "Move scanner into site" / "Move scanners out of site" (and the two of power supplies) of the tab of a site, before "New event": in the flow of the
   toolbar, so on a line of their own they start at the left; "New event" keeps the right end. */
.hx-sv__toolbar > .hx-sv__move {
  flex: none;
}

/* What could not be done: in a form over its buttons, in a detail at the end of its body. */
.hx-sv-form__alert,
.hx-sv-detail__alert {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 14px;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-error-text);
  background: var(--color-error-tint);
  border-radius: 10px;
}

.hx-sv-form__alert > span,
.hx-sv-detail__alert > span {
  flex: 1 1 220px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hx-sv-form__alert[hidden],
.hx-sv-detail__alert[hidden] {
  display: none;
}

.hx-sv-form__alert--save {
  margin-top: 14px;
}

.hx-sv-form,
.hx-sv-form__fields,
.hx-sv-form__part {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hx-sv-form {
  padding-top: 8px;
  /* The columns of the form of an event (below) go by the width of the form. */
  container-type: inline-size;
}

/* The form of an event: two columns where it is wide (its dialog opens twice as wide as the other forms): the fields,
   the details last, left; the symptoms right, with room for more of them. One under the other where it is not. */
.hx-sv-form__cols,
.hx-sv-form__col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

@container (min-width: 760px) {
  .hx-sv-form__cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px 32px;
    align-items: start;
  }

  /* The list of the right column (the symptoms of an event, the events of a resolution), Kyle, 2026-11-13.
     As high as its content (its window is, up to 90% of the page: components/service-frame.js, `fill`): the whole list,
     no scroll bar, reaching down to the foot of the fields when they are higher ("expand up to 80% screen height with
     the number of events or symptoms and then scroll from there").
     A window of a fixed height (`.is-filled` of js/pcd/window.js: stopped at that 80%, resized from above or below, or
     maximised: "resize the list of events and symptoms ... on dialog resizing"): the columns take what is left of the
     body (`flex: 1 0 auto`; the body and the form are flex columns, above), never less than the fields, which keep
     their height (the body scrolls when the window is lower); the right column is as tall as that, never under MIN, and
     the list takes what is left of it and scrolls inside. `contain: size` keeps the list from making the row taller. */
  .hx-sv-form__cols {
    align-items: stretch;
  }

  .is-filled .hx-sv-form__cols,
  .is-filled .hx-sv-form__fields:has(> .hx-sv-form__cols) {
    flex: 1 0 auto;
  }

  .is-filled .hx-sv-form__cols > .hx-sv-form__col:last-child {
    contain: size;
    min-height: 360px;
  }

  .hx-sv-form__col > .hx-sv-form__symptoms,
  .hx-sv-form__col > .hx-sv-form__events {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
  }

  .hx-sv-form__col > .hx-sv-form__symptoms > .hx-sv-form__picks,
  .hx-sv-form__col > .hx-sv-form__events > .hx-sv-form__picks {
    flex: 1 1 auto;
    min-height: 120px;
    max-height: none;
  }

  .is-filled .hx-sv-form__col > .hx-sv-form__symptoms > .hx-sv-form__picks,
  .is-filled .hx-sv-form__col > .hx-sv-form__events > .hx-sv-form__picks {
    flex-basis: 0;
  }
}

.hx-sv-form__part {
  gap: 8px;
}

.hx-sv-form [hidden] {
  display: none;
}

.hx-sv-form__state:empty {
  display: none;
}

.hx-sv-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px 12px;
}

.hx-sv-form textarea.field__input {
  min-height: 120px;
  line-height: 1.4;
  resize: vertical;
}

/* The details and the completion notes of a resolution (Kyle, 2026-11-13): three lines, so the form fits once Complete
   shows the notes; each still grows by its corner. */
.hx-sv-form .hx-sv-form__details--short textarea.field__input {
  min-height: 76px;
}

.hx-sv-form__note,
.hx-sv-form__count {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.hx-sv-form__count {
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.hx-sv-form__count.is-over {
  font-weight: 600;
  color: var(--color-error-text);
}

/* The site of a record that is there: said, not chosen. */
.hx-sv-form__fixed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hx-sv-form__fixed-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.hx-sv-form__fixed-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-sv-form__loading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 0;
}

/* The events a visit is for: a list of ticks that scrolls when it is long. */
.hx-sv-form__events {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.hx-sv-form__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-sv-form__picked {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.hx-sv-form__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 6px -10px;
}

.hx-sv-form__tools:empty {
  display: none;
}

.hx-sv-form__picks {
  max-height: 264px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sv-form__picks > .hx-sv-form__note {
  padding: 12px 14px;
}

.hx-sv-form__pick {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 44px;
  padding: 10px 14px;
  cursor: pointer;
}

/* A line of the checklist: its label, and "Edit" beside it when the event is one of the visit that is changed (or the
   link of a symptom to the Health page's dialog). */
.hx-sv-form__pick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* The flags of a scanner, beside it in "Scanners" (sql/site_event_tasks.sql); they go under its name where there is no room. */
.hx-sv-form__scanners .hx-sv-form__pick-row > .hx-sv-form__pick {
  flex: 1 1 160px;
}

/* A Scanner event: one select of its scanner, and its two flags under it (Kyle, 2026-11-05). No box around them: the
   select is a field of its own, with its own label. */
.hx-sv-form__picks.is-one {
  max-height: none;
  overflow: visible;
  border: 0;
  border-radius: 0;
}

.hx-sv-form__one {
  margin-bottom: 4px;
}

.hx-sv-form__one-flags .hx-sv-form__flags {
  padding: 0 2px;
}

.hx-sv-form__flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-size: 13px;
}

.hx-sv-form__flag {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;
}

/* A flag among the symptoms of a scanner (components/event-about.js): Needs cleaning yellow, Needs replacement red. */
.hx-ev-about__symptom.hx-ev-about__symptom--task-1 {
  color: var(--color-warning-text);
  background: color-mix(in srgb, var(--status-warning) 16%, transparent);
  border-color: var(--status-warning);
}

.hx-ev-about__symptom.hx-ev-about__symptom--task-2 {
  color: var(--color-error-text);
  background: var(--color-error-tint);
  border-color: var(--status-error);
}

/* A symptom of an event of a resolution (components/service-forms.js). */
.hx-sv-symptom-row {
  display: block;
  min-width: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

/* The icons of the symptoms of that event, a column of their own at its right; a pair for each scanner or space. */
.hx-sv-event-icons {
  display: grid;
  flex: none;
  grid-template-columns: auto auto;
  gap: 2px;
  align-items: center;
}

.hx-sv-detail__event.has-icons {
  flex-direction: row;
  gap: 10px;
  align-items: flex-start;
}

.hx-sv-detail__event-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hx-sv-event-icons > .hx-sv-form__pick-link {
  margin: 0;
}

.hx-sv-form__pick-row > .hx-sv-event-icons {
  margin: 6px 6px 0 0;
}

/* In the form of a resolution, with the words of the event. */
.hx-sv-form__event-symptoms {
  display: block;
  margin-top: 2px;
}

/* The flags of an event, as tags. */
.hx-sv-tasks {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hx-sv-form__pick-row + .hx-sv-form__pick-row {
  border-top: 1px solid var(--color-border);
}

.hx-sv-form__pick-row > .hx-sv-form__pick {
  flex: 1;
  min-width: 0;
}

.hx-sv-form__pick-edit,
.hx-sv-form__pick-link {
  flex: none;
  margin: 6px 6px 0 0;
}

/* The link to the Health page's dialog of a symptom, beside its tick (a form opened from that page), and the pile icon
   of its 3D view (`hx-sv-form__pick-scan`, the same look). */
.hx-sv-form__pick-link {
  color: var(--color-text-muted);
}

.hx-sv-form__pick:hover {
  background: var(--color-row-hover);
}

.hx-sv-form__pick > .checkbox {
  margin-top: 3px;
}

.hx-sv-form__pick.is-blocked {
  cursor: default;
  background: none;
}

.hx-sv-form__pick.is-blocked .hx-sv-form__pick-title {
  opacity: 0.6;
}

.hx-sv-form__pick.is-blocked .hx-sv-form__pick-when {
  color: var(--color-error-text);
}

.hx-sv-form__pick-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hx-sv-form__pick-title {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-sv-form__pick-when {
  font-size: 12.5px;
  color: var(--color-text-muted);
}

/* What the notice says, under its line. */
.hx-sv-form__pick-detail {
  font-size: 13px;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

/* The Health notices a new event is logged for: ticks in the look of the checklist of a visit (the rows are
 * `.hx-sv-form__pick`), each a level tag and its line, wrapping on a phone. Above them what ticking does, and while the
 * notices of the site are asked a spinner; when there are none, or they could not be had, a muted line says so. */
.hx-sv-form__symptoms {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.hx-sv-form__symptoms[hidden],
.hx-sv-form__symptoms > [hidden] {
  display: none;
}

.hx-sv-form__symptoms > .hx-sv-form__note {
  margin: 0 0 8px;
}

.hx-sv-form__symptoms-state:empty {
  display: none;
}

/* A group of notices the ticked ones are part of (Kyle, 2026-11-08): offered, unobtrusively, over the checklist. */
.hx-sv-form__group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  padding: 8px 12px;
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text);
  background: var(--color-accent-tint);
  border-radius: 10px;
}

.hx-sv-form__group-text {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.hx-sv-form__group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* The (?) of the band: "How notices are grouped" (the kit's help-btn look). */
.hx-sv-form__group-help {
  align-self: center;
  cursor: pointer;
}

/* The dialog "How notices are grouped": the order of the rules, then an accordion of them (hx-sc-acc). */
.hx-sv-rules {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hx-sv-rules__lead,
.hx-sv-rules__line {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
}

.hx-sv-rules__lead {
  color: var(--color-text-muted);
}

.hx-sv-rules__panel {
  gap: 6px;
}

.hx-sv-rules__list {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
}

.hx-sv-rules__list > li + li {
  margin-top: 4px;
}

/* What is ticked looks like several problems: said under the checklist, Save still works. */
.hx-sv-form__symptoms > .hx-sv-form__note--warn {
  margin: 8px 0 0;
  color: var(--color-warning-text);
}

.hx-sv-form__symptoms-state > .hx-sv-form__note {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 8px;
}

.hx-sv-form__symptom-text {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

/* The scanners an event is about: ticks in the look of the checklist of a visit; under them which one is the
 * scanner of the event. A line of an event that is part of another says so, muted, under its text. */
.hx-sv-form__scanners {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.hx-sv-form__scanners > .hx-sv-form__state:empty {
  display: none;
}

.hx-sv-form__scanners > .hx-sv-form__state {
  margin-bottom: 6px;
}

.hx-sv-form__scanners > .hx-sv-form__picks[hidden] {
  display: none;
}

.hx-sv-form__scanners-note {
  margin: 6px 0 0;
}

.hx-sv-form__scanners-note[hidden] {
  display: none;
}

.hx-sv-form__pick-part {
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-sv-form__parent > .hx-sv-form__note {
  margin: 4px 0 0;
}

.hx-sv-form__parent > .hx-sv-form__note[hidden] {
  display: none;
}

/* "Visit complete", and under it what that does. */
.hx-sv-form__complete {
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sv-form__complete > .switch-row {
  padding: 6px 14px;
  border-radius: 10px 10px 0 0;
}

.hx-sv-form__closes {
  padding: 0 14px 10px;
}

/* A row of "Needs attention" about a scanner, with "Log event" beside it (pages/health.js): the row is a button, so
   the second action stands next to it, not in it. The lines between the rows are next.css's for rows that follow
   each other; a row in this wrapper has them here. */
.hx-sv-queue__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: auto;
  align-items: stretch;
}

/* A row with its actions beside it, on the Health page (Kyle 2026-10-31): the coloured edge of the row runs down the
   whole of it, the actions too, which wrap under the row on a phone. */
.hx-sv-queue__row.is-striped {
  position: relative;
}

.hx-sv-queue__row.is-striped::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: 4px;
  content: '';
  background: var(--nx-item-color, var(--status-unknown));
}

.hx-sv-queue__row + .hx-sv-queue__row,
.hx-sv-queue__row + .nx-queue__item,
.nx-queue__item + .hx-sv-queue__row,
.hx-sv-queue__row + .hx-sv-cards__wrap,
.hx-sv-cards__wrap + .hx-sv-queue__row {
  border-top: 1px solid var(--color-border);
}

.hx-sv-queue__log {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 0 18px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-accent-text);
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: 0;
  border-left: 1px solid var(--color-border);
}

.hx-sv-queue__log:hover {
  background: var(--color-row-hover);
}

.hx-sv-queue__log:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

/* On a phone the row has no room beside it: its actions ("Log event", "Add to event", "Snooze"; "Restore") are a row of
   their own under it, sharing the width, with their words. */
@media (max-width: 719.98px) {
  .hx-sv-queue__row {
    display: flex;
    flex-wrap: wrap;
  }

  .hx-sv-queue__row > .nx-queue__item,
  .hx-sv-queue__row > .hx-sv-cards__wrap {
    flex: 1 0 100%;
  }

  /* No lines around them: they read as part of the card above, not as cells of their own. */
  .hx-sv-queue__log {
    flex: 1 1 0;
    min-height: 42px;
    padding: 4px 10px 10px;
    border: 0;
  }
}

/* ---- Notices acknowledged as symptoms of an issue (pages/health.js): select mode of "Needs attention", its bar, and
   the dialogs "Add to an issue of …" and "Acknowledge N notices of … as…". The colours are the kit's tokens. */

/* "Acknowledge…" while select mode is on. */
.nx-section__actions .btn.is-pressed {
  color: var(--color-accent-text);
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  border-color: var(--color-accent);
}

/* A row of a notice in select mode: the tick at its left, the whole row its label; no action at its right. */
.nx-queue__item.hx-sy-row {
  grid-template-columns: 24px 44px minmax(0, 1fr);
}

.hx-sy-row.is-ticked {
  background: color-mix(in srgb, var(--color-accent) 9%, transparent);
}

.hx-sy-row.is-ticked:hover {
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
}

.hx-sy-row:focus-within {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-sy-pick {
  display: grid;
  place-items: center;
}

.hx-sy-pick > .checkbox {
  margin: 0;
}

/* The rows that cannot be ticked (the events, a site) stay usable, in the background. */
.hx-sy-off {
  opacity: 0.55;
}

.hx-sy-off:hover,
.hx-sy-off:focus-visible {
  opacity: 0.85;
}

/* Under the ticks, in view at the bottom while the page scrolls. */
.hx-sy-bar {
  position: sticky;
  bottom: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 18px;
  margin-top: 12px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-raised);
}

.hx-sy-bar[hidden] {
  display: none;
}

.hx-sy-bar__count {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-sy-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* A phone: the bar is the width of the page, its buttons share the line under the count. */
@media (max-width: 599.98px) {
  .hx-sy-bar {
    bottom: 8px;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
  }

  .hx-sy-bar__actions > .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* The dialogs. */
.hx-sy-dialog__lead {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.hx-sy-dialog .empty-state {
  padding-block: 12px;
}

.hx-sy-choose-list {
  box-shadow: none;
}

.nx-queue__item.hx-sy-choose {
  min-height: 60px;
}

.hx-sy-choose:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

/* A scanner event that cannot take these symptoms (of another scanner), and a notice it cannot take: shown, not chosen. */
.nx-queue__item.hx-sy-choose:disabled,
.nx-queue__item.hx-sy-row.is-refused {
  cursor: not-allowed;
  opacity: 0.6;
}

.hx-sy-choose:disabled .nx-queue__action {
  visibility: hidden;
}

/* Under the header of a power supply's symptom (the rows of "Needs attention", "Add symptoms", the checklist of the
   event form, the detail of an event): the scanners on that supply, in small type (Kyle, 2026-11-08). */
.hx-sy-scanners {
  display: block;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.hx-sy-refused,
/* The scanners on the power supply chosen, in small type under its select (the select shows its name only). */
.hx-sv-form__device-scanners {
  margin: 4px 14px 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-text-muted);
}

.hx-sv-form__pick-other {
  color: var(--color-text-muted, #5a6474);
  font-style: italic;
}

/* A symptom the event cannot take (another scanner, a scanner off its supply, another supply): faded as in "Add symptoms"
   of the Health page (.hx-sy-row.is-refused), the reason why at full strength. */
.hx-sv-form__pick-row.is-refused .hx-sv-form__pick > .checkbox,
.hx-sv-form__pick-row.is-refused .hx-sv-form__pick-title,
.hx-sv-form__pick-row.is-refused .hx-sv-form__pick-detail,
.hx-sv-form__pick-row.is-refused .hx-sy-scanners,
.hx-sv-form__pick-row.is-refused .hx-sv-form__pick-when:not(.hx-sv-form__pick-other),
.hx-sv-form__pick-row.is-refused > :not(.hx-sv-form__pick) {
  opacity: 0.5;
}

.hx-sv-form__pick-row.is-refused .hx-sv-form__pick {
  cursor: not-allowed;
}

/* An event that is part of the one above it: indented under it, "Part of #44" beside its title. */
.nx-queue__item.hx-sy-choose--child {
  min-height: 52px;
  padding-left: 54px;
}

.hx-sy-choose--child .nx-queue__icon {
  width: 34px;
  height: 34px;
  font-size: 16px;
  justify-self: end;
}

.hx-sy-part {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* What an event is about, under its title (components/event-about.js): a line a scanner or space, its symptoms as
   pills on an indented line under its name. Under the rows of "Needs attention", in the picker of "Add to event", under the open events
   of the site page. */
.hx-ev-about {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.hx-ev-about__subject {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text);
}

.hx-ev-about__subject > .bi {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* The description of an open event in a row, for who has the Service page: "Needs attention" of the Health page and
   of the Sites page, the dialog of open events, the open events of a site page. Whole, in the colour of the text, its
   long words broken. */
.hx-ev-description {
  color: var(--color-text);
  overflow-wrap: anywhere;
  /* The line breaks typed in the edit dialogs (Kyle, 2026-11-13). */
  white-space: pre-line;
}

/* What was written of an event, on its line in a fold: its line breaks kept (Kyle, 2026-11-13). */
.hx-ev-about__details {
  white-space: pre-line;
}

/* Text of several lines goes under the name, past the icon of the level, instead of beside it. */
.hx-ev-about__details.is-multiline {
  flex-basis: 100%;
  padding-left: 19px;
}

/* A description of several lines with events or symptoms under it: a line of space before them (Kyle, 2026-11-13). */
.hx-ev-description.has-gap,
.hx-ev-about__details.has-gap {
  margin-bottom: 1.4em;
}

/* And a line of space before it (Kyle, 2026-11-13). */
.hx-ev-description.is-multiline,
.hx-ev-about__details.is-multiline {
  margin-top: 1.4em;
}

/* A scanner or space and, under it, its symptoms. */
.hx-ev-about__group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* The symptoms of the scanner or space above, indented past its icon, with a faint rule that ties them to it. */
.hx-ev-about__symptoms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  margin-left: 6px;
  padding-left: 12px;
  border-left: 2px solid var(--color-border);
  font-size: 13px;
  line-height: 1.4;
}

.hx-ev-about__name {
  font-weight: 600;
  margin-right: 2px;
}

.hx-ev-about__symptom {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 1px 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: 999px;
}

.hx-ev-about__symptom > .bi {
  font-size: 12px;
}

/* A symptom the site does not report any more. */
.hx-ev-about__symptom--gone {
  color: var(--color-text-muted);
  text-decoration: line-through;
  border-style: dashed;
}

.hx-sy-dialog__note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* "Add symptoms to event #n": "Select all", "Select none" and the count of the ticks, over the rows. */
.hx-sy-choose-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 8px;
}

.hx-sy-choose-tools__count {
  margin-left: auto;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* The boundary dialog of a space (components/boundary-dialog.js): the look of the scanner dialog (.hx-hl-detail,
   .hx-hl-tabs, .hx-hl-scans), with the few things of its own. A tab with no finished reading has a grey dot. */
.hx-hl-tabs__tab.is-none .hx-hl-tabs__dot {
  background: var(--status-unknown);
}

/* No coverage to chart: one line where the chart would be. */
.hx-bh-empty {
  margin: 0;
  padding: 24px 12px;
  font-size: 14px;
  text-align: center;
  background: var(--color-surface-sunken);
  border-radius: 10px;
}

/* The readings: the columns of the scans (.hx-hl-scan__head): when, the box of the coverage, then the tag. */
.hx-bh-readings__legend,
.hx-bh-reading__head {
  grid-template-columns: 16px 128px 64px minmax(0, 1fr);
}

/* The box of the coverage of a reading: the look of the box of a scan (.hx-sc-quality, its pastel colours: green to
   red as scanner-config.js qualityColor), by how the reading went; grey "–" in progress or without a coverage. */
.hx-bh-box--ok {
  background: hsl(120, 50%, 70%);
}

.hx-bh-box--warning {
  background: hsl(42, 85%, 68%);
}

.hx-bh-box--error {
  background: hsl(0, 50%, 70%);
}

@media (max-width: 599.98px) {
  /* A reading on a phone: when it was taken and its box on one line, the tag under them. */
  .hx-bh-readings__legend {
    display: none;
  }

  .hx-bh-reading__head {
    grid-template-columns: 16px minmax(0, 1fr) auto;
  }

  .hx-bh-reading__head .hx-hl-scan__quality {
    grid-row: 1;
    grid-column: 3;
    justify-self: end;
  }

  .hx-bh-reading__head .hx-hl-scan__flags {
    grid-row: 2;
    grid-column: 2 / -1;
  }
}

/* "{boundary} · Invalid boundary" (components/boundary-notice.js): the notice, the newest reading in a small 3D view,
   "Coverage" (the least coverage, the line of what it would make of the reading, and the default), then "Health check"
   (the cards of openNoticeChecks, health-checks.js). On a phone the view is as wide as the sheet. */
.hx-bc-dialog {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hx-bc-dialog > * {
  flex-shrink: 0;
}

/* The notice and the cards keep their own margins below: the gap of the dialog is enough. */
.hx-bc-dialog > .hx-hc-one__notice,
.hx-bc-dialog .hx-hc-one__card:last-of-type {
  margin-bottom: 0;
}

.hx-bc-section {
  margin: 6px 0 -4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-bc-view {
  position: relative;
  /* A bottom sheet is as tall as what it holds: the view keeps its height, and the sheet scrolls. */
  flex: 0 0 auto;
  height: 320px;
  overflow: hidden;
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-bc-view canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hx-bc-view__state {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 16px;
  font-size: 13.5px;
  color: var(--color-text-muted);
  text-align: center;
  pointer-events: none;
}

.hx-bc-view__state[hidden] {
  display: none;
}

/* The scan of a notice of a check of its points, above the card of its check (health-checks.js openNoticeChecks,
   components/scan-points-view.js): the view of the dialog of an Invalid boundary, and a line under it. */
.hx-uv {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
}

.hx-bc-caption {
  margin: 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-bc-facts,
.hx-bc-hint,
.hx-bc-note,
.hx-bc-error {
  margin: 0;
  font-size: 13.5px;
}

.hx-bc-facts {
  color: var(--color-text);
}

.hx-bc-hint,
.hx-bc-note {
  color: var(--color-text-muted);
}

.hx-bc-hint.is-good {
  color: var(--color-success-text, var(--status-ok));
}

.hx-bc-hint.is-bad,
.hx-bc-error {
  color: var(--color-error-text);
}

.hx-bc-dialog .field-group {
  max-width: 220px;
}

@media (max-width: 599.98px) {
  .hx-bc-view {
    height: 260px;
  }

  .hx-bc-dialog .field-group {
    max-width: none;
  }
}

/* The scanner dialog: the open events of its site about the scanner, under the action buttons. */
.hx-sy-events {
  margin: 0 0 16px;
}

.hx-sy-events__head {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hx-sy-events__list {
  padding: 0;
  margin: 0;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.hx-sy-events__list > li + li {
  border-top: 1px solid var(--color-border);
}

.hx-sy-events__item {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--color-text);
  background: none;
  border: 0;
  cursor: pointer;
}

.hx-sy-events__item:hover {
  background: var(--color-row-hover);
}

.hx-sy-events__item:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-sy-events__icon {
  display: inline-flex;
  font-size: 16px;
  color: var(--hx-sy-event-color, var(--status-unknown));
}

.hx-sy-events__title {
  font-weight: 700;
  color: var(--color-heading);
}

.hx-sy-events__tag {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-sy-list {
  padding: 0;
  margin: 0 0 12px;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sy-list > li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.hx-sy-list > li + li {
  border-top: 1px solid var(--color-border);
}

.hx-sy-list > li::before {
  flex: none;
  width: 8px;
  height: 8px;
  content: '';
  background: var(--status-warning);
  border-radius: 50%;
  transform: translateY(-1px);
}

.hx-sy-list > .hx-sy-list__item--error::before {
  background: var(--status-error);
}

/* The notices of "Snooze…" and "Dismiss…": many of them scroll within the dialog. */
.hx-sy-list--scroll {
  max-height: 220px;
  overflow-y: auto;
}

/* "Snooze…": the days field and its quick picks on one line, the date it runs to under them. */
.hx-sy-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

/* Days, hours and minutes: the three on one line of a phone. */
.hx-sy-days > .field-group {
  flex: 0 0 96px;
}

.hx-sy-days__picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hx-sy-days__picks > .btn.is-pressed {
  color: var(--color-accent-text);
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  border-color: var(--color-accent);
}

.hx-sy-days__until {
  margin: 6px 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
}

/* "Dismiss…": the tick of the second confirmation. */
.hx-sy-confirm {
  margin-top: 4px;
}

/* "N notices muted · Manage": in the head of a site, and under "Needs attention" in the view of one site. */
.hx-sy-muted {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  align-items: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* The words themselves are the way to the muted notices (the "Muted" filter, focused on the site). */
.hx-sy-muted__manage {
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent-text);
  cursor: pointer;
  background: none;
  border: 0;
}

.hx-sy-muted__manage:hover {
  text-decoration: underline;
}

.hx-sy-muted__manage:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-sy-muted-bar {
  margin: -8px 0 16px;
  padding: 0 4px;
}

.hx-sy-muted-bar[hidden] {
  display: none;
}

/* "Muted notices of …": rows of the queue that do not open anything; "Restore" at their right. */
.hx-sy-muted-list {
  box-shadow: none;
}

.nx-queue__item.hx-sy-muted-row {
  min-height: 60px;
  cursor: default;
}

.nx-queue__item.hx-sy-muted-row:hover {
  background: none;
}

/* A phone: the queue hides the action of a row; here it is "Restore", under the words. */
@media (max-width: 599.98px) {
  .hx-sy-muted-row .nx-queue__action {
    display: inline-flex;
    grid-column: 2;
  }
}

/* Stacked (the breakpoint of `hx-bill-table`): the time is a line like the others, the details are under their label. */
@container (max-width: 820px) {
  .hx-sv__table td[data-label='When'],
  .hx-sv__table td[data-label='Arrival'] {
    color: inherit;
  }

  .hx-sv__table td[data-label='Site'],
  .hx-sv__table td[data-label='Device'],
  .hx-sv__table td[data-label='Technician'],
  .hx-sv__table td[data-label='Details'] {
    min-width: 0;
  }

  .hx-sv__table td[data-label='Details'] {
    display: block;
    text-align: left;
  }

  .hx-sv__table td[data-label='Details'].is-blank {
    display: none;
  }

  .hx-sv__table td[data-label='Details']::before {
    display: block;
    margin-bottom: 4px;
  }

  .hx-sv__events {
    justify-content: flex-end;
  }
}

@media (max-width: 599.98px) {
  .hx-sv__content {
    padding-top: 16px;
  }

  .hx-sv__toolbar > .hx-sv__field--level,
  .hx-sv__toolbar > .hx-sv__field--sort {
    flex: 1 1 100%;
  }

  /* The order, the level and the search as tall as the same inputs of the Health page on a phone. */
  .field-group.hx-sv__bare .field__input {
    min-height: 40px;
    height: 40px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  /* The buttons of a detail and a form (the toolbar of the page is as tall as the same buttons of the other pages). */
  .hx-sv-detail__actions .btn,
  .hx-sv-form__tools .btn,
  .hx-sv-form__pick-edit,
  .hx-sv-form__alert .btn,
  .hx-sv-detail__related .btn,
  .hx-sv-link .btn,
  .hx-sv-pics .btn {
    min-height: 44px;
  }

  /* Three tiles beside each other at 375 px; the ✕ is finger-sized. */
  .hx-sv-pics__grid {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  }

  .hx-sv-pics__remove {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .hx-sv-pics__tools > .hx-sv-pics__add {
    flex: 1 1 100%;
  }

  /* Beside "Filters", on one row ("Plan resolution" of the views of resolutions; "New event" is not shown here). */
  .hx-sv__toolbar > .hx-sv__new {
    flex: 1 1 auto;
    margin-left: 0;
  }

  .hx-sv-form__picks {
    max-height: none;
  }

  /* Finger-sized: Unlink of a related event. */
  .hx-sv-detail__related-unlink {
    width: 44px;
    height: 44px;
    margin: -8px -6px -8px 0;
  }

  /* Finger-sized: the time of a row, the name of its site. */
  .hx-sv__open,
  .hx-sv__site,
  .hx-sv-detail__link {
    min-height: 44px;
  }

  .hx-sv__site {
    display: inline-flex;
    align-items: center;
  }
}

/* ============================================================ end of the Service page */

/* ============================================================ end of the scanner configuration dialog */

/* ============================================================ The sign-in page (login.php)
   The layout is the one of Hyperion Health (.login in ../../health/css/altamus.css); only what
   that page does not have is here. */

/* The page is the form: it fills the window, and scrolls inside it on a short one. */
.hx-login {
  box-sizing: border-box;
  min-height: 100%;
}

/* The row of the tick box lines up with the fields, and has no hover band across the card. */
.hx-login__remember {
  margin: -4px 0;
  padding-right: 0;
  padding-left: 2px;
}

.hx-login__remember:hover {
  background: transparent;
}

.hx-login__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  margin: 20px 0 0;
  font-size: 14px;
}

.hx-login__links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-weight: 600;
  color: var(--color-accent-text);
  text-decoration: none;
}

.hx-login__links a:hover,
.hx-login__links a:focus-visible {
  text-decoration: underline;
}

/* Good news above a form (login.php after a password was reset): the shape of .form-error, in green. */
.hx-login__notice {
  padding: 10px 12px;
  border-radius: var(--radius-field);
  background: color-mix(in srgb, var(--status-ok) 16%, transparent);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

/* A line under the answer of forgot.php: whom to ask when no e-mail comes. */
.hx-login__note {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.hx-login__note a {
  font-weight: 600;
  color: var(--color-accent-text);
  text-decoration: none;
}

.hx-login__note a:hover,
.hx-login__note a:focus-visible {
  text-decoration: underline;
}

/* ============================================================ end of the sign-in page */

/* ============================================================
 * The native 3D viewer (js/components/pcd-viewer.js): a toolbar over a picture that fills the
 * dialog, and over the picture what covers it (loading, an error), the readout of a point, the
 * facts of the cloud and the View panel. The dialog itself is `.dialog--full` of altamus.css:
 * a large box on a desktop, the whole screen on a phone.
 * The chrome follows the theme; the picture has its own background (`data-background` of the
 * stage, the one the engine clears with: white or black, as the classic viewer).
 * ============================================================ */

.hx-pcd-dialog .dialog__body {
  display: flex;
  overflow: hidden;
}

.hx-pcd {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.hx-pcd [hidden] {
  display: none !important;
}

.hx-pcd-toolbar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  scrollbar-width: none;
}

.hx-pcd-toolbar__group {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.hx-pcd-tool {
  position: relative;
  flex: none;
}

/* "Next" and "Now" have their arrow after the word. */
.hx-pcd-tool--after .bi {
  order: 2;
}

/* "VR unavailable", on a headset whose browser cannot enter VR: it says why when it is pressed. */
.hx-pcd-tool--vr.is-unavailable {
  color: var(--color-text-muted);
}

.hx-pcd-tool.is-active {
  background: var(--color-accent-tint);
  border-color: var(--color-accent);
}

.hx-pcd-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #FFFFFF;
}

.hx-pcd-stage[data-background='dark'] {
  background: #000000;
}

.hx-pcd-canvas-wrap {
  position: absolute;
  inset: 0;
}

/* The picture: the fingers on it are the camera's, not the page's. */
.hx-pcd-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hx-pcd-canvas:active {
  cursor: grabbing;
}

.hx-pcd-canvas:focus-visible {
  outline: 2px solid var(--color-focus, #7C4DFF);
  outline-offset: -2px;
}

/* Loading, nothing to show, an error: over the whole picture. */
.hx-pcd-status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
  background: var(--color-surface-raised);
}

/* The scan before stays in view under it while the next one loads. */
.hx-pcd-status--veil {
  background: var(--color-veil);
}

.hx-pcd-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  font-size: 14px;
  color: var(--color-text-muted);
  text-align: center;
  border-radius: var(--radius-card);
}

.hx-pcd-status--veil .hx-pcd-loading {
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-raised);
}

.hx-pcd-loading__bar {
  width: min(260px, 70vw);
  height: 6px;
  accent-color: var(--color-accent);
}

.hx-pcd-status__actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

/* How many points: a line in a corner, never in the way of a pointer. */
.hx-pcd-facts {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  max-width: calc(100% - 24px);
  padding: 4px 10px;
  overflow: hidden;
  font-size: 12px;
  color: var(--color-text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}

/* The readout of a point: beside the pointer of a mouse (left and top are set by the script). */
.hx-pcd-readout {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  white-space: nowrap;
  pointer-events: none;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: var(--shadow-raised);
}

.hx-pcd-readout__item b {
  display: inline-block;
  min-width: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
}

/* After a tap: docked at the bottom, where no finger covers it, until the next tap. */
.hx-pcd-readout--docked {
  top: auto;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  flex-direction: row;
  gap: 14px;
  max-width: calc(100% - 24px);
  transform: translateX(-50%);
}

/* The View panel: beside the picture on a desktop, under it on a phone (below). */
.hx-pcd-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  width: 300px;
  max-width: calc(100% - 24px);
  padding: 0 16px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--color-text);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-raised);
}

/* The scrollbar of a panel stays inside its rounded corners: its track starts and ends where the corners do. (A
   browser without these pseudo-elements, Firefox, draws its thin one.) */
.hx-pcd-panel::-webkit-scrollbar {
  width: 10px;
}

.hx-pcd-panel::-webkit-scrollbar-track {
  margin-block: var(--radius-card);
  background: transparent;
}

.hx-pcd-panel::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-text-muted) 45%, transparent);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
}

.hx-pcd-panel::-webkit-scrollbar-thumb:hover {
  background-color: color-mix(in srgb, var(--color-text-muted) 70%, transparent);
}

@supports not selector(::-webkit-scrollbar) {
  .hx-pcd-panel {
    scrollbar-width: thin;
  }
}

/* The head of a panel: its title, the (?) of the panel right after it when it has one, and Close at the end. */
.hx-pcd-panel__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 6px;
  background: var(--color-surface-raised);
}

.hx-pcd-panel__title {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-pcd-panel__header > .icon-btn:last-child {
  margin-left: auto;
}

.hx-pcd-panel__section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--color-border);
}

.hx-pcd-panel__heading {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hx-pcd-panel__group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hx-pcd-panel__group > .btn {
  align-self: flex-start;
}

.hx-pcd-panel__note {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-pcd-panel__footer {
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

/* A panel floating beside its window (pcd/window.js, BESIDE): in the layer of the windows, where the script puts it
   (left, top, height and z-index); its header is what it is dragged by. Takes pointers: the layer around it does not. */
.hx-pcd-panel.hx-pcd-beside {
  top: auto;
  right: auto;
  bottom: auto;
  max-width: none;
  pointer-events: auto;
  outline: none;
  box-shadow: var(--shadow-lg);
}

.hx-pcd-beside .hx-pcd-panel__header {
  cursor: move;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.hx-pcd-beside .hx-pcd-panel__header .icon-btn {
  cursor: default;
}

/* ONE HEIGHT. Every control of a panel of the viewer, and of a dialog a panel opens (`hx-pcd-compact` on the panel,
   and on the `.dialog`), is as high as --hx-pcd-control: a button of any size, a field and a drop-down, a row of a
   switch or a tick, the fields of a dialog, and (below, with the rules of each) the step buttons, the sliders, the
   names of the lists and the scans of "Add scan". One number for a mouse, a little more for a finger. */
.hx-pcd-compact {
  --hx-pcd-control: 32px;
}

@media (pointer: coarse) {
  .hx-pcd-compact {
    --hx-pcd-control: 36px;
  }

  /* A phone zooms into a field whose text is smaller than 16px when it takes the focus: not here. */
  .hx-pcd-compact .field .field__input,
  .hx-pcd-compact .hx-sc-input:not([type='file']),
  .hx-pcd-compact .hx-pcd-position__row input {
    font-size: 16px;
  }
}

.hx-pcd-compact .btn {
  min-height: var(--hx-pcd-control);
  padding: 4px 10px;
  font-size: 13px;
}

/* A field and a drop-down of the kit, compact or not. */
.hx-pcd-compact .field .field__input {
  min-height: var(--hx-pcd-control);
  padding: 6px 10px;
  font-size: 13px;
}

.hx-pcd-compact .field select.field__input {
  padding-right: 30px;
  background-position: right 10px center;
}

/* Its label at rest: in the middle of the box. */
.hx-pcd-compact .field .field__label {
  top: calc((var(--hx-pcd-control) - 1.2em) / 2);
  left: 7px;
  font-size: 13px;
}

/* Floated (a value, the focus, a drop-down): on the top border, smaller, with the fill of the field behind it. */
.hx-pcd-compact .field .field__input:focus ~ .field__label,
.hx-pcd-compact .field .field__input:not(:placeholder-shown) ~ .field__label,
.hx-pcd-compact .field select.field__input ~ .field__label {
  top: -7px;
  font-size: 12px;
}

/* The fields of the dialogs (From and To, the voxel of "Align"): inside the 1px border of their box. A file field
   keeps its own height: its button is the browser's. */
.hx-pcd-compact .hx-sc-input:not([type='file']) {
  min-height: calc(var(--hx-pcd-control) - 2px);
  padding: 4px 10px;
  font-size: 13px;
}

/* The voxel of "Align" has the border itself. */
.hx-pcd-compact .hx-sc-input.hx-pcd-align__voxel,
.hx-pcd-compact .hx-sc-input.hx-pcd-align__accuracy {
  min-height: var(--hx-pcd-control);
}

/* A row of a switch or a tick: the switch keeps the size of the kit (44 x 26), which fits. */
.hx-pcd-compact .switch-row,
.hx-pcd-compact .checkbox-row {
  min-height: var(--hx-pcd-control);
  padding-top: 2px;
  padding-bottom: 2px;
}

.hx-pcd-slider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 8px;
  align-items: baseline;
  font-size: 14px;
}

.hx-pcd-slider__value {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

/* As high as the other controls of a panel: a finger gets more there too (--hx-pcd-control). */
.hx-pcd-slider__input {
  grid-column: 1 / -1;
  width: 100%;
  min-height: var(--hx-pcd-control, 32px);
  margin: 0;
  accent-color: var(--color-accent);
}

.hx-pcd-slider.is-disabled {
  opacity: 0.5;
}

.hx-pcd-legend__bar {
  height: 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.hx-pcd-legend__ends {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

@media (max-width: 599.98px) {
  .hx-pcd-toolbar {
    gap: 6px;
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) 6px max(8px, env(safe-area-inset-left, 0px));
    border-top: 0;
  }

  .hx-pcd-toolbar__group {
    gap: 6px;
  }

  /* Icons alone: the words stay for a screen reader (and as the tooltip). */
  .hx-pcd-tool {
    justify-content: center;
    min-width: 44px;
    min-height: 40px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .hx-pcd-tool .btn__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
    clip-path: inset(50%);
  }

  .hx-pcd-panel:not(.hx-pcd-beside) {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    max-width: none;
    max-height: 56%;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    border-width: 1px 0 0;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
  }

  /* Square at the bottom: the track goes down to it. */
  .hx-pcd-panel:not(.hx-pcd-beside)::-webkit-scrollbar-track {
    margin-block: var(--radius-card) 0;
  }

  /* The readout of a tap stays above the panel. */
  .hx-pcd--panel-open .hx-pcd-readout--docked {
    bottom: calc(56% + 8px);
  }
}

/* ------------------------------------------------------------
 * The viewer of a space (js/components/pcd-space-viewer.js): the lists of its sources and of
 * its boundaries, and its measurements.
 * ------------------------------------------------------------ */

/* A tool that shows its icon alone: the words stay for a screen reader (and as the tooltip). */
.hx-pcd-tool--icon {
  justify-content: center;
  min-width: 36px;
  padding-right: 8px;
  padding-left: 8px;
}

.hx-pcd-tool--icon .btn__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

.hx-pcd-list {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hx-pcd-list__all {
  padding: 6px 0;
}

/* A row of a list: the tick, the name and its kind and mark are as high as a control (--hx-pcd-control), level. */
.hx-pcd-list__row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 4px 0;
  border-top: 1px solid var(--color-border);
}

.hx-pcd-list__row.is-selected {
  margin: 0 -8px;
  padding-right: 8px;
  padding-left: 8px;
  background: var(--color-accent-tint);
  border-radius: 8px;
}

/* The tick of a row: its words are for a screen reader, the name beside it is what is seen. */
.hx-pcd-list__tick {
  flex: none;
}

.hx-pcd-list__tick .checkbox-row__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

/* The name and what is said of it, a line each; the actions of the row (Retry, Add, Unpin, Isolate) on one line under them. */
.hx-pcd-list__body {
  display: flex;
  flex: 1;
  flex-flow: row wrap;
  gap: 2px 6px;
  align-items: center;
  min-width: 0;
}

.hx-pcd-list__body > :not(.hx-pcd-list__action) {
  flex: 1 0 100%;
  min-width: 0;
}

.hx-pcd-list__name {
  min-height: var(--hx-pcd-control, 32px);
  padding: 0;
  overflow: hidden;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: 0;
}

.hx-pcd-list__name:disabled {
  color: var(--color-text-muted);
  cursor: default;
}

.hx-pcd-list__name:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.hx-pcd-list__detail {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.hx-pcd-list__row.is-failed .hx-pcd-list__detail {
  color: var(--color-danger, #c0392b);
}

.hx-pcd-list__action {
  margin-top: 4px;
}

.hx-pcd-list__kind {
  flex: none;
  font-size: 12px;
  line-height: var(--hx-pcd-control, 32px);
  color: var(--color-text-muted);
}

/* The Sources panel, for who may edit: a source whose tick is not what the entry has stored, and Save / Reset. */
.hx-pcd-list__changed {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-warning-text);
}

.hx-pcd-sources {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.hx-pcd-sources__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hx-pcd-recalculate {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

/* Piles saved with Stage and not calculated: counted over Recalculate. */
.hx-pcd-recalculate__staged {
  margin: 0;
  font-weight: 600;
  color: var(--color-warning-text);
}

.hx-pcd-sources__state {
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-pcd-sources__error {
  margin: 0;
  font-size: 13px;
  color: var(--color-danger, #c0392b);
}

/* "Sync all" at the bottom of the Sources and the Boundaries panel: what it staged, and what could not be saved. */
.hx-pcd-sync-all {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.hx-pcd-sync-all__state {
  margin: 0;
}

/* "Update all defaults" and its (?): they wrap to the next line together. */
.hx-pcd-sync-all__pair {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.hx-pcd-sync-all.is-staged .hx-pcd-sync-all__state {
  font-weight: 600;
  color: var(--color-warning-text);
}

.hx-pcd-sync-all__failed {
  padding-left: 18px;
}

/* A row "Sync all" staged: a bar at its side, as the field of a form that was changed. */
.hx-pcd-list__row.is-synced {
  box-shadow: inset 3px 0 0 var(--color-warning-text);
}

/* What is said of a calculation of the piles over the picture, and of the files that could not
   be loaded: under the count of the points and the line of the measurements, never over the
   middle of the scene, and one under the other. The column itself takes no click. */
.hx-pcd-notes {
  position: absolute;
  top: 76px;
  left: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  width: min(440px, calc(100% - 24px));
  pointer-events: none;
}

.hx-pcd-load-note,
.hx-pcd-recalc {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  box-sizing: border-box;
  min-width: min(280px, 100%);
  max-width: 100%;
  pointer-events: auto;
  padding: 6px 8px 6px 12px;
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: var(--shadow-raised);
}

.hx-pcd-recalc__text {
  flex: 1 1 180px;
  min-width: 0;
}

/* The "x" of a notice over the picture: at its end. */
.hx-pcd-recalc > .hx-pcd-notice__close,
.hx-pcd-load-note > .hx-pcd-notice__close {
  margin-left: auto;
}

.hx-pcd-recalc__text b {
  display: block;
  font-variant-numeric: tabular-nums;
}

.hx-pcd-recalc--failed,
.hx-pcd-load-note {
  border-color: var(--color-warning-text);
}

.hx-pcd-recalc[hidden],
.hx-pcd-load-note[hidden] {
  display: none;
}

.hx-pcd-load-note__icon {
  flex: none;
  color: var(--color-warning-text);
}

.hx-pcd-load-note__text {
  flex: 1 1 130px;
  min-width: 0;
}

.hx-pcd-load-note__text b,
.hx-pcd-load-note__text span {
  display: block;
}

.hx-pcd-list__row.is-calculating .hx-pcd-list__detail {
  font-style: italic;
}

/* The pile that is selected in the Boundaries panel: its results in this entry, and its settings. */
.hx-pcd-pile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 14px;
  list-style: none;
}

.hx-pcd-pile__title {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.hx-pcd-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  margin: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.hx-pcd-results dt {
  color: var(--color-text-muted);
}

.hx-pcd-results dd {
  margin: 0;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
}

.hx-pcd-results__unit {
  display: inline-block;
  min-width: 78px;
  font-weight: 400;
  color: var(--color-text-muted);
  text-align: left;
}

.hx-pcd-pile__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-pcd-pile__state {
  font-weight: 600;
  color: var(--color-text);
}

.hx-pcd-pile__state--warn {
  color: var(--color-warning-text);
}

.hx-pcd-pile__remove {
  color: var(--color-error-text);
}

.hx-pcd-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hx-pcd-settings__group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.hx-pcd-settings__legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.hx-pcd-settings__field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hx-pcd-settings__hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* The settings of a pile while the piles are calculated: shown, greyed, taking nothing. */
.hx-pcd-settings.is-calculating {
  opacity: 0.55;
}

/* A setting that is not what the entry has stored: Save would write it. */
.hx-pcd-settings .field-group.is-changed {
  padding-left: 6px;
  border-left: 3px solid var(--color-warning-text);
}

/* The position of one source (Sources panel): its nine values, each between its four step
   buttons, the helpers, Save and Cancel. Under the row of the source it is of. */
.hx-pcd-position-row {
  padding: 4px 0 12px;
  list-style: none;
  border-bottom: 1px solid var(--color-border);
}

.hx-pcd-position {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hx-pcd-position__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.hx-pcd-position__group {
  gap: 6px;
}

.hx-pcd-position__field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hx-pcd-position__row {
  display: flex;
  gap: 4px;
  align-items: flex-end;
}

.hx-pcd-position__row .field-group {
  flex: 1 1 0;
  min-width: 0;
}

.hx-pcd-position__row input {
  width: 100%;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

/* A value that differs from the pinned one (a position, a setting of a pile, its material) or the scanner's (a scan
   setting): what makes the pin red. */
.hx-pcd-position .field-group.is-differs input,
.hx-pcd-settings .field-group.is-differs input,
.hx-pcd-settings .field-group.is-differs select {
  border-color: var(--color-danger, #c0392b);
  color: var(--color-danger, #c0392b);
}

.hx-pcd-position .field-group.is-changed input,
.hx-pcd-settings .hx-pcd-position__row .field-group.is-changed input {
  border-color: var(--color-warning-text);
}

/* A setting of a pile between its step buttons is marked as changed as a position is: by its box, not a line beside it. */
.hx-pcd-settings .hx-pcd-position__row .field-group.is-changed {
  padding-left: 0;
  border-left: 0;
}

.hx-pcd-position__wrong {
  color: var(--color-danger, #c0392b);
}

.hx-pcd-position__row input[aria-invalid="true"] {
  border-color: var(--color-danger, #c0392b);
}

.hx-pcd-position__steps {
  display: flex;
  flex: none;
  gap: 2px;
}

.hx-pcd-position__step {
  box-sizing: border-box;
  min-width: 30px;
  height: var(--hx-pcd-control, 32px);
  padding: 0 4px;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text);
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong, var(--color-border));
  border-radius: 8px;
}

.hx-pcd-position__step:hover:not(:disabled) {
  background: var(--color-surface-raised);
  border-color: var(--color-text-muted);
}

.hx-pcd-position__step:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

.hx-pcd-position__step:disabled {
  cursor: default;
  opacity: 0.5;
}

.hx-pcd-position__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hx-pcd-position__saved {
  margin: 0;
  font-size: 13px;
  color: var(--color-warning-text);
}

/* A notice that stays after a save, with an "x" at its end that clears it (the viewer's `savedNotice`, and what a
   save of the scan settings came to). */
.hx-pcd-notice {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  width: 100%;
}

.hx-pcd-notice__text {
  flex: 1 1 auto;
  min-width: 0;
}

.hx-pcd-notice__close {
  flex: none;
  width: 24px;
  height: 24px;
  margin: -4px 0 -4px auto;
  font-size: 14px;
  color: var(--color-text-muted);
  /* A line over the picture takes no pointer itself; its "x" does. */
  pointer-events: auto;
}

/* The settings of one scan (the Configure panel of a scan, and under the position of a scan in a space): the
   fields of a position, each under its name; the switch; what a save came to; the two actions of the scanner. */
.hx-pcd-panel--configure {
  width: 330px;
}

/* The Sources panel: the position of a source has four step buttons and a (?) on each row, and the name of a scan
   setting with its unit ("Delay adjust (deg)") must fit in the box between them. */
.hx-pcd-panel--sources {
  width: 350px;
}

/* The Boundaries panel: the settings of a pile have the four step buttons and a (?) on each row too, and the longest
   name with its unit ("Error tolerance (%)", "Outlier NB (points)") must fit in the box between them. */
.hx-pcd-panel--boundaries {
  width: 370px;
}

.hx-pcd-configure__field {
  gap: 2px;
}

.hx-pcd-configure__switch {
  gap: 10px;
  font-size: 13px;
}

.hx-pcd-configure__switch.is-changed .switch-row__label {
  padding-left: 6px;
  border-left: 3px solid var(--color-warning-text);
}

.hx-pcd-configure__warn {
  padding: 6px 8px;
  color: var(--color-text);
  border: 1px solid var(--color-warning-text);
  border-radius: 8px;
}

.hx-pcd-configure__warn[hidden],
.hx-pcd-configure__result[hidden],
.hx-pcd-configure__again[hidden],
.hx-pcd-preview-note[hidden] {
  display: none;
}

.hx-pcd-configure__result {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.hx-pcd-configure__result--failed {
  border-color: var(--color-warning-text);
}

.hx-pcd-configure .hx-pcd-sources__actions {
  flex-wrap: wrap;
}

/* Inside the form of the position of a scan (the view of a space): set off from what is above it. */
.hx-pcd-position > .hx-pcd-configure {
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

/* Over the picture while the points are a preview made in the browser, not the stored file: under the facts. */
.hx-pcd-preview-note {
  position: absolute;
  top: 44px;
  left: 12px;
  z-index: 2;
  display: flex;
  gap: 6px;
  align-items: center;
  box-sizing: border-box;
  max-width: calc(100% - 24px);
  padding: 4px 10px;
  font-size: 12px;
  color: var(--color-text);
  pointer-events: none;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-warning-text);
  border-radius: 10px;
}

/* The line over the picture while the two points of a move are chosen: under the one of the measurements. */
.hx-pcd-position-bar {
  top: 84px;
}

@media (max-width: 599.98px) {
  /* A finger needs more than a mouse: wider, and in a panel as high as its other controls (--hx-pcd-control);
     elsewhere (the space configuration page) 40 px. */
  .hx-pcd-position__step {
    min-width: 34px;
    height: var(--hx-pcd-control, 40px);
  }

  .hx-pcd--panel-open .hx-pcd-position-bar {
    display: none;
  }

  /* The settings of a scan are a sheet under the picture, as the other panels. */
  .hx-pcd-panel--configure:not(.hx-pcd-beside) {
    width: auto;
  }
}

/* Level with the name of its row. */
.hx-pcd-swatch {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: calc((var(--hx-pcd-control, 32px) - 14px) / 2);
  background: rgb(128 128 128);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.hx-pcd-pin {
  flex: none;
  width: 16px;
  font-size: 14px;
  color: var(--color-text-muted);
  text-align: center;
}

/* In a row of a list: level with its name. */
.hx-pcd-list__row > .hx-pcd-pin {
  line-height: var(--hx-pcd-control, 32px);
}

.hx-pcd-pin--warn {
  color: var(--color-danger, #c0392b);
}

/* What the marks of the Boundaries list say, under the list. */
.hx-pcd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin: 0;
}

.hx-pcd-legend__item {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
}

/* A group of actions (the standards of a pile, other entries and spaces, the pin of a scanner, the scanner of a scan,
   new entries and other entries): its actions on one row that wraps, its heading and what it says each a line. */
.hx-pcd-standard {
  display: flex;
  flex-flow: row wrap;
  gap: 6px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}

/* Align, under Move, Level and GPS of a position: one group of tools with them, no line between. */
.hx-pcd-position > .hx-pcd-align {
  padding-top: 0;
  border-top: 0;
}

.hx-pcd-standard > :not(.hx-pcd-standard__item) {
  flex: 1 0 100%;
  min-width: 0;
}

.hx-pcd-standard__state {
  margin: 0;
}

/* An action and the (?) that says what it does: one unit, never parted. */
.hx-pcd-standard__item {
  display: inline-flex;
  flex: none;
  gap: 4px;
  align-items: center;
  max-width: 100%;
  min-width: 0;
}

/* "Add scan" and "Add file" at the top of the Sources panel on one row, "Group" on the row under them. */
.hx-pcd-scans__adds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.hx-pcd-standard__action--unpin {
  color: var(--color-error-text);
}

/* A (?) beside what it explains: a heading, a label, a switch or a field (ui.help). */
.hx-pcd-help-row {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.hx-pcd-help-row > .switch-row,
.hx-pcd-help-row--field > .field-group {
  flex: 1 1 auto;
  min-width: 0;
}

/* Beside a field whose label is inside its box: level with the box, also when an error shows under it. */
.hx-pcd-help-row--field {
  align-items: flex-start;
}

/* In the middle of the height of the box (--hx-pcd-control): the (?) is 24 px, 32 px for a finger. */
.hx-pcd-help-row--field > .help-btn {
  margin: calc((var(--hx-pcd-control, 32px) - 24px) / 2) 0 0;
}

@media (pointer: coarse) {
  .hx-pcd-help-row--field > .help-btn {
    margin: calc((var(--hx-pcd-control, 36px) - 32px) / 2) 0 0;
  }
}

/* Right after the name of a setting of a scan; "Best pitch" stays at the end. */
/* The (?) at the end of a row of a value, after "++": level with the box. */
.hx-pcd-position__row > .help-btn {
  align-self: center;
}

.hx-pcd-scans__window > .help-btn,
.hx-pcd-dialog-help {
  align-self: center;
}

/* The dialogs of "Apply…" (to other entries) and "Move…" (to another space): the two fields side by side where there is room, what the
   range holds, how far its calculations are, and the entries that failed. */
.hx-pcd-range__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.hx-pcd-range__count,
.hx-pcd-range__applied,
.hx-pcd-range__progress {
  margin: 0;
  font-weight: 600;
}

.hx-pcd-range__count--none,
.hx-pcd-range__progress--failed {
  color: var(--color-error-text);
}

.hx-pcd-range__progress {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hx-pcd-range__failed {
  max-height: 40vh;
  margin: 0;
  padding: 0 0 0 18px;
  overflow: auto;
  font-size: 13px;
}

.hx-pcd-range__failed li + li {
  margin-top: 4px;
}

/* The form of "Add a pile". */
.hx-pcd-add {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hx-pcd-add__from {
  margin: 0;
}

/* "Add a file": the file field takes the width of the dialog; the bar of the upload with what it says under it. */
.hx-pcd-upload__file {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  padding: 6px;
}

.hx-pcd-upload__progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 13px;
}

.hx-pcd-upload__progress[hidden] {
  display: none;
}

.hx-pcd-upload__bar {
  width: 100%;
  height: 8px;
}

/* "Align" (to the other sources), in the form of a position: the button, and the voxel size beside it. */
.hx-pcd-align__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.hx-pcd-align__label {
  font-size: 13px;
}

/* The field stands alone, not in the box of a labelled field: it has the outline of one itself. */
.hx-pcd-align__voxel {
  flex: none;
  width: 76px;
  min-width: 0;
  background: var(--color-field-fill);
  border: 1px solid var(--color-field-outline);
  border-radius: var(--radius-field);
}

.hx-pcd-align__voxel:focus {
  border-color: var(--color-focus);
  box-shadow: inset 0 0 0 1px var(--color-focus);
}

/* How to align (Fine, Coarse, Coarse + fine): a plain select with the outline of the voxel field. */
.hx-pcd-align__accuracy {
  flex: none;
  width: auto;
  min-width: 0;
  max-width: 100%;
  background: var(--color-field-fill);
  border: 1px solid var(--color-field-outline);
  border-radius: var(--radius-field);
}

.hx-pcd-align__accuracy:focus {
  border-color: var(--color-focus);
  box-shadow: inset 0 0 0 1px var(--color-focus);
}

.hx-pcd-align__actions[hidden] {
  display: none;
}

/* The dialogs of "Add scan" and "Other scan…": how near the entry, then the scanners with their scans. */
.hx-pcd-scans__window,
.hx-pcd-scans__scanner {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.hx-pcd-scans__window legend,
.hx-pcd-scans__scanner legend {
  width: 100%;
  padding: 0;
}

.hx-pcd-scans__scanner {
  flex-direction: column;
  gap: 0;
}

.hx-pcd-scans__scanner legend {
  font-weight: 600;
}

.hx-pcd-scans__choice,
.hx-pcd-scans__scan {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: var(--hx-pcd-control, 32px);
  cursor: pointer;
}

.hx-pcd-scans__scan {
  flex-wrap: wrap;
  gap: 2px 10px;
  padding: 2px 0;
  font-variant-numeric: tabular-nums;
}

.hx-pcd-scans__scan.is-off {
  color: var(--color-text-muted);
  cursor: default;
}

.hx-pcd-scans__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 46vh;
  overflow: auto;
}

.hx-pcd-scans__group {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hx-pcd-scans__distance,
.hx-pcd-scans__mark {
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-pcd-scans__mark {
  font-weight: 600;
}

.hx-pcd-scans__mark--used {
  color: var(--color-text);
}

/* The labels of the measurements lie over the picture and take the pointer only on themselves. */
.hx-pcd-labels {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.hx-pcd-measure {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 8px;
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  text-align: left;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-raised);
}

.hx-pcd-measure.is-selected {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-tint), var(--shadow-raised);
}

.hx-pcd-measure b {
  color: var(--color-text-muted);
}

.hx-pcd-measure-bar {
  position: absolute;
  top: 44px;
  left: 12px;
  z-index: 3;
  display: flex;
  gap: 4px;
  align-items: center;
  max-width: calc(100% - 24px);
  padding: 2px 4px 2px 12px;
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-raised);
}

.hx-pcd-stage--measuring .hx-pcd-canvas {
  cursor: crosshair;
}

/* Editing the outline of a pile (js/components/pcd-boundary-edit.js): a bar along the bottom of
   the picture, the layers over it when they are open. The dock itself takes no click: the scene
   beside and above it is turned and zoomed as ever. */
.hx-pcd-edit-dock {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  max-height: calc(100% - 24px);
  pointer-events: none;
}

.hx-pcd-edit,
.hx-pcd-edit-layers {
  box-sizing: border-box;
  max-width: 100%;
  pointer-events: auto;
  color: var(--color-text);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-raised);
}

.hx-pcd-edit {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(760px, 100%);
  padding: 6px 8px;
  font-size: 13px;
}

.hx-pcd-edit__row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  min-width: 0;
}

/* Cancel and Save (a phone): one pair, at the right, that wraps as one. */
.hx-pcd-edit__end {
  display: inline-flex;
  flex: none;
  gap: 4px;
  align-items: center;
  margin-left: auto;
}

.hx-pcd-edit__name {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  max-width: 40%;
  padding: 0 4px;
  overflow: hidden;
  font-weight: 600;
  color: var(--color-heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hx-pcd-edit__name > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.hx-pcd-edit__spacer {
  flex: 1 1 8px;
}

.hx-pcd-edit__corner.is-none .hx-pcd-edit__coords,
.hx-pcd-edit__corner.is-none .hx-pcd-edit__add,
.hx-pcd-edit__corner.is-none .hx-pcd-edit__delete {
  display: none;
}

/* In a narrow window (a phone, or a small window on a desktop) the bar is as wide as the picture:
   the name gives way first, and the two buttons of a corner show their icons alone. */
.hx-pcd-edit-dock {
  container-type: inline-size;
}

.hx-pcd-edit__narrow {
  display: none;
}

@container (max-width: 560px) {
  .hx-pcd-edit__name {
    flex: 1 1 40px;
    max-width: none;
  }

  .hx-pcd-edit__wide {
    display: none;
  }

  .hx-pcd-edit__narrow {
    display: inline;
  }

  .hx-pcd-edit__spacer {
    display: none;
  }

  .hx-pcd-edit__which {
    flex: 1 1 auto;
    min-width: 0;
  }

  .hx-pcd-edit__input {
    width: 76px;
  }

  .hx-pcd-edit__floor .btn__label,
  .hx-pcd-edit__add .btn__label,
  .hx-pcd-edit__delete .btn__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

.hx-pcd-edit__which {
  min-width: 96px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  text-align: center;
}

.hx-pcd-edit__coords {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.hx-pcd-edit__field {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--color-text-muted);
}

.hx-pcd-edit__input {
  box-sizing: border-box;
  width: 92px;
  height: 32px;
  padding: 0 8px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong, var(--color-border));
  border-radius: 8px;
}

.hx-pcd-edit__input:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

.hx-pcd-edit__input.is-invalid {
  border-color: var(--color-error-text);
}

.hx-pcd-edit__input:disabled {
  color: var(--color-text-disabled, var(--color-text-muted));
  background: var(--color-surface-sunken);
}

.hx-pcd-edit__unit {
  color: var(--color-text-muted);
}

.hx-pcd-edit__hint {
  margin: 0;
  padding: 0 4px 2px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-pcd-edit__hint--warning {
  color: var(--color-warning-text);
}

.hx-pcd-edit__hint--error {
  color: var(--color-error-text);
}

.hx-pcd-edit .icon-btn:disabled,
.hx-pcd-edit-layers .hx-pcd-edit__step:disabled {
  opacity: 0.4;
}

.hx-pcd-edit-layers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(420px, 100%);
  min-height: 0;
  padding: 8px 10px 10px;
  overflow-y: auto;
  font-size: 13px;
}

.hx-pcd-edit-layers[hidden] {
  display: none;
}

.hx-pcd-edit-layers__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hx-pcd-edit-layers__title {
  margin: 0;
  font-size: 14px;
  color: var(--color-heading);
}

.hx-pcd-edit-layers__list {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hx-pcd-edit-layers__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 4px 10px;
  align-items: end;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-pcd-edit-layers__row.is-active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.hx-pcd-edit-layers__row.is-invalid {
  border-color: var(--color-error-text);
}

.hx-pcd-edit-layers__pick {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 6px;
  align-items: center;
  min-height: 32px;
  font-weight: 600;
  cursor: pointer;
}

.hx-pcd-edit-layers__pick small {
  grid-column: 2;
  font-weight: 400;
  color: var(--color-text-muted);
}

.hx-pcd-edit-layers__height {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-pcd-edit-layers__stepper {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.hx-pcd-edit-layers__stepper .hx-pcd-edit__input {
  width: 64px;
  text-align: right;
}

.hx-pcd-edit__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 32px;
  padding: 0;
  color: var(--color-text);
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.hx-pcd-edit__step:hover:not(:disabled) {
  background: var(--color-hover);
}

.hx-pcd-edit__step:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

.hx-pcd-edit-layers__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* The custom floor of the first layer (the panel of "Floor"): the tick, what it does, the floor
   points with the height of each. In the row of the bar the height and "Delete point" are there
   while the floor is edited, "Add corner" and "Delete corner" while the outline is. */
.hx-pcd-edit__corner.is-floor .hx-pcd-edit__of-outline,
.hx-pcd-edit__corner:not(.is-floor) .hx-pcd-edit__of-floor {
  display: none;
}

.hx-pcd-edit-floor__tick {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  font-weight: 600;
  cursor: pointer;
}

.hx-pcd-edit-floor__note {
  margin: 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-pcd-edit-floor__points > summary {
  min-height: 28px;
  line-height: 28px;
  cursor: pointer;
}

.hx-pcd-edit-floor__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 190px;
  margin: 4px 0 0;
  padding: 2px;
  overflow-y: auto;
  list-style: none;
}

.hx-pcd-edit-floor__row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-pcd-edit-floor__row.is-active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.hx-pcd-edit-floor__pick {
  display: inline-flex;
  flex: 1 1 auto;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
  min-height: 32px;
  padding: 0 4px;
  font: inherit;
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 8px;
}

.hx-pcd-edit-floor__pick small {
  font-weight: 400;
  color: var(--color-text-muted);
}

.hx-pcd-edit-floor__pick:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

/* The corners for who does not see the picture: one button each, in the order of the keyboard,
   never drawn. A button that has the focus is still one a screen reader stands on. */
.hx-pcd-edit-corners {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  list-style: none;
  clip-path: inset(50%);
}

/* Where the corner under a finger is: said above the finger, which covers it. */
.hx-pcd-edit-loupe {
  position: absolute;
  z-index: 5;
  padding: 3px 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #fff;
  white-space: pre;
  pointer-events: none;
  background: rgba(20, 20, 20, 0.88);
  border-radius: 8px;
}

.hx-pcd-edit-loupe[hidden] {
  display: none;
}

/* While an outline is edited: what leaves it or changes the pile is held back (a press says why),
   and what is said of the point under the pointer gives way to the bar. */
.hx-pcd--editing .hx-pcd-tool.is-held {
  opacity: 0.45;
}

.hx-pcd--editing .hx-pcd-readout,
.hx-pcd--editing .hx-pcd-measure-bar {
  display: none;
}

.hx-pcd-stage--editing .hx-pcd-canvas {
  cursor: default;
}

@media (max-width: 599.98px) {
  .hx-pcd-edit-dock {
    right: 6px;
    bottom: 6px;
    left: 6px;
  }

  .hx-pcd-edit {
    padding: 4px 6px;
  }

  /* A finger needs more than a mouse: the fields and the steppers are 40 px high. */
  .hx-pcd-edit__input,
  .hx-pcd-edit__step {
    height: 40px;
  }

  .hx-pcd-edit__step {
    width: 36px;
  }

  .hx-pcd-edit__input {
    font-size: 16px;
  }

  .hx-pcd-edit-layers {
    max-height: 45vh;
  }

  .hx-pcd-edit-layers__row {
    grid-template-columns: 1fr 1fr;
  }

  .hx-pcd-edit-layers__pick {
    grid-column: 1 / -1;
  }
}

/* What is said of a surface is longer than what is said of a point: docked, it may take two lines. */
.hx-pcd--space .hx-pcd-readout--docked {
  flex-wrap: wrap;
  row-gap: 2px;
  justify-content: center;
  width: max-content;
}

/* The readout of a measurement that is selected has a button: it takes the pointer. */
.hx-pcd-readout--measure {
  align-items: center;
  pointer-events: auto;
}

@media (max-width: 599.98px) {
  .hx-pcd-list__row {
    padding: 10px 0;
  }

  .hx-pcd--panel-open .hx-pcd-measure-bar {
    display: none;
  }
}

/* The map under the scene (js/pcd/map-layer.js). Its credits: a line in the lower left corner,
   legible on any picture, never in the way of a pointer. The 3D map of the classic interface
   writes its own line into the same element, with these looks. */
.hx-pcd-map-credits {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.hx-pcd-map-credit {
  position: absolute;
  bottom: 6px;
  left: 8px;
  max-width: 80%;
  overflow: hidden;
  font: 11px sans-serif;
  color: #FFFFFF;
  text-overflow: ellipsis;
  text-shadow: 0 0 3px #000000, 0 0 2px #000000;
  white-space: nowrap;
}

/* What is said of the map while it loads, and when it could not be loaded: over a corner of the
   picture, never over the scene. */
.hx-pcd-map-note {
  position: absolute;
  bottom: 28px;
  left: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  max-width: min(420px, calc(100% - 24px));
  padding: 6px 8px 6px 12px;
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: var(--shadow-raised);
}

.hx-pcd-map-note__text {
  flex: 1 1 180px;
  min-width: 0;
}

.hx-pcd-map-note--failed .hx-pcd-map-note__text b {
  display: block;
}

/* The choice of the map in the View panel: three rows to tap, each with what it is. */
.hx-pcd-map-choice {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.hx-pcd-map-choice__legend {
  padding: 0;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.hx-pcd-map-choice__option {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: var(--hx-pcd-control, 32px);
  padding: 4px 8px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 8px;
}

.hx-pcd-map-choice__option:hover {
  background: var(--color-accent-tint);
}

.hx-pcd-map-choice__option:has(input:checked) {
  background: var(--color-accent-tint);
  border-color: var(--color-accent);
}

.hx-pcd-map-choice__option:has(input:focus-visible) {
  outline: 2px solid var(--color-focus, #7C4DFF);
  outline-offset: 1px;
}

.hx-pcd-map-choice__option input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-accent);
}

.hx-pcd-map-choice__words {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 14px;
}

.hx-pcd-map-choice__words small {
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-pcd-map-choice:disabled .hx-pcd-map-choice__option {
  cursor: default;
  opacity: 0.55;
}

.hx-pcd-map-choice:disabled .hx-pcd-map-choice__option:hover {
  background: none;
}

@media (max-width: 599.98px) {
  /* The panel covers the lower part of the picture: what is said of the map goes above it. */
  .hx-pcd--panel-open .hx-pcd-map-note {
    bottom: calc(56% + 8px);
  }
}

/* ------------------------------------------------------------
 * The windows of the native 3D viewer (js/pcd/window.js), on a page with room for them.
 * The layer has the z-index of `.dialog-backdrop` of altamus.css, so the order in the page
 * decides between a window and a dialog: the script keeps the layer after the dialogs that were
 * open when a window opened, and a dialog opened later is after it. Under it: the page and the
 * floating classic viewers (900). Over it: menus (1100), tooltips (1200), toasts (1300).
 * The layer takes no pointer: what is not a window is the page's.
 * Left, top, width, height and the z-index of a window are set by the script.
 * ------------------------------------------------------------ */

.hx-pcd-windows {
  position: fixed;
  inset: 0;
  z-index: 1000;
  /* Clipped, not scrolled: the focus given to a control of a panel that hangs past the page must not scroll the layer. */
  overflow: hidden;
  overflow: clip;
  pointer-events: none;
}

.hx-pcd-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  color: var(--color-text);
  pointer-events: auto;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-strong, var(--color-border));
  border-radius: var(--radius-card);
  outline: none;
  box-shadow: var(--shadow-lg);
  /* The toolbar goes by the width of the window, not of the page (below). */
  container: hx-pcd-window / inline-size;
}

/* The window that has the focus says so, also when the focus is in a panel beside it. */
.hx-pcd-window:focus-within,
.hx-pcd-window.has-focus-beside {
  border-color: var(--color-accent);
}

.hx-pcd-window.is-maximised {
  border-width: 0;
  border-radius: 0;
}

/* The bar it is dragged by: a finger on it moves the window, not the page. */
.hx-pcd-window__bar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 48px;
  padding: 4px 4px 4px 16px;
  cursor: move;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.hx-pcd-window.is-maximised .hx-pcd-window__bar {
  cursor: default;
}

.hx-pcd-window__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hx-pcd-window__tools {
  display: flex;
  flex: none;
  align-items: center;
  cursor: default;
}

.hx-pcd-window__tools .icon-btn {
  font-size: 18px;
}

.hx-pcd-window__body {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* The edges and corners it is resized from: over the content, 6px in and (clipped by the window) no further out. */
.hx-pcd-window__grip {
  position: absolute;
  z-index: 6;
  touch-action: none;
}

.hx-pcd-window__grip--n,
.hx-pcd-window__grip--s {
  right: 12px;
  left: 12px;
  height: 6px;
  cursor: ns-resize;
}

.hx-pcd-window__grip--e,
.hx-pcd-window__grip--w {
  top: 12px;
  bottom: 12px;
  width: 6px;
  cursor: ew-resize;
}

.hx-pcd-window__grip--n { top: 0; }
.hx-pcd-window__grip--s { bottom: 0; }
.hx-pcd-window__grip--e { right: 0; }
.hx-pcd-window__grip--w { left: 0; }

.hx-pcd-window__grip--ne,
.hx-pcd-window__grip--se,
.hx-pcd-window__grip--sw,
.hx-pcd-window__grip--nw {
  /* More than the edges: the round corner of the window cuts the tip of it off. */
  width: 18px;
  height: 18px;
}

.hx-pcd-window__grip--ne { top: 0; right: 0; cursor: nesw-resize; }
.hx-pcd-window__grip--se { right: 0; bottom: 0; cursor: nwse-resize; }
.hx-pcd-window__grip--sw { bottom: 0; left: 0; cursor: nesw-resize; }
.hx-pcd-window__grip--nw { top: 0; left: 0; cursor: nwse-resize; }

.hx-pcd-window.is-maximised .hx-pcd-window__grip {
  display: none;
}

/* A finger needs more of an edge than a mouse. */
@media (pointer: coarse) {
  .hx-pcd-window__grip--n,
  .hx-pcd-window__grip--s {
    height: 12px;
  }

  .hx-pcd-window__grip--e,
  .hx-pcd-window__grip--w {
    width: 12px;
  }

  .hx-pcd-window__grip--ne,
  .hx-pcd-window__grip--se,
  .hx-pcd-window__grip--sw,
  .hx-pcd-window__grip--nw {
    width: 24px;
    height: 24px;
  }
}

/* A narrow window: the tools are icons alone, as on a phone (the words stay for a screen reader). */
@container hx-pcd-window (max-width: 699.98px) {
  .hx-pcd-toolbar {
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .hx-pcd-toolbar__group {
    gap: 6px;
  }

  .hx-pcd-tool {
    justify-content: center;
    min-width: 40px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .hx-pcd-tool .btn__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
    clip-path: inset(50%);
  }
}

/* ============================================================ end of the native 3D viewer */

/* The header between the phone layout and a desktop: six navigation links (Service is the sixth, for
   administrators) fit beside the brand and the buttons when the gaps are narrower. */
@media (min-width: 720px) and (max-width: 1099.98px) {
  .nx-header {
    gap: 12px;
    padding: 0 16px;
  }

  .nx-nav {
    gap: 0;
  }

  .nx-nav__link {
    padding: 0 7px;
    font-size: 14px;
  }

  .nx-nav__link.is-selected::after {
    right: 7px;
    left: 7px;
  }
}

/* ============================================================ Site temperature */
/* The temperature of a site (components/site-temperature.js): the control in the hero of the site
   page, beside "Site actions", and the dialog with its trend. Every class of this block starts
   with "hx-st". */

/* The control: a button of the hero (dark navy in both themes), with the figure in tabular digits. */
.hx-st-control[hidden] {
  display: none;
}

.hx-st-control {
  gap: 6px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.hx-st-control > .bi {
  font-size: 15px;
  color: #ffb199;
}

.hx-st-control:hover,
.hx-st-control:focus-visible {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

/* The installation pictures of a site (components/site-gallery.js): the control to the right of the
   temperature, an icon alone; a click opens the pictures (components/lightbox.js). Every class of it
   starts with "hx-sg". */
.hx-sg-control[hidden] {
  display: none;
}

.hx-sg-control {
  flex: none;
  justify-content: center;
  min-width: 36px;
  padding-inline: 9px;
}

.hx-sg-control > .bi {
  font-size: 16px;
}

.hx-sg-control:hover,
.hx-sg-control:focus-visible {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

/* While the links are asked for: the spinner is drawn for the dark header, in both themes. */
.hx-sg-control.is-loading > .spinner {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
}

/* The dialog. */
.hx-st {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.hx-st__head[hidden],
.hx-st__section[hidden],
.hx-st__chart-state[hidden],
.hx-st__chart > canvas[hidden] {
  display: none;
}

.hx-st__head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hx-st__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--series-temperature, #ff6e40) 14%, transparent);
  font-size: 24px;
  color: var(--series-temperature, #ff6e40);
}

.hx-st__now {
  min-width: 0;
}

.hx-st__value {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--color-heading);
}

.hx-st__summary {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: var(--color-text-muted);
}

.hx-st__section {
  min-width: 0;
}

.hx-st__section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.hx-st__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-st__section > .hx-st__title {
  margin-bottom: 8px;
}

.hx-st__range {
  max-width: 100%;
}

/* Five ranges (1 day to 12 months) on a narrow phone: less room around each, so the row fits. */
@media (max-width: 420px) {
  .hx-st__range .segmented__option {
    padding-right: 7px;
    padding-left: 7px;
  }
}

.hx-st__chart {
  position: relative;
  height: 260px;
}

/* What stands over the chart: the spinner while a range is asked for, or that there is nothing to draw. */
.hx-st__chart-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background: color-mix(in srgb, var(--color-surface-raised, #ffffff) 80%, transparent);
  text-align: center;
}

.hx-st__note {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-st__scanners {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--color-border);
}

.hx-st__scanner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 76px minmax(0, 190px);
  align-items: center;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}

.hx-st__scanner-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-heading);
}

.hx-st__scanner-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hx-st__scanner-position {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-st__scanner-position--verified > .bi {
  color: var(--color-success, #1e8e3e);
}

/* A scanner that is not verified by GPS (it stands somewhere else, or has no position): its reading is not part of the temperature. */
.hx-st__scanner.is-left-out .hx-st__scanner-value {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

@media (max-width: 599.98px) {
  .hx-st__value {
    font-size: 26px;
  }

  .hx-st__chart {
    height: 210px;
  }

  /* Two lines: the name and the reading, then whether it is online and where it is. */
  .hx-st__scanner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hx-st__scanner-value {
    grid-column: 2;
    grid-row: 1;
  }

  .hx-st__scanner > .tag {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  .hx-st__scanner-position {
    grid-column: 1;
    grid-row: 2;
  }
}

/* ============================================================ end of the site temperature */

/* ============================================================ Site summary
   components/site-info.js: the summary of a site in a dialog of the kit — the
   buttons that go to its pages, then three tabs (Summary, Users, Pictures).
   The skeleton and the page states are the shared ones; a picture shows large
   in the lightbox (components/lightbox.js). Prefix `hx-si-`. */

.hx-si {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  container-type: inline-size;
}

.hx-si [hidden] {
  display: none;
}

/* The pages the classic dialog had as sections of its own. */
.hx-si__go {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.hx-si__tabs .tabs__panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* The sections are of different heights: the dialog does not shrink to a short one. */
  min-height: min(340px, 50vh);
  padding-top: 14px;
  overflow: visible;
}

.hx-si__tabs .tabs__panel[hidden] {
  display: none;
}

.hx-si__facts .hx-kv__row:first-child {
  padding-top: 0;
}

.hx-si__block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hx-si__heading {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hx-si__note,
.hx-si__count {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* ---- the on-site contacts */

.hx-si__contacts,
.hx-si__visits,
.hx-si__events,
.hx-si__users,
.hx-si__pics {
  padding: 0;
  margin: 0;
  list-style: none;
}

.hx-si__contacts {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-si__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: center;
  padding: 10px 14px;
}

.hx-si__contact + .hx-si__contact {
  border-top: 1px solid var(--color-border);
}

.hx-si__contact-name {
  flex: 1 1 180px;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

/* A phone number or an address: a link where it can be one. */
.hx-si__link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  font-size: 13.5px;
  color: var(--color-text-muted);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.hx-si__link {
  color: var(--color-accent-text);
}

a.hx-si__link:hover,
a.hx-si__link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- the pending service visits */

.hx-si__visits {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hx-si__visit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 6px 6px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.hx-si__visit-open,
.hx-si__event {
  display: flex;
  gap: 6px 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  font: inherit;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 8px;
}

.hx-si__visit-open {
  flex-wrap: wrap;
}

.hx-si__visit-open:hover,
.hx-si__event:hover {
  background: var(--color-row-hover);
}

.hx-si__visit-open:focus-visible,
.hx-si__event:focus-visible,
.hx-si__pic:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

.hx-si__visit-open.is-loading,
.hx-si__event.is-loading {
  cursor: progress;
  opacity: 0.6;
}

.hx-si__visit-open > .bi:first-child {
  color: var(--color-accent-text);
}

.hx-si__visit-open > .bi:last-child {
  margin-left: auto;
  color: var(--color-text-muted);
}

.hx-si__visit-when {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-heading);
}

.hx-si__visit-who {
  min-width: 0;
  font-size: 13.5px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

/* The report of a visit can be very long: four lines of it. */
.hx-si__visit-details {
  display: -webkit-box;
  padding: 0 10px;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-text);
  overflow-wrap: anywhere;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.hx-si__visit > .hx-si__note {
  padding: 0 10px;
}

.hx-si__events {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border);
  padding-top: 4px;
}

.hx-si__event .tag {
  flex: none;
}

.hx-si__event-title {
  flex: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
}

.hx-si__event-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 13.5px;
  color: var(--color-text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- the users */

.hx-si__users {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-si__user {
  display: flex;
  gap: 8px 16px;
  align-items: center;
  padding: 10px 14px;
}

.hx-si__user + .hx-si__user {
  border-top: 1px solid var(--color-border);
}

.hx-si__user[aria-busy='true'] .hx-si__user-who {
  opacity: 0.6;
}

.hx-si__user-who {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hx-si__user-name {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.hx-si__user-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-si__user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  align-items: center;
  min-width: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.hx-si__user-meta .hx-si__link {
  font-size: 13px;
}

.hx-si__user-actions {
  display: flex;
  flex: none;
  gap: 4px 8px;
  align-items: center;
  justify-content: flex-end;
}

/* The switch of the kit is a row of a list: here it stands among the buttons of a user. */
.hx-si__switch {
  flex: none;
  gap: 8px;
  padding: 4px 8px;
  font-size: 13.5px;
  border-radius: 8px;
}

.hx-si__switch .switch-row__label {
  flex: none;
  color: var(--color-text-muted);
}

.hx-si__switch.is-off {
  cursor: not-allowed;
}

.hx-si__switch.is-off:hover {
  background: none;
}

.hx-si__user-actions .icon-btn {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

/* ---- the pictures */

.hx-si__pics-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  justify-content: space-between;
}

.hx-si__pics-head .hx-si__count {
  flex: 1 1 220px;
  min-width: 0;
}

.hx-si__pics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.hx-si__pics > li {
  min-width: 0;
}

.hx-si__pic {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 0 0 6px;
  font: inherit;
  color: var(--color-text);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 10px;
}

button.hx-si__pic {
  cursor: zoom-in;
}

.hx-si__pic-frame {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-si__pic-frame > .bi {
  font-size: 22px;
}

.hx-si__pic-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.15s ease;
}

button.hx-si__pic:hover .hx-si__pic-img {
  transform: scale(1.04);
}

.hx-si__pic-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0 2px;
}

.hx-si__pic-when {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.hx-si__pic-caption {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.hx-si__pic-skeleton {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--color-skeleton);
  border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .hx-si__pic-img {
    transition: none;
  }

  button.hx-si__pic:hover .hx-si__pic-img {
    transform: none;
  }
}

/* No room for the switch and the buttons beside the user: they go under, the switch at the start. */
@container (max-width: 640px) {
  .hx-si__user {
    flex-direction: column;
    align-items: stretch;
  }

  .hx-si__user-actions {
    justify-content: flex-start;
  }

  .hx-si__switch {
    padding-left: 0;
    margin-right: auto;
  }

  /* The details of an event go under its level and its title. */
  .hx-si__event {
    flex-wrap: wrap;
  }

  .hx-si__event-details {
    flex-basis: 100%;
    white-space: normal;
  }

  .hx-si__pics {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px;
  }
}

/* ============================================================ end of the site summary */

/* ============================================================ Convert LAS/LAZ to PCD
   components/laz-convert.js: a dialog of the kit — what the conversion assumes,
   the form (the position, the file, the voxel size), then what is going on
   (the upload with its bar, the conversion with its time), the file that came
   out, or what went wrong. Colours are the tokens of the kit, so it follows
   the light and the dark theme. Prefix `hx-lz-`. Its button in the Site
   summary is `hx-si__address` (beside the address). */

/* The address of the Site summary, with the button of the converter beside it. */
.hx-si__address {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.hx-lz {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.hx-lz [hidden] {
  display: none;
}

/* The site the file is of, under the title. */
.hx-lz__site {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

/* What the conversion assumes: said before anything is chosen. */
.hx-lz__assumes {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--color-text);
  background: var(--color-accent-selected);
  border-radius: 8px;
}

.hx-lz__assumes .bi {
  flex: none;
  margin-top: 2px;
  color: var(--color-accent-text);
}

.hx-lz__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.hx-lz__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.hx-lz__legend {
  padding: 0;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Latitude and longitude side by side; one under the other where there is no room. */
.hx-lz__position {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 12px;
  min-width: 0;
}

.hx-lz__position .field-group,
.hx-lz__group > .field-group {
  min-width: 0;
}

.hx-lz__group > .field-group {
  max-width: 220px;
}

.hx-lz__reset {
  align-self: flex-start;
  padding: 2px 0;
  font: inherit;
  font-size: 13px;
  color: var(--color-accent-text);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 4px;
}

.hx-lz__reset:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-lz__reset:disabled {
  color: var(--color-text-disabled);
  cursor: default;
}

/* The file field takes the width of the dialog, and never more. */
.hx-lz__file {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  padding: 6px;
}

.hx-lz__file-state {
  min-height: 1.3em;
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.hx-lz__file-state.is-wrong,
.hx-lz__error {
  color: var(--color-error-text);
}

.hx-lz__hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* What is going on: the step in words, the bar of the upload, a line under it. */
.hx-lz__work {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.hx-lz__work-label {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-heading);
}

.hx-lz__work-note {
  font-size: 13px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.hx-lz__bar {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  appearance: none;
  background: var(--color-skeleton);
  border: 0;
  border-radius: 999px;
}

.hx-lz__bar::-webkit-progress-bar {
  background: var(--color-skeleton);
}

.hx-lz__bar::-webkit-progress-value {
  background: var(--color-accent);
  transition: width 0.2s linear;
}

.hx-lz__bar::-moz-progress-bar {
  background: var(--color-accent);
}

/* The file that came out. */
.hx-lz__result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.hx-lz__done {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-heading);
}

.hx-lz__done .bi {
  color: var(--color-accent-text);
}

.hx-lz__download {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  max-width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-on-accent-tint);
  text-decoration: none;
  overflow-wrap: anywhere;
  background: var(--color-accent-tint);
  border-radius: 8px;
}

.hx-lz__download:hover {
  background: var(--color-accent-tint-hover);
}

.hx-lz__download:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-lz__error {
  margin: 0;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.45;
  background: var(--color-error-tint);
  border-radius: 8px;
}

/* The buttons of the footer that are not of this step. */
.hx-lz-box .dialog__footer [hidden] {
  display: none;
}

@media (max-width: 599.98px) {
  .hx-lz-box .dialog__footer {
    flex-wrap: wrap;
  }

  .hx-lz__group > .field-group {
    max-width: none;
  }
}

/* ============================================================ end of Convert LAS/LAZ to PCD */

/* ============================================================ The lightbox
   components/lightbox.js: pictures that belong together, large over the whole
   window — the pictures of an event or of a service visit
   (components/service-pictures.js) and of a site (components/site-info.js).
   Dark in both themes: a picture is judged against it, not against the page.
   Over the dialogs and the windows (1000), under menus (1100), tooltips (1200)
   and toasts (1300). Prefix `hx-lightbox`. */

.hx-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  font-size: 14px;
  line-height: 1.45;
  color: #e6ecf5;
  color-scheme: dark;
  background: rgb(6 12 22 / 94%);
  outline: 0;
  overscroll-behavior: contain;
  animation: hx-lightbox-in 0.16s ease-out;
}

@keyframes hx-lightbox-in {
  from {
    opacity: 0;
  }
}

.hx-lightbox [hidden] {
  display: none;
}

/* ---- over the picture: where it is among the others, what they are of, the original, Close */

.hx-lightbox__bar {
  display: flex;
  flex: none;
  gap: 8px;
  align-items: center;
  min-height: 60px;
  padding: 8px 12px 8px 16px;
}

.hx-lightbox__heading {
  display: flex;
  flex: 1;
  gap: 12px;
  align-items: baseline;
  min-width: 0;
}

.hx-lightbox__position {
  flex: none;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.hx-lightbox__title {
  min-width: 0;
  overflow: hidden;
  color: #b9c4d6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hx-lightbox__button {
  display: inline-flex;
  flex: none;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 16px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: rgb(255 255 255 / 10%);
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 999px;
}

.hx-lightbox__close {
  width: 44px;
  padding: 0;
  font-size: 18px;
}

.hx-lightbox__button:hover,
.hx-lightbox__nav:hover {
  background: rgb(255 255 255 / 22%);
}

.hx-lightbox__button:focus-visible,
.hx-lightbox__nav:focus-visible,
.hx-lightbox__thumb:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--color-focus);
}

/* ---- the picture: in the middle, as large as fits, never larger than it is */

.hx-lightbox__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}

.hx-lightbox__frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 76px;
}

.hx-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgb(0 0 0 / 55%);
  transition: opacity 0.15s ease;
}

.hx-lightbox__stage.is-loading .hx-lightbox__img {
  opacity: 0;
}

/* The small picture of a picture, while the picture itself loads: in its place, as large as it will be
   (scaled up to what fits, as a picture is scaled down to it), a little blurred so that it does not pass for
   it. The picture takes its place when it is here. */
.hx-lightbox__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: blur(6px);
}

/* A small picture of a page (`showSmall` of components/lightbox.js) is not seen until it has loaded: one whose
   thumbnail is not there never shows as a broken image before the picture itself has taken its place. */
img[data-small='loading'] {
  opacity: 0;
}

/* A small picture that is as large as its picture stands at its own size: a picture is never shown larger than it is. */
.hx-lightbox__placeholder--natural {
  object-fit: scale-down;
}

/* The spinner comes after a moment: a picture that is there already shows without it. */
.hx-lightbox__wait {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: hx-lightbox-wait 0.2s step-end both;
}

@keyframes hx-lightbox-wait {
  from {
    opacity: 0;
  }
}

.hx-lightbox__state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 24px 76px;
  font-size: 14.5px;
  text-align: center;
  pointer-events: none;
}

.hx-lightbox__state > * {
  pointer-events: auto;
}

.hx-lightbox__state > .bi {
  font-size: 28px;
}

.hx-lightbox__state .btn {
  color: #fff;
  background: transparent;
  border-color: rgb(255 255 255 / 60%);
}

.hx-lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  font-size: 22px;
  color: #fff;
  cursor: pointer;
  background: rgb(11 21 38 / 66%);
  border: 1px solid rgb(255 255 255 / 40%);
  border-radius: 999px;
  transform: translateY(-50%);
}

.hx-lightbox__nav--prev {
  left: 12px;
}

.hx-lightbox__nav--next {
  right: 12px;
}

/* ---- under the picture: its time and its caption, then the others, small */

.hx-lightbox__caption {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  min-height: 2.9em;
  max-height: 5.8em;
  padding: 8px 16px 4px;
  overflow-y: auto;
  text-align: center;
  overflow-wrap: anywhere;
}

.hx-lightbox__time {
  font-weight: 600;
  color: #fff;
}

.hx-lightbox__text {
  max-width: 80ch;
  color: #c9d3e2;
}

.hx-lightbox__strip {
  position: relative;
  display: flex;
  flex: none;
  gap: 8px;
  padding: 8px 12px 12px;
  margin: 0;
  overflow: auto hidden;
  list-style: none;
  scrollbar-width: thin;
}

/* In the middle while they fit; from the left, and scrolled, when they do not. */
.hx-lightbox__strip > li:first-child {
  margin-left: auto;
}

.hx-lightbox__strip > li:last-child {
  margin-right: auto;
}

.hx-lightbox__strip > li {
  flex: none;
}

.hx-lightbox__thumb {
  display: block;
  width: 72px;
  height: 54px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: #1a2436;
  border: 2px solid transparent;
  border-radius: 8px;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.hx-lightbox__thumb:hover,
.hx-lightbox__thumb.is-current {
  opacity: 1;
}

.hx-lightbox__thumb.is-current {
  border-color: #fff;
}

.hx-lightbox__thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hx-lightbox__strip > .is-broken .hx-lightbox__thumb-img {
  visibility: hidden;
}

/* ---- a phone: the picture from edge to edge, the edge buttons over it */

@media (max-width: 599.98px) {
  .hx-lightbox__bar {
    padding: 6px 8px 6px 12px;
  }

  .hx-lightbox__frame {
    padding: 0;
  }

  .hx-lightbox__state {
    padding: 24px 60px;
  }

  .hx-lightbox__img {
    border-radius: 0;
  }

  .hx-lightbox__nav {
    width: 44px;
    height: 44px;
    font-size: 19px;
  }

  .hx-lightbox__nav--prev {
    left: 6px;
  }

  .hx-lightbox__nav--next {
    right: 6px;
  }

  /* "Open original" is its sign alone. */
  .hx-lightbox__original {
    width: 44px;
    padding: 0;
  }

  .hx-lightbox__button-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .hx-lightbox__thumb {
    width: 60px;
    height: 45px;
  }
}

/* ---- a low window (a phone on its side): the room is the picture's */

@media (max-height: 480px) {
  .hx-lightbox__bar {
    min-height: 0;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .hx-lightbox__strip {
    display: none;
  }

  .hx-lightbox__caption {
    flex-flow: row wrap;
    gap: 2px 10px;
    justify-content: center;
    min-height: 0;
    max-height: 2.9em;
    padding: 4px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-lightbox,
  .hx-lightbox__wait {
    animation: none;
  }

  .hx-lightbox__img,
  .hx-lightbox__thumb {
    transition: none;
  }
}

/* ============================================================ end of the lightbox */

/* ============================================================ Site details (components/site-details.js) */

/* Every class of this block starts with "hx-sd". The dialog of the details of a site itself: a form in two
   columns (one on a phone), then the payment, the API key and "Delete site", each a section under a rule. The
   colours are the tokens of the kit: light and dark follow them. */

.hx-sd {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.hx-sd__form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  min-width: 0;
  margin: 0;
}

.hx-sd__form .field-group {
  min-width: 0;
}

/* The name and the address take the whole width. */
.hx-sd__field--name,
.hx-sd__field--address {
  grid-column: 1 / -1;
}

/* The client code, with the name of the client under it. */
.hx-sd__client {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hx-sd__hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.hx-sd__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.hx-sd__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* The key, and what can be done with it at its end; under it where there is no room. */
.hx-sd__key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  min-width: 0;
  font-size: 14px;
}

.hx-sd__key-value {
  min-width: 0;
}

.hx-sd__none {
  color: var(--color-text-muted);
}

.hx-sd__key-actions {
  display: flex;
  flex-wrap: wrap;
  margin-left: auto;
}

.hx-sd__key-actions [hidden] {
  display: none;
}

/* The payment: the choice, then what belongs to the chosen one (the number of the purchase order, or the cards). */
.hx-sd__pay-choice {
  display: flex;
  min-width: 0;
}

.hx-sd__pay-choice .segmented {
  max-width: 100%;
}

.hx-sd__pay-part {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hx-sd__pay-part[hidden],
.hx-sd__pay-part [hidden] {
  display: none;
}

/* The number is as wide as a field of the form above it. */
.hx-sd__field--order {
  width: calc(50% - 7px);
  min-width: 0;
}

/* A link that leaves the dialog: to the map. */
.hx-sd__link {
  padding: 2px 0;
  font: inherit;
  color: var(--color-accent-text);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 4px;
}

.hx-sd__link:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-sd__link:disabled {
  color: var(--color-text-disabled);
  cursor: default;
}

.hx-sd__alert {
  margin-top: 14px;
}

@media (max-width: 599.98px) {
  .hx-sd__form {
    grid-template-columns: minmax(0, 1fr);
  }

  .hx-sd__field--order {
    width: 100%;
  }
}

/* ============================================================ end of the site details */

/* ============================================================ Router dialog
   components/router-config.js: the accordion, the states, the toolbars, the chart and the table are the scanner
   dialog's (`hx-sc-` above) and the form the site details' (`hx-sd__`); this is what they do not cover. Prefix `hx-router`.
   The power supply dialog (components/power-supply-config.js, `hx-supply-config`) is drawn the same way: its Voltage
   section uses the toolbars and summary of the Data usage section (`hx-router__tools`, `__ranges`, `__summary`). */

.hx-router-config .hx-sc-acc__panel > .hx-kv {
  margin: 0;
}

/* The VPN: its label, the switch and the word, on one line at the start (not spread across like a row of a menu). */
.hx-router__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  min-width: 0;
}

.hx-router__vpn.switch-row {
  justify-content: flex-start;
  gap: 12px;
  min-height: 40px;
  padding: 0;
  font-weight: 600;
}

.hx-router__vpn.switch-row:hover {
  background: none;
}

.hx-router__vpn.is-disabled {
  cursor: default;
}

.hx-router__vpn-word {
  min-width: 4.5em;
  font-weight: 400;
  color: var(--color-text-muted);
}

.hx-router__send {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.hx-router__hint--warn {
  color: var(--color-warning-text, var(--color-text));
}

.hx-router__say {
  margin: 0;
  font-size: 13px;
  color: var(--color-error-text);
}

.hx-router__say[hidden] {
  display: none;
}

.hx-router__ecm {
  color: var(--color-accent-text);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.hx-router__ecm .bi {
  font-size: 11px;
}

.hx-router__tools {
  justify-content: space-between;
  align-items: center;
}

.hx-router__ranges {
  min-width: 0;
  max-width: 100%;
}

/* From and To share the row with the button that loads again (the dialog is narrower than the scanner's). */
.hx-router-config .hx-sc-toolbar > .hx-sc-field,
.hx-supply-config .hx-sc-toolbar > .hx-sc-field {
  flex: 1 1 0;
  min-width: 170px;
}

.hx-router__summary {
  margin-bottom: 8px;
}

@media (max-width: 599.98px) {
  .hx-router__ranges,
  .hx-router__ranges .segmented {
    width: 100%;
  }

  .hx-router__ranges .segmented__option {
    flex: 1 1 0;
    min-width: 0;
  }

  .hx-router-config .hx-sc-toolbar > .hx-sc-field,
  .hx-supply-config .hx-sc-toolbar > .hx-sc-field {
    flex: 1 1 100%;
  }
}

/* ============================================================ Power supply dialog
   components/power-supply-config.js: what the router dialog's rules above do not cover. Prefix `hx-supply`. */

/* The scanners checklist under the form, in the Settings section. */
.hx-supply-config .hx-sv-form__scanners {
  margin: 4px 0 0;
}

/* A reading under the low threshold, in the table of the Voltage section. */
.hx-supply-config .hx-supply__low {
  color: var(--color-warning-text, var(--color-text));
  font-weight: 600;
}

/* The Type of a supply and "Edit types…" beside it; the names of the types are long ("Morningstar Sunsaver Lead-Acid
   Battery"): the select takes what is left and cuts its text, the button goes under it on a narrow window. */
.hx-supply__type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  min-width: 0;
}

.hx-supply__type-row > .hx-supply__type {
  flex: 1 1 240px;
  min-width: 0;
}

.hx-supply__type select {
  min-width: 0;
  max-width: 100%;
  text-overflow: ellipsis;
}

.hx-supply__edit-types {
  flex: 0 0 auto;
}

/* The window "Types of power supply" (components/power-supply-types.js): a row per type (name, warning voltage, Save; for a
   super-user the extension table under them), then "Add type". */
.hx-supply-types {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.hx-supply-types__intro {
  margin: 0;
}

.hx-supply-types__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hx-supply-types__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  min-width: 0;
}

.hx-supply-types__line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  min-width: 0;
}

.hx-supply-types__line > .hx-supply-types__name,
.hx-supply-types__line > .hx-supply-types__table {
  flex: 1 1 300px;
  min-width: 0;
}

.hx-supply-types__line .field-group {
  margin: 0;
}

.hx-supply-types__line > .hx-supply-types__warning {
  flex: 0 1 150px;
  min-width: 120px;
}

.hx-supply-types__save {
  flex: 0 0 auto;
  margin-left: auto;
}

.hx-supply-types__line--table {
  align-items: flex-start;
}

/* The foot of a row: how many supplies have the type, then Save and Remove at the end. */
.hx-supply-types__line--foot {
  justify-content: space-between;
}

.hx-supply-types__used {
  color: var(--color-text-muted);
  font-size: 13px;
}

.hx-supply-types__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.hx-supply-types__alert {
  margin: 0;
}

.hx-supply-types__hint {
  flex: 1 1 100%;
  margin: 0;
}

.hx-supply-types__add {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.hx-supply-types__heading {
  margin: 0;
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: 600;
}

/* "Sync from scanners…" at the end of the row of Chart / Table. */
.hx-supply__view {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

/* The prompt of "Sync from scanners": the explanation, then From and To side by side (one above the other on a phone). */
.hx-supply-sync {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hx-supply-sync__text {
  margin: 0;
  color: var(--color-text-muted);
}

.hx-supply-sync__times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 599.98px) {
  .hx-supply-sync__times {
    grid-template-columns: minmax(0, 1fr);
  }

  .hx-supply__view {
    width: 100%;
    justify-content: space-between;
  }
}

/* "Sync batteries from InvenTree" (components/inventree-battery-sync.js): the site written into, the part search, the
   preview table. */
.hx-bsync {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hx-bsync__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* The body of a phone's sheet is only so tall: nothing in it shrinks (the body scrolls instead). */
.hx-bsync > *,
.hx-bsync__col > * {
  flex-shrink: 0;
}

/* One column (Kyle, 2026-11-15), the dialog 80% of the window high on a desktop (openDialog `height`; a phone's sheet
   ignores it): the stock items take the height left and scroll inside it. */
@media (min-width: 720px) {
  .hx-bsync {
    height: 100%;
  }

  .hx-bsync__col--stock,
  .hx-bsync__result {
    flex: 1 1 auto;
    min-height: 0;
  }

  .hx-bsync__col--stock .hx-bsync__table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }
}

.hx-bsync__placeholder {
  margin: 0;
  padding: 24px 16px;
  color: var(--color-text-muted);
  font-size: 14px;
  text-align: center;
  border: 1px dashed var(--color-border);
  border-radius: 10px;
}

.hx-bsync__result {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hx-bsync__into,
.hx-bsync__chosen,
.hx-bsync__summary {
  margin: 0;
}

.hx-bsync__into {
  font-size: 15px;
}

.hx-bsync__label,
.hx-bsync__note {
  color: var(--color-text-muted);
}

.hx-bsync__note {
  margin: 0;
  font-size: 13px;
}

.hx-bsync__parts {
  display: flex;
  flex-direction: column;
  max-height: 180px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-bsync__parts:empty {
  display: none;
}

.hx-bsync__part {
  width: 100%;
  padding: 7px 12px;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.hx-bsync__part:hover,
.hx-bsync__part:focus-visible {
  background: var(--color-surface-raised);
}

.hx-bsync__part.is-selected {
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.hx-bsync__table-wrap {
  max-height: 360px;
  border: 1px solid var(--color-border);
}

.hx-bsync__table td {
  vertical-align: top;
}

.hx-bsync__table td.hx-bsync__pin-cell {
  white-space: normal;
  min-width: 140px;
}

/* The action ("Already in Hyperion at Altamus Staging") wraps rather than pushing the table wider than a phone. */
.hx-bsync__table td:last-child {
  white-space: normal;
  min-width: 110px;
}

.hx-bsync__tick {
  width: 32px;
}

.hx-bsync__table tr.is-quiet td {
  color: var(--color-text-muted);
}

.hx-bsync__pin {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-weight: 600;
}

.hx-bsync__was {
  color: var(--color-text-muted);
  font-family: var(--font-mono, ui-monospace, monospace);
}

.hx-bsync__missing {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-left: 3px solid var(--status-warning);
  color: var(--color-text);
  font-weight: 600;
}

.hx-bsync__notes {
  display: block;
  color: var(--color-text-muted);
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ============================================================ the events of the Service page, ticked for one resolution
   (pages/service.js, select mode) and the category of a resolution (components/service-forms.js) */

/* "Plan resolution…": at the end of the toolbar, before "New event". */
.hx-sv__toolbar > .hx-sv__plan {
  flex: none;
  margin-left: auto;
}

.hx-sv__toolbar > .hx-sv__plan:not([hidden]) + .hx-sv__new {
  margin-left: 0;
}

/* With it the toolbar holds one more button: the fields start narrower, so it stays one line on a desktop. */
.hx-sv__toolbar:has(> .hx-sv__plan:not([hidden])) > .hx-ul__field--find {
  flex-basis: 180px;
}

.hx-sv__toolbar > .hx-sv__plan.is-pressed {
  color: var(--color-accent-text);
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  border-color: var(--color-accent);
}

/* "Filters" of the toolbar (pages/service.js): on a phone only, where the order, the level and which events show are
   behind it; folded at first. On the events view "New event" is left out there, so "Filters" and "Plan resolution…"
   are one row. */
.hx-sv-filters {
  display: none;
}

.hx-sv-filters__count {
  min-width: 20px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  color: var(--color-accent-text);
  text-align: center;
  background: color-mix(in srgb, var(--color-accent) 16%, transparent);
  border-radius: 999px;
}

.hx-sv-filters__count[hidden] {
  display: none;
}

@media (max-width: 719.98px) {
  .hx-sv__toolbar > .hx-sv-filters {
    display: inline-flex;
    flex: 1 1 auto;
  }

  /* Not on the resolutions (Active and Log), which have no order or filters (Kyle, 2026-11-13). */
  .hx-sv__toolbar > .hx-sv-filters[hidden] {
    display: none;
  }

  .hx-sv__toolbar > .hx-sv-filters[aria-expanded='true'] {
    color: var(--color-accent-text);
    border-color: var(--color-accent);
  }

  .hx-sv__toolbar.is-filtered > .hx-sv__field--sort,
  .hx-sv__toolbar.is-filtered > .hx-sv__field--level,
  .hx-sv__toolbar.is-filtered > .hx-sv__scope,
  .hx-sv__toolbar > .hx-sv__new--event {
    display: none;
  }

  .hx-sv__toolbar > .hx-sv__plan {
    margin-left: 0;
  }

  /* The Board on a phone (Kyle, 2026-11-03): "Filters" across the toolbar, then "New Resolution" and "Send proposals…"
     side by side, half each (the toolbar's gap is 12 px between them). */
  .hx-sv__toolbar:has(> .hx-sv__propose-many) > .hx-sv-filters {
    flex: 1 1 100%;
  }

  .hx-sv__toolbar > .hx-sv__new-visit,
  .hx-sv__toolbar > .hx-sv__propose-many {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    margin-left: 0;
  }
}

/* ---- The events of the Service page as cards (pages/service.js `eventCard`): the rows of "Needs attention" of the Health
   page, with the pills of the level and of the resolution in the title, the details under the line of the time. In
   select mode a card is the label of its tick: `.hx-sy-row` / `.hx-sy-pick` of the Health page, above. */
.hx-sv-cards {
  box-shadow: none;
}

.hx-sv-cards .nx-queue__title > .tag {
  font-size: 11.5px;
}

.hx-sv-cards__details {
  color: var(--color-text);
}

/* A row that wraps (not the column of a table row): the 240px of the details below is a width, never a height. */
.hx-sv-cards__details .hx-sv__details {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
}

.hx-sv-cards__details .hx-sv__clamp {
  flex: 1 1 240px;
}

/* ---- "Board" of the Service page (components/service-board.js): the work as columns by stage, side by side, each
   as tall as its cards (the page scrolls), their heads a row of their own pinned under the tabs while the page scrolls
   past them (`--hx-sb-stuck`, measured by the board), the strip scrolling sideways when the columns do not fit and the
   heads following it. Recognized has a card per event (a compact `eventCard`), the other columns a card per
   resolution (a compact `visitCard`, `.hx-sb-card--visit`, its events a short list: `.hx-sb-card__events`). Either
   has the stripe and the icon of the level (`--nx-item-color`; of a resolution the worst of its events), "Move" at
   its top right for a writer. A writer drags a card with a mouse or a pen: the card dimmed in its place
   (`is-dragging`), its ghost (`.hx-sb-ghost`) under the pointer, the columns `is-target` / `is-over` / `is-blocked`,
   and a resolution card a Recognized event would be attached to `is-over-card` (a ring, a slight scale, a wobble).
   Below 720px (as "Filters" of the toolbar) one column shows, with its head, chosen in the head of the board. Tokens
   only: dark mode follows them. Prefix `hx-sb-`. */
.hx-sb-board {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hx-sb-board[hidden] {
  display: none;
}

/* The board view is as wide as the main area (the gutters of the tabs), not the 1280px of the other views: every
   column in view on a wide screen. Under the board the page keeps a little of its padding, not the 72px of the other
   views: the columns reach down to the footer once the page is scrolled to them. */
.hx-sv__content:has(> .hx-sv__panel > .hx-sb-board:not([hidden])) {
  max-width: none;
  padding-bottom: 16px;
}

/* The picker and the hint of a narrow screen: not shown where every column is. */
.hx-sb-board__head {
  display: none;
}

.hx-sb-board__hint {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* The heads: pinned under what sticks above the board, over the columns; the track slides with the strip (the board
   sets `--hx-sb-slide`), the row clipping it. Opaque: the cards pass under it. */
.hx-sb-board__heads {
  position: sticky;
  top: var(--hx-sb-stuck, 0px);
  z-index: 1;
  overflow: hidden;
  background: var(--color-bg);
}

.hx-sb-board__track {
  display: flex;
  gap: 10px;
  transform: translateX(var(--hx-sb-slide, 0px));
  will-change: transform;
}

.hx-sb-board__cols {
  display: flex;
  gap: 10px;
  align-items: stretch;
  padding-bottom: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}

/* The columns (and their heads, the same widths) share the width, 240px each at least (the five fit a 1366px screen
   with its scrollbar) and 360px at most: the strip scrolls sideways when they do not fit. A column is as tall as the
   tallest, its cards from the top. */
.hx-sb-col,
.hx-sb-col__head {
  flex: 1 1 240px;
  min-width: 240px;
  max-width: 360px;
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
}

/* The Service and the Health board (Kyle, 2026-11-11): their columns grow with the screen, no cap (a compact one keeps
   its own widths), and the board is in the middle while its columns do not fill the width (several compact): `safe`,
   so a strip that scrolls sideways still starts at its first column. The heads' track does the same, so heads stay
   over columns. */
.hx-sb-board .hx-sb-col:not(.is-compact),
.hx-sb-board .hx-sb-col__head:not(.is-compact) {
  max-width: none;
}

.hx-sb-board .hx-sb-board__cols,
.hx-sb-board .hx-sb-board__track {
  justify-content: safe center;
}

.hx-sb-col {
  display: flex;
  flex-direction: column;
  border-top: 0;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  scroll-snap-align: start;
}

.hx-sb-col__head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px 14px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.hx-sb-col__label {
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A name with a shorter form: the short one on a narrow screen, the whole one elsewhere (Kyle, 2026-11-10). */
.hx-sb-col__label-short {
  display: none;
}

@media (max-width: 719.98px) {
  .hx-sb-col__label-full {
    display: none;
  }

  .hx-sb-col__label-short {
    display: inline;
  }
}

.hx-sb-col__count {
  flex: none;
  min-width: 22px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  color: var(--color-on-accent-tint);
  text-align: center;
  background: var(--color-accent-tint);
  border-radius: 999px;
}

.hx-sb-col__body {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}


.hx-sb-col__empty {
  margin: 0;
  padding: 16px 8px;
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
}

.hx-sb-col__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 4px 8px 8px;
  border-top: 1px solid var(--color-border);
}

.hx-sb-card {
  position: relative;
  flex: none;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

/* The stripe of the level, as `.nx-queue__item`. */
.hx-sb-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  content: '';
  background: var(--nx-item-color, var(--status-unknown));
}

.hx-sb-card__open {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  /* Room at the right for "Move". */
  padding: 10px 36px 10px 14px;
  font: inherit;
  text-align: left;
  color: var(--color-text);
  background: none;
  border: 0;
  cursor: pointer;
}

.hx-sb-card__open:hover {
  background: var(--color-row-hover);
}

.hx-sb-card__open:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-sb-card__icon {
  display: grid;
  width: 28px;
  height: 28px;
  font-size: 15px;
  color: var(--nx-item-color, var(--status-unknown));
  background: color-mix(in srgb, var(--nx-item-color, var(--status-unknown)) 14%, transparent);
  border-radius: 8px;
  place-items: center;
}

.hx-sb-card__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-sb-card__title {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-sb-card__name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hx-sb-card__title > .tag,
.hx-sb-card__stage .tag {
  padding: 2px 8px;
  font-size: 11px;
}

.hx-sb-card__title > .tag .bi,
.hx-sb-card__stage .tag .bi {
  font-size: 12px;
}

.hx-sb-card__stage {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  font-weight: 600;
  color: var(--color-text);
}

/* The chip of the category of a resolution card (`resolutionChip` of site-events.js): "Proposed: site visit",
   "Proposed: ship parts", "Proposed: remote", "Accepted: site visit", "Accepted: ship parts", "Accepted: remote"
   (Pending), "Parts shipped" (Client responsibility), "Remote" (Altamus responsibility). */
.hx-sb-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text);
  white-space: normal;
  overflow-wrap: anywhere;
  background: color-mix(in srgb, var(--status-info) 16%, transparent);
  border-radius: var(--radius-pill);
}

/* "Not notified": a resolution card the client was never told of (components/service-board.js): in Client and Altamus
   responsibility, and a Pending (category 1) one in Pending ("Awaiting notification"). */
.hx-sb-chip.hx-sv-notify__chip {
  background: color-mix(in srgb, var(--status-warning) 20%, transparent);
}

/* "Accepted: …": a proposal the client accepted, waiting in Pending to be moved on (Kyle, 2026-10-29); tinted as its
   state tag ("Proposal accepted", `tag--ok`). */
.hx-sb-chip.hx-sb-chip--accepted {
  background: color-mix(in srgb, var(--status-ok) 18%, transparent);
}

/* The pills of a Pending card (`pendingPills` of components/service-board.js; Kyle, 2026-10-29): a row after the button
   that opens the card, under its text (the icon's 28px and the gap of `.hx-sb-card__open`), clear of "Move". */
.hx-sb-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 0 14px 10px 52px;
  margin-top: -4px;
}

/* A pill is a button the size of `.hx-sb-chip`: who was told ("Notified" / "Not notified") and the proposal ("Not
   proposed" / "Proposed: …" / "Accepted: …"), each tinted by its state. */
.hx-sb-pill {
  display: inline-flex;
  align-items: center;
  /* A pill wider than the card breaks inside it, never past the card (Kyle 2026-11-01: the pills wrap). */
  max-width: 100%;
  padding: 1px 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text);
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  background: color-mix(in srgb, var(--status-info) 16%, transparent);
  border: 0;
  border-radius: var(--radius-pill);
}

.hx-sb-pill--told,
.hx-sb-pill--accepted {
  background: color-mix(in srgb, var(--status-ok) 18%, transparent);
}

.hx-sb-pill--untold {
  background: color-mix(in srgb, var(--status-warning) 20%, transparent);
}

.hx-sb-pill--declined {
  background: color-mix(in srgb, var(--status-error) 18%, transparent);
}

.hx-sb-pill--unproposed {
  background: color-mix(in srgb, var(--color-text-muted) 14%, transparent);
}

.hx-sb-pill--proposed {
  background: color-mix(in srgb, var(--status-info) 16%, transparent);
}

/* The proposal pill of a card outside Pending (`proposalPill`; Kyle, 2026-10-30): "Proposal", opens the billing
   proposal; tinted as the chip of the proposal beside it. A button for readers too. */
.hx-sb-pill--proposal {
  color: var(--color-accent-text);
  font-variant-numeric: tabular-nums;
  background: var(--color-accent-tint);
}

/* The parked pill (`parkedOf`, Kyle 2026-11-10): "N unacknowledged", quiet, a link to the Health board of the site; in
   the colour of an error when errors are among them (Parked Critical). */
.hx-sb-pill--parked {
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  background: color-mix(in srgb, var(--status-warning) 12%, transparent);
}

.hx-sb-pill--parked.hx-sb-pill--critical {
  color: var(--status-error);
  background: color-mix(in srgb, var(--status-error) 14%, transparent);
}

/* A reader's pill (`readerPills`: an administrator, a super-user in read-only mode) is a tag, not a button. */
.hx-sb-pill--static {
  cursor: default;
}

.hx-sb-pill:hover:not(:disabled):not(.hx-sb-pill--static) {
  box-shadow: 0 0 0 2px var(--color-border);
}

.hx-sb-pill:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

.hx-sb-pill:disabled {
  cursor: default;
}

/* "Mark resolved" (`askResolved` of components/service-forms.js): the fields are the forms' (`hx-sv-form*`); the answer
   to "How was it resolved?" starts a few lines tall. */
.hx-sv-resolved .hx-sv-form__details textarea.field__input {
  min-height: 120px;
}

/* "Notify client" (components/service-notify.js): the fields are the forms' (`hx-sv-form*`); the message is the
   body of a mail, so it starts taller, and the line of the event that goes with it wraps anywhere. */
.hx-sv-notify .hx-sv-notify__message textarea.field__input {
  min-height: 180px;
}

.hx-sv-notify__with {
  overflow-wrap: anywhere;
}

.hx-sv-notify__with-label {
  font-weight: 600;
  color: var(--color-text);
}

/* "Send proposal" (components/service-proposal.js): the fields are the forms' and the message is Notify client's
   (`hx-sv-form*`, `hx-sv-notify*`). What is mailed is one block, hidden at once when the proposal was made outside
   Hyperion (`.hx-sv-form [hidden]` hides it, and "Reset text" till the message was typed in); its fields keep the gap
   of the form's. The note for the record (`.hx-sv-notify__note`, Notify client's too) stays. Notify client has the
   same block and tick since 2026-10-29 (Kyle: "The client was notified outside Hyperion"). */
.hx-sv-proposal__mail,
.hx-sv-notify__mail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hx-sv-proposal__external,
.hx-sv-notify__external {
  margin: 2px 0;
}

.hx-sv-proposal__reset {
  margin-top: 4px;
}

/* "Billing proposal (optional)" (step 5b): the figures of its options line up; what could not be loaded is said under
   it, close to it. */
.hx-sv-proposal__invoice select {
  font-variant-numeric: tabular-nums;
}

/* "Create Proposal" beside the select. */
.hx-sv-proposal__invoice-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.hx-sv-proposal__invoice-row .hx-sv-proposal__invoice {
  flex: 1;
  min-width: 0;
}

.hx-sv-proposal__invoice-row .btn {
  flex: none;
}

.hx-sv-proposal__invoice-state:empty {
  display: none;
}

/* "Send proposals" (components/service-proposals.js; Kyle, 2026-11-03): To, CC and Subject at the top, then a tab per
   proposal (the kit's `.tabs__tab` look: muted, the one shown underlined in the accent), each with × to take it out, and
   "Add proposal" last. The tabs wrap onto more rows when they do not fit (Add proposal stays in sight); a label is cut with "…". A tab with a
   problem has a red dot. The panel of a tab has the fields of the form, as "Send proposal". */
.hx-sv-proposals__tabs {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hx-sv-proposals__list {
  flex-wrap: wrap;
  gap: 2px;
}

.hx-sv-proposals__tab {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: stretch;
  max-width: 280px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.hx-sv-proposals__tab.is-selected {
  border-bottom-color: var(--color-accent);
}

.hx-sv-proposals__list .tabs__tab {
  flex: none;
  flex-direction: row;
  gap: 6px;
  min-height: 40px;
  padding: 6px 10px;
  white-space: nowrap;
}

.hx-sv-proposals__tab .tabs__tab {
  flex: 0 1 auto;
  min-width: 0;
  padding-right: 4px;
  border-bottom: 0;
  margin-bottom: 0;
}

.hx-sv-proposals__tab .tabs__tab.is-selected {
  font-weight: 600;
  color: var(--color-heading);
}

.hx-sv-proposals__tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.hx-sv-proposals__dot {
  display: none;
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--status-error);
  border-radius: 50%;
}

.hx-sv-proposals__tab.is-invalid .hx-sv-proposals__dot {
  display: inline-block;
}

.hx-sv-proposals__remove {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  padding: 0;
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.hx-sv-proposals__remove:hover:not(:disabled) {
  color: var(--color-heading);
  background: var(--color-accent-hover);
}

.hx-sv-proposals__remove:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-sv-proposals__add {
  color: var(--color-accent-text);
}

/* "Add proposal": a tick per resolution, by site; "Add" under them. One of another client greyed out. */
.hx-sv-proposals__checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.hx-sv-proposals__check-group {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-field);
  overflow: hidden;
}

.hx-sv-proposals__check-site {
  padding: 8px 12px;
  background: var(--color-surface-sunken);
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--color-heading);
}

.hx-sv-proposals__check {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
}

.hx-sv-proposals__check:last-child {
  border-bottom: 0;
}

.hx-sv-proposals__check.is-disabled {
  opacity: 0.45;
}

.hx-sv-proposals__pick-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 6px;
}

.hx-sv-proposals__pick-bar[hidden],
.hx-sv-proposals__checks[hidden],
.hx-sv-proposals__pick-clear[hidden] {
  display: none;
}

.hx-sv-proposals__panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hx-sv-proposals__panel[hidden] {
  display: none;
}

.hx-sv-proposals__about {
  margin: 0;
  overflow-wrap: anywhere;
}

.hx-sv-proposals__to-note:empty {
  display: none;
}

/* next/proposal.php: Accept and Decline, each its own form. */
.login__card .form-stack + .form-stack {
  margin-top: 20px;
}

/* "Withdraw proposal" and the client's answer: a note, a few lines tall. */
.hx-sv-proposal-ask .hx-sv-form__details textarea.field__input {
  min-height: 96px;
}

/* The note for the record of Notify client and Send proposal (not mailed): a few lines tall. */
.hx-sv-notify__note textarea.field__input {
  min-height: 64px;
}

/* What became of a proposal (`askProposalOutcome`; Kyle, 2026-10-29): the chooser, three buttons side by side (one
   under the other when they do not fit; two of a proposal the client accepted in Hyperion, step 6: "Set the kind",
   "Withdraw"), then the step chosen ("What did the client accept?" is the accepted step's fields); the buttons of the footer that are not of the step
   are hidden (the footer is outside `.hx-sv-form`, whose `[hidden]` rule does not reach it). */
.hx-sv-proposal-outcome__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hx-sv-proposal-outcome__choice {
  flex: 1 1 140px;
  justify-content: center;
}

/* "Reassociate proposal" is longer than the others: a line of its own. */
.hx-sv-proposal-outcome__choice--line {
  flex-basis: 100%;
}

.hx-sv-proposal-outcome__step {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hx-sv-proposal-outcome-dialog .dialog__footer [hidden] {
  display: none !important;
}

/* The names of its scanners and spaces: one line, the rest in the title. */
.hx-sb-card__names {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hx-sb-card__details {
  color: var(--color-text);
}

/* The issue of a Recognized card, under its site. */
.hx-sb-card__issue {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
  color: var(--color-text);
}

/* The details of a Recognized card: whole, as they were typed (`cardDetails`). */
.hx-sb-card__details--whole {
  overflow-wrap: anywhere;
  white-space: pre-line;
}

/* How a Resolved resolution was resolved (its completion notes): two lines (`hx-sv__clamp`), in the colour of text,
   set off from the stage line above by a rule at its start. */
.hx-sb-card__notes {
  padding-left: 8px;
  color: var(--color-text);
  border-left: 2px solid var(--color-border);
}

/* The events of a resolution card: a line each, the icon of its level (`--hx-sb-event-color`) then "#key Title" cut
   with an ellipsis (the whole of it in the title); "+N more" muted after the first four. */
.hx-sb-card__events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin-top: 2px;
  font-size: 12.5px;
}

.hx-sb-card__event {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  color: var(--color-text);
}

.hx-sb-card__event > .bi {
  flex: none;
  font-size: 12px;
  color: var(--hx-sb-event-color, var(--status-unknown));
}

.hx-sb-card__event-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hx-sb-card__more {
  padding-left: 18px;
  color: var(--color-text-muted);
}

/* "+N more" of a resolution card's events: it shows the rest (Kyle 2026-11-01). */
.hx-sb-card__more-button {
  align-self: flex-start;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-right: 4px;
  font: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.hx-sb-card__more-button:hover {
  color: var(--color-text);
  text-decoration: underline;
}

.hx-sb-card__more-button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-sb-card__menu {
  position: absolute;
  top: 6px;
  right: 4px;
  width: 30px;
  height: 30px;
  font-size: 16px;
}

.hx-sb-card__menu.is-open {
  background: var(--color-accent-hover);
}

/* The chevron of the details of a resolution card (service-board.js `detailsToggle`, Kyle 2026-11-01): beside "Move", or
   in its place for a reader; the details fold open under the card's button, above its events. */
.hx-sb-card__details-toggle {
  position: absolute;
  top: 6px;
  right: 4px;
  width: 30px;
  height: 30px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.hx-sb-card.has-menu > .hx-sb-card__details-toggle {
  right: 36px;
}

.hx-sb-card__details-toggle > .bi {
  transition: transform 0.15s ease;
}

.hx-sb-card__details-toggle.is-open > .bi {
  transform: rotate(180deg);
}

.hx-sb-card.has-details-toggle.has-menu > .hx-sb-card__open {
  padding-right: 68px;
}

.hx-sb-card__resolution-details {
  margin: -4px 14px 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* An event of a Board card (components/event-fold.js `openLine`, Kyle 2026-11-01): its line opens the event, and only the
   chevron at its right folds open its details and symptoms. */
.hx-sv-cards__event-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.hx-sv-cards__event-open {
  flex: 1 1 auto;
  min-width: 0;
  padding: 2px 4px 2px 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.hx-sv-cards__event-open:hover .hx-ev-about__name {
  text-decoration: underline;
}

.hx-sv-cards__event-open:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-sv-cards__event-toggle {
  flex: none;
  width: 26px;
  height: 26px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-sv-cards__event-toggle > .bi {
  transition: transform 0.15s ease;
}

.hx-sv-cards__event-toggle.is-open > .bi {
  transform: rotate(180deg);
}

.hx-sv-cards__event-fold--split > .hx-sv-cards__symptoms {
  margin: 2px 0 4px;
}

.hx-sv-cards__event-fold--split > .hx-sv-cards__symptoms[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .hx-sv-cards__event-toggle > .bi {
    transition: none;
  }
}

.hx-sb-card__resolution-details--none,
.hx-sv-cards__event-details--none {
  font-style: italic;
  color: var(--color-text-muted);
}

/* An event's details, whole, when its fold is open (components/event-fold.js), above its scanners and spaces. */
.hx-sv-cards__event-details {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  .hx-sb-card__details-toggle > .bi {
    transition: none;
  }
}

/* A writer drags the card (not one in Resolved): the hand, before the spinner's cursor of a busy one. */
/* A card without the icon (`is-plain`, Kyle 2026-10-31: the look of "Needs attention" of the Sites page): its text, its
   pills and the folds of its events (components/event-fold.js) start at the button's left padding. */
.hx-sb-card.is-plain .hx-sb-card__open {
  grid-template-columns: minmax(0, 1fr);
}

.hx-sb-card.is-plain .hx-sb-card__pills {
  padding-left: 14px;
}

.hx-sb-card > .hx-sv-cards__events {
  margin-top: -6px;
  padding: 0 36px 10px 14px;
}

.hx-sb-card > .hx-sv-cards__events .hx-ev-about__subject {
  font-size: 12.5px;
}

/* The line of an event of a card keeps its level icon beside its name when the name is long ("Scanner Installation ·
   P1 Hall South"): the name wraps under itself. */
.hx-sb-card > .hx-sv-cards__events .hx-ev-about__subject:not(.hx-sv-cards__symptoms .hx-ev-about__subject) {
  flex-wrap: nowrap;
  align-items: baseline;
}

.hx-sb-card > .hx-sv-cards__events .hx-ev-about__subject > .hx-ev-about__name {
  min-width: 0;
}

.hx-sb-card > .hx-sv-cards__events .hx-sb-card__more {
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-sb-card.is-draggable .hx-sb-card__open {
  cursor: grab;
}

.hx-sb-card.is-busy .hx-sb-card__open {
  cursor: progress;
}

/* A drag (mouse or pen): the card stays in its place, dimmed and dashed; its ghost follows the pointer over the page,
   above the chrome (40 at most) and under the dialogs, menus and toasts (1000 and up). */
.hx-sb-card.is-dragging {
  opacity: 0.4;
  outline: 2px dashed var(--color-border);
  outline-offset: 2px;
}

/* Dropped, in its new column while the server has not answered: greyed (the spinner of `is-busy` turns meanwhile). */
.hx-sb-card.is-pending {
  opacity: 0.55;
}

.hx-sb-card.hx-sb-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 900;
  margin: 0;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
  will-change: transform;
}

html.hx-sb-dragging,
html.hx-sb-dragging * {
  cursor: grabbing !important;
  user-select: none;
}

/* Near an edge the board scrolls the strip a few px a frame: no snapping back to a column meanwhile. */
html.hx-sb-dragging .hx-sb-board__cols {
  scroll-snap-type: none;
}

/* The columns (and their heads) the card may go to, tinted; the one under the pointer more; the others faded. */
.hx-sb-col,
.hx-sb-col__head {
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    opacity 120ms ease;
}

.hx-sb-col.is-target,
.hx-sb-col__head.is-target {
  background: color-mix(in srgb, var(--color-accent-tint) 55%, var(--color-surface-sunken));
  border-color: var(--color-accent);
}

.hx-sb-col.is-target.is-over,
.hx-sb-col__head.is-target.is-over {
  background: var(--color-accent-tint);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.hx-sb-col.is-blocked,
.hx-sb-col__head.is-blocked {
  opacity: 0.45;
}

/* DRAG FOCUS (components/board-drag-focus.js): what a drag hides is out of the page, whatever it is drawn as (the foot
   is a flex row); the cards left are slid under the pinned heads by a transform of their body, at once; the hint of a
   column left empty is quiet. */
.hx-sb-col > [hidden],
.hx-sb-col__body > [hidden] {
  display: none !important;
}

.hx-sb-focus-hint {
  font-style: italic;
}

/* A Recognized event dragged over a resolution card it would be attached to (ONTO A CARD of
   components/service-board.js): the card wins over its column, so it rings in the accent, grows a little and
   wobbles; the ring only with reduced motion (below). Above its neighbours, so the ring is not covered by the next card. */
.hx-sb-card.is-over-card {
  z-index: 1;
  box-shadow: 0 0 0 2px var(--color-accent);
  animation: hx-sb-wobble 300ms ease-in-out infinite alternate;
}

@keyframes hx-sb-wobble {
  from {
    transform: scale(1.02) rotate(-1.5deg);
  }

  to {
    transform: scale(1.02) rotate(1.5deg);
  }
}

@media (max-width: 719.98px) {
  .hx-sb-board__head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
  }

  .hx-sb-board__cols {
    overflow-x: visible;
  }

  /* The strip does not scroll sideways here: the heads stay where the columns are. */
  .hx-sb-board__track {
    transform: none;
  }

  /* One column, the one the picker chose, and its head, the width of the page. */
  .hx-sb-col,
  .hx-sb-col__head {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
  }

  .hx-sb-col:not(.is-current),
  .hx-sb-col__head:not(.is-current) {
    display: none;
  }
}


@media (prefers-reduced-motion: reduce) {
  .hx-sb-board__cols {
    scroll-behavior: auto;
    scroll-snap-type: none;
  }

  .hx-sb-col,
  .hx-sb-col__head {
    transition: none;
  }

  /* The card an event would be attached to: the ring only, still. */
  .hx-sb-card.is-over-card {
    transform: none;
    animation: none;
  }
}

/* ---- "Board" of the Health page (components/health-board.js, `#health/board`): Monitoring, Symptoms, Parked Warning,
   Parked Critical, Recognized, Planned. The
   columns and cards are the Service board's (`.hx-sb-*`); what is its own is here, prefix `hx-hb-`: the "List | Board"
   switch, the quiet loading line, a symptom card that opens nothing, the line of a monitored notice, the cards RELATED
   to the one dragged (`is-related`: a tint and a dashed outline of info blue, and a "Related" tag; distinct from the
   accent ring of `is-over-card`), the Recognized cards that would not take it (`is-ineligible`: greyed, no target), and
   "Plan on the Service board". Tokens only: dark mode follows them. */
.hx-hb-view {
  margin-left: auto;
}

/* The sections of the list keep the gaps `.nx-content` gives its own children (they were its children). */
.hx-hb-list-view {
  display: flex;
  flex-direction: column;
  gap: inherit;
}

.hx-hb-list-view[hidden],
.hx-hb-view-board[hidden] {
  display: none;
}

/* The board uses the width of the main area, as the Service board does. */
.nx-content.hx-hb-on {
  max-width: none;
}

/* But its bar stays where the list has it (Kyle, 2026-11-10): as wide as the inside of `.nx-content` (next.css: 1280px
   less its side padding), in the middle, so nothing of it moves when the view is switched. */
.nx-content.hx-hb-on > .hx-ov-toolbar,
.nx-content.hx-hb-on > .hx-sv__tabs {
  width: 100%;
  max-width: calc(1280px - 2 * clamp(16px, 4vw, 40px));
  margin-right: auto;
  margin-left: auto;
}

/* The column a card is dragged out of is not a target, but it stays at full strength: its related cards are read there. */
.hx-hb-board .hx-sb-col.is-blocked:has(.is-dragging) {
  opacity: 1;
}

/* The Service board likewise (RELATED EVENTS of components/service-board.js, Kyle 2026-11-12): Recognized, out of which
   an event with related events is dragged, stays at full strength while they are marked there. */
.hx-sb-board--service .hx-sb-col.is-blocked:has(.is-related) {
  opacity: 1;
}

/* Six columns (Monitoring, Symptoms, Parked Warning, Parked Critical, Recognized, Planned), as wide as the screen
   allows (the rule over `.hx-sb-col` above); the strip scrolls sideways when they do not fit (240px each at least). */

.hx-hb-card__still {
  cursor: default;
}

.hx-sb-card.is-draggable .hx-hb-card__still {
  cursor: grab;
}

.hx-hb-card__still:hover {
  background: none;
}

/* The sliders of a symptom card (health-board.js `tune`): beside "Move" (left of it), muted until hover or focus; the
   card's button keeps clear of both. Not in a compact column (below). */
.hx-hb-card__tune {
  position: absolute;
  top: 6px;
  right: 4px;
  width: 30px;
  height: 30px;
  font-size: 15px;
  color: var(--color-text-muted);
}

.hx-hb-card__tune:hover,
.hx-hb-card__tune:focus-visible {
  color: var(--color-accent-text);
  background: var(--color-accent-tint);
}

.hx-sb-card.has-menu > .hx-hb-card__tune {
  right: 36px;
}

.hx-sb-card.has-menu.has-tune > .hx-sb-card__open {
  padding-right: 68px;
}

.hx-sb-col.is-compact .hx-hb-card__tune {
  display: none;
}

.hx-hb-card__watch {
  font-weight: 600;
  color: var(--color-text);
}

.hx-hb-card__gone {
  font-style: italic;
}

.hx-hb-card__coming {
  font-weight: 600;
  color: var(--color-accent);
}

.hx-sb-card.is-related {
  background: color-mix(in srgb, var(--status-info) 10%, var(--color-surface));
  outline: 2px dashed var(--status-info);
  outline-offset: 1px;
  transition:
    background-color 120ms ease,
    outline-color 120ms ease;
}

.hx-hb-related-tag {
  padding: 2px 8px;
  font-size: 11px;
  color: var(--status-info);
  background: color-mix(in srgb, var(--status-info) 14%, transparent);
}

.hx-sb-card.hx-hb-event.is-ineligible {
  opacity: 0.4;
  filter: grayscale(0.8);
  transition:
    opacity 120ms ease,
    filter 120ms ease;
}

.hx-hb-board__plan {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  border-radius: 6px;
}

.hx-hb-board__plan:hover {
  text-decoration: underline;
}

.hx-hb-board__plan:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-hb-related-list .hx-hb-related-fixed {
  cursor: default;
}

/* PARKED (components/health-board.js, ../js/parked-symptoms.js): the head of a group of the Parked column, the site and
   "Awaiting visit · Nov 16, 2026" / "Awaiting service · P0048" (a button: the resolution), "Add to this resolution…" of a
   writer at its right. */
.hx-hb-park {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  align-items: center;
  padding: 6px 4px 2px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-hb-park:not(:first-child) {
  margin-top: 8px;
  border-top: 1px dashed var(--color-border);
}

.hx-hb-park__site {
  font-weight: 600;
  color: var(--color-text);
}

.hx-hb-park__open {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
  padding: 2px 6px;
  font: inherit;
  font-weight: 600;
  text-align: left;
  color: var(--color-accent);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
}

.hx-hb-park__open:hover {
  text-decoration: underline;
}

.hx-hb-park__open:focus-visible,
.hx-hb-park__add:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-hb-park__add {
  font-weight: 500;
}

/* PLANNED (components/health-board.js): a group per open resolution, its head (as a head of Parked) over its event
   cards. While a symptom is dragged, the groups of its site are targets (a dashed accent outline; the one it is parked
   under tinted, `is-natural`; the one under the pointer filled, `is-over`), the others greyed; an eventless one says
   "Drop to add to this resolution" then. */
.hx-hb-plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 8px;
  transition:
    background-color 120ms ease,
    opacity 120ms ease;
}

.hx-hb-plan:not(:first-child) {
  padding-top: 2px;
  margin-top: 8px;
  border-top: 1px dashed var(--color-border);
}

.hx-hb-plan__cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hx-hb-plan__cards > [hidden] {
  display: none !important;
}

.hx-hb-plan__empty {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  font-style: italic;
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
  border-radius: 8px;
}

.hx-hb-plan__hint,
.hx-hb-plan.is-target .hx-hb-plan__idle {
  display: none;
}

.hx-hb-plan.is-target .hx-hb-plan__hint {
  display: inline;
}

.hx-hb-plan.is-target {
  outline: 2px dashed var(--color-accent);
  outline-offset: 2px;
}

.hx-hb-plan.is-natural {
  background: color-mix(in srgb, var(--color-accent-tint) 60%, transparent);
}

.hx-hb-plan.is-target.is-over {
  background: var(--color-accent-tint);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.hx-hb-plan.is-ineligible {
  opacity: 0.45;
}

/* BY SITE (components/health-board.js, and components/service-board.js since 2026-11-11: ./board-site.js): the cards of
   a column grouped by site, under the name of the site (a link to its board); the heads of the parked and planned groups of a resolution under it. Nothing is cut: the words wrap. */
.hx-hb-site {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hx-hb-site:not(:first-child) {
  margin-top: 6px;
}

.hx-hb-site__head {
  padding: 2px 4px 0;
  overflow-wrap: anywhere;
}

/* ONE SITE (components/board-site.js, both boards): the tick at the right end of the head shows that site alone. */
.hx-hb-site__head.has-only {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.hx-hb-site__only {
  flex: none;
  margin-top: 1px;
  cursor: pointer;
}

.hx-hb-site__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-heading);
  text-decoration: none;
}

.hx-hb-site__name:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.hx-hb-site__name:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.hx-hb-site__cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hx-hb-site__cards > [hidden] {
  display: none !important;
}

.hx-hb-park__open > span,
.hx-hb-plan__empty {
  overflow-wrap: anywhere;
}

/* The site of the card dragged, on its ghost (the card itself does not say it). */
.hx-hb-ghost-site {
  font-weight: 600;
  color: var(--color-text);
}

/* COMPACT (components/health-board.js, components/service-board.js; the toggle of components/board-compact.js): the
   toggle in the head of a column, and a compact column half the min and max width of the others (its share of the room grows half as fast, so it stays
   half of a full one), its cards one or two lines: the stripe, the name and the pill, the subject; no icon, detail,
   "since", stage or fold; the heads of its groups one line. Not below 720px (one column at a time). */
.hx-sb-col__compact {
  flex: none;
  width: 26px;
  height: 26px;
  font-size: 14px;
}

.hx-sb-col__head:has(> .hx-sb-col__compact) .hx-sb-col__label {
  margin-right: auto;
}

@media (min-width: 720px) {
  .hx-sb-col.is-compact,
  .hx-sb-col__head.is-compact {
    flex: 0.5 1 120px;
    min-width: 120px;
    max-width: 180px;
  }

  .hx-hb-board .hx-sb-col.is-compact,
  .hx-hb-board .hx-sb-col__head.is-compact {
    max-width: 210px;
  }

  .hx-sb-col__head.is-compact {
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 4px 8px 10px;
  }

  /* "Parked" and the icon of its severity, as dark as the label, a little larger than its letters and on the middle
     of their line (Kyle, 2026-11-10); so are "Client" and "Altamus" and their checkbox on the Service board (Kyle,
     2026-11-11: in the place of "responsibility"). */
  .hx-sb-col__label:has(> .hx-hb-col__parked-icon) {
    display: inline-flex;
    gap: 6px;
    align-items: center;
  }

  .hx-hb-col__parked-icon {
    flex: none;
    font-size: 1.3em;
    line-height: 1;
    color: inherit;
  }

  .hx-hb-col__parked-icon::before {
    vertical-align: 0;
  }

  /* Its label wraps between words, never cut; the count and the toggle stay beside it while they fit, and go under it
     only when they do not (Kyle, 2026-11-10). */
  .hx-sb-col__head.is-compact .hx-sb-col__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .hx-sb-col.is-compact .hx-sb-col__body {
    gap: 6px;
    padding: 6px;
  }

  /* The pill runs under "Move": only the title keeps clear of it. */
  .hx-sb-col.is-compact .hx-sb-card__open {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 6px 6px 6px 10px;
  }

  .hx-sb-col.is-compact .hx-sb-card.is-draggable .hx-sb-card__name,
  .hx-sb-col.is-compact .hx-sb-card:has(> .hx-sb-card__menu) .hx-sb-card__name {
    padding-right: 20px;
  }

  .hx-sb-col.is-compact .hx-sb-card__icon,
  .hx-sb-col.is-compact .hx-sb-card__details,
  .hx-sb-col.is-compact .hx-sb-card__line,
  .hx-sb-col.is-compact .hx-sb-card__issue,
  .hx-sb-col.is-compact .hx-sb-card__stage,
  .hx-sb-col.is-compact .hx-sb-card__pills,
  .hx-sb-col.is-compact .hx-sb-card > .hx-sv-cards__events {
    display: none;
  }

  .hx-sb-col.is-compact .hx-sb-card__menu {
    top: 3px;
    right: 2px;
    width: 26px;
    height: 26px;
  }

  .hx-sb-col.is-compact .hx-sb-card__text {
    gap: 1px;
    font-size: 12px;
  }

  /* The title (the subject, at most two lines), the pill under it on a line of its own, its words wrapping. */
  .hx-sb-col.is-compact .hx-sb-card__title {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 3px;
    align-items: flex-start;
    font-size: 13px;
  }

  .hx-sb-col.is-compact .hx-sb-card__name {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .hx-sb-col.is-compact .hx-sb-card__title > .tag {
    max-width: 100%;
    padding: 1px 6px;
    font-size: 10px;
    letter-spacing: 0;
    white-space: normal;
    overflow-wrap: break-word;
  }

  /* The heads of the groups: never cut. The site, then the resolution, then "Add to this resolution…", each on its own
     line(s). */
  .hx-sb-col.is-compact .hx-hb-park {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  .hx-sb-col.is-compact .hx-hb-park__open {
    max-width: 100%;
    padding-right: 2px;
    padding-left: 2px;
  }
}

@media (max-width: 719.98px) {
  .hx-sb-col__compact {
    display: none;
  }
}

/* COMPACT of the Service board (components/service-board.js, `.hx-sb-board--service`; Kyle, 2026-11-10): the rules above,
   and its own cards. An event card: the event (the head of its site group names the site since 2026-11-11), the level
   pill under it; nothing else. A resolution card: the kind, the level pill, then its pills as ever, wrapping in the
   half width; no state pill, stage line, notes, events, details nor their chevron. */
@media (min-width: 720px) {
  .hx-sb-board--service .hx-sb-col.is-compact .hx-sb-card__issue {
    display: block;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hx-sb-board--service .hx-sb-col.is-compact .hx-sb-card__state,
  .hx-sb-board--service .hx-sb-col.is-compact .hx-sv-tasks,
  .hx-sb-board--service .hx-sb-col.is-compact .hx-sb-card__notes,
  .hx-sb-board--service .hx-sb-col.is-compact .hx-sb-card__events,
  .hx-sb-board--service .hx-sb-col.is-compact .hx-sb-card__resolution-details,
  .hx-sb-board--service .hx-sb-col.is-compact .hx-sb-card__details-toggle {
    display: none;
  }

  /* No chevron of the details: only "Move" to keep clear of. */
  .hx-sb-board--service .hx-sb-col.is-compact .hx-sb-card.has-details-toggle > .hx-sb-card__open {
    padding-right: 6px;
  }

  .hx-sb-board--service .hx-sb-col.is-compact .hx-sb-card__pills {
    display: flex;
    gap: 3px 4px;
    margin-top: -2px;
    padding: 0 6px 6px 10px;
  }

  .hx-sb-board--service .hx-sb-col.is-compact .hx-sb-pill {
    padding: 1px 6px;
    font-size: 10px;
  }
}

/* The list: a parked notice on a row of its own says what it waits for; the fold of a resolution's row holds its rows.
   The errors among them are said apart, in the colour of an error ("2 critical"). */
.hx-hl-parked-critical {
  font-weight: 700;
  color: var(--status-error);
}

.hx-hl-parked-line {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-style: italic;
}

/* The resolution a parked notice waits for: a link to its detail. */
.hx-hl-parked-link {
  padding: 0;
  font: inherit;
  color: var(--color-accent-text);
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
}

.hx-hl-parked-link:hover,
.hx-hl-parked-link:focus-visible {
  text-decoration: underline;
}

.hx-hl-park-rows {
  margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .hx-sb-card.is-related,
  .hx-sb-card.hx-hb-event.is-ineligible,
  .hx-hb-plan {
    transition: none;
  }
}

/* Under the ticks, in view at the bottom while the page scrolls (as `.hx-sy-bar` of the Health page). */
.hx-sv-bar {
  position: sticky;
  bottom: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 18px;
  margin-top: 12px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-raised);
}

.hx-sv-bar[hidden] {
  display: none;
}

.hx-sv-bar__count {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-heading);
}

/* Ticks of several sites: one resolution is of one site. */
.hx-sv-bar.is-mixed .hx-sv-bar__count {
  color: var(--status-warning);
}

.hx-sv-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@media (max-width: 599.98px) {
  /* Beside "Filters", on one row. */
  .hx-sv__toolbar > .hx-sv__plan {
    flex: 1 1 auto;
    margin-left: 0;
  }

  .hx-sv-bar {
    bottom: 8px;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
  }

  .hx-sv-bar__actions > .btn {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 44px;
  }
}

/* The line under the category of a resolution of the client. */
.hx-sv-form__category-note {
  margin-top: 6px;
}

/* The line under "Assigned to" when a user of the client was let go of (the category is not one of the client's). */
.hx-sv-form__assignee-note {
  margin-top: 6px;
}

.hx-sv-form__assignee-note[hidden] {
  display: none;
}

/* ============================================================ end of the events ticked for one resolution */

/* ============================================================ Account: profile, password, summary report
   (components/account-profile.js, components/summary-report.js). The forms use the classes of the user management form (hx-um-form__*). */

/* The picture: its buttons under the identity, and what was said about the file. */
.hx-prof-picture {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding: 12px 0 4px;
}

.hx-prof-picture__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hx-prof-picture [hidden] {
  display: none;
}

.hx-prof-picture__note:empty {
  display: none;
}

.hx-prof-picture__alert {
  margin: 0;
}

.hx-prof-body {
  padding-top: 16px;
}

.hx-prof-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hx-prof-form .hx-um-form__alert {
  margin: 0;
}

.hx-prof-skeleton {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hx-prof-skeleton .hx-skeleton__line {
  height: 40px;
  border-radius: 8px;
}

/* The summary report dialog. */
.hx-sr-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hx-sr-group {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.hx-sr-group__legend {
  padding: 0;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-sr-days {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hx-sr-day {
  width: 40px;
  height: 40px;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--color-heading);
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-field-outline);
  border-radius: 50%;
}

.hx-sr-day:hover {
  background: var(--color-accent-hover);
}

.hx-sr-day:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-sr-day.is-on {
  color: #fff;
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.hx-sr-when {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 12px;
}

.hx-sr-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.hx-sr-site-tools {
  margin-bottom: 8px;
}

.hx-sr-sites {
  max-height: 200px;
  padding: 4px 10px;
  margin: 0;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-sr-sites-empty {
  padding: 8px 0;
  text-align: left;
}

.hx-sr-warn {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-weight: 600;
  color: var(--color-error-text);
}

.hx-sr-status {
  padding: 10px 14px;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-heading);
  background: var(--color-accent-selected);
  border-radius: 10px;
  overflow-wrap: anywhere;
}

.hx-sr-status[data-kind="error"] {
  color: var(--color-error-text);
  background: var(--color-error-tint);
}

.hx-sr-status[hidden] {
  display: none;
}

/* The preview: a document of its own, white as the email is. */
.hx-sr-frame {
  display: block;
  width: 100%;
  height: min(72vh, 680px);
  background: #fff;
  border: 0;
}

@media (max-width: 599.98px) {
  .hx-sr-when {
    grid-template-columns: minmax(0, 1fr);
  }

  .hx-sr-frame {
    height: calc(100dvh - 140px);
  }
}

/* ============================================================ end of Account: profile, password, summary report */

/* ============================================================ File management (components/file-management.js)
   The scanner upload files waiting on the server: a filter and a count over a table, a pager, and the dialog of a run of "Process all".
   Uses the dialog classes of the other configuration dialogs (hx-sc-*, hx-csp-confirm). */

.hx-fm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* The two tabs of the dialog (components/file-management.js): the upload folder and the stuck scans. In its tab the stuck
   scans are no section under the files any more: no rule above them, and the tab names them (their own heading hides). */
.hx-fm-files {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.hx-fm-tabs > .tabs__panel {
  padding-top: 16px;
}

.hx-fm-tabs .hx-ss {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.hx-fm-tabs .hx-ss-heading {
  display: none;
}

/* The dialog has one height for both tabs (its `height`); the tab shown fills it, and its list takes what is left, scrolling
   inside. Not on a phone, where the dialog is the whole screen and the page scrolls as before. */
@media (min-width: 600px) {
  .hx-fm-dialog > .hx-fm,
  .hx-fm-dialog .hx-fm-tabs,
  .hx-fm-dialog .hx-fm-tabs > .tabs__panel:not([hidden]),
  .hx-fm-dialog .hx-fm-files,
  .hx-fm-dialog .hx-fm-results,
  .hx-fm-dialog .hx-ss,
  .hx-fm-dialog .hx-ss-list {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
  }

  .hx-fm-dialog > .hx-fm {
    height: 100%;
  }

  .hx-fm-dialog .hx-fm-table-wrap {
    flex: 1;
    min-height: 120px;
    max-height: none;
  }
}

.hx-fm-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
}

.hx-fm-filter {
  flex: 1 1 240px;
  max-width: 360px;
}

.hx-fm-count {
  flex: 0 1 auto;
}

.hx-fm-notes:empty {
  display: none;
}

.hx-fm-table-wrap {
  max-height: min(56vh, 560px);
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-fm-table {
  margin: 0;
}

.hx-fm-table td.hx-fm-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.hx-fm-table .hx-fm-size {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hx-fm-table td.hx-fm-actions,
.hx-fm-table th.hx-fm-actions {
  text-align: right;
}

.hx-fm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.hx-fm-table td.hx-fm-actions {
  display: table-cell;
  white-space: nowrap;
}

.hx-fm-table td.hx-fm-actions .btn + .btn {
  margin-left: 8px;
}

.hx-fm-delete {
  color: var(--color-error-text);
}

.hx-fm-arriving {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--color-text-muted);
  cursor: help;
}

.hx-fm-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
}

.hx-fm-pager__text {
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-fm-progress {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.hx-fm-bar-progress {
  width: 100%;
  height: 8px;
  margin: 0 0 12px;
}

.hx-fm-failures {
  max-height: 200px;
  padding-left: 20px;
  margin: 0 0 8px;
  overflow: auto;
  overflow-wrap: anywhere;
  font-size: 13px;
}

/* On a phone a row is a card: the name over its size and time, and the two actions side by side below, each
   half of the width. Nothing scrolls sideways, and the list scrolls with the dialog instead of in a box of its own. */
@media (max-width: 600px) {
  .hx-fm-filter {
    flex-basis: 100%;
    max-width: none;
  }

  .hx-fm-table-wrap {
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .hx-fm-table,
  .hx-fm-table tbody {
    display: block;
    width: 100%;
  }

  .hx-fm-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .hx-fm-table tbody tr {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 10px;
    align-items: baseline;
    padding: 10px 12px;
    margin: 0 0 8px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
  }

  .hx-fm-dialog .hx-fm-table tbody td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .hx-fm-dialog .hx-fm-table thead + tbody tr:first-child td {
    border: 0;
  }

  .hx-fm-table td.hx-fm-name {
    grid-column: 1 / -1;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 600;
  }

  .hx-fm-table td.hx-fm-size,
  .hx-fm-table td.hx-fm-when {
    font-size: 13px;
    color: var(--color-text-muted);
    text-align: left;
    white-space: nowrap;
  }

  .hx-fm-dialog .hx-fm-table tbody td.hx-fm-actions {
    display: flex;
    grid-column: 1 / -1;
    gap: 8px;
    margin-top: 8px;
    text-align: left;
    white-space: normal;
  }

  .hx-fm-dialog .hx-fm-table tbody td.hx-fm-actions {
    justify-content: flex-start;
  }

  .hx-fm-dialog .hx-fm-table td.hx-fm-actions .btn {
    flex: 1 1 0;
    justify-content: center;
    min-height: 40px;
    margin: 0;
  }

  .hx-fm-pager {
    justify-content: center;
  }
}

/* ---- Stuck scans (components/stuck-scans.js): below the files, the scans whose file is in storage but that were never processed */

.hx-ss {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--color-border);
}

.hx-ss-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: flex-end;
  justify-content: space-between;
}

.hx-ss-title {
  flex: 1 1 280px;
  min-width: 0;
}

.hx-ss-heading {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 600;
}

.hx-ss-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.hx-ss-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.hx-ss-field__label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.hx-ss-field__control {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.hx-ss-since {
  min-height: 34px;
  font-size: 14px;
}

.hx-ss-count:empty {
  display: none;
}

.hx-ss-table-wrap {
  max-height: min(44vh, 440px);
}

/* Over the list: the counts, and what the list shows (Stuck only / All scans). */
.hx-ss-listbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
}

.hx-ss-listbar .hx-ss-count {
  margin: 0;
}

.hx-ss-table td.hx-ss-file {
  min-width: 160px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.hx-ss-table td.hx-ss-when,
.hx-ss-table td.hx-ss-state {
  white-space: nowrap;
}

.hx-ss-result {
  margin-left: 8px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  white-space: normal;
}

.hx-ss-result--sent {
  color: var(--status-ok);
}

.hx-ss-result--failed {
  color: var(--color-error-text);
}

.hx-ss-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@media (max-width: 600px) {
  .hx-ss-bar {
    width: 100%;
  }

  .hx-ss-table-wrap {
    max-height: none;
  }

  .hx-ss-field {
    flex: 1 1 auto;
  }

  .hx-ss-table td.hx-ss-scanner {
    grid-column: 1 / -1;
    font-weight: 600;
  }

  .hx-ss-table td.hx-ss-site,
  .hx-ss-table td.hx-ss-when {
    font-size: 13px;
    color: var(--color-text-muted);
  }

  .hx-ss-dialog .hx-ss-table td.hx-ss-file,
  .hx-fm-dialog .hx-ss-table td.hx-ss-file {
    grid-column: 1 / -1;
    font-size: 12px;
    font-weight: 400;
  }

  .hx-ss-table td.hx-ss-state {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .hx-ss-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ============================================================ end of File management */

/* ---- Contact Altamus (components/contact-dialog.js): the dialog, and the warning button of a stale pile ---- */
.hx-ct-alertbtn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  color: var(--color-error-text);
  cursor: pointer;
  background: var(--color-error-tint);
  border: 0;
  border-radius: 50%;
}

.hx-ct-alertbtn:hover {
  box-shadow: 0 0 0 2px var(--status-error);
}

.hx-ct-alertbtn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

@media (max-width: 599.98px) {
  /* A finger: the hit area grows, the look does not. */
  .hx-ct-alertbtn {
    position: relative;
  }

  .hx-ct-alertbtn::after {
    position: absolute;
    inset: -8px;
    content: "";
  }
}

.hx-ct {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hx-ct-contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hx-ct-contact__line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--color-text-muted);
}

.hx-ct-contact__link {
  font-weight: 600;
  color: var(--color-accent-text);
  overflow-wrap: anywhere;
}

.hx-ct-or {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
}

.hx-ct-site input {
  color: var(--color-text-muted);
  cursor: default;
}

.hx-ct-form textarea.field__input {
  min-height: 120px;
  line-height: 1.4;
  resize: vertical;
}

.hx-ct-alert[role="note"] {
  margin: 0;
}

.hx-ct-done {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 16px 0;
  text-align: center;
}

.hx-ct-done > .bi {
  font-size: 32px;
  color: var(--status-ok);
}

.hx-ct-done > p {
  margin: 0;
}

/* ---- Add / Edit material (components/material-config.js): the form of one material, and the materials of the other sites ---- */
.hx-mcf-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hx-mcf {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hx-mcf [hidden],
.hx-mcf-more[hidden] {
  display: none;
}

/* The site the material is of: said, not chosen. */
.hx-mcf-site {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-mcf-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.hx-mcf-color {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hx-mcf-form .hx-um-form__note {
  margin-top: -8px;
}

/* A number and its unit, side by side. */
.hx-mcf-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 8px;
  align-items: start;
}

/* A limit: the number, its unit, and the volume that is stored. */
.hx-mcf-limit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px minmax(110px, auto);
  gap: 8px;
  align-items: start;
}

.hx-mcf-equals {
  display: flex;
  align-items: center;
  min-height: 48px;
  margin: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.hx-mcf-capacity {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.hx-mcf-capacity .hx-um-form__note {
  margin-top: 0;
}

.hx-mcf-capacity__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 8px;
  align-items: center;
}

.hx-mcf-capacity__value {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: pre-wrap;
}

.hx-mcf-alert[role='note'] {
  margin: 0;
}

/* Delete sits apart from Cancel and Save. */
.hx-mcf-delete {
  margin-right: auto;
}

/* What the other sites of the client have. */
.hx-mcf-more {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.hx-mcf-more__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.hx-mcf-picks {
  display: flex;
  flex-direction: column;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-mcf-pick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 4px 12px;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
}

.hx-mcf-pick + .hx-mcf-pick {
  border-top: 1px solid var(--color-border);
}

.hx-mcf-pick:hover {
  background: var(--color-row-hover);
}

.hx-mcf-pick__name {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hx-mcf-pick__density,
.hx-mcf-pick__sites {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.hx-mcf-more__actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 600px) {
  /* The number over its unit and the stored volume: three in a row do not fit a phone. */
  .hx-mcf-limit {
    grid-template-columns: minmax(0, 1fr) 132px;
  }

  .hx-mcf-equals {
    grid-column: 1 / -1;
    min-height: 0;
    margin-top: -2px;
  }

  .hx-mcf-pair,
  .hx-mcf-capacity__row {
    grid-template-columns: minmax(0, 1fr) 132px;
  }

  .hx-mcf-picks {
    max-height: none;
  }

  .hx-mcf-pick {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .hx-mcf-pick__sites {
    grid-column: 2 / -1;
  }

  .hx-mcf-more__actions .btn {
    width: 100%;
  }
}

/* ---- "View as" (js/view-as.js) */

/* The bar under the header while the interface shows a lower user level than the user's own: on every page. */
.hx-view-as-bar {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  padding: 4px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
  background: color-mix(in srgb, var(--status-warning) 18%, var(--color-bg));
  border-bottom: 1px solid color-mix(in srgb, var(--status-warning) 45%, transparent);
}

.hx-view-as-bar > .bi {
  color: var(--status-warning);
}

/* The section of the Account page: what it does, then the choice. */
.hx-view-as {
  display: grid;
  gap: 12px;
  max-width: 560px;
}

.hx-view-as__lead {
  margin: 0;
  color: var(--color-text-muted);
}

/* ---------- System flows (components/system-flows.js): sequence diagrams (sequence-diagram.js) ---------- */

.hx-flows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.hx-flows__lead {
  margin: 0;
  color: var(--color-text-muted);
}

.hx-flows__canvas {
  overflow: auto;
  padding: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card, 8px);
  -webkit-overflow-scrolling: touch;
}

.hx-flows__error {
  margin: 0;
  color: var(--status-error);
}

.hx-seq {
  display: block;
  font-family: inherit;
  font-size: 13px;
}

.hx-seq__title {
  font-size: 15px;
  font-weight: 700;
  fill: var(--color-heading);
}

.hx-seq__life {
  stroke: var(--color-border-strong);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.hx-seq__actor rect {
  fill: var(--color-accent-tint);
  stroke: var(--color-accent);
  stroke-width: 1.2;
}

.hx-seq__actor-label {
  font-weight: 600;
  fill: var(--color-heading);
}

.hx-seq__arrow {
  fill: none;
  stroke: var(--color-text);
  stroke-width: 1.4;
}

.hx-seq__message--dashed .hx-seq__arrow {
  stroke-dasharray: 5 4;
}

.hx-seq__head {
  fill: var(--color-text);
}

.hx-seq__head-open {
  fill: none;
  stroke: var(--color-text);
  stroke-width: 1.4;
}

.hx-seq__message-text {
  fill: var(--color-text);
}

.hx-seq__number {
  fill: var(--color-accent);
}

.hx-seq__number-text {
  font-size: 10px;
  font-weight: 700;
  fill: #fff;
}

.hx-seq__note rect {
  fill: color-mix(in srgb, var(--status-warning) 18%, var(--color-surface));
  stroke: color-mix(in srgb, var(--status-warning) 70%, var(--color-border));
}

.hx-seq__note-text {
  fill: var(--color-text);
}

.hx-seq__frame-box {
  fill: color-mix(in srgb, var(--color-accent) 4%, transparent);
  stroke: var(--color-border-strong);
  stroke-width: 1;
}

.hx-seq__frame-tag {
  fill: var(--color-surface-raised);
  stroke: var(--color-border-strong);
}

.hx-seq__frame-kind {
  font-size: 11.5px;
  font-weight: 700;
  fill: var(--color-heading);
}

.hx-seq__frame-text {
  font-size: 12px;
  font-style: italic;
  fill: var(--color-text-muted);
}

.hx-seq__frame-split {
  stroke: var(--color-border-strong);
  stroke-dasharray: 5 4;
}

/* "Replace scanner" (components/scanner-replace.js): what Replace does, as a list. */
.hx-sr__title {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-sr__summary {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.hx-sr__summary li + li {
  margin-top: 3px;
}

.hx-sr__summary ul {
  margin: 2px 0 0;
  padding-left: 18px;
  list-style: circle;
}

.hx-sr__summary ul li + li {
  margin-top: 0;
}

/* "Move scanner into site" (components/scanner-move.js): the search, and the scanners it finds. */
.hx-smv__col,
.hx-smv__side {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

/* Two columns from a tablet on: the left one keeps one height (a list of one height, room for the chips), and the right
   one scrolls within it, so the dialog keeps its size whatever is chosen. */
@media (min-width: 768px) {
  .hx-smv--cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
  }

  .hx-smv--cols .hx-smv__list {
    height: min(320px, 40vh);
  }

  .hx-smv--cols .hx-smv__list:empty {
    display: block;
  }

  .hx-smv--cols .hx-smv__chosen,
  .hx-smv--cols .hx-smv__chosen:empty {
    display: block;
    height: 96px;
    margin-top: 10px;
    overflow-y: auto;
  }

  .hx-smv__col--side {
    position: relative;
  }

  .hx-smv__col--side > .hx-smv__side {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding-right: 4px;
  }
}

.hx-smv__events {
  display: grid;
  gap: 10px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.hx-smv__events[hidden],
.hx-smv__events [hidden] {
  display: none;
}

.hx-smv__legend {
  padding: 0;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-smv__modes {
  display: grid;
  gap: 6px;
}

.hx-smv__mode {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.hx-smv__mode input {
  margin-top: 3px;
  accent-color: var(--color-primary);
}

.hx-smv__mode-text {
  display: grid;
  gap: 1px;
}

.hx-smv__mode-label {
  font-size: 14px;
  color: var(--color-text);
}

/* The group of each scanner chosen: a band that names it and the event its photos go to, its event, its photos. */
.hx-smv__groups {
  display: grid;
  gap: 10px;
}

.hx-smv__group {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control, 6px);
}

.hx-smv__group-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 10px;
  background: var(--color-surface-sunken);
  border-bottom: 1px solid var(--color-border);
}

.hx-smv__group-name {
  font-weight: 600;
  color: var(--color-heading);
}

/* The event its photos go to, whole: a long label wraps rather than hiding the site the scanner comes from. */
.hx-smv__group-event {
  font-size: 12.5px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.hx-smv__group-body,
.hx-smv__group-create,
.hx-smv__group-photos {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.hx-smv__group-body {
  padding: 10px;
}

.hx-smv__group-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.hx-smv__group-count {
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-smv__group-none {
  margin: 0;
}

.hx-smv__group-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hx-smv__group-thumbs:empty {
  display: none;
}

.hx-smv__group-thumb {
  position: relative;
  width: 56px;
  height: 56px;
}

.hx-smv__group-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control, 6px);
}

.hx-smv__group-x {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  color: #fff;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.55);
  border: 0;
  border-radius: 50%;
}

.hx-smv__group-x:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.75);
}

.hx-smv__group-x:disabled {
  cursor: default;
  opacity: 0.5;
}

.hx-smv__create-row {
  display: grid;
  /* The Category in the middle a little wider: "Power Delivery" and "Communications" clear the arrow of the select. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 8px;
}

@media (max-width: 560px) {
  .hx-smv__create-row {
    grid-template-columns: 1fr;
  }
}

.hx-smv__state {
  margin: -4px 0 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-smv__list {
  max-height: min(320px, 45vh);
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control, 6px);
}

.hx-smv__list:empty {
  display: none;
}

.hx-smv__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 6px;
}

.hx-smv__item:hover,
.hx-smv__item.is-active {
  background: var(--color-accent-hover);
}

.hx-smv__item.is-chosen {
  background: var(--color-accent-tint);
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.hx-smv__name {
  font-weight: 600;
  color: var(--color-heading);
}

.hx-smv__detail {
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-smv__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hx-smv__tick {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 13px;
  color: #fff;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 4px;
}

.hx-smv__item.is-chosen .hx-smv__tick {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.hx-smv__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: -4px;
}

.hx-smv__bar .hx-smv__state {
  margin: 0;
}

/* Two routers assigned to one event (components/scanner-move.js): an event names one router. */
.hx-smv__clash {
  margin: 0;
  color: var(--status-error);
}

.hx-smv__chosen:empty {
  display: none;
}

.hx-smv__chosen-text {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--color-accent-text);
}

.hx-smv__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hx-smv__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 10px;
  font-size: 13px;
  color: var(--color-heading);
  background: var(--color-accent-tint);
  border-radius: 999px;
}

.hx-smv__chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 50%;
}

.hx-smv__chip-x:hover:not(:disabled) {
  color: var(--color-heading);
  background: var(--color-accent-hover);
}

/* The scanner health dialog (components/scanner-health.js): the range at its top, and zooming the chart. */
.hx-hl-detail__range-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  margin-bottom: 14px;
}

.hx-hl-detail__range-bar .field-group {
  margin: 0;
}

/* "Look back": wide enough for "60 days" and its arrow. */
.hx-hl-detail__range-bar select {
  min-width: 120px;
}

.hx-hl-detail__zoom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

/* The range of a chart of the scanner, power supply and router settings, as the scanner health dialog has it
   (components/look-back-range.js): back and forward with "Now", then "Look back" and "Date". */
.hx-lookback-row {
  align-items: flex-end;
  gap: 8px 12px;
}

.hx-lookback-row > .hx-hl-detail__range-bar {
  margin-bottom: 0;
}

/* Chart or table, and back, forward and "Now" on the same line (Kyle, 2026-11-07). */
.hx-lookback-tools {
  align-items: center;
}

.hx-lookback-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.hx-lookback-row > .hx-hl-detail__step {
  padding-bottom: 2px;
}

@media (max-width: 600px) {
  .hx-lookback-row > .hx-hl-detail__range-bar {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    width: 100%;
  }

  .hx-lookback-row > .hx-hl-detail__range-bar select {
    min-width: 0;
  }
}

/* "Update the reference orientation" under the chart of the orientation (scanner-health.js referenceRow). */
.hx-hl-detail__reference {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 8px;
}

.hx-hl-detail__reference[hidden] {
  display: none;
}

.hx-hl-detail__zoom .hx-hl-detail__note {
  margin: 0;
}

.hx-hl-detail__zoom-help {
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-hl-detail__zoom-reset {
  margin-left: auto;
}

.hx-hl-detail__chart canvas {
  cursor: grab;
}

.hx-hl-detail__chart canvas.is-panning {
  cursor: grabbing;
}

/* The scanner health dialog: the tabs of the scanners of its site with notices, arrows when they overflow. */
.hx-hl-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: -4px 0 20px;
  border-bottom: 1px solid var(--color-border);
  /* Pinned to the top of the dialog while it scrolls (the body's 4 px padding above it). */
  position: sticky;
  top: -4px;
  z-index: 3;
  background: var(--color-surface-raised);
}

/* In the sheet of a phone the body has 16 px above it: the bar covers it, so nothing shows above the tabs. */
.dialog__body > .hx-hl-tabs {
  top: -16px;
  padding-top: 12px;
  margin-top: -16px;
}

.hx-hl-tabs[hidden] {
  display: none;
}

.hx-hl-tabs__list {
  display: flex;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.hx-hl-tabs__list::-webkit-scrollbar {
  display: none;
}

.hx-hl-tabs__arrow {
  flex: 0 0 auto;
}

.hx-hl-tabs__tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin-bottom: -1px;
  font: inherit;
  font-size: 13.5px;
  color: var(--color-text-muted);
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
}

.hx-hl-tabs__tab:hover {
  color: var(--color-heading);
}

.hx-hl-tabs__tab.is-selected {
  font-weight: 600;
  color: var(--color-heading);
  border-bottom-color: var(--color-accent);
}

.hx-hl-tabs__dot {
  width: 8px;
  height: 8px;
  background: var(--status-ok);
  border-radius: 50%;
}

.hx-hl-tabs__tab.is-warning .hx-hl-tabs__dot {
  background: var(--status-warning);
}

.hx-hl-tabs__tab.is-error .hx-hl-tabs__dot {
  background: var(--status-error);
}

/* The power supply dialog of a site (components/power-supply-health.js): the look of the scanner dialog (.hx-hl-*),
   with a row for each scanner on the supply: its name, online or not, its voltage now, when it was seen, "Health". */
.hx-ps-scanners {
  padding: 0;
  margin: 0;
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-ps-scanner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 72px minmax(0, 150px) auto;
  column-gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  font-size: 14px;
}

.hx-ps-scanner + .hx-ps-scanner {
  border-top: 1px solid var(--color-border);
}

.hx-ps-scanner__name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hx-ps-scanner__volts {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.hx-ps-scanner__volts--low {
  font-weight: 600;
  color: var(--status-warning);
}

.hx-ps-scanner__seen {
  font-size: 13px;
  color: var(--color-text-muted);
}

@media (max-width: 600px) {
  .hx-ps-scanner {
    grid-template-columns: minmax(0, 1fr) auto auto;
    row-gap: 2px;
  }

  .hx-ps-scanner__seen {
    grid-column: 1 / 3;
  }
}

/* The name of a power supply that opens its dialog: "On supply · {supply}" of a scanner (its Battery cell on the Health
   page, its facts in the scanner dialog). */
.hx-ps-supplylink {
  padding: 0;
  font: inherit;
  color: var(--color-accent-text);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  cursor: pointer;
}

.hx-ps-supplylink:hover {
  color: var(--color-heading);
}

.hx-ps-supplylink:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 3px;
}

/* The scanner health dialog: back and forward by the days looked back over, beside "Telemetry". */
.hx-hl-detail__step {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* The scanner health dialog while another range or scanner loads: what was shown, faded. */
.hx-hl-detail.is-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s;
}

/* In the head of the telemetry, between back and forward and the metrics. */
.hx-hl-detail__section-head > .hx-hl-detail__range-bar {
  margin-bottom: 0;
}

/* In place of "Scan now" (a site card) and "Scan site" (the Inventory toolbar) while the site scans: the ETA (scan-actions.js). */
.hx-scan-eta {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 1px 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--status-info);
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--status-info) 45%, transparent);
  border-radius: 999px;
}

/* Phones: no summary band on the pages (Sites, Devices, Billing, Health, Service). "Search" beside the account (shell.js)
   floats the band's search field under the header instead; on the Map it focuses "Find a site". */
.nx-header__search {
  display: none;
}

@media (max-width: 719.98px) {
  .nx-header__search:not([hidden]) {
    display: inline-flex;
  }

  /* In the account menu instead (shell.js). */
  .nx-header .interface-switch,
  .nx-header__display {
    display: none;
  }

  .nx-hero.hx-ov-hero {
    display: none;
  }

  .nx-hero.hx-ov-hero.is-search-open {
    position: fixed;
    top: var(--hx-page-search-top, 60px);
    right: 0;
    left: 0;
    z-index: 40;
    display: block;
    min-height: 0;
    padding: 10px 16px;
    margin: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
  }

  .nx-hero.hx-ov-hero.is-search-open::before,
  .nx-hero.hx-ov-hero.is-search-open::after {
    display: none;
  }

  .nx-hero.hx-ov-hero.is-search-open .nx-hero__inner {
    display: block;
    max-width: none;
    padding: 0;
    margin: 0;
  }

  .nx-hero.hx-ov-hero.is-search-open .nx-hero__inner > :not(.nx-hero__controls),
  .nx-hero.hx-ov-hero.is-search-open .nx-hero__controls > :not(.nx-search) {
    display: none;
  }

  .nx-hero.hx-ov-hero.is-search-open .nx-hero__controls {
    display: block;
    margin: 0;
  }

  .nx-hero.hx-ov-hero.is-search-open .nx-search {
    width: 100%;
    max-width: none;
    margin: 0;
  }
}

/* Sites, for who is not an administrator: "Show all charts" and "Collapse all" at the end of the line of the scope. */
.hx-ov-toolbar__end {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  margin-left: auto;
}

/* On a phone they go under the scope, aligned left (as on the line of "Needs attention"). */
@media (max-width: 719.98px) {
  .hx-ov-toolbar__end {
    margin-left: 0;
  }
}

/* The copyright at the end of every page but the Map (shell.js): the Altamus wordmark, a link to its website. */
.nx-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  font-size: 12.5px;
  color: var(--color-text-muted);
  /* The surface of the site cards (.nx-card), in either theme. */
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.nx-footer a {
  color: inherit;
}

.nx-footer__brand {
  display: inline-flex;
  line-height: 0;
}

.nx-footer__logo {
  width: auto;
  height: 20px;
}

.nx-footer__logo--dark {
  display: none;
}

:root[data-theme='dark'] .nx-footer__logo--light {
  display: none;
}

:root[data-theme='dark'] .nx-footer__logo--dark {
  display: inline;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .nx-footer__logo--light {
    display: none;
  }

  :root:not([data-theme='light']) .nx-footer__logo--dark {
    display: inline;
  }
}

/* ============================================================ User logs: the activity
   components/activity.js: the sessions of the users in the "User logs" dialog, each a card whose head
   folds its timeline open. The root, the toolbar, the count, the skeleton and "Show more" are the ones
   of the logs table (`hx-ul-` rules, so the root is the container the rules below ask); only what
   those do not have is here. Prefix `hx-ac-`. */

/* The head of the dialog: the search, Refresh and when the rows were answered. */
.hx-ac__head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding-top: 6px;
}

.hx-ac__head > .hx-ac__search {
  flex: 1 1 260px;
}

.hx-ac__refresh {
  flex: none;
}

.hx-ac__updated {
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.hx-ac__updated:empty {
  display: none;
}

/* The figures of the sessions that show, on one line. */
.hx-ac__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  font-size: 13px;
}

.hx-ac__stats:empty {
  display: none;
}

.hx-ac__stat {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.hx-ac__stat > dt {
  color: var(--color-text-muted);
}

.hx-ac__stat > dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-heading);
}

.hx-ac__toolbar > [hidden] {
  display: none;
}

.hx-ac__toolbar > .hx-ac__field {
  flex: 1 1 170px;
}

.hx-ac__range {
  display: flex;
  flex: none;
}

.hx-ac__views {
  flex: none;
  gap: 10px;
}

.hx-ac__sessions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hx-ac-session {
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-ac-session__head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  padding: 12px 16px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 10px;
}

.hx-ac-session__head:hover {
  background: var(--color-row-hover);
}

/* An open session: its head is tinted and the card edged in the accent, apart from the folded ones. */
.hx-ac-session.is-open {
  border-color: var(--color-accent);
}

.hx-ac-session.is-open > .hx-ac-session__head {
  background: var(--color-accent-tint);
  border-radius: 9px 9px 0 0;
}

.hx-ac-session.is-open > .hx-ac-session__head:hover {
  background: var(--color-accent-tint-hover);
}

.hx-ac-session__chevron:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-ac-session__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.hx-ac-session__who {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.hx-ac-session__name {
  font-weight: 600;
  color: var(--color-heading);
}

.hx-ac-session__when {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.hx-ac-session__meta,
.hx-ac-session__sites {
  font-size: 13px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.hx-ac-session__sites {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.hx-ac-session__chevron {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 2px;
  margin-top: 0;
  font: inherit;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
}

.hx-ac-session__chevron > * {
  transition: transform 0.15s ease;
}

.hx-ac-session.is-open .hx-ac-session__chevron > * {
  transform: rotate(180deg);
}

.hx-ac-timeline {
  padding: 4px 16px 12px;
  margin: 0;
  list-style: none;
  border-top: 1px solid var(--color-border);
}

.hx-ac-timeline[hidden] {
  display: none;
}

/* An open session: its clients and sites on a sunken band edged beneath, then the timeline under them. */
.hx-ac-session__body {
  border-top: 1px solid var(--color-border);
}

.hx-ac-session__body[hidden] {
  display: none;
}

.hx-ac-session__body > .hx-ac-timeline {
  border-top: 0;
}

.hx-ac-session__body > .hx-ac-session__sites {
  padding: 8px 16px;
  background: var(--color-surface-sunken);
  border-bottom: 1px solid var(--color-border);
}

/* A line: the time, the action, the details, the site; and the delete button, for who may delete. */
.hx-ac-step {
  display: grid;
  grid-template-columns: 76px minmax(150px, 220px) minmax(0, 1fr) minmax(0, 200px);
  gap: 4px 12px;
  align-items: baseline;
  padding: 8px 0;
  font-size: 13.5px;
  border-bottom: 1px solid var(--color-border);
}

.hx-ac-timeline--delete > .hx-ac-step {
  grid-template-columns: 76px minmax(150px, 220px) minmax(0, 1fr) minmax(0, 180px) 32px;
}

.hx-ac-step__delete {
  align-self: center;
}

.hx-ac-step__delete .icon-btn {
  width: 32px;
  height: 32px;
  font-size: 15px;
}

.hx-ac-step__view {
  align-self: flex-start;
  margin-top: 2px;
}

.hx-ac-step:last-child {
  border-bottom: 0;
}

.hx-ac-step__time {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.hx-ac-step__action {
  min-width: 0;
}

.hx-ac-step__action > .tag {
  max-width: 100%;
  white-space: normal;
}

.hx-ac-step__details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hx-ac-step__line--more,
.hx-ac-step__site {
  color: var(--color-text-muted);
}

.hx-ac-step__site {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Another part of a session that touched the filtered site: context, dimmed. */
.hx-ac-step.is-context {
  opacity: 0.55;
}

.hx-ac__older {
  padding-top: 4px;
}

/* Narrow: a phone, or a window not much wider than the dialog. */
@container (max-width: 719.98px) {
  .hx-ac__toolbar > .hx-ac__field {
    flex: 1 1 100%;
  }

  .hx-ac__range {
    flex: 1 1 100%;
  }

  .hx-ac__range > .segmented {
    width: 100%;
  }

  .hx-ac__range .segmented__option {
    flex: 1 1 0;
  }

  .hx-ac-session__head {
    padding: 12px;
    min-height: 44px;
  }

  .hx-ac-timeline {
    padding: 4px 12px 10px;
  }

  .hx-ac-session__body > .hx-ac-session__sites {
    padding: 8px 12px;
  }

  /* Stacked: the time and the action on a line (the delete button at its end), the details and the site under them. */
  .hx-ac-step {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .hx-ac-timeline--delete > .hx-ac-step {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .hx-ac-step__details,
  .hx-ac-step__site {
    grid-column: 1 / -1;
  }

  .hx-ac-step__delete {
    grid-row: 1;
    grid-column: 3;
    align-self: start;
    margin: -6px 0;
  }

  .hx-ac-step__site:empty {
    display: none;
  }

  .hx-ac__older .btn {
    min-height: 44px;
  }
}

@media (max-width: 599.98px) {
  .hx-ac__head > .hx-ac__search {
    flex: 1 1 100%;
  }

  .hx-ac-step__delete .icon-btn {
    width: 44px;
    height: 44px;
  }

  .hx-ac-step__view {
    min-height: 44px;
  }
}

/* ============================================================ end of the user logs: the activity */

/* ============================================================ a field that chooses several (components/multi-select.js) */

/* The field: a compact select of the kit, a button in its place; its label stays on the outline. */
.hx-ms .hx-ms__button {
  display: flex;
  align-items: center;
  padding-right: 36px;
  text-align: left;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  cursor: pointer;
}

.hx-ms .hx-ms__button ~ .field__label {
  top: -8px;
  font-size: 12px;
  font-weight: 600;
}

.hx-ms .hx-ms__button:focus ~ .field__label,
.hx-ms .hx-ms__button.is-open ~ .field__label {
  color: var(--color-accent-text);
}

.hx-ms .hx-ms__button.is-open {
  border-color: var(--color-focus);
  box-shadow: inset 0 0 0 1px var(--color-focus);
}

.hx-ms__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Something chosen: the field is a filter. */
.hx-ms.is-filtered .hx-ms__text {
  font-weight: 600;
  color: var(--color-heading);
}

/* The popover (ui.openMenu): the search, the list, the counts and the buttons. */
.menu.hx-ms-pop {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.hx-ms-pop__head {
  flex: none;
  padding: 12px 12px 8px;
}

.hx-ms-pop__list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(320px, 50vh);
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.hx-ms-pop__list:focus {
  outline: none;
}

.hx-ms-pop__list:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-focus);
}

.hx-ms-pop__option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
}

.hx-ms-pop__option:hover,
.hx-ms-pop__option.is-active {
  background: var(--color-row-hover);
}

.hx-ms-pop__list:focus-visible .hx-ms-pop__option.is-active,
.hx-ms-pop__head:focus-within ~ .hx-ms-pop__list .hx-ms-pop__option.is-active {
  box-shadow: inset 0 0 0 2px var(--color-focus);
}

.hx-ms-pop__option.is-chosen {
  background: var(--color-accent-tint);
}

.hx-ms-pop__option.is-chosen:hover,
.hx-ms-pop__option.is-chosen.is-active {
  background: var(--color-accent-hover);
}

/* A checkbox drawn: the option itself is what is ticked (role="option", aria-selected). */
.hx-ms-pop__tick {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 13px;
  color: transparent;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 4px;
  background: var(--color-field-fill);
}

.hx-ms-pop__option.is-chosen .hx-ms-pop__tick {
  color: var(--color-on-accent, #fff);
  border-color: var(--color-accent);
  background: var(--color-accent);
}

.hx-ms-pop__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hx-ms-pop__name {
  overflow-wrap: anywhere;
  font-weight: 500;
  color: var(--color-heading);
}

.hx-ms-pop__detail {
  overflow-wrap: anywhere;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.hx-ms-pop__empty {
  margin: 0;
  padding: 16px 16px;
  font-size: 13.5px;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.hx-ms-pop__empty[hidden],
.hx-ms-pop__list[hidden] {
  display: none;
}

.hx-ms-pop__foot {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  padding: 6px 8px 6px 14px;
}

.hx-ms-pop__count {
  margin: 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.hx-ms-pop__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

/* Up to a narrow window: the popover is as wide as the window (a phone has the kit's bottom sheet). */
@media (max-width: 719.98px) {
  .menu.hx-ms-pop:not(.menu--sheet) {
    right: 8px;
    left: 8px !important;
    width: auto !important;
  }
}

/* The sheet of a phone: full width, the list scrolls between the search and the buttons, touch-sized rows. */
.menu--sheet.hx-ms-pop {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.menu--sheet .hx-ms-pop__head {
  padding: 0 16px 8px;
}

.menu--sheet .hx-ms-pop__list {
  max-height: none;
}

.menu--sheet .hx-ms-pop__option {
  min-height: 48px;
  font-size: 15px;
}

.menu--sheet .hx-ms-pop__foot {
  padding: 8px 12px 8px 20px;
}

.menu--sheet .hx-ms-pop__actions .btn {
  min-height: 44px;
}

/* ============================================================ end of the field that chooses several */

/* "Only this" beside a user or a site of the User logs (components/activity.js): clears the filters, then chooses it. */
.hx-ac-session__name {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.hx-ac-session__names {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  min-width: 0;
}

.hx-ac-session__site,
.hx-ac-step__site:not(:empty) {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  min-width: 0;
}

/* A row of the timeline: the client above its site, in the one column. */
.hx-ac-step__site:not(:empty) {
  flex-direction: column;
  align-items: flex-start;
  overflow-wrap: normal;
}

.hx-ac-step__site .hx-ac-client {
  margin-right: 0;
}

.hx-ac-step__site .hx-ac-client::after {
  content: none;
}

.hx-ac-site {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  min-width: 0;
}

.hx-ac-client__name,
.hx-ac-site__name {
  min-width: 0;
}

.hx-ac-only {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
}

.hx-ac-only:hover {
  color: var(--color-accent-text);
  background: var(--color-row-hover);
}

.hx-ac-only.is-active {
  color: var(--color-accent-text);
}

.hx-ac-only:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

@media (max-width: 719.98px) {
  .hx-ac-only,
  .hx-ac-session__chevron {
    min-width: 36px;
    min-height: 36px;
  }
}

/* The User logs dialog (components/activity.js) keeps its height whatever its filters show: as tall as the window lets it. */
.dialog:has(> .hx-ac-dialog) {
  height: min(100%, 960px);
}

/* A list of Needs attention with no rows (the Health page, while the all-clear shows in its place): no empty frame. */
.nx-queue:empty {
  display: none;
}

/* The sites of a user, from the User logs (components/activity.js `openUserSites`): a modal dialog. */
.hx-ac-sites__status {
  margin: 0 0 10px;
  color: var(--color-text-muted);
}

.hx-ac-sites__status--error {
  color: var(--color-error-text);
}

.hx-ac-sites__list {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hx-ac-sites__site {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px 0;
  border-top: 1px solid var(--color-border);
}

.hx-ac-sites__site > .bi {
  flex: none;
  color: var(--color-text-muted);
}

.hx-ac-sites__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hx-ac-sites__mine {
  display: inline-flex;
  flex: none;
  gap: 4px;
  align-items: center;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* The link of a site to its page, beside its "only this" and in the Sites of a user (components/activity.js `siteLink`). */
.hx-ac-site-link {
  text-decoration: none;
}

/* The client of a site in the User logs, with its "only this" (components/activity.js `sitePieces`). */
.hx-ac-client {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  min-width: 0;
  margin-right: 4px;
  color: var(--color-text-muted);
}

.hx-ac-client::after {
  margin-left: 4px;
  content: '·';
}

/* ---- Health checks (components/health-checks.js): the section of the Scanner Health dialog, and the dialog of several sites ---- */

/* The way to the settings of a site, beside the way to the site: a super-user's. */
.hx-hl-site__checks.icon-btn {
  width: 32px;
  height: 32px;
  margin-left: -6px;
  font-size: 14px;
  color: var(--color-text-muted);
  border-radius: 8px;
}

.hx-hl-site__checks.icon-btn:hover {
  color: var(--color-accent-text);
  background: var(--color-hover);
}

/* ---- Health check settings (components/health-checks.js): the section of a scanner and the dialog of several sites. */

/* The section of a scanner: the checks under three small headings, a row a check; two columns where the dialog is wide. */
.hx-hc__lead {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* "3 not saved" beside the count in the head, while something is staged. */
.hx-hc__pending {
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-warning-text);
  background: var(--color-field-changed);
  border-radius: 999px;
}

.hx-hc__pending[hidden] {
  display: none;
}

.hx-hc-group {
  margin: 14px 0 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.hx-hc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 0 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hx-hc-list--phone {
  grid-template-columns: 1fr;
}

.hx-hc-row {
  display: flex;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
  min-height: 56px;
  padding: 4px 6px 4px 10px;
  border-bottom: 1px solid var(--color-border);
}

/* Changed and not saved: the fill of a changed field. The source is said in words, not by a colour. */
.hx-hc-row.is-changed,
.hx-hc-subject.is-changed {
  background: var(--color-field-changed);
}

.hx-hc-row__main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.hx-hc-row__main .switch-row {
  min-height: 0;
  padding: 2px 0;
  font-weight: 600;
  background: none;
}

.hx-hc-row.is-off .switch-row__label,
.hx-hc-row.is-off .hx-hc-row__label {
  color: var(--color-text-muted);
}

.hx-hc-row__hint {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* The streak of a check (Scan quality poor, Invalid boundaries), inside its row, its card or under its subject: two
   compact counts in a sentence, "Raise after [3] poor scans in a row". Dimmed while the check itself is off. */
.hx-hc-row--streak {
  flex-wrap: wrap;
}

/* The check's own line keeps its field beside it: the words give way, the streak takes the next line. */
.hx-hc-row--streak > .hx-hc-row__main {
  flex-basis: 0;
}

.hx-hc-streaks {
  display: flex;
  flex-basis: 100%;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin: 0 0 4px;
  padding: 2px 0 2px 10px;
  border-left: 2px solid var(--color-border);
}

.hx-hc-streaks.is-dimmed > .hx-hc-streak {
  opacity: 0.55;
}

.hx-hc-streaks__note {
  font-size: 12px;
  font-style: italic;
  color: var(--color-text-muted);
}

.hx-hc-streak {
  display: flex;
  align-items: center;
  gap: 0 4px;
  min-height: 34px;
  padding: 0 2px 0 4px;
  border-radius: 6px;
}

.hx-hc-streak.is-changed {
  background: var(--color-field-changed);
}

/* Right-aligned, under the value of its check (Kyle, 2026-11-08). */
.hx-hc-streak__main {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  text-align: right;
  gap: 0 8px;
  min-width: 0;
}

.hx-hc-streak__words {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 6px;
  font-size: 14px;
}

.hx-hc-streak__input {
  width: 64px;
  min-height: 30px;
  padding: 2px 6px;
  font: inherit;
  text-align: right;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
}

.hx-hc-streak__input:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

.hx-hc-streak__input:disabled {
  color: var(--color-text-muted);
  background: transparent;
}

.hx-hc-streak.has-error .hx-hc-streak__input {
  border-color: var(--status-error);
}

.hx-hc-streak__error {
  font-size: 12px;
  color: var(--status-error);
}

.hx-hc-streak__hint {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-hc-streak__value {
  min-height: 30px;
  padding: 2px 8px;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.hx-hc-streak__value:hover {
  border-color: var(--color-border-strong);
}

.hx-hc-streak__value:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-hc-streak .hx-hc-row__reset.icon-btn,
.hx-hc-streak .hx-hc-subject__reset.icon-btn {
  width: 28px;
  height: 28px;
  flex: none;
  font-size: 14px;
}

.hx-hc-streaks--subject {
  margin: 0 0 2px 24px;
}

.hx-hc-streaks--all {
  margin-left: 12px;
}

.hx-hc-streaks--scanner {
  margin-left: 48px;
}

.hx-hc-one__card .hx-hc-streaks {
  margin: 6px 0 4px;
}

.hx-hc-row__side {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
}

.hx-hc-row__limit {
  width: 132px;
  margin: 0;
}

.hx-hc-row__limit .field__error {
  font-size: 12px;
}

/* The date a scanner is checked from: a field of a date and a time (the viewer's), wide enough for it. */
.hx-hc-row__limit.hx-hc-row__date {
  width: 212px;
}

.hx-hc-date .field__input {
  min-width: 0;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

/* In a row of the section, on a phone, the date and the time (date-time-split.js) take the whole width under the name of
   the check. */
.hx-hc-row--date:has(.hx-dts) {
  flex-wrap: wrap;
}

.hx-hc-row--date:has(.hx-dts) > .hx-hc-row__side {
  flex: 1 1 100%;
}

.hx-hc-row__limit.hx-hc-date:has(.hx-dts) {
  flex: 1 1 auto;
  width: auto;
}

/* On a phone every `datetime-local` is a date and a time side by side in one box (date-time-split.js); the original
   holds the value, out of sight. A field of the kit keeps its one label, raised over the two; a bare `hx-sc-input` is
   two in its box (the ranges of the scanner settings). */
.hx-dts__held {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hx-dts {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.hx-dts .field__input,
.hx-dts .hx-sc-input {
  min-width: 0;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.hx-dts--bare {
  flex: 1;
  gap: 0;
}

.hx-dts--bare > .hx-sc-input + .hx-sc-input {
  border-left: 1px solid var(--color-border);
}

/* The two inputs of a field of the kit make one box: the corners and the line between them are the box's. A little
   less padding than a field, so a date and a time fit beside another field on a phone. */
.hx-dts--field {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0;
}

.hx-dts--field > .field__input {
  padding-right: 6px;
  padding-left: 8px;
}

/* The calendar and the clock of the two keep close to the text (the browser leaves room before them). */
.hx-dts > input::-webkit-calendar-picker-indicator {
  margin-left: 2px;
  padding: 2px;
}

.hx-dts > input::-webkit-datetime-edit {
  padding: 0;
}

.hx-dts--field > .field__input:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.hx-dts--field > .field__input + .field__input {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.hx-dts--field > .field__input:focus {
  position: relative;
  z-index: 1;
}

.hx-dts--field > .field__label {
  z-index: 2;
  top: -8px;
  font-size: 12px;
  font-weight: 600;
}

.hx-hc-row--date .hx-hc-row__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hx-hc-row--date .hx-hc-row__label {
  font-weight: 600;
  color: var(--color-heading);
}

/* A space under its site (a date of the spaces): a step further in than the site's row. */
.hx-hc-subject--space {
  margin-left: 22px;
}

/* Hidden, it keeps its place: the fields of the rows stay in line. */
.hx-hc-row__reset.icon-btn {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

.hx-hc-row__reset.icon-btn[hidden] {
  display: inline-flex;
  visibility: hidden;
}

/* A row on a phone: the switch alone at the left, then a button of the rest (the label, the source, the value, a chevron)
   that opens the editor of the check. */
.hx-hc-row--phone {
  padding: 0 0 0 2px;
}

.hx-hc-row__switch--bare.switch-row {
  flex: none;
  min-height: 0;
  padding: 0;
  background: none;
}

.hx-hc-row__open {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 56px;
  padding: 6px 2px 6px 8px;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 8px;
}

.hx-hc-row__open:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-hc-row__label {
  font-weight: 600;
  color: var(--color-heading);
}

.hx-hc-row__chevron,
.hx-hc-check__chevron {
  display: inline-flex;
  flex: none;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* A value: what is in force; where it is changed and not saved, the saved value struck through before it. */
.hx-hc-value {
  flex: none;
  font-weight: 600;
  white-space: nowrap;
}

.hx-hc-value.is-off {
  font-weight: 400;
  color: var(--color-text-muted);
}

.hx-hc-value__was {
  font-weight: 400;
  color: var(--color-text-muted);
}

.hx-hc__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

/* While something is not saved the footer stays in view under the rows. */
.hx-hc__footer.is-sticky {
  position: sticky;
  bottom: -16px;
  z-index: 1;
  padding: 8px 0;
  background: var(--color-surface-raised, var(--color-surface));
  border-top: 1px solid var(--color-border);
}

.hx-hc__status {
  margin-right: auto;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-hc__status.is-pending {
  font-weight: 600;
  color: var(--color-warning-text);
}

/* The small text buttons of the rows ("Tick scanners", "Retry"). */
.hx-hc-textbtn.btn--sm {
  min-height: 28px;
  padding: 2px 8px;
  font-size: 12px;
}

/* The editor of one subject, one check: a bottom sheet (a phone) or a small dialog. */
.hx-hc-editor__about {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* What Done reaches, under what the check governs ("All" of the dialog of several sites). */
.hx-hc-editor__note {
  margin: -2px 0 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--color-heading);
}

.hx-hc-editor__switch.switch-row {
  padding: 6px 0;
  font-weight: 600;
}

.hx-hc-editor__limit {
  margin: 0;
}

/* A limit between its step buttons: (−−) (−) before the field, (+) (++) after it, as a setting of a pile in the 3D
   viewer (.hx-pcd-position__step). In the row of the section the field keeps its width; in a sheet it takes the rest. */
.hx-hc-stepper {
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
}

.hx-hc-editor .hx-hc-stepper,
.hx-hc-one__card .hx-hc-stepper {
  margin: 10px 0 0;
}

.hx-hc-stepper > .field-group {
  flex: 1 1 0;
  min-width: 0;
}

.hx-hc-stepper > .hx-hc-row__limit {
  flex: none;
  width: 96px;
}

.hx-hc-stepper input {
  width: 100%;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.hx-hc-stepper__steps {
  display: flex;
  flex: none;
  gap: 2px;
}

.hx-hc-stepper__step {
  box-sizing: border-box;
  min-width: 30px;
  height: 40px;
  padding: 0 4px;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text);
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong, var(--color-border));
  border-radius: 8px;
}

.hx-hc-stepper__step:hover:not(:disabled) {
  background: var(--color-surface-raised);
  border-color: var(--color-text-muted);
}

.hx-hc-stepper__step:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

.hx-hc-stepper__step:disabled {
  cursor: default;
  opacity: 0.5;
}

/* In a sheet (the editor, a notice's card) the field is full height and the buttons a finger wide. */
.hx-hc-editor .hx-hc-stepper__step,
.hx-hc-one__card .hx-hc-stepper__step {
  min-width: 36px;
  height: 48px;
}

.hx-hc-editor__levels,
.hx-hc-editor__setby {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* The dialog of one notice (openNoticeChecks): the notice as its row says it, the scope, then a card a check. */
.hx-hc-one__notice {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  padding: 10px 12px;
  margin: 0 0 12px;
  background: var(--color-surface-sunken);
  border-left: 4px solid var(--nx-item-color, var(--status-unknown));
  border-radius: 8px;
}

.hx-hc-one__detail {
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text);
}

.hx-hc-one__scope,
.hx-hc-one__readonly {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.hx-hc-one__readonly {
  margin: 4px 0 0;
  font-size: 12px;
}

.hx-hc-one__card {
  padding: 10px 14px 12px;
  margin: 0 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

/* A card with a setting of its own: marked at the left, as a changed row is. */
.hx-hc-one__card.is-own {
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.hx-hc-one__head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 2px;
}

.hx-hc-one__label {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-hc-one__follow {
  margin: 6px 0 0 -8px;
}

.hx-hc-one__all {
  margin: 2px 0 0 -8px;
}

/* ---- The dialog of several sites: the checks (A) and one check (B); a stack of two screens on a phone, two columns on a desktop. */
.hx-hc-dialog {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.hx-hc-dialog:not(.hx-hc-dialog--phone) {
  overflow: hidden;
}

.hx-hc-cols {
  display: flex;
  flex: 1 1 auto;
  gap: 0;
  min-height: 0;
}

.hx-hc-cols > .hx-hc-screen--checks {
  flex: none;
  width: 320px;
  padding: 12px 16px 16px 0;
  overflow: auto;
  border-right: 1px solid var(--color-border);
}

.hx-hc-cols > .hx-hc-screen--check {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 0 16px 20px;
  overflow: auto;
}

.hx-hc-screen[hidden] {
  display: none;
}

.hx-hc-screen--checks .hx-ms {
  margin: 0;
}

.hx-hc-chosen {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-hc-checklist {
  padding: 0;
  margin: 0;
  list-style: none;
}

/* A check: its label and summary at the left, the value (or "Mixed") at the right; pressed, it is the one shown (a desktop). */
.hx-hc-check {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 6px 4px 6px 8px;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
}

.hx-hc-check:hover {
  background: var(--color-hover);
}

.hx-hc-check:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-hc-check[aria-pressed='true'] {
  background: var(--color-accent-tint);
  border-radius: 8px;
}

.hx-hc-check__main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.hx-hc-check__label {
  font-weight: 600;
  color: var(--color-heading);
}

.hx-hc-check__sub {
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-hc-check__value {
  flex: none;
  font-weight: 600;
  white-space: nowrap;
}

.hx-hc-check__value.is-off {
  font-weight: 400;
  color: var(--color-text-muted);
}

/* "3 changes" (a phone) or "3" beside a check that has something staged. */
.hx-hc-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  color: var(--color-warning-text);
  vertical-align: 1px;
  background: var(--color-field-changed);
  border: 1px solid var(--status-warning);
  border-radius: 999px;
}

/* "Custom": the rule in force, as saved, differs from the default (components/health-checks.js `customBadge`). A quiet
   tint, apart from the changed one; inline with the name, so a row at 375px keeps its one line where it can. */
.hx-hc-badge--custom {
  color: var(--color-accent-text);
  background: var(--color-accent-tint);
  border-color: transparent;
  font-weight: 600;
  white-space: nowrap;
}

.switch-row__label .hx-hc-badge--custom,
.hx-hc-one__label + .hx-hc-badge--custom {
  vertical-align: 2px;
}

/* One check: its "?" and range, then "Set to" (sticky over the subjects), then the subjects by site. */
.hx-hc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 8px;
}

.hx-hc-head__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-heading);
}

/* The foot of a check in the Health checks dialog: its range and default, then what it is (Kyle, 2026-11-08). */
.hx-hc-about {
  margin: 16px 0 4px;
  padding: 12px 2px 0;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.hx-hc-about__range {
  margin: 0 0 6px;
  font-weight: 600;
}

.hx-hc-about__text {
  margin: 0;
}

.hx-hc-head__range {
  font-size: 12px;
  color: var(--color-text-muted);
}

.hx-hc-sitegroup {
  margin-top: 10px;
}

/* A subject: its name and source, its value (a button: the editor), the way back. "All" (every chosen site, and what is
   under them) is a site's row over the sites, kept in view while they scroll. */
.hx-hc-subject {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  min-height: 48px;
  padding: 4px 4px 4px 10px;
  border-bottom: 1px solid var(--color-border);
  border-radius: 8px;
}

.hx-hc-subject--site {
  min-height: 52px;
  background: var(--color-surface-sunken);
}

.hx-hc-subject--all {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 4px;
  background: var(--color-accent-tint);
  box-shadow: 0 1px 0 var(--color-border);
}

.hx-hc-subject--all.is-changed {
  background: var(--color-field-changed);
}

.hx-hc-subject:not(.hx-hc-subject--site) {
  margin-left: 24px;
}

.hx-hc-subject__main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.hx-hc-subject__name {
  color: var(--color-text);
}

/* What the check shown finds now on a scanner (or on the spaces of a site): its icon beside the name, the colour of
   its severity. A button: a tap says what it is, where there is no hover. */
.hx-hc-symptom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  vertical-align: -1px;
  cursor: help;
  font-size: 0.95em;
  line-height: 1;
}

/* The severity of the notice a check raises, before its name in the list of the Health checks dialog (Kyle, 2026-11-08). */
.hx-hc-sev {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  margin-right: 6px;
  font-size: 0.95em;
  line-height: 1;
  vertical-align: -1px;
}

.hx-hc-sev--error {
  color: var(--status-error);
}

.hx-hc-sev--warning {
  color: var(--status-warning);
}

.hx-hc-sev--info {
  color: var(--status-info);
}

.hx-hc-symptom--error {
  color: var(--status-error);
}

.hx-hc-symptom--warning {
  color: var(--status-warning);
}

.hx-hc-symptom--info {
  color: var(--status-info);
}

@media (max-width: 599.98px) {
  /* A target a finger can hit, without making the row taller. */
  .hx-hc-symptom {
    min-width: 28px;
    min-height: 28px;
    margin: -6px -4px -6px 2px;
  }
}

.hx-hc-subject--site .hx-hc-subject__name {
  font-weight: 700;
  color: var(--color-heading);
}

.hx-hc-subject__sub {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* The site threshold settings (the Health checks dialog): no small detail line under All, a site, a scanner, a space or a
   boundary, nor beside a streak's count (Kyle, 2026-11-08). The line of a site still loading stays: it says it is. */
.hx-hc-dialog .hx-hc-subject:not(.hx-hc-subject--wait) .hx-hc-subject__sub,
.hx-hc-dialog .hx-hc-streak__hint {
  display: none;
}

/* A field to tap, boxed as a streak's count is (Kyle, 2026-11-08). */
.hx-hc-subject__value {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 32px;
  padding: 2px 10px;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.hx-hc-subject__value:hover {
  border-color: var(--color-border-strong);
}

.hx-hc-subject__value:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-hc-subject__reset.icon-btn {
  width: 32px;
  height: 32px;
  font-size: 15px;
}

.hx-hc-subject--wait {
  background: none;
}

/* A power supply that was removed, listed because it keeps a row of its own of the check (for a restore): greyed. */
.hx-hc-subject--supply.is-removed .hx-hc-subject__name {
  color: var(--color-text-muted);
  font-style: italic;
}

.hx-hc-subject__none {
  margin: 4px 0 0 30px;
  font-size: 12px;
}

/* Invalid boundaries: under a site, its spaces (a row that folds their boundaries away) and each boundary with its
   "Ignore" switch. Indented as the scanners of a site are; a change not saved has the changed tint. */
.hx-hc-spaces {
  margin-left: 24px;
}

.hx-hc-spaces[hidden] {
  display: none;
}

/* The fold of a site's row (Invalid boundaries): a chevron before its tick. */
.hx-hc-subject--fold {
  padding-left: 2px;
}

.hx-hc-fold {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 -6px 0 0;
  padding: 0;
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 8px;
}

.hx-hc-fold:hover {
  color: var(--color-text);
  background: var(--color-row-hover);
}

.hx-hc-fold:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-hc-spaces__note {
  margin: 6px 0 2px;
  font-size: 12px;
}

.hx-hc-spaces.is-off .hx-hc-bnd {
  opacity: 0.6;
}

.hx-hc-space {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 4px 6px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 8px;
}

.hx-hc-space:hover {
  background: var(--color-row-hover);
}

.hx-hc-space:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.hx-hc-space .hx-hc-subject__name {
  font-weight: 600;
}

.hx-hc-space.is-changed {
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.hx-hc-space__chevron {
  flex: none;
  width: 18px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-hc-bnds[hidden] {
  display: none;
}

.hx-hc-bnd {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-left: 24px;
  padding: 2px 4px 2px 6px;
  border-bottom: 1px solid var(--color-border);
  border-radius: 8px;
}

.hx-hc-bnd.is-changed {
  background: var(--color-field-changed);
}

.hx-hc-bnd.is-ignored:not(.is-changed) .hx-hc-subject__name {
  color: var(--color-text-muted);
}

/* The kit's switch row, as small as the row: "Ignore" beside the switch, at the right. */
.hx-hc-bnd__switch.switch-row {
  flex: none;
  gap: 8px;
  padding: 4px 6px;
  font-size: 13px;
  border-radius: 8px;
}

.hx-hc-none {
  margin: 8px 0;
}

/* The review before a save that touches more than one site: what is staged, by site. */
.hx-hc-review__site {
  margin: 10px 0 2px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-heading);
}

.hx-hc-review__site:first-child {
  margin-top: 0;
}

.hx-hc-review__lines {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}

/* A phone: the two screens one at a time (the back arrow in the title bar); "Set to" sticks to the top of the sheet's body;
   the subjects' rows have less around them. */
.hx-hc-back[hidden] {
  display: none;
}

@media (max-width: 599.98px) {
  .hx-hc-dialog--phone .hx-hc-screen--checks .hx-ms {
    margin-top: 4px;
  }

  .hx-hc-subject--all {
    top: -16px;
    border-radius: 0 0 8px 8px;
  }

  .hx-hc-subject:not(.hx-hc-subject--site) {
    margin-left: 14px;
  }

  .hx-hc-spaces {
    margin-left: 10px;
  }

  .hx-hc-bnd {
    margin-left: 14px;
  }

  .hx-hc-row__limit {
    width: 112px;
  }

  .hx-hc-spaces .hx-hc-subject--space {
    margin-left: 4px;
  }

  .hx-hc__footer.is-sticky {
    bottom: -16px;
  }
}

/* "Customer API keys" (components/client-keys.js): the client-wide API key of each customer, for super-users. */
.hx-ck {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.hx-ck-lead {
  margin: 0;
}

.hx-ck-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
}

.hx-ck-filter {
  flex: 1 1 240px;
  max-width: 360px;
}

.hx-ck-count {
  flex: 0 1 auto;
}

.hx-ck-notes:empty {
  display: none;
}

.hx-ck-table-wrap {
  max-height: min(56vh, 560px);
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hx-ck-table {
  margin: 0;
}

.hx-ck-table td.hx-ck-code-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.hx-ck-table .hx-ck-sites {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hx-ck-table td.hx-ck-key {
  min-width: 220px;
}

.hx-ck-none {
  color: var(--color-text-muted);
}

.hx-ck-mask {
  margin-right: 8px;
  letter-spacing: 1px;
  color: var(--color-text-muted);
}

.hx-ck-code {
  display: inline-block;
  max-width: 100%;
  padding: 2px 6px;
  margin-right: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  word-break: break-all;
  cursor: pointer;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.hx-ck-code:hover,
.hx-ck-code:focus-visible {
  border-color: var(--color-text-muted);
}

.hx-ck-table td.hx-ck-actions,
.hx-ck-table th.hx-ck-actions {
  text-align: right;
}

.hx-ck-table td.hx-ck-actions {
  white-space: nowrap;
}

.hx-ck-table td.hx-ck-actions .btn + .btn {
  margin-left: 8px;
}

.hx-ck-revoke {
  color: var(--color-error-text);
}

/* "Client pricing" (components/client-pricing.js): the prices negotiated with each customer; administrators read, super-users change. */
.hx-cp {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.hx-cp-client {
  max-width: 480px;
}

.hx-cp-showhidden {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  cursor: pointer;
}

.hx-cp-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.hx-cp-option.is-disabled {
  cursor: default;
}

/* "At cost" under the unit price of the transaction form (an InvenTree part): ticked or not, the price is asked for again. */
.hx-bill-atcost {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  cursor: pointer;
}

.hx-bill-atcost[hidden] {
  display: none;
}

.hx-cp-hiddentag {
  margin-left: 8px;
  opacity: 0.75;
}

.hx-cp-notes:empty {
  display: none;
}

.hx-cp-table {
  margin: 0;
}

.hx-cp-table th.hx-cp-item {
  font-weight: 600;
  text-align: left;
}

.hx-cp-table .hx-cp-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hx-cp-default {
  color: var(--color-text-muted);
}

.hx-cp-table tr.hx-cp-price td {
  font-size: 13px;
  border-top-style: dashed;
}

.hx-cp-table tr.hx-cp-price--ended td,
.hx-cp-table tr.hx-cp-price--ended th,
.hx-cp-table tr.hx-cp-price--ended .hx-cp-note {
  color: var(--color-text-muted);
}

.hx-cp-table tr.hx-cp-group th {
  text-align: left;
  background: var(--color-bg-subtle, var(--color-bg));
  border-top: 2px solid var(--color-border);
}

.hx-cp-group__title {
  font-weight: 600;
  margin-right: 12px;
}

.hx-cp-table tr.hx-cp-planempty td {
  color: var(--color-text-muted);
}

.hx-cp-note {
  display: block;
  padding-left: 16px;
  white-space: normal;
  max-width: 28ch;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.hx-cp-table th .hx-cp-note--item {
  padding-left: 0;
  font-weight: 400;
  font-size: 12px;
}

.hx-cp-table td.hx-cp-actions,
.hx-cp-table th.hx-cp-actions {
  text-align: right;
  white-space: nowrap;
  /* As wide as its buttons, and no wider: the other columns take the rest. */
  width: 1%;
}

.hx-cp-table td.hx-cp-actions .btn + .btn {
  margin-left: 4px;
}

/* The actions sit in fixed places (slots() of client-pricing.js): an empty place keeps its width, unseen. */
.hx-cp-table td.hx-cp-actions .hx-cp-slot--empty {
  visibility: hidden;
}

/* "Hide" and "Unhide" take the same room, so Delete after them lines up. */
.hx-cp-table td.hx-cp-actions .hx-cp-slot--hide {
  min-width: 7em;
}

/* "Facility-wide" (client-pricing.js): a tick, centred, in a narrow column. */
.hx-cp-table td.hx-cp-facility,
.hx-cp-table th.hx-cp-facility {
  text-align: center;
  white-space: nowrap;
  width: 1%;
}

.hx-cp-facilityfield {
  margin-top: 0;
}

.hx-cp-delete {
  color: var(--color-error-text);
}

/* "Delete" of the Edit form of a price or a custom plan: at the left of its buttons, away from Save. */
.hx-cp-formdelete {
  margin-right: auto;
}

.hx-cp-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hx-cp-months {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

/* ============================================================ Which space? (space-pick.js): "Site 3D" of a site with several spaces */

.hx-space-pick__lead {
  margin: 0 0 12px;
  color: var(--color-text-muted);
}

/* "Download to Excel" (components/excel-export.js): each input on a row of its own, the whole width: Start, Stop,
   Piles | Materials (both sides as wide), the drop-down of the piles (or the materials), the drop-down of the units;
   then why "Download" waits. */
.hx-xl,
.hx-xl__times,
.hx-xl__choice {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hx-xl {
  --field-fill: var(--color-bg);
}

.hx-xl .field-group {
  margin: 0;
}

.hx-xl__by .segmented {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  width: 100%;
}

.hx-xl__pick {
  min-width: 0;
}

.hx-xl__pick[hidden] {
  display: none;
}

.hx-xl__note {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hx-space-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hx-space-pick__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  color: var(--color-text);
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
}

.hx-space-pick__item:hover {
  border-color: var(--color-accent);
}

.hx-space-pick__item:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hx-space-pick__name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
}

.hx-space-pick__when {
  flex: none;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* The tooltip of a chart (components/chart-tooltip.js): a box above the canvas, outside the plot, over the windows and dialogs. */
.hx-chart-tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2100;
  display: none;
  max-width: min(320px, calc(100vw - 16px));
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--color-tooltip-bg);
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.18);
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-tooltip-text);
  pointer-events: none;
}

.hx-chart-tip.is-shown {
  display: block;
}

.hx-chart-tip__title {
  margin-bottom: 2px;
  font-weight: 700;
}

.hx-chart-tip__line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hx-chart-tip__swatch {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.hx-chart-tip__footer {
  margin-top: 2px;
  font-weight: 600;
}

/* The footer of a resolution's summary on a phone (components/service-detail.js, Kyle 2026-10-30): Delete and Edit on
 * one row, "Mark complete" and Close on the next, each half of the width. */
@media (max-width: 719.98px) {
  .dialog__footer:has(> .hx-sv-visit-act),
  .hx-sv-window__footer:has(> .hx-sv-visit-act) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dialog__footer:has(> .hx-sv-visit-act) > .hx-sv-visit-act,
  .hx-sv-window__footer:has(> .hx-sv-visit-act) > .hx-sv-visit-act {
    width: 100%;
    margin: 0;
  }

  .hx-sv-visit-act--delete { order: 1; }
  .hx-sv-visit-act--edit { order: 2; }
  .hx-sv-visit-act--complete { order: 3; }
  /* A complete resolution has no "Mark complete": Close takes the whole second row. */
  .hx-sv-visit-act--close { order: 4; }
  .dialog__footer:not(:has(> .hx-sv-visit-act--complete)) > .hx-sv-visit-act--close,
  .hx-sv-window__footer:not(:has(> .hx-sv-visit-act--complete)) > .hx-sv-visit-act--close {
    grid-column: 1 / -1;
  }
}

/* The footer of a proposal the client's administrator answers (components/service-detail.js: Accept, Decline, Contact,
 * Close; Kyle 2026-10-30), on a phone: Accept and Decline on one row, Contact and Close on the next, half the width each. */
@media (max-width: 719.98px) {
  .dialog__footer:has(> [data-focus-id="accept-proposal"]),
  .hx-sv-window__footer:has(> [data-focus-id="accept-proposal"]) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dialog__footer:has(> [data-focus-id="accept-proposal"]) > .btn,
  .hx-sv-window__footer:has(> [data-focus-id="accept-proposal"]) > .btn {
    width: 100%;
    margin: 0;
  }
}

/* The "Timeline" of a resolution's summary (components/service-detail.js, Kyle 2026-10-30): a line per moment. */
.hx-sv-detail__timeline {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hx-sv-detail__timeline-pill {
  align-self: flex-start;
  margin: 2px 0 4px;
}


/* Chat */
/* Live chat with Altamus (components/chat-widget.js): a bubble bottom-right on every page, the panel it opens (a full-screen
 * sheet on a phone), the staff inbox and the messages of a thread. Under the dialogs (1000) and the toasts (1300), so the
 * confirmation of "Close conversation" and the toast of a new message show over it. Colours are the tokens of altamus.css. */
.nx-chat [hidden] {
  display: none !important;
}

.nx-chat__bubble {
  position: fixed;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  font-size: 24px;
  color: var(--color-on-accent);
  background: var(--color-accent);
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-raised);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.nx-chat__bubble:hover {
  background: var(--color-accent-strong);
  transform: translateY(-1px);
}

.nx-chat__bubble:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.nx-chat__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  color: var(--color-on-accent);
  text-align: center;
  background: var(--status-error);
  border: 2px solid var(--color-surface);
  border-radius: var(--radius-pill);
  box-sizing: content-box;
}

.nx-chat__panel {
  position: fixed;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: flex;
  flex-direction: column;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100dvh - 120px);
  overflow: hidden;
  color: var(--color-text);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
}

.nx-chat__panel:focus {
  outline: none;
}

.nx-chat__head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 60px;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--color-border);
}

.nx-chat__back {
  margin-left: -8px;
}

.nx-chat__heading {
  flex: 1;
  min-width: 0;
}

.nx-chat__title {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-heading);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nx-chat__sub {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nx-chat__dot {
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--status-ok);
  border-radius: var(--radius-pill);
}

.nx-chat__dot--off {
  background: var(--status-unknown);
}

/* Away: the note under the title may take two lines beside the switch. */
.nx-chat__sub.is-away {
  align-items: flex-start;
  white-space: normal;
}

.nx-chat__sub.is-away .nx-chat__dot {
  margin-top: 4px;
}

/* Idle (no input for 5 minutes) and Away (set by hand): amber. */
.nx-chat__dot--idle {
  background: var(--status-warning);
}

/* Staff: the Available / Away switch of the panel header. */
.nx-chat__available,
.nx-chat__available:hover {
  flex: none;
  gap: 8px;
  min-height: 0;
  padding: 4px 6px;
  margin: 0;
  background: none;
  font-size: 12px;
  color: var(--color-text-muted);
}

.nx-chat__available .switch-row__label {
  font-size: 12px;
}

/* Staff, Away: a ring on the bubble, visible without opening the panel. */
.nx-chat__bubble.is-away::after {
  content: '';
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  background: var(--status-warning);
  border: 2px solid var(--color-surface-raised);
  border-radius: var(--radius-pill);
}

.nx-chat__body {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  background: var(--color-bg);
}

.nx-chat__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}

.nx-chat__empty .empty-state__text,
.nx-chat__inbox-empty .empty-state__text {
  font-size: 13px;
}

.nx-chat__messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  padding: 12px 12px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nx-chat__msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 82%;
  margin-top: 8px;
}

.nx-chat__msg.is-grouped {
  margin-top: 0;
}

.nx-chat__msg.is-mine {
  align-self: flex-end;
  align-items: flex-end;
}

.nx-chat__meta {
  margin: 0 4px 2px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.nx-chat__text {
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px 16px 16px 4px;
}

.nx-chat__msg.is-staff .nx-chat__text {
  color: var(--color-on-accent-tint);
  background: var(--color-accent-tint);
  border-color: transparent;
}

.nx-chat__msg.is-mine .nx-chat__text {
  color: var(--color-on-accent);
  background: var(--color-accent);
  border-color: transparent;
  border-radius: 16px 16px 4px 16px;
}

.nx-chat__msg.is-grouped .nx-chat__text {
  border-top-left-radius: 4px;
}

.nx-chat__msg.is-mine.is-grouped .nx-chat__text {
  border-top-left-radius: 16px;
  border-top-right-radius: 4px;
}

.nx-chat__day {
  align-self: center;
  margin: 12px 0 4px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-sunken);
  border-radius: var(--radius-pill);
}

.nx-chat__notice {
  flex: none;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  background: var(--color-surface-sunken);
  border-top: 1px solid var(--color-border);
}

.nx-chat__composer {
  display: flex;
  flex: none;
  align-items: flex-end;
  gap: 6px;
  margin: 0;
  padding: 8px 8px 8px 12px;
  background: var(--color-surface-raised);
  border-top: 1px solid var(--color-border);
}

.nx-chat__input {
  flex: 1;
  min-height: 40px;
  max-height: 140px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text);
  resize: none;
  background: var(--color-field-fill);
  border: 1px solid var(--color-field-outline);
  border-radius: 20px;
  box-sizing: border-box;
}

.nx-chat__input:focus {
  outline: none;
  border-color: var(--color-focus);
  box-shadow: 0 0 0 1px var(--color-focus);
}

.nx-chat__input:disabled {
  color: var(--color-text-disabled);
  background: var(--color-fill-disabled);
}

.nx-chat__send {
  flex: none;
  width: 40px;
  height: 40px;
  color: var(--color-accent-text);
}

.nx-chat__send:disabled {
  color: var(--color-text-disabled);
}

/* The staff inbox: "My own thread", then a row per open conversation. */
.nx-chat__inbox {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--color-surface-raised);
}

.nx-chat__row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
}

.nx-chat__row--own,
.nx-chat__row-open {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 12px 8px 12px 16px;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.nx-chat__row--own {
  width: 100%;
  align-items: center;
  padding-right: 16px;
  background: var(--color-surface-sunken);
}

.nx-chat__row--own:hover,
.nx-chat__row-open:hover {
  background: var(--color-row-hover);
}

.nx-chat__row-open .nx-chat__dot {
  margin-top: 6px;
}

.nx-chat__row-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 16px;
  color: var(--color-accent-text);
  background: var(--color-accent-selected);
  border-radius: var(--radius-pill);
}

.nx-chat__row-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.nx-chat__row-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.nx-chat__row-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nx-chat__row-time,
.nx-chat__row-page {
  flex: none;
  font-size: 11px;
  color: var(--color-text-muted);
}

.nx-chat__row-page {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nx-chat__row-last {
  overflow: hidden;
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nx-chat__row.is-unread .nx-chat__row-last {
  font-weight: 600;
  color: var(--color-text);
}

.nx-chat__count {
  flex: none;
  align-self: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  color: var(--color-on-accent);
  text-align: center;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
  box-sizing: border-box;
}

.nx-chat__row-close {
  flex: none;
  margin-right: 6px;
  color: var(--color-text-muted);
}

/* Staff: the link to the page a client is on, beside where it is said (components/chat-widget.js `pageLink`). */
.nx-chat__page-link {
  flex: none;
  width: 32px;
  height: 32px;
  font-size: 15px;
  color: var(--color-text-muted);
  text-decoration: none;
}

.nx-chat__page-link:hover,
.nx-chat__page-link:focus-visible {
  color: var(--color-accent);
}

.nx-chat__sub-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nx-chat__sub .nx-chat__page-link {
  width: 24px;
  height: 24px;
  margin: -4px 0;
  font-size: 13px;
}

.nx-chat__inbox-empty {
  padding: 32px 24px;
}

/* The headings of the inbox: "Online now" (the clients online, staff may start a conversation) and "Conversations". */
.nx-chat__section {
  margin: 0;
  padding: 10px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.nx-chat__online-empty {
  padding: 10px 16px 12px;
  font-size: 13px;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

/* A client: what staff see of them, one quiet line above the composer. */
.nx-chat__privacy {
  flex: none;
  padding: 6px 16px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--color-text-muted);
  text-align: center;
  background: var(--color-surface-raised);
  border-top: 1px solid var(--color-border);
}

/* With the bottom bar of pages (health/css/next.css: 56px high, plus the safe area): the bubble sits above it. */
@media (max-width: 719.98px) {
  .nx-chat__bubble {
    /* Much smaller than on a desktop: it must not cover the cards. */
    width: 36px;
    height: 36px;
    font-size: 16px;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(56px + 12px + env(safe-area-inset-bottom, 0px));
  }

  .nx-chat__bubble .nx-chat__badge {
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    font-size: 10px;
    padding: 0 4px;
  }

  .nx-chat__panel {
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(56px + 16px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 56px - 96px - env(safe-area-inset-bottom, 0px));
  }
}

/* A phone (ui.js PHONE_MAX_WIDTH): the panel is a full-screen sheet, over the bottom bar. */
@media (max-width: 599.98px) {
  .nx-chat__panel {
    inset: 0;
    z-index: 950;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    padding-top: env(safe-area-inset-top, 0px);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .nx-chat__composer {
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .nx-chat__input {
    font-size: 16px;
  }

  .nx-chat__row-close {
    display: inline-flex;
  }
}

/* The device name of a scanner of an event, in brackets after its name (Kyle, 2026-11-13): kept whole on its line. */
.hx-sv-detail__device-name {
  white-space: nowrap;
}

.hx-sv-detail__device-name[hidden] {
  display: none;
}

/* The pictures of a resolution in its form (Kyle, 2026-11-13): first in the right column, without the rule of a part
   of a detail over them. Their height is their own (the grid is cut at a row and a half): the list of the events under
   them takes the rest of the column. */
.hx-sv-form__col > .hx-sv-pics:first-child {
  flex: none;
  padding-top: 0;
  border-top: 0;
}
