:root{
  --bg0:#070A12;
  --bg1:#0B1020;
  --panel:#0E1730;
  --panel2:#0C1429;
  --stroke:rgba(255,255,255,.09);
  --stroke2:rgba(255,255,255,.14);
  --text:#EAF0FF;
  --muted:rgba(234,240,255,.65);

  --accent:#5BE7C4;
  --accent2:#6AA8FF;
  --danger:#FF4D6D;

  --grid:rgba(91,231,196,.14);
  --trace1:#7CF7D5;
  --trace2:#FF5C8A;
  --fft:#90C2FF;
  --warn:#FFCC66;

  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --radius: 16px;
  --radius2: 22px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  background:
    radial-gradient(1400px 900px at 20% 0%, rgba(106,168,255,.10), transparent 60%),
    radial-gradient(1200px 700px at 80% 10%, rgba(91,231,196,.10), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  color:var(--text);
  overflow:hidden;
}

.topbar{
  height:72px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--stroke);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  backdrop-filter: blur(10px);
}

.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:38px;height:38px;border-radius:12px;
  background:
    radial-gradient(circle at 30% 30%, rgba(91,231,196,.95), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(106,168,255,.9), transparent 52%),
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  border:1px solid var(--stroke2);
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
}
.title{font-weight:700; letter-spacing:.2px}
.subtitle{font-size:12px; color:var(--muted); margin-top:2px}

.top-actions{display:flex; align-items:center; gap:10px}
.pill{
  padding:7px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--stroke);
  color:var(--muted);
  font-size:12px;
}

.layout{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap:14px;
  padding:14px;
  height:calc(100% - 72px - 44px);
}

.panel{
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border:1px solid var(--stroke);
  border-radius:var(--radius2);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.controls{
  padding:14px;
  overflow:auto;
}

.section{
  background:rgba(0,0,0,.14);
  border:1px solid var(--stroke);
  border-radius:var(--radius);
  padding:12px;
  margin-bottom:12px;
}

.section-title{
  font-weight:700;
  font-size:13px;
  letter-spacing:.2px;
  margin-bottom:10px;
  color:rgba(234,240,255,.9);
}

.row{display:flex; flex-direction:column; gap:6px; margin-bottom:10px}
.row.two{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
label{font-size:12px; color:var(--muted)}
input, select{
  width:100%;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid var(--stroke);
  background:rgba(7,10,18,.55);
  color:var(--text);
  outline:none;
}
input:focus, select:focus{border-color:rgba(91,231,196,.45); box-shadow:0 0 0 3px rgba(91,231,196,.12)}

.hint{
  font-size:11px;
  color:rgba(234,240,255,.55);
  line-height:1.35;
}

.btn{
  border:none;
  border-radius:14px;
  padding:10px 12px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--stroke);
  color:var(--text);
  cursor:pointer;
  transition: transform .06s ease, background .18s ease, border-color .18s ease;
}
.btn:hover{background:rgba(255,255,255,.09); border-color:rgba(255,255,255,.18)}
.btn:active{transform:translateY(1px)}
.btn.primary{
  background:linear-gradient(135deg, rgba(91,231,196,.32), rgba(106,168,255,.22));
  border-color:rgba(91,231,196,.28);
}
.btn.danger{
  background:rgba(255,77,109,.16);
  border-color:rgba(255,77,109,.30);
  color:#FFD6DE;
}

.checks{display:flex; gap:12px; flex-wrap:wrap}
.chk{display:flex; align-items:center; gap:8px; user-select:none}
.chk input{width:auto}

.segmented{
  display:flex;
  background:rgba(255,255,255,.05);
  border:1px solid var(--stroke);
  border-radius:14px;
  overflow:hidden;
}
.seg{
  flex:1;
  padding:9px 10px;
  background:transparent;
  border:none;
  color:var(--muted);
  cursor:pointer;
}
.seg.on{
  color:var(--text);
  background:linear-gradient(135deg, rgba(91,231,196,.20), rgba(106,168,255,.16));
}

.display{
  display:flex;
  flex-direction:column;
}

.tabs{
  display:flex;
  gap:6px;
  padding:10px;
  border-bottom:1px solid var(--stroke);
  background:rgba(0,0,0,.10);
}
.tab{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid transparent;
  background:transparent;
  color:rgba(234,240,255,.72);
  cursor:pointer;
}
.tab.on{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.12);
  color:var(--text);
}

.tabpane{
  display:none;
  height:100%;
  overflow:hidden;
}
.tabpane.on{display:flex; flex-direction:column}

.toolbar{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-bottom:1px solid var(--stroke);
  background:rgba(0,0,0,.10);
}
.badge{
  font-size:12px;
  color:rgba(234,240,255,.85);
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.05);
}
.spacer{flex:1}
.inline{display:flex; gap:10px; align-items:center}

.canvas-wrap{
  position:relative;
  flex:1;
  background:linear-gradient(180deg, rgba(0,0,0,.30), rgba(0,0,0,.18));
}
canvas{
  width:100%;
  height:100%;
  display:block;
}
.hud{
  position:absolute;
  left:12px;
  top:12px;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.10);
  font-family:var(--mono);
  font-size:12px;
  color:rgba(234,240,255,.90);
  white-space:pre;
  pointer-events:none;
  max-width: 60%;
}

.measbar{
  padding:10px 12px;
  border-top:1px solid var(--stroke);
  background:rgba(0,0,0,.10);
  font-family:var(--mono);
  font-size:12px;
  color:rgba(234,240,255,.80);
}

.gen-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  padding:12px;
  overflow:auto;
}
.gen-card{
  background:rgba(0,0,0,.14);
  border:1px solid var(--stroke);
  border-radius:var(--radius);
  padding:12px;
}
.gen-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
  font-weight:700;
}

.switch{
  position:relative; display:inline-block;
  width:46px; height:26px;
}
.switch input{display:none}
.slider{
  position:absolute; inset:0;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  border:1px solid var(--stroke);
  transition:.18s;
}
.slider:before{
  content:"";
  position:absolute;
  width:20px;height:20px;
  left:3px; top:2px;
  border-radius:999px;
  background:linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.55));
  transition:.18s;
}
.switch input:checked + .slider{
  background:linear-gradient(135deg, rgba(91,231,196,.35), rgba(106,168,255,.25));
  border-color:rgba(91,231,196,.28);
}
.switch input:checked + .slider:before{transform:translateX(20px)}

.rec-grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:12px;
  padding:12px;
  overflow:auto;
}
.rec-card, .settings-card{
  background:rgba(0,0,0,.14);
  border:1px solid var(--stroke);
  border-radius:var(--radius);
  padding:12px;
}
.meter{display:flex; flex-direction:column; gap:10px}
.meter-row{display:grid; grid-template-columns:50px 1fr 70px; gap:10px; align-items:center}
.meter-label{font-family:var(--mono); color:rgba(234,240,255,.75)}
.meter-bar{
  height:12px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid var(--stroke);
  overflow:hidden;
}
.meter-fill{height:100%; width:0%; background:linear-gradient(90deg, rgba(91,231,196,.75), rgba(255,92,138,.75))}
.meter-val{font-family:var(--mono); color:rgba(234,240,255,.8); text-align:right}

.settings-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  padding:12px;
  overflow:auto;
}
.about p{color:rgba(234,240,255,.72); line-height:1.5}
.about li{color:rgba(234,240,255,.7); margin:6px 0}

.footer{
  height:44px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 14px;
  border-top:1px solid var(--stroke);
  color:rgba(234,240,255,.60);
  font-size:12px;
  background:rgba(0,0,0,.10);
}
