:root {
  --red: #ea360e;
  --red-soft: #2a1210;
  --red-mid: rgba(234, 54, 14, 0.28);
  --bg: #111111;
  --bg-2: #181818;
  --bg-3: #1f1f1f;
  --line: #2a2a2a;
  --text: #f2f1ec;
  --muted: #9a9890;
  --ok: #6fbf7a;
  --warn: #d4a84b;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.35;
}
button, input { font: inherit; color: inherit; }
button {
  cursor: pointer;
  border: 0;
  background: none;
  text-align: left;
}
img { display: block; max-width: 100%; }
strong, b { font-weight: 700; }

.shell {
  height: 100svh;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

/* ── top bar ── */
.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 56px;
  padding: 0 1rem;
  background: #0d0d0d;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.brand img { height: 1.2rem; width: auto; }

.top-live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  min-width: 0;
}
.top-live strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(234, 54, 14, 0.22);
  flex-shrink: 0;
}
body.is-offair .dot {
  background: #555;
  box-shadow: none;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.btn-air {
  height: 36px;
  padding: 0 0.9rem;
  border-radius: 6px;
  background: var(--red);
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.btn-air.is-off {
  background: var(--bg-3);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-air span { display: none; }

.seg {
  display: inline-flex;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.seg button {
  height: 36px;
  padding: 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.is-on {
  background: var(--red-soft);
  color: var(--text);
}

.pulse {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.45rem;
}
.pulse.is-live { color: var(--ok); }
.pulse.is-lag { color: var(--warn); }
.user {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner {
  margin: 0;
  padding: 0.55rem 1rem;
  background: var(--red-soft);
  color: #ffb5a6;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.banner.is-error { background: #2a1414; color: #ff9d9d; }

.toast {
  margin: 0;
  padding: 0.7rem 1rem;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  animation: toast-in 0.25s ease;
}
@keyframes toast-in {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* beeld strip — full width, not in sidebar */
.beeld-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  background: #0f0f0f;
  border-bottom: 1px solid var(--line);
}
.beeld-bar button {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.beeld-bar button strong {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}
.beeld-bar button span {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.beeld-bar button.is-on {
  background: var(--red-soft);
  border-color: var(--red);
  box-shadow: inset 0 -3px 0 var(--red);
}

/* ── main layout: wide presets · chat · slim requests ── */
.layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1.6fr) minmax(240px, 280px);
  overflow: hidden;
}

.rail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #141414;
  border-right: 1px solid var(--line);
  overflow: auto;
}

.block {
  padding: 0.85rem 1rem 1rem;
  border-bottom: 1px solid var(--line);
}
.block--grow {
  flex: 1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.block--streams { flex-shrink: 0; }
.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}
.block h2 {
  margin: 0 0 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.block-head h2 { margin: 0; }

/* old stacked beeld removed — now .beeld-bar */

/* presets — roomy, no overlap */
.djs {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.adm-dj {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.adm-dj.is-live {
  background: var(--red-soft);
  border-color: var(--red-mid);
}
.adm-dj-go {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  width: 100%;
  padding: 0;
  border-radius: 8px;
}
.adm-dj img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #000;
}
.adm-dj-go span {
  min-width: 0;
  font-weight: 700;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adm-dj small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--red);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.adm-dj-tools {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-left: 56px;
}
.adm-dj-tools button {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #121212;
}
.adm-dj-tools button:hover {
  color: var(--text);
  border-color: #555;
}

.new-dj {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.new-dj p {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.new-dj input[type="text"],
.adm-reply input,
.air-card input {
  width: 100%;
  height: 38px;
  padding: 0 0.7rem;
  background: #0c0c0c;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.new-dj input:focus,
.adm-reply input:focus,
.air-card input:focus {
  outline: none;
  border-color: #555;
}
.file {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.row { display: flex; gap: 0.35rem; }
.btn {
  height: 36px;
  padding: 0 0.85rem;
  border-radius: 6px;
  background: var(--red);
  font-weight: 700;
  font-size: 0.88rem;
}
.btn--ghost {
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* streams compact */
.streams {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.air-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
}
.air-card.is-off { opacity: 0.45; }
.air-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.air-card header strong {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.air-card header button,
.air-actions button {
  height: 26px;
  padding: 0 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.7rem;
  color: var(--muted);
}
.air-card form {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.air-card input { height: 32px; font-size: 0.85rem; }
.air-actions { display: flex; gap: 0.3rem; }
.air-actions button:first-child {
  background: var(--red);
  border-color: transparent;
  color: var(--text);
  font-weight: 700;
}

/* ── panels ── */
.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--line);
}
.panel--reqs { border-right: 0; }
.panel-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
  background: #141414;
}
.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  animation: badge-pop 0.35s ease;
}
@keyframes badge-pop {
  from { transform: scale(0.7); }
  to { transform: scale(1); }
}

.mode {
  max-width: 9rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.mode b, .mode span { display: block; }
.mode b {
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: -0.02em;
}
.mode span {
  margin-top: 0.08rem;
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.2;
}
.mode.is-auto {
  background: var(--red-soft);
  border-color: var(--red-mid);
}

/* chat */
.chat {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
}
.chat-list {
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #151515;
  padding: 0.4rem;
}
.adm-person {
  position: relative;
  display: block;
  width: 100%;
  padding: 0.7rem 0.65rem;
  border-radius: 8px;
  margin-bottom: 0.2rem;
}
.adm-person:hover { background: var(--bg-3); }
.adm-person.is-open {
  background: var(--red-soft);
  box-shadow: inset 0 0 0 1px var(--red-mid);
}
.adm-person.is-unread {
  background: rgba(234, 54, 14, 0.12);
  box-shadow: inset 3px 0 0 var(--red);
}
.adm-person.is-unread strong { color: #fff; }
.adm-person .unread-dot {
  position: absolute;
  top: 0.75rem;
  right: 0.65rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.adm-person strong {
  display: block;
  font-size: 0.92rem;
  padding-right: 1.4rem;
}
.adm-person small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-thread {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem 1rem;
}
.chat-thread > header {
  flex-shrink: 0;
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.chat-thread > header strong {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.chat-thread > header small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.adm-msgs {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-right: 0.2rem;
}
.adm-msg {
  margin: 0;
  max-width: 78%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px 10px 10px 3px;
  background: var(--bg-3);
  font-size: 0.92rem;
  line-height: 1.4;
  word-break: break-word;
}
.adm-msg.is-studio {
  align-self: flex-end;
  background: var(--red);
  border-radius: 10px 10px 3px 10px;
}
.adm-reply {
  flex-shrink: 0;
  display: flex;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.adm-reply input { flex: 1; height: 42px; font-size: 0.95rem; }
.adm-reply button {
  height: 42px;
  padding: 0 1.1rem;
  border-radius: 6px;
  background: var(--red);
  font-weight: 700;
}

/* requests — compact slim column */
.reqs {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.adm-req {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0.45rem 0.55rem;
  align-items: start;
  padding: 0.5rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.adm-req img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 5px;
  background: #000;
  grid-row: 1 / span 2;
}
.adm-req strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.2;
}
.adm-req em {
  display: block;
  margin-top: 0.08rem;
  font-style: normal;
  color: var(--muted);
  font-size: 0.75rem;
}
.adm-req small {
  display: block;
  grid-column: 2;
  color: var(--muted);
  font-size: 0.68rem;
}
.adm-req.is-done { display: none; }
.adm-req.is-queued {
  border-color: var(--red);
  background: var(--red-soft);
}
.adm-req.is-unmatched small { color: var(--warn); }
.adm-req.is-dismissed { display: none; }
.adm-req-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.adm-req-actions button {
  height: 28px;
  padding: 0 0.55rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  background: var(--red);
}
.adm-req-actions button + button {
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 600;
}

.empty, .adm-empty {
  margin: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 26ch;
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: minmax(280px, 300px) minmax(0, 1fr) minmax(220px, 250px);
  }
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 280px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(240px, 34vh);
  }
  .panel--reqs {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }
  .chat { grid-template-columns: 170px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .shell { height: auto; min-height: 100svh; overflow: visible; }
  .layout {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .rail, .panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .rail { max-height: none; overflow: visible; }
  .panel--chat, .panel--reqs { min-height: 420px; }
  .chat { grid-template-columns: 1fr; }
  .chat-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 140px;
  }
  .beeld-bar { grid-template-columns: 1fr; }
  .top {
    flex-wrap: wrap;
    height: auto;
    padding: 0.65rem 0.75rem;
  }
  .top-actions { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .user { display: none; }
}
