/* Copyright (c) 2026 Daan Suijkerbuijk / Audiopeek. All rights reserved. See LICENSE. */
:root {
  --bg: #0b0c10;
  --panel: #13151b;
  --panel-2: #1a1d25;
  --line: #262a35;
  --text: #e8e9ee;
  --muted: #8b90a0;
  --accent: #8fb3ff;
  --accent-2: #3d5bd9;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button, select, input { font: inherit; color: inherit; }
button {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; cursor: pointer;
}
button:hover { border-color: #3a4050; }
button.primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
button.small { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
select, input[type=number] {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 6px; min-width: 0;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.small { font-size: 11px; }
.hidden { display: none !important; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: conic-gradient(#8fb3ff, #f28fb4, #5ef0c0, #8fb3ff); }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: calc(100% - 51px); }
.stage { padding: 16px; overflow: auto; min-width: 0; }
.panel { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 6px 14px 40px; }

.preview-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
#preview { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.preview-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: rgba(10, 11, 15, .85); border-top: 1px solid var(--line);
}
.preview-bar input[type=range] { flex: 1; }
.icon { width: 34px; padding: 4px 0; }

.gallery-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 8px; }
.gallery-head h3 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tabs { display: flex; gap: 4px; }
.tabs button.on { border-color: var(--accent); color: var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.card { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); cursor: pointer; background: #000; padding: 0; text-align: left; }
.card img, .card canvas { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.75)); font-size: 12px; }
.card .del { position: absolute; top: 4px; right: 4px; padding: 0 6px; font-size: 11px; background: rgba(0,0,0,.6); }
.empty { color: var(--muted); padding: 12px 2px; }

details { border-bottom: 1px solid var(--line); padding: 8px 0 10px; }
summary { cursor: pointer; font-weight: 600; padding: 4px 0 8px; color: var(--text); list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: '▸'; display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.chips button.on { background: var(--accent); color: #0b0c10; border-color: var(--accent); font-weight: 600; }

.palettes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 10px; }
.pal { height: 22px; border-radius: 5px; border: 1px solid var(--line); padding: 0; }
.swatches { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.swatches input[type=color] { width: 36px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.swatches .lbl { color: var(--muted); font-size: 11px; margin-left: 4px; }

.ctl { display: grid; grid-template-columns: 104px 1fr 38px; align-items: center; gap: 8px; margin: 5px 0; }
.ctl label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl output { text-align: right; color: var(--muted); font-size: 11px; }
input[type=range] { width: 100%; accent-color: var(--accent); }

.row { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.row > select { grid-column: 2 / 4; }
.row label { color: var(--muted); }
.row.buttons { grid-template-columns: 1fr 1fr; margin-top: 12px; }
.progress { margin-top: 10px; display: grid; gap: 6px; }
.progress .bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s; }
.hint { color: var(--muted); font-size: 11px; margin: 8px 0 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: #22262f; border: 1px solid var(--line); padding: 8px 14px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: all .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .top { flex-wrap: wrap; }
}

/* ?live: only the background, edge to edge */
body.live { overflow: hidden; background: #000; }
body.live .top, body.live .panel, body.live .gallery-head, body.live .gallery,
body.live .preview-bar, body.live .toast { display: none !important; }
body.live .layout { display: block; height: 100vh; }
body.live .stage { padding: 0; overflow: hidden; }
body.live .preview-wrap { position: fixed; inset: 0; width: 100vw !important; border: 0; border-radius: 0; }
body.live #preview { width: 100vw; height: 100vh; aspect-ratio: auto !important; }
