/* netherBio Monitor — wall/side-table ops board.
   Theme is the platform's "Gold (Default)" preset, matched token-for-token to
   infra/pulse (app/data/siteConfig.ts presetThemes[0] + app/globals.css). Layout:
   a persistent top strip (attack state / site status / deploy health / clock) over
   a body that auto-rotates through Dev, Ops and Traffic pages, and a slim bottom bar
   with per-source freshness + a page indicator. Sized to scale from a viewport-derived
   root font-size — readable on a small side-table monitor or a full wall TV. */

:root {
  --amber: #d4a24a;
  --amber-light: #e8c078;
  --amber-dark: #a67c32;
  --amber-glow: rgba(212, 162, 74, 0.35);
  --brown-dark: #1a1410;
  --brown: #2a2018;
  --brown-light: #3d2e22;
  --text: #f8f4ed;
  --text-dim: rgba(248, 244, 237, 0.75);
  --text-muted: rgba(248, 244, 237, 0.5);
  --card-bg: rgba(26, 20, 16, 0.94);
  --card-border: rgba(212, 162, 74, 0.18);
  --success: #6b9b37;
  --success-light: #8bc24a;
  --warn: #d9a441;
  --warn-light: #f0c363;
  --orange: #d47a2a;
  --orange-light: #ef9a4a;
  --error: #c45a5a;
  --error-light: #e07777;
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-num: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
}

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

html { font-size: clamp(12px, 0.95vw, 22px); }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--brown-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: none;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
  padding: 1rem 1.2rem;
  height: 100vh;
}

/* ── Background: warm radial glow + drifting gold particles ─────────────── */
.bg-glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% -12%, var(--amber-glow) 0%, transparent 55%),
    radial-gradient(100% 120% at 50% 120%, rgba(61, 46, 34, 0.55) 0%, transparent 60%),
    radial-gradient(140% 120% at 50% 42%, var(--brown-light) 0%, var(--brown) 30%, var(--brown-dark) 100%);
  opacity: 0.9;
  transition: background 0.8s ease;
}
/* When under attack, the whole room glows red so it reads across the room. */
body.crit .bg-glow {
  background:
    radial-gradient(120% 95% at 50% -12%, rgba(196, 90, 90, 0.4) 0%, transparent 58%),
    radial-gradient(140% 120% at 50% 45%, rgba(61, 30, 26, 0.9) 0%, var(--brown-dark) 70%);
}
.particles { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.particle {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, var(--amber-light), var(--amber));
  box-shadow: 0 0 8px var(--amber-glow); opacity: 0;
  animation: particleDrift 18s ease-in-out infinite;
}
@keyframes particleDrift {
  0%, 100% { opacity: 0; transform: translateY(0); }
  15% { opacity: 0.6; } 50% { opacity: 0.8; } 85% { opacity: 0.5; }
  100% { opacity: 0; transform: translateY(-180px); }
}

/* ── Top strip: the always-visible glanceable state ─────────────────────── */
.topbar { display: grid; grid-template-columns: auto 1fr auto; align-items: stretch; gap: 1rem; }
.brand { display: flex; flex-direction: column; justify-content: center; padding: 0 0.4rem; }
.brand .mark { font-family: var(--font-heading); font-weight: 800; font-size: 1.9rem; line-height: 1; }
.brand .mark .g { color: var(--amber); }
.brand .mark .t { color: var(--text); }
.brand .sub { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.34em; color: var(--amber-light); text-transform: uppercase; opacity: 0.8; margin-top: 0.3rem; }

.hero { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 1rem; }
.tile {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 1rem;
  padding: 0.7rem 1.1rem; display: flex; flex-direction: column; justify-content: center; gap: 0.15rem;
  position: relative; overflow: hidden; min-width: 0;
  animation: panelIn 0.5s ease both;
}
.tile-label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.tile-main { font-family: var(--font-heading); font-weight: 700; font-size: 1.7rem; line-height: 1.02; color: var(--text); display: flex; align-items: baseline; gap: 0.5rem; }
.tile-sub { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .dot { width: 0.8rem; height: 0.8rem; border-radius: 50%; flex: 0 0 auto; }

/* Attack tile — the centerpiece, colored + animated by level */
.tile.attack { border-width: 1.5px; }
.tile.attack .tile-main { font-size: 2.05rem; }
.attack-rungs { display: flex; gap: 0.25rem; margin-top: 0.35rem; }
.rung-pip { flex: 1 1 0; height: 0.36rem; border-radius: 0.2rem; background: rgba(248,244,237,0.14); }
.tile.attack[data-level="quiet"] { border-color: rgba(107,155,55,0.4); }
.tile.attack[data-level="quiet"] .tile-main { color: var(--success-light); }
.tile.attack[data-level="quiet"] .rung-pip.on { background: var(--success); }
.tile.attack[data-level="elevated"] { border-color: rgba(217,164,65,0.5); }
.tile.attack[data-level="elevated"] .tile-main { color: var(--warn-light); }
.tile.attack[data-level="elevated"] .rung-pip.on { background: var(--warn); }
.tile.attack[data-level="shedding"] { border-color: rgba(212,122,42,0.6); }
.tile.attack[data-level="shedding"] .tile-main { color: var(--orange-light); }
.tile.attack[data-level="shedding"] .rung-pip.on { background: var(--orange); }
.tile.attack[data-level="attack"] { border-color: var(--error); animation: panelIn 0.5s ease both, critPulse 1.6s ease-in-out infinite; }
.tile.attack[data-level="attack"] .tile-main { color: var(--error-light); }
.tile.attack[data-level="attack"] .rung-pip.on { background: var(--error); }
.tile.attack[data-level="unknown"] { border-color: rgba(248,244,237,0.18); }
.tile.attack[data-level="unknown"] .tile-main { color: var(--text-muted); }
.tile.attack[data-level="unknown"] .rung-pip.on { background: var(--text-muted); }
/* No fresh reading behind the tile: dim it so an old verdict never reads as current. */
.tile.attack.stale { opacity: 0.55; }
@keyframes critPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196,90,90,0.0), 0 0 18px rgba(196,90,90,0.15); }
  50% { box-shadow: 0 0 0 0.22rem rgba(196,90,90,0.35), 0 0 30px rgba(196,90,90,0.3); }
}

/* Status + deploy tiles use a status dot */
.dot[data-s="ok"], .dot[data-s="operational"], .dot[data-s="success"], .dot[data-s="live"] { background: var(--success); box-shadow: 0 0 8px rgba(107,155,55,0.5); }
.dot[data-s="degraded"], .dot[data-s="behind"], .dot[data-s="deploying"], .dot[data-s="elevated"] { background: var(--warn); box-shadow: 0 0 8px rgba(217,164,65,0.5); animation: nodePulse 1.6s ease-in-out infinite; }
.dot[data-s="outage"], .dot[data-s="failed"], .dot[data-s="down"], .dot[data-s="failure"] { background: var(--error); box-shadow: 0 0 8px rgba(196,90,90,0.6); animation: nodePulse 1.2s ease-in-out infinite; }
.dot[data-s="unknown"], .dot[data-s="idle"] { background: var(--text-muted); }
.tile-main.small { font-size: 1.35rem; }

.clockbox { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; padding: 0 0.4rem; }
.clock { font-family: var(--font-num); font-weight: 700; font-size: 1.7rem; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.clock-date { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); margin-top: 0.3rem; letter-spacing: 0.06em; }

/* ── Page deck (rotating body) ──────────────────────────────────────────── */
.deck { position: relative; min-height: 0; }
.page {
  position: absolute; inset: 0; display: none; min-height: 0;
  opacity: 0; transition: opacity 0.6s ease;
}
.page.active { display: grid; opacity: 1; }
.page.dev { grid-template-columns: 1.5fr 1fr; gap: 1rem; }
.page.dev .rightcol { display: grid; grid-template-rows: 1.7fr 1fr; gap: 1rem; min-height: 0; }
.page.ops { grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.page.traffic { grid-template-columns: 1fr 1.2fr 0.9fr; gap: 1rem; }

.panel {
  background: var(--card-bg);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border); border-radius: 1.25rem;
  padding: 1.05rem 1.15rem; display: flex; flex-direction: column;
  min-height: 0; overflow: hidden; animation: panelIn 0.6s ease both;
}
@keyframes panelIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.8rem; flex: 0 0 auto; gap: 0.5rem; }
.panel-head h2 { font-family: var(--font-heading); font-weight: 700; font-size: 1.3rem; color: var(--text); }
.panel-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.04em; white-space: nowrap; }
.panel.stale { opacity: 0.55; }
.panel.stale .panel-head::after { content: 'stale'; font-family: var(--font-mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--warn-light); border: 1px solid rgba(217,164,65,0.4); border-radius: 0.35rem; padding: 0.05rem 0.3rem; }

/* ── Builds, grouped by commit (pulse) ─────────────────────────────────── */
.build-list { display: flex; flex-direction: column; gap: 0.4rem; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.build-group {
  position: relative; display: flex; flex-direction: column; gap: 0.3rem; justify-content: center;
  padding: 0.45rem 0.75rem; border-radius: 0.7rem;
  border: 1px solid var(--card-border); border-left: 3px solid var(--card-border);
  background: linear-gradient(150deg, rgba(61, 46, 34, 0.4), rgba(26, 20, 16, 0.4));
  overflow: hidden; flex: 1 1 0; min-height: 0;
  animation: rowIn 0.45s ease both; transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
@keyframes rowIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.build-group.is-active { border-left-color: var(--amber); animation: rowIn 0.45s ease both, activePulse 3s ease-in-out infinite 0.4s; }
.build-group.is-success { border-left-color: var(--success-light); }
.build-group.is-failure { border-left-color: var(--error-light); }
.build-group.is-neutral { border-left-color: var(--text-muted); }
.bg-line { display: flex; align-items: center; gap: 0.55rem; }
.grp-dot { flex: 0 0 auto; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--text-muted); }
.grp-dot.is-active { background: var(--amber); box-shadow: 0 0 8px var(--amber-glow); animation: nodePulse 1.6s ease-in-out infinite; }
.grp-dot.is-success { background: var(--success); box-shadow: 0 0 8px rgba(107, 155, 55, 0.5); }
.grp-dot.is-failure { background: var(--error); box-shadow: 0 0 8px rgba(196, 90, 90, 0.5); }
.grp-title { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 0.92rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-branch { flex: 0 0 auto; font-family: var(--font-mono); font-size: 0.74rem; color: var(--amber-light); opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 11rem; }
.grp-chips { display: flex; flex-wrap: wrap; gap: 0.38rem; padding-left: 1.25rem; }
.grp-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.12rem 0.5rem 0.12rem 0.4rem; border-radius: 0.5rem; border: 1px solid var(--card-border); background: rgba(26, 20, 16, 0.5); font-size: 0.78rem; }
.chip-glyph { display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem; font-size: 0.78rem; font-weight: 800; }
.chip-name { font-weight: 600; color: var(--text-dim); }
.chip-time { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.grp-chip.is-active { border-color: rgba(212, 162, 74, 0.5); }
.grp-chip.is-active .chip-glyph, .grp-chip.is-active .chip-name { color: var(--amber-light); }
.grp-chip.is-active .spinner { width: 0.85rem; height: 0.85rem; border-radius: 50%; border: 0.14rem solid rgba(232, 192, 120, 0.28); border-top-color: var(--amber-light); animation: spin 0.9s linear infinite; }
.grp-chip.is-success { border-color: rgba(107, 155, 55, 0.35); }
.grp-chip.is-success .chip-glyph { color: var(--success-light); }
.grp-chip.is-failure { border-color: rgba(196, 90, 90, 0.4); }
.grp-chip.is-failure .chip-glyph { color: var(--error-light); }
.grp-chip.is-neutral .chip-glyph { color: var(--text-muted); }
.grp-chip.chip-pop .chip-glyph { animation: glyphPop 0.7s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes activePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 162, 74, 0.28), 0 0 16px rgba(212, 162, 74, 0.1); }
  50% { box-shadow: 0 0 0 0.28rem rgba(212, 162, 74, 0), 0 0 22px rgba(212, 162, 74, 0.18); }
}
.build-group.just-succeeded { animation: rowIn 0.45s ease both, winSweep 1.5s ease-out; }
.build-group.just-succeeded::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(139, 194, 74, 0.35), transparent); transform: translateX(-100%); animation: sweep 1s ease-out; }
.build-group.just-failed { animation: rowIn 0.45s ease both, failFlash 1.5s ease-out, shake 0.5s ease-in-out; }
@keyframes sweep { to { transform: translateX(100%); } }
@keyframes winSweep { 0% { box-shadow: 0 0 0 0 rgba(139, 194, 74, 0); } 20% { box-shadow: 0 0 0 0.2rem rgba(139, 194, 74, 0.5), 0 0 30px rgba(139, 194, 74, 0.4); } 100% { box-shadow: 0 0 0 0 rgba(139, 194, 74, 0); } }
@keyframes failFlash { 0% { box-shadow: 0 0 0 0 rgba(224, 119, 119, 0); } 18% { box-shadow: 0 0 0 0.2rem rgba(224, 119, 119, 0.45), 0 0 28px rgba(196, 90, 90, 0.4); } 100% { box-shadow: 0 0 0 0 rgba(224, 119, 119, 0); } }
@keyframes glyphPop { 0% { transform: scale(0.2) rotate(-25deg); opacity: 0; } 55% { transform: scale(1.35) rotate(6deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-0.4rem); } 40% { transform: translateX(0.34rem); } 60% { transform: translateX(-0.24rem); } 80% { transform: translateX(0.14rem); } }
@keyframes nodePulse { 0%, 100% { opacity: 0.65; } 50% { opacity: 1; } }

/* ── Pull Requests (pulse) ──────────────────────────────────────────────── */
.pr-list { display: flex; flex-direction: column; gap: 0.34rem; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.pr-row {
  display: grid; grid-template-columns: auto minmax(0, auto) auto minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 0.5rem; padding: 0.36rem 0.55rem; border-radius: 0.6rem;
  border: 1px solid var(--card-border); border-left: 3px solid var(--card-border);
  background: linear-gradient(150deg, rgba(61, 46, 34, 0.34), rgba(26, 20, 16, 0.34));
  text-decoration: none; color: var(--text-dim); cursor: pointer;
  animation: rowIn 0.4s ease both; transition: border-color 0.3s ease, background 0.3s ease, transform 0.08s ease;
}
.pr-row:hover { border-color: var(--amber); }
.pr-row.is-awaiting { border-left-color: var(--amber); }
.pr-av { width: 1.4rem; height: 1.4rem; border-radius: 50%; flex: 0 0 auto; background: var(--brown-light); object-fit: cover; }
.pr-who { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; }
.pr-author { font-weight: 600; font-size: 0.84rem; color: var(--text); white-space: nowrap; max-width: 8rem; overflow: hidden; text-overflow: ellipsis; }
.pr-badge { font-family: var(--font-mono); font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--amber-light); background: rgba(212, 162, 74, 0.14); border: 1px solid var(--card-border); border-radius: 0.4rem; padding: 0.06rem 0.3rem; white-space: nowrap; }
.pr-num { font-family: var(--font-mono); font-size: 0.76rem; color: var(--amber-light); white-space: nowrap; }
.pr-title { min-width: 0; font-size: 0.84rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-checks { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--text-muted); }
.pr-checks[data-c="success"] { background: var(--success); }
.pr-checks[data-c="failure"] { background: var(--error); }
.pr-checks[data-c="pending"] { background: var(--amber); animation: nodePulse 1.6s ease-in-out infinite; }
.pr-review { font-family: var(--font-mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.1rem 0.38rem; border-radius: 0.4rem; border: 1px solid var(--card-border); white-space: nowrap; color: var(--text-muted); }
.pr-review[data-r="awaiting"] { color: var(--amber-light); border-color: rgba(212, 162, 74, 0.5); background: rgba(212, 162, 74, 0.12); }
.pr-review[data-r="approved"] { color: var(--success-light); border-color: rgba(107, 155, 55, 0.4); }
.pr-review[data-r="changes"] { color: var(--error-light); border-color: rgba(196, 90, 90, 0.4); }
.pr-review[data-r="commented"] { color: var(--text-dim); }
.pr-review[data-r="draft"] { color: var(--text-muted); font-style: italic; }
.pr-age { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-merged { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.55rem; padding-top: 0.55rem; border-top: 1px solid rgba(212, 162, 74, 0.1); flex: 0 0 auto; }
.pr-merged:empty { display: none; }
.pm-lbl { font-family: var(--font-mono); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.pm-chip { display: inline-flex; align-items: center; gap: 0.28rem; font-family: var(--font-mono); font-size: 0.7rem; color: var(--success-light); text-decoration: none; border: 1px solid rgba(107, 155, 55, 0.25); border-radius: 0.4rem; padding: 0.06rem 0.34rem; }
.pm-age { color: var(--text-muted); font-size: 0.6rem; }

/* ── Graphs (pulse) ─────────────────────────────────────────────────────── */
.graphs { gap: 0.4rem; }
.graph-block { display: flex; flex-direction: column; min-height: 0; flex: 1 1 0; }
.graph-block + .graph-block { margin-top: 0.7rem; }
.graph-title { font-family: var(--font-body); font-weight: 600; font-size: 0.86rem; color: var(--text-dim); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.06em; }
.graph-sub { font-family: var(--font-mono); font-weight: 400; font-size: 0.7rem; color: var(--text-muted); text-transform: none; letter-spacing: 0; margin-left: 0.4rem; }
.chart-bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.5rem; flex: 1 1 auto; min-height: 0; padding-top: 0.9rem; }
.bar-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 0.25rem; }
.bar-wrap { width: 100%; flex: 1 1 auto; display: flex; align-items: flex-end; justify-content: center; min-height: 0; }
.bar { width: 68%; border-radius: 0.35rem 0.35rem 0 0; background: linear-gradient(180deg, var(--amber-light), var(--amber-dark)); box-shadow: 0 0 12px var(--amber-glow); transition: height 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); min-height: 0.2rem; }
.bar-val { font-family: var(--font-num); font-weight: 600; font-size: 0.8rem; color: var(--amber-light); }
.bar-lbl { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.run-strip { display: flex; align-items: stretch; gap: 0.22rem; flex: 0 0 auto; height: 1.4rem; }
.run-cell { flex: 1 1 0; border-radius: 0.2rem; background: var(--text-muted); opacity: 0.85; }
.run-cell[data-r="s"] { background: var(--success); }
.run-cell[data-r="f"] { background: var(--error); }
.run-cell[data-r="o"] { background: var(--text-muted); }

/* ── Generic stat rows / KPI grids (ops + traffic) ──────────────────────── */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; flex: 0 0 auto; }
.kpi { background: linear-gradient(150deg, rgba(61,46,34,0.34), rgba(26,20,16,0.34)); border: 1px solid var(--card-border); border-radius: 0.8rem; padding: 0.6rem 0.8rem; display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.kpi-num { font-family: var(--font-num); font-weight: 700; font-size: 1.75rem; color: var(--amber); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi-num.warn { color: var(--warn-light); }
.kpi-num.bad { color: var(--error-light); }
.kpi-num.good { color: var(--success-light); }
.kpi-num.bump { animation: countGlow 0.6s ease; }
.kpi-lbl { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
@keyframes countGlow { 0% { text-shadow: 0 0 0 rgba(232, 192, 120, 0); transform: scale(1); } 40% { text-shadow: 0 0 24px rgba(232, 192, 120, 0.65); transform: scale(1.05); } 100% { text-shadow: 0 0 0 rgba(232, 192, 120, 0); transform: scale(1); } }

/* Provider chips (infra) */
.provider-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-top: 0.7rem; }
.prov { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.65rem; border-radius: 0.6rem; border: 1px solid var(--card-border); background: rgba(26,20,16,0.5); }
.prov .dot { width: 0.65rem; height: 0.65rem; }
.prov-name { font-size: 0.86rem; color: var(--text-dim); font-weight: 600; }

/* Box gauges (infra) */
.box-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.7rem; }
.box-row { display: grid; grid-template-columns: 4rem 1fr auto; align-items: center; gap: 0.6rem; }
.box-name { font-family: var(--font-mono); font-size: 0.78rem; color: var(--amber-light); }
.gauge { height: 0.5rem; border-radius: 0.3rem; background: rgba(248,244,237,0.1); overflow: hidden; }
.gauge > span { display: block; height: 100%; background: linear-gradient(90deg, var(--amber-dark), var(--amber-light)); transition: width 0.7s ease; }
.gauge.hot > span { background: linear-gradient(90deg, var(--orange), var(--error-light)); }
.box-val { font-family: var(--font-num); font-size: 0.86rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* Anomalies event list */
.evt-list { display: flex; flex-direction: column; gap: 0.36rem; flex: 1 1 auto; min-height: 0; overflow: hidden; margin-top: 0.4rem; }
.evt { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 0.5rem; padding: 0.32rem 0.5rem; border-radius: 0.5rem; border: 1px solid var(--card-border); border-left: 3px solid var(--card-border); background: rgba(26,20,16,0.4); animation: rowIn 0.4s ease both; }
.evt[data-sev="warn"] { border-left-color: var(--warn); }
.evt[data-sev="error"] { border-left-color: var(--error); }
.evt[data-sev="info"] { border-left-color: var(--text-muted); }
.evt-src { font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--amber-light); }
.evt-kind { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-muted); }
.evt-title { font-size: 0.82rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.evt-age { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; }

/* Health strip (anomalies) */
.health-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.health-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.55rem; border-radius: 0.5rem; border: 1px solid var(--card-border); background: rgba(26,20,16,0.5); font-size: 0.76rem; color: var(--text-dim); }
.health-chip .dot { width: 0.6rem; height: 0.6rem; }

/* Traffic: top pages + countries */
.rank-list { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.rank-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.6rem; }
.rank-bar { position: relative; height: 1.5rem; border-radius: 0.4rem; background: rgba(26,20,16,0.5); overflow: hidden; }
.rank-bar > span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(212,162,74,0.35), rgba(212,162,74,0.12)); border-radius: 0.4rem; transition: width 0.7s ease; }
.rank-bar > label { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 0.6rem; font-size: 0.8rem; color: var(--text); z-index: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-val { font-family: var(--font-num); font-size: 0.86rem; color: var(--amber-light); font-variant-numeric: tabular-nums; }

/* Sales tiles */
.sales-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 0.6rem; }
.sales-tile { border: 1px solid var(--card-border); border-radius: 0.8rem; padding: 0.6rem 0.7rem; background: rgba(26,20,16,0.5); text-align: center; }
.sales-val { font-family: var(--font-num); font-weight: 700; font-size: 1.5rem; color: var(--amber); line-height: 1; }
.sales-lbl { font-size: 0.66rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.25rem; }

/* Status endpoint pills */
.ep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-top: 0.4rem; }
.ep { display: flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.55rem; border-radius: 0.5rem; border: 1px solid var(--card-border); background: rgba(26,20,16,0.45); }
.ep .dot { width: 0.6rem; height: 0.6rem; }
.ep-name { font-size: 0.8rem; color: var(--text-dim); }
.incident-banner { margin-top: 0.6rem; padding: 0.55rem 0.75rem; border-radius: 0.6rem; border: 1px solid rgba(196,90,90,0.4); background: rgba(196,90,90,0.12); color: var(--error-light); font-size: 0.86rem; }
.incident-banner:empty { display: none; }

/* ── Bottom bar: sources + page dots ────────────────────────────────────── */
.footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 0.3rem; }
.sources { display: flex; align-items: center; gap: 0.9rem; }
.src { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.src .dot { width: 0.55rem; height: 0.55rem; }
.pagedots { display: flex; align-items: center; gap: 0.5rem; }
.pagedot { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.pagedot .pip { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: rgba(248,244,237,0.2); }
.pagedot.active { color: var(--amber-light); }
.pagedot.active .pip { background: var(--amber); box-shadow: 0 0 8px var(--amber-glow); }
.pagedot.pinned .pip { background: var(--error); box-shadow: 0 0 8px rgba(196,90,90,0.6); }
.updated { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); }

.empty-row { color: var(--text-muted); font-size: 0.92rem; padding: 0.6rem 0.35rem; font-style: italic; }

@media (prefers-reduced-motion: reduce) {
  .particle, .build-group.is-active, .grp-dot.is-active, .pr-checks[data-c="pending"],
  .tile.attack[data-level="attack"], .dot[data-s] { animation: none !important; }
  .page { transition: none; }
}

/* ── Auth pages (login + change password), verbatim from infra/pulse ─────── */
body.auth-body { cursor: auto; display: grid; grid-template-rows: none; place-items: center; gap: 0; padding: 2rem; overflow: auto; }
.auth-wrap { width: 100%; max-width: 26rem; }
.auth-card { background: var(--card-bg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--card-border); border-radius: 1.25rem; padding: 2.4rem 2.2rem; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); animation: panelIn 0.5s ease both; }
.brand-mark { font-family: var(--font-heading); font-weight: 800; line-height: 1; }
.brand-mark .g { color: var(--amber); }
.brand-mark .t { color: var(--text); }
.auth-brand { font-size: 2.2rem; text-align: center; }
.auth-sub { text-align: center; font-family: var(--font-mono); letter-spacing: 0.38em; color: var(--amber-light); font-size: 0.78rem; opacity: 0.85; text-transform: uppercase; margin: 0.35rem 0 1.6rem; }
.auth-label { font-size: 0.82rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-top: 0.85rem; margin-bottom: 0.35rem; }
.auth-input { font-family: var(--font-body); font-size: 1.05rem; color: var(--text); background: rgba(26, 20, 16, 0.6); border: 1px solid var(--card-border); border-radius: 0.7rem; padding: 0.75rem 0.9rem; outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.auth-input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-glow); }
.auth-btn { margin-top: 1.4rem; font-family: var(--font-body); font-weight: 700; font-size: 1rem; color: #1a1410; background: linear-gradient(135deg, var(--amber-light), var(--amber)); border: none; border-radius: 0.7rem; padding: 0.8rem; cursor: pointer; transition: transform 0.1s ease, box-shadow 0.2s ease; }
.auth-btn:hover { box-shadow: 0 8px 24px var(--amber-glow); }
.auth-btn:active { transform: translateY(1px); }
.auth-msg { min-height: 1.2rem; margin-top: 0.95rem; font-size: 0.9rem; text-align: center; color: var(--text-dim); }
.auth-msg.err { color: var(--error-light); }
.auth-msg.ok { color: var(--success-light); }
.auth-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid rgba(212, 162, 74, 0.1); }
.auth-foot a, .auth-link { color: var(--text-muted); font-size: 0.85rem; text-decoration: none; background: none; border: none; cursor: pointer; font-family: var(--font-body); padding: 0; }
.auth-foot a:hover, .auth-link:hover { color: var(--amber-light); }
.auth-stack { display: flex; flex-direction: column; gap: 1.2rem; max-width: 30rem; }
.auth-text { font-size: 0.95rem; line-height: 1.5; color: var(--text-muted); text-align: center; margin: 0 0 0.6rem; }
.auth-text.dim { color: var(--text-dim); font-size: 0.85rem; }
.auth-code { font-family: var(--font-mono); font-size: 2.1rem; font-weight: 700; letter-spacing: 0.32em; text-align: center; color: var(--amber-light); margin: 0.6rem 0 0.4rem; }

/* Settings: the device list */
.dev-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.dev-item { border: 1px solid var(--card-border); border-radius: 0.8rem; padding: 0.75rem 0.85rem; background: rgba(26, 20, 16, 0.45); }
.dev-item.is-pending { border-color: var(--amber); }
.dev-head { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.dev-name { font-weight: 700; color: var(--text); overflow-wrap: anywhere; margin-right: auto; }
.dev-tag { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid var(--card-border); border-radius: 999px; padding: 0.15rem 0.5rem; color: var(--text-muted); }
.dev-tag.pending { color: var(--amber-light); border-color: var(--amber); }
.dev-tag.approved { color: var(--success-light); }
.dev-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); margin-top: 0.35rem; overflow-wrap: anywhere; }
.dev-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.dev-btn { min-height: 2.5rem; padding: 0 0.95rem; border: 1px solid var(--card-border); border-radius: 0.6rem; background: transparent; color: var(--text); font-family: var(--font-body); font-size: 0.9rem; cursor: pointer; }
.dev-btn:hover { border-color: var(--amber); }
.dev-btn.primary { background: linear-gradient(135deg, var(--amber-light), var(--amber)); color: #1a1410; border: none; font-weight: 700; }
.dev-btn.danger:hover { border-color: var(--error-light); color: var(--error-light); }
.dev-link { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.9rem; }
.dev-link[hidden] { display: none; }

@media (max-width: 480px) {
  body.auth-body { padding: 1rem; }
  .auth-card { padding: 1.7rem 1.2rem; }
  .auth-code { font-size: 1.7rem; letter-spacing: 0.24em; }
}
