:root {
  color-scheme: dark;
  --bg: #090b12;
  --surface-0: #0d1019;
  --surface-1: #111521;
  --surface-2: #171c2a;
  --surface-3: #202739;
  --surface-4: #2a3348;
  --line: rgba(171, 184, 219, 0.13);
  --line-strong: rgba(171, 184, 219, 0.24);
  --text: #f5f7ff;
  --muted: #8e98b2;
  --muted-2: #66708a;
  --purple: #8b5cf6;
  --purple-2: #ad8aff;
  --mint: #20d9b3;
  --red: #f46b86;
  --yellow: #f6c85f;
  --blue: #4ca6ff;
  --orange: #fa8b42;
  --radius: 10px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  --toolbar-h: 58px;
  --status-h: 26px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  background:
    radial-gradient(circle at 14% -10%, rgba(139, 92, 246, 0.18), transparent 34%),
    radial-gradient(circle at 98% 0%, rgba(32, 217, 179, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { color: inherit; }
button, [role="button"], input[type="range"] { touch-action: none; }
canvas { display: block; }

.boot-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 10px;
  background: var(--bg);
}
.boot-logo {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  border-radius: 19px;
  background: linear-gradient(145deg, var(--purple), var(--mint));
  box-shadow: 0 16px 50px rgba(139, 92, 246, 0.32);
  transform: rotate(-5deg);
}
.boot-logo span { font-size: 35px; font-weight: 900; transform: rotate(5deg); }
.boot-shell h1 { margin: 0; font-size: 26px; letter-spacing: -0.035em; }
.boot-shell p { margin: 0; color: var(--muted); font-size: 13px; }
.boot-progress { width: 220px; height: 3px; margin: 14px auto 0; overflow: hidden; background: var(--surface-3); border-radius: 99px; }
.boot-progress i { display: block; height: 100%; width: 45%; background: linear-gradient(90deg, var(--purple), var(--mint)); border-radius: inherit; animation: boot 1.2s ease-in-out infinite alternate; }
@keyframes boot { to { transform: translateX(122%); } }

.studio-shell {
  height: 100%;
  display: grid;
  grid-template-rows: var(--toolbar-h) minmax(0, 1fr) var(--status-h);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(270px, 0.85fr) minmax(510px, 1.7fr) minmax(260px, 0.8fr);
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  background: rgba(13, 16, 25, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  z-index: 20;
}
.brand-zone, .transport-zone, .project-zone { display: flex; align-items: center; min-width: 0; }
.brand-zone { gap: 10px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--purple), #6f45e9 54%, var(--mint));
  box-shadow: 0 9px 24px rgba(139, 92, 246, 0.27); font-weight: 900; font-size: 20px;
}
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 13px; line-height: 1.1; letter-spacing: 0.01em; }
.brand-copy span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.project-title-input {
  width: min(230px, 25vw); margin-left: 7px; padding: 7px 9px; border: 1px solid transparent; border-radius: 7px;
  color: var(--text); background: transparent; font-size: 12px; font-weight: 650; outline: none;
}
.project-title-input:hover, .project-title-input:focus { border-color: var(--line-strong); background: var(--surface-1); }
.transport-zone { justify-content: center; gap: 6px; }
.project-zone { justify-content: flex-end; gap: 6px; }

.icon-button, .tool-button, .chip-button {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; cursor: pointer;
  display: inline-grid; place-items: center; transition: 130ms ease; outline: none;
}
.icon-button { width: 36px; height: 36px; font-size: 14px; }
.tool-button { min-height: 32px; padding: 0 10px; gap: 6px; display: inline-flex; font-size: 11px; font-weight: 650; }
.chip-button { min-height: 27px; padding: 0 9px; font-size: 10px; color: var(--muted); }
.icon-button:hover, .tool-button:hover, .chip-button:hover { border-color: var(--line-strong); background: var(--surface-3); transform: translateY(-1px); }
.icon-button:active, .tool-button:active, .chip-button:active { transform: translateY(0); }
.icon-button.active, .tool-button.active, .chip-button.active { color: white; border-color: rgba(139, 92, 246, 0.66); background: linear-gradient(145deg, rgba(139, 92, 246, 0.48), rgba(139, 92, 246, 0.22)); }
.icon-button.recording { border-color: var(--red); background: rgba(244, 107, 134, 0.22); box-shadow: 0 0 0 4px rgba(244, 107, 134, 0.09); animation: pulse-record 1.2s ease-in-out infinite; }
@keyframes pulse-record { 50% { box-shadow: 0 0 0 8px rgba(244, 107, 134, 0.02); } }
.icon-button:disabled, .tool-button:disabled { opacity: 0.38; cursor: default; transform: none; }
.play-button { color: var(--mint); }
.stop-button { color: var(--muted); }
.record-button { color: var(--red); }
.divider-v { width: 1px; height: 27px; background: var(--line); margin: 0 3px; }

.tempo-box, .position-box {
  height: 36px; border: 1px solid var(--line); background: #090c14; border-radius: 8px;
  display: flex; align-items: center; padding: 0 9px; gap: 7px;
}
.tempo-box label, .position-box label { font-size: 9px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.09em; }
.tempo-box input { width: 47px; border: 0; padding: 0; color: var(--text); background: transparent; font-weight: 800; outline: none; }
.tempo-box span { color: var(--muted); font-size: 9px; }
.position-box output { min-width: 70px; font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: #dfe4ff; letter-spacing: 0.04em; }
.mode-switch { display: flex; padding: 3px; border: 1px solid var(--line); background: #090c14; border-radius: 8px; }
.mode-switch button { border: 0; background: transparent; color: var(--muted); padding: 5px 8px; border-radius: 5px; font-size: 9px; font-weight: 750; cursor: pointer; }
.mode-switch button.active { color: white; background: var(--surface-3); }

.studio-main {
  min-height: 0;
  display: grid;
  grid-template-columns: 230px minmax(510px, 1fr) 262px;
  background: var(--bg);
}
.sidebar, .inspector { min-height: 0; background: var(--surface-0); overflow: hidden; }
.sidebar { border-right: 1px solid var(--line); }
.inspector { border-left: 1px solid var(--line); }
.panel-head {
  height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px;
  border-bottom: 1px solid var(--line); background: var(--surface-1);
}
.panel-head h2 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.095em; }
.panel-head span { color: var(--muted-2); font-size: 9px; }

.workspace {
  min-width: 0; min-height: 0; display: grid; grid-template-rows: 39px minmax(0, 1fr) 230px;
  background: #0b0e17;
}
.workspace.mixer-collapsed { grid-template-rows: 39px minmax(0, 1fr) 36px; }
.editor-tabs { display: flex; align-items: flex-end; padding: 0 10px; gap: 4px; border-bottom: 1px solid var(--line); background: var(--surface-1); }
.editor-tab {
  height: 31px; padding: 0 13px; border: 0; border-radius: 7px 7px 0 0; background: transparent;
  color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent;
}
.editor-tab:hover { color: var(--text); background: rgba(255,255,255,0.025); }
.editor-tab.active { color: white; border-bottom-color: var(--purple); background: var(--surface-2); }
.editor-tools { margin-left: auto; height: 100%; display: flex; align-items: center; gap: 6px; }
.editor-host { min-height: 0; min-width: 0; overflow: hidden; position: relative; }
.editor-panel { width: 100%; height: 100%; min-height: 0; display: flex; flex-direction: column; }
.editor-toolbar {
  height: 40px; flex: 0 0 40px; display: flex; align-items: center; gap: 7px; padding: 0 10px;
  border-bottom: 1px solid var(--line); background: rgba(17, 21, 33, 0.86);
}
.editor-toolbar .spacer { flex: 1; }
.editor-toolbar label { font-size: 9px; color: var(--muted); }
.editor-toolbar select, .mini-select {
  height: 27px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--text);
  padding: 0 24px 0 8px; outline: none; font-size: 10px;
}
.editor-canvas-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #0b0e16; }
.editor-canvas-wrap canvas { width: 100%; height: 100%; cursor: crosshair; }
.canvas-hint {
  position: absolute; right: 11px; bottom: 9px; padding: 5px 8px; border-radius: 6px;
  color: var(--muted-2); background: rgba(9, 11, 18, 0.78); border: 1px solid var(--line); font-size: 9px; pointer-events: none;
}

.browser-pane { height: calc(100% - 42px); display: flex; flex-direction: column; min-height: 0; }
.search-box { margin: 10px; height: 32px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; gap: 7px; padding: 0 9px; background: #090c14; }
.search-box span { color: var(--muted-2); font-size: 12px; }
.search-box input { flex: 1; min-width: 0; color: var(--text); background: transparent; border: 0; outline: 0; font-size: 10px; }
.browser-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 10px 8px; }
.browser-tabs button { height: 27px; border: 1px solid var(--line); background: var(--surface-1); color: var(--muted); border-radius: 6px; font-size: 9px; cursor: pointer; }
.browser-tabs button.active { color: white; background: var(--surface-3); border-color: var(--line-strong); }
.browser-list { flex: 1; min-height: 0; overflow: auto; padding: 2px 8px 12px; }
.browser-group-title { margin: 10px 5px 5px; color: var(--muted-2); font-size: 8px; text-transform: uppercase; letter-spacing: 0.12em; }
.browser-item {
  display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 43px;
  padding: 5px 7px; border-radius: 7px; border: 1px solid transparent; cursor: grab;
}
.browser-item:hover { background: var(--surface-2); border-color: var(--line); }
.browser-item:active { cursor: grabbing; }
.sound-icon { width: 29px; height: 29px; border-radius: 7px; display: grid; place-items: center; background: rgba(139,92,246,0.16); color: var(--purple-2); font-weight: 850; font-size: 10px; }
.browser-item strong { display: block; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser-item small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 8px; }
.browser-item .preview { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.browser-item .preview:hover { color: var(--mint); background: rgba(32,217,179,0.09); }
.browser-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 10px; border-top: 1px solid var(--line); }

.inspector-body { height: calc(100% - 42px); overflow: auto; padding: 12px; }
.inspector-card { border: 1px solid var(--line); background: var(--surface-1); border-radius: 9px; margin-bottom: 10px; overflow: hidden; }
.inspector-card h3 { margin: 0; padding: 10px 11px; border-bottom: 1px solid var(--line); font-size: 10px; }
.inspector-section { padding: 10px 11px; }
.parameter-row { display: grid; grid-template-columns: minmax(72px, 1fr) 1.35fr 36px; align-items: center; gap: 8px; min-height: 30px; }
.parameter-row label { color: var(--muted); font-size: 9px; }
.parameter-row output { color: #dce1f5; text-align: right; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
input[type="range"] {
  appearance: none; width: 100%; height: 3px; border-radius: 99px; background: var(--surface-4); outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #dfe4ff; border: 2px solid var(--purple); box-shadow: 0 1px 5px rgba(0,0,0,0.4); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #dfe4ff; border: 2px solid var(--purple); }
.capability-grid { display: grid; grid-template-columns: 1fr auto; gap: 7px; font-size: 9px; color: var(--muted); }
.capability-grid b.ok { color: var(--mint); }
.capability-grid b.warn { color: var(--yellow); }
.capability-grid b.bad { color: var(--red); }
.info-callout { padding: 9px; border: 1px solid rgba(76,166,255,0.22); background: rgba(76,166,255,0.06); color: #b9d9ff; border-radius: 7px; font-size: 9px; line-height: 1.45; }

.rack-scroll { min-height: 0; flex: 1; overflow: auto; padding: 8px 10px 16px; }
.pattern-strip { display: flex; gap: 6px; align-items: center; }
.pattern-button { position: relative; height: 28px; min-width: 80px; max-width: 130px; padding: 0 10px 0 13px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); text-align: left; font-size: 9px; cursor: pointer; overflow: hidden; }
.pattern-button::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--pattern-color, var(--purple)); }
.pattern-button.active { color: white; border-color: color-mix(in srgb, var(--pattern-color, var(--purple)) 58%, transparent); background: color-mix(in srgb, var(--pattern-color, var(--purple)) 18%, var(--surface-2)); }
.channel-rack { min-width: 800px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface-0); box-shadow: 0 15px 45px rgba(0,0,0,0.16); }
.channel-row { display: grid; grid-template-columns: 225px minmax(500px, 1fr); min-height: 48px; border-bottom: 1px solid var(--line); }
.channel-row:last-child { border-bottom: 0; }
.channel-row.selected { background: linear-gradient(90deg, rgba(139,92,246,0.08), transparent 35%); }
.channel-meta { display: grid; grid-template-columns: 4px 27px minmax(70px, 1fr) 28px 28px 47px 47px; align-items: center; gap: 5px; padding: 5px 8px 5px 0; border-right: 1px solid var(--line); }
.channel-color { height: 100%; background: var(--channel-color); }
.channel-index { color: var(--muted-2); font: 9px ui-monospace, monospace; text-align: center; }
.channel-name { border: 0; outline: 0; min-width: 0; color: var(--text); background: transparent; font-size: 10px; font-weight: 650; }
.channel-name:focus { background: var(--surface-2); border-radius: 4px; padding: 4px; }
.mini-toggle { height: 24px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--muted-2); font-size: 8px; cursor: pointer; }
.mini-toggle:hover { color: white; background: var(--surface-2); }
.mini-toggle.active.mute { color: var(--red); border-color: rgba(244,107,134,0.45); background: rgba(244,107,134,0.09); }
.mini-toggle.active.solo { color: var(--yellow); border-color: rgba(246,200,95,0.45); background: rgba(246,200,95,0.09); }
.mini-range { width: 47px !important; }
.step-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(20px, 1fr); gap: 3px; align-items: center; padding: 8px; }
.step-button { height: 30px; min-width: 18px; position: relative; border: 1px solid rgba(171,184,219,0.08); border-radius: 4px; background: #181d2a; cursor: pointer; padding: 0; overflow: hidden; }
.step-button:nth-child(4n+1) { margin-left: 4px; }
.step-button:first-child { margin-left: 0; }
.step-button:hover { border-color: var(--line-strong); background: #222a3c; }
.step-button.active { background: color-mix(in srgb, var(--channel-color) calc(var(--velocity) * 75%), #24293a); border-color: color-mix(in srgb, var(--channel-color) 70%, white 8%); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.22), 0 0 10px color-mix(in srgb, var(--channel-color) 25%, transparent); }
.step-button.active::after { content: ""; position: absolute; left: 3px; right: 3px; bottom: 3px; height: 2px; background: rgba(255,255,255,calc(var(--probability) * 0.8)); border-radius: 99px; }
.step-button.playhead { outline: 1px solid white; outline-offset: 1px; }

.mixer-panel { min-height: 0; border-top: 1px solid var(--line); background: #0b0e16; overflow: hidden; }
.mixer-head { height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid var(--line); background: var(--surface-1); }
.mixer-head strong { font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em; }
.mixer-head span { color: var(--muted-2); font-size: 9px; }
.mixer-head .spacer { flex: 1; }
.mixer-strip-scroll { height: calc(100% - 36px); overflow: auto; }
.mixer-strips { min-width: 880px; height: 100%; display: grid; grid-template-columns: repeat(8, minmax(88px, 1fr)) minmax(98px, 1.05fr); }
.mixer-strip { min-height: 176px; position: relative; display: grid; grid-template-rows: 26px minmax(70px, 1fr) 34px 28px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,0.012), transparent 60%); }
.mixer-strip.master { background: linear-gradient(180deg, rgba(139,92,246,0.08), transparent 70%); }
.mixer-strip.selected { box-shadow: inset 0 2px 0 var(--strip-color, var(--purple)); }
.mixer-strip-name { overflow: hidden; padding: 6px 7px; color: #dce1f5; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.mixer-main { position: relative; display: grid; grid-template-columns: 10px 1fr; gap: 7px; padding: 4px 8px; }
.meter-track { position: relative; overflow: hidden; border-radius: 4px; background: #07090f; border: 1px solid var(--line); }
.meter-fill { position: absolute; left: 1px; right: 1px; bottom: 1px; height: 0%; border-radius: 2px; background: linear-gradient(to top, var(--mint) 0 70%, var(--yellow) 84%, var(--red)); transition: height 80ms linear; }
.vertical-fader { position: relative; display: grid; place-items: center; }
.vertical-fader input { width: 80px; transform: rotate(-90deg); }
.mixer-knobs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 2px 5px; }
.mini-knob { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted-2); font-size: 7px; }
.mini-knob input { width: 100% !important; }
.mixer-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 2px 7px 6px; }

.statusbar {
  display: flex; align-items: center; gap: 12px; padding: 0 10px; color: var(--muted-2); background: #080a10; border-top: 1px solid var(--line); font-size: 8px;
}
.statusbar .save-state { color: var(--mint); }
.statusbar .spacer { flex: 1; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.status-dot.on { background: var(--mint); box-shadow: 0 0 8px rgba(32,217,179,0.55); }

.audio-gate {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(5, 7, 12, 0.78); backdrop-filter: blur(18px);
}
.audio-gate-card { width: min(480px, 92vw); padding: 29px; border: 1px solid var(--line-strong); border-radius: 18px; background: linear-gradient(145deg, rgba(24,29,43,0.98), rgba(12,15,24,0.98)); box-shadow: var(--shadow); text-align: center; }
.audio-gate-card .brand-mark { margin: 0 auto 15px; width: 54px; height: 54px; border-radius: 15px; font-size: 26px; }
.audio-gate-card h2 { margin: 0; font-size: 23px; letter-spacing: -0.035em; }
.audio-gate-card p { margin: 9px auto 20px; max-width: 370px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.start-studio-button { min-width: 180px; height: 43px; border: 0; border-radius: 10px; background: linear-gradient(135deg, var(--purple), #6c4ae3); color: white; font-weight: 800; cursor: pointer; box-shadow: 0 12px 30px rgba(139,92,246,0.3); }
.start-studio-button:hover { filter: brightness(1.09); transform: translateY(-1px); }
.gate-caps { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.gate-caps span { border: 1px solid var(--line); border-radius: 99px; padding: 5px 8px; color: var(--muted-2); font-size: 8px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 18px; background: rgba(4,6,10,0.75); backdrop-filter: blur(9px); }
.modal { width: min(510px, 96vw); max-height: min(680px, 92vh); overflow: auto; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-1); box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 14px; }
.modal-close { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.modal-close:hover { background: var(--surface-3); color: white; }
.modal-body { padding: 16px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 7px; padding: 12px 16px; border-top: 1px solid var(--line); }
.modal-progress { height: 5px; margin: 12px 0; overflow: hidden; background: #080a10; border-radius: 99px; }
.modal-progress i { display: block; height: 100%; width: var(--progress, 0%); background: linear-gradient(90deg, var(--purple), var(--mint)); transition: width 180ms linear; }
.form-grid { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 10px; }
.form-grid label { color: var(--muted); }
.form-grid select, .form-grid input[type="number"], .form-grid input[type="text"] { height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #0b0e16; color: white; padding: 0 8px; outline: none; }

.toast-stack { position: fixed; right: 14px; bottom: 38px; z-index: 300; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.toast { width: min(340px, calc(100vw - 28px)); padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line-strong); background: rgba(24,29,43,0.96); box-shadow: 0 13px 38px rgba(0,0,0,0.32); animation: toast-in 170ms ease-out; }
.toast strong { display: block; font-size: 10px; }
.toast span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.toast.error { border-color: rgba(244,107,134,0.42); }
.toast.success { border-color: rgba(32,217,179,0.35); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

.context-menu { position: fixed; z-index: 400; min-width: 160px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(22,27,41,0.98); box-shadow: var(--shadow); }
.context-menu button { width: 100%; height: 29px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; text-align: left; padding: 0 9px; font-size: 9px; cursor: pointer; }
.context-menu button:hover { color: white; background: var(--surface-3); }
.context-menu button.danger:hover { color: #ff9aad; background: rgba(244,107,134,0.09); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.08); }
::-webkit-scrollbar-thumb { background: #293146; border: 2px solid transparent; background-clip: padding-box; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #37415a; border: 2px solid transparent; background-clip: padding-box; }

@media (max-width: 1180px) {
  .studio-main { grid-template-columns: 205px minmax(500px, 1fr); }
  .inspector { display: none; }
  .topbar { grid-template-columns: minmax(230px, .8fr) minmax(500px, 1.6fr) minmax(200px, .6fr); }
  .project-zone .tool-button span { display: none; }
  .project-zone .tool-button { width: 36px; padding: 0; justify-content: center; }
}
@media (max-width: 900px) {
  .studio-main { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { grid-template-columns: 190px minmax(460px, 1fr); overflow-x: auto; }
  .project-zone { display: none; }
  .project-title-input { display: none; }
}
