:root {
  /* Scanedidit-adjacent dark glass + Mahogany warm accents */
  --bg0: #05070d;
  --bg1: #0c0f19;
  --surface: #0f1320;
  --glass: rgba(15, 19, 32, 0.88);
  --border: #1e2a44;
  --border-hot: rgba(42, 69, 255, 0.35);
  --text: #d8e1ff;
  --muted: #9aa4c3;
  --dim: #5a6380;
  --scan-blue: #2a45ff;
  --scan-red: #e63946;
  --mahogany: #8b4518;
  --mahogany-hot: #c4783a;
  --ember: #ff8c00;
  --ok: #22c55e;
  --radius: 14px;
  --font: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(196, 120, 58, 0.08), transparent 32%),
    radial-gradient(circle at 78% 8%, rgba(42, 69, 255, 0.07), transparent 30%),
    linear-gradient(145deg, var(--bg0) 0%, var(--bg1) 55%, #090b13 100%);
  background-attachment: fixed;
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.brand { display: flex; gap: 0.75rem; align-items: center; }
.logo { font-size: 1.6rem; }
h1 { margin: 0; font-size: 1.15rem; letter-spacing: 0.03em; }
.tag { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.78rem; }
.top-actions { display: flex; gap: 0.5rem; align-items: center; }

.pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.pill.live { border-color: rgba(196, 120, 58, 0.5); color: var(--mahogany-hot); }

.btn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: var(--border-hot); }
.btn.primary {
  background: linear-gradient(135deg, var(--mahogany), var(--scan-blue));
  border: 0;
}
.btn.ghost { background: transparent; }

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 0.65rem;
  padding: 0.65rem;
  min-height: 0;
}
@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
}

.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}
.glass-inner {
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem;
  margin-top: 0.65rem;
}

.rail { padding: 0.75rem; overflow: auto; }
.rail h2 { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--mahogany-hot); text-transform: uppercase; letter-spacing: 0.08em; }
.rail h3 { margin: 0.75rem 0 0.4rem; font-size: 0.8rem; color: var(--muted); }

.tree { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.tree ul { list-style: none; margin: 0.25rem 0 0.5rem 0.75rem; padding: 0; }
.tree li { color: var(--muted); padding: 0.2rem 0; }
.tree li.active { color: var(--text); font-weight: 600; }
.folder { color: var(--text); font-weight: 600; }

.bands { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.band {
  font-family: var(--mono);
  font-size: 0.65rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--dim);
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
  cursor: pointer;
}
.band.on { color: var(--text); border-color: var(--mahogany-hot); background: rgba(139, 69, 24, 0.25); }

.center { display: flex; flex-direction: column; gap: 0.65rem; min-width: 0; }

.transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  gap: 1rem;
}
.transport-left, .transport-right { display: flex; align-items: center; gap: 0.45rem; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}
.icon-btn.play { background: linear-gradient(135deg, var(--ok), #15803d); border: 0; }
.icon-btn.on { outline: 1px solid var(--mahogany-hot); }
.clock { text-align: center; }
.time { font-family: var(--mono); font-size: 1.25rem; display: block; }
.tempo { color: var(--muted); font-size: 0.8rem; }
.tempo input {
  width: 3.2rem;
  background: #0a0e18;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.15rem 0.3rem;
  font-family: var(--mono);
}
.meter {
  width: 10px; height: 36px;
  background: #0a0e18;
  border-radius: 4px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.meter i {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, var(--ok), var(--ember));
  transition: height 0.12s linear;
}
.meter-label { font-size: 0.7rem; color: var(--dim); }

.timeline { padding: 0.65rem; flex: 1; min-height: 220px; }
.timeline-head {
  display: flex; justify-content: space-between;
  font-size: 0.82rem; margin-bottom: 0.5rem; color: var(--muted);
}
.tracks { display: flex; flex-direction: column; gap: 0.4rem; }
.track {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.5rem;
  align-items: center;
}
.track-label {
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
}
.track-lane {
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background:
    repeating-linear-gradient(90deg, transparent, transparent 47px, rgba(255,255,255,0.03) 48px),
    #0a0e18;
  position: relative;
  overflow: hidden;
}
.clip {
  position: absolute;
  top: 6px; bottom: 6px;
  border-radius: 6px;
  opacity: 0.9;
  border: 1px solid rgba(255,255,255,0.12);
}
.clip.c-mahogany { background: linear-gradient(90deg, rgba(139,69,24,0.85), rgba(196,120,58,0.55)); left: 8%; width: 28%; }
.clip.c-blue { background: linear-gradient(90deg, rgba(42,69,255,0.75), rgba(61,87,255,0.4)); left: 22%; width: 35%; }
.clip.c-ember { background: linear-gradient(90deg, rgba(230,57,70,0.7), rgba(255,140,0,0.45)); left: 40%; width: 22%; }
.clip.c-air { background: linear-gradient(90deg, rgba(34,197,94,0.55), rgba(42,69,255,0.35)); left: 12%; width: 40%; }

.freq { padding: 0.75rem; }
.freq-head h2 { margin: 0; font-size: 0.95rem; }
.freq-head p { margin: 0.2rem 0 0.55rem; }
#spectrum {
  width: 100%;
  height: 160px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #070a12;
  display: block;
}
.freq-legend {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 0.65rem; color: var(--dim); margin-top: 0.3rem;
}

.inspector label {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.75rem; color: var(--muted); margin-bottom: 0.55rem;
}
.inspector input[type="text"], .inspector select {
  background: #0a0e18;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  font-family: inherit;
}
.inspector input[type="range"] { width: 100%; }

.fader-row { display: flex; gap: 0.55rem; justify-content: center; padding: 0.4rem 0; }
.fader {
  width: 22px; height: 100px;
  background: #0a0e18;
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
}
.fader.master { border-color: rgba(196,120,58,0.5); }
.fader .cap {
  position: absolute; left: 2px; right: 2px; height: 10px;
  background: linear-gradient(180deg, #eee, #888);
  border-radius: 3px;
}

.notes p { margin: 0; font-size: 0.8rem; line-height: 1.4; color: var(--muted); }
.muted { color: var(--muted); }
.tiny { font-size: 0.7rem; }

.status {
  display: flex; justify-content: space-between;
  padding: 0.45rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}

.plan-dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  max-width: 520px;
}
.plan-dialog::backdrop { background: rgba(0,0,0,0.55); }
.plan-card { padding: 1.1rem 1.2rem 1.2rem; }
.plan-card h2 { margin: 0 0 0.75rem; font-size: 1.05rem; }
.plan-card ol { margin: 0 0 0.85rem; padding-left: 1.2rem; color: var(--muted); line-height: 1.45; font-size: 0.9rem; }
.plan-card li { margin-bottom: 0.35rem; }
