*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg-body: #0d1117;
  --color-bg-card: #161b22;
  --color-bg-hover: #1c2128;
  /* Warm card surface (Settings cards) — visually distinct from the blue-gray
     defaults so config surfaces stand apart from data. */
  --color-bg-card-warm: #362e2e;
  --color-bg-hover-warm: #523b3b;
  --color-border: #21262d;
  --color-border-accent: #30363d;
  --color-text-primary: #e6edf3;
  --color-text-secondary: #8b949e;
  --color-text-tertiary: #c9d1d9;
  --color-text-muted: #7d7f82;
  --color-brand: #ff0000;
  --color-danger: #f85149;
  --color-success: #3fb950;
  --color-warning: #d29922;
  --color-info: #0053cb;
  --color-accent-gold: #c9a84c;
  --color-burgundy: rgb(86 5 4);
  --color-tier-beta: #24aeee;
  --color-tier-beta-bg: #1a2f42;
  --color-tier-beta-tint: rgba(36, 174, 238, 0.08);
  --color-link: #ff0000;
  --color-logo-bg: #000000;
  --color-instance-dev: #ffca07;
  --color-instance-test: #ff8b00;
  --color-accent-gold-hover: #f0cc8a;
  --color-text-on-dark: #ffffff;
  --font-s: 10px;
  --font-m: 12px;
  --font-md: 13px;
  --font-l: 14px;
  --font-xl: 18px;
  --font-xxl: 24px;
  --radius-card: 12px;
  --radius-input: 6px;
  --radius-compact: 4px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--font-m);
  background: var(--color-bg-body);
  color: var(--color-text-primary);
}

/* Display font (Anta) for h1s, the sidebar nav section headers, and the
   top-level Alerts nav item. */
h1,
.nav-section-header,
.nav-section-label,
.nav-item[data-section="alerts"] {
  font-family: 'Anta', sans-serif;
  text-transform: uppercase;
}

/* Non-prod instance strip: a thin colored bar above all app chrome so dev/test
   tabs are unmistakable. Prod carries no instance class, so the strip stays
   hidden. Color mirrors the tab favicon (gold = dev, orange = test). */
.instance-strip { display: none; height: 4px; }
body.instance-dev .instance-strip { display: block; background: var(--color-instance-dev); }
body.instance-test .instance-strip { display: block; background: var(--color-instance-test); }

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 16px;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
}
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-bar-account-select {
  padding: 4px 28px 4px 8px;
  background: var(--color-bg-body);
  color: var(--color-text-tertiary);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-input);
  font-size: var(--font-m);
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%238b949e'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 14px;
}

/* Layout */
.layout {
  display: flex;
  min-height: calc(100vh - 37px);
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: var(--color-bg-card);
  border-right: 1px solid var(--color-border);
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.sidebar-logo-wrap {
  padding: 10px 22px 14px;
  border-bottom: 1px solid var(--color-border);
  margin: 4px 0;
  background-color: var(--color-logo-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.sidebar-logo-wrap .nav-beta-badge { margin-top: 10px; align-self: center; }
.sidebar-logo {
  width: 100%;
  height: auto;
  display: block;
  max-width: 175px;;
}
.mobile-logo { cursor: pointer; }
.site-selector {
  padding: 12px 20px 4px;
}
#account-selector {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 12px;
  padding-bottom: 12px;
}
.site-label {
  display: block;
  font-size: var(--font-s);
  font-weight: 700;
  color: var(--color-accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.site-select {
  width: 100%;
  padding: 8px 32px 8px 12px;
  font-size: var(--font-l);
  font-family: inherit;
  color: #fff;
  background: var(--color-burgundy);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-input);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='%238b949e'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.site-select:hover {
  border-color: var(--color-text-muted);
}
.site-select:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.nav-group,
.nav-element {
  display: flex;
  flex-direction: column;
}
.nav-group {
  font-family: 'Anta', sans-serif;
}
.nav-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 4px 0px;
}

.nav-section-label {
  display: block;
  padding: 8px 20px 4px;
  font-weight: 700;
  color: var(--color-accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: color 0.15s;
}
.nav-section-label:hover {
  color: var(--color-accent-gold-hover);
}
.nav-vendor-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  margin: 0 12px;
  width: calc(100% - 24px);
  font-size: var(--font-l);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  font-family: inherit;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.nav-vendor-toggle:hover,
.nav-vendor-toggle.nav-section-toggle:not(.collapsed) {
  background: var(--color-bg-hover);
  color: var(--color-text-on-dark);
}
.nav-vendor-toggle .nav-section-chevron {
  margin-left: auto;
}
.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.nav-section-toggle:not(.collapsed) {
  color: var(--color-accent-gold);
}
.nav-section-toggle:hover {
  color: var(--color-text-on-dark);
}
.nav-section-chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.nav-section-toggle.collapsed .nav-section-chevron {
  transform: rotate(-90deg);
}
.nav-section-group {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.25s ease-in-out;
}
.nav-section-group.collapsed {
  grid-template-rows: 0fr;
}
.nav-section-group-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  margin: 0 12px;
  font-size: var(--font-l);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  width: calc(100% - 24px);
  text-align: left;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
  border-radius: 8px;
}
.nav-item-expandable .nav-section-chevron {
  margin-left: auto;
}
.nav-item-expandable.collapsed .nav-section-chevron {
  transform: rotate(-90deg);
}
.nav-item.nav-disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}
.nav-site-group-label {
  display: none;
}
#sfcc-nav-group .nav-item,
#shopify-nav-group .nav-item,
#crux-nav-group .nav-item {
  margin: 0 12px 0 18px;
  width: calc(100% - 30px);
  padding-left: 28px;
}
.nav-context-selector {
  padding: 8px 16px 12px;
}
.nav-context-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-accent-gold);
  margin-bottom: 8px;
  padding-left: 2px;
}
.site-select-grouped {
  width: 100%;
  padding: 8px 12px;
  background: var(--color-burgundy);
  color: #fff;
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-input);
  font-size: var(--font-l);
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%238b949e'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 28px;
}
.site-select-grouped optgroup {
  color: var(--color-text-secondary);
  font-style: normal;
  font-weight: 600;
  font-size: var(--font-m);
}
.site-select-grouped option {
  color: var(--color-text-primary);
  font-weight: 400;
  padding: 4px 8px;
}
.site-select-grouped option:checked {
  color: var(--color-accent-gold);
}
.nav-item-link {
  text-decoration: none;
  font-family: inherit;
}
.nav-item-link:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}
.nav-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}
.nav-item.active {
  background: rgb(118, 3, 3);
  color: var(--color-text-on-dark);
  font-weight: 600;
}
.nav-item.has-active-alerts:not(.active) {
  color: var(--color-brand);
}
.nav-item.has-active-alerts .nav-icon {
  animation: pulse-alert 1s ease-in-out infinite;
}
@keyframes pulse-alert {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  pointer-events: none;
  display: block;
  align-self: center;
}

/* Marks a surface (nav item, settings group) as admin-only. Sits to the right
   of the label text; its inline-flex wrapper keeps it vertically centered with
   the text across the different label sizes (vertical-align is the fallback). */
.admin-shield {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  margin-left: 6px;
  color: var(--color-accent-gold);
  vertical-align: middle;
  pointer-events: none;
}

/* Marks a control as an instance-gated feature not yet available on every
   instance (see shared-utils/config/instance-features.js). The beaker reads as
   "still rolling out"; its title attribute names where it's available. */
.feature-flask {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 6px;
  color: var(--color-tier-beta);
  vertical-align: middle;
  cursor: help;
}
.feature-flask svg {
  width: 14px;
  height: 14px;
}

/* Inline-flex wrapper around a label + its trailing admin shield, so the shield
   centers on the text regardless of the label's font size / line-height. */
.nav-item-label {
  display: inline-flex;
  align-items: center;
}
.nav-logo-icon {
  object-fit: contain;
  opacity: 0.45;
  transition: opacity 0.15s;
}
.nav-vendor-toggle:hover .nav-logo-icon,
.nav-vendor-toggle:not(.collapsed) .nav-logo-icon {
  opacity: 0.9;
}
.nav-external-icon {
  width: 12px;
  height: 12px;
  margin-left: auto;
  opacity: 0.5;
  flex-shrink: 0;
}
.nav-item-link:hover .nav-external-icon {
  opacity: 0.8;
}
.nav-sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease-in-out;
}
.nav-sub.open {
  grid-template-rows: 1fr;
}
.nav-sub-inner {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
  overflow: hidden;
}
.nav-sub-label {
  padding: 12px 20px 4px 34px;
  font-size: var(--font-s);
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.nav-sub-item {
  display: flex;
  align-items: center;
  padding: 8px 20px 8px 28px;
  margin: 0 12px 0 18px;
  width: calc(100% - 30px);
  font-size: var(--font-l);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border-radius: 8px;
}
.nav-sub-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}
.nav-sub-item.active {
  color: var(--color-text-on-dark);
  font-weight: 600;
  background: var(--color-burgundy);
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 24px 32px;
  min-width: 0;
}
.section { display: block; }

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--color-brand);
}
.header h1 { font-size: var(--font-xxl); font-weight: 700; color: var(--color-text-primary); text-transform: uppercase; }
.header { align-items: center; }
.header-meta { display: flex; align-items: center; gap: 12px; }

/* Single icon-only "docs" link used everywhere: next to the page title
   (`#section-docs-link`), next to settings card headings (Slack, CrUX,
   etc.), and beside the Site Alert Configurations panels. Same look in
   every spot so the affordance reads as one consistent thing. */
.docs-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--color-text-muted);
  text-decoration: none;
  vertical-align: middle;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.docs-help-icon:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
}
.docs-help-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.docs-help-icon[hidden] { display: none; }

/* Page-header docs link sits next to the <h1> and pushes the .header-meta
   block to the far right (overriding the .header's space-between). */
#section-docs-link {
  margin-left: 12px;
  margin-right: auto;
}

/* Wraps a settings card with its docs link so the icon sits in a thin
   column to the right of the card, vertically aligned with the card's
   header toggle. The card flexes to fill the remaining width and the
   docs-icon column is fixed-width so the column of icons aligns
   vertically down the page across all the wrapped cards. */
.settings-card-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
}
.settings-card-row > .card {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
  margin-top: 0;
}
.settings-card-row > .docs-help-icon {
  /* Card has 20px padding-top + a ~20px header (the toggle is 20px); icon
     top at 19px puts its center at y=30, aligned with the toggle's center. */
  margin-top: 19px;
}
.header-meta-text { text-align: right; }
.header-meta-line { font-size: var(--font-m); color: var(--color-text-secondary); line-height: 1.2; }
.header-meta-next { color: var(--color-text-muted); }
.title-site { color: var(--color-brand); font-style: italic; }
.section-subtitle { color: #ff0000; font-style: italic; }

/* Device toggle */
.device-toggle {
  display: inline-flex;
  gap: 1px;
  align-items: center;
  background: var(--color-border);
  border-radius: var(--radius-input);
  overflow: hidden;
  margin-left: 16px;
}
/* Legacy class kept for any callsite that still toggles `.visible`. */
.device-toggle.visible { display: inline-flex; }
/* The `hidden` attribute is the toggle's off-switch (it's created hidden and
   revealed only on the Performance dashboard). The base `display` above would
   otherwise beat the UA `[hidden]` rule, leaving it visible on every other page
   — restore it so `hidden` actually hides. */
.device-toggle[hidden] { display: none; }
.device-toggle-icon {
  display: flex;
  align-items: center;
  padding: 0 8px 0 12px;
  color: var(--color-text-secondary);
}
.filter-row-sticky {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  padding-bottom: 12px;
  margin-top: 50px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg-body);
}
.filter-row-sticky:empty {
  display: none;
}

#overview-details-section {
  padding-top: 16px;
}

/* ============================================================================
 * Site Alert Configurations card
 * Used by the Orders page; reusable for any future per-site config sections.
 * Prefixed `site-cfg-*` to avoid colliding with the older `alert-cfg-*`
 * classes used by the Settings → Alerts page (see further down).
 * ============================================================================ */

.site-cfg-card { margin-bottom: 24px; }

.site-cfg-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}
.site-cfg-toggle-title {
  font-size: var(--font-l);
  font-weight: 600;
  color: var(--color-text-primary);
}
/* Left-aligned caret matching the entity-card: points right collapsed, down when
   expanded. (Larger section padding is kept via the surrounding `.card`.) */
.site-cfg-chevron {
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}
.site-cfg-toggle[aria-expanded="true"] .site-cfg-chevron {
  transform: rotate(45deg);
}

.site-cfg-body {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
  /* Full-bleed the divider to the card edges (counteract .card's 24px side
     padding) so it spans full width like the entity-card body border. */
  margin-left: -24px;
  margin-right: -24px;
  padding-left: 24px;
  padding-right: 24px;
}

.site-cfg-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.site-cfg-chart-wrap {
  flex: 1 1 480px;
  min-width: 0;
  padding-bottom: 20px;
}

.site-cfg-panel {
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
  color: var(--color-text-secondary);
  text-align: right;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
}
.site-cfg-panel-title {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: left;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 4px;
}

.site-cfg-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}
.site-cfg-input {
  width: 90px;
  padding: 3px 6px;
  background: var(--color-bg-body);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-compact);
  color: inherit;
  text-align: right;
}
/* Weekday preview selector at the top of a config panel — picks which
   day-of-week's baseline the chart previews; the config knobs stay global. */
.site-cfg-select {
  width: 130px;
  padding: 3px 6px;
  background: var(--color-bg-body);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-compact);
  color: inherit;
  text-align: right;
}
.site-cfg-weekday-field {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 4px;
}
.site-cfg-rec-hint {
  font-size: 10.5px;
  font-style: italic;
}

.site-cfg-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-top: 6px;
}
.site-cfg-actions .btn-primary,
.site-cfg-actions .btn-ghost {
  font-size: 12px;
  padding: 6px 12px;
}
.site-cfg-status {
  font-style: italic;
  color: var(--color-text-secondary);
  text-align: right;
}

.site-cfg-explainer {
  margin-top: 18px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--color-text-secondary);
  background: var(--color-bg-body);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 14px 16px;
}
.site-cfg-explainer-title {
  color: var(--color-text-primary);
  font-weight: 600;
  margin-bottom: 6px;
}
.site-cfg-explainer-list {
  margin: 0;
  padding-left: 18px;
}
.site-cfg-explainer p { margin: 8px 0 0; }
.site-cfg-explainer p.first { margin-top: 0; }
.site-cfg-explainer .note { color: var(--color-success); }
.site-cfg-explainer .alert { color: #ff6b6b; }
.site-cfg-explainer .closing { font-style: italic; margin-top: 8px; }

.site-cfg-explainer-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}
.site-cfg-explainer-section p > strong { color: var(--color-text-primary); }
.site-cfg-settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.site-cfg-settings-table th,
.site-cfg-settings-table td {
  padding: 6px 8px;
  vertical-align: top;
}
.site-cfg-settings-table thead tr {
  text-align: left;
  color: var(--color-text-primary);
}
.site-cfg-settings-table th {
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
}
.site-cfg-settings-table th.col-setting,
.site-cfg-settings-table td.col-setting { width: 130px; color: var(--color-text-primary); }
.site-cfg-settings-table th.col-when,
.site-cfg-settings-table td.col-when { width: 170px; }

@container alert-configs (max-width: 760px) {
  .site-cfg-panel { width: 100% !important; }
}

/* When a collapsible heading is also a sticky section header (e.g. Page
   Type Breakdown), pin it to the top of the viewport when scrolled past. */
.collapsible-heading.sticky-section-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg-body);
  margin-top: 24px;
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.device-btn {
  padding: 4px 16px;
  font-size: var(--font-m);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.device-btn:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.device-btn.active { color: var(--color-brand); font-weight: 600; background: rgba(255, 0, 0, 0.08); }

/* URL list */
.url-list {
  margin-bottom: 24px;
}
.url-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--color-bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  margin-bottom: 8px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.url-row:hover { border-color: var(--color-border-accent); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.url-row.active { border-color: var(--color-text-on-dark); box-shadow: 0 2px 8px rgba(255,255,255,0.12); }
.url-row::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: translateY(-50%) rotate(45deg);
  transition: transform 0.2s;
  pointer-events: none;
}
.url-row:hover::after { border-color: var(--color-text-secondary); }
.url-row.active::after { transform: translateY(-50%) rotate(-135deg); border-color: var(--color-text-on-dark); }
.url-row .url-path {
  font-weight: 600;
  font-size: var(--font-l);
  width: 300px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text-primary);
}
.url-row .url-metrics {
  display: flex;
  gap: 20px;
  font-size: var(--font-l);
}
.url-row .url-metric-label { color: var(--color-text-secondary); margin-right: 4px; }
.url-external-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  margin-left: auto;
  margin-right: 20px;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.url-external-link:hover {
  color: var(--color-text-primary);
  background: rgba(255,255,255,0.08);
}
.url-row.no-data-row { opacity: 0.5; cursor: default; }
.url-row.no-data-row:hover { border-color: var(--color-border); box-shadow: none; }
.url-row.no-data-row::after { display: none; }
.no-data-label { color: var(--color-text-secondary); font-style: italic; }
.url-row-expand {
  margin-bottom: 8px;
}
.url-row-expand .kpi-row {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 16px;
}
.url-row-expand .collapsible-heading {
  margin-top: 8px;
}
.url-row-expand .trend-panel {
  background: var(--color-bg-card);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  border: 1px solid var(--color-border);
}
.url-row-expand .trend-panel h2 {
  font-size: var(--font-l);
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--color-text-primary);
}

/* KPI row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 0;
}
.kpi-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.kpi-card::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s;
  pointer-events: none;
}
.kpi-card:hover::after { border-color: var(--color-text-secondary); }
.kpi-card.active::after { transform: rotate(-135deg); border-color: var(--color-brand); }
.kpi-card:hover { border-color: var(--color-border-accent); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.kpi-card.active { border-color: var(--color-brand); box-shadow: 0 2px 8px rgba(255,0,0,0.12); }
.trend-expand {
  margin-bottom: 24px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.trend-expand:empty { margin-bottom: 24px; }
.trend-expand .trend-panel {
  background: var(--color-bg-card);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  margin-top: 16px;
  border: 1px solid var(--color-border);
}
.trend-panel h2 {
  font-size: var(--font-l);
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--color-text-primary);
}
.kpi-card .kpi-label {
  font-size: var(--font-l);
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}
.kpi-card .kpi-value {
  font-size: var(--font-xxl);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text-primary);
}
/* === Badges =================================================================
   One shared inline status marker. Shape lives on `.badge`; hue on a
   `.badge-<state>` modifier (good / warning / poor / info / neutral). Bordered,
   lightly-tinted fill, compact radius — the Uptime / Vendor Status look.
   Width is intrinsic: the base never forces a fixed width; callers that need
   column alignment (vendor header stats, uptime card slot) add a local
   min-width. Add `.badge-uppercase` for tiny uppercased labels (roles,
   override state). */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-compact);
  font-size: var(--font-m);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.badge-good    { background: rgba(63, 185, 80, 0.15);   color: var(--color-success);        border-color: rgba(63, 185, 80, 0.3); }
.badge-warning { background: rgba(210, 153, 34, 0.15);  color: var(--color-warning);        border-color: rgba(210, 153, 34, 0.3); }
.badge-poor    { background: rgba(248, 81, 73, 0.15);   color: var(--color-danger);         border-color: rgba(248, 81, 73, 0.3); }
.badge-info    { background: rgba(0, 83, 203, 0.15);    color: var(--color-info);           border-color: rgba(0, 83, 203, 0.3); }
.badge-neutral { background: rgba(139, 148, 158, 0.15); color: var(--color-text-secondary); border-color: rgba(139, 148, 158, 0.3); }
.badge-uppercase { text-transform: uppercase; letter-spacing: 0.5px; }
.perf-site-list { color: #6e7681; font-weight: 400; }

/* Chart row */
.chart-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(300px, calc(33.33% - 11px)), 1fr));
  gap: 16px;
}
.chart-row.half-row {
  grid-template-columns: 1fr 1fr;
}
/* Orders charts row: auto-fit so charts wrap to one column whenever they
   would otherwise be < 500px wide. Cards stretch to equal height via grid
   stretch + align-items; the chart inside keeps its natural aspect ratio
   and any extra card height shows as empty space at the bottom of the
   shorter chart. min-width: 0 lets the cards actually shrink inside their
   grid track. */
.orders-charts-row {
  margin-bottom: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
  align-items: stretch;
}
.orders-charts-row > .card {
  min-width: 0;
  height: 100%;
  position: relative;
}
/* When a chart card is toggled full-width, span the entire grid row so the
   sibling card drops to the next row. Chart.js + the resize-fix plugin
   pick up the new parent width via ResizeObserver and redraw. */
.orders-charts-row > .card.fullwidth { grid-column: 1 / -1; }

/* Top-right toggle button. Two SVGs swap visibility based on `.fullwidth`. */
.card-fullwidth-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 1px solid var(--color-border-accent);
  border-radius: 4px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.card-fullwidth-toggle:hover {
  color: var(--color-text-primary);
  border-color: var(--color-text-muted);
}
.card-fullwidth-toggle .icon-collapse { display: none; }
.card.fullwidth .card-fullwidth-toggle .icon-expand { display: none; }
.card.fullwidth .card-fullwidth-toggle .icon-collapse { display: block; }
.chart-row > .trend-expand,
.full-row {
  grid-column: 1 / -1;
}
.chart-wrap.padded { padding-bottom: 20px; }
.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  border: 1px solid var(--color-border);
}
.card.clickable,
.card.card-expandable {
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card.clickable::after,
.card.card-expandable::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 24px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s;
  pointer-events: none;
}
.card.clickable:hover,
.card.card-expandable:hover { border-color: var(--color-border-accent); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.card.clickable:hover::after,
.card.card-expandable:hover::after { border-color: var(--color-text-secondary); }
.card.clickable.active,
.card.card-expandable.active { border-color: var(--color-brand); box-shadow: 0 2px 8px rgba(255,0,0,0.12); }
.card.clickable.active::after,
.card.card-expandable.active::after { transform: rotate(-135deg); border-color: var(--color-brand); }
.card h2 {
  font-size: var(--font-l);
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-text-primary);
}
.device-card-avg { font-weight: 400; color: #fff; font-size: var(--font-l); }
.nav-summary { display: flex; gap: 16px; justify-content: center; font-weight: 400; padding: 8px 0 0; }
.nav-legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.nav-fast-dot { background: var(--color-success); }
.nav-slow-dot { background: var(--color-danger); }
.nav-fast { color: var(--color-success); }
.nav-slow { color: var(--color-danger); }
/* Card-header badge floats to the right of the heading; shape from `.badge`. */
.card h2 .badge {
  float: right;
  margin-top: 2px;
  margin-right: 20px;
}
.chart-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 12px;
  padding-top: 8px;
  font-size: var(--font-l);
  color: var(--color-text-secondary);
  line-height: 1.4;
}
.chart-wrap {
  position: relative;
}
.trend-expand .chart-wrap,
.url-row-expand .chart-wrap {
  border-radius: 8px;
  padding: 12px;
}

/* Table */
.table-card-wrap { position: relative; margin-bottom: 24px; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.table-card-wrap > .table-card { flex: 1; }
.table-card-wrap > .scroll-fade { position: absolute; top: 0; right: 0; bottom: 0; width: 32px; background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.15)); pointer-events: none; z-index: 2; border-radius: 0 var(--radius-card) var(--radius-card) 0; opacity: 0; transition: opacity 0.3s ease; }
.table-card-wrap.is-scrollable > .scroll-fade { opacity: 1; }
.table-card-wrap.scrolled-end > .scroll-fade { opacity: 0; }
.table-card { margin-bottom: 0; overflow-x: auto; position: relative; scrollbar-width: none; }
.table-card-wrap .table-card { border-radius: var(--radius-card); }
.table-card::-webkit-scrollbar { display: none; }
/* Unwrapped table-cards (fallback) */
.table-card:not(.table-card-wrap .table-card) { margin-bottom: 24px; }
.table-card h2 {
  font-size: var(--font-l);
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-text-primary);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-l);
}
th {
  text-align: left;
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: var(--font-m);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
}
td {
  padding: 12px;
  border-bottom: 1px solid var(--color-bg-card);
  color: var(--color-text-tertiary);
}
tr:last-child td { border-bottom: none; }
.cartridges {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sandbox credits section */
.credits-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  margin-bottom: 24px;
}
.credit-summary { display: flex; flex-direction: column; gap: 16px; }
.credit-stat {
  border-radius: 8px;
  padding: 12px 16px;
  border-left: 4px solid transparent;
}
.credit-stat.stat-warn {
  border-left-color: var(--color-warning);
  background: rgba(210, 153, 34, 0.1);
}
.credit-stat.stat-error {
  border-left-color: var(--color-danger);
  background: rgba(248, 81, 73, 0.1);
}
.credit-stat .stat-label { font-size: var(--font-l); color: var(--color-text-secondary); margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.credit-stat .stat-value { font-size: var(--font-xxl); font-weight: 700; color: var(--color-text-primary); }
.credit-stat .stat-sub { font-size: var(--font-l); color: var(--color-text-secondary); margin-top: 2px; }
.section-title {
  font-size: var(--font-xl);
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 16px;
  color: var(--color-text-primary);
}

/* Inline cell warnings */
.cell-warning {
  background: rgba(210, 153, 34, 0.15);
  border-radius: var(--radius-input);
  padding: 4px 8px;
  display: inline-block;
  color: var(--color-warning);
}
.card-explainer-note {
  margin: 0 16px 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-warning);
  background: rgba(210, 153, 34, 0.08);
  border-left: 3px solid var(--color-warning);
  border-radius: var(--radius-input);
}
.card-explainer-note strong { color: var(--color-warning); }

.cell-critical {
  background: rgba(248, 81, 73, 0.15);
  border-radius: var(--radius-input);
  padding: 4px 8px;
  display: inline-block;
  color: var(--color-danger);
}
.cell-ok {
  padding: 4px 8px;
  display: inline-block;
}
.schedule-days { color: var(--color-text-secondary); margin-top: 2px; }
.storage-bar-wrap {
  width: 80px;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}
.storage-bar-fill { height: 100%; border-radius: 3px; }
.storage-row { display: flex; align-items: center; gap: 4px; font-size: var(--font-l); margin-bottom: 2px; color: var(--color-text-tertiary); }
.storage-row:last-child { margin-bottom: 0; }

/* Action buttons */
.btn-start {
  font-size: var(--font-m);
  font-weight: 600;
  padding: 4px 12px;
  border: none;
  border-radius: var(--radius-input);
  cursor: pointer;
  background: var(--color-text-on-dark);
  color: var(--color-bg-body);
  transition: opacity 0.15s;
}
.btn-start:hover { opacity: 0.85; }
.btn-start:disabled { opacity: 0.4; cursor: default; }
.btn-stop { background: var(--color-danger); color: var(--color-bg-body); }
.btn-start-error {
  color: var(--color-danger);
  margin-top: 4px;
}

/* Info tooltip */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.info-tip .info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-text-muted);
  color: #fff;
  font-size: var(--font-s);
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
}
.info-tip .info-text {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-border-accent);
  color: var(--color-text-primary);
  font-weight: 400;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: normal;
  min-width: 260px;
  max-width: 360px;
  margin-bottom: 4px;
  z-index: 10;
}
.info-tip:hover .info-text { display: block; }

/* Metric description under chart */
.card-metric-desc {
  color: var(--color-text-secondary);
  padding: 8px 0 0;
  margin-top: 8px;
  border-top: 1px solid var(--color-border);
  line-height: 1.4;
}
.card-metric-desc strong {
  color: var(--color-text-tertiary);
}

/* Nav glossary */
.nav-glossary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.nav-glossary-toggle {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: var(--font-m);
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.nav-glossary-toggle::before {
  content: '\25B8';
  display: inline-block;
  margin-right: 4px;
  transition: transform 0.2s;
}
.nav-glossary.open .nav-glossary-toggle::before {
  transform: rotate(90deg);
}
.nav-glossary-toggle:hover { color: var(--color-text-primary); }
.nav-glossary-content {
  display: none;
  margin-top: 8px;
  padding-left: 2px;
}
.nav-glossary.open .nav-glossary-content {
  display: block;
}
.nav-glossary-item {
  color: var(--color-text-secondary);
  line-height: 1.6;
}
.nav-glossary-term {
  color: var(--color-text-tertiary);
  font-weight: 600;
}


/* Timezone label in the sidebar, below the Documentation link */
.nav-timezone {
  padding: 12px 20px;
  margin-top: auto;
}
.nav-timezone .footer-timezone {
  color: var(--color-text-muted);
  font-size: var(--font-s);
}

/* Refresh button */
.refresh-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: var(--font-xl);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  font-family: inherit;
}
.refresh-btn:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.08);
}
.refresh-btn:disabled {
  cursor: default;
  opacity: 0.5;
}
.refresh-btn.loading {
  animation: spin 0.8s linear infinite;
}
.refresh-error {
  color: var(--color-danger);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* About CrUX collapsible */
.crux-about {
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}
.crux-about-updated {
  color: var(--color-text-muted);
}
.crux-about-toggle {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: var(--font-l);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s;
}
.crux-about-toggle:hover { color: var(--color-text-primary); }
.crux-header-row:hover .crux-about-toggle { color: var(--color-text-primary); }
.crux-header-row.open .crux-about-toggle { color: var(--color-brand); }
.crux-header-row.open .crux-about-toggle .collapse-caret {
  transform: rotate(-135deg);
  border-color: var(--color-brand);
}
.crux-about-content {
  display: none;
  margin-top: 12px;
}
.crux-about.open .crux-about-content {
  display: block;
}
.crux-about-content p {
  font-size: var(--font-l);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.crux-about-content p:last-child {
  margin-bottom: 0;
}
.crux-about-content strong {
  color: var(--color-text-tertiary);
}
.crux-thresholds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-l);
  margin: 8px 0 12px;
}
.crux-thresholds-table th,
.crux-thresholds-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.crux-thresholds-table th {
  color: var(--color-text-tertiary);
  font-weight: 600;
}
.crux-thresholds-table td {
  color: var(--color-text-secondary);
}
.crux-thresholds-table td:first-child {
  color: var(--color-text-tertiary);
  font-weight: 600;
}

/* Details accordion */
.details-toggle {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  cursor: pointer;
  position: relative;
  margin-top: 32px;
  margin-bottom: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.details-toggle:hover { border-color: var(--color-border-accent); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.details-toggle.active { border-color: var(--color-text-on-dark); box-shadow: 0 2px 8px rgba(255,255,255,0.12); }
.details-toggle::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: translateY(-50%) rotate(45deg);
  transition: transform 0.2s;
  pointer-events: none;
}
.details-toggle:hover::after { border-color: var(--color-text-secondary); }
.details-toggle.active::after { transform: translateY(-50%) rotate(-135deg); border-color: var(--color-text-on-dark); }
.details-toggle .details-label {
  font-size: var(--font-l);
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
}
.details-summary {
  display: flex;
  align-items: center;
  gap: 16px;
}
.details-summary .ff-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-l);
  color: var(--color-text-tertiary);
}
.ff-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ff-bar {
  width: 200px;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  background: var(--color-border);
}
.ff-bar span { height: 100%; }
.details-expand {
  display: none;
  margin-bottom: 24px;
}
.details-expand.open {
  display: block;
}
.details-expand .chart-row {
  margin-top: 16px;
}

/* CrUX trend grid */
.trend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.trend-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  border: 1px solid var(--color-border);
}
.trend-card h3 {
  font-size: var(--font-l);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}
.trend-card .trend-value {
  font-size: var(--font-xxl);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text-primary);
}
.trend-card .trend-delta {
  font-weight: 600;
  margin-left: 8px;
}
.trend-delta.improved { color: var(--color-success); }
.trend-delta.regressed { color: var(--color-danger); }
.trend-delta.flat { color: var(--color-text-secondary); }

/* Usage KPI row — no carets, no pointer, spacing below */
/* Uptime section */
#section-uptime .kpi-row { grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; }
.inventory-kpi-row { grid-template-columns: repeat(3, 1fr); margin-bottom: 24px; }
.kpi-card-static { cursor: default; }
.kpi-card-static::after { display: none; }
.kpi-card-static:hover { border-color: var(--color-border); box-shadow: none; }

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.status-up { background: var(--color-success); }
.status-blocked { background: var(--color-warning); }
.status-down { background: var(--color-danger); }
.status-pending { background: var(--color-text-muted); }
.url-cell { word-break: break-all; max-width: 500px; }

/* Uptime entity-card header: the right-aligned status pill (Up / Down / Blocked /
   Unreachable / Pending), styled like the Vendor Status "Operational" badge. The
   slot owns the fixed column width so every row's status lines up column-style
   down the list; the badge flexes to fill it. On a Blocked row the slot also
   holds a docs help icon, and the badge shrinks so badge + icon together still
   occupy exactly one column (right edge aligned with the other rows' badges).
   Colors key off the same status-* classes uptimeState() returns. */
.uptime-status-slot {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 104px;
}
/* The badge flexes to fill the fixed-width slot (color from a `.badge-*`
   modifier the renderer picks per state). */
.uptime-status-slot .badge { flex: 1 1 auto; min-width: 0; }
/* Compact the shared docs help icon for this inline-in-slot context so it sits
   snugly beside the badge without making the row taller. */
.uptime-status-slot .docs-help-icon { width: 18px; height: 18px; }
.uptime-status-slot .docs-help-icon svg { width: 14px; height: 14px; }
/* Keep the URL + status badge on a single line: the URL takes the free space
   and truncates with an ellipsis rather than wrapping the badge to its own row
   (the base entity-card header wraps, which suits the multi-stat vendor cards
   but not this single-badge one). */
.uptime-card .entity-card-header { flex-wrap: nowrap; }
.uptime-card .entity-card-main { flex: 1; min-width: 0; }
.uptime-card-url { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Mobile: drop the fixed slot width (column alignment only matters on wide
   screens) so the status stays snug next to a narrow row. */
@media (max-width: 768px) {
  .uptime-status-slot { min-width: 0; }
}
/* A `.card` whose body is an `.entity-card-list` (Uptime sites/monitoring,
   System Health's System Uptime). The plain `.card` has no bottom margin — the
   old `.table-card` these replaced supplied the 24px gap between stacked cards,
   so restore it here. */
.card-entity-list { margin-bottom: 24px; }
/* The expanded incident's event-log body. It connects flush beneath its row
   (which becomes the card header): the -8px top margin closes the table's
   row-gap so the two share one continuous outline, and the header row's bottom
   border serves as the single divider (hence no top border here). */
.resp-detail-content {
  background: var(--color-bg-body);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-input) var(--radius-input);
  margin: -8px 0 0;
  padding: 12px 16px;
}
.resp-detail-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  font-size: var(--font-l);
  border-bottom: 1px solid var(--color-bg-card);
}
.resp-detail-item:last-child { border-bottom: none; }
.resp-detail-label {
  color: var(--color-text-secondary);
  min-width: 100px;
  flex-shrink: 0;
  font-weight: 500;
}
.resp-header-name { color: var(--color-text-secondary); }
.resp-body-snippet {
  margin: 0;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
}

/* Vendor status detail panel (components + active incidents) */
.vendor-detail-section { margin-bottom: 12px; }
.vendor-detail-section:last-child { margin-bottom: 0; }
.vendor-detail-heading {
  display: block;
  color: var(--color-text-primary);
  font-size: var(--font-l);
  font-weight: 600;
  margin-bottom: 6px;
}
.vendor-detail-hint {
  color: var(--color-text-secondary);
  font-size: var(--font-m);
  font-weight: 400;
}
/* External-link icon + monitoring toggle cluster in a vendor card's header. */
.vendor-row-actions { display: flex; align-items: center; gap: 12px; }

/* === Expandable entity card ===
   The condensed Sites card pattern promoted to a shared component: a single-line
   header (12px 16px) you click to expand a collapsed, recessed body. Vendor
   Status uses it now; Uptime and Alerts adopt it next so all expandable lists
   read as one system. */
.entity-card-list { display: flex; flex-direction: column; gap: 8px; }
/* Config-panel cards (Orders/Inventory "Site Alert Configurations") aren't in an
   .entity-card-list, so preserve their prior inter-card spacing. */
.entity-card[data-cfg-section] { margin-top: 12px; }
.entity-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  background: var(--color-bg-card);
  overflow: hidden;
}
.entity-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 16px;
}
.entity-card-header-expandable { cursor: pointer; user-select: none; }
.entity-card-header-expandable:hover { background: var(--color-bg-hover); }
.entity-card-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.entity-card-title { font-weight: 600; color: var(--color-text-primary); white-space: nowrap; }
.entity-card-meta { display: flex; align-items: center; gap: 12px; flex: none; }
.entity-card-caret {
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}
.entity-card-header-expandable.expanded .entity-card-caret {
  transform: rotate(45deg);
  border-color: var(--color-brand);
}
.entity-card-caret.is-hidden { visibility: hidden; }
.entity-card-body {
  background: var(--color-bg-body);
  border-top: 1px solid var(--color-border);
  padding: 12px 16px 14px;
}
.entity-card-body.collapsed { display: none; }
/* Warm variant (Settings cards) — a warm surface so config cards stand out from
   the blue-gray data surfaces. The body shares the card's warm fill (with the
   header divider) rather than the recessed dark body. */
.entity-card-warm { background: var(--color-bg-card-warm); }
.entity-card-warm .entity-card-header-expandable:hover { background: var(--color-bg-hover-warm); }
.entity-card-warm .entity-card-body { background: transparent; }
/* Vendor-card header bits. */
.vendor-card-category { font-size: var(--font-m); }
/* Labeled status stats in the header: "Vendor Status [badge]" / "API Status [badge]".
   Fixed-width badges (based on the longest label) so the two stats line up
   column-style across every card. */
.vendor-card-stat { display: inline-flex; align-items: center; gap: 6px; }
.vendor-card-stat-label { font-size: var(--font-m); color: var(--color-text-secondary); }
.vendor-card-stat .status-badge { display: inline-block; min-width: 116px; text-align: center; }
/* Fixed-width priority select + a reserved external-link slot keep the action
   cluster aligned across cards whether or not a vendor has a status-page link. */
.vendor-priority-select { width: 68px; }
.vendor-link-slot { display: inline-flex; align-items: center; justify-content: center; width: 20px; flex: none; }
.vendor-card-comingsoon { color: var(--color-text-muted); font-size: var(--font-m); }
.vendor-card-dimmed { opacity: 0.5; }
/* Restore the gap between the Subscribed and Unsubscribed vendor cards (the old
   table-card fallback provided this before the card refactor). */
#vendor-status-table-card { margin-bottom: 24px; }
/* Tablet / narrow desktop: the vendor card's fixed-width status stats + controls
   don't fit beside the name, so hard-stack them to a second row. Scoped to
   `.vendor-card` — other entity-cards (e.g. alert config) have a light meta that
   fits inline, and the base header's `flex-wrap` lets it drop to a second row
   only when it genuinely overflows, so they get no needless extra row here.
   Uses the app's 1200px "narrow desktop" breakpoint. */
@media (max-width: 1200px) {
  .vendor-card .entity-card-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .vendor-card .entity-card-meta { flex-wrap: wrap; justify-content: flex-start; }
}
/* Mobile: relax the fixed badge width (the column alignment only matters on wide
   screens) so the two stats fit side by side on a narrow row. */
@media (max-width: 768px) {
  .vendor-card-stat .status-badge { min-width: 0; }
}
.vendor-component-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
}
.vendor-component-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  font-size: var(--font-l);
  color: var(--color-text-tertiary);
}
.vendor-component-item.is-group { font-weight: 600; color: var(--color-text-primary); }
/* A group with leaves is a column: its header row plus a collapsible leaf list. */
.vendor-component-item.is-group.has-children {
  flex-direction: column;
  align-items: stretch;
}
.vendor-component-grouphead {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vendor-component-caret,
.vendor-detail-caret {
  flex: none;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vendor-component-caret::before,
.vendor-detail-caret::before {
  content: '';
  border-style: solid;
  border-width: 4px 0 4px 6px;
  border-color: transparent transparent transparent currentColor;
  transition: transform 0.12s ease;
}
.vendor-component-caret.expanded::before,
.vendor-detail-caret.expanded::before { transform: rotate(90deg); }
/* Collapsible detail sub-section header (Monitored Endpoints / Vendor
   Components): caret + heading on the left, status badge right-aligned (8px
   inset to match the rows revealed below it). */
.vendor-detail-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 8px 0 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.vendor-detail-toggle .vendor-detail-heading { margin-bottom: 0; }
.vendor-detail-badge { margin-left: auto; display: inline-flex; align-items: center; }
.vendor-detail-since { font-size: var(--font-m); margin-left: 8px; }
.vendor-detail-body { margin-top: 6px; }
/* Frame the Monitored Endpoints / Vendor Components / Active Incidents sections
   as outlined panels so they read as a grouped unit, set apart from the empty
   state. Transparent fill keeps the row zebra intact. */
.vendor-detail-collapsible {
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-input);
  padding: 6px 8px;
  margin-bottom: 8px;
}
.vendor-detail-collapsible:last-child { margin-bottom: 0; }
/* Monitored-endpoint rows: URL (truncated) + per-endpoint status badge. */
.vendor-endpoint-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vendor-endpoint-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  /* Left inset (caret 16 + gap 8 + base 8) lines the URL up with the component
     names in the Vendor Components tree, which sit past the group caret. */
  padding: 4px 8px 4px 32px;
  font-size: var(--font-l);
}
.vendor-endpoint-list > .vendor-endpoint-item:nth-child(even) { background: var(--color-bg-card); }
.vendor-endpoint-url {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-secondary);
  text-decoration: none;
}
.vendor-endpoint-url:hover { text-decoration: underline; }
.vendor-component-children {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}
/* A class display rule outranks the UA [hidden] rule, so restore it explicitly. */
.vendor-component-children[hidden] { display: none; }
.vendor-component-item.is-leaf {
  padding-left: 32px;
  font-weight: 400;
  color: var(--color-text-tertiary);
}
/* Zebra striping. Top-level rows (groups + ungrouped items) alternate among
   themselves; leaves alternate independently within their own group. A group
   with children stripes only its header row, so the stripe doesn't bleed over
   the expanded leaf list below it. */
.vendor-component-list > .vendor-component-item:not(.has-children):nth-child(even) { background: var(--color-bg-card); }
.vendor-component-list > .vendor-component-item.has-children:nth-child(even) > .vendor-component-grouphead { background: var(--color-bg-card); }
.vendor-component-children > .vendor-component-item:nth-child(even) { background: var(--color-bg-card); }

/* Right-align a group header's status badge to match leaf/top rows (which get it
   from .vendor-component-item's space-between / .vendor-component-check). In the
   non-selectable detail view the badge is a bare child of the grouphead with no
   such push, so it needs the margin explicitly. */
.vendor-component-grouphead .status-badge { margin-left: auto; }
.vendor-component-check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
}
.vendor-component-name { flex: none; }
/* Push the status badge (and the trailing checkbox) to the right — uniform
   across leaves, groups, and top-level rows. */
.vendor-component-check .status-badge { margin-left: auto; }
.vendor-incident {
  margin-top: 8px;
  padding: 10px;
  background: var(--color-bg-hover);
  border-radius: var(--radius-input);
  border-left: 3px solid var(--color-warning);
}
.vendor-incident.is-major { border-left-color: var(--color-danger); }
.vendor-incident-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.vendor-incident-title {
  color: var(--color-text-primary);
  font-size: var(--font-l);
  font-weight: 600;
}
.vendor-incident-update {
  margin-top: 6px;
  font-size: var(--font-m);
  color: var(--color-text-secondary);
}
.vendor-incident-update-status { color: var(--color-text-tertiary); }
.vendor-incident-link {
  color: var(--color-link);
  font-size: var(--font-m);
  margin-top: 4px;
  display: inline-block;
}
.vendor-detail-empty {
  color: var(--color-text-secondary);
  font-size: var(--font-l);
  padding: 8px 0;
}

/* Textarea for config fields */
.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: monospace;
  font-size: var(--font-l);
  line-height: 1.5;
}

/* Usage section */
#section-usage .kpi-row, #section-usage .chart-row { margin-bottom: 24px; }
#section-usage .chart-row { grid-template-columns: 1fr 1fr; }

/* Admin pages */

/* Nav items rendered as section-heading style (currently only System
   Health). Mirrors `.nav-section-label`'s uppercase + letter-spacing
   so the entry visually reads like a heading instead of a regular link,
   while staying a clickable button. */
.nav-item.nav-item-heading { text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.admin-form { margin-bottom: 24px; }
.admin-form h2 { margin-bottom: 12px; }
.admin-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-form-row .form-input { flex: 1; min-width: 140px; }
.admin-form-row .btn { flex-shrink: 0; }
.admin-table { width: 100%; }
.admin-table th { text-align: left; font-size: var(--font-m); color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.admin-table td { vertical-align: middle; }
/* Collector Heartbeats — grouped + expandable rows.
   The collector-name cell is an expand button (chevron + name) when the
   collector has per-account heartbeat rows; `.hb-name-plain` keeps the
   button-less (global-only) collectors aligned with it. The status cell can
   hold two badges — the global heartbeat's badge and a per-account rollup —
   so space them when both are present. */
.hb-status .badge + .badge { margin-left: 6px; }
.hb-expand-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
/* Expand caret — the shared entity-card caret: points right when collapsed,
   rotates down + brand-colored when the collector's per-account rows show. */
.hb-expand-btn:not(.collapsed) .entity-card-caret {
  transform: rotate(45deg);
  border-color: var(--color-brand);
}
/* Button-less (global-only) collectors align their name with the buttoned ones
   (7px caret + 6px gap). */
.hb-name-plain { padding-left: 13px; }
/* Nested per-account rows — hidden until the parent collector is expanded,
   their content indented so they read as detail under the collector row.
   `:first-child` keeps the indent ahead of the generic `.card-rows` cell
   padding that comes later in the sheet. */
tr.hb-account[hidden] { display: none; }
.card-rows tbody tr.hb-account > td.hb-account-name:first-child { padding-left: 26px; }
.hb-account-name code { color: var(--color-text-secondary); }
.admin-actions { white-space: nowrap; }
.admin-actions .btn { margin-left: 8px; }
.admin-welcome-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--color-text-secondary);
  font-size: var(--font-m);
}
.admin-2fa-cell { white-space: nowrap; }
.admin-2fa-cell .btn { margin-left: 8px; }
.admin-accounts-cell { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.account-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-border);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-card);
  padding: 2px 12px;
  font-size: var(--font-m);
  color: var(--color-text-tertiary);
}
.account-tag-remove {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--font-l);
  padding: 0 2px;
  line-height: 1;
}
.account-tag-remove:hover { color: var(--color-danger); }
.admin-assign-account-select {
  background: transparent;
  border: 1px dashed var(--color-border-accent);
  border-radius: var(--radius-card);
  padding: 2px 8px;
  font-size: var(--font-m);
  color: var(--color-text-secondary);
  cursor: pointer;
}
.admin-assign-account-select:hover { border-color: var(--color-text-muted); }
/* Role badge in the Users table — a `.badge .badge-uppercase` with its own hue
   pair (admin = blue, user = gray). `.admin-role-badge` is a marker for the
   inline-edit querySelector; shape/case come from the shared classes. */
.admin-role-admin { background: rgba(31, 111, 235, 0.15); color: #58a6ff; border-color: rgba(31, 111, 235, 0.3); }
.admin-role-user { background: rgba(139, 148, 158, 0.15); color: var(--color-text-secondary); border-color: rgba(139, 148, 158, 0.3); }
.form-input-sm { padding: 4px 8px; font-size: var(--font-l); }
.admin-edit-role { padding: 4px 8px; font-size: var(--font-l); background: var(--color-bg-body); color: var(--color-text-tertiary); border: 1px solid var(--color-border-accent); border-radius: var(--radius-input); }

#orders-hourly-card {
  margin-bottom: 24px;
}

/* Orders KPI row */
.orders-kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card .kpi-sub {
  color: var(--color-text-secondary);
  margin-top: 4px;
}
.kpi-card .kpi-multi {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.kpi-card .kpi-multi .kpi-item {
  display: flex;
  flex-direction: column;
}
.kpi-card .kpi-multi .kpi-item .sub-label {
  color: var(--color-text-secondary);
  margin-bottom: 2px;
}
.kpi-card .kpi-multi .kpi-item .sub-value {
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--color-text-primary);
}
/* Today vs avg KPI card layout */
.kpi-today-avg {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-top: 4px;
}
.kpi-trend {
  align-self: center;
}
.kpi-primary {
  display: flex;
  flex-direction: column;
}
.kpi-primary-value {
  font-size: var(--font-xxl);
  font-weight: 700;
  color: var(--color-text-primary);
}
.kpi-primary-label {
  color: var(--color-text-secondary);
}
.kpi-secondary {
  display: flex;
  flex-direction: column;
}
.kpi-secondary-value {
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--color-text-secondary);
}
.kpi-secondary-label {
  color: #6e7681;
}
.kpi-mid {
  display: flex;
  flex-direction: column;
}
.kpi-mid-value {
  font-size: var(--font-xxl);
  font-weight: 600;
  color: var(--color-text-tertiary);
}
.kpi-mid-label {
  color: var(--color-text-secondary);
}
/* Breakdown stats table below charts */
.breakdown-table {
  width: 100%;
  margin-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: var(--font-l);
}
.breakdown-table th {
  text-align: right;
  color: var(--color-text-secondary);
  font-weight: 500;
  padding: 8px 8px;
  font-size: var(--font-m);
}
.breakdown-table th:first-child {
  text-align: left;
}
.breakdown-table td {
  padding: 4px 8px;
  border-top: 1px solid var(--color-border);
}
.breakdown-table td:first-child {
  color: var(--color-text-primary);
}
.breakdown-table td:not(:first-child) {
  text-align: right;
  color: var(--color-text-tertiary);
}
.breakdown-table .col-today {
  background: rgba(29, 109, 227, 0.08);
  color: #58a6ff;
}
.breakdown-table th.col-today {
  color: #58a6ff;
}
/* Hourly progress summary below charts */
.hourly-progress {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.hourly-progress .progress-label {
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}
.hourly-progress .progress-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.hourly-progress .progress-item {
  color: var(--color-text-tertiary);
}
.hourly-progress .progress-item strong {
  color: var(--color-text-primary);
}
.no-data {
  padding: 40px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--font-l);
}
.no-data-alert {
  color: var(--color-danger);
  text-align: left;
  padding: 20px;
}
#sandbox-alert, #orders-alert, #code-versions-alert, #crux-alert {
  margin-bottom: 16px;
}
.order-alert-card {
  border-color: var(--color-brand);
  box-shadow: 0 2px 8px rgba(255,0,0,0.12);
}
.order-alert-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
}
.order-alert-link:hover {
  opacity: 0.85;
}
.no-data-alert div:first-child {
  font-weight: 600;
  margin-bottom: 8px;
}
.order-issue-list {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  color: var(--color-text-tertiary);
  font-size: var(--font-l);
}
.order-issue-list li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
}
.order-issue-list li .status-dot {
  flex-shrink: 0;
  align-self: center;
}
.order-issue-list .issue-text {
  min-width: 0;
}
.order-issue-time {
  color: var(--color-text-secondary);
  margin-top: 8px;
  display: block;
}

.no-account {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  color: var(--color-text-secondary);
}
.no-account h1 { color: var(--color-text-primary); font-size: var(--font-xxl); margin-bottom: 8px; }
.no-account p { font-size: var(--font-l); }

/* Overview page */
.overview-section-title {
  font-size: var(--font-l);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 24px 0 12px;
}
.overview-section-title.overall-title {
  margin-top: 0;
}
.crux-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-bottom: 12px;
  margin-bottom: 0;
  cursor: pointer;
}
.crux-header-row.with-divider {
  border-top: 2px solid var(--color-brand);
  padding-top: 16px;
}
.crux-header-row .overview-section-title {
  margin: 0;
  font-size: var(--font-xl);
}
.crux-page-label { font-size: var(--font-l); color: var(--color-text-secondary); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: normal; }
.crux-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.overview-title-date {
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-left: 8px;
  letter-spacing: 0;
  text-transform: none;
}
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
#overview-kpi-row {
  margin-bottom: 0;
}
#overview-charts {
  margin-bottom: 0;
}

/* ── Settings / Configurations ── */
.settings-card {
  margin-top: 16px;
}
/* Beta info callout — a left-bordered notice carrying a BETA badge and
   beta-blue text. Self-contained (doesn't depend on a `.tier-<key>`
   ancestor) so it reads consistently wherever it's used: the site-limit
   notice (Settings → Sites) and the voice-cap note (Settings → Alerts).
   Mirrors the left-border shape of `.card-explainer-note` in the beta palette. */
.beta-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: var(--font-m);
  line-height: 1.5;
  color: var(--color-tier-beta);
  background: var(--color-tier-beta-tint);
  border-left: 3px solid var(--color-tier-beta);
  border-radius: var(--radius-input);
}
/* Site-cap notice sits on its own line above the disabled Add Site button. */
.settings-limit-note { margin-bottom: 8px; }
.logout-wrap {
  margin-top: 24px;
}
.settings-card > .form-section-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.settings-card > .collapsible-body:not(.collapsed) {
  padding-top: 16px;
}
.settings-toolbar {
  margin-bottom: 16px;
}
.settings-form {
  margin-bottom: 0;
}
.settings-form h2 {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 20px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
/* Muted caption under a form / form-row (e.g. "ID is generated automatically"). */
.form-hint {
  color: var(--color-text-muted);
  font-size: var(--font-m);
  margin: 8px 0;
}
/* Monospace host/identifier shown in a table cell (e.g. the per-account DB host). */
.db-host {
  font-family: monospace;
  font-size: var(--font-m);
}
/* All checkboxes use burgundy for their checked fill. */
input[type="checkbox"] { accent-color: var(--color-brand); }

.form-input {
  width: 100%;
  padding: 8px 12px;
  font-size: var(--font-l);
  font-family: inherit;
  color: var(--color-text-primary);
  background: var(--color-bg-body);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select.form-input {
  padding-right: 36px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='%238b949e'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.form-input:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}
.form-input[readonly] {
  opacity: 0.5;
  cursor: not-allowed;
}
.form-input.input-error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 2px rgba(248, 81, 73, 0.2);
}
.field-error {
  color: var(--color-danger);
  margin-top: 4px;
}
.form-section-title {
  font-size: var(--font-l);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.form-section-title.collapsible {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title.collapsible:hover { color: var(--color-brand); }
.form-section-title.config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.config-header-label {
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Toggle switch */
.config-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
}
.config-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.config-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--color-border-accent);
  border-radius: 10px;
  transition: background 0.2s;
}
.config-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--color-text-secondary);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.config-toggle input:checked + .config-toggle-track {
  background: rgba(255, 0, 0, 0.3);
}
.config-toggle input:checked + .config-toggle-track::after {
  transform: translateX(16px);
  background: var(--color-brand);
}

/* Vendor group labels */
.vendor-group-label {
  padding: 20px 0 4px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* No-data variants for tighter contexts */
.no-data.compact { padding: 8px 0; }
.no-data.padded { padding: 12px 0; }
.no-data.centered { padding: 24px; text-align: center; }

/* Inline icon used inside button/label text */
.icon-inline { vertical-align: -2px; }

/* Uptime monitoring rows — domain editor + custom-headers toggle/textarea */
.uptime-domain-row { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.uptime-url-row { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.uptime-row-line { display: flex; gap: 8px; align-items: center; }
.uptime-header-toggle {
  font-size: 11px;
  padding: 2px 6px;
  white-space: nowrap;
  margin-left: auto;
  color: var(--color-text-muted);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-accent);
  border-radius: 4px;
}
.uptime-header-input {
  font-size: 12px;
  font-family: monospace;
  resize: vertical;
}

/* Uptime per-target editor — acceptable status ranges + read-only site rows */
.uptime-ranges { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: var(--font-s); }
.uptime-ranges-label { color: var(--color-text-muted); }
.uptime-range { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.uptime-range-cb { margin: 0; cursor: pointer; }
.uptime-header-error { margin-top: 4px; font-size: var(--font-m); color: var(--color-danger); }
.uptime-url-static {
  flex: 1;
  color: var(--color-text-muted);
  background: var(--color-bg-card);
  cursor: default;
}
.uptime-site-tag {
  font-size: var(--font-s);
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(139, 148, 158, 0.15);
  color: var(--color-text-muted);
}

/* CrUX site discovery row + footer + group editor */
.crux-discover-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.crux-discover-row.crux-discover-blocked { font-size: 12px; color: var(--color-text-muted); display: block; }
.crux-discover-btn { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.crux-discover-status { font-size: 12px; color: var(--color-text-muted); }
.crux-footer { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; margin-top: 8px; }
.add-group-link {
  background: none;
  border: none;
  color: #388bfd;
  cursor: pointer;
  font-size: var(--font-md);
  padding: 0;
}
.crux-total-count { font-size: 12px; }
.crux-group-suggestions { font-size: 11px; color: #6e7681; padding-bottom: 4px; }
.crux-group-name {
  font-weight: 600;
  border: none;
  background: transparent;
  color: #e6edf3;
  font-size: 14px;
  padding: 2px 0;
  width: 200px;
}
.crux-group-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.btn-remove-group { font-size: 12px; color: var(--color-danger); padding: 4px 10px; }

/* Per-site fallback note */
.per-site-note { font-size: var(--font-m); margin: 0; }
/* "(not configured)" hint inside a channel label */
.channel-not-configured { font-size: 11px; }

/* Disabled config card */
.settings-card.config-disabled {
  opacity: 0.5;
}
.settings-card.config-disabled .config-header-label {
  cursor: default;
}
.settings-card.config-disabled .config-header-label:hover {
  color: var(--color-text-primary);
}
.collapse-caret {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s;
}
.form-section-title.open .collapse-caret,
.config-header-label.open .collapse-caret {
  transform: rotate(-135deg);
  border-color: var(--color-brand);
}
/* Collapsible sections */
.collapsible-heading {
  font-size: var(--font-l);
  font-weight: 600;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 32px;
  margin-bottom: 12px;
  padding: 0;
}
.collapsible-heading-right { display: flex; align-items: center; gap: 10px; }
.collapsible-heading .collapse-caret {
  border-color: var(--color-text-secondary);
}
.collapsible-heading.open .collapse-caret {
  transform: rotate(-135deg);
}
.collapsible-heading:hover { color: var(--color-text-on-dark); }
.collapsible-heading:hover .collapse-caret { border-color: var(--color-text-primary); }
.collapsible-body { opacity: 1; transition: max-height 0.4s ease, opacity 0.3s ease; overflow: hidden; }
.collapsible-body.collapsed,
.collapsible-heading + .collapsible-body:not(.open) { max-height: 0; opacity: 0; overflow: hidden; }
.collapsible-heading + .collapsible-body.open { max-height: 2000px; opacity: 1; }
.crux-section {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--color-bg-body);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
/* Site display-name label inside a settings card header — content class kept
   after the card structure moved to the shared `.entity-card` component. */
.site-card-name { color: var(--color-text-secondary); }
.site-card-actions-bar {
  display: flex;
  justify-content: flex-end;
  padding: 12px 0 4px;
}

.crux-section-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.crux-section-label {
  font-size: var(--font-l);
  font-weight: 600;
  color: var(--color-text-primary);
}
.crux-section-hint {
  color: var(--color-text-muted);
}
.crux-url-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 32px;
}
.crux-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.crux-url-row .form-input {
  flex: 1;
}
.crux-url-row .drag-handle {
  cursor: grab;
  color: var(--color-text-muted);
  font-size: 14px;
  user-select: none;
  padding: 0 2px;
  opacity: 0.5;
}
.crux-url-row .drag-handle:hover { opacity: 1; }
.crux-url-row.dragging { opacity: 0.4; }
.uptime-url-card { background: #362e2e; border: 1px solid var(--color-border); border-radius: 8px; padding: 10px 12px; }
.crux-url-list.drag-over {
  outline: 2px dashed var(--color-brand);
  outline-offset: 2px;
  border-radius: 4px;
  min-height: 24px;
}
.btn-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: var(--font-xl);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  font-family: inherit;
}
.btn-remove:hover {
  color: var(--color-danger);
  background: rgba(248, 81, 73, 0.1);
}
.add-url-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
}
.add-url-link:hover {
  color: var(--color-text-primary);
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}
/* Right-align the action buttons (e.g. modal Cancel / Save). */
.form-actions-end { justify-content: flex-end; }
.btn-primary {
  padding: 8px 20px;
  font-size: var(--font-l);
  font-weight: 600;
  color: var(--color-text-on-dark);
  background: var(--color-brand);
  border: none;
  border-radius: var(--radius-input);
  cursor: pointer;
  font-family: inherit;
}
.btn-primary:hover:not(:disabled) {
  background: #cc0000;
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: default;
}
.btn-danger {
  padding: 8px 20px;
  font-size: var(--font-l);
  font-weight: 600;
  color: var(--color-danger);
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: var(--radius-input);
  cursor: pointer;
  font-family: inherit;
}
.btn-danger:hover {
  background: rgba(248, 81, 73, 0.2);
}
.btn-ghost {
  padding: 8px 20px;
  font-size: var(--font-l);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-input);
  cursor: pointer;
  font-family: inherit;
}
.btn-ghost:hover:not(.disabled):not(:disabled) {
  color: var(--color-text-primary);
  border-color: var(--color-text-muted);
}
.btn-ghost.disabled, .btn-ghost:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn-sm {
  padding: 4px 12px;
  font-size: var(--font-m);
}
.site-list-actions {
  display: flex;
  gap: 6px;
}
.config-group {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-brand);
}
.config-group:first-child {
  margin-top: 24px;
}
.config-group:last-child,
.config-group.last {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.site-platform-config > .config-group:last-child,
.site-crux-config > .config-group:last-child {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-brand);
}
/* Hide border on the last config-group before the save button in site cards */
.settings-form > :nth-last-child(2) > .config-group,
.settings-form > .config-group:nth-last-child(2) {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.config-group-label {
  font-size: var(--font-l);
  font-weight: 600;
  color: #e5e5e7;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.site-crux-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-crux-toggle .collapse-caret {
  margin-top: -2px;
}
.site-crux-toggle.open .collapse-caret {
  transform: rotate(-135deg);
  border-color: var(--color-brand);
}
.config-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.form-group-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.form-label-inline {
  font-size: var(--font-l);
  color: #e5e5e7;
  white-space: nowrap;
  min-width: 140px;
}
.form-group-inline .form-input {
  flex: 1;
}
.form-group-inline .field-error {
  width: 100%;
  padding-left: 152px;
}

/* Login page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--color-bg-body);
}
.login-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 40px;
  width: 100%;
  max-width: 380px;
}
.login-logo {
  display: block;
  width: 250px;
  margin: 0 auto 24px;
}
.login-card h2 {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: 24px;
}
.login-card .form-group { margin-bottom: 16px; }
.login-card .form-label { display: block; margin-bottom: 8px; }
.login-btn {
  width: 100%;
  padding: 12px 16px;
  font-size: var(--font-l);
  font-weight: 600;
  font-family: inherit;
  color: var(--color-bg-body);
  background: var(--color-text-on-dark);
  border: none;
  border-radius: var(--radius-input);
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 8px;
}
.login-btn:hover { opacity: 0.85; }
.login-error {
  color: var(--color-danger);
  font-size: var(--font-l);
  margin-bottom: 8px;
  text-align: center;
}
.forgot-link { display: block; text-align: center; margin-top: 12px; color: var(--color-link); font-size: var(--font-l); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }
.terms-link { display: block; text-align: center; margin-top: 8px; color: var(--color-text-muted); font-size: var(--font-m); text-decoration: none; }
.terms-link:hover { color: var(--color-text-secondary); text-decoration: underline; }
.nav-terms-link { display: block; padding: 8px 20px; color: var(--color-text-muted); font-size: var(--font-m); text-decoration: none; }
.nav-terms-link:hover { color: var(--color-text-secondary); }
.nav-beta-badge { display: inline-block; background: var(--color-tier-beta-bg); color: var(--color-tier-beta); padding: 3px 7px; border-radius: var(--radius-compact); font-size: var(--font-s); font-weight: 700; letter-spacing: 0.5px; }
/* Synthetic-toggle row sits among inline form rows but a checkbox + hint don't
   need the same column widths the labeled-input rows use. */
.site-synthetic-row { align-items: center; gap: 8px; flex-wrap: wrap; }
.site-synthetic-row .form-hint { margin: 0; flex-basis: 100%; }
.forgot-desc { color: var(--color-text-secondary); font-size: var(--font-l); margin: 0 0 16px; text-align: center; line-height: 1.5; }
.forgot-success { color: var(--color-success); font-size: var(--font-l); margin-bottom: 8px; text-align: center; line-height: 1.5; }
.forgot-success a { color: var(--color-link); }

/* General utility: hide an element via class rather than an inline style. The
   pre-existing login pages use `style="display:none"` directly — new code
   prefers `.hidden` + classList.toggle so visibility lives in CSS. */
.hidden { display: none !important; }

/* Two-factor: enrollment QR / manual key + recovery codes (login flow) */
.twofa-qr {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
  min-height: 180px;
  align-items: center;
}
.twofa-qr img { width: 180px; height: 180px; image-rendering: pixelated; border-radius: var(--radius-input); background: var(--color-text-on-dark); padding: 8px; }
.twofa-secret-label { color: var(--color-text-muted); font-size: var(--font-m); text-align: center; margin: 0 0 4px; }
.twofa-secret {
  display: block;
  text-align: center;
  font-family: monospace;
  font-size: var(--font-l);
  letter-spacing: 1px;
  color: var(--color-text-primary);
  background: var(--color-bg-body);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  padding: 10px;
  margin: 0 0 20px;
  word-break: break-all;
}
.twofa-recovery-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 16px;
  background: var(--color-bg-body);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.twofa-recovery-list code { font-family: monospace; font-size: var(--font-l); color: var(--color-text-primary); }
/* Form-row actions for the enrollment wizard (Cancel + Confirm). */
.twofa-actions { display: flex; gap: 12px; margin-top: 12px; }

/* Profile → Two-Factor card. Shape from the shared `.badge`; this only spaces
   it after the "Status:" label. */
.account-2fa-status { color: var(--color-text-secondary); font-size: var(--font-l); margin: 12px 0; }
.account-2fa-status .badge { margin-left: 6px; }
.account-2fa-desc { color: var(--color-text-secondary); font-size: var(--font-l); margin: 0 0 16px; line-height: 1.5; }

/* Account picker */
.account-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.account-pick-btn {
  display: block;
  padding: 12px 16px;
  font-size: var(--font-l);
  font-weight: 500;
  color: var(--color-text-primary);
  background: var(--color-bg-body);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-input);
  text-decoration: none;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.account-pick-btn:hover {
  border-color: var(--color-brand);
  background: var(--color-bg-hover);
}

/* Bottom nav separator (Profile, Settings, Admin) */
.nav-group-bottom {
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
  padding-top: 8px;
}
/* Logout */
.nav-group-logout {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding-top: 8px;
}
.nav-logout {
  width: auto;
  padding: 8px 16px;
  color: var(--color-text-secondary);
  font-size: var(--font-l);
}
.nav-logout:hover {
  color: var(--color-danger);
  background: transparent;
}

/* Overview cards */
.overview-status-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.overview-status-main {
  flex: 2;
  margin-bottom: 0 !important;
}
.overview-status-side {
  flex: 1;
  margin-bottom: 0 !important;
}
.overview-group {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}
.overview-group > .overview-cards { flex: 1; }
.overview-group-title {
  font-size: var(--font-l);
  font-weight: 600;
  color: #f5f0e8;
  margin-bottom: 16px;
}
.overview-group .card.table-card {
  margin-bottom: 0;
  border: none;
  padding: 0;
  background: none;
}
/* Zone label trailing the local time in the Orders-by-Site "Current Time"
   column (same "EDT (UTC−4)" format as the sidebar) — muted so the time itself
   reads first. */
.overview-site-tz {
  color: var(--color-text-secondary);
}
/* Visually group the data columns on the Orders-by-Site table — the per-day
   trio (Last 24h / Expected Last 24h / Trend, cols 3-5) and the per-hour trio
   (Last 60m / Expected Last 60m / Trend, cols 6-8). A subtle elevation vs
   the identity columns plus a 1px divider at each group's leading edge so a
   reader can see which expected/trend belongs to which window without
   re-reading the headers.
   The column positions below are coupled to the <thead> layout in
   index.html's #orders-by-site-table — if the column count or order changes,
   update both. */
#orders-by-site-table th:nth-child(3),
#orders-by-site-table td:nth-child(3),
#orders-by-site-table th:nth-child(6),
#orders-by-site-table td:nth-child(6) {
  border-left: 1px solid var(--color-border-accent);
}
#orders-by-site-table th:nth-child(n+3):nth-child(-n+5),
#orders-by-site-table td:nth-child(n+3):nth-child(-n+5),
#orders-by-site-table th:nth-child(n+6):nth-child(-n+8),
#orders-by-site-table td:nth-child(n+6):nth-child(-n+8) {
  background: var(--color-bg-hover);
}
.overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.overview-cards-half {
  grid-template-columns: repeat(2, 1fr);
}
.overview-card {
  display: block;
  background: var(--color-bg-body);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 20px;
  color: var(--color-text-primary);
}
.overview-card-alert {
  border-color: var(--color-brand);
}
.overview-card-title {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}
.overview-card-status {
  font-size: var(--font-xl);
  font-weight: 600;
  margin-bottom: 4px;
}
.overview-card-status-ok {
  color: var(--color-success);
}
.overview-card-status-alert {
  color: var(--color-danger);
}
.overview-card-count {
  font-size: var(--font-l);
  color: var(--color-text-secondary);
}
.overview-card-down-list {
  list-style: none;
  margin-top: 12px;
  font-size: var(--font-l);
  color: var(--color-text-primary);
}
.overview-card-down-list li {
  display: flex;
  align-items: center;
  padding: 4px 0;
  word-break: break-all;
}

/* Overview progressive-load skeletons. Each configured group renders a
   placeholder in DOM order so the page shows its full top-down structure
   immediately; the real card/table replaces the placeholder in place as its
   own fetch resolves (no bottom-up pop-in). */
@keyframes overview-skeleton-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.overview-skeleton {
  animation: overview-skeleton-pulse 1.2s ease-in-out infinite;
}
.overview-skeleton-bar {
  height: 14px;
  background: var(--color-bg-hover);
  border-radius: var(--radius-compact);
  margin: 12px 0;
}
.overview-skeleton-bar-title {
  width: 40%;
  height: 18px;
}
.overview-skeleton-bar-wide { width: 75%; }
.overview-skeleton-bar-mid { width: 55%; }
/* Inside a table cell the td padding already provides row spacing, so the bar
   fills the cell width with no margin and a line-height matching the real
   text rows. */
.overview-skeleton-bar-cell { width: 100%; height: 16px; margin: 0; }

/* Config page section headings */
.config-section-heading {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin: 24px 0 8px;
}
.config-section-heading:first-child {
  margin-top: 0;
}

/* Read-only CrUX overall section */
.crux-section-readonly input[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  background: var(--color-bg-card);
}

/* Auto-tracked domains in uptime config */
.auto-domains-info {
  padding: 8px 0;
}
.auto-domain-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  margin-bottom: 4px;
  font-size: var(--font-l);
}
.auto-domain-url {
  color: var(--color-text-tertiary);
  font-family: monospace;
}
.auto-domain-site {
  color: var(--color-text-secondary);
}

/* ── Hamburger (hidden on desktop) ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 1px;
}
.mobile-header {
  display: none;
}
.sidebar-overlay {
  display: none;
}

/* ── Tablet / narrow desktop ── */
@media (max-width: 1200px) {
  .kpi-row,
  .url-row-expand .kpi-row,
  #section-uptime .kpi-row,
  .inventory-kpi-row,
  .orders-kpi-row,
  .chart-row,
  .credits-row,
  .overview-cards,
  .overview-cards-half {
    grid-template-columns: 1fr;
  }
  .chart-row.half-row {
    grid-template-columns: 1fr;
  }
  .overview-status-row {
    flex-direction: column;
  }
  .table-card th,
  .table-card td { white-space: nowrap; }
}

/* ── Mobile Responsive ── */
/* Site Alert Configurations — when the configs body becomes narrow enough
   that the chart and controls would no longer fit side-by-side, the controls
   wrap below; in that single-column state, stretch them to full width.
   Uses a container query so this responds to the panel's actual size, not
   just the viewport (avoids breaking when the sidebar is open vs collapsed). */
#alert-configs-body {
  container-type: inline-size;
  container-name: alert-configs;
}
@container alert-configs (max-width: 760px) {
  #stall-threshold-controls {
    width: 100% !important;
  }
}

@media (max-width: 768px) {
  /* Mobile header bar */
  .mobile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-brand);
  }
  .mobile-logo {
    height: 28px;
    width: auto;
  }
  .hamburger { display: flex; }
  .sidebar .sidebar-logo-wrap { display: none; }

  /* Sidebar → slide-out overlay */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Main content */
  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  /* Header — page title row */
  .header {
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: none;
    padding-bottom: 8px;
    margin-bottom: 16px;
  }
  .header h1 { font-size: var(--font-xl); }

  /* All grids → single column */
  .kpi-row,
  .url-row-expand .kpi-row,
  #section-uptime .kpi-row,
  .chart-row,
  .credits-row,
  .form-row {
    grid-template-columns: 1fr;
  }
  .orders-kpi-row {
    grid-template-columns: 1fr;
  }


  /* URL rows — no expand on mobile */
  .url-row { flex-wrap: wrap; pointer-events: none; cursor: default; }
  .url-row .url-external-link { pointer-events: auto; }
  .url-row::after { display: none; }
  .url-row:hover { border-color: var(--color-border); box-shadow: none; }
  .url-row .url-path { width: auto; min-width: 0; flex: 1 1 100%; }
  .url-row .url-metrics { flex: 1 1 100%; flex-wrap: wrap; gap: 8px 16px; }
  .url-row-expand { display: none !important; }
  .url-external-link { margin-right: 0; }

  /* Cards — no expand on mobile */
  .kpi-card { pointer-events: none; cursor: default; }
  .kpi-card::after { display: none; }
  .kpi-card:hover { border-color: var(--color-border); box-shadow: none; }
  .card.clickable,
  .card.card-expandable { pointer-events: none; cursor: default; }
  .card.clickable::after,
  .card.card-expandable::after { display: none; }
  .card.clickable:hover,
  .card.card-expandable:hover { border-color: var(--color-border); box-shadow: none; }
  .trend-expand { display: none; }

  /* Filter rows — reduce top margin */
  .filter-row-sticky { margin-top: 16px; }

  /* Cards — reduce padding on mobile */
  .card { padding: 16px; }
  .card h2 .badge { margin-right: 0; }

  /* Fixed-width elements */
  .ff-bar { width: 100% !important; max-width: 200px; }
  .cartridges { max-width: none; }
  .url-cell { max-width: none; word-break: normal; }
}

/* Alerts */
.alerts-table { width: 100%; min-width: 700px; }
.alerts-table col:nth-child(1),
.alerts-table col:nth-child(2) { width: 80px; }
.alerts-table col:nth-child(3),
.alerts-table col:nth-child(5),
.alerts-table col:nth-child(6) { width: 140px; }
.cols-product col:nth-child(1) { width: 140px; }
.cols-product col:nth-child(3) { width: 90px; }
.cols-product col:nth-child(4) { width: 100px; }
.cols-product col:nth-child(5) { width: 110px; }
.cols-product col:nth-child(6) { width: 140px; }
.cols-product col:nth-child(7) { width: 120px; }
.cols-product col:nth-child(8) { width: 130px; }
.alert-card-open { border: 3px solid var(--color-brand); }
.alert-card-info { border: 3px solid var(--color-info); }
/* Collapsible card heading — left caret + title, mirroring the entity-card
   header (Orders/Inventory "Site Alert Configurations"). The caret points right
   when collapsed and rotates down + brand-colored when open, same as an
   entity-card. `gap:10px` matches `.entity-card-main`. */
.alert-card-heading-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  margin-bottom: 16px;
}
.alert-card-heading-toggle.collapsed {
  margin-bottom: 0;
}
.alert-card-heading-toggle:not(.collapsed) .entity-card-caret {
  transform: rotate(45deg);
  border-color: var(--color-brand);
}
/* Default: no height cap so long lists (e.g. Active Open Info Incidents) aren't
   clipped. The cap only applies to collapsible cards, which need a finite
   max-height to animate the open/close transition. */
.alert-card-body.collapsible {
  overflow: hidden;
  max-height: 4000px;
  transition: max-height 0.3s ease-in-out;
}
.alert-card-body.collapsible.collapsed {
  max-height: 0;
}

.alert-history-list { flex: 1; }
.alert-history-event { padding: 2px 0; font-size: var(--font-l); color: var(--color-text-tertiary); display: flex; align-items: center; }
.alert-history-event.expandable { cursor: pointer; }
.alert-history-event.expandable:hover { color: var(--color-text-on-dark); }
.alert-history-toggle-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  flex-shrink: 0;
}
.alert-history-toggle {
  display: inline-block;
  font-size: var(--font-s);
  color: var(--color-text-muted);
  transition: transform 0.15s;
}
.alert-history-toggle::before { content: '\25B6'; }
.alert-history-event.expanded .alert-history-toggle { transform: rotate(90deg); }
.alert-history-text { margin-left: 6px; }
.alert-history-details {
  margin-left: 16px;
  margin-bottom: 4px;
  padding: 8px 0;
  border-left: 2px solid var(--color-border);
  padding-left: 12px;
}
.alert-history-details .resp-detail-item { padding: 2px 0; font-size: var(--font-m); }
.alert-history-details .resp-detail-label { min-width: 90px; font-size: var(--font-m); }
.resp-detail-item-history { align-items: flex-start; }

/* === Card-style table rows ===
   Each data row reads as a bordered entity-card (same border / radius / surface
   / 8px gap as `.entity-card-list`) while staying a real table. Shared by the
   alert incident tables and the System Health heartbeat table. The caret and
   the connected expanded body below are scoped to incident rows. */
.card-rows { border-collapse: separate; border-spacing: 0 8px; }
/* Row cells use the entity-card header's body-size text (font-m). The expanded
   incident event-log body keeps font-l via `.resp-detail-item`, mirroring the
   entity-card's header-vs-body sizing. */
.card-rows tbody tr:not(.alert-event-log-row) > td {
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-m);
}
.card-rows tbody tr:not(.alert-event-log-row) > td:first-child {
  border-left: 1px solid var(--color-border);
  border-top-left-radius: var(--radius-input);
  border-bottom-left-radius: var(--radius-input);
  padding-left: 16px;
}
.card-rows tbody tr:not(.alert-event-log-row) > td:last-child {
  border-right: 1px solid var(--color-border);
  border-top-right-radius: var(--radius-input);
  border-bottom-right-radius: var(--radius-input);
  padding-right: 16px;
}

/* Incident rows: clickable, with the entity-card caret in the leading cell. */
.alerts-incident-row { cursor: pointer; }
.alerts-incident-row:hover > td { background: var(--color-bg-hover); }
.alerts-incident-row .entity-card-caret {
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
}
.alerts-incident-row.expanded .entity-card-caret {
  transform: rotate(45deg);
  border-color: var(--color-brand);
}
/* Expanded incident: the row becomes the card header (square bottom corners);
   its event-log body connects flush beneath via `.resp-detail-content`. */
.alerts-incident-row.expanded > td:first-child { border-bottom-left-radius: 0; }
.alerts-incident-row.expanded > td:last-child { border-bottom-right-radius: 0; }
.alert-event-log-row > td { padding: 0 !important; border: none !important; }

/* Snooze inline controls */
.snooze-cell { white-space: nowrap; }
.snooze-duration-inline { background: var(--color-bg-card); color: var(--color-text-secondary); border: 1px solid var(--color-border-accent); border-radius: 4px; padding: 2px 4px; font-size: var(--font-m); cursor: pointer; margin-right: 4px; }
.snooze-inline-btn, .unsnooze-inline-btn, .enable-inline-btn { border: none; font-size: var(--font-l); cursor: pointer; padding: 2px 8px; border-radius: 4px; transition: color 0.15s, background 0.15s; }
.unsnooze-inline-btn, .enable-inline-btn { padding: 1px 1px 0px 4px; font-size: var(--font-m); margin-left: 4px;}
.snooze-inline-btn { background: rgba(210, 153, 34, 0.2); color: var(--color-warning); }
.snooze-inline-btn.disable-action { background: rgba(248, 81, 73, 0.2); color: var(--color-danger); }
.snooze-inline-btn:hover { color: #fff; background: rgba(210, 153, 34, 0.45); }
.snooze-inline-btn.disable-action:hover { color: #fff; background: rgba(248, 81, 73, 0.45); }
.unsnooze-inline-btn:hover, .enable-inline-btn:hover { color: var(--color-success); background: rgba(63, 185, 80, 0.15); }
.snooze-inline-btn:disabled, .unsnooze-inline-btn:disabled, .enable-inline-btn:disabled { opacity: 0.4; cursor: default; }
.snooze-status { font-size: var(--font-m); color: var(--color-warning); }
/* Shared snooze control row — flex-centers the duration select and its
   pause/disable button so they align to the same height in every cell. */
.snooze-controls { display: inline-flex; align-items: center; }
/* Disable-only control for segment alerts on a re-alert delay schedule. */
.snooze-delayed { display: inline-flex; flex-direction: column; gap: 2px; }
.snooze-delay-note { font-size: var(--font-s); color: var(--color-accent-gold); }
.snooze-status.disabled-status { color: var(--color-danger); }
.status-dot.status-snoozed { background: var(--color-warning); }
.status-dot.status-unsnoozed { background: #58a6ff; }
.status-dot.status-disabled { background: var(--color-brand); }
.status-dot.status-enabled { background: #58a6ff; }
.status-dot.status-notified { background: #a371f7; }

.alert-card-subtitle { margin: -4px 0 8px; color: var(--color-text-secondary); font-weight: 400; }

/* Alert config table (settings page) */
/* Alert config cards */
.alert-cfg-group { margin-bottom: 24px; }
.alert-cfg-group-label { font-size: var(--font-l); color: var(--color-text-primary); margin: 0; font-weight: 600; padding: 4px 0; }
.alert-cfg-group-body { margin-top: 16px; }
/* Alert config cards use the shared `.entity-card entity-card-warm` component
   for their card/header/body chrome; the rules below are the alert-specific
   inner content only. */
.entity-card[data-alert-key] { margin-top: 12px; }
/* Channel tabs inside an alert config card */
.alert-cfg-channels-tabs { display: flex; gap: 2px; margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--color-border); background: #1c2128; padding-left: 16px; padding-right: 16px; flex-wrap: wrap; border-radius: 8px 8px 0 0; }
.alert-cfg-channels-tabs.no-fields-above { margin-top: 0; border-top: none; padding-top: 0; }
.alert-cfg-channel-tab { background: transparent; border: none; padding: 10px 16px; cursor: pointer; color: var(--color-text-secondary); font-size: var(--font-m); border-radius: 6px 6px 0 0; display: flex; align-items: center; gap: 6px; }
.alert-cfg-channel-tab:hover { color: var(--color-text-primary); background: rgba(255,255,255,0.04); }
.alert-cfg-channel-tab.active { color: var(--color-text-primary); background: #0d1117; }
.alert-cfg-channel-tab.has-config { color: var(--color-text-primary); }
.alert-cfg-channel-tab .tab-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--color-success); margin-left: 4px; }
.alert-cfg-channel-tab.disabled { opacity: 0.5; cursor: not-allowed; }
.alert-cfg-channels-panels { background: #0d1117; padding: 16px; border-radius: 0 0 8px 8px; }
.alert-cfg-channel-panel { display: none; }
.alert-cfg-channel-panel.active { display: block; }
/* Override the standalone channel styling when inside tab panels — no border/bg needed */
.alert-cfg-channel-panel .alert-cfg-channel { padding: 0; background: transparent; border: none; }
.alert-cfg-channel-panel .alert-cfg-channel-header { justify-content: flex-start; gap: 12px; }
.alert-cfg-channel-panel .alert-cfg-channel-header .alert-cfg-channel-label { min-width: 140px; white-space: nowrap; }
.alert-cfg-channel-panel .alert-cfg-channel-fields { border-top: none; padding-top: 12px; margin-top: 0; }
.alert-cfg-label { color: var(--color-text-primary); font-weight: 500; font-size: var(--font-l); }
.alert-cfg-detail { margin-bottom: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.alert-cfg-detail-text { flex: 1; min-width: 0; }
.alert-cfg-detail .alert-priority-select { flex: none; margin-top: 10px; }
.alert-cfg-key { display: none; font-size: var(--font-l); color: var(--color-text-muted); font-family: monospace; margin-bottom: 6px; }
/* Channel chips (EMAIL / SLACK / …) — a deliberately smaller, denser sibling of
   `.badge`: same bordered, tinted, compact-radius look at a micro size. */
.alert-cfg-channel-badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 600; padding: 1px 6px; border: 1px solid rgba(139, 148, 158, 0.3); border-radius: var(--radius-compact); background: rgba(139, 148, 158, 0.15); color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.alert-cfg-desc { color: var(--color-text-primary); font-size: var(--font-l); margin: 0; line-height: 1.5; padding: 10px 0 20px }
.alert-cfg-threshold { margin-top: 8px; }
.entity-card[data-alert-key] .config-fields .form-label-inline { min-width: 220px; }
.alert-cfg-channels { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.alert-cfg-channel { padding: 8px 12px; background: #362e2e; border: 1px solid var(--color-border); border-radius: 6px; }
.alert-cfg-channel-header { display: flex; align-items: center; justify-content: space-between; }
.alert-cfg-channel-header .alert-cfg-channel-label { display: flex; align-items: center; gap: 8px; }
.alert-cfg-channel-label { font-size: var(--font-l); color: var(--color-text-primary); font-weight: 500; }
.alert-cfg-channel-fields { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--color-border); }
.alert-cfg-field-warn { display: block; font-size: 11px; color: var(--color-warning); margin-top: 4px; padding-left: 152px; }
.alert-cfg-voice-note { margin: 8px 0 0; }
.alert-cfg-voice-cap-note { margin-top: 8px; }
.alert-cfg-integration-link { color: var(--color-danger); }
.alert-cfg-integration-link:hover { color: var(--color-text-on-dark); }
.alert-cfg-channel-panel > .card-explainer-note { margin: 0; }
.alert-cfg-channel > .card-explainer-note { margin: 12px 0 0; }
.alert-cfg-channel-fields .form-input { flex: 1; }
.alert-cfg-channel-fields .alert-notify-teams-dest { flex: 1; }
.alert-notify-select { background: var(--color-bg-body); color: var(--color-text-primary); border: 1px solid var(--color-border-accent); border-radius: var(--radius-input); padding: 4px 8px; font-size: var(--font-l); cursor: pointer; }
.alert-priority-select { background: var(--color-bg-card); color: var(--color-text-secondary); border: 1px solid var(--color-border-accent); border-radius: 4px; padding: 2px 4px; font-size: var(--font-m); cursor: pointer; }
.alert-notify-teams-dest { background: var(--color-bg-body); color: var(--color-text-primary); border: 1px solid var(--color-border-accent); border-radius: var(--radius-input); padding: 2px 4px; font-size: var(--font-l); }
.alert-notify-teams-dest option { padding: 2px 6px; }
.alert-notify-teams-dest option:checked { background: rgb(118, 3, 3); color: #fff; }

/* ============================================================================
 * Per-site alert config overrides — mode bar, banner, badges, revert link
 * ============================================================================ */
.alert-cfg-mode-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg-card);
}
.alert-cfg-mode-bar.site-mode {
  border-color: var(--color-warning);
  background: rgba(210, 153, 34, 0.08);
}
.alert-cfg-mode-label {
  font-size: var(--font-l);
  color: var(--color-text-secondary);
  font-weight: 500;
  white-space: nowrap;
}
.alert-cfg-mode-select {
  background: var(--color-bg-body);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-input);
  padding: 4px 28px 4px 10px;
  font-size: var(--font-l);
  cursor: pointer;
  min-width: 220px;
}
.alert-cfg-mode-banner {
  flex: 1 1 320px;
  font-size: var(--font-m);
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.alert-cfg-mode-banner.global { color: var(--color-text-muted); }
.alert-cfg-mode-banner strong { color: var(--color-text-primary); }

/* Subtle per-card tint in site mode so cards visually belong to a "scope". */
#alert-config-card.alert-cfg-site-mode .entity-card {
  border-left: 3px solid rgba(210, 153, 34, 0.4);
}

/* Override status badges: count for global mode, "site override" for site mode.
   A `.badge .badge-uppercase` — this only carries the hue (neutral default,
   warning for site mode) and the left margin. */
.alert-cfg-override-badge {
  background: rgba(139, 148, 158, 0.15);
  color: var(--color-text-secondary);
  border-color: rgba(139, 148, 158, 0.3);
  margin-left: 8px;
}
.alert-cfg-override-badge.site {
  background: rgba(210, 153, 34, 0.15);
  color: var(--color-warning);
  border-color: rgba(210, 153, 34, 0.4);
}

/* Sortable table headers: click-to-sort with a direction arrow on the active column. */
.sortable-table thead th[data-sort-key] {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 18px;
}
.sortable-table thead th[data-sort-key]:hover {
  color: var(--color-text-primary);
}
.sortable-table thead th[data-sort-key]::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.25;
}
.sortable-table thead th.sort-asc::after {
  border-bottom: 5px solid currentColor;
  margin-top: -3px;
  opacity: 0.9;
}
.sortable-table thead th.sort-desc::after {
  border-top: 5px solid currentColor;
  margin-top: -2px;
  opacity: 0.9;
}

/* "Revert site overrides" link, only rendered on overridden cards in site mode. */
.alert-cfg-revert {
  font-size: var(--font-m);
  color: var(--color-text-muted);
  margin-left: 12px;
  text-decoration: none;
  align-self: center;
}
.alert-cfg-revert:hover { color: var(--color-warning); text-decoration: underline; }

/* Summary block in Global mode showing which sites override this alert. */
.alert-cfg-overrides-summary {
  margin: 16px 0;
  padding: 10px 14px;
  background: rgba(210, 153, 34, 0.06);
  border: 1px solid rgba(210, 153, 34, 0.25);
  border-radius: 6px;
}
.alert-cfg-overrides-summary-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-warning);
  margin-bottom: 8px;
}
.alert-cfg-override-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  padding: 4px 0;
  font-size: var(--font-m);
}
.alert-cfg-override-row + .alert-cfg-override-row {
  border-top: 1px dashed rgba(210, 153, 34, 0.18);
}
.alert-cfg-override-site {
  font-weight: 600;
  color: var(--color-text-primary);
  min-width: 140px;
}
.alert-cfg-override-pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  flex: 1;
}
.alert-cfg-override-pair .k { color: var(--color-text-muted); }
.alert-cfg-override-pair .v { color: var(--color-text-primary); font-family: monospace; font-size: 11px; }

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

/* Parenthetical "(all sites)" pool total shown next to a per-site value in
   inventory tables — de-emphasised so the per-site figure reads as primary. */
.cell-pool-total { color: var(--color-text-secondary); }

.overview-card-down-list .badge { margin-left: 6px; }

/* Dashboard loading indicator */
.dashboard-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 120px 20px; gap: 20px; }
.loading-label { font-size: var(--font-xl); font-weight: 700; color: var(--color-text-primary); letter-spacing: 2px; }
.loading-bar-track { width: 260px; height: 24px; background: var(--color-bg-card); border: 2px solid var(--color-border-accent); border-radius: 4px; overflow: hidden; padding: 4px; }
.loading-bar-fill { height: 100%; width: 40%; background: repeating-linear-gradient(90deg, var(--color-brand) 0px, var(--color-brand) 12px, #5c0000 12px, #5c0000 16px); border-radius: 2px; animation: loading-slide 1.2s ease-in-out infinite; }
.dashboard-loading-inline { padding: 60px 20px; }
.dashboard-loading-inline .loading-label { font-size: var(--font-xl); }
.dashboard-loading-inline .loading-bar-track { width: 200px; height: 20px; }
@keyframes loading-slide { 0% { margin-left: 0; width: 0%; } 50% { margin-left: 0; width: 100%; } 100% { margin-left: 100%; width: 0%; } }

/* Modal overlay (used by admin Database edit dialog) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-card);
  padding: 24px;
  width: 480px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}
.modal-card h3 {
  color: var(--color-text-primary);
  margin: 0 0 12px;
  font-size: var(--font-l);
}
.modal-body-text {
  color: var(--color-text-tertiary);
  font-size: var(--font-m);
  line-height: 1.6;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* "All clear" card shown by the shared alerts renderer when there are
   zero open + zero disabled-open incidents. */
.alert-all-clear-card {
  padding: 30px 0;
  margin-bottom: 16px;
  text-align: center;
  color: var(--color-text-primary);
  font-size: 1.15em;
  border: 3px solid var(--color-success);
}
.alert-all-clear-icon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 8px;
  color: var(--color-success);
}
/* Empty-state message used by the shared alerts renderer when there's
   no open/resolved/disabled history to show. */
.alert-empty-history {
  padding: 24px 0;
  text-align: center;
}

/* ============================================================
   Documentation page (/docs.html)
   ============================================================ */
.docs-layout {
  display: flex;
  min-height: 100vh;
}
.docs-sidebar {
  width: 220px;
  background: var(--color-bg-card);
  border-right: 1px solid var(--color-border);
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.docs-sidebar-logo {
  padding: 10px 22px 14px;
  border-bottom: 1px solid var(--color-border);
  margin: 4px 0;
  background-color: var(--color-logo-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.docs-sidebar-logo a {
  display: block;
  width: 100%;
  max-width: 175px;
}
.docs-sidebar-logo img {
  width: 100%;
  max-width: 175px;
  height: auto;
  display: block;
}
/* "Documentation" subtitle under the logo — Anta font + uppercase so it
   reads as a distinct page label, not a body line. Centered under the
   logo for visual symmetry. */
.docs-sidebar-section {
  margin-top: 10px;
  font-family: 'Anta', sans-serif;
  font-size: var(--font-md);
  font-weight: 400;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--color-text-primary);
  align-self: center;
}
/* BETA pill — same centered placement as the dashboard sidebar
   (.sidebar-logo-wrap .nav-beta-badge) so the two pages match. */
.docs-sidebar-logo .nav-beta-badge {
  margin-top: 10px;
  align-self: center;
}
.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  padding: 12px 0;
  font-family: 'Anta', sans-serif;
}
.docs-nav-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 4px;
  font-weight: 700;
  color: var(--color-accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.docs-nav-group-label:hover {
  color: var(--color-accent-gold-hover);
}
.docs-nav-group-label .chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.docs-nav-group-label.collapsed .chevron {
  transform: rotate(-90deg);
}
.docs-nav-group-items {
  overflow: hidden;
  transition: max-height 0.2s ease;
}
.docs-nav-group-items.collapsed {
  max-height: 0 !important;
}
.docs-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  margin: 0 12px;
  width: calc(100% - 24px);
  font-size: var(--font-l);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
  border-radius: 8px;
}
/* Items inside a collapsible group get extra left indent so they read as
   sub-items of the group label above them — mirrors the dashboard's
   Settings sub-nav. */
.docs-nav-group-items .docs-nav-item {
  margin: 0 12px 0 18px;
  width: calc(100% - 30px);
  padding: 8px 20px 8px 28px;
}
.docs-nav-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}
.docs-nav-item.active {
  background: var(--color-burgundy);
  color: var(--color-text-on-dark);
  font-weight: 600;
}

/* Docs content */
.docs-main {
  flex: 1;
  margin-left: 220px;
  padding: 40px 48px 60px;
  max-width: 900px;
}
.docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--color-brand);
}
.docs-header h1 {
  font-size: var(--font-xxl);
  font-weight: 700;
  color: var(--color-text-primary);
  text-transform: uppercase;
  margin: 0;
}
.docs-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-input);
  font-family: inherit;
  font-size: var(--font-md);
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.docs-share-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
  border-color: var(--color-text-muted);
}
.docs-share-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.docs-share-btn-success {
  color: var(--color-success);
  border-color: var(--color-success);
}
.docs-share-btn-success:hover {
  color: var(--color-success);
  border-color: var(--color-success);
}
.docs-share-btn-error {
  color: var(--color-danger);
  border-color: var(--color-danger);
}
.docs-share-btn-error:hover {
  color: var(--color-danger);
  border-color: var(--color-danger);
}
.docs-article {
  display: none;
}
.docs-article.active {
  display: block;
}
.docs-article > p:first-of-type {
  font-size: 15px;
  color: var(--color-text-tertiary);
}
.docs-article h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-top: 28px;
  margin-bottom: 10px;
}
.docs-article p {
  font-size: var(--font-l);
  color: var(--color-text-tertiary);
  line-height: 1.65;
  margin-bottom: 14px;
}
.docs-article ol,
.docs-article ul {
  font-size: var(--font-l);
  color: var(--color-text-tertiary);
  line-height: 1.65;
  margin-bottom: 14px;
  padding-left: 24px;
}
.docs-article li {
  margin-bottom: 8px;
}
.docs-article code {
  background: var(--color-bg-hover);
  color: var(--color-accent-gold);
  padding: 2px 6px;
  border-radius: var(--radius-compact);
  font-size: var(--font-md);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.docs-link {
  color: var(--color-link);
  text-decoration: none;
}
.docs-link:hover {
  text-decoration: underline;
}
.docs-note {
  background: var(--color-bg-hover);
  border-left: 3px solid var(--color-warning);
  padding: 12px 16px;
  border-radius: var(--radius-compact);
  margin: 16px 0;
  font-size: var(--font-md);
  color: var(--color-text-tertiary);
  line-height: 1.6;
}
.docs-note strong {
  color: var(--color-warning);
}
.docs-note-info {
  border-left-color: var(--color-info);
}
.docs-note-info strong {
  color: var(--color-info);
}
.docs-note-info code {
  display: block;
  background: transparent;
  padding: 2px 0;
  color: var(--color-accent-gold);
}
/* "Where to find it" callout at the top of each article — gives the user
   the dashboard navigation path before they read the prose. */
.docs-where {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 10px 14px;
  background: var(--color-bg-card);
  border-left: 3px solid var(--color-info);
  border-radius: var(--radius-compact);
  font-size: var(--font-md);
  color: var(--color-text-tertiary);
  line-height: 1.5;
}
.docs-where svg {
  width: 14px;
  height: 14px;
  color: var(--color-info);
  flex-shrink: 0;
}
.docs-where strong {
  color: var(--color-text-primary);
}
.docs-where code {
  background: transparent;
  padding: 0;
  color: var(--color-accent-gold);
  font-size: var(--font-md);
}
.docs-field-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 20px;
  font-size: var(--font-md);
}
.docs-field-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}
.docs-field-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-tertiary);
  vertical-align: top;
}
.docs-field-table td:first-child {
  white-space: nowrap;
}
.docs-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 28px 0;
}

/* ============================================================
   Terms (/terms.html) and Release Notes (/release-notes.html)
   Both pages reuse the .docs-layout / .docs-sidebar / .docs-main
   shell from docs.html so the three standalone pages match. The
   rules below are just the small additions specific to each page.
   ============================================================ */
.terms-updated {
  color: var(--color-text-secondary);
  font-size: var(--font-md);
  margin: 0 0 24px;
}
.release-notes-meta {
  color: var(--color-text-secondary);
  font-size: var(--font-md);
  margin: 0 0 16px;
}
/* Release-version nav items stack the version label over a small date,
   so the sidebar reads like "beta1.1 / Jun 23, 2026" without needing a
   second column. */
.release-notes-nav-version {
  display: block;
}
.release-notes-nav-date {
  display: block;
  margin-top: 2px;
  font-size: var(--font-m);
  color: var(--color-text-muted);
  font-weight: 400;
}
.docs-nav-item.active .release-notes-nav-date {
  color: var(--color-text-on-dark);
  opacity: 0.75;
}
/* De-emphasized trailing lines inside a release article — small,
   muted, so they don't compete with the numbered feature list above. */
.release-notes-platform,
.release-notes-fixes {
  color: var(--color-text-secondary);
  font-size: var(--font-md);
  margin-top: 18px;
}
.release-notes-platform strong,
.release-notes-fixes strong {
  color: var(--color-text-primary);
}

/* Mobile */
@media (max-width: 768px) {
  .docs-sidebar { display: none; }
  .docs-main { margin-left: 0; padding: 24px 16px 40px; }
}
