:root {
  --bg: #0f1219;
  --surface: #13161f;
  --panel: #1b1f2a;
  --line: rgba(80, 90, 120, 0.45);
  --text: #e8edf8;
  --muted: #8b93a8;
  --purple: #9147fa;
  --cyan: #0dd4e8;
  --green: #38d191;
  --yandex: #fc0;
  --clip: #1fd6b2;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: #252a38; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
button.on, button:hover { border-color: var(--cyan); }
input[type="text"], input[type="number"] {
  background: #10131b; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}

.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 400px at 20% 0%, rgba(145, 71, 250, 0.18), transparent),
    radial-gradient(700px 400px at 80% 100%, rgba(13, 212, 232, 0.12), transparent),
    var(--bg);
}
.gate-card {
  width: min(420px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 32px;
}
.mark { letter-spacing: 0.18em; text-transform: uppercase; color: var(--cyan); font-size: 12px; margin: 0; }
h1 { margin: 8px 0 12px; font-size: 36px; }
.lead, .muted { color: var(--muted); line-height: 1.45; }
.yandex {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 8px; width: 100%; height: 48px;
  background: var(--yandex); color: #111; font-weight: 700;
  border-radius: 12px; text-decoration: none;
}
.err { color: #fb7185; }
code { font-size: 12px; word-break: break-all; }

.daw { height: 100%; display: grid; grid-template-rows: 56px 52px 1fr 92px; }
.top, .prompt {
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 10px; align-items: baseline; min-width: 180px; }
.transport { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: center; }
.transport button { width: 40px; height: 36px; }
.clock { font-variant-numeric: tabular-nums; color: var(--cyan); min-width: 72px; }
.userbox { margin-left: auto; display: flex; gap: 12px; color: var(--muted); }
.userbox a { color: var(--text); }
.prompt input { flex: 1; }
.workspace { display: grid; grid-template-columns: 240px 1fr 260px; min-height: 0; }
.library, .inspector {
  background: var(--panel); border-right: 1px solid var(--line);
  padding: 12px; overflow: auto;
}
.inspector { border-right: 0; border-left: 1px solid var(--line); }
h2 { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tabs button { flex: 1; font-size: 12px; }
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
  background: #141824; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; cursor: grab;
}
.lib-item small { display: block; color: var(--muted); }
.arrange { position: relative; overflow: auto; background: #10131a; }
.ruler-wrap { position: sticky; top: 0; z-index: 2; background: #10131a; }
.lanes { min-width: 1600px; }
.lane {
  display: grid; grid-template-columns: 140px 1fr;
  border-bottom: 1px solid var(--line); height: 72px;
}
.lane-head {
  background: var(--surface); padding: 8px 10px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; position: sticky; left: 0; z-index: 1;
}
.lane-head .row { display: flex; gap: 4px; }
.lane-head button { padding: 2px 6px; font-size: 11px; }
.lane-head button.armed { background: #5a2030; }
.lane-body { position: relative; background-image: repeating-linear-gradient(
  90deg, transparent 0 47px, rgba(255,255,255,0.03) 47px 48px,
  transparent 48px 191px, rgba(145,71,250,0.18) 191px 192px
); }
.clip {
  position: absolute; top: 10px; height: 52px; border-radius: 8px;
  background: linear-gradient(180deg, #1fd6b2, #0b8f78);
  color: #04140f; overflow: hidden; cursor: ew-resize;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.clip canvas { width: 100%; height: 100%; display: block; opacity: 0.85; }
.clip .name { position: absolute; left: 8px; top: 4px; font-size: 11px; font-weight: 600; }
.playhead {
  position: absolute; top: 0; bottom: 0; width: 2px; background: var(--purple);
  pointer-events: none; z-index: 3;
}
.empty { position: absolute; inset: 80px 40px auto; color: var(--muted); pointer-events: none; }
.insp label { display: block; margin: 8px 0; font-size: 13px; color: var(--muted); }
.insp input { width: 100%; margin-top: 4px; }
.mixer {
  display: flex; gap: 8px; padding: 8px 12px; overflow-x: auto;
  background: var(--surface); border-top: 1px solid var(--line);
}
.strip {
  min-width: 88px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; text-align: center; font-size: 11px;
}
.strip input[type="range"] { writing-mode: vertical-lr; direction: rtl; height: 52px; width: 22px; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .library, .inspector { display: none; }
  .daw { grid-template-rows: 52px 48px 1fr 72px; }
}
