:root {
  --bg-1: #08101f;
  --bg-2: #0f1e38;
  --card: rgba(11, 22, 43, 0.88);
  --line: rgba(103, 144, 255, 0.18);
  --text: #edf4ff;
  --muted: #9aa9c7;
  --good: #3bff9a;
  --warn: #ffb347;
  --danger: #ff4d6d;
  --accent: #59b7ff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --cyan: #00f7ff;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(53, 116, 255, 0.22), transparent 35%),
    linear-gradient(160deg, var(--bg-1), #0a152a 42%, var(--bg-2));
}
body.defcon-alert {
  background:
    radial-gradient(circle at top right, rgba(255, 77, 109, 0.22), transparent 30%),
    radial-gradient(circle at left center, rgba(255, 159, 67, 0.12), transparent 26%),
    linear-gradient(160deg, #140915, #0a152a 42%, #0f1e38);
}
.ops-section { min-height: 100vh; padding: 12px; }
.ops-shell { max-width: 1440px; margin: 0 auto; position: relative; z-index: 1; }
.ops-bg-fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(0,247,255,.10), transparent 18%),
    radial-gradient(circle at 82% 14%, rgba(89,183,255,.12), transparent 20%),
    radial-gradient(circle at 60% 78%, rgba(255,179,71,.06), transparent 22%);
  filter: blur(6px);
}
.ops-topline { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.system-badge {
  border: 1px solid rgba(124,182,255,0.18);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(9,18,36,.72);
  color: #d8edff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  box-shadow: var(--shadow);
}
.system-badge.muted { color: #9cc4f7; }
.ops-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.eyebrow {
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: 0.28em;
  font-size: 11px;
  color: #7cb6ff;
}
.ops-header h1 { margin: 0; font-size: clamp(24px, 3vw, 40px); line-height: 1; }
.subtitle { margin: 6px 0 0; max-width: 780px; color: var(--muted); font-size: 13px; }
.ops-status-pill {
  min-width: 220px;
  text-align: center;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 33, 66, 0.7);
  box-shadow: var(--shadow);
  font-weight: 800;
  letter-spacing: 0.08em;
}
.ops-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 8px;
  margin: 0 0 8px;
}
.kpi-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(116,178,255,.16);
  background:
    radial-gradient(circle at top right, rgba(0,247,255,.12), transparent 34%),
    rgba(9,18,36,.82);
  padding: 12px 12px 10px;
  box-shadow: var(--shadow);
}
.kpi-card::after {
  content:"";
  position:absolute;
  inset:auto -20% -65% auto;
  width:160px; height:160px;
  border-radius:999px;
  background: radial-gradient(circle, rgba(89,183,255,.18), transparent 65%);
}
.kpi-card span {
  display:block; color:#9ec4f2; font-size:11px; letter-spacing:.12em; text-transform:uppercase;
  margin-bottom:6px; font-weight:800;
}
.kpi-card strong { display:block; font-size:28px; line-height:1; color:white; margin-bottom:6px; text-shadow: 0 0 24px rgba(143,225,255,.18); }
.kpi-card small { color:var(--muted); font-size:12px; }
.ops-alert-strip {
  margin: 0 0 8px;
  border-radius: 16px;
  border: 1px solid rgba(89,183,255,.14);
  background: linear-gradient(90deg, rgba(4,13,27,.8), rgba(11,32,67,.85), rgba(4,13,27,.8));
  padding: 9px 12px;
  color: #bfe8ff;
  font-weight: 800;
  letter-spacing: .12em;
  font-size: 10px;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}
.ops-alert-strip::after {
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  transform: translateX(-100%);
  animation: stripSweep 3.8s linear infinite;
}
@keyframes stripSweep { to { transform: translateX(100%); } }
body.defcon-alert .ops-alert-strip {
  color: #ffd7dd;
  border-color: rgba(255,77,109,.28);
  background: linear-gradient(90deg, rgba(37,6,16,.86), rgba(66,11,28,.94), rgba(37,6,16,.86));
}
body.defcon-alert .ops-alert-strip::after { background: linear-gradient(90deg, transparent, rgba(255,77,109,.14), transparent); }
.ops-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(330px, 0.74fr); gap: 12px; }
.ops-map-card,
.ops-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(12,24,47,.94), rgba(9,19,39,.88)),
    radial-gradient(circle at top right, rgba(0,247,255,.08), transparent 28%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
body.defcon-alert .ops-card {
  background:
    linear-gradient(180deg, rgba(22,14,24,.94), rgba(16,14,28,.88)),
    radial-gradient(circle at top right, rgba(255,77,109,.10), transparent 28%);
}
.ops-map-card { min-height: 590px; overflow: visible; }
.ops-map-card::before {
  content:"";
  position:absolute; inset:0;
  background:
    radial-gradient(circle at 20% 25%, rgba(0,247,255,.10), transparent 24%),
    radial-gradient(circle at 75% 32%, rgba(89,183,255,.08), transparent 22%),
    radial-gradient(circle at 48% 68%, rgba(255,179,71,.07), transparent 24%);
  pointer-events:none; z-index:2;
}
.ops-map-card::after {
  content:"";
  position:absolute; inset:auto 8% -28px 8%;
  height:60px;
  background: radial-gradient(circle, rgba(0,247,255,.22), transparent 72%);
  filter: blur(18px);
  pointer-events:none;
  z-index: 1;
}
.map-toolbar {
  position: relative; z-index: 1001;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 15, 30, 0.72);
  backdrop-filter: blur(8px);
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 10px; }
.toolbar-tag, .toolbar-clock { font-size: 10px; }
.toolbar-tag {
  padding: 7px 10px; border-radius: 999px;
  background: rgba(76, 145, 255, 0.16); color: #9fd3ff; font-weight: 800; letter-spacing: 0.12em;
}
.map-btn {
  cursor: pointer; border: 1px solid rgba(116, 178, 255, 0.2);
  background: rgba(9, 18, 36, 0.9); color: #d6e6ff;
  border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 700;
}
.map-btn.is-active { background: linear-gradient(90deg, rgba(58, 169, 255, 0.28), rgba(56, 255, 191, 0.18)); color: white; }
#opsMap {
  position: relative; z-index: 1;
  min-height: 520px; height: calc(100% - 50px);
  filter: saturate(1.15) contrast(1.08);
  box-shadow: 0 0 0 1px rgba(89,183,255,.10), 0 0 30px rgba(0,247,255,.10), 0 0 90px rgba(89,183,255,.08);
}
.map-overlay-grid, .map-scanline, .map-radar {
  pointer-events: none; position: absolute; inset: 50px 0 0 0; z-index: 500;
  border-radius: 0 0 20px 20px;
}
.map-overlay-grid {
  background-image: linear-gradient(rgba(117, 160, 255, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(117, 160, 255, 0.08) 1px, transparent 1px);
  background-size: 48px 48px; mix-blend-mode: screen;
}
.map-scanline { background: linear-gradient(180deg, transparent, rgba(70, 175, 255, 0.09), transparent); animation: scan 5.2s linear infinite; }
.map-radar {
  background: radial-gradient(circle at 51% 56%, rgba(0,247,255,.12), transparent 16%, transparent 21%), radial-gradient(circle at 51% 56%, rgba(89,183,255,.08), transparent 22%, transparent 32%);
  animation: radarPulse 5.8s ease-out infinite;
}
@keyframes scan { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }
@keyframes radarPulse { 0% { transform: scale(.75); opacity: 0; } 20% { opacity: .16; } 100% { transform: scale(1.55); opacity: 0; } }
.ops-sidepanel-compact { display: grid; gap: 10px; align-content: start; }
.ops-card { padding: 14px; }
.ops-card h2 { margin: 0 0 8px; font-size: 15px; }
.status-main { font-size: 22px; font-weight: 900; letter-spacing: 0.04em; }
.status-sub, .mini-text, .np-message { color: var(--muted); line-height: 1.4; font-size: 12px; }
.metric-list, .ops-log, .node-health { list-style: none; margin: 12px 0 0; padding: 0; }
.metric-list.compact { margin-bottom: 10px; }
.metric-list li, .node-health li {
  display: flex; justify-content: space-between; gap: 12px; padding: 6px 0;
  border-bottom: 1px solid rgba(112, 135, 178, 0.18); font-size: 13px;
}
.metric-list li span, .node-health li span { color: var(--muted); }
.metric-list li strong, .node-health li strong { color: white; }
.signal-panel {
  margin-top: 8px; padding: 10px; border-radius: 16px; border: 1px solid rgba(89,183,255,.16);
  background: rgba(6,14,28,.56); box-shadow: inset 0 0 0 1px rgba(89,183,255,.05), 0 0 30px rgba(0,247,255,.05);
}
.signal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 800; font-size: 13px; }
#signalDb { color: #c9ecff; }
.vu-wrap { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.vu-label { font-size: 12px; font-weight: 800; color: #9fd3ff; }
.vu-meter {
  height: 10px; border-radius: 999px; background-repeat:no-repeat; background-size:70% 100%;
  background-image: linear-gradient(90deg, #17f083 0 55%, #ffd166 55% 82%, #ff4d6d 82% 100%);
  box-shadow: 0 0 18px rgba(0,247,255,.08);
}
.signal-meta { margin-top: 6px; color: #96b7df; font-size: 11px; letter-spacing: .06em; }
.nowplaying-block { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: start; }
.np-art {
  width: 72px; aspect-ratio: 1 / 1; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(58, 121, 255, 0.32), rgba(17, 28, 46, 0.95)), center/cover no-repeat;
  box-shadow: inset 0 0 20px rgba(255,255,255,0.08);
  position: relative; overflow: hidden;
}
.np-art::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(135deg, rgba(255,255,255,.12), transparent 36%, transparent 68%, rgba(255,255,255,.06));
  mix-blend-mode: screen;
}
.np-title { display: block; font-size: 15px; margin-bottom: 4px; }
.np-artist { margin: 0 0 6px; color: #cfe0ff; }
.mini-value { font-size: 20px; font-weight: 900; margin-bottom: 4px; text-shadow: 0 0 18px rgba(89,183,255,.14); }
.mini-value-small { font-size: 24px; }
.double { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.listener-intel { display: grid; gap: 8px; }
.intel-big {
  font-size: 42px; font-weight: 900; line-height: 1; color: #9ce8ff;
  text-shadow: 0 0 28px rgba(0,247,255,.24), 0 0 70px rgba(89,183,255,.10);
}
.intel-sub, .intel-zones { color: var(--muted); }
.intel-zones { font-size: 11px; line-height: 1.35; }
.ops-bottom-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.ops-reveal { animation: revealCard .7s ease both; transform-origin: center top; }
.ops-bottom-grid .ops-card:nth-child(1) { animation-delay: .05s; }
.ops-bottom-grid .ops-card:nth-child(2) { animation-delay: .12s; }
.ops-bottom-grid .ops-card:nth-child(3) { animation-delay: .19s; }
.ops-bottom-grid .ops-card:nth-child(4) { animation-delay: .26s; }
@keyframes revealCard {
  from { opacity: 0; transform: translateY(18px) scale(.985); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.ops-log { max-height: 118px; min-height: 118px; overflow: hidden; position: relative; }
.ops-log-inner { display: block; height: 100%; overflow: hidden; position: relative; }
.ops-log-track { display: flex; flex-direction: column; gap: 8px; animation: logScroll 16s linear infinite; will-change: transform; }
.ops-log:hover .ops-log-track { animation-play-state: paused; }
@keyframes logScroll { 0% { transform: translateY(0); } 100% { transform: translateY(-50%); } }
.ops-log li {
  position: relative; padding: 0 0 6px 14px; color: var(--muted); font-size: 12px;
}
.ops-log li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px rgba(89, 183, 255, 0.6);
}
.node-ok { color: var(--good) !important; }
.node-warn { color: var(--warn) !important; }
.node-bad { color: var(--danger) !important; }
.map-legend {
  position: absolute; left: 10px; bottom: 10px; z-index: 1002; display: flex; flex-wrap: wrap;
  gap: 8px; padding: 7px 9px; border-radius: 14px; border: 1px solid rgba(116,178,255,0.16);
  background: rgba(7,15,30,0.78); backdrop-filter: blur(8px); box-shadow: var(--shadow); font-size: 10px; color: #d8e9ff;
}
.map-legend span { display:flex; align-items:center; gap:8px; }
.lg { width: 10px; height: 10px; display:inline-block; border-radius: 999px; }
.lg-hq { background: #3bff9a; box-shadow: 0 0 12px rgba(59,255,154,.6); }
.lg-node { background: #59b7ff; box-shadow: 0 0 12px rgba(89,183,255,.6); }
.lg-listener { background: var(--cyan); box-shadow: 0 0 12px rgba(0,255,255,.7); }
.lg-wave { background: #ffb347; box-shadow: 0 0 12px rgba(255,179,71,.7); }
.leaflet-container { background: #071120; font: inherit; border-radius: 0 0 20px 20px; }
.ops-popup { color: #0d1730; font-weight: 700; }
.signal-pulse {
  width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,255,154,.95) 0 40%, rgba(59,255,154,.2) 45%, transparent 75%);
  box-shadow: 0 0 28px rgba(59,255,154,.45);
  animation: hqPulse 2.2s infinite ease-out;
}
.signal-pulse.warn {
  background: radial-gradient(circle, rgba(255,179,71,.95) 0 40%, rgba(255,179,71,.2) 45%, transparent 75%);
  box-shadow: 0 0 28px rgba(255,179,71,.45);
}
.signal-pulse.danger {
  background: radial-gradient(circle, rgba(255,77,109,.95) 0 40%, rgba(255,77,109,.2) 45%, transparent 75%);
  box-shadow: 0 0 28px rgba(255,77,109,.55);
}
@keyframes hqPulse {
  0% { transform: scale(.85); opacity: .95; }
  70% { transform: scale(1.25); opacity: .25; }
  100% { transform: scale(1.45); opacity: 0; }
}
.ops-node {
  width: 16px; height: 16px; border-radius: 999px;
  border: 2px solid rgba(255,255,255,.12);
  background: rgba(89,183,255,.85);
  box-shadow: 0 0 18px rgba(89,183,255,.38);
}
.ops-node--stream { background: #7df9ff; }
.ops-node--tunein { background: #bd9bff; }
.ops-node--vps { background: #9dffba; }
.ops-node--web { background: #ffcf76; }
.ops-node--studio { background: #7fb8ff; }
.ops-node[data-mode="warning"] { box-shadow: 0 0 18px rgba(255,179,71,.35); }
.ops-node[data-mode="emergency"] { box-shadow: 0 0 20px rgba(255,77,109,.5); }
#weatherMulti { display: grid; grid-template-columns: 1fr; gap: 6px; }
.weather-mini {
  font-size: 12px; color: #cfe6ff; display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(8,16,31,.30); border: 1px solid rgba(116,178,255,.08);
}
.weather-mini strong { font-weight: 700; color: #e6f4ff; }
.weather-mini span { color: #9fb8d6; white-space: nowrap; }

@media (max-width: 1280px) {
  .ops-grid { grid-template-columns: 1fr; }
  .ops-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ops-bottom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-map-card { min-height: 520px; }
  #opsMap { min-height: 460px; }
}
@media (max-width: 760px) {
  .ops-section { padding: 10px; }
  .ops-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ops-bottom-grid { grid-template-columns: 1fr; }
  .ops-status-pill { min-width: unset; width: 100%; }
  .double { grid-template-columns: 1fr; }
}
