/* ═══════════════════════════════════════════════════════════
   Design tokens
   All colour, radius, and spacing values live here so both
   the internal dashboard and client status views stay in sync.
   ═══════════════════════════════════════════════════════════ */

/* The Squadron wordmark's face, served by us rather than fetched from a third
   party on every page load. A render-blocking cross-origin stylesheet for one
   decorative word puts first paint on someone else's uptime, and an extension
   that blocks that host stalls it: caddis-www lost five seconds to exactly this
   (caddis-www#6). Latin subset only, which is all "SQUADRON" needs, at 9,968
   bytes -- less than the request it replaces. See static/fonts/README.md. */
@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 600;
  /* Same swap the Google stylesheet asked for: draw in the fallback first and
     repaint when the face lands, rather than holding the header blank. */
  font-display: swap;
  src: url("../fonts/chakra-petch-600-latin.27489a499469.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-page:        #0f1117;
  --bg-card:        #1c1f2e;
  --bg-subtle:      rgba(255, 255, 255, 0.04);
  --border-default: rgba(255, 255, 255, 0.07);
  /* The accent at 40%, derived so a holiday's accent carries its hover border. */
  --border-hover:   color-mix(in srgb, var(--brand-blue) 40%, transparent);
  --text-primary:   #e2e8f0;
  --text-secondary: #8892a4;

  /* The caddis fly mark's lightest blue (#3f95c5) lifted until it carries text.
     Against the #303030 navbar the mark's own blue manages 3.97:1, under the
     4.5:1 WCAG AA asks for; this reads 5.78:1. The Squadron wordmark is painted
     in it so the name and the mark beside it read as one lockup. */
  --brand-blue:     #63b3ed;
  --radius-card:    12px;
  --radius-badge:   20px;

  --color-ok:       #48c78e;
  --color-ok-bg:    rgba(72, 199, 142, 0.15);
  --color-ok-border:rgba(72, 199, 142, 0.3);

  --color-warn:     #ffb74d;
  --color-warn-bg:  rgba(255, 183, 77, 0.15);
  --color-warn-border: rgba(255, 183, 77, 0.3);

  --color-crit:     #fc6464;
  --color-crit-bg:  rgba(252, 100, 100, 0.15);
  --color-crit-border: rgba(252, 100, 100, 0.3);

  /* One colour per sensor, so a trend chart and the card that opened it are
     never two different colours for the same measurement. Hue is picked where
     it is free -- warm for temperature, water-blue for clarity, the pink of a
     pH strip, brass for the electrical probe -- and lightness carries the rest,
     which is what keeps them apart for a viewer who cannot separate the hues.
     Each clears 4.7:1 against --bg-card, and the closest pair measures 36.6
     CIELAB dE under simulated deuteranopia and protanopia against the 29 dE bar
     dashboards/basemaps.py sets for the map palette. Changing one of these means
     re-checking both numbers, not just eyeballing it. */
  --sensor-ph:           #c964d8;
  --sensor-temp:         #ba7a5e;
  --sensor-turbidity:    #a9d0da;
  --sensor-conductivity: #c4ab31;

  /* The other two values the conductivity probe reports. These three are the
     only sensor colours ever drawn together, so they are the ones that have to
     be told apart at a glance: every pair clears 35 dE in normal vision and
     under both dichromacies, and 45 dE against the near-white trend line laid
     over them. That is close to the ceiling -- red-green colourblindness folds
     hue onto a single blue-yellow axis, so three categorical colours cannot be
     three unrelated hues -- which is why the chart also gives each line its own
     marker shape rather than resting on colour alone. */
  --sensor-tds:          #b38a61;
  --sensor-salinity:     #7c86c0;

  /* The pond map's field overlay, which answers a different question from the
     --sensor-* colours above: those name WHICH sensor, these name whether the
     water is good. So the map's colour changes with the reading while the
     chart's stays put, and the two never have to agree.

     Deliberately not red-against-green as the two poles. Red-green is the pair
     that collapses under deuteranopia and protanopia, and it is the pair
     carrying the whole signal here. Blue against red survives both, because
     they separate on the blue-yellow axis dichromacy leaves intact. Green is
     kept for the healthy middle, where it is only ever drawn at ~14% alpha and
     means "nothing to look at" -- so the one risky pairing never carries
     information. Good and bad are told apart by saturation before hue. */
  --field-low:  #5b9bd5;
  /* Deliberately not --color-ok, and deliberately not spelled as the route's
     own value either -- dashboards/basemaps.py owns that one, and a copy here
     is exactly what test_no_template_or_static_file_hardcodes... exists to
     stop. The point is the collision: on the dark basemap the run route is a
     vivid green meaning "where the boat went", and at overlay alpha the ok
     green was near enough to it that the field read as more route rather than
     as a reading. This is deeper and cooler, so the two stay separable where
     they overlap. */
  --field-good: #2f8f74;
  --field-high: var(--color-crit);

  /* Surfaces and text that Darkly's colour-named classes (bg-dark, text-light,
     btn-light, table-dark, navbar-dark) used to supply, at the values Darkly gave
     them. A class that names a colour cannot be re-themed; these can. */
  --bg-chrome:          #303030;
  --text-heading:       #adb5bd;
  --text-bright:        #fff;
  --text-on-bright:     #000;
  --button:             #adb5bd;
  /* Darkly's bg-secondary and btn-primary, which the sign-in and password
     forms used directly and so stayed the same in every theme. */
  --bg-input:            #444;
  --button-primary:      #375a7f;
  --button-primary-text: var(--text-bright);
  --nav-link:           rgba(255, 255, 255, 0.6);
  --nav-link-disabled:  rgba(255, 255, 255, 0.25);
  /* The demo copy's banner under the header: Darkly's bg-info and text-dark,
     which it used directly and so kept in every theme. */
  --bg-banner:          #3498db;
  --text-banner:        #303030;
  /* A box saying something is done (a visit submitted, a message confirmed):
     Darkly's alert-success, which it painted solid. */
  --bg-done:            #00bc8c;
  --text-done:          #fff;

  /* Lines, washes, and panels drawn over the page and the maps. */
  --border-divider:     rgba(255, 255, 255, 0.08);
  --border-panel:       rgba(255, 255, 255, 0.1);
  --border-faint:       rgba(255, 255, 255, 0.04);
  --border-hover-plain: rgba(255, 255, 255, 0.25);
  --focus-ring:         rgba(255, 255, 255, 0.35);
  --bg-track:           rgba(255, 255, 255, 0.08);
  --bg-hover:           rgba(255, 255, 255, 0.07);
  --bg-row-hover:       rgba(255, 255, 255, 0.02);
  --bg-overlay:         rgba(15, 17, 23, 0.88);
  --bg-popover:         rgba(15, 17, 23, 0.92);
  --shadow-popover:     0 4px 16px rgba(0, 0, 0, 0.45);
  --text-table:         #c8d0de;
  --text-overlay-label: rgba(255, 255, 255, 0.5);
  --scrollbar-thumb:    #444;

  /* The visit report's photo viewer. A photo is judged against black, so no
     theme should repaint these. */
  --photo-stage:        #000;
  --photo-control-bg:   rgba(0, 0, 0, 0.55);
  --photo-control-text: #fff;

  /* The pond page's run chart and the controls around it, drawn by
     waterway_trend.js and styled in waterway_detail.html. */
  --chart-grid:                  rgba(255, 255, 255, 0.07);
  --chart-axis:                  rgba(255, 255, 255, 0.2);
  --chart-idle:                  rgba(255, 255, 255, 0.24);
  --chart-cross:                 rgba(255, 255, 255, 0.35);
  --chart-fault-hatch:           rgba(255, 255, 255, 0.16);
  --chart-fault-swatch:          rgba(255, 255, 255, 0.3);
  --chart-mark:                  #f8fafc;
  --chart-label-strong:          #a0aec0;
  --chart-control-text:          #cbd5e1;
  --chart-control-bg:            rgba(255, 255, 255, 0.06);
  --chart-control-border:        rgba(255, 255, 255, 0.12);
  --chart-control-active-bg:     rgba(255, 255, 255, 0.08);
  --chart-control-active-border: rgba(255, 255, 255, 0.3);

  /* Map buttons drawn to match Leaflet's own white zoom control. */
  --map-control-bg:       #fff;
  --map-control-bg-hover: #f4f4f4;
  --map-control-text:     #333;

  /* The employee fleet map's own status colours. They are not --color-ok, -warn
     and -crit, and should be: TODO(2026-09-28) reconcile the two palettes (#225),
     which is a visible change and so not part of moving them onto tokens. */
  --fleet-ok:             #22c55e;
  --fleet-warn:           #f59e0b;
  --fleet-crit:           #ef4444;
  --fleet-offline:        #6b7280;
  --fleet-cluster-bg:     rgba(30, 60, 100, 0.85);
  --fleet-cluster-border: #4a9eed;
  --fleet-overlay-bg:     rgba(24, 26, 30, 0.92);

  /* What the browser paints for native controls, scrollbars, and the gap
     between documents. A theme that is not dark says so here. */
  --color-scheme: dark;
}


/* ─── Base ───────────────────────────────────────────────── */

/* The root element, not only the body. A transparent root leaves the browser
   painting its own default -- white -- for the moment between one document and
   the next, which is the flash on every navigation that changes the run date.
   color-scheme closes the same gap from the other side: it tells the browser
   the default it should be reaching for is dark, and carries scrollbars and
   form controls with it. */
html {
  background-color: var(--bg-page);
  color-scheme: var(--color-scheme);
}

/* Chrome and Edge on Windows paint a select's open list in the select's own
   background laid over white, so a see-through one put near-white text on
   white. A solid colour on each choice keeps every list dark. */
select option {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 1 auto;
}


/* ─── Chrome ─────────────────────────────────────────────── */

/* Stand-ins for Darkly's colour-named classes, which name a colour rather than
   a role and so cannot be re-themed. The utilities keep Bootstrap's !important
   so they still win over component rules like .form-control's colour. */
.bg-chrome    { background-color: var(--bg-chrome) !important; }
.text-heading { color: var(--text-heading) !important; }
.bg-input     { background-color: var(--bg-input) !important; }

/* btn-light and btn-outline-light from a token. Bootstrap shades a button's
   hover, active, and border states by mixing black into the base colour, at
   15%, 20%, and 25%; the same mixes here reproduce Darkly's values exactly. */
.btn-chrome {
  --bs-btn-color: var(--text-bright);
  --bs-btn-bg: var(--button);
  --bs-btn-border-color: var(--button);
  --bs-btn-hover-color: var(--text-bright);
  --bs-btn-hover-bg: color-mix(in srgb, var(--button) 85%, black);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--button) 80%, black);
  --bs-btn-active-color: var(--text-bright);
  --bs-btn-active-bg: color-mix(in srgb, var(--button) 80%, black);
  --bs-btn-active-border-color: color-mix(in srgb, var(--button) 75%, black);
  --bs-btn-disabled-color: var(--text-bright);
  --bs-btn-disabled-bg: var(--button);
  --bs-btn-disabled-border-color: var(--button);
  --bs-btn-focus-box-shadow: 0 0 0 0.25rem
    color-mix(in srgb, color-mix(in srgb, var(--text-bright) 15%, var(--button)) 50%, transparent);
}

.btn-outline-chrome {
  --bs-btn-color: var(--button);
  --bs-btn-border-color: var(--button);
  --bs-btn-hover-color: var(--text-bright);
  --bs-btn-hover-bg: var(--button);
  --bs-btn-hover-border-color: var(--button);
  --bs-btn-active-color: var(--text-bright);
  --bs-btn-active-bg: var(--button);
  --bs-btn-active-border-color: var(--button);
  --bs-btn-disabled-color: var(--button);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--button);
  --bs-btn-focus-box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--button) 50%, transparent);
}


/* Bootstrap's primary button from a token, shaded the same way as .btn-chrome. */
.btn-primary {
  --bs-btn-color: var(--button-primary-text);
  --bs-btn-bg: var(--button-primary);
  --bs-btn-border-color: var(--button-primary);
  --bs-btn-hover-color: var(--button-primary-text);
  --bs-btn-hover-bg: color-mix(in srgb, var(--button-primary) 85%, black);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--button-primary) 80%, black);
  --bs-btn-active-color: var(--button-primary-text);
  --bs-btn-active-bg: color-mix(in srgb, var(--button-primary) 80%, black);
  --bs-btn-active-border-color: color-mix(in srgb, var(--button-primary) 75%, black);
  --bs-btn-disabled-color: var(--button-primary-text);
  --bs-btn-disabled-bg: var(--button-primary);
  --bs-btn-disabled-border-color: var(--button-primary);
  --bs-btn-focus-box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--button-primary) 50%, transparent);
}


/* ─── Navbar ─────────────────────────────────────────────── */

/* ─── Site header ────────────────────────────────────────── */

/* Three columns around the mark. The side columns are equal so the mark stays
   centred, which also means each side gets only half the leftover width: that is
   why the row folds into the Menu button below lg rather than wrapping its labels.
   Which half shows at which width is Bootstrap's d-* utilities in the template,
   not this file (#127). */
.site-header {
  display: block;  /* Bootstrap's .navbar is a wrapping flex row; this is a grid. */
  flex-shrink: 0;
  padding: 0;
  --bs-navbar-brand-padding-y: 0;
  --bs-navbar-brand-margin-end: 0;
  /* The bar's height is the one size to set; the mark fills it less a thin
     clearance above and below. The word CADDIS is under a third of the mark's
     height, so the mark takes all of the bar it can while staying off its edges. */
  --site-header-height: 64px;
  --site-header-mark-clearance: 10px;

  /* What navbar-dark set, from tokens instead. */
  --bs-navbar-color: var(--nav-link);
  --bs-navbar-hover-color: var(--text-bright);
  --bs-navbar-active-color: var(--text-bright);
  --bs-navbar-disabled-color: var(--nav-link-disabled);
  --bs-navbar-brand-color: var(--text-bright);
  --bs-navbar-brand-hover-color: var(--text-bright);
  --bs-navbar-toggler-border-color: var(--border-panel);
}

/* Bootstrap draws the toggler's three bars as an SVG with the colour baked into
   its data URL, where no token can reach. Use the same bars as a mask instead
   and paint them in the link colour. */
.navbar-toggler-icon {
  background-image: none;
  background-color: var(--nav-link);
  -webkit-mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='black' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") center / 100% no-repeat;
  mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='black' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") center / 100% no-repeat;
}

.site-header-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 1rem;
  min-height: var(--site-header-height);
  padding: 0 1rem;
}

.site-header-start {
  display: flex;
  align-self: stretch;
  align-items: center;
  min-width: 0;
}

.site-header-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  min-width: 0;
}

.site-header-mark {
  display: flex;
  align-items: center;
}

.site-header-mark img {
  display: block;
  width: auto;
  height: calc(var(--site-header-height) - 2 * var(--site-header-mark-clearance));
  object-fit: contain;
}

/* Under a mouse the mark grows out of the bar. A transform leaves its place in
   the bar untouched, so nothing beside it moves and it settles back where it was.
   No phones: a tap counts as hover there and would leave the mark stuck large. */
@media (hover: hover) {
  .site-header-mark img {
    position: relative;
    /* Grows down into the page; from the centre, its top would leave the window. */
    transform-origin: top center;
  }

  /* Over the banners (1041) and holiday art (1040), under the header's dropdowns. */
  .site-header-mark:hover img {
    transform: scale(1.8);
    z-index: 1042;
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .site-header-mark img {
    transition: transform 150ms ease-out;
  }
}

/* The wordmark's face, in capitals. 600 is the only Chakra Petch weight
   shipped, so asking for bold would have the browser fake it. Employee portal
   headings wear it over the theme's body type; Squadron's pages keep the theme's. */
.navbar-wordmark,
.portal-heading {
  font-family: 'Chakra Petch', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
}

.portal-heading {
  letter-spacing: 0.08em;
}

/* The Squadron wordmark. Squared and letter-spaced so it reads as a name rather
   than as one more label in the bar. */
.navbar-wordmark {
  font-size: 1rem;
  letter-spacing: 0.16em;
  color: var(--brand-blue);
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  /* Letter-spacing pads the right of the final glyph too, which would leave the
     wordmark short of the bar's edge by that much. */
  margin-right: -0.16em;
}

@media (min-width: 768px) {
  .site-header {
    --site-header-height: 88px;
    /* Thinner from md, where the row has room for the wider mark. On a 320px
       phone, 6px brought the mark within 4px of the Squadron name. */
    --site-header-mark-clearance: 6px;
  }

  .site-header-bar {
    padding: 0 1.5rem;
    column-gap: 1.5rem;
  }

  .navbar-wordmark {
    font-size: 1.2rem;
  }
}

/* Labels never wrap. A two-line "Fleet / Status" is the bug this layout replaced. */
.site-header .nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
  position: relative;
}

.site-header-links {
  --site-header-link-padding: 0.75rem;
  align-self: stretch;
  /* Pull the first label's padding back so its text lines up with the bar edge. */
  margin-left: calc(-1 * var(--site-header-link-padding));
}

.site-header-links .nav-link {
  height: 100%;
  padding: 0 var(--site-header-link-padding);
}

/* Between lg and xl the side columns are at their narrowest, and an employee's
   five labels ran under the mark at 992px (#446). Bootstrap's own 0.5rem keeps
   them clear there; a wider bar keeps the roomier spacing. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .site-header-links {
    --site-header-link-padding: 0.5rem;
  }
}

/* The current page is told apart by more than brightness: it also gets a bar in
   the brand colour along the header's bottom edge. */
.site-header .nav-link[aria-current="page"] {
  color: var(--bs-navbar-active-color);
}

.site-header-links .nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: var(--site-header-link-padding);
  right: var(--site-header-link-padding);
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--brand-blue);
}

/* The account menu's Employee Portal is a page too. Bold, as in the phone menu,
   marks it current there without relying on the brighter colour alone. */
.site-header .dropdown-item[aria-current="page"] {
  color: var(--bs-navbar-active-color);
  font-weight: 700;
}

.site-header-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.75rem;
  color: var(--bs-navbar-active-color);
  background: transparent;
  border: 1px solid var(--bs-navbar-toggler-border-color);
  border-radius: 0.5rem;
}

.site-header-menu-button .navbar-toggler-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.site-header-you {
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

/* View as is a mode, not a page, so it is a control beside the account rather than
   a link among the pages. It turns the banner's yellow while it is on. */
.site-header-view-as {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 13rem;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--bs-navbar-toggler-border-color);
  border-radius: 999px;
  /* A <button> in the employee header, where the dark color-scheme would
     otherwise paint the browser's grey button fill behind the label. */
  background: transparent;
  color: var(--bs-navbar-color);
  text-decoration: none;
  white-space: nowrap;
}

/* A plain wrapper held the button at its whole label, up to the 13rem cap, so at
   992px a long name pushed the account past the bar's edge (#570). As a flex item
   the button shortens with the space instead, and the name is cut sooner. */
.site-header-view-as-dropdown {
  display: flex;
  min-width: 0;
}

/* Cut long customer names here only. The banner under the bar gives the whole name. */
.site-header-view-as span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Below xl the button holds about 19 characters, so "Viewing as " is taken out of
   sight there, though still read out, and the banner says it (#597). From xl the bar
   has room for the words and a 12-character short name, which in capitals needs
   17rem: 15rem cut "Viewing as WOODMERE POA". */
@media (max-width: 1199.98px) {
  .site-header-view-as-prefix {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

@media (min-width: 1200px) {
  .site-header-view-as {
    max-width: 17rem;
  }
}

.site-header-view-as:hover {
  color: var(--bs-navbar-active-color);
  border-color: var(--bs-navbar-active-color);
}

.site-header-view-as.is-on {
  background: var(--bs-warning);
  border-color: var(--bs-warning);
  color: var(--bs-dark);
  font-weight: 700;
}

/* #512's list of customers can be long; it scrolls inside the menu instead. */
.site-header-view-as-menu {
  max-height: 60vh;
  max-width: min(24rem, calc(100vw - 2rem));
  overflow-y: auto;
}

/* A long customer name wraps rather than widening the menu past the screen. */
.site-header-view-as-menu .dropdown-item {
  white-space: normal;
}

/* The holiday animations switch, where it sits in the bar (#604), is the same
   round button as the account, so the two read as the same kind of control. */
.site-header-account,
.site-header-animations {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--bs-navbar-toggler-border-color);
  border-radius: 50%;
  background: transparent;
  color: var(--bs-navbar-active-color);
  font-size: 0.9rem;
  font-weight: 700;
}

.site-header-who {
  display: grid;
}

/* The inactive links' colour, 5.83:1 on the bar and the menu. --text-secondary
   reads 4.21:1 there, under the 4.5:1 small text needs. */
.site-header-who span,
.site-header-menu-heading {
  color: var(--bs-navbar-color);
  font-size: 0.85rem;
}

.site-header .dropdown-item {
  min-height: 44px;
}

/* Below lg: a full-width list under the bar. Rows are 48px and the whole width of
   the screen, so a thumb cannot miss. */
.site-header-menu {
  border-top: 1px solid var(--bs-navbar-toggler-border-color);
  padding: 0.5rem 0 0.75rem;
}

.site-header-menu .nav-link {
  width: 100%;
  min-height: 48px;
  padding: 0 1.25rem;
  background: none;
  border: 0;
  text-align: left;
}

.site-header-menu .nav-link[aria-current="page"] {
  font-weight: 700;
}

.site-header-menu .nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-blue);
}

.site-header-menu-section {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--bs-navbar-toggler-border-color);
}

.site-header-menu .site-header-who {
  padding: 0.5rem 1.25rem;
}

/* Over the holiday switch's rows in the Menu list (#604), in the size and
   colour of the email above them. */
.site-header-menu-heading {
  margin: 0;
  padding: 0.5rem 1.25rem 0.25rem;
}

/* The holiday switch's rows are a section of the menu they sit in, kept apart
   from the Log Out or Exit demo under them. */
.holiday-switch-rows {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bs-navbar-toggler-border-color);
}

/* Bootstrap's own ring is a 25% glow of its blue, which all but vanishes on this
   bar. White reads 13:1 against it, and against every holiday's colour too. */
.site-header a:focus-visible,
.site-header button:focus-visible,
.view-as-banner button:focus-visible,
.site-skip-link:focus-visible {
  outline: 2px solid var(--text-bright);
  outline-offset: 2px;
  box-shadow: none;
}

.site-skip-link:focus {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1040;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  background: var(--text-bright);
  color: var(--text-on-bright);
}

/* Each banner says what the page is, the demo or a customer's view, so it sits
   above any holiday art (holiday_overlay.css, at 1040) rather than under it. */
.demo-banner,
.view-as-banner {
  position: relative;
  z-index: 1041;
}

/* The header's menus open over the page, so over holiday art and the banners
   too. Bootstrap opens a dropdown at 1000, under the art; the moon covered View as. */
.site-header .dropdown-menu {
  z-index: 1042;
}

.site-header-menu {
  position: relative;
  z-index: 1041;
}

.demo-banner,
.demo-banner a {
  background: var(--bg-banner);
  color: var(--text-banner);
}

.alert-success {
  background-color: var(--bg-done);
  color: var(--text-done);
}

/* The sentence takes the spare width and wraps, so the button stays beside it until
   the screen is too narrow for both. */
.view-as-banner > span {
  flex: 1 1 20rem;
  min-width: 0;
}

.view-as-banner .btn {
  min-height: 44px;
}


/* ─── Cards ──────────────────────────────────────────────── */

/* Shared card shell used by both internal and client views */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.section-card + .section-card {
  margin-top: 0;
}

/* Section header strip inside a card */
.section-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-default);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* A real heading inside the strip, for screen readers, drawn like the strip. */
.section-header .section-title {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

/* Large metric card (client stat cards + internal summary bar) */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  height: 100%;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-unit {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-left: 0.2rem;
  font-weight: 400;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}


/* ─── Health / status badges ─────────────────────────────── */

.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-badge);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.health-ok   { background: var(--color-ok-bg);   color: var(--color-ok);   border: 1px solid var(--color-ok-border); }
.health-warn { background: var(--color-warn-bg);  color: var(--color-warn); border: 1px solid var(--color-warn-border); }
.health-crit { background: var(--color-crit-bg);  color: var(--color-crit); border: 1px solid var(--color-crit-border); }
.health-none { background: var(--bg-subtle);      color: var(--text-secondary); border: 1px solid var(--border-default); }

/* Compact inline variant for table cells */
.status-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-badge);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-ok   { background: var(--color-ok-bg);   color: var(--color-ok); }
.status-warn { background: var(--color-warn-bg);  color: var(--color-warn); }
.status-crit { background: var(--color-crit-bg);  color: var(--color-crit); }
.status-none { background: var(--bg-subtle);      color: var(--text-secondary); }


/* ─── Battery bar ────────────────────────────────────────── */

.battery-bar {
  height: 4px;
  background: var(--bg-track);
  border-radius: 2px;
  margin-top: 0.4rem;
  overflow: hidden;
}

.battery-fill {
  height: 100%;
  border-radius: 2px;
}


/* ─── Tables ─────────────────────────────────────────────── */

.readings-table {
  width: 100%;
  border-collapse: collapse;
}

.readings-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border-default);
  font-weight: 600;
}

.readings-table td {
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-table);
  border-bottom: 1px solid var(--border-faint);
}

.readings-table tr:last-child td { border-bottom: none; }
.readings-table tr:hover td { background: var(--bg-row-hover); }

/* Bootstrap table overrides to match the design */
.table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* table-dark from a token. Darkly derives the stripe, hover, active, and border
   shades by mixing white into the table colour, so the same mixes here keep
   them identical today and make them follow whatever --bg-chrome becomes. */
.table-chrome {
  --bs-table-color: var(--text-bright);
  --bs-table-bg: var(--bg-chrome);
  --bs-table-border-color: color-mix(in srgb, var(--bg-chrome) 80%, white);
  --bs-table-striped-bg: color-mix(in srgb, var(--bg-chrome) 95%, white);
  --bs-table-striped-color: var(--text-bright);
  --bs-table-active-bg: color-mix(in srgb, var(--bg-chrome) 90%, white);
  --bs-table-active-color: var(--text-bright);
  --bs-table-hover-bg: color-mix(in srgb, var(--bg-chrome) 92.5%, white);
  --bs-table-hover-color: var(--text-bright);
  color: var(--bs-table-color);
  border-color: var(--bs-table-border-color);
}


/* ─── Off-season banner (#730) ───────────────────────────── */

/* Inline in the page, under the header, so a holiday scene drawn over the page
   never covers it and it never covers the scene. */
.season-banner {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-left: 4px solid var(--brand-blue);
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}
.season-banner-icon { color: var(--brand-blue); font-size: 1.25rem; line-height: 1.4; }
.season-banner-title { font-weight: 600; margin-bottom: 0.25rem; }
.season-banner p { margin-bottom: 0.35rem; font-size: 0.9rem; }
.season-banner p:last-child { margin-bottom: 0; }
.season-banner a { color: var(--brand-blue); }

/* The field tech's "Out for the season?" switch: staff only. A blue box sits
   under the chosen answer and slides across when it changes; the other answer
   is greyed out. */
.season-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.season-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 2px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: 999px;
}
.season-toggle::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc(50% - 2px);
  border-radius: 999px;
  background: var(--brand-blue);
  transition: transform 0.2s ease;
}
.season-switch[data-removed="yes"] .season-toggle::before {
  transform: translateX(100%);
}
.season-toggle button {
  position: relative;
  min-width: 2.75rem;
  padding: 0.15rem 0.7rem;
  border: 0;
  background: none;
  /* Greyed by colour alone. Faded further it read below 4.5:1, and it is the
     answer a tech may need to press. */
  color: var(--text-secondary);
  font-weight: 600;
  transition: color 0.2s ease;
}
.season-toggle button[aria-pressed="true"] { color: var(--bg-page); }
.season-switch-error { color: var(--color-crit); }
@media (prefers-reduced-motion: reduce) {
  .season-toggle::before, .season-toggle button { transition: none; }
}
/* Under a pond's card on the staff list, and on each pond row in a grounds. */
.pond-season { margin-top: 0.5rem; }
/* The card still fills its column with the switch under it, so a row of
   cards keeps one height. */
[data-pond-grid] > :has(> .pond-season):not([hidden]) { display: flex; flex-direction: column; }
[data-pond-grid] > :has(> .pond-season) > .waterway-card { flex: 1; height: auto; }
.grounds-ponds .season-switch { padding: 0 0 0.5rem; }
/* On the pond page, under the header. */
.pond-page-season { margin-bottom: 1.5rem; }


/* ─── Charts ─────────────────────────────────────────────── */

.dashboard-chart {
  min-height: 220px;
}


/* ─── Map ────────────────────────────────────────────────── */

#mapid {
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}


/* ─── Scrollbar (webkit) ─────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
