:root {
  color-scheme: dark;
  --bg: #0f0f10;
  --surface: #1a1a19;
  --surface-2: #232322;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #8f8e88;
  --grid: rgba(255, 255, 255, 0.07);
  --series-1: #3987e5; /* server / viewers */
  --series-2: #d95926; /* peers */
  --live: #e5484d;
  --ring: rgba(255, 255, 255, 0.85);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { margin: 0; font-weight: 600; }
h1 { font-size: 20px; letter-spacing: -0.01em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); }

button, input { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.muted { color: var(--muted); font-size: 13px; }

/* ---------- login ---------- */

.login { min-height: calc(var(--vh, 1vh) * 100); display: grid; place-items: center; padding: 16px; }
.card {
  width: min(380px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card .sub { margin: -4px 0 8px; color: var(--muted); }
.card label { font-size: 13px; color: var(--text-2); }
.card input {
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.card button {
  height: 44px;
  margin-top: 6px;
  border: 0;
  border-radius: 10px;
  background: var(--text);
  color: #111;
  font-weight: 600;
  cursor: pointer;
}
.card .err {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(229, 72, 77, 0.12);
  color: #ff9ea1;
  font-size: 14px;
}

/* ---------- header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(15, 15, 16, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.ttl { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ttl h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tools form { margin: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.on { color: var(--text); }
.pill.on::before { background: var(--live); }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.seg button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
}
.seg button[aria-selected="true"] { background: var(--surface-2); color: var(--text); }

.ghost {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}
.ghost:hover { color: var(--text); background: var(--surface); }

/* ---------- dashboard ---------- */

.dash {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.dash > section > h2 { margin-bottom: 12px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 92px;
}
.tile .k { font-size: 13px; color: var(--text-2); }
.tile .v { margin-top: 6px; font-size: 28px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile .v small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.tile .d { margin-top: 2px; font-size: 12px; color: var(--muted); }
.live .tile { background: linear-gradient(180deg, var(--surface-2), var(--surface)); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
}
.ph { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }

.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.chart { position: relative; height: 240px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .empty { fill: var(--muted); font-size: 13px; }

.tip {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #2b2b2a;
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.tip b { display: block; margin-bottom: 4px; color: var(--text); font-weight: 600; }
.tip .row { display: flex; align-items: center; gap: 6px; }
.tip .row i { width: 8px; height: 8px; border-radius: 2px; }
.tip .row em { margin-left: auto; padding-left: 12px; font-style: normal; color: var(--text); font-variant-numeric: tabular-nums; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .now { color: var(--text); font-weight: 600; }
td .now::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--live);
  vertical-align: 1px;
}

@media (max-width: 640px) {
  .top { padding: 12px 16px; }
  .dash { padding: 16px; gap: 22px; }
  .tile .v { font-size: 24px; }
  .chart { height: 200px; }
}

/* ---------- superadmin extras ---------- */

select.ghost { appearance: none; -webkit-appearance: none; padding-right: 28px; max-width: 220px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23c3c2b7' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center; }
select.ghost option { background: var(--surface); color: var(--text); }
.search {
  height: 34px; width: min(260px, 100%); padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px;
}
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 11px;
  background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.on { color: var(--text); }
.tag.on::before { background: var(--live); }
button.link { border: 0; padding: 0; background: none; color: var(--text); font-weight: 600; cursor: pointer; text-align: left; }
button.link:hover { text-decoration: underline; }
.slug { font-size: 12px; color: var(--muted); }
.ghost.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.panel .tablewrap { max-height: 560px; overflow: auto; }
.panel thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }

/* ---------- studio ---------- */

.studio-body { min-height: calc(var(--vh, 1vh) * 100); }
.golive {
  height: 36px; padding: 0 16px; border: 0; border-radius: 10px;
  background: var(--live); color: #fff; font-weight: 650; cursor: pointer;
}
.golive.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--live); }
.golive:disabled { opacity: 0.5; cursor: default; }
.banner { max-width: 1440px; margin: 12px auto 0; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.banner.err { background: rgba(229, 72, 77, 0.14); color: #ffb3b5; }
.banner + .studio { padding-top: 12px; }

.studio { max-width: 1440px; margin: 0 auto; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 18px; }

.monitors { display: grid; grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr); gap: 14px; align-items: center; }
.mon { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mon-h { display: flex; align-items: center; gap: 10px; min-height: 22px; font-size: 13px; }
.mon canvas { width: 100%; aspect-ratio: 16 / 9; height: auto; display: block; background: #000; border-radius: 8px; }
.mon:first-child canvas { box-shadow: 0 0 0 2px #2fb36b; }
.mon:last-child canvas { box-shadow: 0 0 0 2px var(--live); }
.tag.pv { color: #8ee2b2; }
.tag.pv::before { background: #2fb36b; }
.tag.pg { color: #ffb3b5; }
.tag.pg::before { background: var(--live); }

.switcher { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.trs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.trs button {
  height: 30px; border: 1px solid var(--border); border-radius: 8px; background: transparent;
  color: var(--text-2); font-size: 13px; cursor: pointer;
}
.trs button[aria-checked="true"] { background: var(--surface-2); color: var(--text); border-color: rgba(255,255,255,0.22); }
.trs button:last-child { grid-column: 1 / -1; }
.small { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.switcher select, .field select, .field input, .ov input[type="text"], .small select {
  height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14px; width: 100%;
}
.take {
  height: 64px; border: 0; border-radius: 12px; background: var(--text); color: #111;
  font-size: 18px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer;
}
.take:disabled { opacity: 0.35; cursor: default; }

.scenes-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.scenes { display: flex; gap: 8px; flex-wrap: wrap; }
.scene {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 10px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  cursor: pointer; font-size: 14px;
}
.scene svg, .lay svg { width: 32px; height: 20px; fill: currentColor; flex: none; }
.scene.is-pv { box-shadow: inset 0 0 0 2px #2fb36b; color: var(--text); }
.scene.is-pg { box-shadow: inset 0 0 0 2px var(--live); color: var(--text); }
.scene.is-pv.is-pg { box-shadow: inset 0 0 0 2px var(--live), 0 0 0 2px #2fb36b; }

.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.panels.two { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.panels .panel { padding: 14px 16px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2.end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.ghost.danger:hover { color: #ffb3b5; border-color: rgba(229, 72, 77, 0.5); }
.ghost:disabled { opacity: 0.4; cursor: default; }

.layouts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.lay {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px;
  border-radius: 9px; border: 1px solid var(--border); background: transparent; color: var(--muted);
  font-size: 11px; cursor: pointer; text-align: center; line-height: 1.2;
}
.lay.on { color: var(--text); background: var(--surface-2); border-color: rgba(255,255,255,0.22); }

.add-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sources { display: flex; flex-direction: column; gap: 8px; }
.src { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; background: var(--bg); }
.thumb {
  width: 96px; aspect-ratio: 16 / 9; flex: none; border-radius: 6px; overflow: hidden; background: #000;
  display: grid; place-items: center; color: var(--muted);
}
.thumb video, .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb svg { width: 22px; height: 22px; }
.meta { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.meta b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ov { padding: 10px 0; border-bottom: 1px solid var(--border); }
.ov:first-child { padding-top: 0; }
.ov:last-child { border-bottom: 0; padding-bottom: 0; }
.ov-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.ov-b { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.ov-b.col { flex-direction: column; align-items: stretch; }
.ov-b .small { flex: 1 1 120px; }
.ov input[type="range"], .fader input { width: 100%; accent-color: var(--text); }
.switch {
  width: 40px; height: 22px; border-radius: 11px; border: 0; padding: 0; background: var(--surface-2);
  position: relative; cursor: pointer; flex: none;
}
.switch i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: left 0.15s ease, background 0.15s ease; }
.switch.on { background: var(--live); }
.switch.on i { left: 21px; background: #fff; }

.mixer { display: flex; flex-direction: column; gap: 10px; }
.ch { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr) minmax(0, 220px); gap: 12px; align-items: center; }
.ch-h { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.ch-h b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.ch[data-ch="master"] { padding-top: 10px; border-top: 1px solid var(--border); }
.mute {
  height: 24px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); background: transparent;
  color: var(--text-2); font-size: 12px; cursor: pointer; flex: none;
}
.mute.on { background: var(--live); color: #fff; border-color: var(--live); }
.meter { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: #2fb36b; transition: width 60ms linear; }
.meter i.hot { background: #e8b11c; }
.meter i.clip { background: var(--live); }
.fader { display: flex; align-items: center; gap: 8px; }
.db { width: 64px; flex: none; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.link-ro {
  display: block; padding: 9px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border);
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text);
  word-break: break-all; user-select: all;
}
.warn-box { margin: 0; padding: 9px 10px; border-radius: 8px; background: rgba(232, 177, 28, 0.12); color: #f2d27a; font-size: 13px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.stats .muted { grid-column: 1 / -1; margin: 0; }
.stat { padding: 8px 10px; border-radius: 8px; background: var(--bg); display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.stat b { font-size: 15px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

dialog#pick { padding: 0; border: 0; background: transparent; color: var(--text); }
dialog#pick::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog#pick .card button[value="ok"] { margin: 0; padding: 0 16px; }
dialog#pick .card .ghost { margin: 0; height: 44px; }

@media (max-width: 1100px) {
  .monitors { grid-template-columns: 1fr; }
  .switcher { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
  .trs { grid-template-columns: repeat(5, auto); }
  .trs button:last-child { grid-column: auto; }
  .take { height: 44px; padding: 0 28px; }
  .panels, .panels.two { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .studio { padding: 16px; }
  .ch { grid-template-columns: 1fr; gap: 6px; }
}
.save-state { font-size: 13px; white-space: nowrap; }

/* ---------- embed & widgets ---------- */

.embeds { display: flex; flex-direction: column; gap: 14px; }
.emb { padding: 14px 16px 16px; }
.emb-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.emb textarea.code, .emb input.code {
  width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical;
}
.emb input.code { height: 36px; }
.emb .field select { height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; }
.emb-act { display: flex; align-items: center; gap: 10px; margin: -2px 0 12px; }
.copied { font-size: 12px; }
.note { margin: 4px 0 0; font-size: 12px; }
.emb-prev { min-height: 180px; border-radius: 10px; background: var(--bg); border: 1px dashed var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; }
.emb-prev .muted { font-size: 12px; margin: 0; }
.emb-frame { position: relative; width: 100%; padding-top: 56.25%; border-radius: 8px; overflow: hidden; background: #000; }
.emb-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.badge-prev { display: flex; align-items: center; justify-content: center; min-height: 120px; border-radius: 10px; background: #2a2a29; }
.badge-prev.light { background: #ffffff; }
@media (max-width: 800px) { .emb-grid { grid-template-columns: 1fr; } }
.badge-prev iframe { color-scheme: normal; }

/* ---------- viewer locations ---------- */

.geo-map { padding: 12px 16px 14px; margin-bottom: 14px; }
.seg.sm button { height: 26px; font-size: 13px; padding: 0 10px; }
.map { position: relative; width: 100%; }
.map svg { display: block; width: 100%; height: auto; }
.map .land { fill: #2c2c2b; stroke: var(--surface); stroke-width: 0.6; }
.map .land.has { fill: var(--series-1); }
.map .land:hover { fill: #3a3a39; }
.map .land.has:hover { fill-opacity: 1 !important; }
.map .dot { fill: var(--series-1); fill-opacity: 0.78; stroke: var(--surface); stroke-width: 1.5; cursor: default; }
.map .dot:hover { fill-opacity: 1; }
.geo-tables { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.geo-tables .panel { padding: 14px 16px 10px; }
table.rank td { padding: 7px 8px; vertical-align: top; }
table.rank th { padding: 6px 8px; }
.rk-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; color: var(--text); }
.rk-bar { margin-top: 5px; height: 4px; border-radius: 2px; background: var(--bg); overflow: hidden; }
.rk-bar i { display: block; height: 100%; background: var(--series-1); border-radius: 2px; }
.credit { margin: 10px 0 0; font-size: 12px; }
.credit a { color: var(--text-2); }
@media (max-width: 1000px) { .geo-tables { grid-template-columns: 1fr; } .rk-name { max-width: none; } }
.geo-tables .panel { overflow-x: auto; }
@media (max-width: 640px) {
  table.rank td, table.rank th { padding-left: 4px; padding-right: 4px; }
  .geo-tables .panel { padding: 12px 10px 8px; }
}

/* chat embed preview */
.chat-prev { height: 380px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); }
.chat-prev.light { background: #fff; }
.chat-prev iframe { width: 100%; height: 100%; border: 0; color-scheme: normal; }

/* ---------- phone call-in ---------- */
.panels .phone-panel { grid-column: 1 / -1; }
.phone-panel .ph-right { display: flex; align-items: center; gap: 8px; }
.ph-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14px; color: var(--text-2); margin-bottom: 10px; }
.ph-info b { color: var(--text); }
.ph-pin { font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.ph-max input { width: 64px; height: 30px; margin-left: 6px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.ph-flash { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: rgba(229, 72, 77, 0.12); color: #ffb3b5; font-size: 14px; }
.calls { display: flex; flex-direction: column; gap: 8px; }
.call {
  display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(200px, 1.4fr) auto; gap: 8px 14px; align-items: center;
  padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border);
}
.call.s-ready { border-color: rgba(47, 179, 107, 0.45); }
.call.mine { border-color: rgba(57, 135, 229, 0.6); }
.call.s-air { border-color: var(--live); box-shadow: inset 3px 0 0 var(--live); }
.c-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.c-num { font-variant-numeric: tabular-nums; }
.c-cid { color: var(--text-2); font-size: 13px; }
.c-wait { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.c-badge { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); }
.c-badge.b-ready { background: rgba(47, 179, 107, 0.18); color: #7bd88f; }
.c-badge.b-screening { background: rgba(57, 135, 229, 0.2); color: #8fbfff; }
.c-badge.b-air { background: var(--live); color: #fff; }
.c-badge.b-ivr { color: var(--muted); }
.c-prem { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; background: linear-gradient(180deg, #ffc451, #ffb224); color: #1a1300; }
.c-mid { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.c-note { flex: 1; min-width: 140px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; }
.c-live { display: flex; align-items: center; gap: 8px; flex-basis: 100%; }
.c-live .meter { flex: 1; }
.c-vol { width: 110px; }
.c-act { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.air-btn { height: 28px; padding: 0 10px; border-radius: 8px; border: 0; background: var(--live); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.ph-blocked { margin-top: 12px; font-size: 14px; color: var(--text-2); }
.ph-blocked summary { cursor: pointer; }
.ph-blocked ul { list-style: none; margin: 8px 0 0; padding: 0; }
.ph-blocked li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.screener { padding: 16px 24px 24px; max-width: 1000px; }
.screener .panel { padding: 14px 16px 16px; }
#phonePanel .did, #phoneRows .did { height: 32px; width: 180px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
@media (max-width: 860px) {
  .call { grid-template-columns: 1fr; }
  .c-act { justify-content: flex-start; }
  .screener { padding: 12px 16px; }
}
.phone-form .pf-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.phone-form .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.phone-form .field input { height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; }
.phone-form .field .muted { font-size: 12px; }
.phone-form .pf-pair { display: flex; gap: 8px; }
.phone-form .pf-pair input { width: 110px; }
.phone-form .pf-pair select { height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; }
.phone-form .pf-act { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
#phoneRows td:has(.ch) { white-space: nowrap; }
#phoneRows .lim { width: 72px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); text-align: right; }
#phoneRows .chk { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 1100px) { .phone-form .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .phone-form .pf-grid { grid-template-columns: 1fr; } }

/* ---------- broadcaster editor (superadmin) ---------- */
#streamsPanel .ph-right { display: flex; align-items: center; gap: 8px; }
td.acts { white-space: nowrap; }
td.acts .ghost + .ghost { margin-left: 6px; }
.bc-dialog { width: min(860px, calc(calc(var(--vw, 1vw) * 100) - 32px)); max-height: calc(calc(var(--vh, 1vh) * 100) - 32px); padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); }
.bc-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.bc-form { padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.bc-head { display: flex; align-items: baseline; gap: 10px; }
.bc-form h2 { margin-top: 10px; }
.bc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.bc-grid .wide { grid-column: span 3; }
.bc-form .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.bc-form .field input, .bc-form .field textarea { padding: 0 10px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.bc-form .field textarea { height: auto; padding: 8px 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; resize: vertical; }
.bc-form .field input[readonly] { color: var(--muted); }
.bc-form .field .muted { font-size: 12px; }
.bc-form .chk-field .chk { display: flex; align-items: center; gap: 8px; height: 36px; color: var(--text); }
.bc-err { margin: 4px 0 0; color: #ffb3b5; font-size: 14px; }
.bc-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.bc-save { height: 36px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--series-1); color: #fff; font-weight: 600; cursor: pointer; }
.bc-save:disabled { opacity: 0.5; }
.bc-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: calc(calc(var(--vw, 1vw) * 100) - 32px); padding: 10px 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); font-size: 14px; }
@media (max-width: 700px) { .bc-grid { grid-template-columns: 1fr; } .bc-grid .wide { grid-column: auto; } }
.bc-form .chk input[type="checkbox"] { width: 18px; height: 18px; padding: 0; margin: 0; flex: none; accent-color: var(--series-1); }

/* ---------- studio soundboard ---------- */
.panels .sb-panel { grid-column: 1 / -1; }
.sb-panel .ph-right { display: flex; align-items: center; gap: 8px; }
.sb-panel.drop { outline: 2px dashed var(--series-1); outline-offset: -6px; }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pad { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.pad-hit {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 2px;
  height: 78px; padding: 8px 10px; border: 0; border-radius: 9px; cursor: pointer; text-align: left; overflow: hidden;
  background: color-mix(in srgb, var(--pad) 22%, var(--surface-2)); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pad) 45%, transparent);
}
.pad-hit:hover { background: color-mix(in srgb, var(--pad) 32%, var(--surface-2)); }
.pad-hit:active { transform: scale(0.98); }
.pad.on .pad-hit { background: color-mix(in srgb, var(--pad) 55%, var(--surface-2)); box-shadow: inset 0 0 0 2px var(--pad); }
.pad-key { position: absolute; top: 6px; right: 8px; font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pad-name { font-weight: 600; font-size: 14px; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pad-len { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pad-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, 0.25); }
.pad-prog i { display: block; height: 100%; width: 0; background: var(--pad); }
.pad:not(.on) .pad-prog i { width: 0 !important; }
.pad-ctl { display: flex; align-items: center; gap: 4px; }
.pad-vol { flex: 1; min-width: 0; }
.pad-btn { width: 26px; height: 26px; flex: none; border-radius: 7px; border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.pad-btn:hover { color: var(--text); background: var(--surface); }
.pad-btn.on { color: #fff; background: var(--series-1); border-color: var(--series-1); }
.pad-btn.danger:hover { color: #ffb3b5; border-color: rgba(229, 72, 77, 0.5); }
.sb-uploads { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.sb-uploads:empty { display: none; }
.sb-up { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 6px 10px; border-radius: 8px; background: var(--bg); }
.sb-up.error { color: #ffb3b5; background: rgba(229, 72, 77, 0.1); }
.sb-up span:not(.spin) { flex: 1; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--series-1); animation: sbspin 0.8s linear infinite; flex: none; }
@keyframes sbspin { to { transform: rotate(360deg); } }
.sb-hint { margin: 10px 0 0; font-size: 12px; }
.bc-wowza { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bc-wowza .muted { font-size: 12px; }

/* ---------- live tools (bitrate, recording, TV status) ---------- */
.banner.warn { background: rgba(232, 177, 28, 0.14); color: #f5d27a; border-color: rgba(232, 177, 28, 0.4); }
body > .banner.warn { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 40; max-width: calc(calc(var(--vw, 1vw) * 100) - 32px); }
.live-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.lt-h { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); }
.lt-v { font-size: 20px; font-weight: 600; }
.lt-v.bad { color: #ff8a8d; }
.lt-act { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.rec-btn.on { color: #fff; background: var(--live); border-color: var(--live); }
.bc-toast.bad { border-color: rgba(229, 72, 77, 0.6); color: #ffb3b5; }
.bc-toast[hidden] { display: none; }
.usage { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; min-width: 120px; flex: 1; max-width: 240px; }
.usage i { display: block; height: 100%; width: 0; background: var(--series-1); }
.usage-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tg-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.tg-form .bc-grid .wide2 { grid-column: span 2; }
.tg-form .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.tg-form .field input { height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; }
#recPanel, #targetsPanel { padding: 14px 16px 16px; }
@media (max-width: 860px) { .live-tools { grid-template-columns: 1fr; } .tg-form .bc-grid .wide2 { grid-column: auto; } }

/* ---------- TV station ---------- */
.tvs { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 14px; padding: 16px 24px 24px; align-items: start; position: relative; }
.tv-side { display: flex; flex-direction: column; gap: 14px; }
.tvs .panel { padding: 14px 16px 16px; }
.tvs .panel .ph-right { display: flex; align-items: center; gap: 8px; }
.tvs .panel.drop { outline: 2px dashed var(--series-1); outline-offset: -6px; }
.tv-media, .tv-pls, .tv-items { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.tv-m, .tv-pl, .tv-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 8px; padding: 7px 8px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); font-size: 13px; }
.tv-m[draggable="true"], .tv-pl, .tv-item { cursor: grab; }
.tv-m.s-failed { border-color: rgba(229, 72, 77, 0.45); }
.tv-m.s-processing .tv-m-st, .tv-m.s-uploading .tv-m-st { color: #8fbfff; }
.tv-m-name, .tv-pl-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-m-st { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tv-m-err { grid-column: 1 / -1; color: #ffb3b5; font-size: 12px; }
.tv-m-act { display: flex; gap: 3px; }
.tv-pl { grid-template-columns: auto minmax(0, 1fr) auto; }
.tv-pl.sel { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.tv-sw { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.tv-item { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.tv-grip { color: var(--muted); letter-spacing: -2px; }
.tv-items.over { outline: 2px dashed var(--series-1); outline-offset: 2px; border-radius: 8px; }
.tv-drop-hint { padding: 18px; text-align: center; border: 1px dashed var(--border); border-radius: 8px; margin: 0; }
.tv-ed-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.tv-ed-row input { height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; }
.tv-colors { display: flex; gap: 6px; }
.tv-c { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.tv-c.on { border-color: var(--text); }
.tv-hint { margin: 8px 0 0; font-size: 12px; }
.tv-cal-panel { min-width: 0; }
.tv-cal { height: calc(calc(var(--vh, 1vh) * 100) - 190px); min-height: 480px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.tv-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(110px, 1fr)); min-width: 830px; }
.tv-dh { position: sticky; top: 0; z-index: 3; height: 34px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--text-2); background: var(--surface); border-bottom: 1px solid var(--border); }
.tv-day.today .tv-dh { color: var(--text); box-shadow: inset 0 -2px 0 var(--series-1); }
.tv-hours .tv-dh { left: 0; z-index: 4; }
.tv-hr { height: 48px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.tv-hr:first-of-type { transform: none; }
.tv-day { border-left: 1px solid var(--border); }
.tv-col { position: relative; }
.tv-slot { height: 48px; border-bottom: 1px solid var(--grid); }
.tv-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--live); z-index: 2; pointer-events: none; }
.tv-block {
  position: absolute; left: 3px; right: 3px; z-index: 1; overflow: hidden; padding: 3px 6px; border-radius: 6px; cursor: grab; touch-action: none;
  background: color-mix(in srgb, var(--c) 30%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); font-size: 12px; line-height: 1.25; user-select: none;
}
.tv-block b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-block span { color: var(--text-2); font-size: 11px; white-space: nowrap; }
.tv-block.clash { box-shadow: inset 3px 0 0 var(--c), 0 0 0 2px var(--live); }
.tv-block.live { box-shadow: inset 3px 0 0 var(--live), 0 0 0 1px var(--live); }
.tv-block.dragging { opacity: 0.85; z-index: 5; cursor: grabbing; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); }
.tv-pop { position: absolute; z-index: 20; width: 290px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; gap: 8px; }
.tv-pop h3 { margin: 0; font-size: 15px; }
.tv-pop .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.tv-pop input, .tv-pop select { height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; color-scheme: dark; }
.tv-pop p { margin: 0; font-size: 12px; }
.tv-prev-dlg { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); width: min(860px, calc(calc(var(--vw, 1vw) * 100) - 32px)); }
.tv-prev-dlg::backdrop { background: rgba(0, 0, 0, 0.7); }
.tv-prev-dlg video { width: 100%; border-radius: 8px; background: #000; display: block; margin-bottom: 8px; }
.tv-prev-dlg form { display: flex; justify-content: flex-end; }
@media (max-width: 980px) { .tvs { grid-template-columns: 1fr; padding: 12px 16px; } }
[hidden] { display: none !important; }

/* ---------- studio tabs: fits one screen ---------- */
.studio-body:has(.studio.tabbed) { height: calc(var(--vh, 1vh) * 100); height: calc(var(--vh, 1vh) * 100); display: flex; flex-direction: column; overflow: hidden; }
.studio-body > .banner { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 40; width: min(900px, calc(calc(var(--vw, 1vw) * 100) - 32px)); margin: 0; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.studio.tabbed { flex: 1; min-height: 0; width: 100%; padding: 12px 24px 14px; gap: 10px; }
.studio.tabbed .monitors { flex: none; }
.studio.tabbed .mon canvas { max-height: calc(var(--vh, 1vh) * 38); object-fit: contain; }
.studio.tabbed .scenes-row { flex: none; }
.stabs { flex: none; display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); overflow-x: auto; }
.stabs [role="tab"] { position: relative; height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 14px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.stabs [role="tab"]:hover { color: var(--text); }
.stabs [role="tab"][aria-selected="true"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
.tab-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--live); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.tabpanes { flex: 1; min-height: 0; overflow-y: auto; }
.tabpanes .pane > .panel { padding: 14px 16px 16px; }
@media (max-width: 900px), (max-height: 620px) {
  .studio-body:has(.studio.tabbed) { height: auto; overflow: visible; display: block; }
  .studio.tabbed .mon canvas { max-height: none; }
  .tabpanes { overflow: visible; }
}

/* ---------- superadmin server meters ---------- */
.sys { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sys-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.sys-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.sys-h b { font-size: 20px; color: var(--text); letter-spacing: 0; }
.sys-bar { height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; }
.sys-bar i { display: block; height: 100%; background: #2fb36b; transition: width 0.4s ease; }
.sys-bar.warn i { background: #e8b11c; }
.sys-bar.crit i { background: var(--live); }
.sys-card .muted { font-size: 12px; line-height: 1.5; }
.sys-cores { display: flex; gap: 3px; height: 34px; align-items: flex-end; margin-top: 2px; }
.sys-core { flex: 1; max-width: 18px; height: 100%; border-radius: 3px; background: var(--bg); display: flex; align-items: flex-end; overflow: hidden; }
.sys-core i { display: block; width: 100%; background: #2fb36b; transition: height 0.4s ease; }
.sys-core.warn i { background: #e8b11c; }
.sys-core.crit i { background: var(--live); }
.sb-grid > p { grid-column: 1 / -1; margin: 0; }

/* ---------- headphones: monitor + cue ---------- */
.hp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 4px 0 12px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.hp-vol { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.hp-vol input { width: 140px; }
.hp-warn { font-size: 13px; color: #f5d27a; background: rgba(232, 177, 28, 0.12); border: 1px solid rgba(232, 177, 28, 0.35); padding: 4px 10px; border-radius: 8px; }
.mute.cue.on, .mute.mon.on { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.ch { grid-template-columns: minmax(0, 240px) minmax(0, 1fr) minmax(0, 220px); }
.tv-block.loop { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, var(--surface)) 0 10px, color-mix(in srgb, var(--c) 22%, var(--surface)) 10px 20px); }
.pop-chk { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.pop-chk input { width: 16px; height: 16px; accent-color: var(--series-1); }

/* studio source rows: video play controls and chroma key */
.src-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.src-ctl .mute.on { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.src-ctl .vtime { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
.src-ctl .keyopts { display: inline-flex; align-items: center; gap: 6px; }
.src-ctl input[type="color"] { width: 30px; height: 24px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }

/* outside encoder (OBS) details: studio Output tab and superadmin broadcaster editor */
.enc-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.enc-box h3 { margin: 0 0 4px; font-size: 14px; }
.enc-box > p { margin: 0 0 10px; font-size: 13px; }
.enc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.copyrow { display: flex; gap: 6px; align-items: center; }
.copyrow input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.pf-sub { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.bc-note { margin: 0 0 10px; font-size: 13px; }
.bc-dialog .enc-grid { margin-bottom: 10px; }

/* Discord & API panels */
.integrations { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.int-col h3 { margin: 0 0 6px; font-size: 14px; }
.int-col > p { font-size: 13px; margin: 0 0 10px; }
.int-col code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.int-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.int-row input { flex: 1; min-width: 180px; }
.int-state { font-size: 13px; margin: 0 0 4px; }
.int-msg { display: block; min-height: 1.2em; margin-top: 6px; font-size: 12.5px; }
.int-msg.bad { color: var(--live); }
.int-new { padding: 10px; border-radius: 8px; background: var(--bg); margin-bottom: 10px; font-size: 13px; display: grid; gap: 6px; }
.int-keys td, .int-keys th { font-size: 12.5px; }
.bc-danger { padding: 10px; border-radius: 8px; border: 1px solid rgba(229,72,77,0.35); }
.tv-rec-dlg { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; width: min(560px, calc(calc(var(--vw, 1vw) * 100) - 32px)); }
.tv-rec-dlg::backdrop { background: rgba(0, 0, 0, 0.6); }
.tv-rec-dlg h2 { margin: 0 0 4px; font-size: 1.05rem; }
.tv-rec-list { max-height: calc(var(--vh, 1vh) * 60); overflow: auto; margin: 12px 0; display: grid; gap: 6px; }
.tv-rec { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.tv-rec-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-rec .muted { grid-column: 1; font-size: 0.85em; }
.tv-rec button { grid-column: 2; grid-row: 1 / span 2; }
.rec-auto { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; cursor: pointer; }
.rec-auto input { width: auto; margin: 0; }
.ads-admin .ads-set { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.ads-admin .ads-set .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.ads-admin .ads-set input, .ads-admin .ads-set select { height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; }
.ads-admin .ads-set input[type=number] { width: 110px; }
.ads-admin .ads-hint { margin: 10px 0; }
.ads-admin .ads-add { display: flex; gap: 8px; margin-bottom: 10px; }
.ads-admin .ads-text { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ads-admin .ads-text input { flex: 1 1 220px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.ads-admin .ad-in { height: 30px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 13px; min-width: 0; width: 100%; max-width: 260px; }
.ads-admin .ad-in.wide { display: block; max-width: 420px; margin-top: 4px; }
.ads-admin .ad-in.num { width: 70px; }
.ads-admin .ad-thumb { display: block; max-width: 240px; max-height: 60px; margin-top: 4px; border-radius: 4px; border: 1px solid var(--border); background: #000; }
.ads-admin td .muted { margin-left: 6px; font-size: 12px; }
.ads-admin .ad-on { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ads-admin .ad-on input { width: auto; margin: 0; }
.bc-ads { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.bc-ads .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.bc-ads .field input { width: 90px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.bc-ads .chk { display: inline-flex; align-items: center; gap: 6px; height: 34px; }
.bc-ads .chk input { width: auto; margin: 0; }
.ads-admin .ads-range { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; }
.ads-admin .ads-range select { height: 30px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.ads-admin .ads-count { margin-left: auto; }
.ph-audio { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.ph-audio .pa-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); min-width: 220px; flex: 1 1 220px; }
.ph-audio select { height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 13px; }
.ph-audio .pa-lvl { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; font-size: 13px; }
.ph-audio .pa-lvl .meter { flex: 1 1 80px; min-width: 60px; }
.ph-audio .pa-lvl input[type=range] { width: 110px; }
.ph-audio .ghost.on { color: #ffb3b5; border-color: rgba(229, 72, 77, 0.5); }
.ph-audio .pa-note { flex-basis: 100%; font-size: 12px; }

/* ---------- storage (one total per broadcaster) ---------- */
.storage-panel .st-head { font-size: 14px; margin-bottom: 8px; }
.storage-panel .st-bar { display: flex; height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; border: 1px solid var(--border); }
.storage-panel .st-bar i { display: block; height: 100%; }
.storage-panel .st-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.storage-panel .st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.storage-panel .st-legend b { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.storage-panel .st-note { margin: 10px 0 0; font-size: 12px; }
.st-0 { background: #3987e5; } .st-1 { background: #d95926; } .st-2 { background: #2fa36b; } .st-3 { background: #b46bd6; } .st-4 { background: #d4a72c; } .st-5 { background: #25b5b0; }
.storage-line { margin: -4px 0 8px; font-size: 13px; color: var(--text-2); }
.storage-line.full-up, .storage-panel.full-up .st-head { color: #e5484d; }

/* icons (sprite on the studio pages; harmless elsewhere) */
.ic { width: 18px; height: 18px; flex: none; }

/* staff accounts and roles (dashboard) */
.staff-admin h3 { margin: 16px 0 8px; font-size: 14px; }
.staff-admin code { user-select: all; }
.staff-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; margin: 10px 0; }
.staff-role-form .field { max-width: 320px; }
.staff-admin .row-act { display: flex; gap: 8px; }
.staff-admin td input:not([type=checkbox]), .staff-admin td select { width: 100%; min-width: 120px; }
.staff-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; }
.staff-add .field { margin: 0; min-width: 160px; }
.staff-admin .chk { display: inline-flex; align-items: center; gap: 6px; }
.staff-admin td { white-space: normal; }
.staff-admin td.num { white-space: nowrap; }

/* superadmin: phone number portals */
.numbers-admin h3 { margin: 8px 0; font-size: 14px; }
.numbers-admin .small { font-size: 12.5px; }
.numbers-admin code { user-select: all; }
.num-set { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 8px 0; }
.num-add, .num-assign { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0; }
.num-add .field { flex: 1; min-width: 240px; margin: 0; }
.num-add textarea { width: 100%; font-family: ui-monospace, monospace; }
.num-assign .field { margin: 0; min-width: 180px; }
.num-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 8px; }
.num-tabs .ghost.on { border-color: var(--text); color: var(--text); }
.num-tabs input[type=search] { margin-left: auto; }
.num-acts { white-space: nowrap; text-align: right; }
.num-acts .ghost + .ghost { margin-left: 4px; }
.num-st { font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--border); white-space: nowrap; }
.num-st.st-assigned { color: #7bd88f; border-color: rgba(123, 216, 143, 0.5); }
.num-st.st-reserved { color: #e8b11c; border-color: rgba(232, 177, 28, 0.5); }
.num-st.st-disabled { color: var(--muted); }
.num-st.st-air { color: #fff; background: var(--live); border-color: var(--live); }
.num-hist ul { margin: 0; padding-left: 18px; font-size: 12.5px; }
.numbers-admin .chk { display: inline-flex; align-items: center; gap: 6px; }
.numbers-admin p code { display: inline; white-space: normal; padding: 0 3px; }

/* superadmin: users */
.users-admin .usr-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.users-admin .usr-head h3 { margin: 0; font-size: 16px; }
.users-admin h4 { margin: 18px 0 6px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.users-admin h4 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.usr-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.usr-facts dt { color: var(--muted); }
.usr-facts dd { margin: 0; }

/* ---------- superadmin: traffic, referral links, main site announcements/events, SEO ---------- */
.tr-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.tr-two .panel { padding: 14px 16px 10px; margin: 0; min-width: 0; overflow-x: auto; }
.tr-two .rk-name { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart.tr-min { height: 150px; }
#refBox code { font-size: 12.5px; color: var(--text-2); }
.ref-form { margin-bottom: 12px; }
.news-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--bg); }
.news-item .pf-act { margin-top: 8px; justify-content: flex-end; }
.phone-form .news-wide, .phone-form .seo-wide { grid-column: span 2; }
.phone-form .field textarea { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; resize: vertical; }
.news-item .field textarea, .news-item .field input, .news-item .field select { background: var(--surface); }
.phone-form .field select { height: 36px; }
.req-mail { margin-bottom: 12px; }
#annPanel > .muted, #evPanel > .muted { margin: 0 0 12px; font-size: 13px; }
@media (max-width: 1000px) {
  .tr-two { grid-template-columns: 1fr; }
  .phone-form .news-wide, .phone-form .seo-wide { grid-column: auto; }
}
.tile.tr-ref .v { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .tr-two .rk-name { max-width: 180px; } }
#visPanel .ph { gap: 12px; }
#visPanel .ph .search { margin-left: auto; }
table.vis td { white-space: nowrap; }
table.vis .vis-row { cursor: pointer; }
table.vis .vis-row.open td { background: rgba(57, 135, 229, 0.08); }
table.vis .vis-pages td { white-space: normal; background: var(--bg); }
.journey { margin: 4px 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.journey .j-visit { list-style: none; margin: 6px 0 2px -22px; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ---------- captions ---------- */
.cc-langs > div { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.cc-langs label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text); }
.cc-live { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; font-size: 13px; }
.cc-live .cc-st { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); min-width: 0; overflow-wrap: anywhere; }
.cc-live .cc-st b { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.cc-spoken { display: flex; flex-direction: column; gap: 4px; max-width: 280px; margin-top: 4px; font-size: 13px; color: var(--text-2); }
@media (max-width: 1000px) { .cc-live { grid-template-columns: 1fr; } }
.ch .cc-name { display: flex; flex-direction: column; gap: 3px; margin: 2px 0 6px; font-size: 11px; color: var(--muted); }
.ch .cc-name input { height: 26px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 12.5px; min-width: 0; }
.staff-perms { display: block; columns: 3 260px; column-gap: 18px; }
.staff-perms .chk { display: flex; break-inside: avoid; margin-bottom: 6px; }
.staff-perms .chk.sub { padding-left: 24px; font-size: 13px; color: var(--text-2); }

/* superadmin: domain and VMs */
.dom-info { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 13px; }
.dom-log { margin: 10px 0 0; max-height: 260px; overflow: auto; background: #0b0d10; border: 1px solid var(--border, #2a2e36); border-radius: 6px; padding: 8px 10px; font: 12px/1.45 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
.vm-bc-h { display: flex; align-items: center; gap: 12px; margin: 16px 0 8px; }
.vm-bc-h input { max-width: 260px; }
#linksPanel { margin-top: 12px; }
.lk-url { display: flex; gap: 6px; align-items: center; min-width: 320px; }
.lk-url input { flex: 1; min-width: 0; height: 30px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 12px; }
.gm-key { margin: 4px 0 10px; max-width: 760px; }
.gm-steps { margin: 0 0 8px; padding-left: 20px; line-height: 1.6; }
