:root {
  color-scheme: dark;
  --bg:#111113; --panel:#19191c; --surface:#202023; --line:#2e2d32;
  --text:#f1eeec; --muted:#a6a3a9; --subtle:#8d8992; --accent:#ff6b30;
  --display:"Barlow Condensed","Arial Narrow",sans-serif;
  --mono:"IBM Plex Mono",monospace;
  font: 16px "Barlow",system-ui,sans-serif;
  color:var(--text); background:var(--bg);
}
*, *::before, *::after {box-sizing:border-box}
body {margin:0; min-width:300px; min-height:100vh; display:flex; flex-direction:column}
button,input,select {font:inherit}
button {cursor:pointer; color:inherit}
button:disabled {opacity:.55; cursor:wait}
:focus-visible {outline:2px solid var(--accent); outline-offset:3px}
h1,h2,h3,p {margin:0}
a {color:inherit; text-decoration:none}
svg {flex:none; vertical-align:middle}
.sr-only {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.topbar {height:75px; padding:0 28px; display:flex; align-items:center; justify-content:space-between; gap:16px; background:#161618; border-bottom:1px solid var(--line)}
.brand,.top-actions,.button,.engine {display:flex; align-items:center}
.brand {gap:11px}
.brand img {box-shadow:0 0 18px #ff6b3023}
.brand strong {display:block; font:700 26px/.94 var(--display); letter-spacing:1.15px; white-space:nowrap}
.brand em {color:var(--accent);font-style:normal}
.brand small {display:block;margin-top:5px;color:var(--muted);font:500 9px/1 var(--mono);letter-spacing:2px}
.top-actions {gap:12px}
.engine {color:#a8a8ad;gap:8px;margin-right:11px;font:500 10px var(--mono);letter-spacing:1px;white-space:nowrap}
.engine i,.input-status i,.module-led {width:7px;height:7px;border-radius:50%;background:#6fd5a0;box-shadow:0 0 10px #6fd5a04d; flex:none}
.button {justify-content:center;gap:8px; padding:0 14px; min-height:38px; border-radius:6px; border:1px solid #39383d; background:#222226; font-weight:600; font-size:14px; white-space:nowrap; transition:background .15s,border-color .15s}
.button:hover {background:#2d2c31;border-color:#57545b}
.button svg {width:16px;height:16px}
.icon-button {width:38px;padding:0;color:#c5c1c7}
.connect,.generate {background:var(--accent);border-color:var(--accent); color:#1b120f; font-weight:700}
.connect:hover,.generate:hover {background:#ff8858;border-color:#ff8858}
.workspace {display:grid;grid-template-columns:280px minmax(0,1fr);flex:1}
.sidebar {background:#171719;border-right:1px solid var(--line);padding:28px 19px 22px;display:flex;flex-direction:column;min-width:0}
.side-heading,.section-heading h2 {display:flex;align-items:center;gap:9px}
.side-heading {padding:0 4px}
.side-heading svg,.section-heading h2 svg {width:17px;height:17px;color:var(--accent)}
.side-heading h2,.section-heading h2 {font:700 22px/1 var(--display);letter-spacing:1.15px}
.filters {display:flex;gap:5px;margin:21px 0 17px;flex-wrap:wrap}
.filters button {background:transparent;border:1px solid transparent;border-radius:4px;padding:5px 8px;font:500 10px var(--mono);color:var(--muted)}
.filters button:hover,.filters button[aria-pressed=true] {background:#302119;border-color:#63402e;color:#ff8959}
.preset-list {display:grid;gap:8px;max-height:448px;overflow:auto;scrollbar-width:thin;scrollbar-color:#54433d transparent}
.preset {text-align:left;min-width:0;width:100%;min-height:68px;border:1px solid #302f34;border-radius:7px;padding:10px;display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:9px;align-items:center;background:#202023}
.preset:hover {background:#282629;border-color:#65402e}
.preset.active {background:#2c201c;border-color:#a44d2b}
.preset-art {width:34px;height:34px;display:grid;place-items:center;border-radius:5px;background:color-mix(in srgb,var(--tone) 15%,#221f23);color:var(--tone)}
.preset-art svg {width:17px;height:17px}
.preset-title,.preset-artist {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.preset-title {font-size:14px;font-weight:700;margin-bottom:3px}
.preset-artist {font-size:12px;color:var(--muted)}
.preset-type {font:500 9px var(--mono);color:var(--tone);background:color-mix(in srgb,var(--tone) 12%,transparent);border-radius:3px;padding:4px 5px}
.save {margin-top:22px;width:100%;background:transparent;color:#ccc7cb}
.empty {font-size:14px;color:var(--muted);padding:10px 5px}
main {width:100%; min-width:0; max-width:1560px; margin:0 auto; padding:27px 30px 30px}
.hero {position:relative;background:radial-gradient(ellipse at 93% 12%,#462418 0%,#2a1d19 35%,transparent 72%),#1c191a;border:1px solid #433029;border-radius:10px;padding:26px 28px 23px}
.hero-grid,.hero canvas {position:absolute;inset:0;width:100%;height:100%;border-radius:inherit;pointer-events:none}
.hero-grid {background:linear-gradient(#d77f4b15 1px,transparent 1px),linear-gradient(90deg,#d77f4b15 1px,transparent 1px);background-size:24px 24px;mask-image:linear-gradient(90deg,transparent 15%,#000 90%)}
.hero-content {position:relative}
.eyebrow {display:flex;align-items:center;gap:7px;color:#ff905f;font:600 11px var(--mono);letter-spacing:1.6px}
.eyebrow svg {width:15px;height:15px}
h1 {font:800 clamp(43px,5.15vw,83px)/.97 var(--display);letter-spacing:.015em;margin:12px 0 9px}
h1 span {color:var(--accent)}
.hero p {color:#c0b5b7;font-size:16px}
#prompt-form {display:flex;gap:9px;max-width:760px;margin-top:22px}
.prompt-field {min-width:0;flex:1;position:relative;display:flex;align-items:center}
.prompt-icon {position:absolute;left:13px;color:#e68561;pointer-events:none}
.prompt-icon svg {width:18px;height:18px}
.prompt-field input {width:100%;min-height:46px;border:1px solid #563a32;border-radius:6px;background:#181619;color:var(--text);padding:0 12px 0 40px;font-size:15px}
.prompt-field input:has(+ .prompt-clear:not([hidden])) {padding-right:44px}
.prompt-field input::placeholder {color:#a49aa0}
.prompt-clear {position:absolute;right:5px;display:grid;place-items:center;width:36px;height:36px;padding:0;border:0;border-radius:5px;background:transparent;color:#c3afb0}
.prompt-clear svg {width:16px;height:16px}
.prompt-clear:hover {background:#332420;color:#ffab86}
.prompt-clear[hidden] {display:none}
.prompt-options {position:absolute;z-index:3;inset:calc(100% + 5px) 0 auto;margin:0;padding:4px;list-style:none;background:#231d1e;border:1px solid #684334;border-radius:6px;box-shadow:0 10px 28px #0009}
.prompt-options li {display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding:8px 10px;border-radius:4px;cursor:pointer;font-size:14px}
.prompt-options li:hover,.prompt-options li[aria-selected=true] {background:#3c2a25;color:#ffc0a5}
.prompt-options strong {font-weight:600}
.prompt-options small {color:#c3afb0;text-align:right;flex:none}
.generate {min-height:46px;padding:0 16px}
.suggestions {display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:12px}
.suggestions span {font:500 10px var(--mono);color:#baaaa9;margin-right:3px}
.suggestions button {border:1px solid #553a31;border-radius:4px;padding:4px 8px;background:#2c211f;color:#d3c5c5;font-size:12px}
.suggestions button:hover {border-color:var(--accent);color:#ffab86}
.chain-section {margin-top:25px}
.section-heading {display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.chain-heading {display:flex;align-items:center;gap:13px;min-width:0;margin-right:12px}
.chain-heading h2 {white-space:nowrap}
#tone-name {border-left:1px solid #403b41;padding-left:13px;color:var(--muted);font-size:13px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.demo {min-height:33px;font-size:13px;background:#1b1b1e}
.demo svg {width:14px;height:14px;color:var(--accent)}
.chain {display:grid;grid-template-columns:.82fr repeat(5,minmax(0,1.1fr)) .82fr;gap:13px}
.module {position:relative; text-align:left;min-width:0;min-height:102px;border:1px solid #333138;border-radius:7px;background:linear-gradient(#222225,#1a1a1d);padding:10px;display:flex;flex-direction:column;align-items:flex-start}
.module:hover {background:#29272b;border-color:#85523d}
.module[aria-pressed=true] {border-color:#e06a3b;background:linear-gradient(#37251e,#25201f);box-shadow:inset 0 0 18px #ff6b3010}
.module:not(:last-child)::after {content:"";position:absolute;width:13px;height:1px;right:-14px;top:50%;background:#554138}
.module[aria-pressed=true]::after {background:#9a4e30}
.module svg {height:21px;width:21px;color:var(--module)}
.module-led {position:absolute;right:9px;top:12px;width:5px;height:5px;background:var(--module);box-shadow:0 0 7px var(--module)}
.module.disabled .module-led {background:#756d74;box-shadow:none}
.module strong {display:block;font:700 18px/1 var(--display);letter-spacing:.7px;margin:9px 0 4px}
.module small {font-size:11px;color:#b6afb5;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.editor {margin-top:17px;border:1px solid #353238;background:#1a1a1d;border-radius:8px;overflow:hidden;min-height:219px}
.editor-head {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 17px;border-bottom:1px solid #302c30;background:linear-gradient(100deg,#2a211e,#202023 55%)}
.editor-title {display:flex;align-items:center;gap:10px;min-width:0}
.editor-title>span {color:var(--accent);display:grid;place-items:center;border-radius:5px;background:#43271d;width:34px;height:34px;flex:none}
.editor-title h2 {font:700 23px/1 var(--display);letter-spacing:.7px}
.editor-title p {font-size:12px;color:#b2a6ab;margin-top:3px;overflow-wrap:anywhere}
.editor-actions {display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.editor-actions .button {min-height:29px;padding:0 8px;font-size:12px}
.bypass[aria-pressed=true] {border-color:#63402e;color:#ff9569;background:#35261f}
.knobs {display:flex;align-items:flex-start;justify-content:space-evenly;flex-wrap:wrap;gap:14px;padding:13px 14px 16px}
.knob-control {display:grid;justify-items:center;min-width:67px;gap:3px;position:relative}
.knob-control label {font:500 10px var(--mono);letter-spacing:.55px;color:#c1b9bf;order:2}
.knob-control output {font:500 11px var(--mono);color:#fc8a59;order:3}
.knob-face {width:74px;height:74px;display:grid;place-items:center;position:relative;border-radius:50%;isolation:isolate;background:conic-gradient(from 225deg,#ff773f var(--turn),#3c3536 var(--turn) 270deg,transparent 270deg)}
.knob-face::before {content:"";position:absolute;inset:3px;border-radius:50%;background:#19191c}
.knob-disc {width:58px;height:58px;border-radius:50%;border:1px solid #544d51;position:relative;background:repeating-conic-gradient(#ffffff04 0deg 3deg,#0000000e 3deg 5deg),radial-gradient(circle at 40% 29%,#404045,#2a292e 49%,#18181b 89%);box-shadow:0 4px 8px #09090a,inset 0 0 0 3px #212125;transform:rotate(var(--needle))}
.knob-disc::before {content:"";position:absolute;left:calc(50% - 1px);top:5px;width:2px;height:12px;border-radius:2px;background:#ff824b;box-shadow:0 0 5px #ff824b99}
.knob-control input {position:absolute;inset:0 0 auto;width:100%;height:74px;margin:0;opacity:0;cursor:ew-resize;touch-action:none}
.knob-control:focus-within .knob-face {outline:2px solid #ffad89;outline-offset:2px}
.module-settings {display:flex;justify-content:space-evenly;gap:14px;flex-wrap:wrap;padding:15px}
.module-settings p {color:var(--muted);font-size:14px;max-width:460px}
.module-settings select {min-width:160px}
.statusbar {display:flex;justify-content:space-between;align-items:center;gap:12px;padding:0 28px;min-height:47px;background:#151517;border-top:1px solid #302f33;color:#b2aeb5;font:500 10px var(--mono)}
.footer-meters,.footer-info,.meter-group,.input-status {display:flex;align-items:center;gap:10px}
.footer-meters {gap:22px}
.footer-info {gap:20px}
.meter {display:flex;gap:3px}
.meter i {width:5px;height:11px;border-radius:1px;background:#323136}
.meter i.on {background:#6fd5a0}
.meter i.on:nth-child(n+13) {background:#f9ad61}
.meter i.on:nth-child(n+16) {background:#ff6946}
.mute {border:0;background:transparent;padding:3px;color:#aaa3ad}
.mute svg {width:15px;height:15px}
.mute[aria-pressed=true] {color:var(--accent)}
.input-status i {background:#726870;box-shadow:none;width:6px;height:6px}
.input-status.live i {background:#6fd5a0;box-shadow:0 0 8px #6fd5a084}
.toast {position:fixed;z-index:2;right:22px;bottom:60px;max-width:min(400px,calc(100% - 44px));border:1px solid #72442f;background:#2c211d;border-radius:7px;padding:12px 16px;box-shadow:0 8px 25px #0008;display:none}
.toast.show {display:block}
dialog {max-width:min(460px,calc(100% - 28px));width:100%;background:#202024;color:var(--text);border:1px solid #4c4141;border-radius:9px;padding:20px}
dialog::backdrop {background:#09080bb5}
.dialog-head {display:flex;justify-content:space-between;align-items:center;gap:12px}
.dialog-head h2 {font:700 25px var(--display);letter-spacing:1px}
dialog p {margin:10px 0;color:var(--muted);font-size:14px}
dialog label {display:block;margin:14px 0;font-weight:600}
dialog output {float:right;color:#ff966b;font:12px var(--mono)}
dialog input,dialog select {display:block;width:100%;margin-top:6px}
select,dialog input:not([type=range]) {padding:8px;color:var(--text);border:1px solid #48434b;background:#18181b;border-radius:5px}
input[type=range] {accent-color:var(--accent)}
@media(max-width:1150px) {
  .workspace {grid-template-columns:238px minmax(0,1fr)}
  .sidebar {padding-inline:14px}
  main {padding-inline:20px}
  .chain {gap:8px}
  .module:not(:last-child)::after {width:8px;right:-9px}
}
@media(max-width:900px) {
  .workspace {grid-template-columns:195px minmax(0,1fr)}
  .sidebar {padding-inline:11px}
  main {padding:20px 14px}
  .hero {padding:22px 17px}
  .preset {grid-template-columns:29px minmax(0,1fr);padding:8px}
  .preset-art {width:29px;height:31px}
  .preset-type {display:none}
  .module {padding:7px;min-height:90px}
  .module strong {font-size:16px}
}
@media(max-width:700px) {
  .topbar {height:63px;padding-inline:12px}
  .top-actions {gap:6px}
  .engine {display:none}
  .brand strong {font-size:22px}
  .brand img {width:32px;height:32px}
  .brand small {font-size:8px}
  .topbar .connect {padding-inline:8px;font-size:12px}
  .workspace {display:flex;flex-direction:column}
  main {order:-1}
  .sidebar {border-right:0;border-top:1px solid var(--line);padding:18px 14px}
  .preset-list {grid-template-columns:repeat(auto-fit,minmax(140px,1fr));max-height:280px}
  .save {align-self:flex-start;width:auto}
  .chain {grid-template-columns:repeat(auto-fit,minmax(77px,1fr))}
  .module:not(:last-child)::after {display:none}
  .statusbar {padding:10px 14px;flex-wrap:wrap}
}
@media(max-width:420px) {
  #prompt-form {flex-direction:column}
  .generate {align-self:flex-start;min-height:39px}
  .editor-head {align-items:flex-start}
  .footer-meters {gap:12px}
  .meter {gap:2px}
}
@media(max-width:540px) {
  .editor-head {flex-direction:column;align-items:stretch}
  .editor-actions {justify-content:flex-start}
  .editor-actions select {max-width:100%;min-width:0;font-size:14px}
}
@media(max-width:420px) {
  .chain-heading {flex-direction:column;align-items:flex-start;gap:4px}
  #tone-name {max-width:100%;border-left:0;padding-left:0}
}
