:root{
  --bg:#0b0f15;
  --panel:#101722;
  --panel2:#0f1620;
  --line:rgba(151,166,178,.18);
  --muted:rgba(151,166,178,.85);
  --text:#e6edf3;

  --e: rgba(77,227,255,0.95);   /* CH1 */
  --p: rgba(255,210,77,0.92);   /* CH2 */
  --b: rgba(178,123,255,0.88);  /* CH3 */

  --shadow: 0 18px 55px rgba(0,0,0,.35);
  --shadow2: 0 10px 30px rgba(0,0,0,.25);
  --glass: rgba(12,18,26,.72);
  --glass2: rgba(16,23,34,.72);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:
    radial-gradient(1000px 780px at 15% 0%, rgba(77,227,255,.12), transparent 55%),
    radial-gradient(1000px 780px at 85% 0%, rgba(178,123,255,.12), transparent 55%),
    radial-gradient(1200px 900px at 50% 100%, rgba(255,210,77,.06), transparent 60%),
    var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/* ---------- Topbar ---------- */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 16px;
  border-bottom:1px solid var(--line);
  background: rgba(8,12,18,.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position:sticky; top:0; z-index:10;
}
.brand{ display:flex; gap:12px; align-items:center; }
.dot{
  width:12px; height:12px; border-radius:999px;
  background: var(--e);
  box-shadow: 0 0 22px rgba(77,227,255,.42), 0 0 46px rgba(77,227,255,.20);
}

.topbar h1.title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .2px;
  line-height: 1.15;
}

.subtitle{ color:var(--muted); font-size:12px; margin-top:2px; }
.rightHeader{ display:flex; gap:10px; align-items:center; }

.pill{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(77,227,255,.25);
  background: rgba(0,0,0,.20);
  color: var(--muted);
  font-size:12px;
  font-weight:900;
  letter-spacing:.4px;
  box-shadow: 0 0 0 1px rgba(77,227,255,.05) inset;
}

.btn{
  border:1px solid rgba(151,166,178,.22);
  background: rgba(20,28,40,.55);
  color: var(--text);
  padding:8px 10px;
  border-radius:12px;
  font-weight:900;
  cursor:pointer;
  box-shadow: 0 0 0 1px rgba(255,255,255,.03) inset;
}
.btn.ghost{ background: rgba(0,0,0,.16); }
.btn:hover{ filter: brightness(1.10); }
.btn:active{ transform: translateY(1px); }

/* ---------- Layout ---------- */
.layoutDash{
  display:grid;
  grid-template-columns: 410px 1fr;
  gap:16px;
  padding:16px;
  max-width: 1750px;
  margin: 0 auto;
}
.rightCol{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-width: 0;
}

/* ---------- Panels ---------- */
.panel{
  background: linear-gradient(180deg, var(--glass2), var(--glass));
  border:1px solid rgba(151,166,178,.16);
  border-radius:18px;
  padding:14px;
  box-shadow: var(--shadow2);
}
.controlPanel{
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 92px);
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

/* nicer scrollbars */
.controlPanel::-webkit-scrollbar{ width: 10px; }
.controlPanel::-webkit-scrollbar-track{ background: rgba(0,0,0,.12); border-radius: 999px; }
.controlPanel::-webkit-scrollbar-thumb{
  background: rgba(151,166,178,.22);
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,.18);
}
.controlPanel::-webkit-scrollbar-thumb:hover{ background: rgba(151,166,178,.30); }

.panelSection{ padding:10px 8px; border-bottom:1px solid rgba(151,166,178,.10); }
.panelSection:last-child{ border-bottom:none; }

h3{ margin:0 0 10px; font-size:14px; letter-spacing:.35px; }
.hint{ color: var(--muted); line-height:1.35; margin:8px 0 0; font-size:12px; }
.hint.small{ font-size:11px; }
.steps{ margin:8px 0 0 18px; color: var(--muted); font-size:12px; line-height:1.35; }

.row{ display:flex; flex-direction:column; gap:6px; margin:10px 0; }
label{ color: var(--muted); font-weight:900; font-size:12px; }
label sub{ font-size: 10px; opacity: .9; }
.ctl{ display:flex; gap:8px; align-items:center; }

input[type="number"]{
  width: 110px;
  border-radius:12px;
  border:1px solid rgba(151,166,178,.22);
  background: rgba(0,0,0,.18);
  color: var(--text);
  padding:8px 10px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.03) inset;
}
.unit{ color: var(--muted); font-size:12px; font-weight:950; width:28px; text-align:left; }

/* pretty sliders */
input[type="range"]{
  flex:1;
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(151,166,178,.18);
  border-radius: 999px;
  outline: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,.03) inset;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(230,237,243,.92);
  border: 1px solid rgba(151,166,178,.35);
  box-shadow:
    0 0 0 3px rgba(77,227,255,.10),
    0 10px 22px rgba(0,0,0,.35);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb{
  width: 18px; height: 18px; border-radius: 999px;
  background: rgba(230,237,243,.92);
  border: 1px solid rgba(151,166,178,.35);
  box-shadow: 0 10px 22px rgba(0,0,0,.35);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track{
  height: 12px;
  border-radius: 999px;
}

/* info grid */
.kv{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:8px 10px;
  margin-top:10px;
}
.k{ color: var(--muted); font-size:12px; font-weight:900; }
.v{ font-size:12px; font-weight:950; color: var(--text); }

.checkRow{ display:flex; flex-direction:column; gap:6px; }
.chk{ color: var(--muted); font-size:12px; display:flex; gap:8px; align-items:center; }
.chk input{ accent-color: rgba(77,227,255,.85); }

/* ---------- Dashboard cards ---------- */
.dashGrid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}
.dashCard{
  grid-column: span 6;
  background: linear-gradient(180deg, var(--glass2), var(--glass));
  border:1px solid rgba(151,166,178,.16);
  border-radius:18px;
  padding:12px 12px 10px;
  min-width: 0;
  box-shadow: var(--shadow2);
}
.dashCard.kpi{
  grid-column: span 7;
  border-color: rgba(77,227,255,.22);
  box-shadow:
    0 0 0 1px rgba(77,227,255,.06) inset,
    0 0 44px rgba(77,227,255,.06),
    var(--shadow);
}
.metricsCard{ grid-column: span 5; }

.dashTitle{
  font-weight:950;
  letter-spacing:.25px;
  font-size:13px;
  margin-bottom:8px;
  color: rgba(230,237,243,.95);
}

/* tabs */
.dashTitleRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.tabs{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.tabBtn{
  border:1px solid rgba(151,166,178,.18);
  background: rgba(0,0,0,.16);
  color: var(--muted);
  padding:6px 10px;
  border-radius:999px;
  font-weight:950;
  font-size:12px;
  cursor:pointer;
  box-shadow: 0 0 0 1px rgba(255,255,255,.02) inset;
}
.tabBtn:hover{ filter: brightness(1.10); }
.tabBtn.active{
  color: var(--text);
  border-color: rgba(77,227,255,.30);
  box-shadow: 0 0 0 1px rgba(77,227,255,.08) inset;
}
.tabPanel{ display:none; }
.tabPanel.active{ display:block; }

.kpiValue{
  font-size:30px;
  font-weight:1000;
  letter-spacing:.3px;
  margin: 2px 0 6px;
}
.kpiSub{
  color: var(--muted);
  font-size:12px;
  line-height:1.25;
  margin-bottom:10px;
}

.violetSub{
  margin-top:4px;
  font-size:11px;
  color: rgba(178,123,255,.85);
  font-weight:900;
  letter-spacing:.2px;
}

.bar{
  height: 10px;
  border-radius:999px;
  border:1px solid rgba(30,42,58,.85);
  background: rgba(0,0,0,.18);
  overflow:hidden;
  margin: 8px 0 10px;
}
.barFill{
  height:100%;
  width:0%;
  background: rgba(151,166,178,.25);
  box-shadow: 0 0 20px rgba(77,227,255,.30);
}

.callout{
  margin-top:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(151,166,178,.14);
  background: rgba(0,0,0,.14);
  color: var(--muted);
  font-size:12px;
  line-height:1.35;
  box-shadow: 0 0 0 1px rgba(255,255,255,.02) inset;
}

.dashBelow{ margin-top: 2px; }

/* ---------- Scope ---------- */
.stage{
  position:relative;
  background: linear-gradient(180deg, rgba(14,20,28,.62), rgba(10,14,20,.62));
  border:1px solid rgba(151,166,178,.16);
  border-radius:18px;
  overflow:hidden;
  box-shadow: var(--shadow);
}

/* plot on top ~half screen height */
.stageTop{
  height: min(52vh, 620px);
}
#scope{
  width:100%;
  height: 100%;
  display:block;
}

.scopeHud{
  position:absolute;
  inset: 14px 14px auto 14px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  pointer-events:none;
}
.hudLeft{ display:flex; gap:8px; flex-wrap:wrap; }
.hudRight{ color: var(--muted); font-size:12px; display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }

.chip{
  display:flex; align-items:center; gap:8px;
  border:1px solid rgba(151,166,178,.18);
  background: rgba(0,0,0,.18);
  padding:6px 10px;
  border-radius:999px;
  color: var(--muted);
  font-weight:900;
  box-shadow: 0 0 0 1px rgba(255,255,255,.02) inset;
}
.swatch{ width:12px; height:12px; border-radius:4px; display:inline-block; }
.swatch.v{ background: var(--e); box-shadow: 0 0 18px rgba(77,227,255,.20); }
.swatch.i{ background: var(--p); box-shadow: 0 0 18px rgba(255,210,77,.16); }
.swatch.vl{ background: var(--b); box-shadow: 0 0 18px rgba(178,123,255,.18); }

.labFooter{
  margin-top: 40px;
  padding: 40px 20px;
  border-top: 1px solid rgba(151,166,178,.18);
  background: linear-gradient(
    180deg,
    rgba(10,14,20,.5),
    rgba(10,14,20,.85)
  );
}

.labFooterInner{
  max-width: 1000px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.labFooter h3{
  margin-bottom: 16px;
  color: var(--text);
  font-size: 18px;
}

.labFooter h4{
  margin-top: 22px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 15px;
}

.labFooter ul{
  padding-left: 18px;
  margin: 6px 0;
}

.labNote{
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(178,123,255,.08);
  border: 1px solid rgba(178,123,255,.18);
}


/* ---------- Responsive ---------- */
@media (max-width: 1250px){
  .dashCard{ grid-column: span 12; }
  .dashCard.kpi{ grid-column: span 12; }
  .metricsCard{ grid-column: span 12; }
}
@media (max-width: 1100px){
  .layoutDash{ grid-template-columns: 1fr; }
  .controlPanel{
    position: relative;
    top: 0;
    max-height: none;
    overflow: visible;
  }
  .stageTop{
    height: min(48vh, 560px);
  }
}
@media (max-width: 700px){
  .stageTop{
    height: min(44vh, 460px);
  }
}
