/* OPRA Command — CRT phosphor ops mosaic */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Share+Tech+Mono&display=swap');

:root {
  --bg: #010805;
  --panel: rgba(2, 18, 12, 0.88);
  --panel-2: rgba(3, 24, 16, 0.94);
  --line: rgba(57, 255, 160, 0.18);
  --line-strong: rgba(57, 255, 160, 0.38);
  --text: #c8ffd9;
  --muted: #5f9a78;
  --dim: #2f6a4c;
  --green: #3dff9a;
  --amber: #ffcc55;
  --cyan: #5ef0ff;
  --red: #ff4d6d;
  --violet: #c59bff;
  --glow: 0 0 10px rgba(61, 255, 154, 0.35), 0 0 28px rgba(61, 255, 154, 0.12);
  --glow-cyan: 0 0 12px rgba(94, 240, 255, 0.35);
  --glow-red: 0 0 14px rgba(255, 77, 109, 0.4);
  --mono: "Share Tech Mono", "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: #050505;
  color: var(--text);
  font-family: var(--sans);
  overflow: hidden;
}

/* Old body overlays retired — CRT layers live on .crt-screen */
body::before, body::after { display: none; }

/* ========== CRT CHASSIS ========== */
.crt-chassis {
  position: relative;
  height: 100%;
  padding: 18px 20px 34px;
  background:
    radial-gradient(ellipse at 50% 0%, #2a2a2a 0%, #121212 40%, #050505 100%);
  box-shadow: inset 0 0 80px rgba(0,0,0,.85);
}
.crt-chassis::before {
  content: "";
  position: absolute; inset: 10px;
  border-radius: 28px;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 2px #1a1a1a,
    inset 0 0 0 6px #0d0d0d,
    inset 0 0 40px rgba(0,0,0,.9);
  z-index: 2;
}
.crt-power {
  position: absolute; right: 34px; bottom: 10px; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .58rem; letter-spacing: .18em;
  color: #666; text-transform: uppercase;
}
.crt-power i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 18px rgba(61,255,154,.5);
  animation: c2-blink 1.6s infinite;
}
.crt-badge {
  position: absolute; left: 34px; bottom: 10px; z-index: 5;
  font-family: var(--mono); font-size: .58rem; letter-spacing: .2em;
  color: #555; text-transform: uppercase;
}
.crt-screen {
  position: relative;
  height: 100%;
  border-radius: 22px / 26px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, #04140c 0%, #020a06 55%, #010503 100%);
  box-shadow:
    0 0 0 3px #111,
    0 0 0 8px #1c1c1c,
    0 20px 60px rgba(0,0,0,.75),
    inset 0 0 80px rgba(61,255,154,.04);
  isolation: isolate;
}
.crt-glass, .crt-scan, .crt-grille, .crt-sweep, .crt-vignette {
  pointer-events: none;
  position: absolute; inset: 0; z-index: 70;
}
.crt-glass {
  z-index: 72;
  background:
    linear-gradient(125deg, rgba(255,255,255,.07) 0%, transparent 32%, transparent 68%, rgba(255,255,255,.03) 100%);
  mix-blend-mode: soft-light;
}
.crt-scan {
  z-index: 73;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,.22) 0px,
    rgba(0,0,0,.22) 1px,
    transparent 2px,
    transparent 3px
  );
  opacity: .55;
}
.crt-grille {
  z-index: 71;
  background:
    repeating-linear-gradient(90deg, rgba(0,255,140,.025) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0,255,140,.02) 0 1px, transparent 1px 3px);
  opacity: .7;
  mix-blend-mode: screen;
}
.crt-sweep {
  z-index: 74;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(61,255,154,.045) 46%,
    rgba(61,255,154,.09) 50%,
    rgba(61,255,154,.045) 54%,
    transparent 100%
  );
  background-size: 100% 220%;
  animation: crt-sweep 7.5s linear infinite;
  opacity: .85;
}
.crt-vignette {
  z-index: 75;
  /* Soft CRT edge only — keep corners readable */
  background:
    radial-gradient(ellipse at center, transparent 72%, rgba(0,0,0,.18) 92%, rgba(0,0,0,.32) 100%);
  opacity: .55;
}
@keyframes crt-sweep {
  0% { background-position: 0 -40%; }
  100% { background-position: 0 140%; }
}
@keyframes c2-flicker {
  0%, 100% { opacity: 0.92; }
  48% { opacity: 0.98; }
  50% { opacity: 0.82; }
  52% { opacity: 1; }
}
.crt-screen > #c2-app {
  position: relative;
  z-index: 1;
  animation: c2-flicker 5.5s infinite;
}
/* Login fills the CRT screen and centers the card (must stay absolute — a prior
   shared rule forced position:relative and pinned the gate to the top). */
.crt-screen > #c2-login {
  position: absolute;
  inset: 0;
  z-index: 100;
  animation: c2-flicker 5.5s infinite;
}
@media (prefers-reduced-motion: reduce) {
  .crt-sweep, .crt-screen > #c2-login, .crt-screen > #c2-app, .crt-power i { animation: none !important; }
}

#c2-login {
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(61,255,154,.08), transparent 42%),
    #010805;
}
#c2-login.is-open { display: flex; }
.c2-login-card {
  width: min(420px, calc(100vw - 48px));
  background: rgba(2, 16, 10, .9);
  border: 1px solid var(--line-strong);
  box-shadow: var(--glow), inset 0 0 40px rgba(61,255,154,.05);
  border-radius: 4px;
  padding: 28px 24px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.c2-boot-line {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .16em;
  color: var(--amber); text-transform: uppercase; margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(255,204,85,.35);
}
.c2-login-card h1 {
  margin: 0 0 6px; font-family: var(--mono); letter-spacing: .16em;
  text-transform: uppercase; font-size: 1.05rem; color: var(--green);
  text-shadow: var(--glow);
}
.c2-login-card p { margin: 0 0 16px; color: var(--muted); font-size: .8rem; }
.c2-login-card input {
  width: 100%; margin: 0 0 8px; padding: 11px 12px;
  border-radius: 2px; border: 1px solid var(--line-strong);
  background: #02140c; color: var(--text); font: inherit;
  box-shadow: inset 0 0 12px rgba(61,255,154,.05);
}
.c2-login-card input:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(61,255,154,.35), inset 0 0 14px rgba(61,255,154,.08);
}
.c2-login-card button {
  width: 100%; margin-top: 6px; padding: 12px;
  border: 1px solid rgba(61,255,154,.55); border-radius: 2px;
  background: rgba(61,255,154,.14); color: var(--green);
  font-family: var(--mono); font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; cursor: pointer; text-shadow: var(--glow);
  box-shadow: var(--glow);
}
.c2-login-card button:hover { background: rgba(61,255,154,.22); }
#c2-login-error { display: none; margin-top: 10px; color: var(--red); font-size: .78rem; text-shadow: var(--glow-red); }

#c2-app {
  display: none;
  height: 100%;
  grid-template-rows: auto auto auto minmax(0, 1fr) 168px auto;
  position: relative;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(61,255,154,.055), transparent 160px),
    radial-gradient(ellipse at 72% 18%, rgba(94,240,255,.05), transparent 36%),
    radial-gradient(ellipse at 20% 80%, rgba(61,255,154,.04), transparent 40%),
    transparent;
}
#c2-app.is-on { display: grid; }
#c2-app[hidden] { display: none !important; }

/* Top marquee */
.c2-marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(0, 18, 12, 0.95);
  height: 26px;
  display: flex;
  align-items: center;
  box-shadow: inset 0 -1px 0 rgba(61,255,154,.15), 0 0 20px rgba(61,255,154,.06);
}
.c2-marquee-track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: c2-marquee 55s linear infinite;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  color: var(--amber);
  text-transform: uppercase;
  padding-left: 100%;
  text-shadow: 0 0 8px rgba(255,204,85,.25);
}
.c2-marquee-track b { color: var(--green); font-weight: 700; text-shadow: var(--glow); }
@keyframes c2-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.c2-topbar {
  display: grid;
  grid-template-columns: 1.1fr auto 1.1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 10, 12, 0.92);
}
.c2-brand { min-width: 0; }
.c2-brand strong {
  display: block;
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--green);
  text-shadow: var(--glow);
}
.c2-brand span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.c2-hud-clocks {
  display: flex; gap: 16px; justify-content: center; align-items: center;
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
  padding: 4px 12px;
  border: 1px solid rgba(94,240,255,.18);
  background: rgba(0, 20, 24, .45);
  box-shadow: inset 0 0 18px rgba(94,240,255,.06);
}
.c2-hud-clocks em {
  font-style: normal; color: var(--cyan); font-size: 1.08rem; font-weight: 700;
  text-shadow: var(--glow-cyan);
  letter-spacing: .06em;
}
.c2-top-actions {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center;
}
.c2-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(0,20,16,.8);
  color: var(--muted); font-family: var(--mono); font-size: .6rem;
  letter-spacing: .05em; text-transform: uppercase;
}
.c2-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.c2-pill.is-live { color: var(--green); border-color: rgba(57,255,176,.35); }
.c2-pill.is-live .dot { background: var(--green); box-shadow: 0 0 10px var(--green); animation: c2-blink 1.2s infinite; }
.c2-pill.is-warn { color: var(--amber); border-color: rgba(255,193,74,.35); }
.c2-pill.is-warn .dot { background: var(--amber); }
.c2-pill.is-bad { color: var(--red); border-color: rgba(255,93,108,.4); }
.c2-pill.is-bad .dot { background: var(--red); box-shadow: 0 0 10px var(--red); }
@keyframes c2-blink { 50% { opacity: .35; } }

.c2-btn, .c2-window {
  appearance: none; border: 1px solid var(--line-strong);
  background: rgba(2, 22, 14, 0.92); color: var(--text);
  border-radius: 2px; padding: 5px 8px;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .08em;
  text-transform: uppercase; cursor: pointer; text-decoration: none;
  box-shadow: inset 0 0 10px rgba(61,255,154,.04);
}
.c2-btn:hover, .c2-window:hover {
  border-color: var(--green); color: var(--green);
  text-shadow: var(--glow); box-shadow: var(--glow);
}
.c2-window.active {
  background: rgba(61,255,154,.14);
  border-color: rgba(61,255,154,.65);
  color: var(--green);
  box-shadow: var(--glow);
  text-shadow: var(--glow);
}
.c2-btn.is-danger { border-color: rgba(255,77,109,.5); color: #ffb0b8; }

/* KPI ribbon */
.c2-kpis {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 1px;
  background: rgba(61,255,154,.22);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 0 24px rgba(61,255,154,.08);
}
.c2-kpi {
  background:
    linear-gradient(180deg, rgba(8,36,22,.98), rgba(2,12,8,.99));
  padding: 9px 10px; min-width: 0;
  position: relative;
}
.c2-kpi::after {
  content: "";
  position: absolute; left: 8px; right: 8px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(61,255,154,.45), transparent);
  opacity: .7;
}
.c2-kpi-label {
  color: var(--dim); font-family: var(--mono); font-size: .56rem;
  letter-spacing: .12em; text-transform: uppercase;
}
.c2-kpi-value {
  margin-top: 2px; font-size: 1.38rem; font-weight: 700;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
  color: var(--green); text-shadow: var(--glow);
}
.c2-kpi-detail {
  margin-top: 1px; color: var(--muted); font-size: .62rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.c2-kpi.is-alert .c2-kpi-value { color: var(--red); text-shadow: var(--glow-red); }
.c2-kpi.is-amber .c2-kpi-value { color: var(--amber); text-shadow: 0 0 14px rgba(255,204,85,.4); }

/* Main mosaic */
.c2-mosaic {
  display: grid;
  grid-template-columns: 21% minmax(0, 1fr) 23% 18%;
  grid-template-rows: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 8px;
  padding: 8px;
  min-height: 0;
}
.c2-panel {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow:
    inset 0 0 28px rgba(61,255,154,.045),
    0 0 18px rgba(61,255,154,.04);
  overflow: hidden;
  position: relative;
}
.c2-panel::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(135deg, rgba(61,255,154,.07), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 40%);
}
.c2-panel-head {
  display: flex; justify-content: space-between; gap: 8px; align-items: flex-start;
  padding: 8px 10px 6px; border-bottom: 1px solid var(--line);
  position: relative; z-index: 1;
  background: rgba(0, 16, 10, .55);
}
.c2-panel-head.is-expandable { cursor: pointer; }
.c2-panel-head.is-expandable:hover { background: rgba(61,255,154,.08); }
.c2-panel-head > .c2-count { margin-left: auto; }
.c2-panel-open {
  appearance: none; flex: 0 0 auto; align-self: flex-start;
  margin-left: 6px; min-height: 0; padding: 2px 5px;
  border: 1px solid rgba(61,255,154,.22); border-radius: 3px;
  background: transparent; color: var(--dim);
  font-family: var(--mono); font-size: .5rem; letter-spacing: .06em;
  text-transform: uppercase; cursor: pointer; line-height: 1.2;
  opacity: .75;
}
.c2-panel-open:hover,
.c2-panel-head.is-expandable:hover .c2-panel-open {
  opacity: 1; color: var(--green); border-color: rgba(61,255,154,.4);
  background: rgba(61,255,154,.08);
}
.c2-panel.is-expanded .c2-panel-open {
  color: var(--green); border-color: rgba(61,255,154,.45);
  background: rgba(61,255,154,.1); opacity: 1;
}
@media (max-width: 860px) {
  .c2-panel-open { padding: 3px 6px; font-size: .52rem; }
}
.c2-panel-backdrop {
  position: fixed; inset: 0; z-index: 360;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.c2-panel-backdrop[hidden] { display: none !important; }
.c2-panel-placeholder {
  border: 1px dashed rgba(61,255,154,.22);
  border-radius: 3px;
  background: rgba(61,255,154,.03);
  min-height: 72px;
}
.c2-panel.is-expanded {
  position: fixed !important;
  z-index: 370;
  left: max(12px, 3.5vw);
  right: max(12px, 3.5vw);
  top: max(12px, 3.5vh);
  bottom: max(12px, calc(3.5vh + env(safe-area-inset-bottom, 0px)));
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-shadow:
    0 0 0 1px rgba(61,255,154,.35),
    0 24px 80px rgba(0,0,0,.7),
    0 0 40px rgba(61,255,154,.16);
}
.c2-panel.is-expanded .c2-scroll,
.c2-panel.is-expanded .c2-plain.c2-scroll,
.c2-panel.is-expanded .c2-ticker {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.c2-panel.is-expanded.c2-map-panel {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto auto minmax(140px, 26%);
}
.c2-panel.is-expanded .c2-map-wrap {
  flex: 1 1 auto;
  min-height: 220px !important;
}
body.c2-panel-open .c2-mobile-nav { visibility: hidden; pointer-events: none; }
.c2-panel-label {
  color: var(--amber); font-family: var(--mono); font-size: .56rem;
  letter-spacing: .16em; text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255,204,85,.25);
}
.c2-panel-title {
  margin-top: 1px; font-size: .84rem; font-weight: 650;
  letter-spacing: .02em; text-shadow: 0 0 12px rgba(200,255,217,.12);
}
/* Keep panel heads short — meta footnotes steal probe/list viewport. */
.c2-panel-meta {
  display: none;
}
.c2-count {
  color: var(--muted); font-family: var(--mono); font-size: .58rem;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.c2-scroll { min-height: 0; overflow: auto; padding: 6px; position: relative; z-index: 1; }
.c2-scroll::-webkit-scrollbar { width: 7px; }
.c2-scroll::-webkit-scrollbar-thumb { background: rgba(57,255,176,.18); border-radius: 8px; }

.c2-map-panel { grid-column: 2; grid-row: 1 / span 2; }
.c2-left-stack, .c2-right-stack, .c2-far-stack {
  display: grid; gap: 8px; min-height: 0;
}
.c2-left-stack { grid-column: 1; grid-row: 1 / span 2; grid-template-rows: 1.05fr 0.85fr 0.9fr 0.85fr; }
.c2-right-stack { grid-column: 3; grid-row: 1 / span 2; grid-template-rows: 1.2fr 0.85fr 0.95fr; }
.c2-far-stack { grid-column: 4; grid-row: 1 / span 2; grid-template-rows: 0.85fr 0.85fr 1fr 0.9fr; }

/* Probes */
.c2-probe {
  display: grid; grid-template-columns: 8px minmax(0,1fr) auto;
  gap: 7px; align-items: start; padding: 6px 7px; border-radius: 7px;
  border: 1px solid transparent; margin-bottom: 3px;
}
.c2-probe-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 3px; background: var(--dim); }
.c2-probe.is-up { background: rgba(57,255,176,.05); border-color: rgba(57,255,176,.14); }
.c2-probe.is-up .c2-probe-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.c2-probe.is-down { background: rgba(255,93,108,.06); border-color: rgba(255,93,108,.18); }
.c2-probe.is-down .c2-probe-dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.c2-probe.is-degraded { background: rgba(255,193,74,.05); border-color: rgba(255,193,74,.18); }
.c2-probe.is-degraded .c2-probe-dot { background: var(--amber); }
.c2-probe.is-pending .c2-probe-dot { background: var(--dim); }
.c2-probe-name { font-size: .72rem; font-weight: 650; line-height: 1.2; }
.c2-probe-detail {
  margin-top: 2px; color: var(--muted); font-family: var(--mono);
  font-size: .58rem; line-height: 1.35; white-space: pre-wrap; word-break: break-word;
}
.c2-probe-ms { font-family: var(--mono); font-size: .62rem; color: var(--dim); }

.c2-plain {
  margin: 0; padding: 8px 10px; color: #b8e6cb;
  font-family: var(--mono); font-size: .63rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.c2-plain .hi { color: var(--cyan); }
.c2-plain .ok { color: var(--green); }
.c2-plain .bad { color: var(--red); }
.c2-plain .warn { color: var(--amber); }
.c2-plain .dim { color: var(--dim); }
.c2-plain .vio { color: var(--violet); }

/* Map */
.c2-map-wrap { position: relative; flex: 1; min-height: 0; }
#c2-map { width: 100%; height: 100%; min-height: 320px; background: #020a0c; }
.c2-map-wrap.is-gated #c2-map { visibility: hidden; }
.c2-map-loading {
  position: absolute; inset: 0; z-index: 460;
  display: none; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(57,255,176,.08), transparent 55%),
    rgba(2, 8, 10, 0.88);
  pointer-events: none;
}
.c2-map-loading.is-on { display: flex; }
.c2-map-loading-card {
  width: min(320px, calc(100% - 36px));
  text-align: center;
  padding: 22px 18px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(4, 16, 18, 0.92);
  box-shadow: 0 0 28px rgba(57,255,176,.08);
}
.c2-map-spinner {
  width: 28px; height: 28px; margin: 0 auto 12px;
  border-radius: 50%;
  border: 2px solid rgba(57,255,176,.18);
  border-top-color: var(--green);
  animation: c2-spin 0.85s linear infinite;
}
@keyframes c2-spin { to { transform: rotate(360deg); } }
.c2-map-loading-card strong {
  display: block; color: var(--green); font-family: var(--mono);
  letter-spacing: .1em; text-transform: uppercase; font-size: .72rem;
}
.c2-map-loading-card span {
  display: block; margin-top: 7px; color: var(--muted); font-size: .74rem; line-height: 1.35;
}
.c2-map-loading-bar {
  margin-top: 14px; height: 4px; border-radius: 999px;
  background: rgba(255,255,255,.06); overflow: hidden;
}
.c2-map-loading-bar i {
  display: block; height: 100%; width: 8%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  transition: width .35s ease;
}
.c2-map-empty {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  padding: 24px; text-align: center; color: var(--muted); font-size: .82rem;
  background: rgba(2,8,10,.55); z-index: 400; pointer-events: none;
}
.c2-map-empty strong { display: block; color: var(--green); margin-bottom: 6px; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.c2-map-hud {
  position: absolute; left: 10px; top: 10px; z-index: 450; pointer-events: none;
  display: flex; flex-direction: column; gap: 4px;
}
.c2-map-hud span {
  display: inline-flex; align-self: flex-start;
  padding: 3px 7px; border-radius: 4px;
  background: rgba(0,16,14,.82); border: 1px solid var(--line);
  font-family: var(--mono); font-size: .58rem; color: var(--amber); letter-spacing: .08em;
}
.c2-map-foot {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px;
  padding: 6px 10px; border-top: 1px solid var(--line);
  color: var(--dim); font-size: .62rem;
  min-width: 0;
}
.c2-map-legend,
.c2-map-status {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  min-width: 0;
}
.c2-map-foot strong { color: var(--muted); }
.c2-map-status span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.leaflet-container { background: #020a0c; font-family: inherit; }
.leaflet-control-zoom { border: 1px solid var(--line-strong) !important; border-radius: 6px !important; overflow: hidden; }
.leaflet-control-zoom a {
  background: rgba(4,18,16,.95) !important; color: var(--green) !important;
  border-color: var(--line) !important; width: 24px !important; height: 24px !important; line-height: 24px !important;
}
.leaflet-control-attribution { background: rgba(2,8,10,.8) !important; color: #4f7464 !important; font-size: 8px !important; }
.leaflet-control-attribution a { color: var(--cyan) !important; }

.c2-dot-icon { background: transparent !important; border: 0 !important; }
.c2-dot {
  display: block; width: 5px; height: 5px; border-radius: 50%;
  background: #4aa8ff; box-shadow: 0 0 6px rgba(74,168,255,.55); opacity: .92;
}
.c2-dot.is-verified {
  width: 4px; height: 4px; background: var(--cyan);
  box-shadow: 0 0 0 1px rgba(77,228,255,.55), 0 0 8px rgba(77,228,255,.45);
}
.c2-dot.is-selected {
  width: 8px; height: 8px; background: var(--green);
  box-shadow: 0 0 0 2px rgba(57,255,176,.35), 0 0 14px rgba(57,255,176,.55);
}
.c2-dot.is-new { animation: c2-pulse 1.1s ease-out 3; }
@keyframes c2-pulse {
  0% { box-shadow: 0 0 0 0 rgba(57,255,176,.7); transform: scale(1); }
  70% { box-shadow: 0 0 0 12px rgba(57,255,176,0); transform: scale(1.8); }
  100% { box-shadow: 0 0 0 0 rgba(57,255,176,0); transform: scale(1); }
}

/* Feed */
.c2-event {
  display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 7px;
  width: 100%; padding: 6px 7px; margin: 0 0 3px;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit;
}
.c2-event:hover { background: rgba(57,255,176,.04); border-color: var(--line); }
.c2-event.is-selected { background: rgba(57,255,176,.08); border-color: rgba(57,255,176,.28); }
.c2-event-icon {
  display: flex; align-items: center; justify-content: center; height: 30px; border-radius: 6px;
  background: rgba(77,228,255,.1); color: var(--cyan);
  font-family: var(--mono); font-size: .56rem; font-weight: 700;
}
.c2-event[data-type="export"] .c2-event-icon { background: rgba(57,255,176,.1); color: var(--green); }
.c2-event[data-type="share"] .c2-event-icon { background: rgba(176,140,255,.12); color: var(--violet); }
.c2-event[data-type="portal"] .c2-event-icon { background: rgba(255,193,74,.1); color: var(--amber); }
.c2-event[data-type="failure"] .c2-event-icon { background: rgba(255,93,108,.12); color: #ff9aa4; }
.c2-event-name { display: block; font-size: .74rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c2-event-sub { display: block; margin-top: 1px; color: var(--muted); font-size: .62rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c2-event-time { color: var(--dim); font-family: var(--mono); font-size: .58rem; white-space: nowrap; }
.c2-empty { padding: 14px 8px; color: var(--muted); font-size: .75rem; text-align: center; }

.c2-inspector-addr { font-size: .9rem; font-weight: 700; margin-bottom: 3px; }
.c2-inspector-place { color: var(--muted); font-size: .68rem; margin-bottom: 8px; }
.c2-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 8px; }
.c2-fact { padding: 6px 7px; border-radius: 6px; background: rgba(255,255,255,.02); border: 1px solid var(--line); min-width: 0; }
.c2-fact-label { color: var(--dim); font-family: var(--mono); font-size: .54rem; letter-spacing: .08em; text-transform: uppercase; }
.c2-fact-value { margin-top: 1px; font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c2-open { display: inline-flex; color: var(--cyan); font-size: .72rem; text-decoration: none; }
.c2-open:hover { text-decoration: underline; }

/* Bars / chips */
.c2-pulse-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}
.c2-pulse-body .c2-bars { flex: 0 0 auto; }
.c2-pulse-body .c2-plain {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
}
.c2-bars { display: flex; align-items: flex-end; gap: 2px; height: 54px; padding: 4px 8px 8px; }
.c2-bar {
  flex: 1; min-width: 0; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--green), rgba(57,255,176,.15));
  opacity: .85; position: relative;
}
.c2-bar[title]:hover { opacity: 1; box-shadow: 0 0 8px rgba(57,255,176,.35); }
.c2-hot-body {
  flex: 1;
  min-height: 0;
  padding: 0;
}
.c2-hot-body .c2-chip-row:last-child { padding-top: 0; }
.c2-chip-row { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 8px; }
.c2-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 7px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
  font-size: .62rem; color: var(--muted);
}
.c2-chip b { color: var(--text); font-variant-numeric: tabular-nums; }
.c2-meter {
  display: grid; grid-template-columns: 62px minmax(0,1fr) 28px; gap: 6px;
  align-items: center; padding: 3px 8px; font-size: .62rem; color: var(--muted);
}
.c2-meter-track { height: 5px; border-radius: 999px; background: rgba(255,255,255,.05); overflow: hidden; }
.c2-meter-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--green)); box-shadow: 0 0 8px rgba(57,255,176,.25); }
.c2-meter b { color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }

/* Bottom strip — fixed height so ticker scrolls inside, never grows the page */
.c2-bottom {
  display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 8px;
  padding: 0 8px 6px; height: 100%; min-height: 0; max-height: 168px;
  align-items: stretch; overflow: hidden;
}
.c2-bottom > .c2-panel {
  min-height: 0; max-height: 100%; overflow: hidden;
}
.c2-ticker-panel { min-height: 0; }
.c2-ticker {
  margin: 0; padding: 6px 10px;
  flex: 1 1 auto; min-height: 0; max-height: none; height: auto;
  overflow: auto; overflow-x: hidden; overscroll-behavior: contain;
  font-family: var(--mono); font-size: .62rem; line-height: 1.45; color: #8fceb0; white-space: pre-wrap;
  background: rgba(0, 12, 10, 0.55);
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: rgba(57,255,176,.35) transparent;
}
.c2-ticker::-webkit-scrollbar { width: 9px; }
.c2-ticker::-webkit-scrollbar-thumb {
  background: rgba(57,255,176,.28); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box;
}
.c2-ticker::-webkit-scrollbar-thumb:hover { background: rgba(57,255,176,.45); background-clip: padding-box; }
.c2-ticker .line-fail { color: #ff9aa4; }
.c2-ticker .line-portal { color: var(--amber); }
.c2-ticker .line-ok { color: var(--green); }
.c2-ticker .line-attn { color: var(--violet); }

.c2-footer-marquee {
  overflow: hidden; border-top: 1px solid var(--line);
  background: rgba(0, 14, 12, 0.96); height: 22px;
  display: flex; align-items: center;
}
.c2-footer-track {
  display: flex; gap: 40px; white-space: nowrap;
  animation: c2-marquee 70s linear infinite reverse;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .05em;
  color: var(--muted); text-transform: uppercase; padding-left: 100%;
}
.c2-footer-track b { color: var(--cyan); }

.c2-privacy {
  display: none;
}

.c2-mobile-status { display: none; }
.c2-mobile-nav { display: none; }
.c2-window-row { display: inline-flex; flex-wrap: wrap; gap: 6px; }

@media (max-width: 1280px) {
  html, body { height: auto; min-height: 100%; overflow: auto; }
  .crt-chassis { height: auto; min-height: 100vh; }
  .crt-screen { height: auto; min-height: calc(100vh - 52px); }
  #c2-app { height: auto; min-height: calc(100vh - 52px); grid-template-rows: auto; }
  .c2-mosaic {
    grid-template-columns: 24% minmax(0,1fr) 28%;
    grid-template-rows: minmax(280px, 1.2fr) minmax(220px, 1fr) minmax(170px, auto);
  }
  .c2-far-stack {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(4, minmax(0,1fr));
    grid-template-rows: minmax(170px, auto);
  }
  .c2-map-panel { grid-column: 2; grid-row: 1 / span 2; }
  .c2-right-stack { grid-column: 3; grid-row: 1 / span 2; }
  .c2-left-stack { grid-row: 1 / span 2; }
  .c2-kpis { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .c2-bottom { grid-template-columns: 1fr 1fr; max-height: none; min-height: 180px; height: auto; }
}

/* Phone / small tablet Command */
@media (max-width: 860px) {
  /* Override the tablet (≤1280) height:auto rules — those break phone scroll. */
  html, body {
    height: 100%;
    height: 100dvh;
    max-height: 100%;
    max-height: 100dvh;
    overflow: hidden;
    background: #050505;
    position: relative;
  }
  body::before, body::after { display: none; }
  .crt-chassis {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 6px 6px 8px;
    overflow: hidden;
  }
  .crt-chassis::before { inset: 4px; border-radius: 18px; }
  .crt-screen {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    border-radius: 14px / 16px;
    overflow: hidden;
  }
  .crt-power, .crt-badge { font-size: .5rem; }
  .crt-power { right: 16px; bottom: 6px; }
  .crt-badge { left: 16px; bottom: 6px; }
  /* Flex — not grid. Fixed bottom nav was stealing the 1fr row and killing scroll. */
  #c2-app.is-on:not([hidden]) {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    padding-bottom: calc(64px + max(12px, env(safe-area-inset-bottom, 0px)));
  }
  .c2-marquee, .c2-footer-marquee { display: none !important; }

  .c2-topbar {
    flex: 0 0 auto;
    width: 100%;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 10px 12px 8px;
    position: relative; z-index: 30;
  }
  .c2-brand span { display: none; }
  .c2-brand strong { font-size: .82rem; letter-spacing: .12em; }
  .c2-hud-clocks {
    grid-column: 1 / -1;
    justify-content: space-between;
    order: 3;
    font-size: .64rem;
  }
  .c2-hud-clocks em { font-size: .86rem; }
  .c2-mobile-status {
    display: flex; gap: 6px; align-items: center; justify-content: flex-end;
  }
  .c2-top-actions {
    display: none;
    grid-column: 1 / -1;
    order: 4;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 6px;
  }
  .c2-topbar.is-controls-open .c2-top-actions { display: flex; }
  .c2-top-actions .c2-pill { display: none; }
  .c2-window-row {
    display: flex; flex-wrap: nowrap; gap: 6px;
    width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .c2-btn, .c2-window {
    min-height: 36px; padding: 8px 12px; font-size: .68rem;
    border-radius: 8px; flex: 0 0 auto;
  }

  .c2-kpis {
    flex: 0 0 auto;
    width: 100%;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(132px, 42vw);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
  }
  .c2-kpi { padding: 10px 12px; border-right: 1px solid var(--line); }
  .c2-kpi-value { font-size: 1.35rem; }

  /*
   * iOS scroll: one scroller (.c2-mosaic). Stacks/lists expand with content.
   * CRT overlays stay under the UI. Map tab keeps mosaic locked + inspector scroll.
   */
  .crt-glass, .crt-scan, .crt-grille, .crt-sweep, .crt-vignette {
    z-index: 0 !important;
    mix-blend-mode: normal !important;
    pointer-events: none !important;
  }
  .crt-screen > #c2-app {
    z-index: 5;
    animation: none !important;
  }
  .crt-screen > #c2-login {
    position: absolute;
    inset: 0;
    z-index: 100;
    animation: none !important;
  }

  .c2-mosaic {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
  }
  .c2-left-stack,
  .c2-right-stack,
  .c2-far-stack,
  .c2-map-panel,
  .c2-bottom {
    display: none;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto !important;
    max-height: none !important;
    min-height: 0;
    gap: 8px;
    overflow: visible !important;
    padding: 0;
  }
  body[data-c2-mobile-tab="map"] .c2-map-panel {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto auto minmax(120px, 28%);
    height: 100% !important;
    min-height: 100%;
    overflow: hidden !important;
  }
  body[data-c2-mobile-tab="map"] .c2-mosaic {
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body[data-c2-mobile-tab="live"] .c2-right-stack,
  body[data-c2-mobile-tab="ops"] .c2-left-stack,
  body[data-c2-mobile-tab="more"] .c2-far-stack {
    display: block !important;
  }
  /* More: bottom strip is outside mosaic — scroll the whole app instead. */
  body[data-c2-mobile-tab="more"] #c2-app,
  body[data-c2-mobile-tab="more"] #c2-app.is-on {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
  }
  body[data-c2-mobile-tab="more"] .c2-mosaic {
    flex: 0 0 auto;
    overflow: visible;
  }
  body[data-c2-mobile-tab="more"] .c2-bottom {
    display: block !important;
    flex: 0 0 auto;
    width: auto;
    margin: 0 8px 8px;
  }
  body[data-c2-mobile-tab="live"] .c2-right-stack > .c2-panel,
  body[data-c2-mobile-tab="ops"] .c2-left-stack > .c2-panel,
  body[data-c2-mobile-tab="more"] .c2-far-stack > .c2-panel,
  body[data-c2-mobile-tab="more"] .c2-bottom > .c2-panel {
    display: flex;
    flex-direction: column;
    height: auto !important;
    max-height: none !important;
    margin-bottom: 8px;
    overflow: visible !important;
  }
  body[data-c2-mobile-tab="live"] .c2-scroll,
  body[data-c2-mobile-tab="live"] .c2-plain.c2-scroll,
  body[data-c2-mobile-tab="live"] .c2-ticker,
  body[data-c2-mobile-tab="ops"] .c2-scroll,
  body[data-c2-mobile-tab="ops"] .c2-plain.c2-scroll,
  body[data-c2-mobile-tab="ops"] .c2-ticker,
  body[data-c2-mobile-tab="more"] .c2-scroll,
  body[data-c2-mobile-tab="more"] .c2-plain.c2-scroll,
  body[data-c2-mobile-tab="more"] .c2-ticker {
    flex: none !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    touch-action: pan-y;
  }
  body[data-c2-mobile-tab="map"] #c2-inspector {
    max-height: min(36vh, 280px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .c2-map-wrap { min-height: 280px; }
  #c2-map { min-height: 280px; }
  .c2-map-foot {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 8px 10px;
    font-size: .6rem;
    line-height: 1.35;
  }
  .c2-map-legend {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 8px;
  }
  .c2-map-status {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .c2-map-status span {
    white-space: normal;
    word-break: break-word;
  }
  .c2-panel { min-height: 0; }

  /* On body, above CRT bezel — was clipped by .crt-screen overflow. */
  body.c2-authed .c2-mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 300;
    gap: 0;
    padding: 8px 8px max(14px, env(safe-area-inset-bottom, 0px));
    background: rgba(2, 10, 12, 0.98);
    border-top: 1px solid var(--line-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.55);
  }
  body.c2-term-open .c2-mobile-nav { visibility: hidden; pointer-events: none; }
  .c2-mobile-tab {
    appearance: none; border: 0; background: transparent;
    color: var(--muted); font-family: var(--mono);
    font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
    min-height: 48px; border-radius: 10px; cursor: pointer;
  }
  .c2-mobile-tab.active {
    color: var(--green);
    background: rgba(57,255,176,.1);
    box-shadow: inset 0 0 0 1px rgba(57,255,176,.25);
  }
  .crt-power, .crt-badge { display: none; }

  .c2-login-card { width: min(390px, calc(100vw - 24px)); }
  .c2-login-card input, .c2-login-card button { min-height: 44px; font-size: 16px; }
}

/* ========== CRT TERMINALS (Search / Scan) ========== */
.c2-btn-term {
  border-color: rgba(94,240,255,.45) !important;
  color: var(--cyan) !important;
  box-shadow: 0 0 12px rgba(94,240,255,.12);
}
.c2-btn-term:hover {
  border-color: var(--cyan) !important;
  color: #fff !important;
  text-shadow: var(--glow-cyan);
}

/* Fixed to the real viewport — never inside .crt-screen overflow (iOS keyboard trap). */
.c2-term {
  position: fixed; inset: 0; z-index: 4000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
  overscroll-behavior: none;
}
.c2-term[hidden] { display: none !important; }
.c2-term-win {
  width: min(720px, 100%);
  max-height: min(78vh, 640px);
  display: flex; flex-direction: column;
  background: #02140c;
  border: 1px solid rgba(61,255,154,.45);
  box-shadow: var(--glow), 0 24px 80px rgba(0,0,0,.65);
  border-radius: 3px;
  overflow: hidden;
  overscroll-behavior: contain;
  /* Keep list scrolling working on iOS even while the page behind is locked. */
  touch-action: pan-y;
}
.c2-term-win-lg { width: min(860px, 100%); max-height: min(84vh, 720px); }
html.c2-term-open,
html.c2-term-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
}
.c2-term-chrome {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: rgba(0, 20, 12, .95);
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--mono);
}
.c2-term-chrome strong {
  flex: 1; font-size: .68rem; letter-spacing: .14em;
  color: var(--amber); text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255,204,85,.3);
}
.c2-term-dots { display: inline-flex; gap: 5px; }
.c2-term-dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: #3a5a48; display: block;
}
.c2-term-dots i:nth-child(1) { background: #ff5d6c; box-shadow: 0 0 6px rgba(255,93,108,.5); }
.c2-term-dots i:nth-child(2) { background: #ffc14a; }
.c2-term-dots i:nth-child(3) { background: #3dff9a; box-shadow: 0 0 6px rgba(61,255,154,.45); }
.c2-term-x {
  appearance: none; border: 1px solid var(--line); background: transparent;
  color: var(--muted); width: 28px; height: 28px; border-radius: 2px;
  font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.c2-term-x:hover { color: var(--red); border-color: rgba(255,77,109,.5); }
.c2-term-screen {
  position: relative;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.12), rgba(0,0,0,.12) 1px, transparent 2px, transparent 3px),
    #03180e;
}
.c2-term-out {
  flex: 1 1 auto; min-height: 140px; max-height: none;
  margin: 0; padding: 12px 14px;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  font-family: var(--mono); font-size: .78rem; line-height: 1.45;
  color: #9dffc4; white-space: pre-wrap; word-break: break-word;
  text-shadow: 0 0 6px rgba(61,255,154,.15);
}
.c2-term-out .ok { color: var(--green); }
.c2-term-out .warn { color: var(--amber); }
.c2-term-out .bad { color: var(--red); }
.c2-term-out .hi { color: var(--cyan); }
.c2-term-out .dim { color: var(--dim); }
.c2-term-out .cmd { color: var(--amber); }

/* CRT-tinted Leaflet map inside Scan terminal */
.c2-scan-map-shell {
  margin: 8px 0 12px;
  border: 1px solid rgba(61, 255, 154, 0.4);
  box-shadow: 0 0 18px rgba(61, 255, 154, 0.12), inset 0 0 24px rgba(0, 0, 0, 0.35);
  background: #010a07;
  overflow: hidden;
  white-space: normal;
}
.c2-scan-map-hud {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  background: rgba(0, 18, 10, 0.95);
  border-bottom: 1px solid rgba(61, 255, 154, 0.22);
}
.c2-scan-map-hud-label {
  color: var(--green);
  letter-spacing: 0.06em;
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.c2-scan-map {
  width: 100%;
  height: 260px;
  background: #020a0c;
}
.c2-scan-map .leaflet-tile-pane {
  filter:
    grayscale(1)
    sepia(1)
    hue-rotate(75deg)
    saturate(2.4)
    brightness(0.88)
    contrast(1.2);
}
.c2-scan-map .leaflet-control-zoom {
  border: 1px solid rgba(61, 255, 154, 0.45) !important;
  border-radius: 2px !important;
  overflow: hidden;
}
.c2-scan-map .leaflet-control-zoom a {
  background: rgba(2, 16, 10, 0.92) !important;
  color: #9dffc4 !important;
  width: 26px !important;
  height: 26px !important;
  line-height: 26px !important;
  border-bottom-color: rgba(61, 255, 154, 0.2) !important;
}
.c2-scan-map .leaflet-control-attribution {
  background: rgba(1, 10, 7, 0.85) !important;
  color: #3d6a52 !important;
  font-size: 8px !important;
}
.c2-scan-map .leaflet-control-attribution a { color: var(--cyan) !important; }
.c2-scan-map-pin {
  background: transparent !important;
  border: 0 !important;
}
.c2-scan-map-pin i {
  display: block;
  width: 14px;
  height: 14px;
  margin: 4px;
  border-radius: 50%;
  background: #fff4a0;
  box-shadow:
    0 0 0 2px rgba(2, 16, 10, 0.85),
    0 0 10px 3px rgba(255, 210, 70, 0.85),
    0 0 22px 6px rgba(61, 255, 154, 0.35);
  animation: c2-scan-pin-pulse 1.5s ease-in-out infinite;
}
@keyframes c2-scan-pin-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.75; }
}
.c2-scan-map-legend {
  display: flex;
  gap: 14px;
  padding: 5px 10px 7px;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  border-top: 1px solid rgba(61, 255, 154, 0.18);
  background: rgba(0, 14, 8, 0.9);
}
.c2-scan-map-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.c2-scan-map-legend .lg-target {
  background: #fff4a0;
  box-shadow: 0 0 6px rgba(255, 210, 70, 0.8);
}
.c2-scan-map-legend .lg-arch {
  background: #5ef0ff;
  box-shadow: 0 0 6px rgba(94, 240, 255, 0.7);
}
.c2-term-ac {
  position: absolute; left: 12px; right: 12px; bottom: 46px;
  max-height: min(38vh, 220px);
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  background: rgba(1, 16, 10, .97);
  border: 1px solid rgba(94,240,255,.35);
  box-shadow: 0 0 24px rgba(94,240,255,.12), inset 0 0 20px rgba(61,255,154,.04);
  z-index: 2;
}
.c2-term-ac[hidden] { display: none !important; }
.c2-term-ac button {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; border: 0; border-bottom: 1px solid rgba(61,255,154,.1);
  background: transparent; color: #b8ffe0;
  font-family: var(--mono); font-size: .74rem; cursor: pointer;
}
.c2-term-ac button:hover,
.c2-term-ac button.is-active {
  background: rgba(61,255,154,.12);
  color: #fff;
  text-shadow: var(--glow);
}
.c2-term-ac button small {
  display: block; margin-top: 2px; color: var(--dim); font-size: .62rem;
}
.c2-term-prompt {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--line);
  background: rgba(0, 12, 8, .9);
}
.c2-term-ps {
  font-family: var(--mono); font-size: .78rem; color: var(--cyan);
  text-shadow: var(--glow-cyan); flex-shrink: 0;
}
.c2-term-prompt input {
  flex: 1; min-width: 0; border: 0; outline: 0;
  background: transparent; color: var(--green);
  font-family: var(--mono); font-size: .84rem;
  text-shadow: var(--glow);
  caret-color: var(--green);
}
.c2-term-prompt input::placeholder { color: var(--dim); text-shadow: none; }

@media (max-width: 860px) {
  .c2-term {
    padding: 0;
    align-items: flex-end;
    justify-content: stretch;
  }
  .c2-term-win, .c2-term-win-lg {
    width: 100%;
    max-height: min(72dvh, 720px);
    border-radius: 14px 14px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
  }
  /* iOS Safari zooms focused inputs under 16px — keep terminal fields at 16px. */
  .c2-term-prompt input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
