/*
 * equipment.css — Equipment tab
 *
 * Per-room visual dashboard. Each room is a section; inside, each system
 * is a row of equipment cards with an icon, a label, and an ON/OFF
 * status pill. Active cards animate (fans spin, mister drips, chiller
 * snowflake bounces, light glows) so the status reads at a glance
 * from across a room.
 */

#tab-equipment { padding: 0; }
.eq-wrap {
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px 32px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.eq-header { margin-bottom: 4px; }
.eq-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 6px 0 4px;
  color: var(--text-primary);
}
.eq-sub {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 13px;
  color: var(--text-muted, rgba(186, 211, 232, 0.65));
  max-width: 760px;
}

/* ── Admin stale-equipment alert (collapsible) ─────────────────────────
   A calmer, refined "needs attention" panel. The headline count counts up;
   the per-room detail collapses via the Hide/Show toggle (state persisted).
   A slow sheen sweeps across to keep it feeling live without screaming. */
.eq-alert {
  position: relative;
  overflow: hidden;
  padding: 15px 18px;
  border: 1px solid rgba(248, 113, 113, 0.30);
  border-radius: 16px;
  background:
    radial-gradient(120% 150% at 0% 0%, rgba(248, 113, 113, 0.16), transparent 60%),
    rgba(14, 12, 18, 0.55);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.30);
}
.eq-alert::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #f87171, #ef4444);
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.60);
}
.eq-alert-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 32%, rgba(248, 113, 113, 0.10) 50%, transparent 68%);
  background-size: 240% 100%;
  animation: eq-alert-scan 6s linear infinite;
}
@keyframes eq-alert-scan {
  from { background-position: 130% 0; }
  to   { background-position: -130% 0; }
}
.eq-alert-main { position: relative; display: flex; align-items: center; gap: 13px; }
.eq-alert-icon {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(248, 113, 113, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.42);
  color: rgba(252, 165, 165, 1);
}
.eq-alert-ping {
  position: absolute;
  inset: -1px;
  border-radius: 11px;
  border: 1px solid rgba(248, 113, 113, 0.65);
  animation: eq-ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes eq-ping {
  0%        { opacity: 0.7; transform: scale(1); }
  70%, 100% { opacity: 0;   transform: scale(1.5); }
}
.eq-alert-headline {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}
.eq-alert-tag {
  align-self: center;
  flex-shrink: 0;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.20);
  border: 1px solid rgba(248, 113, 113, 0.50);
  color: rgba(254, 226, 226, 1);
}
.eq-alert-count {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 16px rgba(248, 113, 113, 0.50);
}
.eq-alert-copy {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12.5px;
  color: rgba(254, 215, 170, 0.85);
}
.eq-alert-toggle {
  flex-shrink: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(248, 113, 113, 0.30);
  color: rgba(254, 205, 205, 0.95);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.eq-alert-toggle:hover { background: rgba(248, 113, 113, 0.14); border-color: rgba(248, 113, 113, 0.50); color: #fff; }
.eq-alert-chevron { transition: transform 0.24s ease; }
.eq-alert.is-collapsed .eq-alert-chevron { transform: rotate(-90deg); }
.eq-alert-detail {
  position: relative;
  overflow: hidden;
  max-height: 640px;
  opacity: 1;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid rgba(248, 113, 113, 0.16);
  transition: max-height 0.34s ease, opacity 0.26s ease, margin-top 0.34s ease, padding-top 0.34s ease;
}
.eq-alert.is-collapsed .eq-alert-detail {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  border-top-color: transparent;
}
.eq-alert-sub {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12px;
  line-height: 1.45;
  color: rgba(254, 215, 170, 0.80);
  margin-bottom: 11px;
}
.eq-alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 8px 20px;
}
.eq-alert-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 3px 0; }
.eq-alert-room {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(254, 226, 226, 0.95);
  min-width: 62px;
}
.eq-alert-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.eq-alert-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(248, 113, 113, 0.13);
  border: 1px solid rgba(248, 113, 113, 0.38);
  color: rgba(254, 226, 226, 1);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eq-alert-chip em { font-style: normal; color: rgba(252, 165, 165, 1); font-weight: 600; }
html[data-theme="light"] .eq-alert {
  background:
    radial-gradient(120% 150% at 0% 0%, rgba(220, 38, 38, 0.12), transparent 60%),
    rgba(255, 255, 255, 0.90);
  border-color: rgba(220, 38, 38, 0.32);
}
html[data-theme="light"] .eq-alert::before { background: linear-gradient(180deg, rgba(220, 38, 38, 1), rgba(153, 27, 27, 1)); }
html[data-theme="light"] .eq-alert-icon {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.45);
  color: rgba(127, 29, 29, 1);
}
html[data-theme="light"] .eq-alert-ping { border-color: rgba(220, 38, 38, 0.55); }
html[data-theme="light"] .eq-alert-tag {
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(220, 38, 38, 0.55);
  color: rgba(127, 29, 29, 1);
}
html[data-theme="light"] .eq-alert-count { color: rgba(127, 29, 29, 1); text-shadow: none; }
html[data-theme="light"] .eq-alert-copy  { color: rgba(120, 53, 15, 0.90); }
html[data-theme="light"] .eq-alert-toggle { color: rgba(127, 29, 29, 0.95); border-color: rgba(220, 38, 38, 0.30); background: rgba(15, 23, 42, 0.03); }
html[data-theme="light"] .eq-alert-toggle:hover { background: rgba(220, 38, 38, 0.10); border-color: rgba(220, 38, 38, 0.5); color: rgba(127, 29, 29, 1); }
html[data-theme="light"] .eq-alert-sub  { color: rgba(120, 53, 15, 0.85); }
html[data-theme="light"] .eq-alert-room { color: rgba(127, 29, 29, 1); }
html[data-theme="light"] .eq-alert-chip {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.40);
  color: rgba(127, 29, 29, 1);
}
html[data-theme="light"] .eq-alert-chip em { color: rgba(153, 27, 27, 1); }

/* Stale pill in the system header + stale-room tag in the room count */
.eq-stale-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: rgba(252, 165, 165, 1);
}
.eq-stale-tag { color: rgba(252, 165, 165, 1); font-weight: 700; }
html[data-theme="light"] .eq-stale-pill {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.45);
  color: rgba(127, 29, 29, 1);
}
html[data-theme="light"] .eq-stale-tag { color: rgba(153, 27, 27, 1); }

/* When the whole system block is stale, dim the card grid slightly so
   the visual difference between live + stale rows reads at a glance. */
.eq-system.is-stale .eq-card-grid { opacity: 0.65; filter: saturate(0.6); }
.eq-system.is-stale .eq-card-grid .eq-card { animation: none !important; }
.eq-system.is-stale .eq-card-grid .eq-card-svg,
.eq-system.is-stale .eq-card-grid .eq-card-svg * { animation: none !important; transform: none !important; }

/* Stale-override force-off card style — wins over any per-equipment ON tint */
.eq-card.is-stale {
  background: rgba(255, 255, 255, 0.01) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  box-shadow: none !important;
}
.eq-card.is-stale .eq-card-icon { color: rgba(186, 211, 232, 0.20) !important; filter: none !important; }
html[data-theme="light"] .eq-card.is-stale {
  background: rgba(248, 250, 252, 0.65) !important;
  border-color: rgba(0, 0, 0, 0.04) !important;
}
html[data-theme="light"] .eq-card.is-stale .eq-card-icon { color: rgba(71, 85, 105, 0.30) !important; }

/* ── Sticky filter bar (Room + System pickers) ────────────────────────
   Sits between the header and the room sections, sticks below the
   site-wide WIP banner so the picker is always reachable while scrolling. */
.eq-filterbar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin-bottom: 4px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(8, 14, 22, 0.96), rgba(8, 14, 22, 0.86));
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.eq-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.eq-filter-label {
  flex-shrink: 0;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.85);
  width: 64px;
}
.eq-filter-pills {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 139, 250, 0.35) transparent;
}
.eq-filter-pills::-webkit-scrollbar { height: 4px; }
.eq-filter-pills::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.30);
  border-radius: 2px;
}
.eq-pill {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 6px 13px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(186, 211, 232, 0.75);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}
.eq-pill:hover {
  background: rgba(167, 139, 250, 0.10);
  border-color: rgba(167, 139, 250, 0.40);
  color: rgba(221, 214, 254, 1);
}
.eq-pill.is-on {
  background: rgba(167, 139, 250, 0.22);
  border-color: rgba(167, 139, 250, 0.70);
  color: rgba(245, 243, 255, 1);
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.30);
}
.eq-filter-hint {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11px;
  color: var(--text-dim, rgba(186, 211, 232, 0.45));
  font-style: italic;
}
html[data-theme="light"] .eq-filterbar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
  border-color: rgba(124, 58, 237, 0.18);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
}
html[data-theme="light"] .eq-filter-label { color: rgba(91, 33, 182, 1); }
html[data-theme="light"] .eq-pill {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.10);
  color: rgba(51, 65, 85, 0.85);
}
html[data-theme="light"] .eq-pill:hover {
  background: rgba(124, 58, 237, 0.10);
  border-color: rgba(124, 58, 237, 0.40);
  color: rgba(76, 29, 149, 1);
}
html[data-theme="light"] .eq-pill.is-on {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(124, 58, 237, 0.65);
  color: rgba(76, 29, 149, 1);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.22);
}
html[data-theme="light"] .eq-filter-hint { color: rgba(71, 85, 105, 0.60); }

/* ══ Overview board — landing grid, one tile per room ═══════════════════
   Replaces the old "render every room stacked" infinite scroll. Click a
   tile to drill into that room's systems. */
.eq-ov-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.eq-ov-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 150px;
  padding: 18px 18px 16px;
  text-align: left;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background:
    radial-gradient(130% 100% at 0% 0%, rgba(167, 139, 250, 0.08), transparent 58%),
    rgba(10, 16, 26, 0.62);
  color: inherit;
  font-family: var(--font-body, 'Inter', sans-serif);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.22s ease, background 0.18s ease;
}
.eq-anim .eq-ov-tile {
  animation: eq-ov-in 0.4s cubic-bezier(0.22, 1, 0.32, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes eq-ov-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.eq-ov-tile::before {
  content: '';
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: rgba(148, 163, 184, 0.35);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.eq-ov-tile.has-active::before { background: linear-gradient(180deg, #4ade80, #22c55e); box-shadow: 0 0 12px rgba(74, 222, 128, 0.55); }
.eq-ov-tile.has-stale::before  { background: linear-gradient(180deg, #f87171, #ef4444); box-shadow: 0 0 12px rgba(248, 113, 113, 0.55); }
.eq-ov-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(167, 139, 250, 0.45);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.40), 0 0 22px rgba(167, 139, 250, 0.14);
  background:
    radial-gradient(130% 100% at 0% 0%, rgba(167, 139, 250, 0.14), transparent 58%),
    rgba(13, 20, 33, 0.78);
}
.eq-ov-tile:focus-visible {
  outline: none;
  border-color: rgba(167, 139, 250, 0.7);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.30);
}
.eq-ov-tile.is-empty { cursor: default; opacity: 0.55; }
.eq-ov-tile.is-empty:hover { transform: none; border-color: rgba(255,255,255,0.07); box-shadow: none; }

.eq-ov-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.eq-ov-headtext { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.eq-ov-name {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(237, 233, 254, 1);
}
.eq-ov-sub {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.70);
}
/* Corner health ring with a centred active/total fraction. */
.eq-ov-ringwrap { position: relative; flex-shrink: 0; width: 48px; height: 48px; }
.eq-ov-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 13px;
  font-weight: 700;
  color: rgba(237, 233, 254, 0.95);
  font-variant-numeric: tabular-nums;
}
.eq-ov-ring-center i { font-style: normal; font-size: 9px; color: rgba(186, 211, 232, 0.50); }
/* Per-system segmented status bar — one segment per system; active pulse. */
.eq-ov-segbar { display: flex; gap: 4px; }
.eq-seg {
  position: relative;
  flex: 1 1 0;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.16);
}
.eq-seg i { position: absolute; inset: 0; border-radius: inherit; }
.eq-seg.is-active i {
  background: linear-gradient(90deg, #4ade80, #22c55e);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.55);
  animation: eq-seg-pulse 2.2s ease-in-out infinite;
}
.eq-seg.is-idle  i { background: rgba(100, 116, 139, 0.55); }
.eq-seg.is-stale i {
  background: linear-gradient(90deg, #f87171, #ef4444);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.40);
}
@keyframes eq-seg-pulse { 0%, 100% { opacity: 0.72; } 50% { opacity: 1; } }

.eq-ov-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.eq-ov-lastrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  font-family: var(--font-body, 'Inter', sans-serif);
  min-width: 0;
}
.eq-ov-last-ic { flex-shrink: 0; color: rgba(167, 139, 250, 0.85); }
.eq-ov-last-lbl {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
}
.eq-ov-last-val {
  margin-left: auto;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(237, 246, 255, 0.97);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eq-ov-status {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: rgba(186, 211, 232, 0.78);
}
.eq-ov-status.has-active { background: rgba(74, 222, 128, 0.12);  border-color: rgba(74, 222, 128, 0.40);  color: rgba(187, 247, 208, 1); }
.eq-ov-status.has-stale  { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.40); color: rgba(252, 165, 165, 1); }
.eq-ov-status.has-idle   { background: rgba(100, 116, 139, 0.12); border-color: rgba(148, 163, 184, 0.25); color: rgba(186, 211, 232, 0.70); }
.eq-ov-go {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.70);
  transition: color 0.18s ease, transform 0.18s ease;
}
.eq-ov-tile:hover .eq-ov-go { color: rgba(221, 214, 254, 1); transform: translateX(2px); }
.eq-ov-empty {
  font-size: 12px;
  color: rgba(186, 211, 232, 0.40);
  font-style: italic;
}

/* ══ Drill-in back bar ═════════════════════════════════════════════════ */
.eq-backbar {
  position: sticky;
  top: calc(var(--banner-h, 0px) + var(--nav-h, 46px) + 8px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(8, 14, 22, 0.96), rgba(8, 14, 22, 0.86));
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}
.eq-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 7px 13px 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(221, 214, 254, 0.90);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.eq-back:hover { background: rgba(167, 139, 250, 0.14); border-color: rgba(167, 139, 250, 0.45); color: #fff; }
.eq-back:hover svg { transform: translateX(-2px); }
.eq-back svg { transition: transform 0.16s ease; }
.eq-back-room {
  flex-shrink: 0;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}
.eq-back-sys { margin-left: auto; max-width: 100%; }

html[data-theme="light"] .eq-ov-tile {
  border-color: rgba(15, 23, 42, 0.08);
  background:
    radial-gradient(130% 100% at 0% 0%, rgba(124, 58, 237, 0.08), transparent 58%),
    rgba(255, 255, 255, 0.88);
}
html[data-theme="light"] .eq-ov-tile:hover {
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12), 0 0 18px rgba(124, 58, 237, 0.10);
  background:
    radial-gradient(130% 100% at 0% 0%, rgba(124, 58, 237, 0.12), transparent 58%),
    rgba(255, 255, 255, 0.96);
}
html[data-theme="light"] .eq-ov-name  { color: rgba(76, 29, 149, 1); }
html[data-theme="light"] .eq-ov-count { background: rgba(124, 58, 237, 0.10); border-color: rgba(124, 58, 237, 0.28); color: rgba(91, 33, 182, 1); }
html[data-theme="light"] .eq-ov-go    { color: rgba(124, 58, 237, 0.75); }
html[data-theme="light"] .eq-ov-tile:hover .eq-ov-go { color: rgba(76, 29, 149, 1); }
html[data-theme="light"] .eq-ov-stat        { background: rgba(15, 23, 42, 0.05); border-color: rgba(15, 23, 42, 0.10); color: rgba(71, 85, 105, 0.80); }
html[data-theme="light"] .eq-ov-stat.is-active { background: rgba(22, 163, 74, 0.12); border-color: rgba(22, 163, 74, 0.40); color: rgba(20, 83, 45, 1); }
html[data-theme="light"] .eq-ov-stat.is-stale  { background: rgba(220, 38, 38, 0.10); border-color: rgba(220, 38, 38, 0.40); color: rgba(127, 29, 29, 1); }
html[data-theme="light"] .eq-ov-dot.is-idle    { background: rgba(100, 116, 139, 0.35); }
html[data-theme="light"] .eq-backbar {
  border-color: rgba(124, 58, 237, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
}
html[data-theme="light"] .eq-back { background: rgba(15, 23, 42, 0.04); border-color: rgba(15, 23, 42, 0.10); color: rgba(76, 29, 149, 1); }
html[data-theme="light"] .eq-back:hover { background: rgba(124, 58, 237, 0.10); border-color: rgba(124, 58, 237, 0.40); color: rgba(76, 29, 149, 1); }
html[data-theme="light"] .eq-back-room { color: rgba(76, 29, 149, 1); }

/* ══ Board ⇄ detail view transition ════════════════════════════════════ */
.eq-wrap.eq-leaving { animation: eq-view-out 0.15s ease forwards; pointer-events: none; }
@keyframes eq-view-out {
  to { opacity: 0; transform: translateY(-6px) scale(0.992); }
}
.eq-wrap-detail.eq-anim { animation: eq-view-in 0.36s cubic-bezier(0.22, 1, 0.32, 1) both; }
.eq-wrap-detail.eq-anim .eq-room { animation: eq-view-in 0.44s cubic-bezier(0.22, 1, 0.32, 1) both; animation-delay: 0.07s; }
@keyframes eq-view-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .eq-ov-tile { animation: none; }
  .eq-ov-tile:hover { transform: none; }
  .eq-wrap.eq-leaving,
  .eq-wrap-detail,
  .eq-wrap-detail .eq-room { animation: none !important; }
}

/* ── Room section ────────────────────────────────────────────────────── */
.eq-room {
  background: rgba(8, 14, 22, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.eq-room-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.10), rgba(167, 139, 250, 0.02));
}
.eq-room-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(221, 214, 254, 1);
  margin: 0;
}
.eq-room-count {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.75);
  padding: 3px 11px;
  background: rgba(167, 139, 250, 0.10);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 999px;
}
.eq-active-tag {
  color: rgba(74, 222, 128, 1);
  font-weight: 700;
}
.eq-room-empty {
  padding: 32px 18px;
  text-align: center;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 13px;
  color: var(--text-dim, rgba(186, 211, 232, 0.45));
}

/* ── Per-system block ─────────────────────────────────────────────────── */
.eq-system {
  padding: 14px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.eq-system:last-child { border-bottom: none; }
/* Admin-marked inactive system — X'd out, not hidden */
.eq-system.is-inactive { opacity: 0.6; }
.eq-system.is-inactive .eq-system-name { text-decoration: line-through; color: rgba(148,163,184,0.75); }
.eq-inactive-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px;
  color: rgba(148,163,184,0.9); background: rgba(148,163,184,0.1); border: 1px solid rgba(148,163,184,0.28);
}
.eq-inactive-body { margin-top: 8px; font-size: 12px; color: rgba(148,163,184,0.7); font-style: italic; }
.eq-system-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.eq-system-name {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(125, 211, 252, 1);
  padding: 4px 11px;
  background: rgba(56, 189, 248, 0.10);
  border: 1px solid rgba(56, 189, 248, 0.30);
  border-radius: 7px;
}
.eq-system-hdr-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eq-system-meta {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11px;
  color: var(--text-dim, rgba(186, 211, 232, 0.55));
}
/* Live per-system on/off summary (ring + readout) in the system header. */
.eq-sys-summary { display: inline-flex; align-items: center; gap: 9px; }
.eq-sys-ring { position: relative; flex-shrink: 0; width: 30px; height: 30px; display: inline-block; }
.eq-sys-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  color: rgba(237, 233, 254, 0.95);
  font-variant-numeric: tabular-nums;
}
.eq-sys-sumtxt {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(186, 211, 232, 0.70);
  white-space: nowrap;
}
.eq-sys-sumtxt b  { color: rgba(134, 239, 172, 1); font-weight: 800; }
.eq-sys-sumtxt em { font-style: normal; color: rgba(186, 211, 232, 0.40); margin: 0 2px; }
.eq-system.is-stale .eq-sys-sumtxt b { color: rgba(252, 165, 165, 1); }
html[data-theme="light"] .eq-sys-sumtxt   { color: rgba(71, 85, 105, 0.85); }
html[data-theme="light"] .eq-sys-sumtxt b { color: rgba(22, 101, 52, 1); }
html[data-theme="light"] .eq-system.is-stale .eq-sys-sumtxt b { color: rgba(153, 27, 27, 1); }
html[data-theme="light"] .eq-sys-ring-num { color: rgba(30, 27, 75, 1); }

/* ── Card grid ───────────────────────────────────────────────────────── */
.eq-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(192px, 1fr));
  grid-auto-rows: 112px;
  gap: 12px;
}

/* ── Card ────────────────────────────────────────────────────────────── */
.eq-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  transition:
    background 0.20s ease,
    border-color 0.20s ease,
    box-shadow 0.30s ease,
    transform 0.20s ease;
  overflow: hidden;
}
.eq-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 14% 50%, rgba(255,255,255,0.04) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.20s ease;
}
.eq-card.is-on::before { opacity: 1; }
.eq-card-notes {
  display: block;
  max-width: 100%;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}
.eq-card[data-type="notes"] { grid-column: 1 / -1; min-height: 0; align-items: flex-start; }

/* Icon well — framed, tinted container that gives each glyph presence. */
.eq-card-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(186, 211, 232, 0.50);
  transition: color 0.20s ease, filter 0.20s ease, background 0.20s ease, border-color 0.20s ease;
}
.eq-card.is-on .eq-card-icon { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.10); }
.eq-card-svg {
  width: 36px;
  height: 36px;
  display: block;
}

/* Body — label + status */
.eq-card-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.eq-card-label {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted, rgba(186, 211, 232, 0.55));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eq-card-status { display: flex; align-items: center; gap: 6px; }
.eq-card-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.eq-pill-on {
  background: rgba(74, 222, 128, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.55);
  color: rgba(187, 247, 208, 1);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.25);
}
.eq-pill-off {
  background: rgba(248, 113, 113, 0.10);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: rgba(252, 165, 165, 1);
}
.eq-pill-unknown {
  background: rgba(148, 163, 184, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.20);
  color: rgba(148, 163, 184, 0.85);
}
.eq-card-value {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

/* ── ON state — colored borders + glowing icons by equipment kind ────── */
.eq-card.is-on {
  background: rgba(74, 222, 128, 0.05);
  border-color: rgba(74, 222, 128, 0.30);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.10);
}
.eq-card.is-on .eq-card-icon { color: rgba(187, 247, 208, 1); filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.55)); }

/* Per-equipment ON tints — overrides .is-on so each card has its own
   personality. Tints match the icon's natural color association. */
.eq-card-chiller.is-on { background: rgba(56, 189, 248, 0.06); border-color: rgba(56, 189, 248, 0.45); box-shadow: 0 0 22px rgba(56, 189, 248, 0.18); }
.eq-card-chiller.is-on .eq-card-icon { color: rgba(186, 230, 253, 1); filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.65)); }

.eq-card-room_lights.is-on { background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.50); box-shadow: 0 0 24px rgba(251, 191, 36, 0.22); }
.eq-card-room_lights.is-on .eq-card-icon { color: rgba(254, 240, 138, 1); filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.75)); }

.eq-card-mister.is-on { background: rgba(56, 189, 248, 0.06); border-color: rgba(56, 189, 248, 0.40); box-shadow: 0 0 22px rgba(56, 189, 248, 0.16); }
.eq-card-mister.is-on .eq-card-icon { color: rgba(186, 230, 253, 1); }

.eq-card-fans.is-on { background: rgba(167, 139, 250, 0.06); border-color: rgba(167, 139, 250, 0.40); box-shadow: 0 0 22px rgba(167, 139, 250, 0.18); }
.eq-card-fans.is-on .eq-card-icon { color: rgba(221, 214, 254, 1); filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.55)); }

.eq-card-air_blower.is-on { background: rgba(125, 211, 252, 0.06); border-color: rgba(125, 211, 252, 0.40); }
.eq-card-air_blower.is-on .eq-card-icon { color: rgba(207, 250, 254, 1); }

.eq-card-venturi.is-on { background: rgba(94, 234, 212, 0.06); border-color: rgba(94, 234, 212, 0.40); }
.eq-card-venturi.is-on .eq-card-icon { color: rgba(204, 251, 241, 1); }

/* ── Animations ─────────────────────────────────────────────────────── */

/* Fans — blades spin while ON */
.eq-card-fans.is-on .eq-svg-fans-blades {
  transform-origin: 16px 16px;
  animation: eq-spin 1.6s linear infinite;
}
@keyframes eq-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Air blower — wave lines pulse outward */
.eq-card-air_blower.is-on .eq-svg-blower path {
  animation: eq-wave 2.0s ease-in-out infinite;
}
.eq-card-air_blower.is-on .eq-svg-blower path:nth-child(2) {
  animation-delay: -0.6s;
}
@keyframes eq-wave {
  0%   { opacity: 0.40; transform: translateX(-2px); }
  50%  { opacity: 1;    transform: translateX(2px); }
  100% { opacity: 0.40; transform: translateX(-2px); }
}

/* Chiller — gentle snowflake pulse */
.eq-card-chiller.is-on .eq-svg-chiller {
  animation: eq-pulse 2.4s ease-in-out infinite;
  transform-origin: center;
}
@keyframes eq-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50%      { transform: scale(1.10); opacity: 1; }
}

/* Mister — droplets bounce, spray fades in/out */
.eq-card-mister.is-on .eq-svg-mister-drops {
  transform-origin: 16px 16px;
  animation: eq-bounce 1.4s ease-in-out infinite;
}
@keyframes eq-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
.eq-card-mister.is-on .eq-svg-mister-spray circle {
  animation: eq-spray 1.4s ease-out infinite;
}
.eq-card-mister.is-on .eq-svg-mister-spray circle:nth-child(2) { animation-delay: -0.3s; }
.eq-card-mister.is-on .eq-svg-mister-spray circle:nth-child(3) { animation-delay: -0.6s; }
.eq-card-mister.is-on .eq-svg-mister-spray circle:nth-child(4) { animation-delay: -0.9s; }
@keyframes eq-spray {
  0%   { opacity: 0;   transform: translateY(-4px); }
  40%  { opacity: 0.9; }
  100% { opacity: 0;   transform: translateY(4px); }
}

/* Venturi — flow dots travel along the pipe */
.eq-card-venturi.is-on .eq-svg-venturi circle {
  animation: eq-flow 1.8s linear infinite;
}
.eq-card-venturi.is-on .eq-svg-venturi circle:nth-of-type(2) {
  animation-delay: -0.6s;
}
@keyframes eq-flow {
  0%   { transform: translateX(-12px); opacity: 0;   }
  20%  { opacity: 0.95; }
  80%  { opacity: 0.95; }
  100% { transform: translateX(6px);   opacity: 0;   }
}

/* SB Gas — value reading; bubbles rise while a reading is present */
.eq-card-sb_gas.is-on { background: rgba(45, 212, 191, 0.06); border-color: rgba(45, 212, 191, 0.40); box-shadow: 0 0 22px rgba(45, 212, 191, 0.14); }
.eq-card-sb_gas.is-on .eq-card-icon { color: rgba(153, 246, 228, 1); filter: drop-shadow(0 0 7px rgba(45, 212, 191, 0.55)); }
.eq-card-sb_gas.is-on .eq-svg-sbgas-bubbles circle {
  animation: eq-bubble 2.6s ease-in-out infinite;
}
.eq-card-sb_gas.is-on .eq-svg-sbgas-bubbles circle:nth-child(2) { animation-delay: -0.9s; }
.eq-card-sb_gas.is-on .eq-svg-sbgas-bubbles circle:nth-child(3) { animation-delay: -1.7s; }
@keyframes eq-bubble {
  0%   { opacity: 0.15; transform: translateY(3px); }
  45%  { opacity: 0.95; }
  100% { opacity: 0;    transform: translateY(-6px); }
}

/* Compound — value reading; gentle fizz */
.eq-card-compound.is-on { background: rgba(167, 139, 250, 0.06); border-color: rgba(167, 139, 250, 0.40); box-shadow: 0 0 22px rgba(167, 139, 250, 0.14); }
.eq-card-compound.is-on .eq-card-icon { color: rgba(221, 214, 254, 1); filter: drop-shadow(0 0 7px rgba(167, 139, 250, 0.5)); }
.eq-card-compound.is-on .eq-svg-compound-fizz circle {
  animation: eq-bubble 3.0s ease-in-out infinite;
}
.eq-card-compound.is-on .eq-svg-compound-fizz circle:nth-child(2) { animation-delay: -1.4s; }

/* Return Flow — Yes/No (binary); loop rotates while flow returns */
.eq-card-return_flow.is-on { background: rgba(56, 189, 248, 0.06); border-color: rgba(56, 189, 248, 0.40); box-shadow: 0 0 22px rgba(56, 189, 248, 0.16); }
.eq-card-return_flow.is-on .eq-card-icon { color: rgba(186, 230, 253, 1); filter: drop-shadow(0 0 7px rgba(56, 189, 248, 0.55)); }
.eq-card-return_flow.is-on .eq-svg-return-loop {
  transform-origin: 16px 16px;
  animation: eq-spin 3.4s linear infinite;
}

/* Chiller Temp — value reading; cool pulse + the bulb breathes */
.eq-card-chiller_temp.is-on { background: rgba(56, 189, 248, 0.06); border-color: rgba(56, 189, 248, 0.40); box-shadow: 0 0 22px rgba(56, 189, 248, 0.14); }
.eq-card-chiller_temp.is-on .eq-card-icon { color: rgba(186, 230, 253, 1); filter: drop-shadow(0 0 7px rgba(56, 189, 248, 0.5)); }
.eq-card-chiller_temp.is-on .eq-svg-chillertemp {
  transform-origin: center;
  animation: eq-pulse 2.6s ease-in-out infinite;
}
.eq-card-chiller_temp.is-on .eq-svg-chillertemp circle {
  animation: eq-temp-bulb 2.6s ease-in-out infinite;
}
@keyframes eq-temp-bulb {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 1; }
}

/* Water Level — value reading; the surface lines bob like sloshing water */
.eq-card-water_level.is-on { background: rgba(45, 212, 191, 0.06); border-color: rgba(45, 212, 191, 0.40); box-shadow: 0 0 22px rgba(45, 212, 191, 0.14); }
.eq-card-water_level.is-on .eq-card-icon { color: rgba(153, 246, 228, 1); filter: drop-shadow(0 0 7px rgba(45, 212, 191, 0.5)); }
.eq-card-water_level.is-on .eq-svg-waterlevel line {
  animation: eq-slosh 2.4s ease-in-out infinite;
}
.eq-card-water_level.is-on .eq-svg-waterlevel line:nth-of-type(2) { animation-delay: -1.2s; }
@keyframes eq-slosh {
  0%, 100% { transform: translateY(0);      opacity: 0.7; }
  50%      { transform: translateY(-1.5px); opacity: 1; }
}

/* Honor reduced-motion globally for ALL animations on this tab. */
@media (prefers-reduced-motion: reduce) {
  .eq-card .eq-card-svg,
  .eq-card .eq-card-svg * {
    animation: none !important;
    transform: none !important;
  }
}

/* ── OFF state — dim icon, neutral border ─────────────────────────────── */
.eq-card.is-off { background: rgba(255, 255, 255, 0.01); border-color: rgba(255, 255, 255, 0.04); }
.eq-card.is-off .eq-card-icon { color: rgba(186, 211, 232, 0.20); }
.eq-card.is-unknown .eq-card-icon { color: rgba(186, 211, 232, 0.18); }

/* ── Light theme ──────────────────────────────────────────────────────── */
html[data-theme="light"] .eq-room {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .eq-room-hdr {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.10), rgba(124, 58, 237, 0.02));
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .eq-room-title { color: rgba(76, 29, 149, 1); }
html[data-theme="light"] .eq-room-count {
  background: rgba(124, 58, 237, 0.10);
  border-color: rgba(124, 58, 237, 0.30);
  color: rgba(91, 33, 182, 1);
}
html[data-theme="light"] .eq-active-tag { color: rgba(22, 163, 74, 1); }
html[data-theme="light"] .eq-system-name {
  background: rgba(2, 132, 199, 0.10);
  border-color: rgba(2, 132, 199, 0.30);
  color: rgba(7, 89, 133, 1);
}
html[data-theme="light"] .eq-card {
  background: rgba(248, 250, 252, 0.85);
  border-color: rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .eq-card-label { color: rgba(71, 85, 105, 0.85); }
html[data-theme="light"] .eq-card-value { color: #0f172a; }
html[data-theme="light"] .eq-card-notes { color: #0f172a; }
html[data-theme="light"] .eq-card-icon  { color: rgba(71, 85, 105, 0.40); }
html[data-theme="light"] .eq-pill-on {
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(22, 163, 74, 0.50);
  color: rgba(20, 83, 45, 1);
  box-shadow: 0 0 10px rgba(22, 163, 74, 0.18);
}
html[data-theme="light"] .eq-pill-off {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.35);
  color: rgba(127, 29, 29, 1);
}
html[data-theme="light"] .eq-pill-unknown {
  background: rgba(100, 116, 139, 0.10);
  border-color: rgba(100, 116, 139, 0.25);
  color: rgba(71, 85, 105, 0.85);
}
html[data-theme="light"] .eq-card.is-on {
  background: rgba(22, 163, 74, 0.06);
  border-color: rgba(22, 163, 74, 0.35);
}
html[data-theme="light"] .eq-card.is-on .eq-card-icon { color: rgba(22, 101, 52, 1); filter: drop-shadow(0 0 4px rgba(22, 163, 74, 0.40)); }
html[data-theme="light"] .eq-card-chiller.is-on { background: rgba(2, 132, 199, 0.08); border-color: rgba(2, 132, 199, 0.45); }
html[data-theme="light"] .eq-card-chiller.is-on .eq-card-icon { color: rgba(7, 89, 133, 1); }
html[data-theme="light"] .eq-card-room_lights.is-on { background: rgba(202, 138, 4, 0.10); border-color: rgba(202, 138, 4, 0.50); }
html[data-theme="light"] .eq-card-room_lights.is-on .eq-card-icon { color: rgba(133, 77, 14, 1); }
html[data-theme="light"] .eq-card-fans.is-on { background: rgba(124, 58, 237, 0.06); border-color: rgba(124, 58, 237, 0.40); }
html[data-theme="light"] .eq-card-fans.is-on .eq-card-icon { color: rgba(91, 33, 182, 1); }
html[data-theme="light"] .eq-card.is-off { background: rgba(248, 250, 252, 0.65); border-color: rgba(0, 0, 0, 0.04); }
html[data-theme="light"] .eq-card.is-off .eq-card-icon { color: rgba(71, 85, 105, 0.30); }

@media (max-width: 900px) {
  .eq-wrap    { padding: 18px 14px 50px; gap: 18px; }
  .eq-system  { padding: 12px 14px 14px; }
  .eq-card-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); grid-auto-rows: 100px; gap: 10px; }
  .eq-card    { padding: 13px 14px; gap: 12px; }
  .eq-card-icon { width: 46px; height: 46px; border-radius: 12px; }
  .eq-card-svg  { width: 30px; height: 30px; }
}

/* Legacy WIP placeholder classes — keep so old screenshots / dev artifacts
   don't visually drift in case they're referenced anywhere. */
#tab-equipment .wip-icon-ring { background: rgba(251,191,36,0.10); border: 1px solid rgba(251,191,36,0.28); }
#tab-equipment .wip-badge { background: rgba(251,191,36,0.10); border: 1px solid rgba(251,191,36,0.30); color: rgba(251,191,36,0.95); }
#tab-equipment .wip-dot   { background: rgba(251,191,36,0.95); }

/* ══ Facility live summary strip ═══════════════════════════════════════
   Donut ring (active / idle / need-check arcs) + animated count-up stats +
   a live "updated" pulse. Sits above the board for every role. */
.eq-summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 20px 24px;
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(167, 139, 250, 0.10), transparent 55%),
    radial-gradient(120% 160% at 100% 100%, rgba(56, 189, 248, 0.06), transparent 55%),
    rgba(10, 16, 26, 0.55);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.30);
  overflow: hidden;
}
.eq-sum-ringwrap { position: relative; flex-shrink: 0; width: 104px; height: 104px; }
.eq-sum-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.eq-sum-ring-num {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.eq-sum-ring-lbl {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(186, 211, 232, 0.55);
}
.eq-sum-stats { display: flex; gap: 14px; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
.eq-sum-stat {
  position: relative;
  flex: 1 1 0;
  min-width: 96px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 16px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.eq-sum-stat::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}
.eq-sum-stat.is-active::before { background: #4ade80; box-shadow: 0 0 10px rgba(74, 222, 128, 0.60); }
.eq-sum-stat.is-idle::before   { background: #64748b; }
.eq-sum-stat.is-stale::before  { background: #f87171; box-shadow: 0 0 10px rgba(248, 113, 113, 0.55); }
.eq-sum-num {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: rgba(237, 233, 254, 1);
  font-variant-numeric: tabular-nums;
}
.eq-sum-lbl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(186, 211, 232, 0.65);
}
.eq-swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.eq-swatch.is-active { background: #4ade80; }
.eq-swatch.is-idle   { background: #64748b; }
.eq-swatch.is-stale  { background: #f87171; }
.eq-sum-meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-left: 4px;
}
.eq-sum-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(134, 239, 172, 1);
  padding: 4px 11px 4px 10px;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.10);
  border: 1px solid rgba(74, 222, 128, 0.35);
}
.eq-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  animation: eq-live 2s ease-out infinite;
}
@keyframes eq-live {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.eq-sum-sync   { font-family: var(--font-body, 'Inter', sans-serif); font-size: 11px; color: rgba(186, 211, 232, 0.55); }
.eq-sum-health { font-family: var(--font-body, 'Inter', sans-serif); font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; color: rgba(167, 139, 250, 0.80); }

/* SVG ring base */
.eq-ring { display: block; width: 100%; height: 100%; }

/* Summary + alert ride the same entrance cascade as the tiles (CSS
   fallback; GSAP draws the ring segments on top when present). */
.eq-anim .eq-summary { animation: eq-ov-in 0.5s cubic-bezier(0.22, 1, 0.32, 1) both; }
.eq-anim .eq-alert   { animation: eq-ov-in 0.5s cubic-bezier(0.22, 1, 0.32, 1) both; animation-delay: 0.06s; }

/* Light theme — summary + new tile bits */
html[data-theme="light"] .eq-summary {
  border-color: rgba(124, 58, 237, 0.16);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(124, 58, 237, 0.08), transparent 55%),
    rgba(255, 255, 255, 0.90);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.10);
}
html[data-theme="light"] .eq-sum-ring-num     { color: rgba(30, 27, 75, 1); }
html[data-theme="light"] .eq-sum-num          { color: rgba(30, 27, 75, 1); }
html[data-theme="light"] .eq-sum-stat         { background: rgba(15, 23, 42, 0.03); border-color: rgba(15, 23, 42, 0.07); }
html[data-theme="light"] .eq-sum-lbl          { color: rgba(71, 85, 105, 0.85); }
html[data-theme="light"] .eq-sum-sync         { color: rgba(71, 85, 105, 0.70); }
html[data-theme="light"] .eq-sum-health       { color: rgba(91, 33, 182, 1); }
html[data-theme="light"] .eq-sum-live         { color: rgba(22, 101, 52, 1); background: rgba(22, 163, 74, 0.10); border-color: rgba(22, 163, 74, 0.35); }
html[data-theme="light"] .eq-ov-sub           { color: rgba(91, 33, 182, 0.85); }
html[data-theme="light"] .eq-ov-lastrow       { border-top-color: rgba(15, 23, 42, 0.12); }
html[data-theme="light"] .eq-ov-last-ic       { color: rgba(124, 58, 237, 0.85); }
html[data-theme="light"] .eq-ov-last-lbl      { color: rgba(71, 85, 105, 0.85); }
html[data-theme="light"] .eq-ov-last-val      { color: rgba(15, 23, 42, 0.95); }
html[data-theme="light"] .eq-ov-ring-center   { color: rgba(30, 27, 75, 1); }
html[data-theme="light"] .eq-ov-ring-center i { color: rgba(71, 85, 105, 0.55); }
html[data-theme="light"] .eq-seg              { background: rgba(15, 23, 42, 0.10); }
html[data-theme="light"] .eq-ov-status        { background: rgba(15, 23, 42, 0.05); border-color: rgba(15, 23, 42, 0.10); color: rgba(71, 85, 105, 0.85); }
html[data-theme="light"] .eq-ov-status.has-active { background: rgba(22, 163, 74, 0.12); border-color: rgba(22, 163, 74, 0.40); color: rgba(20, 83, 45, 1); }
html[data-theme="light"] .eq-ov-status.has-stale  { background: rgba(220, 38, 38, 0.10); border-color: rgba(220, 38, 38, 0.40); color: rgba(127, 29, 29, 1); }

/* Reduced motion — kill the new ambient + entrance motion. */
@media (prefers-reduced-motion: reduce) {
  .eq-alert-scan,
  .eq-alert-ping,
  .eq-live-dot,
  .eq-seg.is-active i { animation: none !important; }
  .eq-anim .eq-summary,
  .eq-anim .eq-alert { animation: none !important; }
}

/* Responsive — stack the summary on narrow viewports. */
@media (max-width: 760px) {
  .eq-summary { flex-direction: column; align-items: stretch; gap: 16px; padding: 16px; }
  .eq-sum-ringwrap { align-self: center; }
  .eq-sum-meta { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ══ Equipment Notes panel (full-width, below the device grid) ══════════
   Pulled out of the card grid so the grid stays perfectly uniform; only
   renders when a note actually exists (no more empty full-width void). */
.eq-system-notes {
  margin-top: 12px;
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 14px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(167, 139, 250, 0.06), transparent 60%),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.eq-system-notes-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(196, 181, 253, 0.70);
}
.eq-system-notes-icon svg { width: 28px; height: 28px; }
.eq-system-notes-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.eq-system-notes-label {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.85);
}
.eq-system-notes-text {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}
/* When the system is stale the grid dims; keep notes legible (text context
   isn't invalidated by staleness) but match the muted treatment lightly. */
.eq-system.is-stale .eq-system-notes { opacity: 0.85; }

html[data-theme="light"] .eq-card-icon { background: rgba(15, 23, 42, 0.03); border-color: rgba(0, 0, 0, 0.06); }
html[data-theme="light"] .eq-card.is-on .eq-card-icon { background: rgba(15, 23, 42, 0.04); border-color: rgba(0, 0, 0, 0.08); }
html[data-theme="light"] .eq-system-notes { background: rgba(248, 250, 252, 0.85); border-color: rgba(0, 0, 0, 0.06); }
html[data-theme="light"] .eq-system-notes-icon { background: rgba(124, 58, 237, 0.06); border-color: rgba(124, 58, 237, 0.18); color: rgba(91, 33, 182, 0.85); }
html[data-theme="light"] .eq-system-notes-label { color: rgba(91, 33, 182, 1); }
html[data-theme="light"] .eq-system-notes-text { color: #0f172a; }

/* ══════════════════════════════════════════════════════════════════════════
   LIGHT-THEME GAP FIXES (appended)
   The SVG donut ring (equipment.js _ring()) hardcodes a very light track
   (rgba(148,163,184,0.16)) + bright arc hues (#4ade80 / #64748b / #f87171)
   that wash out on a near-white surface. CSS `stroke` beats the inline SVG
   presentation attribute, so we retint the track + each segment for light
   mode only. Also patches a few near-white label/accent colours the JS-built
   summary/tiles rely on. Dark mode is untouched.
   ══════════════════════════════════════════════════════════════════════════ */

/* SVG data-viz — summary donut + per-system on/off ring + tile health ring.
   Track: light purple-tint so the unfilled arc reads on white.
   Segments: darkened accents (emerald / slate-600 / rose) for WCAG-legible
   colour on white. `:not(.eq-ring-seg)` = the background track circle. */
html[data-theme="light"] .eq-ring circle:not(.eq-ring-seg) { stroke: rgba(19, 16, 58, 0.10); }
html[data-theme="light"] .eq-ring-seg.is-active { stroke: #059669; }
html[data-theme="light"] .eq-ring-seg.is-idle   { stroke: #475569; }
html[data-theme="light"] .eq-ring-seg.is-stale  { stroke: #e11d48; }

/* Summary strip donut centre label ("systems") + the ov-tile ring "/total". */
html[data-theme="light"] .eq-sum-ring-lbl { color: rgba(19, 16, 58, 0.55); }

/* Segmented status bar segment states (JS: .eq-seg.is-active/idle/stale i).
   The base green/rose gradients + slate idle stay legible, but darken the
   idle fill and retint the active/stale glows so they don't glare on white. */
html[data-theme="light"] .eq-seg.is-active i { background: linear-gradient(90deg, #059669, #047857); box-shadow: 0 0 8px rgba(5, 150, 105, 0.35); }
html[data-theme="light"] .eq-seg.is-idle   i { background: rgba(71, 85, 105, 0.55); }
html[data-theme="light"] .eq-seg.is-stale  i { background: linear-gradient(90deg, #e11d48, #be123c); box-shadow: 0 0 8px rgba(225, 29, 72, 0.30); }

/* Overview-tile left accent bar + summary-stat accent bars (bright on white). */
html[data-theme="light"] .eq-ov-tile.has-active::before { background: linear-gradient(180deg, #059669, #047857); box-shadow: 0 0 12px rgba(5, 150, 105, 0.40); }
html[data-theme="light"] .eq-ov-tile.has-stale::before  { background: linear-gradient(180deg, #e11d48, #be123c); box-shadow: 0 0 12px rgba(225, 29, 72, 0.40); }
html[data-theme="light"] .eq-sum-stat.is-active::before { background: #059669; box-shadow: 0 0 10px rgba(5, 150, 105, 0.40); }
html[data-theme="light"] .eq-sum-stat.is-idle::before   { background: #475569; }
html[data-theme="light"] .eq-sum-stat.is-stale::before  { background: #e11d48; box-shadow: 0 0 10px rgba(225, 29, 72, 0.40); }

/* Legend swatches next to Active / Idle / Need-check (bright squares). */
html[data-theme="light"] .eq-swatch.is-active { background: #059669; }
html[data-theme="light"] .eq-swatch.is-idle   { background: #475569; }
html[data-theme="light"] .eq-swatch.is-stale  { background: #e11d48; }

/* Live-pulse dot in the summary meta (bright green on white). */
html[data-theme="light"] .eq-live-dot { background: #059669; }
@media (prefers-reduced-motion: no-preference) {
  html[data-theme="light"] .eq-live-dot {
    animation-name: eq-live-lt;
  }
}
@keyframes eq-live-lt {
  0%   { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(5, 150, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

/* Overview-tile idle accent + empty-state italic text on white. */
html[data-theme="light"] .eq-ov-tile::before { background: rgba(71, 85, 105, 0.35); }
html[data-theme="light"] .eq-ov-empty        { color: rgba(19, 16, 58, 0.45); }
html[data-theme="light"] .eq-ov-status.has-idle { background: rgba(71, 85, 105, 0.10); border-color: rgba(71, 85, 105, 0.25); color: rgba(71, 85, 105, 0.85); }
