/* Soundly – gemeinsames Design (Grundgerüst). Module bringen eigene Dateien mit: css/<modul>.css */
:root {
  --bg: #0d0b16; --bg2: #120f1f; --panel: #17132a; --panel2: #1d1834; --panel3: #252042; --line: rgba(255,255,255,.06); --line2: rgba(255,255,255,.12);
  --text: #ece9f7; --muted: #8f89aa; --dim: #615b7d;
  --accent: #7c4dff; --accent2: #9a6bff; --accentSoft: rgba(124,77,255,.16); --glow: 0 0 0 3px rgba(124,77,255,.28);
  --good: #3ddc97; --bad: #ff5c7a; --warn: #ffc24b;
  --c-drums: #7c4dff; --c-bass: #4d7cff; --c-melody: #b14dff; --c-vocals: #ff4d9d; --c-fx: #3dd9c7; --c-audio: #4dc3ff;
  --r: 12px; --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 13.5px/1.45 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--muted); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.09); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* Layout */
.app { display: flex; height: 100vh; }
.nav { width: 228px; flex: none; display: flex; flex-direction: column; padding: 18px 14px; background: var(--bg2); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 22px; color: var(--text); text-decoration: none; }
.brand .logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(140deg, #9a6bff, #5b2bff); box-shadow: 0 6px 20px rgba(124,77,255,.4); color: #fff; }
.brand .logo svg { width: 22px; height: 22px; stroke-width: 2.4; }
.brand b { display: block; font-size: 19px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 12px; }
.navlist { display: flex; flex-direction: column; gap: 3px; }
.navlist button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 0; background: none; color: #bdb6d8; cursor: pointer; font-size: 14px; text-align: left; }
.navlist button:hover { background: rgba(255,255,255,.04); color: #fff; }
.navlist button.on { background: var(--accentSoft); color: #fff; box-shadow: inset 0 0 0 1px rgba(124,77,255,.35); }
.navlist button.on svg { color: var(--accent2); }
.navlist .soon { margin-left: auto; font-size: 10px; color: var(--dim); }
.navfoot { margin-top: auto; }
.localbox { display: flex; gap: 10px; padding: 12px; border-radius: 12px; background: linear-gradient(160deg, rgba(124,77,255,.18), rgba(124,77,255,.05)); border: 1px solid rgba(124,77,255,.25); }
.localbox svg { color: var(--accent2); margin-top: 2px; }
.localbox b { display: block; font-size: 13px; }
.localbox span { color: var(--muted); font-size: 11.5px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 62px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.pname { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); min-width: 230px; color: var(--muted); }
.pname input { background: none; border: 0; outline: none; color: var(--text); font-weight: 600; width: 100%; user-select: text; }
.pname:focus-within { border-color: var(--accent); }
.saved { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.saved i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.saved.busy i { background: var(--warn); }
.transport { height: 58px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.tgroup { display: flex; align-items: center; gap: 8px; flex: 1; }
.tgroup.center { justify-content: center; flex: 1.4; }
.tgroup.right { justify-content: flex-end; }
.transport { min-width: 0; overflow: hidden; }
.tgroup { min-width: 0; }
.tgroup:first-child { flex: none; } .tgroup.right { flex: 0 1 auto; }
@media (max-width: 1180px) { .transport { gap: 8px; padding: 0 10px; } .tgroup { gap: 5px; } #masterVol { width: 70px; } .clock.dim { display: none; } }
.chipbtn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-weight: 600; cursor: pointer; outline: none; }
.chipbtn:focus-within, select.chipbtn:focus { border-color: var(--accent); }
.chipbtn input { width: 40px; background: none; border: 0; outline: none; color: var(--text); font-weight: 700; text-align: right; -moz-appearance: textfield; user-select: text; }
.chipbtn input::-webkit-inner-spin-button { display: none; }
select.chipbtn option { background: var(--panel2); }
.playbtn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 22px rgba(124,77,255,.5); transition: transform .08s, background .12s; }
.playbtn:hover { background: var(--accent2); transform: scale(1.04); }
.playbtn svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; margin-left: 8px; min-width: 44px; text-align: right; }
.clock.dim { color: var(--muted); font-weight: 500; margin-left: 0; text-align: left; }
.rec { fill: var(--bad); stroke: none; }
.ib.recording { background: rgba(255,92,122,.18); animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255,92,122,.25); } }
.mut { color: var(--muted); }
#masterVol { width: 100px; }
#meter { border-radius: 4px; background: rgba(255,255,255,.04); }
.view { flex: 1; min-height: 0; position: relative; overflow: hidden; }

/* Knöpfe & Eingaben (für alle Module) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(255,255,255,.03); color: var(--text); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: rgba(255,255,255,.07); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 4px 16px rgba(124,77,255,.35); }
.btn.primary:hover { background: var(--accent2); }
.btn.ghost { border-color: transparent; background: none; }
.btn.danger { color: #ffb1c1; border-color: rgba(255,92,122,.4); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .4; cursor: default; }
.ib { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 0; background: none; color: #c4bde0; cursor: pointer; }
.ib:hover { background: rgba(255,255,255,.06); color: #fff; }
.ib:disabled { opacity: .3; cursor: default; background: none; }
.ib.tog.on { color: var(--accent2); background: var(--accentSoft); }
.ib.sm { width: 26px; height: 26px; border-radius: 7px; }
.ib.sm svg { width: 15px; height: 15px; }
.inp { height: 34px; padding: 0 11px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line2); color: var(--text); outline: none; user-select: text; }
.inp:focus { border-color: var(--accent); }
select.inp option { background: var(--panel2); }
.pill { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: none; color: #c4bde0; cursor: pointer; font-size: 12.5px; }
.pill:hover { color: #fff; border-color: rgba(255,255,255,.25); }
.pill.on { background: var(--accent); border-color: transparent; color: #fff; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.sectitle { font-size: 16px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; }
.sub { color: var(--muted); font-size: 12.5px; margin: 2px 0 0; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 18px; background: transparent; cursor: pointer; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), rgba(255,255,255,.12) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; margin-top: -5px; box-shadow: 0 0 0 3px rgba(124,77,255,.4); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.switch { position: relative; width: 34px; height: 20px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 20px; background: rgba(255,255,255,.14); transition: background .15s; cursor: pointer; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(14px); }
/* Drehregler (ui.knob) */
.knob { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; cursor: ns-resize; touch-action: none; }
.knob canvas { display: block; }
.knob span { font-size: 11px; color: var(--muted); }
.knob b { font-size: 11px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* Dropdown */
.ddw { position: relative; }
.ddm { position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px; padding: 6px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line2); box-shadow: 0 16px 40px rgba(0,0,0,.5); z-index: 50; display: none; }
.ddm.open { display: block; }
.ddm button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text); }
.ddm button:hover { background: rgba(255,255,255,.06); }
.ddm hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }

/* Dialoge & Meldungen */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(5,3,12,.7); padding: 16px; backdrop-filter: blur(3px); }
.dlg { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; padding: 24px; box-shadow: 0 24px 70px rgba(0,0,0,.6); }
.dlg h2 { margin: 0 0 4px; font-size: 20px; }
.dlg p { color: var(--muted); margin: 0 0 14px; }
.dlg .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 120; background: var(--panel3); border: 1px solid var(--line2); padding: 11px 18px; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.5); max-width: 90vw; }
.toast.bad { border-color: rgba(255,92,122,.5); }
.placeholder { height: 100%; display: grid; place-items: center; text-align: center; color: var(--muted); }
.placeholder b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }
@media (max-width: 1000px) { .nav { width: 70px; padding: 14px 8px; } .brand span:last-child, .navlist button span, .localbox div, .navlist .soon { display: none; } .navlist button { justify-content: center; } .pname { min-width: 140px; } .saved { display: none; } }
