:root {
  color-scheme: dark;
  --bg: #0e1014;
  --raised: #171b22;
  --sunken: #0b0d11;
  --line: rgba(255, 255, 255, 0.08);
  --text: #edf1f7;
  --muted: #8e98a8;
  --amber: #f5b942;
  --amber-dim: #2a2418;
  --ok: #3dd68c;
  --danger: #ff6b6b;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(245, 185, 66, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.top, .toolbar, .aside-head, .now-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.top, .toolbar { padding: 12px 18px; }
.top { border-bottom: 1px solid var(--line); }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}
.brand strong { display: block; font-size: 15px; letter-spacing: 0.04em; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(245, 185, 66, 0.35);
  background:
    linear-gradient(var(--amber), var(--amber)) 8px 16px / 3px 12px no-repeat,
    linear-gradient(var(--amber), var(--amber)) 14px 10px / 3px 18px no-repeat,
    linear-gradient(var(--amber), var(--amber)) 20px 13px / 3px 14px no-repeat,
    linear-gradient(var(--amber), var(--amber)) 26px 7px / 3px 22px no-repeat,
    #241c10;
}
.top-actions, .tools { display: flex; align-items: center; gap: 10px; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.status i { width: 8px; height: 8px; border-radius: 99px; background: var(--amber); }
.status.on i { background: var(--ok); }
.status.off i { background: var(--danger); }

.toolbar {
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
}
.chip.on {
  background: var(--amber-dim);
  color: #ffe7b8;
  border-color: rgba(245, 185, 66, 0.45);
}
.tools { margin-left: auto; }
.master { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.master input { width: 110px; }
input[type="search"], input[type="text"], input[type="password"], .new-cat input, .card input[type="text"], .cat input {
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--sunken);
  padding: 0 10px;
  min-width: 0;
}
input[type="search"] { width: 180px; }
input[type="range"] { accent-color: var(--amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.btn, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #1c212b;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover, .icon-btn:hover { background: #262c38; }
.btn.primary { background: #3a311c; border-color: rgba(245, 185, 66, 0.5); color: #ffe7b8; }
.btn.danger { background: #3a1e1e; border-color: rgba(255, 107, 107, 0.45); color: #ffd4d4; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.4; cursor: default; }
.icon-btn { width: 36px; padding: 0; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 0;
}
.stage, .now-list, .cat-list, .editor-wrap { min-height: 0; overflow: auto; }
.stage { padding: 18px 18px 28px; }
.group { margin: 0 0 22px; }
.group h2, .aside-head h1, .now-head h2, .empty-panel h2, .dialog h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.grid, .cards { display: grid; gap: 10px; }
.grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.cards { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.pad {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 96px;
  padding: 12px 12px 14px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--c) 42%, transparent);
  background: color-mix(in srgb, var(--c) 16%, #171b22);
  box-shadow: inset 3px 0 0 var(--c);
  overflow: hidden;
  touch-action: manipulation;
}
.pad:active, .pad.hit { transform: translateY(1px) scale(0.985); }
.pad.is-on { border-color: var(--c); }
.pad-cat {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pad-name {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pad-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; margin-top: auto; }
kbd {
  font-family: inherit;
  font-size: 11px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
}
.pad .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.06); }

.bar { position: relative; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar > span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--c, var(--amber));
  transform: scaleX(0);
  transform-origin: left center;
}
.bar.indeterminate > span { width: 35%; animation: slide 1s linear infinite; transform: none; }
@keyframes slide { from { margin-left: -35%; } to { margin-left: 100%; } }

.now {
  border-left: 1px solid var(--line);
  background: #12151b;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.now-head, .now-foot { padding: 14px 14px 8px; }
.now-head h2 { flex: 1; }
.now-head span {
  min-width: 22px;
  height: 22px;
  border-radius: 99px;
  background: var(--amber-dim);
  color: #ffe7b8;
  font-size: 12px;
  display: inline-grid;
  place-items: center;
}
.now-head span:empty { display: none; }
.now-list { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.now-foot { margin: 0; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.play {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--raised);
  border: 1px solid var(--line);
  cursor: pointer;
}
.swatch { border-radius: 99px; background: var(--c, var(--amber)); }
.play-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.play-top { display: flex; justify-content: space-between; gap: 8px; }
.play-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.play-cat { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.play-controls { display: flex; align-items: center; gap: 8px; }
.play-controls input { flex: 1; }
.play-controls .btn { height: 32px; }

.empty, .empty-panel p, .aside-head p, .dialog p { color: var(--muted); }
.empty { margin: 8px 0; }
.empty-panel, .drop {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  padding: 28px 16px;
  border: 1px dashed rgba(245, 185, 66, 0.35);
  border-radius: 14px;
  background: rgba(245, 185, 66, 0.04);
}
.drop { cursor: pointer; margin: 12px; }
.drop strong { color: var(--text); }
.drop span { color: var(--muted); }
.drop .btn-row { width: 100%; max-width: 460px; margin-top: 4px; }
.drop.over, .file-over .drop, .editor-wrap.file-over .drop { background: rgba(245, 185, 66, 0.12); }
label.btn { cursor: pointer; }
.file-input {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.sound.over { outline: 2px dashed var(--amber); background: rgba(245, 185, 66, 0.12); }
#sounds { flex: 1; }
.upload-msg { min-height: 0; color: var(--amber); font-size: 13px; }
.upload-msg:empty { display: none; }
.upload-msg { padding: 10px 18px 0; }

.admin { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 0; }
.admin > aside {
  border-right: 1px solid var(--line);
  background: #12151b;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.aside-head { display: block; padding: 16px 14px 8px; }
.aside-head p { margin: 6px 0 0; font-size: 13px; }
.cat-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cat {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.cat.active { background: var(--amber-dim); border-color: rgba(245, 185, 66, 0.35); }
.cat.drop { outline: 2px dashed var(--amber); }
.cat input { width: 100%; }
.grip {
  width: 28px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.grip:active { cursor: grabbing; }
.dragging { opacity: 0.45; pointer-events: none; }
.new-cat { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.new-cat input { flex: 1; }
.editor-wrap { padding: 0 0 24px; }
#editor { padding: 16px 18px 0; }
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: var(--raised);
  border: 1px solid var(--line);
  box-shadow: inset 3px 0 0 var(--c, var(--amber));
}
.card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.card-head input { width: 100%; }
.colors { display: flex; gap: 6px; }
.colors button {
  width: 18px;
  height: 18px;
  border-radius: 99px;
  border: 2px solid transparent;
  padding: 0;
}
.colors button.on { border-color: white; }
.card-row { display: flex; align-items: center; gap: 8px; }
.card-row input[type="range"] { flex: 1; }
.vol-name, .vol-label { color: var(--muted); font-size: 12px; }
.vol-label { width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.icon-danger { color: #ffd0d0; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 16px;
}
.modal.hidden { display: none; }
.dialog {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 16px;
  background: #1b2029;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.dialog h2 { letter-spacing: 0.14em; }
.dialog input { width: 100%; }
#toasts {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 30;
  width: min(440px, calc(100% - 24px));
}
.toast {
  padding: 10px 12px;
  border-radius: 10px;
  background: #243024;
  border: 1px solid rgba(61, 214, 140, 0.35);
}
.toast.bad { background: #3a1e1e; border-color: rgba(255, 107, 107, 0.45); }
.banner { padding: 16px; }

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate-box {
  width: min(360px, 100%);
  display: grid;
  gap: 20px;
}
.gate form {
  display: grid;
  gap: 12px;
}
.gate-downloads {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.gate-downloads-lead {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.gate-download {
  height: 44px;
  font-size: 15px;
  text-decoration: none;
  display: grid;
  place-items: center;
}
.gate-link {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}
.gate-link:hover { color: var(--text); }
.gate input {
  height: 64px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #1c212b;
  font-size: 28px;
  text-align: center;
  letter-spacing: 0.28em;
}
.gate .btn { height: 52px; font-size: 18px; }
.note { min-height: 1.2em; margin: 0; color: var(--danger); text-align: center; }

.home-wrap {
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 28px 18px;
}
.home-grid {
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 148px;
  width: 100%;
  padding: 22px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #171b22;
  text-align: left;
  text-decoration: none;
}
form.choice { padding: 0; }
form.choice button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 148px;
  padding: 22px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  text-align: left;
}
.choice:hover, form.choice button:hover { background: #1e2430; }
.choice strong { font-size: 22px; }
.choice span { color: var(--muted); line-height: 1.4; }
.choice.wide { grid-column: 1 / -1; min-height: 0; }
.cam-panel {
  width: min(880px, 100%);
  padding: 18px 22px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #171b22;
}
.cam-panel strong { font-size: 22px; }
.cam-panel p { margin: 8px 0 0; }
.cam-panel ul { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); }
.cam-panel li { margin-top: 4px; }
.docs {
  width: min(46rem, 100%);
  margin: 0 auto;
  padding: 28px 20px 80px;
}
.docs h1 { font-size: 2rem; margin: 8px 0 10px; }
.docs h2 { margin: 2.1rem 0 0.4rem; scroll-margin-top: 16px; }
.docs p, .docs li { color: var(--muted); line-height: 1.55; }
.docs a { color: var(--amber); }
.docs strong { color: var(--text); }
.docs code { color: var(--amber); }
.docs pre {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  overflow: auto;
}
.docs pre code { color: var(--text); }
.docs nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.docs nav a {
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 12px;
}
.lock { justify-self: center; }

.beheer-app { grid-template-rows: auto minmax(0, 1fr); }
.beheer {
  display: grid;
  grid-template-columns: 280px minmax(280px, 1fr) 420px;
  min-height: 0;
}
.col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}
.col:last-child { border-right: 0; }
.col-scroll, .detail { overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.stack { display: grid; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.stack-label { color: var(--muted); font-size: 13px; margin-top: 6px; }
input.field {
  width: 100%;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #1c212b;
  padding: 0 14px;
  font-size: 18px;
}
.btn-row { display: flex; gap: 8px; }
.btn-row .btn, .btn-row label.btn { flex: 1; }
.btn.icon { width: 40px; flex: 0 0 40px; padding: 0; }
.line, .sound {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 0;
  background: #171b22;
  text-align: left;
}
.sound { width: 100%; box-shadow: inset 4px 0 0 var(--c, var(--amber)); }
.line.on, .sound.on, .line:hover, .sound:hover { background: #202530; }
.line-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
  border: 0;
  text-align: left;
  padding: 0;
}
.detail h2 {
  margin: 14px 0 0;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail .btn { height: 44px; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(140px, 38dvh); }
  .now { border-left: 0; border-top: 1px solid var(--line); }
  .admin { grid-template-columns: 1fr; grid-template-rows: minmax(180px, 42dvh) minmax(0, 1fr); }
  .admin > aside { border-right: 0; border-bottom: 1px solid var(--line); }
  input[type="search"] { width: 130px; }
  .home-grid, .beheer { grid-template-columns: 1fr; }
  .beheer { grid-template-rows: auto auto auto; }
  .col { border-right: 0; border-bottom: 1px solid var(--line); }
  .col-scroll { max-height: 42dvh; }
}
