:root{
  --bg:#0b0f14;
  --panel:#0f1620;
  --panel2:#0c121a;
  --text:#e7eef7;
  --muted:#9db0c6;
  --line:#1e2a3a;
  --accent:#7aa2ff;
  --danger:#ff6b6b;
  --ok:#5cffb1;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 18px;
}
*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(900px 500px at 15% 10%, rgba(122,162,255,.12), transparent 60%),
              radial-gradient(900px 500px at 85% 20%, rgba(92,255,177,.08), transparent 60%),
              var(--bg);
  color:var(--text);
}
header{
  padding:18px 18px 0;
  max-width: 1320px;
  margin: 0 auto;
}
.title{
  display:flex;
  gap:12px;
  align-items:baseline;
  flex-wrap:wrap;
}
.title h1{
  font-size:18px;
  margin:0;
  letter-spacing:.3px;
}
.title .sub{
  color:var(--muted);
  font-size:13px;
}
.app{
  max-width: 1320px;
  margin: 14px auto 24px;
  padding: 0 18px 18px;
  display:grid;
  grid-template-columns: 420px 1fr;
  gap:16px;
}
@media (max-width: 980px){
  .app{ grid-template-columns: 1fr; }
}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 35%), var(--panel);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card .hd{
  padding:14px 14px 10px;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  background: rgba(0,0,0,.12);
}
.card .hd .label{
  font-size:13px;
  color:var(--muted);
}
.card .bd{ padding:14px; }

.row{ display:flex; gap:10px; flex-wrap:wrap; }
.col{ flex:1; min-width:160px; }

label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin:0 0 6px;
}
input[type="text"], select{
  width:100%;
  padding:10px 11px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: var(--panel2);
  color:var(--text);
  outline:none;
}
input[type="text"]:focus, select:focus{
  border-color: rgba(122,162,255,.55);
  box-shadow: 0 0 0 3px rgba(122,162,255,.12);
}
.kwrap{
  display:grid;
  grid-template-columns: 1fr 92px;
  gap:10px;
  align-items:center;
}
input[type="range"]{ width:100%; }
.kbox{
  width: 92px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.kbox:focus{
  border-color: rgba(122,162,255,.55);
  box-shadow: 0 0 0 3px rgba(122,162,255,.12);
  outline: none;
}
.btnbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}
button{
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  color:var(--text);
  padding:10px 12px;
  border-radius: 12px;
  cursor:pointer;
}
button:hover{ border-color: rgba(122,162,255,.55); }
.danger{ border-color: rgba(255,107,107,.35); }
.danger:hover{ border-color: rgba(255,107,107,.7); }

.status{
  margin-top:10px;
  font-size:12px;
  color: var(--muted);
  line-height:1.35;
  border-left: 3px solid rgba(122,162,255,.55);
  padding-left:10px;
}
.status.err{
  border-left-color: rgba(255,107,107,.8);
  color: rgba(255,107,107,.92);
}
.latexBox{
  padding:10px 12px;
  border:1px dashed rgba(122,162,255,.35);
  background: rgba(122,162,255,.06);
  border-radius: 14px;
  overflow:auto;
}
.block{
  width:100%;
  border:1px solid var(--line);
  border-radius: 14px;
  background: var(--panel2);
  padding:10px;
  overflow:hidden;
}
.charts{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}
@media (max-width: 980px){
  .charts{ grid-template-columns: 1fr; }
}
.plot{
  width:100%;
  height: 320px;
}
@media (max-width: 980px){
  .plot{ height: 340px; }
}
.tiny{
  font-size:11px;
  color:var(--muted);
}
.mt10{ margin-top:10px; }
.spacer{ height:12px; }
