/* ============================================================
   GUPCO — Methane Monitoring Center
   Design System  ·  Powered by SONIC Technologies
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* Surfaces */
  --bg-0: #070b18;
  --bg-1: #0f1729;
  --bg-2: #1a2238;
  --bg-3: #232c47;

  /* Brand */
  --gold:   #F5C518;
  --gold-2: #F59E0B;
  --gold-soft: rgba(245, 197, 24, 0.18);
  --gold-glow: rgba(245, 197, 24, 0.35);
  --red:    #E63946;
  --red-soft: rgba(230, 57, 70, 0.20);
  --green:  #22C55E;
  --green-glow: rgba(34, 197, 94, 0.55);

  /* Text */
  --text:     #E8ECF4;
  --text-dim: #9AA5BD;
  --text-mute:#5B6680;

  /* Borders & shadows */
  --border:       rgba(245, 197, 24, 0.18);
  --border-soft:  rgba(255, 255, 255, 0.06);
  --shadow-card:  0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-halo:  0 0 24px var(--gold-glow), 0 0 60px rgba(245, 197, 24, 0.15);

  /* Fonts */
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-ui:      'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'Courier New', monospace;
}

* , *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

html { zoom: 0.65; }

body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-0);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* ---------- Animated background ---------- */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at top, rgba(245, 197, 24, 0.08), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(230, 57, 70, 0.06), transparent 50%),
    linear-gradient(180deg, var(--bg-0) 0%, #050811 100%);
  z-index: -2;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(245, 197, 24, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 197, 24, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  z-index: -1;
  pointer-events: none;
  animation: gridDrift 60s linear infinite;
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 48px 48px, 48px 48px; }
}

/* ---------- Page shell ---------- */
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 32px 0;
}

/* ---------- Partner logo circles ---------- */
.hero-logos-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
}

/* ---------- Partnership section (below hero) ---------- */
.partner-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 40px 0 44px;
  border-top: 1px solid rgba(245, 197, 24, 0.18);
}
.partner-label {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: rgba(245, 197, 24, 0.70);
}
.partner-cards {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}
.partner-card {
  width: 608px;
  height: 256px;
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  box-shadow:
    0 0 0 1.5px rgba(245, 197, 24, 0.55),
    0 0 36px rgba(245, 197, 24, 0.35),
    0 12px 44px rgba(0, 0, 0, 0.60);
  flex-shrink: 0;
}
.partner-card img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.partner-cards .partner-card:first-child img {
  transform: scale(1.8);
}
.partner-cards .partner-card:last-child img {
  transform: scale(1.22);
}

/* Inner-page slim partner pills */
.slim-partner {
  height: 44px;
  width: auto;
  min-width: 90px;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  box-shadow:
    0 0 0 1px rgba(245, 197, 24, 0.30),
    0 0 14px rgba(245, 197, 24, 0.22);
  flex-shrink: 0;
}
.slim-partner img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* ---------- Hero (home page) ---------- */
.hero {
  padding: 60px 0 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
  text-align: center;
}

.hero-ring { display: none; }

.hero-badge {
  width: 598px;
  height: 598px;
  flex-shrink: 0;
}
.hero-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: circle(48% at 50% 50%);
  display: block;
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(48px, 7vw, 88px);
  letter-spacing: 8px;
  margin: 10px 0 0;
  line-height: 1;
  background: linear-gradient(180deg, #FFE27A 0%, var(--gold) 45%, var(--gold-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 50px rgba(245, 197, 24, 0.25);
}

.hero-subtitle {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 7px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
}
.hero-subtitle .sep {
  display: inline-block;
  width: 36px;
  height: 1px;
  background: var(--gold);
  vertical-align: middle;
  margin: 0 14px;
  opacity: 0.7;
}

.hero-live {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding: 20px 40px;
  background: rgba(15, 23, 41, 0.65);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 24px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-dim);
  backdrop-filter: blur(6px);
}
.hero-live .dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--text-mute);
  box-shadow: 0 0 0 0 transparent;
  flex-shrink: 0;
}
.hero-live .dot.online {
  background: var(--green);
  box-shadow: 0 0 0 0 var(--green-glow);
  animation: pulseDot 1.8s ease-out infinite;
}
.hero-live .dot.offline {
  background: var(--red);
  box-shadow: 0 0 20px var(--red);
}
.hero-live .divider { color: var(--text-mute); }
.hero-live .station { color: var(--gold); letter-spacing: 4px; }
.hero-live .last { color: var(--text-mute); font-family: var(--font-mono); letter-spacing: 0.5px; text-transform: none; }

@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0.7); }
  70%  { box-shadow: 0 0 0 22px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0); }
}

/* ---------- Slim header (inner pages) ---------- */
.slim-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 0 18px;
}
.slim-logo {
  width: 260px;
  height: 260px;
  flex-shrink: 0;
}
.slim-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: circle(48% at 50% 50%);
  display: block;
}
.slim-badge {
  width: 56px; height: 56px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(245, 197, 24, 0.45);
  flex-shrink: 0;
}
.slim-badge img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); display: block; }
.slim-titles {
  display: flex; flex-direction: column; gap: 2px;
}
.slim-titles .brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  letter-spacing: 4px;
  color: var(--gold);
  line-height: 1;
}
.slim-titles .sub {
  font-size: 22px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
}
.slim-nav {
  margin-left: auto;
  display: flex; gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.slim-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 18px 36px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-dim);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(26, 34, 56, 0.4);
  transition: all 0.2s ease;
}
.slim-nav a:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 18px rgba(245, 197, 24, 0.2);
}
.slim-nav a.current {
  background: linear-gradient(180deg, rgba(245,197,24,0.18), rgba(245,197,24,0.05));
  border-color: var(--gold);
  color: var(--gold);
  cursor: default;
}

/* ---------- Section label ---------- */
.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 36px 0 18px;
  padding-left: 0;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 31px;
  background: var(--gold);
  border-radius: 2px;
  box-shadow: 0 0 12px var(--gold-glow);
}
.section-label h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--text);
}
.section-label .accent-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-soft), transparent);
}

/* ---------- Tile grid (home) ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.tile {
  position: relative;
  background: linear-gradient(160deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: tileIn 0.6s ease-out backwards;
}
.tile:nth-child(1) { animation-delay: 0.05s; }
.tile:nth-child(2) { animation-delay: 0.12s; }
.tile:nth-child(3) { animation-delay: 0.19s; }
.tile:nth-child(4) { animation-delay: 0.26s; }
.tile:nth-child(5) { animation-delay: 0.33s; }

@keyframes tileIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tile::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.6;
}
.tile:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.55), 0 0 24px rgba(245, 197, 24, 0.18);
}

/* ---------- Tile hover tooltip ---------- */
.tile-tooltip {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(0deg, rgba(7,11,24,0.98) 0%, rgba(10,17,36,0.95) 100%);
  border-top: 1px solid rgba(245, 197, 24, 0.35);
  padding: 14px 18px 16px;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.30s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.25s ease;
  z-index: 10;
  border-radius: 0 0 14px 14px;
  pointer-events: none;
}
.tile:hover .tile-tooltip {
  transform: translateY(0);
  opacity: 1;
}
.tile-tooltip .tt-label {
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.tile-tooltip .tt-desc {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.6;
  color: rgba(180, 195, 225, 0.85);
  letter-spacing: 0.2px;
}
.tile .label {
  font-size: 22px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 700;
  margin-bottom: 14px;
}
.tile .value {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 20px rgba(245, 197, 24, 0.35);
}
.tile .unit {
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-mute);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 8px;
}

/* ---------- Nav buttons (home → tools) ---------- */
.nav-tools {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.nav-btn {
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 35px;
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 19px;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-card);
}
.nav-btn::after {
  content: '→';
  font-size: 30px;
  color: var(--gold);
  transition: transform 0.25s ease;
}
.nav-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), 0 0 26px rgba(245, 197, 24, 0.22);
}
.nav-btn:hover::after { transform: translateX(6px); }

/* ---------- Controls (form inputs, presets, query button) ---------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 14px;
  padding: 18px;
  background: linear-gradient(160deg, rgba(26,34,56,0.55), rgba(15,23,41,0.55));
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}

/* ---- Range mode toggle pill ---- */
.range-toggle-bar {
  flex: 0 0 100%;
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 0 20px rgba(245, 197, 24, 0.25), inset 0 1px 0 rgba(255,255,255,0.05);
  margin-bottom: 4px;
}
.mode-seg {
  flex: 1;
  padding: 18px 24px;
  font-family: var(--font-ui);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  background: var(--bg-1);
  color: var(--text-mute);
}
.mode-seg + .mode-seg {
  border-left: 2px solid var(--gold);
}
.mode-seg.active {
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  color: var(--bg-0);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2), 0 0 18px rgba(245,197,24,0.35);
}
.mode-seg:not(.active):hover {
  background: var(--bg-2);
  color: var(--gold);
}

/* ---- Section wrappers ---- */
.manual-section {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
  transition: opacity 0.25s ease;
}
.quick-section {
  display: flex;
  align-items: flex-end;
  transition: opacity 0.25s ease;
}

/* ---- Greyed-out inactive section ---- */
.controls.quick-mode .manual-section {
  opacity: 0.22;
  pointer-events: none;
}
.controls.manual-mode .quick-section {
  opacity: 0.22;
  pointer-events: none;
}
.controls label {
  font-size: 18px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.controls input[type="datetime-local"] {
  padding: 16px 21px;
  font-family: var(--font-mono);
  font-size: 23px;
  color: var(--text);
  background: var(--bg-0);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  outline: none;
  color-scheme: dark;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.controls input[type="datetime-local"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.15);
}
.controls > div { display: flex; flex-direction: column; gap: 6px; }
.controls > div > div:first-child {
  font-size: 18px !important;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-mute) !important;
  font-weight: 700;
  margin: 0 !important;
}

/* ---------- Chip / ghost buttons (presets, metrics, col toggles) ---------- */
.presets, .metrics, .col-toggles {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.metrics, .col-toggles { margin-bottom: 14px; }

.metrics > span, .col-toggles > span {
  font-size: 14px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 700;
  margin-right: 6px;
}

.presets button,
.metrics button,
.col-toggles button {
  padding: 14px 25px;
  font-family: var(--font-ui);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(15, 23, 41, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.presets button:hover,
.metrics button:hover,
.col-toggles button:hover {
  color: var(--gold);
  border-color: var(--gold-soft);
}
.presets button.active,
.metrics button.active,
.col-toggles button.active {
  color: var(--bg-0);
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(245, 197, 24, 0.4);
}

.btn-query {
  padding: 19px 43px;
  font-family: var(--font-ui);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--bg-0);
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 197, 24, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn-query:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(245, 197, 24, 0.4);
}
.btn-query:active { transform: translateY(0); }

#queryStatus {
  font-size: 17px;
  color: var(--text-dim);
  margin: 4px 0 12px;
  min-height: 18px;
  letter-spacing: 1px;
  font-family: var(--font-mono);
}

/* ---------- Chart card ---------- */
.chart-wrap {
  background: linear-gradient(160deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  position: relative;
}
.chart-wrap::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
  border-radius: 14px 14px 0 0;
}
.chart-toolbar {
  display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center;
}
.chart-toolbar button {
  padding: 14px 26px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(245, 197, 24, 0.07);
  border: 1.5px solid rgba(245, 197, 24, 0.35);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.chart-toolbar button:hover {
  color: var(--bg-0);
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(245, 197, 24, 0.45);
}
.chart-help {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-mute);
  background: rgba(245, 197, 24, 0.05);
  border: 1px solid rgba(245, 197, 24, 0.12);
  border-radius: 8px;
  padding: 8px 18px;
  margin-bottom: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  width: fit-content;
}

/* ---------- Real-progress loading bar ---------- */
@keyframes bar-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
#queryProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 12px;
  z-index: 99999;
  background: linear-gradient(90deg, var(--gold-2), var(--gold), #FFE27A);
  box-shadow: 0 0 18px rgba(245, 197, 24, 0.85), 0 0 6px rgba(245, 197, 24, 1);
  border-radius: 0 4px 4px 0;
  opacity: 0;
  transition: width 0.12s ease-out, opacity 0.35s ease;
  pointer-events: none;
  overflow: visible;
}
#queryProgressBar::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 0;
  width: 35%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: bar-shimmer 1.4s ease-in-out infinite;
  border-radius: inherit;
}
#queryProgressPill {
  position: fixed;
  top: 18px;
  z-index: 100000;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: var(--bg-0);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 16px rgba(245, 197, 24, 0.6);
  pointer-events: none;
  opacity: 0;
  transition: left 0.12s ease-out, opacity 0.2s ease;
  white-space: nowrap;
  transform: translateX(-50%);
}
.chart-container {
  position: relative;
  height: 1200px;
  background: var(--bg-0);
  border-radius: 8px;
  border: 1px solid var(--gold-soft);
  overflow: hidden;
}

/* ---------- uPlot theme overrides ---------- */
#analyticsChart {
  position: relative; /* anchor .chart-paint-overlay inside the chart bounds */
}
#analyticsChart,
#analyticsChart .uplot,
#analyticsChart .u-wrap {
  width: 100% !important;
  height: 100% !important;
}
#analyticsChart .uplot {
  font-family: var(--font-mono);
  color: var(--text);
}

/* Custom display-only legend (replaces uPlot's built-in legend) */
.custom-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px;
  padding: 12px 18px;
  margin-bottom: 12px;
  background: rgba(15, 23, 41, 0.65);
  border: 1px solid var(--gold-soft);
  border-radius: 10px;
  font-family: var(--font-ui), 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  min-height: 24px;
}
.custom-legend:empty {
  display: none;
}
.custom-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.custom-legend .legend-swatch {
  display: inline-block;
  width: 22px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}
.custom-legend .legend-label {
  color: var(--text);
  letter-spacing: 0.5px;
}
.custom-legend .legend-value {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-weight: 700;
  color: var(--gold);
  min-width: 6ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.chart-wrap.legend-hidden .custom-legend {
  display: none !important;
}

/* Crosshair lines */
#analyticsChart .u-cursor-x,
#analyticsChart .u-cursor-y {
  border-color: rgba(245, 197, 24, 0.5) !important;
  border-right-style: dashed !important;
  border-bottom-style: dashed !important;
}

/* Cursor highlight points: dark border around series-colored fill */
#analyticsChart .u-cursor-pt {
  border: 2px solid #070b18 !important;
  border-radius: 50% !important;
  box-shadow: 0 0 0 1px rgba(245, 197, 24, 0.18);
}

/* Box-zoom drag selection */
#analyticsChart .u-select {
  background: rgba(245, 197, 24, 0.12);
  border: 1px solid var(--gold);
}

/* Floating hover tooltip card */
#analyticsChart .u-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  background: rgba(7, 11, 24, 0.95);
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  padding: 14px 18px;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 17px;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  z-index: 10;
  min-width: 240px;
  backdrop-filter: blur(2px);
}

#analyticsChart .u-tooltip-time {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 16px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--gold-soft);
  padding-bottom: 8px;
  margin-bottom: 10px;
  white-space: nowrap;
}

#analyticsChart .u-tooltip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.6;
}

#analyticsChart .u-tooltip-swatch {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

#analyticsChart .u-tooltip-label {
  color: var(--text-dim);
  font-family: var(--font-ui), 'Inter', sans-serif;
  font-size: 16px;
  flex: 1;
}

#analyticsChart .u-tooltip-val {
  color: var(--gold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 17px;
}

/* ---------- Table card ---------- */
/* =========================================================
   ANNOTATIONS
   ========================================================= */

/* Active state for the Annotate toolbar button */
.chart-toolbar button#annotateBtn.active {
  color: var(--bg-0);
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(245, 197, 24, 0.55);
}

/* Transparent overlay sits on top of .chart-container and
   blocks/passes mouse events depending on annotate mode.    */
#annotationOverlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;   /* default: pass events through to uPlot */
  cursor: default;
}
#annotationOverlay.annotate-active {
  pointer-events: all;
  cursor: crosshair;
}

/* Vertical marker lines drawn per annotation                */
/* ---- Annotation vertical line ---- */
.annotation-line {
  position: absolute;
  width: 2px;
  --r: 0; --g: 216; --b: 255;  /* overridden per element by JS based on type */
  background: linear-gradient(
    to bottom,
    rgb(var(--r),var(--g),var(--b))          0%,
    rgba(var(--r),var(--g),var(--b), 0.10)  100%
  );
  border: none;
  box-shadow: 0 0 8px rgba(var(--r),var(--g),var(--b), 0.50);
  cursor: pointer;
  pointer-events: all;
  transition: box-shadow 0.15s;
  z-index: 11;
}
.annotation-line:hover {
  box-shadow: 0 0 18px rgba(var(--r),var(--g),var(--b), 0.95),
              0 0 40px rgba(var(--r),var(--g),var(--b), 0.38);
}
/* Glowing anchor dot where line meets the flag */
.annotation-line::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: rgb(var(--r),var(--g),var(--b));
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(var(--r),var(--g),var(--b), 0.95),
              0 0 20px rgba(var(--r),var(--g),var(--b), 0.50);
}
/* Alarm: continuous pulsing red glow on the line */
.annotation-line[data-ann-type="Alarm"] {
  animation: ann-alarm-pulse 2.2s ease-in-out infinite;
}
@keyframes ann-alarm-pulse {
  0%, 100% { box-shadow: 0 0 8px  rgba(255, 45, 45, 0.50); }
  50%       { box-shadow: 0 0 26px rgba(255, 45, 45, 0.99),
                          0 0 52px rgba(255, 45, 45, 0.42); }
}

/* ----  Always-visible flag card  ---- */
.ann-flag {
  position: absolute;
  top: 10px;
  left: 9px;
  min-width: 200px;
  max-width: 320px;
  background: linear-gradient(
    138deg,
    rgba(var(--r),var(--g),var(--b), 0.14)  0%,
    rgba(8, 13, 28, 0.88)                  60%
  );
  border: 1px solid rgba(var(--r),var(--g),var(--b), 0.36);
  border-left: 3px solid rgb(var(--r),var(--g),var(--b));
  border-radius: 0 9px 9px 0;
  padding: 12px 16px 12px 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  pointer-events: none;
  z-index: 12;
  transition: box-shadow 0.15s;
}
.annotation-line:hover .ann-flag {
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.65),
    0 0 12px rgba(var(--r),var(--g),var(--b), 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}
/* Flip the card to the left when near the right edge */
.ann-flag.flipped {
  left: auto;
  right: 9px;
  border-left: 1px solid rgba(var(--r),var(--g),var(--b), 0.36);
  border-right: 3px solid rgb(var(--r),var(--g),var(--b));
  border-radius: 9px 0 0 9px;
}
/* Header row: TYPE  ·  DD/MM HH:MM */
.ann-flag-header {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 9px;
  white-space: nowrap;
}
.ann-flag-type {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: rgb(var(--r),var(--g),var(--b));
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.ann-flag-dot {
  margin: 0 7px;
  color: rgba(154, 165, 189, 0.40);
  font-size: 20px;
}
.ann-flag-ts {
  font-size: 18px;
  color: rgba(154, 165, 189, 0.75);
  font-family: var(--font-mono);
  margin-left: auto;
  padding-left: 4px;
}
/* Note text — always visible, max 2 lines */
.ann-flag-note {
  font-size: 22px;
  color: rgba(232, 236, 244, 0.92);
  font-family: var(--font-ui);
  line-height: 1.40;
  margin-bottom: 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  max-width: 295px;
}
.ann-flag-note:empty { display: none; margin-bottom: 0; }
/* Sensor readings row */
.ann-flag-readings {
  display: flex;
  flex-wrap: wrap;
  column-gap: 9px;
  row-gap: 3px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.ann-flag-reading {
  font-size: 20px;
  font-family: var(--font-mono);
  white-space: nowrap;
  opacity: 0.92;
}

/* ---- Hover tooltip: full details ---- */
#annotationTooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: rgba(6, 10, 22, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 2px solid rgba(245, 197, 24, 0.80);  /* overridden inline by JS */
  border-radius: 10px;
  padding: 11px 15px;
  min-width: 190px;
  max-width: 310px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.70);
  font-family: var(--font-ui);
}
.ann-tt-type {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-bottom: 5px;
  font-family: var(--font-mono);
}
.ann-tt-note {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 7px;
  line-height: 1.46;
  word-break: break-word;
}
.ann-tt-readings {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  margin-bottom: 7px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 7px;
  font-size: 12px;
  font-family: var(--font-mono), ui-monospace, monospace;
  line-height: 1.75;
}
.ann-tt-ts {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono), ui-monospace, monospace;
}

/* Modal backdrop                                            */
.ann-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.ann-modal-backdrop[hidden] { display: none; }

/* Modal card                                                */
.ann-modal-card {
  background: linear-gradient(160deg, #0e1629 0%, #070b18 100%);
  border: 1px solid rgba(245, 197, 24, 0.30);
  border-radius: 16px;
  padding: 28px 30px 24px;
  width: min(480px, 92vw);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.70), 0 0 0 1px rgba(245,197,24,0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ann-modal-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 12px;
  flex-wrap: wrap;
}
.ann-modal-title {
  font-family: var(--font-ui), 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.ann-modal-ts {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-dim);
}
.ann-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-ui), 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.ann-char-counter {
  font-weight: 400;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 11px;
}
.ann-select,
.ann-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 197, 24, 0.20);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-ui), 'Inter', sans-serif;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.ann-select:focus,
.ann-textarea:focus {
  border-color: rgba(245, 197, 24, 0.55);
  box-shadow: 0 0 0 2px rgba(245, 197, 24, 0.12);
}
.ann-select option { background: #0e1629; color: var(--text); }
.ann-textarea { resize: vertical; min-height: 72px; }

/* Color swatch picker */
.ann-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 4px 0 10px;
}
.ann-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
  flex-shrink: 0;
}
.ann-swatch:hover {
  transform: scale(1.18);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
}
.ann-swatch.selected {
  border-color: rgba(255, 255, 255, 0.85);
  transform: scale(1.22);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 3px 10px rgba(0, 0, 0, 0.55);
}

/* Modal action row                                          */
.ann-modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 10px;
}
.ann-modal-right {
  display: flex;
  gap: 10px;
}
.ann-btn {
  padding: 10px 22px;
  border-radius: 8px;
  font-family: var(--font-ui), 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1.5px solid transparent;
}
.ann-btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #070b18;
  border-color: var(--gold);
}
.ann-btn-primary:hover {
  box-shadow: 0 0 18px rgba(245, 197, 24, 0.50);
  filter: brightness(1.08);
}
.ann-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ann-btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: rgba(255,255,255,0.12);
}
.ann-btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.28);
}
.ann-btn-danger {
  background: rgba(239, 68, 68, 0.10);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}
.ann-btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.28);
}
.ann-btn-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* =========================================================
   TABLE / QUERY PAGE
   ========================================================= */
.table-wrap {
  background: linear-gradient(160deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  position: relative;
}
.table-wrap::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
  border-radius: 14px 14px 0 0;
}
.table-toolbar {
  display: flex; gap: 8px; margin-bottom: 10px; align-items: center; flex-wrap: wrap;
}
.table-toolbar button {
  padding: 11px 22px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(15, 23, 41, 0.7);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.table-toolbar button:hover {
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(245, 197, 24, 0.18);
}
.table-scroll {
  overflow: auto;
  height: 1200px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
}
.table-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.table-scroll::-webkit-scrollbar-track { background: var(--bg-0); }
.table-scroll::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 5px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: var(--gold-soft); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 28px;
  font-family: var(--font-mono);
}
thead th {
  background: var(--bg-0);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 18px 20px;
  text-align: left;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  white-space: nowrap;
  border-bottom: 1px solid var(--gold-soft);
  z-index: 2;
}
thead th:hover { background: var(--bg-1); color: #FFE27A; }
thead th.sort-asc::after  { content: ' ↑'; color: var(--gold); }
thead th.sort-desc::after { content: ' ↓'; color: var(--gold); }
tbody td {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text);
  white-space: nowrap;
}
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
tbody tr:hover td {
  background: rgba(245, 197, 24, 0.06);
  box-shadow: inset 3px 0 0 var(--gold);
}
/* PPM highlight rows */
tbody tr.row-warn td {
  background: rgba(251, 146, 60, 0.35) !important;
}
tbody tr.row-warn:hover td {
  background: rgba(251, 146, 60, 0.50) !important;
}
tbody tr.row-danger td {
  background: rgba(230, 57, 70, 0.38) !important;
}
tbody tr.row-danger:hover td {
  background: rgba(230, 57, 70, 0.55) !important;
}

.pagination {
  display: flex; gap: 30px; align-items: center; justify-content: center;
  margin-top: 42px;
  font-size: 36px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.pagination button {
  padding: 21px 45px;
  font-family: var(--font-ui);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(15, 23, 41, 0.7);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pagination button:hover:not(:disabled) {
  color: var(--gold);
  border-color: var(--gold);
}
.pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
#pageInfo { font-family: var(--font-mono); color: var(--gold); letter-spacing: 1.5px; }
.page-jump {
  display: inline-flex; align-items: center; gap: 18px;
  margin-left: 8px;
  font-size: 36px; letter-spacing: 2px; color: var(--text-dim); font-weight: 700;
}
#pageJump {
  width: 165px;
  padding: 18px 24px;
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(15, 23, 41, 0.7);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  text-align: center;
  outline: none;
}
#pageJump:focus { border-color: var(--gold); }

/* ---------- Footer ---------- */
.footer {
  margin-top: 36px;
  padding: 44px 0 36px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 22px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
  flex-shrink: 0;
}
.footer .center {
  text-align: center;
  color: var(--text-dim);
  letter-spacing: 4px;
}
.footer .center strong {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 5px;
}
.footer .right { text-align: right; color: var(--text-mute); }
.footer .right a.footer-contact {
  color: var(--gold);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}
.footer .right a.footer-contact:hover {
  color: var(--gold-2);
  text-decoration: underline;
}
.sonic-brand { color: var(--red); }
.sonic-brand strong { color: var(--red); font-weight: 700; }
.footer .center .sonic-brand,
.footer .center .sonic-brand strong,
.intro-powered .sonic-brand,
.intro-powered .sonic-brand strong { color: var(--red); }

/* ---------- Intro overlay ---------- */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse at center, #0a1024 0%, #050811 70%, #000000 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.55s ease;
}
.intro-overlay.intro-fadeout {
  opacity: 0;
  pointer-events: none;
}

.intro-overlay::before,
.intro-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.intro-overlay::before {
  background-image:
    linear-gradient(rgba(245, 197, 24, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 197, 24, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 25%, transparent 75%);
  animation: introGridSweep 1.8s ease-out forwards;
  opacity: 0;
}
.intro-overlay::after {
  background:
    radial-gradient(circle at 20% 30%, rgba(245, 197, 24, 0.10), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(230, 57, 70, 0.08), transparent 45%);
}

@keyframes introGridSweep {
  0%   { opacity: 0; transform: translateX(-30%) skewX(-12deg); }
  60%  { opacity: 1; }
  100% { opacity: 0.55; transform: translateX(0) skewX(0); }
}

.intro-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  z-index: 2;
}

.intro-badge {
  width: 720px;
  height: 720px;
  opacity: 0;
  transform: scale(0.55);
  animation: introBadgeIn 0.9s cubic-bezier(.16,1,.3,1) 0.25s forwards;
}
.intro-badge img {
  width: 100%; height: 100%;
  object-fit: cover;
  clip-path: circle(48% at 50% 50%);
  display: block;
}

@keyframes introBadgeIn {
  to { opacity: 1; transform: scale(1); }
}
@keyframes introHaloIn {
  to { opacity: 0.85; }
}

.intro-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(96px, 16vw, 192px);
  letter-spacing: 14px;
  margin: 0;
  line-height: 1;
  background: linear-gradient(180deg, #FFE27A, var(--gold) 45%, var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: flex;
  gap: 2px;
}
.intro-title span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: introLetterIn 0.5s cubic-bezier(.2,.9,.3,1) forwards;
}
.intro-title span:nth-child(1) { animation-delay: 0.85s; }
.intro-title span:nth-child(2) { animation-delay: 0.95s; }
.intro-title span:nth-child(3) { animation-delay: 1.05s; }
.intro-title span:nth-child(4) { animation-delay: 1.15s; }
.intro-title span:nth-child(5) { animation-delay: 1.25s; }

@keyframes introLetterIn {
  to { opacity: 1; transform: translateY(0); }
}

.intro-subtitle {
  position: relative;
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0;
  animation: introFadeUp 0.7s ease-out 1.35s forwards;
  padding-bottom: 14px;
}
.intro-subtitle::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
  transform: translateX(-50%);
  animation: introRule 0.8s ease-out 1.55s forwards;
}

@keyframes introFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes introRule {
  to { width: 70%; }
}

.intro-station {
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-top: -6px;
  opacity: 0;
  animation: introFadeUp 0.6s ease-out 1.7s forwards;
}

.intro-powered {
  margin-top: 16px;
  opacity: 0;
  animation: introFadeUp 0.7s ease-out 1.85s forwards;
  font-family: var(--font-ui);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .intro-overlay,
  .intro-overlay *,
  .agent-step.processing .agent-step-dot {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ================================================================
   CORNER PARTNER LOGOS (fixed top corners of live page)
   ================================================================ */
.corner-logo {
  position: absolute;
  top: 22px;
  z-index: 5;
  width: 608px;
  height: 256px;
  border-radius: 18px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow: hidden;
  box-shadow:
    0 0 0 1.5px rgba(245, 197, 24, 0.55),
    0 0 36px rgba(245, 197, 24, 0.35),
    0 12px 44px rgba(0, 0, 0, 0.60);
  pointer-events: none;
}
.corner-logo-left  { left: 22px; }
.corner-logo-right { right: 22px; }
.corner-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.corner-logo-left  img { transform: scale(1.37); }
.corner-logo-right img { transform: scale(1.40); }

/* Shrink corner logos on narrower screens so they don't overlap the hero */
@media (max-width: 1600px) {
  .corner-logo { width: 380px; height: 160px; padding: 26px; border-radius: 16px; }
}
@media (max-width: 1200px) {
  .corner-logo { width: 260px; height: 110px; padding: 18px; border-radius: 14px; top: 18px; }
  .corner-logo-left  { left: 18px; }
  .corner-logo-right { right: 18px; }
}

/* ================================================================
   LIVE GRAPH SECTION
   ================================================================ */
.live-graph-section {
  /* Break out of .page's 32px side padding so the graph spans full screen. */
  margin: 26px -32px 8px;
  padding: 0 0 8px;
}
@media (max-width: 880px) {
  .live-graph-section { margin: 26px -18px 8px; padding: 0 0 8px; }
  .corner-logo { width: 140px; height: 60px; padding: 8px 12px; top: 12px; border-radius: 12px; }
  .corner-logo-left  { left: 12px; }
  .corner-logo-right { right: 12px; }
}
.live-graph-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(245, 197, 24, 0.18);
}
.live-graph-title {
  font-family: var(--font-display), 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  margin: 0;
  color: var(--gold);
  text-transform: uppercase;
}
@keyframes lgPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.75); }
  70%  { box-shadow: 0 0 0 14px rgba(255, 59, 59, 0.00); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.00); }
}
.live-graph-window {
  font-family: var(--font-mono, ui-monospace), monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(154, 165, 189, 0.65);
  margin-left: auto;
}
.live-graph-hint {
  font-family: var(--font-mono, ui-monospace), monospace;
  font-size: 18px;
  letter-spacing: 2px;
  color: rgba(154, 165, 189, 0.55);
  margin-left: 14px;
}
.live-graph-card {
  background: linear-gradient(
    150deg,
    rgba(12, 18, 36, 0.78) 0%,
    rgba(6, 10, 22, 0.92) 100%
  );
  border: 1px solid rgba(245, 197, 24, 0.22);
  border-radius: 14px;
  padding: 18px 18px 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Chip row */
.lg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.lg-chip {
  --c: #F5C518;
  display: inline-flex;
  align-items: baseline;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 2px solid transparent;
  border-radius: 9px;
  padding: 16px 28px 14px;
  color: var(--text);
  font-family: var(--font-ui), 'Inter', sans-serif;
  font-size: 26px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.10s;
  user-select: none;
}
.lg-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(var(--c), 0.30);
}
.lg-chip.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.10);
  border-bottom-color: var(--c);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.lg-chip-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
  align-self: center;
}
.lg-chip-name {
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(232, 236, 244, 0.85);
  font-size: 26px;
}
.lg-chip.is-active .lg-chip-name { color: #fff; }
.lg-chip-val {
  font-family: var(--font-mono, ui-monospace), monospace;
  font-size: 30px;
  font-weight: 700;
  color: var(--c);
  margin-left: 2px;
  min-width: 56px;
  text-align: right;
}
.lg-chip-unit {
  font-family: var(--font-mono, ui-monospace), monospace;
  font-size: 20px;
  color: rgba(154, 165, 189, 0.65);
  letter-spacing: 0.5px;
}

/* Canvas wrap */
.lg-canvas-wrap {
  position: relative;
  width: 100%;
  height: 360px;
  border-radius: 10px;
  overflow: hidden;
}
#liveGraphCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
#liveGraphCanvas.is-dragging { cursor: grabbing; }
#liveGraphCanvas:active     { cursor: grabbing; }

/* Hover tooltip */
.lg-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: rgba(6, 10, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 2px solid #F5C518; /* overridden inline by JS */
  border-radius: 8px;
  padding: 7px 11px 6px;
  min-width: 92px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
  font-family: var(--font-ui), 'Inter', sans-serif;
}
.lg-tt-time {
  font-family: var(--font-mono, ui-monospace), monospace;
  font-size: 10px;
  color: rgba(154, 165, 189, 0.75);
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.lg-tt-val {
  font-family: var(--font-mono, ui-monospace), monospace;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.lg-tt-unit {
  font-size: 10px;
  color: rgba(154, 165, 189, 0.65);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ---------- Responsive trim ---------- */
@media (max-width: 720px) {
  .page { padding: 0 18px; }
  .hero-logos-row { gap: 14px; flex-wrap: wrap; justify-content: center; }
  .partner-card { width: 224px; height: 96px; padding: 14px; border-radius: 14px; }
  .lg-canvas-wrap { height: 280px; }
  .live-graph-title { font-size: 20px; letter-spacing: 1.5px; }
  .lg-chip { font-size: 12px; padding: 6px 10px 5px; }
  .lg-chip-val { font-size: 13px; }
  .hero { padding: 36px 0 28px; }
  .hero-ring { display: none; }
  .hero-badge { width: 209px; height: 209px; }
  .hero-title { letter-spacing: 5px; }
  .slim-header { flex-wrap: wrap; }
  .slim-nav { margin-left: 0; width: 100%; }
  .footer { flex-direction: column; text-align: center; gap: 10px; }
}

/* ================================================================
   SUPERVISORY AGENT — FAB + DRAWER
   ================================================================ */

/* FAB container */
#agentFab {
  position: fixed;
  bottom: 60px;
  right: 36px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  user-select: none;
}

/* Pulsing ring */
.agent-fab-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  opacity: 0.35;
  transform: translate(-50%, calc(-50% - 16px));
  animation: agentRingPulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes agentRingPulse {
  0%, 100% { transform: translate(-50%, calc(-50% - 16px)) scale(1);   opacity: 0.35; }
  50%       { transform: translate(-50%, calc(-50% - 16px)) scale(1.18); opacity: 0.10; }
}

/* FAB button */
.agent-fab-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1a2444 0%, #0f1729 100%);
  box-shadow: 0 0 0 2px var(--gold), 0 6px 28px rgba(245, 197, 24, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.agent-fab-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--gold), 0 10px 36px rgba(245, 197, 24, 0.38);
}
#agentFab.agent-fab-active .agent-fab-btn {
  box-shadow: 0 0 0 2.5px var(--gold-2), 0 0 18px rgba(245, 158, 11, 0.5);
  background: linear-gradient(145deg, #22305c 0%, #1a2444 100%);
}

/* AGENT label */
.agent-fab-label {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--gold);
  opacity: 0.85;
}

/* ── Drawer ───────────────────────────────────────────────── */
#agentDrawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  z-index: 8999;
  background: linear-gradient(180deg, #0d1630 0%, #070b18 100%);
  border-left: 1px solid rgba(245, 197, 24, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -8px 0 48px rgba(0, 0, 0, 0.6);
}
#agentDrawer.agent-drawer-open {
  transform: translateX(0);
}

/* ── Header ───────────────────────────────────────────────── */
.agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(245, 197, 24, 0.18);
  background: rgba(15, 23, 41, 0.9);
  flex-shrink: 0;
}
.agent-header-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.agent-title {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
}
.agent-subtitle {
  font-family: var(--font-ui, 'Inter', sans-serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
  color: rgba(245, 197, 24, 0.55);
  text-transform: uppercase;
}
.agent-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.agent-status-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green, #22C55E);
  box-shadow: 0 0 10px var(--green, #22C55E);
  animation: agentStatusPulse 2s ease-in-out infinite;
}
@keyframes agentStatusPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
.agent-close-btn {
  background: none;
  border: none;
  color: rgba(245, 197, 24, 0.55);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.15s;
}
.agent-close-btn:hover { color: var(--gold); }

/* ── Messages area ────────────────────────────────────────── */
.agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 197, 24, 0.3) transparent;
}
.agent-messages::-webkit-scrollbar { width: 5px; }
.agent-messages::-webkit-scrollbar-track { background: transparent; }
.agent-messages::-webkit-scrollbar-thumb {
  background: rgba(245, 197, 24, 0.28);
  border-radius: 4px;
}

/* User bubble */
.agent-msg-user {
  align-self: flex-end;
  max-width: 82%;
}
.agent-msg-user .agent-msg-content {
  background: linear-gradient(135deg, #b8941a 0%, #F5C518 100%);
  color: #0a0e1a;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 500;
  padding: 11px 15px;
  border-radius: 16px 16px 4px 16px;
  word-break: break-word;
  line-height: 1.5;
}

/* Agent bubble */
.agent-msg-bot {
  align-self: flex-start;
  max-width: 92%;
}
.agent-msg-bot .agent-msg-content {
  background: rgba(15, 23, 41, 0.95);
  color: #dce8f5;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 400;
  padding: 13px 16px;
  border-radius: 4px 16px 16px 16px;
  border: 1px solid rgba(245, 197, 24, 0.22);
  word-break: break-word;
  line-height: 1.65;
}
.agent-msg-bot .agent-msg-content p {
  margin: 0 0 8px;
}
.agent-msg-bot .agent-msg-content p:last-child {
  margin-bottom: 0;
}
.agent-msg-bot .agent-msg-content strong {
  color: var(--gold);
  font-weight: 600;
}

/* Welcome message */
.agent-welcome .agent-msg-content {
  background: rgba(245, 197, 24, 0.06);
  border-color: rgba(245, 197, 24, 0.35);
  color: rgba(220, 232, 245, 0.85);
}

/* Error bubble */
.agent-msg-error {
  align-self: flex-start;
  max-width: 92%;
}
.agent-msg-error .agent-msg-content {
  background: rgba(230, 57, 70, 0.12);
  color: #ffaaaa;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 4px 14px 14px 14px;
  border: 1px solid rgba(230, 57, 70, 0.35);
  word-break: break-word;
  line-height: 1.5;
}

/* ── Analysis block ───────────────────────────────────────── */
.agent-analysis {
  align-self: flex-start;
  width: 90%;
  background: rgba(10, 14, 28, 0.96);
  border: 1px solid rgba(245, 197, 24, 0.18);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agent-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui, 'Inter', sans-serif);
  font-size: 12.5px;
  color: rgba(180, 200, 230, 0.35);
  transition: color 0.3s ease;
}
.agent-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(180, 200, 230, 0.15);
  border: 1.5px solid rgba(180, 200, 230, 0.2);
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.agent-step.active {
  color: var(--gold);
}
.agent-step.active .agent-step-dot {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(245, 197, 24, 0.6);
  animation: agentDotPulse 0.9s ease-in-out infinite;
}
@keyframes agentDotPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(245, 197, 24, 0.5); }
  50%       { box-shadow: 0 0 14px rgba(245, 197, 24, 0.9); }
}
.agent-step.done {
  color: var(--green, #22C55E);
}
.agent-step.done .agent-step-dot {
  background: var(--green, #22C55E);
  border-color: var(--green, #22C55E);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
  animation: none;
}

/* ── Input bar ────────────────────────────────────────────── */
.agent-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 14px 18px;
  border-top: 1px solid rgba(245, 197, 24, 0.14);
  background: rgba(7, 11, 24, 0.98);
  flex-shrink: 0;
}
.agent-textarea {
  flex: 1;
  resize: none;
  background: rgba(15, 23, 41, 0.9);
  border: 1px solid rgba(245, 197, 24, 0.22);
  border-radius: 10px;
  color: #dce8f5;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s ease;
  max-height: 120px;
  overflow-y: auto;
}
.agent-textarea::placeholder { color: rgba(180, 200, 230, 0.35); }
.agent-textarea:focus { border-color: var(--gold); }
.agent-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #b8941a 0%, #F5C518 100%);
  color: #0a0e1a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.agent-send-btn:hover:not(:disabled) { transform: scale(1.07); }
.agent-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Mobile adjustments */
@media (max-width: 480px) {
  #agentDrawer { width: 100vw; }
  #agentFab { bottom: 22px; right: 20px; }
}

/* end-of-file marker for visual-pack append */

/* ================================================================
   VISUAL POLISH PACK
   ================================================================ */

/* ── Trends: paint-on reveal ─────────────────────────────────── */
.chart-paint-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  --paint-color: #F5C518;
}

.chart-paint-mask {
  position: absolute;
  inset: 0;
  background: var(--bg-0); /* solid dark fill hides the chart until wiped away */
  transform-origin: right center; /* scaleX shrinks from the left, revealing left→right */
  animation: chartPaintWipe 1500ms cubic-bezier(0.22, 0.9, 0.34, 1) forwards;
}

.chart-paint-beam {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--paint-color) 12%,
    var(--paint-color) 88%,
    transparent 100%
  );
  box-shadow:
    0 0 18px 4px var(--paint-color),
    0 0 52px 16px var(--paint-color),
    0 0 100px 32px var(--paint-color);
  animation: chartPaintBeamPct 1500ms cubic-bezier(0.22, 0.9, 0.34, 1) forwards;
}

@keyframes chartPaintWipe {
  /* scaleX(1)→scaleX(0) with transform-origin:right reveals the chart left→right.
     Replaces clip-path:inset() which misbehaves under html{zoom} in non-Edge Chromium. */
  0%   { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

@keyframes chartPaintBeamPct {
  0%   { left: 0%;   opacity: 0; }
  6%   { opacity: 1; }
  94%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* Annotation overlay fades in alongside the wipe. */
#annotationOverlay.paint-revealing {
  animation: annoFadeIn 1500ms ease-out both;
}
@keyframes annoFadeIn {
  0%   { opacity: 0; }
  35%  { opacity: 0; }
  100% { opacity: 1; }
}

/* ── Live: radar pulse ───────────────────────────────────────── */
.lg-canvas-wrap { position: relative; }
.lg-radar-pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--c, #F5C518);
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 0.85;
  pointer-events: none;
  z-index: 3;
  animation: lgRadarRing 850ms ease-out forwards;
  box-shadow: 0 0 20px var(--c, #F5C518), 0 0 40px var(--c, #F5C518);
}
@keyframes lgRadarRing {
  0%   { transform: translate(-50%, -50%) scale(0.3); opacity: 0.85; }
  100% { transform: translate(-50%, -50%) scale(4.5); opacity: 0; }
}

/* ── Live: alert mode (orange + red tiers) ───────────────────── */
body.alert-orange::before,
body.alert-red::before {
  content: none;
}

.tile.ppm-alert-orange {
  border-color: rgba(251, 146, 60, 0.55);
  background: linear-gradient(160deg, rgba(55, 32, 14, 0.78) 0%, var(--bg-1) 100%);
  box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(251, 146, 60, 0.08);
}
.tile.ppm-alert-red {
  border-color: rgba(230, 57, 70, 0.62);
  background: linear-gradient(160deg, rgba(53, 16, 22, 0.78) 0%, var(--bg-1) 100%);
  box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(230, 57, 70, 0.10);
}

.tile.ppm-alert-orange #los_ppm {
  color: #FB923C;
  text-shadow: 0 0 10px rgba(251, 146, 60, 0.24);
}
.tile.ppm-alert-red #los_ppm {
  color: #F87171;
  text-shadow: 0 0 12px rgba(230, 57, 70, 0.30);
}

/* ── Data Log: row stagger + first-paint pulse ───────────────── */
tbody tr.row-stagger-in {
  animation: rowStaggerIn 360ms cubic-bezier(0.22, 0.9, 0.34, 1) var(--row-delay, 0ms) both;
}
@keyframes rowStaggerIn {
  0%   { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}

tbody tr.row-highlight-pulse {
  animation: rowHighlightPulse 1200ms ease-out 1;
}
@keyframes rowHighlightPulse {
  /* outline on <tr> avoids inset box-shadow paint-scheduler issues under html{zoom}. */
  0%   { outline: 0px solid rgba(245, 197, 24, 0); }
  30%  { outline: 3px solid rgba(245, 197, 24, 0.55); }
  100% { outline: 0px solid rgba(245, 197, 24, 0); }
}

