:root{
  --bg0:#0b0c10;
  --bg1:#11131b;
  --card:#141827;
  --card2:#0f1220;
  --text:#e9ecff;
  --muted:#aab2d6;
  --border:rgba(255,255,255,.10);
  --accent:#7cffc5;
  --accent2:#7aa6ff;
  --warn:#ffd17a;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1100px 700px at 18% 12%, rgba(122,166,255,.25), transparent 60%),
              radial-gradient(900px 600px at 85% 22%, rgba(124,255,197,.18), transparent 55%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  color:var(--text);
}

.layout{ max-width: 1280px; margin: 0 auto; padding: 20px; }
.header{
  display:flex;
  gap:16px;
  align-items:stretch;
  justify-content:space-between;
  flex-wrap:wrap;
  margin-bottom:16px;
}
.kicker{
  display:inline-block;
  color: var(--muted);
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:12px;
  margin-bottom:8px;
}
h1{ margin:0; font-size: 26px; line-height:1.1; }

.readout{
  min-width: min(640px, 100%);
  flex: 1;
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(20,24,39,.9), rgba(15,18,32,.9));
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 14px 14px 10px;
}
.readoutRow{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.readoutRow:last-of-type{ border-bottom:none; }
.readoutRow.subtle .label{ color: var(--muted); font-size: 12px; }
.readoutRow.subtle .value{ color: rgba(233,236,255,.92); font-size: 12px; }
.label{ color: var(--muted); font-weight:700; }
.value{ font-weight:800; font-size: 16px; }
.mono{ font-family: var(--mono); }

.readoutActions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  padding-top:10px;
}
.btn{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight:800;
  cursor:pointer;
}
.btn:hover{ border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.09); }
.btn.ghost{
  background: transparent;
  border-color: rgba(255,255,255,.10);
  color: var(--muted);
}

.main{
  display:grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 16px;
  align-items:start;
}
@media (max-width: 980px){
  .main{ grid-template-columns: 1fr; }
}

.viewerCard{
  border:1px solid var(--border);
  background: rgba(15,18,32,.72);
  border-radius: 14px;
  overflow:hidden;
}
.viewerTopbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background: rgba(20,24,39,.55);
}
.legend{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap:wrap;
}
.legendText{ color: var(--muted); font-size: 12px; font-weight:700; }
.spacer{ width: 12px; }
.hint{ color: rgba(233,236,255,.70); font-size: 12px; }
.dot{ width: 10px; height:10px; border-radius: 50%; display:inline-block; }
.dot.drone{ background: var(--accent2); box-shadow: 0 0 0 3px rgba(122,166,255,.12); }
.dot.fc{ background: var(--accent); box-shadow: 0 0 0 3px rgba(124,255,197,.12); }

canvas#c{
  display:block;
  width: 100%;
  height: min(72vh, 720px);
  background: radial-gradient(900px 600px at 50% 30%, rgba(122,166,255,.07), transparent 60%),
              radial-gradient(600px 500px at 60% 70%, rgba(124,255,197,.06), transparent 55%),
              #0a0b10;
}

.controls{
  display:flex;
  flex-direction:column;
  gap: 12px;
}
.panel{
  border:1px solid var(--border);
  background: rgba(20,24,39,.55);
  border-radius: 14px;
  padding: 12px;
}
.panel h2{ margin: 0 0 6px; font-size: 16px; }
.panel h3{ margin: 0 0 8px; font-size: 14px; color: rgba(233,236,255,.92); }
.small{ margin:0; color: var(--muted); font-size: 12.5px; line-height:1.45; }
ul.small{ margin: 0; padding-left: 18px; }
ul.small li{ margin: 6px 0; }

.axisHeader{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.axisTitle{ font-weight:900; }
.axisMeta{ color: var(--muted); font-size: 12px; }

.axisRow{
  display:grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 10px;
  align-items:center;
}

.sliderStack{
  display:grid;
  grid-template-rows: auto auto;
  justify-items: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.zeroChip{
  padding: 6px 12px;
  border-color: rgba(124,255,197,.22);
  background: rgba(124,255,197,.08);
  color: rgba(233,236,255,.95);
}

.zeroChip:hover{
  border-color: rgba(124,255,197,.35);
  background: rgba(124,255,197,.12);
}
.chip{
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 10px;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
}
.chip:hover{ border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.10); }
.slider{
  width: 100%;
  margin: 0;
}

