/*
 * EventIQ design tokens + component styles (DESIGN_SYSTEM.md, ADR-0020).
 *
 * This stylesheet is the SINGLE place raw colour/size literals are allowed
 * (rule 09-design-tokens): the `:root` palette below defines every raw value
 * once as a CSS custom property, semantic tokens map onto the palette, and all
 * component classes consume ONLY `var(--eq-*)`. Components (TS/TSX) and apps
 * never use raw hex/px — that is lint-enforced.
 *
 * Light theme for v1; the token layer makes additional/per-tenant themes a
 * token-map override, not a component change.
 */

/* ============================================================
 * Raw palette — the ONLY place raw hex values are declared.
 * ============================================================ */
:root {
  --eq-palette-white: #ffffff;
  --eq-palette-slate-50: #f8fafc;
  --eq-palette-slate-100: #f1f5f9;
  --eq-palette-slate-200: #e2e8f0;
  --eq-palette-slate-300: #cbd5e1;
  --eq-palette-slate-400: #94a3b8;
  --eq-palette-slate-500: #64748b;
  --eq-palette-slate-600: #475569;
  --eq-palette-slate-700: #334155;
  --eq-palette-slate-800: #1e293b;
  --eq-palette-slate-900: #0f172a;

  --eq-palette-blue-50: #eff6ff;
  --eq-palette-blue-100: #dbeafe;
  --eq-palette-blue-500: #3b82f6;
  --eq-palette-blue-600: #2563eb;
  --eq-palette-blue-700: #1d4ed8;

  --eq-palette-green-50: #ecfdf5;
  --eq-palette-green-500: #16a34a;
  --eq-palette-green-700: #15803d;

  --eq-palette-amber-50: #fffbeb;
  --eq-palette-amber-500: #d97706;
  --eq-palette-amber-700: #b45309;

  --eq-palette-red-50: #fef2f2;
  --eq-palette-red-500: #dc2626;
  --eq-palette-red-700: #b91c1c;

  /* EventIQ brand palette (Coolors: e63946 f1faee a8dadc 457b9d 1d3557) */
  --eq-palette-brand-coral: #e63946;
  --eq-palette-brand-cream: #f1faee;
  --eq-palette-brand-teal: #a8dadc;
  --eq-palette-brand-steel: #457b9d;
  --eq-palette-brand-navy: #1d3557;

  /* Shadows reference slate-900 at low alpha; declared raw here only. */
  --eq-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --eq-shadow-md: 0 2px 8px rgba(15, 23, 42, 0.1);
  --eq-shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);

  /* ==========================================================
   * Semantic colour tokens (components reference these).
   * ========================================================== */
  --eq-color-background: var(--eq-palette-slate-50);
  --eq-color-surface: var(--eq-palette-white);
  --eq-color-surface-muted: var(--eq-palette-slate-100);
  --eq-color-border: var(--eq-palette-slate-200);
  --eq-color-border-strong: var(--eq-palette-slate-300);

  --eq-color-text: var(--eq-palette-slate-900);
  --eq-color-text-muted: var(--eq-palette-slate-500);
  /* Subtle text that still meets AA on muted/subtle surfaces (e.g. badges). */
  --eq-color-text-subtle: var(--eq-palette-slate-700);
  --eq-color-text-inverse: var(--eq-palette-white);

  --eq-color-brand: var(--eq-palette-blue-600);
  --eq-color-brand-hover: var(--eq-palette-blue-700);
  --eq-color-brand-subtle: var(--eq-palette-blue-50);
  --eq-color-focus-ring: var(--eq-palette-blue-500);

  /* App top bar (dark brand strip) */
  --eq-color-topbar-bg: var(--eq-palette-slate-900);
  --eq-color-topbar-border: var(--eq-palette-slate-800);
  --eq-color-topbar-text: var(--eq-palette-white);
  --eq-color-topbar-text-muted: var(--eq-palette-slate-400);
  --eq-color-topbar-control-hover: rgba(255, 255, 255, 0.1);
  --eq-color-scrim: rgba(15, 23, 42, 0.45);
  --eq-topbar-control-size: 32px;
  --eq-topbar-logo-height: 36px;
  --eq-topbar-height: calc((var(--eq-topbar-logo-height) + var(--eq-space-3) * 2) * 1.171875);
  --eq-topbar-padding-block: calc((var(--eq-topbar-height) - var(--eq-topbar-logo-height)) / 2);

  --eq-color-avatar-bg: var(--eq-color-surface-muted);
  --eq-color-avatar-fg: var(--eq-color-text);
  --eq-color-avatar-border: var(--eq-color-border);

  /* Auth / sign-in split layout (unauthenticated entry screens) */
  --eq-color-auth-panel-bg: var(--eq-palette-white);
  --eq-color-auth-page-bg: var(--eq-palette-brand-cream);
  --eq-color-auth-heading: var(--eq-palette-brand-navy);
  --eq-color-auth-eyebrow: var(--eq-palette-brand-steel);
  --eq-color-auth-muted: var(--eq-palette-slate-500);
  --eq-color-auth-accent: var(--eq-palette-brand-coral);
  --eq-color-auth-primary: var(--eq-palette-brand-steel);
  --eq-color-auth-primary-hover: var(--eq-palette-brand-navy);
  --eq-color-auth-subtle: var(--eq-palette-brand-teal);
  --eq-color-auth-divider: var(--eq-palette-brand-teal);
  --eq-color-auth-hero-overlay: color-mix(in srgb, var(--eq-palette-brand-navy) 28%, transparent);

  /* Semantic status — paired fg/bg/solid so status is never colour-only
   * (icon + label always accompany colour, WCAG). */
  --eq-color-status-healthy-fg: var(--eq-palette-green-700);
  --eq-color-status-healthy-bg: var(--eq-palette-green-50);
  --eq-color-status-healthy-solid: var(--eq-palette-green-500);

  --eq-color-status-warning-fg: var(--eq-palette-amber-700);
  --eq-color-status-warning-bg: var(--eq-palette-amber-50);
  --eq-color-status-warning-solid: var(--eq-palette-amber-500);

  --eq-color-status-critical-fg: var(--eq-palette-red-700);
  --eq-color-status-critical-bg: var(--eq-palette-red-50);
  --eq-color-status-critical-solid: var(--eq-palette-red-500);

  --eq-color-status-stale-fg: var(--eq-palette-slate-600);
  --eq-color-status-stale-bg: var(--eq-palette-slate-100);
  --eq-color-status-stale-solid: var(--eq-palette-slate-400);

  /* ========================================================== Spacing scale */
  --eq-space-0: 0;
  --eq-space-1: 2px;
  --eq-space-2: 4px;
  --eq-space-3: 8px;
  --eq-space-4: 12px;
  --eq-space-5: 16px;
  --eq-space-6: 24px;
  --eq-space-7: 32px;
  --eq-space-8: 48px;
  --eq-space-9: 64px;

  /* Chart plot heights (Recharts containers, ADR-0026) */
  --eq-chart-plot-height: 12rem;
  --eq-chart-plot-height-donut: 10rem;

  /* App shell */
  --eq-shell-sidebar-width: 16rem;
  --eq-shell-sidebar-padding-block: var(--eq-space-5);
  --eq-shell-sidebar-padding-inline: var(--eq-space-5);
  --eq-shell-main-padding-inline: calc(var(--eq-space-6) * 0.75 * 1.5);
  --eq-shell-main-padding-block-start: var(--eq-shell-sidebar-padding-block);
  --eq-shell-main-padding-block-end: calc(var(--eq-space-6) * 0.75);

  /* ====================================================== Typography scale */
  --eq-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --eq-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --eq-font-size-xs: 12px;
  --eq-font-size-sm: 14px;
  --eq-font-size-md: 16px;
  --eq-font-size-lg: 20px;
  --eq-font-size-xl: 24px;
  --eq-font-size-2xl: 32px;
  --eq-font-weight-regular: 400;
  --eq-font-weight-medium: 500;
  --eq-font-weight-semibold: 600;
  --eq-font-weight-bold: 700;
  --eq-line-height-tight: 1.2;
  --eq-line-height-normal: 1.5;
  /* Single-line text control block size (input + select). */
  --eq-input-block-size: calc(
    var(--eq-space-3) * 2 + var(--eq-font-size-sm) * var(--eq-line-height-tight) + 2px
  );
  /* Small control (sm button) block size — used to size adjacent dividers/rules. */
  --eq-control-block-size-sm: calc(
    var(--eq-space-2) * 2 + var(--eq-font-size-xs) * var(--eq-line-height-tight) + 2px
  );

  /* ========================================================== Radius scale */
  --eq-radius-sm: 4px;
  --eq-radius-md: 8px;
  --eq-radius-lg: 16px;
  --eq-radius-pill: 999px;

  /* ======================================================== Z-index scale */
  --eq-z-base: 0;
  --eq-z-sticky: 100;
  --eq-z-overlay: 200;
  --eq-z-modal: 300;
  --eq-z-toast: 400;

  /* ============================================================== Motion */
  --eq-motion-duration-fast: 120ms;
  --eq-motion-duration-base: 200ms;
  --eq-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
}

/* Respect reduced-motion (also makes visual-regression deterministic). */
@media (prefers-reduced-motion: reduce) {
  :root {
    --eq-motion-duration-fast: 0ms;
    --eq-motion-duration-base: 0ms;
  }
}

/* ============================================================
 * Base / reset
 * ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--eq-color-background);
  color: var(--eq-color-text);
  font-family: var(--eq-font-sans);
  font-size: var(--eq-font-size-md);
  line-height: var(--eq-line-height-normal);
  -webkit-font-smoothing: antialiased;
}

/* A consistent, visible focus ring for keyboard users across components. */
.eq-focusable:focus-visible,
.eq-btn:focus-visible,
.eq-input:focus-visible,
.eq-tab:focus-visible,
.eq-toggle:focus-visible {
  outline: var(--eq-space-1) solid var(--eq-color-focus-ring);
  outline-offset: var(--eq-space-1);
}

/* Visually-hidden but screen-reader-available. Apply to a block wrapper — not
 * directly to table elements, whose intrinsic row height ignores 1px sizing. */
.eq-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-content link: off-screen until focused, then pinned top-left so a
 * keyboard user can bypass the topbar nav (WCAG 2.4.1). */
.eq-skip-link {
  position: absolute;
  left: var(--eq-space-3);
  top: calc(-1 * var(--eq-space-8));
  z-index: var(--eq-z-toast);
  background: var(--eq-color-surface);
  color: var(--eq-color-text);
  border: 1px solid var(--eq-color-border-strong);
  border-radius: var(--eq-radius-md);
  padding: var(--eq-space-2) var(--eq-space-4);
  text-decoration: none;
}
.eq-skip-link:focus {
  top: var(--eq-space-3);
}
.eq-shell__main:focus {
  outline: none;
}

/* Inline card heading that reads as a heading for AT but keeps body-text size
 * (used for selectable event cards so screen readers can list-navigate them). */
.eq-card-heading {
  margin: 0;
  font-size: var(--eq-font-size-md);
  font-weight: var(--eq-font-weight-bold);
}

/* Centered single-panel layout for unauthenticated screens (sign-in, denied). */
.eq-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--eq-space-6);
  background: var(--eq-color-auth-page-bg);
}
.eq-auth__panel {
  width: 100%;
  max-width: 28rem;
}

/* Split-screen auth layout (sign-in reference). */
.eq-auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--eq-color-auth-page-bg);
}
.eq-auth-split__panel {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--eq-space-8);
  background: var(--eq-color-auth-panel-bg);
}
.eq-auth-split__brand {
  display: flex;
  align-items: center;
  gap: var(--eq-space-3);
  line-height: 0;
}
.eq-auth-split__wordmark {
  font-size: var(--eq-font-size-xl);
  font-weight: var(--eq-font-weight-bold);
  color: var(--eq-color-auth-heading);
  line-height: var(--eq-line-height-tight);
  letter-spacing: -0.02em;
}
.eq-auth-split__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
}
.eq-auth-split__eyebrow {
  margin: 0 0 var(--eq-space-2);
  font-size: var(--eq-font-size-sm);
  font-weight: var(--eq-font-weight-medium);
  color: var(--eq-color-auth-eyebrow);
}
.eq-auth-split__title {
  margin: 0 0 var(--eq-space-3);
  font-size: var(--eq-font-size-2xl);
  font-weight: var(--eq-font-weight-bold);
  line-height: var(--eq-line-height-tight);
  color: var(--eq-color-auth-heading);
  letter-spacing: -0.02em;
}
.eq-auth-split__subtitle {
  margin: 0 0 var(--eq-space-6);
  font-size: var(--eq-font-size-sm);
  line-height: var(--eq-line-height-normal);
  color: var(--eq-color-auth-muted);
}
.eq-auth-split__content {
  display: grid;
  gap: var(--eq-space-5);
}
.eq-auth-split__tagline {
  margin: var(--eq-space-6) 0 0;
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-auth-muted);
  text-align: center;
}
.eq-auth-split__footer {
  margin-top: var(--eq-space-6);
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-auth-muted);
  text-align: center;
}
.eq-auth-split__hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--eq-color-auth-subtle);
}
.eq-auth-split__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--eq-color-auth-hero-overlay);
  pointer-events: none;
}
.eq-auth-split__hero-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.eq-auth-divider {
  display: flex;
  align-items: center;
  gap: var(--eq-space-4);
  color: var(--eq-color-auth-muted);
  font-size: var(--eq-font-size-xs);
}
.eq-auth-divider::before,
.eq-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--eq-color-auth-divider);
}
.eq-auth-divider span {
  white-space: nowrap;
}
.eq-auth-test {
  display: grid;
  gap: var(--eq-space-4);
  padding: var(--eq-space-5);
  border: 1px solid var(--eq-color-auth-divider);
  border-radius: var(--eq-radius-lg);
  background: var(--eq-color-auth-page-bg);
}
.eq-auth-test__label {
  margin: 0;
  font-size: var(--eq-font-size-xs);
  font-weight: var(--eq-font-weight-semibold);
  color: var(--eq-color-status-warning-fg);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.eq-btn--auth {
  background: var(--eq-color-auth-primary);
  color: var(--eq-color-text-inverse);
  border-color: var(--eq-color-auth-primary);
}
.eq-btn--auth:hover:not(:disabled) {
  background: var(--eq-color-auth-primary-hover);
  border-color: var(--eq-color-auth-primary-hover);
}
.eq-auth-split--compact {
  min-height: 28rem;
}
.eq-auth-split--compact .eq-auth-split__panel,
.eq-auth-split--compact .eq-auth-split__hero {
  min-height: 28rem;
}

/* Design-system previews (styleguide page only) */
.eq-ds-row--start {
  align-items: flex-start;
  flex-wrap: nowrap;
}
.eq-ds-row--wrap {
  flex-wrap: wrap;
  gap: var(--eq-space-5);
}
.eq-ds-row--spaced {
  margin-top: var(--eq-space-5);
}
.eq-ds-preview-label {
  margin: 0 0 var(--eq-space-3);
  font-size: var(--eq-font-size-xs);
  font-weight: var(--eq-font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--eq-color-text-muted);
}
.eq-ds-sidebar-preview {
  width: var(--eq-shell-sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 16rem;
  padding: var(--eq-space-5);
  background: var(--eq-color-surface);
  border: 1px solid var(--eq-color-border);
  border-radius: var(--eq-radius-md);
}
/* Fixed-height, clipped frame for the MapLibre basemap / location-picker
   showcases. A ready geographic map, its grid fallback, and a picker that renders
   nothing when the basemap is unreachable all have different heights; pinning the
   frame keeps the long design-system page a stable height for visual regression
   no matter which renders (the frame is masked in the snapshot). */
.eq-ds-map-frame {
  height: 18rem;
  overflow: hidden;
  border-radius: var(--eq-radius-md);
}
.eq-ds-auth-preview {
  overflow: hidden;
  border: 1px solid var(--eq-color-border);
  border-radius: var(--eq-radius-lg);
  max-height: 28rem;
}
.eq-ds-auth-preview__hero {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--eq-palette-brand-teal), var(--eq-palette-brand-steel));
}
.eq-ds-display-preview {
  overflow: hidden;
  border: 1px solid var(--eq-color-border);
  border-radius: var(--eq-radius-lg);
  max-width: 22rem;
  aspect-ratio: 9 / 16;
  max-height: 36rem;
}
.eq-auth-split__footer p {
  margin: 0;
}

/* ============================================================
 * Button
 * ============================================================ */
.eq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--eq-space-3);
  font-family: var(--eq-font-sans);
  font-size: var(--eq-font-size-sm);
  font-weight: var(--eq-font-weight-medium);
  line-height: var(--eq-line-height-tight);
  border-radius: var(--eq-radius-md);
  border: 1px solid transparent;
  padding: var(--eq-space-3) var(--eq-space-5);
  cursor: pointer;
  transition:
    background var(--eq-motion-duration-fast) var(--eq-motion-easing-standard),
    border-color var(--eq-motion-duration-fast) var(--eq-motion-easing-standard);
  white-space: nowrap;
}
.eq-btn:disabled,
.eq-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.eq-btn--primary {
  background: var(--eq-color-brand);
  color: var(--eq-color-text-inverse);
}
.eq-btn--primary:hover:not(:disabled) {
  background: var(--eq-color-brand-hover);
}
.eq-btn--secondary {
  background: var(--eq-color-surface);
  color: var(--eq-color-text);
  border-color: var(--eq-color-border-strong);
}
.eq-btn--secondary:hover:not(:disabled) {
  background: var(--eq-color-surface-muted);
}
.eq-btn--ghost {
  background: transparent;
  color: var(--eq-color-brand);
}
.eq-btn--ghost:hover:not(:disabled) {
  background: var(--eq-color-brand-subtle);
}
.eq-btn--danger {
  background: var(--eq-color-status-critical-solid);
  color: var(--eq-color-text-inverse);
}
.eq-btn--sm {
  font-size: var(--eq-font-size-xs);
  padding: var(--eq-space-2) var(--eq-space-4);
}
.eq-btn--icon-only {
  inline-size: var(--eq-input-block-size);
  block-size: var(--eq-input-block-size);
  min-inline-size: var(--eq-input-block-size);
  max-inline-size: var(--eq-input-block-size);
  min-block-size: var(--eq-input-block-size);
  max-block-size: var(--eq-input-block-size);
  padding: 0;
  gap: 0;
  flex-shrink: 0;
  border-radius: var(--eq-radius-md);
  aspect-ratio: 1;
}
.eq-btn--block {
  width: 100%;
}

/* ============================================================
 * Card
 * ============================================================ */
.eq-card {
  background: var(--eq-color-surface);
  border: 1px solid var(--eq-color-border);
  border-radius: var(--eq-radius-lg);
  box-shadow: var(--eq-shadow-sm);
  padding: var(--eq-space-6);
}
.eq-card--flush {
  padding: 0;
}
.eq-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--eq-space-4);
  margin-bottom: var(--eq-space-5);
}
.eq-card__title {
  margin: 0;
  font-size: var(--eq-font-size-md);
  font-weight: var(--eq-font-weight-semibold);
}

/* ============================================================
 * Badge / Tag
 * ============================================================ */
.eq-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--eq-space-2);
  font-size: var(--eq-font-size-xs);
  font-weight: var(--eq-font-weight-medium);
  padding: var(--eq-space-1) var(--eq-space-3);
  border-radius: var(--eq-radius-pill);
  background: var(--eq-color-surface-muted);
  color: var(--eq-color-text-subtle);
  border: 1px solid var(--eq-color-border);
}

/* ============================================================
 * Avatar — initials placeholder
 * ============================================================ */
.eq-avatar {
  --eq-avatar-size: 32px;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--eq-avatar-size);
  height: var(--eq-avatar-size);
  border-radius: var(--eq-radius-pill);
  border: 1px solid var(--eq-color-avatar-border);
  background: var(--eq-color-avatar-bg);
  color: var(--eq-color-avatar-fg);
  font-size: var(--eq-font-size-xs);
  font-weight: var(--eq-font-weight-semibold);
  line-height: 1;
  user-select: none;
}
.eq-avatar--topbar {
  background: var(--eq-palette-white);
  color: var(--eq-palette-slate-900);
  border-color: var(--eq-palette-white);
}

/* ============================================================
 * IconButton — circular icon-only control
 * ============================================================ */
.eq-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  line-height: 0;
  font: inherit;
  background: transparent;
  color: inherit;
}
.eq-icon-btn:focus-visible {
  outline: 2px solid var(--eq-color-focus-ring);
  outline-offset: 2px;
}
.eq-icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.eq-icon-btn--topbar {
  width: var(--eq-topbar-control-size);
  height: var(--eq-topbar-control-size);
  background: var(--eq-palette-white);
  color: var(--eq-palette-slate-900);
  border-color: var(--eq-palette-white);
}
.eq-shell__topbar .eq-shell__context .eq-icon-btn--topbar:hover:not(:disabled) {
  background: var(--eq-palette-slate-100);
  border-color: var(--eq-palette-slate-100);
}
.eq-shell__topbar .eq-shell__context form {
  display: inline-flex;
  margin: 0;
}

/* ============================================================
 * StatusPill — colour ALWAYS paired with icon + label (never colour-only).
 * ============================================================ */
.eq-status {
  display: inline-flex;
  align-items: center;
  gap: var(--eq-space-2);
  font-size: var(--eq-font-size-xs);
  font-weight: var(--eq-font-weight-semibold);
  padding: var(--eq-space-1) var(--eq-space-3);
  border-radius: var(--eq-radius-pill);
  border: 1px solid transparent;
}
.eq-status__icon {
  flex: none;
}
.eq-status--healthy {
  background: var(--eq-color-status-healthy-bg);
  color: var(--eq-color-status-healthy-fg);
}
.eq-status--warning {
  background: var(--eq-color-status-warning-bg);
  color: var(--eq-color-status-warning-fg);
}
.eq-status--critical {
  background: var(--eq-color-status-critical-bg);
  color: var(--eq-color-status-critical-fg);
}
.eq-status--stale {
  background: var(--eq-color-status-stale-bg);
  color: var(--eq-color-status-stale-fg);
}

/* ============================================================
 * Form fields
 * ============================================================ */
.eq-field {
  display: grid;
  gap: var(--eq-space-2);
}
.eq-field__label {
  font-size: var(--eq-font-size-sm);
  font-weight: var(--eq-font-weight-medium);
  color: var(--eq-color-text);
}
.eq-field__hint {
  font-size: var(--eq-font-size-xs);
  color: var(--eq-color-text-muted);
}
.eq-field--icon-action {
  flex: 0 0 auto;
  inline-size: auto;
  min-inline-size: 0;
}
.eq-row > .eq-field.eq-field--icon-action {
  flex: 0 0 auto;
  min-width: 0;
}
.eq-input {
  font-family: var(--eq-font-sans);
  font-size: var(--eq-font-size-sm);
  line-height: calc(var(--eq-input-block-size) - 2px);
  color: var(--eq-color-text);
  background: var(--eq-color-surface);
  border: 1px solid var(--eq-color-border-strong);
  border-radius: var(--eq-radius-md);
  padding-block: 0;
  padding-inline: var(--eq-space-4);
  width: 100%;
  block-size: var(--eq-input-block-size);
}
.eq-input:disabled {
  background: var(--eq-color-surface-muted);
  cursor: not-allowed;
}
.eq-input--error {
  border-color: var(--eq-color-status-critical-solid);
}
/* Native selects keep platform chrome in Safari unless appearance is reset.
 * Chevron matches Icon chevron-down; stroke colour is --eq-palette-slate-500
 * (--eq-color-text-muted). */
select.eq-input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-inline-end: calc(var(--eq-space-4) + var(--eq-space-5));
  background-color: var(--eq-color-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--eq-space-4) center;
  background-size: var(--eq-space-5) var(--eq-space-5);
}
select.eq-input:disabled {
  cursor: not-allowed;
}
.eq-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--eq-space-3);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text);
}
.eq-toggle__track {
  width: var(--eq-space-8);
  height: var(--eq-space-5);
  border-radius: var(--eq-radius-pill);
  background: var(--eq-color-border-strong);
  transition: background var(--eq-motion-duration-fast) var(--eq-motion-easing-standard);
  flex: none;
  position: relative;
}
.eq-toggle[aria-checked="true"] .eq-toggle__track {
  background: var(--eq-color-brand);
}
.eq-toggle__thumb {
  position: absolute;
  top: var(--eq-space-1);
  left: var(--eq-space-1);
  width: var(--eq-space-4);
  height: var(--eq-space-4);
  border-radius: var(--eq-radius-pill);
  background: var(--eq-color-surface);
  transition: transform var(--eq-motion-duration-fast) var(--eq-motion-easing-standard);
}
.eq-toggle[aria-checked="true"] .eq-toggle__thumb {
  transform: translateX(var(--eq-space-5));
}

/* ============================================================
 * Table
 * ============================================================ */
.eq-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.eq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--eq-font-size-sm);
}
.eq-table th,
.eq-table td {
  text-align: left;
  padding: var(--eq-space-3) var(--eq-space-4);
  border-bottom: 1px solid var(--eq-color-border);
}
.eq-table th {
  font-weight: var(--eq-font-weight-semibold);
  color: var(--eq-color-text-muted);
  font-size: var(--eq-font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.eq-table tbody tr:hover {
  background: var(--eq-color-surface-muted);
}
/* Sortable header trigger — inherits the th typography so sortable and plain
 * headers render identically; the arrow is decorative (aria-sort on the th). */
.eq-table__sort {
  display: inline-flex;
  align-items: center;
  gap: var(--eq-space-2);
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  border-radius: var(--eq-radius-sm);
}
.eq-table__sort:hover {
  color: var(--eq-color-text);
}
.eq-table__sort:focus-visible {
  outline: 2px solid var(--eq-color-focus-ring);
  outline-offset: 2px;
}
.eq-table__sort-indicator {
  display: inline-block;
  min-width: var(--eq-space-4);
}

/* ============================================================
 * Tabs
 * ============================================================ */
.eq-tabs {
  display: flex;
  gap: var(--eq-space-2);
  border-bottom: 1px solid var(--eq-color-border);
}
.eq-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: var(--eq-space-3) var(--eq-space-4);
  font-size: var(--eq-font-size-sm);
  font-weight: var(--eq-font-weight-medium);
  color: var(--eq-color-text-muted);
  cursor: pointer;
}
.eq-tab[aria-selected="true"] {
  color: var(--eq-color-brand);
  border-bottom-color: var(--eq-color-brand);
}

/* ============================================================
 * Tooltip
 * ============================================================ */
.eq-tooltip {
  position: relative;
  display: inline-flex;
}
.eq-tooltip__bubble {
  position: absolute;
  bottom: calc(100% + var(--eq-space-2));
  left: 50%;
  transform: translateX(-50%);
  background: var(--eq-palette-slate-900);
  color: var(--eq-color-text-inverse);
  font-size: var(--eq-font-size-xs);
  padding: var(--eq-space-2) var(--eq-space-3);
  border-radius: var(--eq-radius-sm);
  max-width: 16rem;
  white-space: normal;
  text-align: center;
  z-index: var(--eq-z-overlay);
  box-shadow: var(--eq-shadow-md);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--eq-motion-duration-fast) var(--eq-motion-easing-standard),
    visibility var(--eq-motion-duration-fast) var(--eq-motion-easing-standard);
}
.eq-tooltip:not(.eq-tooltip--dismissed):hover .eq-tooltip__bubble,
.eq-tooltip:not(.eq-tooltip--dismissed):focus-within .eq-tooltip__bubble {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
 * Modal / Drawer
 * ============================================================ */
.eq-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  z-index: var(--eq-z-modal);
}
.eq-overlay--center {
  align-items: center;
  justify-content: center;
  padding: var(--eq-space-5);
}
.eq-overlay--right {
  justify-content: flex-end;
}
.eq-modal {
  background: var(--eq-color-surface);
  border-radius: var(--eq-radius-lg);
  box-shadow: var(--eq-shadow-lg);
  padding: var(--eq-space-6);
  max-width: 32rem;
  width: 100%;
}
.eq-drawer {
  background: var(--eq-color-surface);
  box-shadow: var(--eq-shadow-lg);
  padding: var(--eq-space-6);
  width: 24rem;
  max-width: 100%;
  height: 100%;
  overflow-y: auto;
}

/* ============================================================
 * Toast
 * ============================================================ */
.eq-toast-region {
  position: fixed;
  bottom: var(--eq-space-6);
  right: var(--eq-space-6);
  display: grid;
  gap: var(--eq-space-3);
  z-index: var(--eq-z-toast);
}
.eq-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--eq-space-3);
  background: var(--eq-color-surface);
  border: 1px solid var(--eq-color-border);
  border-left: var(--eq-space-2) solid var(--eq-color-brand);
  border-radius: var(--eq-radius-md);
  box-shadow: var(--eq-shadow-md);
  padding: var(--eq-space-4) var(--eq-space-5);
  font-size: var(--eq-font-size-sm);
  max-width: 24rem;
}
.eq-toast__icon {
  flex: none;
  color: var(--eq-color-brand);
}
.eq-toast__msg {
  flex: 1 1 auto;
}
.eq-toast__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--eq-color-text-subtle);
  cursor: pointer;
  border-radius: var(--eq-radius-sm);
  padding: var(--eq-space-1);
}
.eq-toast__close:hover {
  color: var(--eq-color-text);
}
.eq-toast--critical {
  border-left-color: var(--eq-color-status-critical-solid);
}
.eq-toast--critical .eq-toast__icon {
  color: var(--eq-color-status-critical-solid);
}
.eq-toast--warning {
  border-left-color: var(--eq-color-status-warning-solid);
}
.eq-toast--warning .eq-toast__icon {
  color: var(--eq-color-status-warning-solid);
}
.eq-toast--healthy {
  border-left-color: var(--eq-color-status-healthy-solid);
}
.eq-toast--healthy .eq-toast__icon {
  color: var(--eq-color-status-healthy-solid);
}

/* ============================================================
 * Skeleton / Spinner
 * ============================================================ */
.eq-skeleton {
  background: var(--eq-color-surface-muted);
  border-radius: var(--eq-radius-sm);
  animation: eq-pulse 1.2s ease-in-out infinite;
}
@keyframes eq-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
.eq-spinner {
  display: inline-block;
  width: var(--eq-space-5);
  height: var(--eq-space-5);
  border: 2px solid var(--eq-color-border-strong);
  border-top-color: var(--eq-color-brand);
  border-radius: var(--eq-radius-pill);
  animation: eq-spin 0.7s linear infinite;
}
@keyframes eq-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .eq-skeleton,
  .eq-spinner {
    animation: none;
  }
}

/* ============================================================
 * MetricStat
 * ============================================================ */
.eq-metric {
  display: grid;
  gap: var(--eq-space-2);
}
.eq-metric__label {
  font-size: var(--eq-font-size-xs);
  color: var(--eq-color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.eq-metric__value {
  font-size: var(--eq-font-size-2xl);
  font-weight: var(--eq-font-weight-bold);
  line-height: var(--eq-line-height-tight);
}
.eq-metric__unit {
  font-size: var(--eq-font-size-md);
  font-weight: var(--eq-font-weight-medium);
  color: var(--eq-color-text-muted);
  margin-left: var(--eq-space-2);
}

/* ============================================================
 * Freshness indicator
 * ============================================================ */
.eq-freshness {
  display: inline-flex;
  align-items: center;
  gap: var(--eq-space-2);
  font-size: var(--eq-font-size-xs);
  color: var(--eq-color-text-muted);
}
.eq-freshness--stale {
  color: var(--eq-color-status-stale-fg);
  font-weight: var(--eq-font-weight-semibold);
}

/* ============================================================
 * Empty / Error states
 * ============================================================ */
.eq-state {
  display: grid;
  gap: var(--eq-space-3);
  justify-items: center;
  text-align: center;
  padding: var(--eq-space-8) var(--eq-space-6);
  color: var(--eq-color-text-muted);
}
.eq-state__title {
  margin: 0;
  font-size: var(--eq-font-size-md);
  font-weight: var(--eq-font-weight-semibold);
  color: var(--eq-color-text);
}

/* ============================================================
 * PageHeader
 * ============================================================ */
.eq-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--eq-space-5);
  flex-wrap: wrap;
  margin-bottom: var(--eq-space-6);
}
.eq-page-header__title {
  margin: 0;
  font-size: var(--eq-font-size-xl);
  font-weight: var(--eq-font-weight-bold);
  line-height: var(--eq-line-height-tight);
}
.eq-page-header__subtitle {
  margin: var(--eq-space-2) 0 0;
  color: var(--eq-color-text-muted);
  font-size: var(--eq-font-size-sm);
}
.eq-page-header__actions {
  display: flex;
  align-items: center;
  gap: var(--eq-space-3);
}

/* ============================================================
 * App shell / layout
 * ============================================================ */
.eq-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.eq-shell__body {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: var(--eq-shell-sidebar-width) minmax(0, 1fr);
  align-items: start;
}
.eq-shell__body:not(:has(.eq-shell__sidebar)) {
  grid-template-columns: minmax(0, 1fr);
}
/* Mobile nav controls (R-33): hidden on desktop, surfaced at ≤768px. */
.eq-shell__nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--eq-topbar-control-size);
  height: var(--eq-topbar-control-size);
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--eq-radius-md);
  background: transparent;
  color: var(--eq-color-topbar-text);
  cursor: pointer;
  flex-shrink: 0;
}
.eq-shell__nav-toggle:hover {
  background: var(--eq-color-topbar-control-hover);
}
.eq-shell__nav-toggle:focus-visible {
  outline: 2px solid var(--eq-color-focus-ring);
  outline-offset: 2px;
}
.eq-shell__nav-backdrop {
  display: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.eq-shell__sidebar {
  position: sticky;
  top: var(--eq-topbar-height);
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: var(--eq-shell-sidebar-width);
  height: calc(100vh - var(--eq-topbar-height));
  max-height: calc(100vh - var(--eq-topbar-height));
  padding: var(--eq-shell-sidebar-padding-block) var(--eq-shell-sidebar-padding-inline);
  background: var(--eq-color-surface);
  border-right: 1px solid var(--eq-color-border);
  overflow: hidden;
}
.eq-shell__topbar {
  position: sticky;
  top: 0;
  z-index: var(--eq-z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--eq-space-4);
  min-height: var(--eq-topbar-height);
  padding: var(--eq-topbar-padding-block) var(--eq-space-6);
  background: var(--eq-color-topbar-bg);
  border-bottom: 1px solid var(--eq-color-topbar-border);
}
.eq-shell__brand {
  display: flex;
  align-items: center;
  gap: var(--eq-space-3);
  line-height: 0;
  text-decoration: none;
}
.eq-shell__brand-logo {
  display: block;
}
.eq-shell__context {
  display: flex;
  align-items: center;
  gap: var(--eq-space-3);
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-topbar-text-muted);
  flex-wrap: wrap;
}
.eq-shell__topbar .eq-shell__context span:not([aria-hidden="true"]):not(.eq-badge):not(.eq-avatar) {
  color: var(--eq-color-topbar-text);
}
.eq-shell__topbar .eq-shell__context .eq-avatar--topbar {
  background: var(--eq-palette-white);
  color: var(--eq-palette-slate-900);
  border-color: var(--eq-palette-white);
}
.eq-shell__topbar .eq-shell__context .eq-badge {
  color: var(--eq-color-text-subtle);
  background: var(--eq-color-surface);
}
.eq-shell__topbar .eq-btn--ghost {
  color: var(--eq-color-topbar-text);
}
.eq-shell__topbar .eq-btn--ghost:hover:not(:disabled) {
  background: var(--eq-color-topbar-control-hover);
}
.eq-shell__topbar .eq-btn--secondary {
  background: transparent;
  color: var(--eq-color-topbar-text);
  border-color: var(--eq-palette-slate-600);
}
.eq-shell__topbar .eq-btn--secondary:hover:not(:disabled) {
  background: var(--eq-color-topbar-control-hover);
}
.eq-shell__main {
  padding: var(--eq-shell-main-padding-block-start) var(--eq-shell-main-padding-inline)
    var(--eq-shell-main-padding-block-end);
  width: 100%;
  min-width: 0;
}

/* Side navigation (AppLayout sidebar) */
.eq-side-nav {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  width: 100%;
}
.eq-side-nav__content {
  display: grid;
  gap: var(--eq-space-5);
  align-content: start;
  min-height: 0;
  overflow-y: auto;
}
.eq-side-nav__footer {
  display: grid;
  gap: var(--eq-space-3);
  padding-top: var(--eq-space-5);
  background: var(--eq-color-surface);
}
.eq-side-nav__version {
  margin: 0;
  width: 100%;
  font-size: var(--eq-font-size-xs);
  color: var(--eq-color-text-muted);
  display: flex;
  justify-content: center;
  text-decoration: none;
  border-radius: var(--eq-radius-sm);
}
.eq-side-nav__version:hover {
  color: var(--eq-color-text);
  text-decoration: underline;
}
.eq-side-nav__version:focus-visible {
  outline: 2px solid var(--eq-color-focus-ring);
  outline-offset: 2px;
}
.eq-changelog {
  display: grid;
  gap: var(--eq-space-6);
}
.eq-changelog__intro {
  margin: 0;
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text-muted);
}
.eq-changelog__release {
  display: grid;
  gap: var(--eq-space-4);
  padding-top: var(--eq-space-5);
  border-top: 1px solid var(--eq-color-border);
}
.eq-changelog__release:first-of-type {
  padding-top: 0;
  border-top: none;
}
.eq-changelog__release-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--eq-space-3);
  margin: 0;
  font-size: var(--eq-font-size-lg);
  font-weight: var(--eq-font-weight-semibold);
  color: var(--eq-color-text);
}
.eq-changelog__release-link {
  color: inherit;
  text-decoration: none;
}
.eq-changelog__release-link:hover {
  color: var(--eq-color-brand);
  text-decoration: underline;
}
.eq-changelog__release-date {
  font-size: var(--eq-font-size-sm);
  font-weight: var(--eq-font-weight-normal);
  color: var(--eq-color-text-muted);
}
.eq-changelog__summary {
  margin: 0;
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text);
}
.eq-changelog__section {
  display: grid;
  gap: var(--eq-space-2);
}
.eq-changelog__section-title {
  margin: 0;
  font-size: var(--eq-font-size-sm);
  font-weight: var(--eq-font-weight-semibold);
  color: var(--eq-color-text);
}
.eq-changelog__list {
  margin: 0;
  padding-left: var(--eq-space-5);
  display: grid;
  gap: var(--eq-space-2);
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text);
}
.eq-changelog__link {
  color: var(--eq-color-brand);
  text-decoration: none;
}
.eq-changelog__link:hover {
  text-decoration: underline;
}
.eq-changelog__code {
  padding: 0 var(--eq-space-1);
  border-radius: var(--eq-radius-sm);
  background: var(--eq-color-surface-muted);
  font-family: var(--eq-font-mono);
  font-size: 0.92em;
}
.eq-app-meta {
  margin: 0;
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text-muted);
}
.eq-side-nav__footer form {
  margin: 0;
  width: 100%;
}
.eq-side-nav__section {
  display: grid;
  gap: var(--eq-space-2);
}
.eq-side-nav__section-title {
  padding: 0 var(--eq-space-3);
  font-size: var(--eq-font-size-xs);
  font-weight: var(--eq-font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--eq-color-text-muted);
}
.eq-side-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--eq-space-1);
}
.eq-side-nav__item,
.eq-side-nav__group {
  margin: 0;
}
.eq-side-nav__group {
  display: grid;
  gap: var(--eq-space-1);
}
.eq-side-nav__list--nested {
  display: none;
}
.eq-side-nav__group--open > .eq-side-nav__list--nested {
  display: grid;
}
.eq-side-nav__link {
  display: block;
  padding: var(--eq-space-3) var(--eq-space-4);
  border-radius: var(--eq-radius-md);
  font-size: var(--eq-font-size-sm);
  font-weight: var(--eq-font-weight-medium);
  color: var(--eq-color-text);
  text-decoration: none;
  border: 1px solid transparent;
}
button.eq-side-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--eq-space-2);
  width: 100%;
  margin: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.eq-side-nav__link:hover {
  background: var(--eq-color-surface-muted);
  color: var(--eq-color-text);
}
.eq-side-nav__link:focus-visible {
  outline: 2px solid var(--eq-color-focus-ring);
  outline-offset: 2px;
}
.eq-side-nav__link--active {
  background: var(--eq-color-brand-subtle);
  color: var(--eq-color-brand);
  border-color: var(--eq-color-border);
  font-weight: var(--eq-font-weight-semibold);
}
.eq-side-nav__disclosure {
  font-size: var(--eq-font-size-md);
  font-weight: var(--eq-font-weight-bold);
  color: var(--eq-color-text);
}
.eq-side-nav__disclosure-label {
  display: inline-flex;
  align-items: center;
  gap: var(--eq-space-2);
  min-width: 0;
}
.eq-side-nav__group-icon {
  flex-shrink: 0;
  color: currentColor;
}
.eq-side-nav__group--open > .eq-side-nav__disclosure {
  color: var(--eq-color-brand);
}
.eq-side-nav__disclosure-icon {
  flex-shrink: 0;
  color: currentColor;
  transition: transform var(--eq-motion-duration-fast) var(--eq-motion-easing-standard);
}
.eq-side-nav__group--open .eq-side-nav__disclosure-icon {
  transform: rotate(0deg);
}
.eq-side-nav__group:not(.eq-side-nav__group--open) .eq-side-nav__disclosure-icon {
  transform: rotate(-90deg);
}
.eq-event-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--eq-space-2);
  align-items: center;
}

/* Styleguide swatch (size/border are token-driven; the colour fill is set inline). */
.eq-swatch {
  width: var(--eq-space-9);
  height: var(--eq-space-9);
  border-radius: var(--eq-radius-md);
  border: 1px solid var(--eq-color-border);
}

/* Layout helpers (token-driven) for composing dashboard screens in apps/web. */
.eq-grid {
  display: grid;
  gap: var(--eq-space-5);
}
.eq-grid--cards {
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  column-gap: var(--eq-space-6);
}
.eq-stack {
  display: grid;
  gap: var(--eq-space-5);
}
.eq-stack.eq-dashboard-toolbar {
  gap: var(--eq-space-3);
}
/* Vertically centre the "Trends: …" caption on the preset button row (matching
 * the sm-control height) so it aligns with the buttons, not the taller group. */
.eq-dashboard-toolbar .eq-row--end > .eq-app-meta {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--eq-control-block-size-sm);
}
.eq-row {
  display: flex;
  align-items: center;
  gap: var(--eq-space-3);
  flex-wrap: wrap;
}
/* Bottom-align when a row mixes label-on-top groups (e.g. FilterGroup: label +
 * controls) with single-line siblings (dividers, meta text), so those siblings
 * line up with the control row rather than centring against the taller group. */
.eq-row--end {
  align-items: flex-end;
}
/* Thin vertical separator between filter groups, sized to the sm-control row so
 * it spans the buttons it divides rather than the full label+control height. */
.eq-filter-divider {
  align-self: flex-end;
  flex: 0 0 auto;
  inline-size: 1px;
  block-size: var(--eq-control-block-size-sm);
  background: var(--eq-color-border);
}
/* Match eq-grid--cards min field width when form fields sit in a horizontal row. */
.eq-row > .eq-field {
  flex: 1 1 15rem;
  min-width: min(100%, 15rem);
}
/* Horizontal create/edit rows: align controls; reserve hint space when mixed. */
.eq-row--fields {
  align-items: flex-end;
  flex-wrap: wrap;
}
.eq-row--fields:has(> .eq-field .eq-field__hint) > .eq-field:not(:has(.eq-field__hint))::after {
  content: "";
  display: block;
  min-block-size: calc(var(--eq-font-size-xs) * var(--eq-line-height-normal));
}
.eq-row--fields:has(> .eq-field .eq-field__hint) > :not(.eq-field) {
  margin-block-end: calc(var(--eq-font-size-xs) * var(--eq-line-height-normal) + var(--eq-space-2));
}

.eq-support-banner {
  justify-content: space-between;
  /* 30% taller banner via increased block padding (keeps inline padding unchanged). */
  padding: calc(var(--eq-space-2) * 1.3) var(--eq-space-4);
  margin-block-end: var(--eq-space-4);
  border-block-end: 1px solid var(--eq-color-border-strong);
  background: color-mix(in srgb, var(--eq-color-status-healthy-solid) 12%, var(--eq-color-surface));
}
.eq-support-banner__message {
  margin: 0;
  flex: 1 1 auto;
}

.eq-event-list-row {
  display: grid;
  gap: var(--eq-space-3);
  padding: var(--eq-space-4) var(--eq-space-5);
  border: 1px solid var(--eq-color-border);
  border-radius: var(--eq-radius-md);
  background: var(--eq-color-surface);
}
.eq-event-list-row__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--eq-space-4);
}
.eq-event-list-row__link {
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.eq-event-list-row__copy {
  min-width: 0;
}
.eq-event-list-row__trailing {
  display: flex;
  align-items: center;
  gap: var(--eq-space-5);
  flex-shrink: 0;
}
.eq-event-list-row__site {
  color: var(--eq-color-text-muted);
  text-align: right;
}
.eq-event-list-row__actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
a.eq-icon-btn:hover {
  color: var(--eq-color-brand);
}

@media (max-width: 768px) {
  .eq-auth-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .eq-auth-split__hero {
    display: none;
  }
  .eq-auth-split__panel {
    padding: var(--eq-space-6);
  }
  /* Mobile nav: hamburger surfaces, sidebar becomes an off-canvas drawer (R-33). */
  .eq-shell__nav-toggle {
    display: inline-flex;
  }
  .eq-shell__topbar {
    padding: var(--eq-topbar-padding-block) var(--eq-space-4);
    gap: var(--eq-space-3);
  }
  .eq-shell__body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .eq-shell__sidebar {
    position: fixed;
    top: var(--eq-topbar-height);
    left: 0;
    z-index: var(--eq-z-overlay);
    width: min(82vw, 20rem);
    max-width: 20rem;
    height: calc(100vh - var(--eq-topbar-height));
    max-height: calc(100vh - var(--eq-topbar-height));
    border-right: 1px solid var(--eq-color-border);
    box-shadow: var(--eq-shadow-lg);
    transform: translateX(-100%);
    transition: transform var(--eq-motion-duration-base) var(--eq-motion-easing-standard);
  }
  .eq-shell--nav-open .eq-shell__sidebar {
    transform: translateX(0);
  }
  .eq-shell--nav-open .eq-shell__nav-backdrop {
    display: block;
    position: fixed;
    inset: var(--eq-topbar-height) 0 0;
    z-index: var(--eq-z-sticky);
    background: var(--eq-color-scrim);
  }
  body.eq-shell-nav-lock {
    overflow: hidden;
  }
  /* Roomier tap targets for touch (R-33). */
  .eq-side-nav__link {
    padding: var(--eq-space-4);
  }
  .eq-shell__main {
    padding: var(--eq-space-3) calc(var(--eq-space-4) * 1.5) calc(var(--eq-space-6) * 0.375);
  }
}

/* Phone breakpoint (≤480px): the drawer spans the full width for reachability. */
@media (max-width: 480px) {
  .eq-shell__sidebar {
    width: 100vw;
    max-width: none;
  }
}

/* ============================================================
 * Charts (ADR-0025) — presentation-only, token-driven SVG/CSS.
 * ============================================================ */
.eq-chart {
  display: grid;
  gap: var(--eq-space-3);
  margin: 0;
  padding: var(--eq-space-4);
  background: var(--eq-color-surface);
  border: 1px solid var(--eq-color-border);
  border-radius: var(--eq-radius-md);
}
.eq-chart__label {
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text-muted);
  margin: 0;
}
/* Compact/inline trend: no frame, chart fills its host (e.g. a schematic slot).
   `inline-size: 100%` is required: as a flex item the figure would otherwise
   size to its Recharts content, which reports zero intrinsic width and collapses
   the plot to 0px (rendering nothing). Filling the host guarantees a measurable
   width for the ResponsiveContainer. */
.eq-chart--compact {
  padding: 0;
  gap: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  block-size: 100%;
  inline-size: 100%;
}
.eq-chart--compact .eq-chart__plot {
  height: 100%;
  min-height: 0;
}
.eq-chart__svg {
  width: 100%;
  height: auto;
  display: block;
}
.eq-chart__plot {
  width: 100%;
  height: var(--eq-chart-plot-height);
  min-height: var(--eq-chart-plot-height);
  min-width: 0;
}
.eq-chart__plot--donut {
  height: var(--eq-chart-plot-height-donut);
  min-height: var(--eq-chart-plot-height-donut);
}
.eq-chart__empty {
  margin: 0;
  padding: var(--eq-space-5);
  text-align: center;
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text-subtle);
  border: 1px dashed var(--eq-color-border);
  border-radius: var(--eq-radius-md);
  background: var(--eq-color-surface-muted);
}
.eq-chart__tooltip {
  display: grid;
  gap: var(--eq-space-1);
  padding: var(--eq-space-3);
  background: var(--eq-color-surface);
  border: 1px solid var(--eq-color-border);
  border-radius: var(--eq-radius-md);
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text);
  box-shadow: var(--eq-shadow-sm);
}
.eq-chart__tooltip-label {
  margin: 0;
  color: var(--eq-color-text-muted);
  font-size: var(--eq-font-size-xs);
}
.eq-chart__tooltip-value {
  margin: 0;
  color: var(--eq-color-text);
  font-weight: 600;
}
.eq-chart__line {
  stroke: var(--eq-color-brand);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.eq-chart__gauge-track,
.eq-chart__gauge-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}
.eq-chart__gauge-track {
  stroke: var(--eq-color-surface-muted);
}
.eq-chart__gauge-fill {
  stroke: var(--eq-color-brand);
}
.eq-chart--gauge {
  text-align: center;
}
.eq-chart__value {
  font-size: var(--eq-font-size-lg);
  font-weight: 600;
  color: var(--eq-color-text);
}
.eq-chart__unit {
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text-muted);
  margin-left: var(--eq-space-2);
}
.eq-chart__bar-track {
  height: var(--eq-space-4);
  background: var(--eq-color-surface-muted);
  border-radius: var(--eq-radius-sm);
  overflow: hidden;
}
.eq-chart__bar-fill {
  height: 100%;
  background: var(--eq-color-brand);
  border-radius: var(--eq-radius-sm);
  transition: width var(--eq-motion-duration-fast);
}
.eq-chart--bar-gauge--healthy .eq-chart__bar-fill {
  background: var(--eq-color-status-healthy-solid);
}
.eq-chart--bar-gauge--warning .eq-chart__bar-fill {
  background: var(--eq-color-status-warning-solid);
}
.eq-chart--bar-gauge--critical .eq-chart__bar-fill {
  background: var(--eq-color-status-critical-solid);
}
.eq-chart--bar-gauge--stale .eq-chart__bar-fill {
  background: var(--eq-color-status-stale-solid);
}
.eq-chart--bar .eq-chart__bar-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--eq-space-3);
}
.eq-chart__bar-row {
  display: grid;
  grid-template-columns: minmax(5rem, 8rem) 1fr auto;
  gap: var(--eq-space-3);
  align-items: center;
}
.eq-chart__bar-row-label {
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.eq-chart__bar-row-value {
  font-size: var(--eq-font-size-sm);
  font-weight: 600;
  color: var(--eq-color-text);
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .eq-chart__bar-fill {
    transition: none;
  }
}
.eq-chart__donut-segment {
  fill: none;
  stroke-width: 16;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
}
.eq-chart__donut-hole {
  fill: var(--eq-color-surface);
}
.eq-chart__legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--eq-space-2);
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text-muted);
}
.eq-chart__legend li {
  display: flex;
  align-items: center;
  gap: var(--eq-space-2);
}
.eq-chart__legend-swatch {
  width: var(--eq-space-4);
  height: var(--eq-space-4);
  border-radius: var(--eq-radius-sm);
  flex-shrink: 0;
}
.eq-chart__timeline {
  display: flex;
  gap: 2px;
  min-height: var(--eq-space-7);
  border-radius: var(--eq-radius-sm);
  overflow: hidden;
}
.eq-chart__timeline-segment {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--eq-space-2);
  min-width: 2rem;
  border-bottom: var(--eq-space-1) solid
    var(--eq-timeline-accent, var(--eq-color-status-stale-solid));
}
.eq-chart__timeline-label {
  font-size: var(--eq-font-size-xs);
  text-transform: capitalize;
}

/* --- Display / totem layout (ADR-0037) ------------------------------------ */
:root {
  --eq-display-zone-name: clamp(1.75rem, 4vmin, 3.5rem);
  --eq-display-zone-meta: clamp(1rem, 2.5vmin, 1.75rem);
  --eq-display-bar-height: clamp(1.5rem, 4vmin, 4rem);
  --eq-display-header: clamp(1.25rem, 3vmin, 2rem);
  --eq-display-gap: clamp(0.75rem, 2vmin, 1.5rem);
  --eq-display-padding: clamp(1rem, 3vmin, 2.5rem);
}
.eq-display {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: var(--eq-display-padding);
  padding-top: max(var(--eq-display-padding), env(safe-area-inset-top));
  padding-bottom: max(var(--eq-display-padding), env(safe-area-inset-bottom));
  background: var(--eq-color-background);
  color: var(--eq-color-text);
}
.eq-display__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--eq-display-gap);
  margin-bottom: var(--eq-display-gap);
}
.eq-display__heading {
  min-width: 0;
}
.eq-display__header-meta {
  flex-shrink: 0;
  align-self: flex-start;
}
.eq-display .eq-freshness--display {
  font-size: var(--eq-display-zone-meta);
  padding: var(--eq-space-2) var(--eq-space-4);
  border-radius: var(--eq-radius-md);
}
.eq-display__title {
  margin: 0;
  font-size: var(--eq-display-header);
  font-weight: 700;
  line-height: 1.1;
}
.eq-display__subtitle {
  margin: var(--eq-space-2) 0 0;
  font-size: var(--eq-display-zone-meta);
  color: var(--eq-color-text-muted);
}
.eq-display__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  min-height: 0;
}
.eq-display__zones {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 0 1 auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: var(--eq-display-gap);
  overflow-y: auto;
  scroll-snap-type: y proximity;
}
.eq-display__zone {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--eq-space-2);
  padding: var(--eq-space-4);
  border-radius: var(--eq-radius-lg);
  background: var(--eq-color-surface);
  border: 1px solid var(--eq-color-border);
  scroll-snap-align: start;
}
.eq-display__zone-name {
  margin: 0;
  font-size: var(--eq-display-zone-name);
  font-weight: 700;
  line-height: 1.1;
}
.eq-display__zone-meta {
  margin: 0;
  font-size: var(--eq-display-zone-meta);
  color: var(--eq-color-text-muted);
}
.eq-display__zone-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--eq-space-3);
  margin-top: var(--eq-space-1);
}
.eq-display__zone-bar-track {
  height: var(--eq-display-bar-height);
  background: var(--eq-color-surface-muted);
  border-radius: var(--eq-radius-sm);
  overflow: hidden;
}
.eq-display__zone-bar-fill {
  height: 100%;
  border-radius: var(--eq-radius-sm);
  transition: width var(--eq-motion-duration-fast);
}
.eq-display__zone-bar--healthy .eq-display__zone-bar-fill {
  background: var(--eq-color-status-healthy-solid);
}
.eq-display__zone-bar--warning .eq-display__zone-bar-fill {
  background: var(--eq-color-status-warning-solid);
}
.eq-display__zone-bar--critical .eq-display__zone-bar-fill {
  background: var(--eq-color-status-critical-solid);
}
.eq-display__zone-bar--stale .eq-display__zone-bar-fill {
  background: var(--eq-color-status-stale-solid);
}
.eq-display__zone-pct {
  font-size: var(--eq-display-zone-meta);
  font-weight: 700;
  line-height: 1;
  min-width: 4ch;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.eq-display__zone-bar--healthy .eq-display__zone-pct {
  color: var(--eq-color-status-healthy-solid);
}
.eq-display__zone-bar--warning .eq-display__zone-pct {
  color: var(--eq-color-status-warning-solid);
}
.eq-display__zone-bar--critical .eq-display__zone-pct {
  color: var(--eq-color-status-critical-solid);
}
.eq-display__zone-bar--stale .eq-display__zone-pct {
  color: var(--eq-color-status-stale-solid);
}
.eq-display__empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: var(--eq-display-zone-meta);
  color: var(--eq-color-text-muted);
}
.eq-display--centered {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.eq-display--centered .eq-display__main {
  flex: 0;
}

/* Cabinet schematic (ADR-0039) — presentation-only regions in packages/ui. */
.eq-cabinet-diagram {
  width: 100%;
  margin: 0;
}
.eq-cabinet-diagram__frame {
  display: grid;
  /* Rack column flexes but stays readable (28rem floor); the sensor column keeps
     a hard floor (14rem) so its inline trend charts always have measurable width
     at laptop viewports rather than being squeezed to 0px by a fixed-width rack. */
  grid-template-columns: minmax(28rem, 1.7fr) minmax(14rem, 1fr);
  grid-template-rows: repeat(6, minmax(6.5rem, 1fr));
  column-gap: var(--eq-space-4);
  row-gap: var(--eq-space-2);
  padding: var(--eq-space-4);
  border: 2px solid var(--eq-color-status-healthy-solid);
  border-radius: var(--eq-radius-lg);
  background: color-mix(in srgb, var(--eq-color-status-healthy-solid) 16%, var(--eq-color-surface));
  align-items: stretch;
}
@media (max-width: 768px) {
  .eq-cabinet-diagram__frame {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, minmax(6.5rem, 1fr)) repeat(6, minmax(6.5rem, 1fr));
  }
}
.eq-field--table-cell .eq-field__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.eq-cabinet-diagram__rack-panel {
  grid-column: 1;
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: subgrid;
  align-self: stretch;
  min-block-size: 0;
  padding: var(--eq-space-2);
}
.eq-cabinet-diagram__rack-panel--type-m {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(6.5rem, 1fr));
  align-content: stretch;
}
@media (max-width: 768px) {
  .eq-cabinet-diagram__rack-panel {
    grid-column: 1;
    grid-row: 1 / span 6;
  }
}
.eq-cabinet-diagram__sensor-panel {
  grid-column: 2;
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: subgrid;
  align-self: stretch;
  min-block-size: 0;
}
@media (max-width: 768px) {
  .eq-cabinet-diagram__sensor-panel {
    grid-column: 1;
    grid-row: 7 / span 6;
  }
}
.eq-cabinet-diagram__slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--eq-space-1);
  block-size: 100%;
  min-block-size: 6.5rem;
  padding: var(--eq-space-2) var(--eq-space-3);
  border: 2px solid var(--eq-color-border);
  border-radius: var(--eq-radius-md);
  background: var(--eq-color-surface);
  text-align: center;
}
/* Populated rack device slot: up/down pill | device + metrics | sync pill. */
.eq-cabinet-diagram__slot--device {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--eq-space-2);
  text-align: center;
}
.eq-cabinet-diagram__slot-pill {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-start;
}
.eq-cabinet-diagram__slot-pill--end {
  justify-content: flex-end;
}
.eq-cabinet-diagram__slot-device {
  flex: 1 1 auto;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--eq-space-1);
}
.eq-cabinet-diagram__slot-device-name {
  font-size: var(--eq-font-size-sm);
  font-weight: var(--eq-font-weight-semibold);
  color: var(--eq-color-text);
  line-height: var(--eq-line-height-tight);
  overflow-wrap: anywhere;
}
.eq-cabinet-diagram__slot-device-metric {
  font-size: var(--eq-font-size-xs);
  font-weight: var(--eq-font-weight-regular);
  /* Primary text (not muted): muted slate falls to ~4.34:1 on the tinted
     warning/critical/stale slot backgrounds, below WCAG AA 4.5:1. */
  color: var(--eq-color-text);
  line-height: var(--eq-line-height-normal);
}
/* Sensor region: name + reading (left), inline 6h trend (right). */
.eq-cabinet-diagram__slot--sensor {
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  gap: var(--eq-space-3);
  text-align: start;
}
.eq-cabinet-diagram__slot-sensor-info {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--eq-space-1);
  inline-size: 40%;
  max-inline-size: 9rem;
  min-inline-size: 0;
}
.eq-cabinet-diagram__slot-reading {
  font-size: var(--eq-font-size-md);
  font-weight: var(--eq-font-weight-semibold);
  color: var(--eq-color-text);
  line-height: var(--eq-line-height-tight);
}
.eq-cabinet-diagram__slot-chart {
  flex: 1 1 auto;
  min-inline-size: 0;
  /* Fixed height (not stretch/100%): a percentage height inside the stretchable
     slot lets the ResponsiveContainer feed its measured size back into layout,
     which never settles and breaks deterministic screenshots. `overflow: hidden`
     clips any transient recharts mount overflow so it can never leak into the
     page height mid-capture. */
  block-size: 4.5rem;
  min-block-size: 0;
  overflow: hidden;
  align-self: center;
  display: flex;
  align-items: stretch;
}
.eq-cabinet-diagram__slot-chart-empty {
  align-self: center;
  font-size: var(--eq-font-size-xs);
  color: var(--eq-color-text);
}
.eq-cabinet-diagram__slot-label {
  font-size: var(--eq-font-size-xs);
  font-weight: var(--eq-font-weight-medium);
  color: var(--eq-color-text);
  line-height: var(--eq-line-height-normal);
}
.eq-cabinet-diagram__slot-sublabel {
  font-size: var(--eq-font-size-xs);
  font-weight: var(--eq-font-weight-regular);
  color: var(--eq-color-text-muted);
  line-height: var(--eq-line-height-normal);
}
.eq-cabinet-diagram__slot--emphasis .eq-cabinet-diagram__slot-label {
  font-size: var(--eq-font-size-sm);
}
.eq-cabinet-diagram__slot--healthy {
  background: var(--eq-color-status-healthy-bg);
  border-color: var(--eq-color-status-healthy-solid);
}
.eq-cabinet-diagram__slot--warning {
  background: var(--eq-color-status-warning-bg);
  border-color: var(--eq-color-status-warning-solid);
}
.eq-cabinet-diagram__slot--critical {
  background: var(--eq-color-status-critical-bg);
  border-color: var(--eq-color-status-critical-solid);
}
.eq-cabinet-diagram__slot--stale {
  background: var(--eq-color-status-stale-bg);
  border-color: var(--eq-color-status-stale-solid);
}
.eq-cabinet-diagram__slot--empty {
  background: var(--eq-color-surface);
  border-color: var(--eq-color-border);
  border-style: dashed;
}
.eq-cabinet-diagram__slot--placeholder {
  background: var(--eq-color-surface);
  border-color: var(--eq-color-border-strong);
  border-style: dashed;
}
.eq-cabinet-diagram__slot--emphasis.eq-cabinet-diagram__slot--placeholder {
  background: var(--eq-color-surface);
  border-color: var(--eq-color-border-strong);
  border-style: dashed;
  border-width: 2px;
}
.eq-cabinet-diagram__slot--emphasis.eq-cabinet-diagram__slot--placeholder
  .eq-cabinet-diagram__slot-sublabel {
  color: var(--eq-color-text-subtle);
}
.eq-cabinet-diagram--fallback {
  max-width: none;
  padding: var(--eq-space-5);
  border: 1px dashed var(--eq-color-border-strong);
  border-radius: var(--eq-radius-md);
  background: var(--eq-color-surface-muted);
}
.eq-cabinet-diagram__fallback {
  margin: 0;
  color: var(--eq-color-text-muted);
  font-size: var(--eq-font-size-sm);
}

/* Device location map (ADR-0047) — relative point plot, no external tiles. */
.eq-device-map {
  display: flex;
  flex-direction: column;
  gap: var(--eq-space-4);
  margin: 0;
}
.eq-device-map__plot {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--eq-color-border);
  border-radius: var(--eq-radius-md);
  background-color: var(--eq-color-surface-muted);
  background-image:
    linear-gradient(to right, var(--eq-color-border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--eq-color-border) 1px, transparent 1px);
  background-size: 10% 10%;
  overflow: hidden;
}
.eq-device-map__marker {
  position: absolute;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: var(--eq-radius-pill);
  border: 2px solid var(--eq-color-surface);
  transform: translate(-50%, -50%);
  box-shadow: var(--eq-shadow-sm);
}
.eq-device-map__dot {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: var(--eq-radius-pill);
  flex: none;
}
.eq-device-map__marker--healthy,
.eq-device-map__dot.eq-device-map__marker--healthy {
  background: var(--eq-color-status-healthy-solid);
}
.eq-device-map__marker--warning,
.eq-device-map__dot.eq-device-map__marker--warning {
  background: var(--eq-color-status-warning-solid);
}
.eq-device-map__marker--critical,
.eq-device-map__dot.eq-device-map__marker--critical {
  background: var(--eq-color-status-critical-solid);
}
.eq-device-map__marker--stale,
.eq-device-map__dot.eq-device-map__marker--stale {
  background: var(--eq-color-status-stale-solid);
}
/* Cabinet markers are square so they read as distinct from round device markers
   beyond colour alone (ADR-0054 §7 / WCAG 1.4.1). */
.eq-device-map__marker--cabinet,
.eq-device-map__dot.eq-device-map__marker--cabinet {
  border-radius: var(--eq-radius-sm);
}
.eq-device-map__legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--eq-space-2);
}
.eq-device-map__legend-item {
  display: flex;
  align-items: center;
  gap: var(--eq-space-2);
}
.eq-device-map__legend-label {
  display: flex;
  flex-direction: column;
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text);
}
.eq-device-map__legend-coord {
  color: var(--eq-color-text-muted);
  font-size: var(--eq-font-size-xs);
}
/* Status text in the accessible list — status is never colour-only (WCAG 1.4.1). */
.eq-device-map__legend-status {
  font-weight: var(--eq-font-weight-medium);
  color: var(--eq-color-text-subtle);
}
.eq-device-map--empty {
  border: 1px dashed var(--eq-color-border-strong);
  border-radius: var(--eq-radius-md);
  padding: var(--eq-space-5);
  background: var(--eq-color-surface-muted);
}
.eq-device-map__empty {
  margin: 0;
  /* Subtle (not muted) so the empty message meets AA contrast on the muted
     surface (slate-500 on slate-100 fails 1.4.3). */
  color: var(--eq-color-text-subtle);
  font-size: var(--eq-font-size-sm);
}

/* Interactive geographic basemap (ADR-0048). Shares the status colours of the
   grid map; the canvas is aria-hidden and the legend list is the a11y source. */
.eq-device-geomap {
  display: flex;
  flex-direction: column;
  gap: var(--eq-space-4);
  margin: 0;
}
.eq-device-geomap__viewport {
  position: relative;
}
.eq-device-geomap__canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--eq-color-border);
  border-radius: var(--eq-radius-md);
  background-color: var(--eq-color-surface-muted);
  overflow: hidden;
}
/* The in-dialog coordinate picker is a touch taller for easier tap-to-place. */
.eq-device-geomap__canvas--picker {
  aspect-ratio: 16 / 10;
}
/* Loading affordance while the basemap initialises (the accessible list below
   already carries the data, so this is a visual cue only). */
.eq-device-geomap__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--eq-radius-md);
  background-color: var(--eq-color-surface-muted);
  color: var(--eq-color-text-subtle);
  font-size: var(--eq-font-size-sm);
}
.eq-geo-marker {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: var(--eq-radius-pill);
  border: 2px solid var(--eq-color-surface);
  box-shadow: var(--eq-shadow-sm);
  cursor: pointer;
}
.eq-geo-marker--healthy {
  background: var(--eq-color-status-healthy-solid);
}
.eq-geo-marker--warning {
  background: var(--eq-color-status-warning-solid);
}
.eq-geo-marker--critical {
  background: var(--eq-color-status-critical-solid);
}
.eq-geo-marker--stale {
  background: var(--eq-color-status-stale-solid);
}
/* Square geographic marker for cabinets (distinct shape, not colour — WCAG 1.4.1). */
.eq-geo-marker--cabinet {
  border-radius: var(--eq-radius-sm);
}

/* Deployment-aware display scope helpers (ADR-0047). */
.eq-scope-tag {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--eq-space-2);
  border: 1px solid var(--eq-color-border-strong);
  border-radius: var(--eq-radius-pill, 999px);
  background: var(--eq-color-surface-muted);
  /* text-subtle (not -muted) so the pill clears WCAG AA on the muted fill. */
  color: var(--eq-color-text-subtle);
  font-size: var(--eq-font-size-xs);
  font-weight: var(--eq-font-weight-medium, 500);
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: help;
}
.eq-scope-note {
  margin: 0;
  padding: var(--eq-space-3) var(--eq-space-4);
  border: 1px solid var(--eq-color-border);
  border-radius: var(--eq-radius-md);
  background: var(--eq-color-surface-muted);
  color: var(--eq-color-text-subtle);
  font-size: var(--eq-font-size-sm);
}

.eq-grid--cabinet-master {
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 768px) {
  .eq-grid--cabinet-master {
    grid-template-columns: 1fr;
  }
}

.eq-cabinet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--eq-space-2);
}
.eq-cabinet-list__link {
  display: block;
  padding: var(--eq-space-3) var(--eq-space-4);
  border: 1px solid var(--eq-color-border);
  border-radius: var(--eq-radius-md);
  background: var(--eq-color-surface);
  color: var(--eq-color-text);
  text-decoration: none;
  font-weight: var(--eq-font-weight-medium);
}
.eq-cabinet-list__link:hover {
  border-color: var(--eq-color-border-strong);
  background: var(--eq-color-surface-muted);
}
.eq-cabinet-list__link--active {
  border-color: var(--eq-color-brand);
  background: var(--eq-color-brand-subtle);
}
.eq-cabinet-list__name {
  display: block;
}
.eq-cabinet-list__meta {
  display: block;
  margin-top: var(--eq-space-1);
  font-size: var(--eq-font-size-xs);
  font-weight: var(--eq-font-weight-regular);
  color: var(--eq-color-text-muted);
}
.eq-cabinet-detail-intro {
  display: grid;
  gap: var(--eq-space-1);
}
.eq-cabinet-detail-intro__name {
  margin: 0;
  font-size: var(--eq-font-size-lg);
  font-weight: var(--eq-font-weight-semibold);
  color: var(--eq-color-text);
}
.eq-cabinet-detail-intro__location {
  margin: 0;
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text-muted);
}
.eq-cabinet-slot-section {
  display: grid;
  gap: var(--eq-space-3);
}
.eq-cabinet-slot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--eq-space-3);
}
.eq-cabinet-slot-list__item {
  display: grid;
  gap: var(--eq-space-2);
  padding: var(--eq-space-3);
  border: 1px solid var(--eq-color-border);
  border-radius: var(--eq-radius-md);
  background: var(--eq-color-surface);
}
.eq-cabinet-slot-list__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--eq-space-3);
  flex-wrap: wrap;
}
.eq-cabinet-slot-list__statuses {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--eq-space-2);
  flex-wrap: wrap;
}
.eq-cabinet-slot-list__name {
  margin: 0;
  font-size: var(--eq-font-size-sm);
  font-weight: var(--eq-font-weight-semibold);
}
.eq-cabinet-slot-list__device {
  margin: var(--eq-space-1) 0 0;
  display: grid;
  gap: var(--eq-space-1);
}
.eq-cabinet-slot-list__device-name {
  font-size: var(--eq-font-size-sm);
  font-weight: var(--eq-font-weight-medium);
  color: var(--eq-color-text);
}
.eq-cabinet-slot-list__device-meta {
  font-size: var(--eq-font-size-xs);
  color: var(--eq-color-text-muted);
}
.eq-cabinet-slot-list__placeholder {
  margin: 0;
  font-size: var(--eq-font-size-sm);
  color: var(--eq-color-text-subtle);
}
