:root{
  --bg0:#070b14;
  --text:#eaf0ff;
  --muted:rgba(234,240,255,0.70);
  --line:rgba(255,255,255,0.10);
  --accent:#77bfff;
  --danger:#ff3b30;
}

*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif; background:radial-gradient(1200px 600px at 30% 10%, #122048, transparent), var(--bg0); color:var(--text); }
a{ color:inherit; text-decoration:none; }

.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; gap:16px;
  padding:14px 16px;
  background:linear-gradient(180deg, rgba(5,7,14,0.95), rgba(5,7,14,0.75));
  border-bottom:1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand{ display:flex; flex-direction:column; gap:2px; min-width:180px; }
.brandTitle{ font-weight:900; letter-spacing:1px; }
.brandSub{ font-size:12px; color:var(--muted); }

.tabs{ display:flex; gap:10px; }
.tab{
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,0.03);
  font-weight:700;
  font-size:13px;
}
.tab.active{ border-color:rgba(119,191,255,0.55); box-shadow:0 0 0 3px rgba(119,191,255,0.12) inset; }

.statusPills{ margin-left:auto; display:flex; gap:10px; align-items:center; }
.pill{
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,0.03);
  font-size:12px;
  color:var(--muted);
  font-weight:800;
}
.pillOk{ color:rgba(200,255,220,0.90); border-color:rgba(200,255,220,0.25); }

.main{ padding:24px 16px 40px; }
.app{ max-width:980px; margin:0 auto; }

.card{
  background:linear-gradient(180deg, rgba(15,26,51,0.92), rgba(10,17,34,0.92));
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:0 18px 50px rgba(0,0,0,0.35);
  padding:16px;
  margin-bottom:14px;
}

.h1{ font-size:18px; font-weight:900; margin:0 0 10px 0; letter-spacing:0.4px; }
.row{ display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.col{ flex:1; min-width:240px; }

.label{ font-size:12px; color:var(--muted); font-weight:800; margin:0 0 6px; }
.input, select{
  width:100%;
  background:rgba(255,255,255,0.03);
  border:1px solid var(--line);
  color:var(--text);
  padding:12px 12px;
  border-radius:12px;
  outline:none;
  font-weight:800;
  letter-spacing:0.6px;
}
.input:focus, select:focus{ border-color:rgba(119,191,255,0.6); box-shadow:0 0 0 3px rgba(119,191,255,0.10); }

.btn{
  border:1px solid rgba(119,191,255,0.35);
  background:rgba(119,191,255,0.12);
  color:var(--text);
  padding:12px 14px;
  border-radius:12px;
  font-weight:900;
  cursor:pointer;
  letter-spacing:0.4px;
}
.btn:hover{ filter:brightness(1.05); }
.btnFull{ width:100%; }
.btnDanger{
  border-color:rgba(255,59,48,0.45);
  background:rgba(255,59,48,0.12);
}

.small{ font-size:12px; color:var(--muted); font-weight:700; }
.hr{ height:1px; background:var(--line); margin:14px 0; }
.resultBox{
  margin-top:10px;
  padding:12px;
  border-radius:14px;
  border:1px dashed rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.02);
}

/* Alarm overlay */
.alarmOverlay{
  position:fixed;
  left:16px;
  right:16px;
  top:78px;
  z-index:9999;
  white-space:pre-line;
  background:rgba(255,59,48,0.12);
  border:1px solid rgba(255,59,48,0.35);
  border-radius:16px;
  padding:14px 14px;
  font-weight:900;
  letter-spacing:0.4px;
  box-shadow:0 18px 50px rgba(0,0,0,0.45);
}
.alarmPulse{
  animation: pulse 1.1s ease-in-out 0s 1;
}
@keyframes pulse{
  0%{ transform:scale(1); }
  45%{ transform:scale(1.02); }
  100%{ transform:scale(1); }
}

/* ---------------------------
   Unit marker label (2 lines)
   --------------------------- */
.unitMarker {
  position: relative;
  width: 220px;
  height: 54px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  pointer-events: auto;
  user-select: none;
}

.unitMarker .labelBox {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10, 20, 40, 0.92);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 8px 52px 8px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  width: 100%;
  box-sizing: border-box;
}

.unitMarker .line1 {
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.95);
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unitMarker .line2 {
  margin-top: 2px;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.85);
  line-height: 1.1;
  text-transform: uppercase;
}

.unitMarker .diamond {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translateY(-50%) rotate(45deg);
  border: 2px solid rgba(255,255,255,0.65);
  border-radius: 3px;
  background: rgba(8, 18, 38, 0.8);
}

.unitMarker .diamond::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: rgba(120, 190, 255, 0.95);
  box-shadow: 0 0 18px rgba(120, 190, 255, 0.9);
  border-radius: 2px;
}
