:root{
  --bg:#070b12;
  --bg2:#0b1320;
  --panel:#121f31;
  --panel2:#172842;
  --text:#f5f8fc;
  --muted:#a9b7c6;
  --line:rgba(255,255,255,.13);
  --accent:#ff5a7a;
  --accent2:#38dbc5;
  --ok:#84f0a6;
  --warn:#ffd166;
  --bad:#ff7979;
  --shadow:0 20px 48px rgba(0,0,0,.34);
  --r:18px;
}

*{ box-sizing:border-box; }
[hidden]{ display:none !important; }
html{ min-height:100%; background:var(--bg); }
body{
  margin:0;
  min-height:100%;
  color:var(--text);
  font:16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(900px 600px at 18% -10%, rgba(56,219,197,.16), transparent 60%),
    radial-gradient(900px 620px at 96% 0%, rgba(255,90,122,.18), transparent 62%),
    linear-gradient(180deg, var(--bg2), var(--bg));
}

button,input,select{ font:inherit; }
button{ cursor:pointer; }
button:disabled{ opacity:.58; cursor:not-allowed; }

.shell{
  width:min(1120px,100%);
  min-height:100vh;
  margin:0 auto;
  padding:18px 16px 92px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:8px 0 18px;
}

.brand{ display:flex; align-items:center; gap:12px; min-width:0; }
.brand-name{ font-size:21px; font-weight:950; letter-spacing:0; }
.brand-sub{ color:var(--muted); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:58vw; }

.state-pill{
  min-height:34px;
  display:inline-flex;
  align-items:center;
  border:1px solid var(--line);
  border-radius:999px;
  padding:7px 11px;
  color:var(--muted);
  background:rgba(255,255,255,.06);
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  white-space:nowrap;
}

.state-pill.ok{ color:var(--ok); }
.state-pill.warn{ color:var(--warn); }
.state-pill.bad{ color:var(--bad); }

.layout{
  display:grid;
  grid-template-columns:minmax(320px, 430px) minmax(0, 1fr);
  gap:16px;
  align-items:start;
}

.panel{
  border:1px solid var(--line);
  border-radius:var(--r);
  background:linear-gradient(180deg, rgba(23,40,66,.95), rgba(18,31,49,.92));
  box-shadow:var(--shadow);
  overflow:hidden;
}

.panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:18px;
  border-bottom:1px solid var(--line);
}

.eyebrow{
  margin:0 0 7px;
  color:var(--accent2);
  font-size:12px;
  line-height:1;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.14em;
}

h1,h2{ margin:0; font-size:24px; line-height:1.12; letter-spacing:0; }

.icon-button{
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid var(--line);
  color:var(--text);
  background:rgba(255,255,255,.07);
  font-size:22px;
  font-weight:950;
}

.form{ display:grid; gap:14px; padding:18px; }
label span,legend{
  display:block;
  margin-bottom:7px;
  color:var(--muted);
  font-size:12px;
  line-height:1;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.09em;
}

input,select{
  width:100%;
  min-height:48px;
  border-radius:14px;
  border:1px solid var(--line);
  color:var(--text);
  background:rgba(7,11,18,.66);
  padding:0 13px;
  outline:none;
}

select option{ color:#0b1320; }
input:focus,select:focus,button:focus-visible{ outline:3px solid rgba(56,219,197,.28); outline-offset:2px; }

.row{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
fieldset{ margin:0; padding:0; border:0; }

.chips{ display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.chips label,.toggles label{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:44px;
  padding:9px 11px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.055);
  color:var(--text);
  font-weight:800;
}

.chips input,.toggles input{
  width:18px;
  height:18px;
  min-height:auto;
  accent-color:var(--accent);
}

.toggles{ display:grid; gap:9px; }
.button-row{ display:flex; gap:10px; flex-wrap:wrap; }

.primary,.secondary{
  min-height:48px;
  border-radius:16px;
  border:1px solid transparent;
  padding:0 16px;
  color:#07111f;
  background:linear-gradient(135deg, var(--accent), #ffb05f);
  font-weight:950;
}

.secondary{
  color:var(--text);
  background:rgba(255,255,255,.08);
  border-color:var(--line);
}

.status-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  padding:18px;
}

.status-grid div{
  border:1px solid var(--line);
  border-radius:15px;
  padding:12px;
  background:rgba(255,255,255,.055);
}

.status-grid span{
  display:block;
  margin-bottom:8px;
  color:var(--muted);
  font-size:11px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.09em;
}

.map-surface{
  position:relative;
  height:250px;
  margin:0 18px 18px;
  border:1px solid var(--line);
  border-radius:22px;
  overflow:hidden;
  background:
    linear-gradient(90deg, transparent 49%, rgba(255,255,255,.08) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(255,255,255,.08) 50%, transparent 51%),
    radial-gradient(circle at center, rgba(56,219,197,.18), rgba(255,255,255,.035) 42%, rgba(255,90,122,.08));
}

.pulse{
  position:absolute;
  left:50%;
  top:50%;
  width:22px;
  height:22px;
  border-radius:50%;
  transform:translate(-50%, -50%);
  background:var(--accent2);
  box-shadow:0 0 30px rgba(56,219,197,.82);
}

.ring{
  position:absolute;
  left:50%;
  top:50%;
  border:1px solid rgba(56,219,197,.28);
  border-radius:50%;
  transform:translate(-50%, -50%);
}

.r1{ width:86px; height:86px; }
.r2{ width:158px; height:158px; }
.r3{ width:232px; height:232px; }

.scan-row{ padding:0 18px 18px; }

.alert{
  margin:0 18px 12px;
  display:flex;
  gap:12px;
  align-items:center;
  border-radius:17px;
  border:1px solid rgba(255,90,122,.42);
  background:rgba(255,90,122,.12);
  padding:13px;
}

.alert-dot{
  width:16px;
  height:16px;
  border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 22px rgba(255,90,122,.85);
}

.alert span{ display:block; color:var(--muted); font-size:13px; }
.message{ min-height:24px; margin:0 18px 12px; color:var(--muted); font-size:14px; }
.results{ display:grid; gap:10px; padding:0 18px 18px; }

.person{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  border:1px solid var(--line);
  border-radius:17px;
  padding:13px;
  background:rgba(255,255,255,.055);
}

.person h3{ margin:0; font-size:16px; line-height:1.25; }
.person p{ margin:7px 0 0; color:var(--muted); font-size:14px; }
.badge{
  align-self:start;
  border-radius:999px;
  padding:7px 10px;
  background:rgba(56,219,197,.13);
  color:var(--accent2);
  font-size:12px;
  font-weight:950;
  white-space:nowrap;
}

.nav{
  position:fixed;
  left:50%;
  bottom:14px;
  transform:translateX(-50%);
  width:min(520px, calc(100% - 28px));
  display:flex;
  justify-content:space-between;
  gap:8px;
  border:1px solid var(--line);
  border-radius:22px;
  padding:8px;
  background:rgba(7,11,18,.88);
  box-shadow:0 18px 45px rgba(0,0,0,.36);
  backdrop-filter:blur(18px);
}

.nav a,.nav button{
  flex:1 1 0;
  min-height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:16px;
  color:var(--text);
  background:rgba(255,255,255,.07);
  text-decoration:none;
  font-weight:950;
}

.nav button{ background:rgba(56,219,197,.16); }

.text-page{
  display:grid;
  gap:16px;
}

.text-panel{
  max-width:860px;
  margin:0 auto;
}

.text-body{
  padding:18px;
}

.text-body h2{
  margin:22px 0 8px;
  font-size:18px;
}

.text-body h2:first-child{
  margin-top:0;
}

.text-body p,.text-body li{
  color:var(--muted);
}

.text-body ul{
  margin:8px 0 0;
  padding-left:22px;
}

.text-body a{
  color:var(--accent2);
}

@media (max-width:860px){
  .layout{ grid-template-columns:1fr; }
}

@media (max-width:560px){
  .shell{ padding:12px 10px 88px; }
  .brand-sub{ max-width:52vw; }
  .panel-head,.form,.status-grid{ padding:14px; }
  h1,h2{ font-size:21px; }
  .row,.chips,.status-grid{ grid-template-columns:1fr; }
  .map-surface{ height:220px; margin:0 14px 14px; }
  .scan-row,.results{ padding:0 14px 14px; }
  .alert{ margin:0 14px 12px; }
  .message{ margin:0 14px 12px; }
}
