:root {
  --bg: #0e0e10;
  --panel: #18181b;
  --panel2: #1f1f23;
  --line: #2f2f35;
  --text: #efeff1;
  --muted: #adadb8;
  --accent: #9147ff;
  --accent-hover: #772ce8;
  --red: #eb0400;
  --nav-h: 50px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: #bf94ff; }
button, input, select { font: inherit; color: inherit; }

/* Top bar */

.nav {
  height: var(--nav-h);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: relative;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--accent);
  position: relative;
  flex: none;
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  width: 12px;
  height: 8px;
  border-radius: 2px;
  background: #fff;
}

.crumb { color: var(--muted); font-weight: 400; font-size: 14px; padding-left: 10px; border-left: 1px solid var(--line); }

.nav-right { display: flex; align-items: center; gap: 14px; }

.pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.pill.live { background: var(--red); color: #fff; }
.pill.off { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }

/* Buttons and fields */

.btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 0 14px;
  height: 36px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.ghost { background: rgba(255, 255, 255, 0.1); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.18); }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #c40300; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.big { height: 40px; padding: 0 22px; font-size: 15px; }

input[type="text"], input[type="password"], input[type="number"], input:not([type]), select {
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 4px;
  height: 36px;
  padding: 0 10px;
  width: 100%;
  outline: none;
}
input:hover, select:hover { border-color: #4a4a52; }
input:focus, select:focus { border-color: var(--accent); }
input[type="color"] { width: 34px; height: 30px; padding: 0; border: 2px solid var(--line); background: var(--bg); border-radius: 4px; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

/* Viewer page */

.layout {
  display: flex;
  height: calc(100vh - var(--nav-h));
}

.main { flex: 1; min-width: 0; overflow-y: auto; }

.stage {
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - var(--nav-h) - 96px);
  width: 100%;
  position: relative;
  margin: 0 auto;
}

.player, .offline { position: absolute; inset: 0; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }

.offline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: var(--panel);
}
.offline h1 { margin: 0 0 8px; font-size: 28px; }
.offline p { margin: 0; color: var(--muted); max-width: 440px; }
.offline .small { margin-top: 18px; font-size: 12px; }
.offline .avatar { width: 84px; height: 84px; font-size: 34px; margin-bottom: 18px; border-color: var(--line); }

.corner { position: absolute; left: 12px; top: 12px; }

.controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 26px 12px 10px;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.15s;
}
.player:hover .controls, .player:focus-within .controls { opacity: 1; }
.controls .grow { flex: 1; }
.icon-btn {
  background: none;
  border: 0;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.2); }
.controls input[type="range"] { width: 90px; accent-color: var(--accent); }

.unmute {
  position: absolute;
  left: 12px;
  bottom: 60px;
}

.info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.avatar {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  background: var(--panel2);
  border: 3px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  text-transform: uppercase;
}
.avatar.on { border-color: var(--red); }
.info-text { min-width: 0; flex: 1; }
.channel { font-weight: 700; font-size: 16px; }
.title { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { text-align: right; color: var(--muted); font-size: 13px; white-space: nowrap; }
.stats b { color: var(--text); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 6px; }

/* Chat */

.chat {
  width: 340px;
  flex: none;
  background: var(--panel);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-head {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex: none;
}
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  min-height: 0;
}
.msg {
  padding: 4px 12px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  position: relative;
}
.msg:hover { background: rgba(255, 255, 255, 0.05); }
.msg.sys { color: var(--muted); font-size: 13px; }
.msg-name { font-weight: 700; }
.msg-colon { color: var(--text); }
.badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: 1px;
}
.mod { display: none; position: absolute; right: 6px; top: 2px; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; }
.msg:hover .mod { display: flex; }
.mod button { background: none; border: 0; color: var(--muted); padding: 2px 8px; font-size: 12px; cursor: pointer; }
.mod button:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

.chat-foot { padding: 12px; flex: none; border-top: 1px solid var(--line); }
.chat-foot form { display: flex; flex-direction: column; gap: 8px; }
.chat-foot .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.linkbtn { background: none; border: 0; padding: 0; color: #bf94ff; cursor: pointer; font-size: 12px; }
.linkbtn:hover { text-decoration: underline; }
.chat-foot.locked { opacity: 0.5; pointer-events: none; }

/* Center screens (admin gate and setup) */

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.box {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.box h1 { font-size: 20px; margin: 4px 0 0; }
.box p { margin: 0; color: var(--muted); }
.box textarea {
  width: 100%;
  height: 92px;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font: 12px/1.5 Consolas, monospace;
  padding: 8px;
  resize: none;
}
.err { color: #ff6b6b !important; min-height: 20px; }

/* Studio */

.studio {
  display: flex;
  height: calc(100vh - var(--nav-h));
}
.studio-main { flex: 1; min-width: 0; overflow-y: auto; padding: 16px; }
.preview { position: relative; background: #000; max-width: 960px; }
.preview canvas { width: 100%; display: block; aspect-ratio: 16 / 9; touch-action: none; cursor: default; }
.golive { display: flex; gap: 10px; margin: 12px 0 6px; max-width: 960px; }
.statusline { color: var(--muted); font-size: 13px; margin-bottom: 14px; min-height: 20px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  max-width: 1200px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.card .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hint { margin: 0; color: var(--muted); font-size: 12px; }

.meter { flex: 1; min-width: 60px; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg button {
  background: var(--panel2);
  border: 2px solid var(--line);
  border-radius: 4px;
  height: 36px;
  cursor: pointer;
  font-weight: 600;
}
.seg button:hover { border-color: #4a4a52; }
.seg button.on { border-color: var(--accent); background: rgba(145, 71, 255, 0.18); }

.ov {
  display: grid;
  grid-template-columns: 18px 1fr 56px 34px 130px 18px 26px;
  gap: 6px;
  align-items: center;
}
.ov input[type="text"], .ov input:not([type]), .ov input[type="number"] { height: 30px; padding: 0 6px; }
.ov select { height: 30px; padding: 0 6px; font-size: 12px; }
@media (max-width: 700px) {
  .ov { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: var(--panel2); border-radius: 6px; }
  .ov input[type="text"] { flex: 1 1 100%; }
  .ov input[type="number"] { width: 64px; }
  .ov select { width: 140px; }
}
.ov .x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.ov .x:hover { color: #fff; }

.studio .chat { width: 340px; }

/* Small screens */

@media (max-width: 900px) {
  .studio { flex-direction: column; height: auto; }
  .studio-main { overflow: visible; }
  /* On the viewer page, keep everything on one screen: the video area can scroll if it
     needs to, but the chat below it always keeps its message box reachable, with no
     need to scroll the whole page just to find where to type. */
  .layout {
    flex-direction: column;
    overflow: hidden;
  }
  .main { flex: 0 1 auto; max-height: 46vh; max-height: 46dvh; overflow-y: auto; }
  .stage { max-height: 34vh; max-height: 34dvh; }
  .chat { width: 100%; border-left: 0; border-top: 1px solid var(--line); flex: 1 1 auto; min-height: 0; }
  .chat-list { -webkit-overflow-scrolling: touch; }
  .crumb { display: none; }
  .golive { flex-direction: column; }
}

.card input[type="range"] { width: 100%; accent-color: var(--accent); }

.badge.green { background: #00a86b; }

/* Stage bar and mod panel on the public page */
.bar {
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--panel);
}
.bar .grow { flex: 1; min-width: 160px; }
.bar b { font-weight: 700; }
.stagelist { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.stagelist .item { display: flex; align-items: center; gap: 8px; }
.stagelist .item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; width: 100%; }

/* Admin side panel tabs, people and stage */
.tabs { display: flex; height: 50px; border-bottom: 1px solid var(--line); flex: none; }
.tabs button {
  flex: 1;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.count { display: inline-block; margin-left: 6px; background: var(--red); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; }

.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pane.scroll { overflow-y: auto; padding: 12px; gap: 10px; display: block; }
.pane.scroll > * { margin-bottom: 10px; }
.pane .mini { margin-top: 6px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

.person { border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: var(--panel2); }
.person .top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.person .nm { font-weight: 700; margin-right: 2px; overflow-wrap: anywhere; }
.athandle { color: var(--muted); font-size: 12px; margin-right: 2px; }
.tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; padding: 1px 5px; border-radius: 3px; background: var(--line); color: var(--text); }
.tag.ok { background: #00a86b; }
.tag.onstage { background: var(--accent); }
.tag.bad { background: var(--red); }
.person .acts { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.person .acts .btn { height: 26px; padding: 0 8px; font-size: 12px; }
.person .acts select { height: 26px; width: auto; padding: 0 4px; font-size: 12px; border-width: 1px; }
.permgrid { margin-top: 8px; display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; align-items: center; font-size: 13px; }
.permgrid select { height: 26px; width: auto; padding: 0 4px; font-size: 12px; border-width: 1px; }
.empty { color: var(--muted); font-size: 13px; }

/* Welcome screen that asks for sound and microphone */
.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(14, 14, 16, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gate-card h1 { margin: 6px 0 0; font-size: 22px; }
.gate-card p { margin: 0; color: var(--muted); }
.gate-card .btn { width: 100%; }

/* Tags, profile card, polls, coins */
.tagicon { width: 18px; height: 18px; border-radius: 3px; vertical-align: -4px; margin-right: 5px; object-fit: cover; }
.badge.grey { background: #4a4a55; }
.msg.clickable { cursor: pointer; }

.pf-ov { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; padding: 20px; }
.pf-card { width: 100%; max-width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; gap: 6px; max-height: 90vh; overflow-y: auto; }
.pf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.pf-name { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.pf-x { background: rgba(255,255,255,0.1); border: 0; border-radius: 4px; color: var(--text); padding: 4px 10px; cursor: pointer; }
.pf-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; margin-top: 8px; }
.pf-line { font-size: 15px; }
.pf-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-tag { display: inline-flex; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; font-size: 13px; }
.pf-tag .tagicon { margin-right: 6px; vertical-align: 0; }
.pf-none { color: var(--muted); font-size: 13px; }
.pf-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pf-row input { flex: 1; min-width: 80px; }

.coinchip { color: #f5c542; font-weight: 700; font-size: 12px; margin: 0 4px; }

.pollbox { flex-direction: column; align-items: stretch; }
.poll-q { font-weight: 700; font-size: 16px; }
.poll-meta { color: var(--muted); font-size: 13px; }
.poll-opts { display: flex; flex-direction: column; gap: 6px; }
.poll-opt { display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; cursor: pointer; }
.poll-opt input { flex: none; }
.poll-bar { position: relative; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; overflow: hidden; }
.poll-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(145, 71, 255, 0.35); }
.poll-bar.right i { background: rgba(0, 200, 120, 0.4); }
.poll-bar span { position: relative; display: flex; justify-content: space-between; gap: 8px; }
.poll-actions { display: flex; gap: 8px; }
.modpoll { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.modpoll textarea { background: var(--bg); border: 2px solid var(--line); border-radius: 4px; color: var(--text); padding: 6px 8px; font: inherit; resize: vertical; min-height: 70px; }

.gate-card input[type="text"] { height: 44px; font-size: 16px; }
.tagrow { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 8px; align-items: center; }
.tagrow img, .tagrow .noicon { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--panel2); border: 1px solid var(--line); }
.optrow { display: grid; grid-template-columns: 1fr auto 26px; gap: 6px; align-items: center; }
.optrow label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.pollstat { border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: var(--panel2); display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 900px) {
  .info { flex-wrap: wrap; }
  #stageBtn { order: 5; width: 100%; }
}


/* ===== Streamer page: navigation and panels ===== */

.mtabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin: 4px 0 16px;
  overflow-x: auto;
  max-width: 1200px;
  scrollbar-width: none;
}
.mtabs::-webkit-scrollbar { display: none; }
.mtabs button {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 16px;
  cursor: pointer;
  white-space: nowrap;
}
.mtabs button:hover { color: var(--text); }
.mtabs button.on { color: var(--text); border-bottom-color: var(--accent); }

.panel { display: none; max-width: 1200px; }
.panel.on { display: block; }
.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  align-items: start;
}
.card.wide { grid-column: 1 / -1; }
.card { gap: 12px; }
.card .field, .fold-body .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.fhead { display: flex; justify-content: space-between; align-items: baseline; }
.fhead output { color: var(--text); font-weight: 700; }
.sub { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.seg-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; color: var(--muted); margin: 2px 0 8px; }
#sceneSeg .seg { margin-bottom: 16px; }
#sceneSeg .seg button { height: 46px; }
#sceneSeg .seg:last-child { margin-bottom: 0; }

/* collapsible sections */
.fold { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 12px; }
.fold summary { list-style: none; cursor: pointer; padding: 14px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before {
  content: "";
  width: 7px; height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
  flex: none;
}
.fold[open] > summary::before { transform: rotate(45deg); }
.fold summary small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: auto; }
.fold-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.card .fold { background: var(--panel2); margin: 0; }

/* ===== Custom controls that match the theme ===== */

/* checkboxes (squares) */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  flex: none;
  margin: 0;
  border: 2px solid #55555e;
  border-radius: 4px;
  background: var(--bg);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
input[type="checkbox"]:hover { border-color: #77777f; }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
input[type="checkbox"]:focus-visible { outline: 2px solid #bf94ff; outline-offset: 2px; }
input[type="checkbox"]:disabled { opacity: 0.5; cursor: default; }

/* on/off switches for settings rows */
.studio label.check {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 0;
}
.studio label.check > span { display: flex; flex-direction: column; gap: 2px; }
.studio label.check > span small { color: var(--muted); font-size: 12px; }
.studio label.check > input[type="checkbox"] {
  position: relative;
  display: block;
  width: 40px;
  height: 22px;
  border: 0;
  border-radius: 11px;
  background: #3a3a44;
}
.studio label.check > input[type="checkbox"]:hover { background: #4a4a55; }
.studio label.check > input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  transform: none;
  transition: transform 0.15s;
}
.studio label.check > input[type="checkbox"]:checked { background: var(--accent); }
.studio label.check > input[type="checkbox"]:checked::after { transform: translateX(18px); }

.pick { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }

/* sliders */
.studio input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
  --p: 50%;
}
.studio input[type="range"]:focus { outline: none; }
.studio input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background-color: var(--line);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: var(--p) 100%;
}
.studio input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
}
.studio input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
.studio input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
.studio input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }
.studio input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid #bf94ff; outline-offset: 2px; }

/* dropdowns */
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23adadb8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select option { background: var(--panel); color: var(--text); }
.person .acts select, .permgrid select { padding-right: 22px; background-position: right 7px center; }

@media (max-width: 900px) {
  .mtabs { margin-top: 0; }
}

/* radio buttons to match */
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  flex: none;
  margin: 0;
  border: 2px solid #55555e;
  border-radius: 50%;
  background: var(--bg);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}
input[type="radio"]:checked { border-color: var(--accent); }
input[type="radio"]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* keep the controls in view: the preview never takes over the whole screen */
.preview { max-width: clamp(420px, calc((100vh - 300px) * 16 / 9), 960px); }
.golive { max-width: clamp(420px, calc((100vh - 300px) * 16 / 9), 960px); }
.mtabs { position: sticky; top: -16px; background: var(--bg); z-index: 4; padding-top: 4px; }

/* right-click menu */
.ctx {
  position: fixed;
  z-index: 80;
  min-width: 210px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
}
.ctx button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.ctx button:hover { background: rgba(255, 255, 255, 0.1); }
.ctx button.danger { color: #ff8a8a; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.stagerow { cursor: default; user-select: none; }
.stagerow .more { margin-left: auto; background: rgba(255,255,255,0.1); border: 0; color: var(--text); border-radius: 4px; padding: 2px 8px; font-size: 12px; cursor: pointer; }
.stagerow .more:hover { background: rgba(255,255,255,0.18); }
.tag.hand { background: #f5c542; color: #1a1a1a; }

/* spotlight bar */
.spot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; max-width: clamp(420px, calc((100vh - 300px) * 16 / 9), 960px); }
.spot-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; color: var(--muted); }
.spot-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.spotbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 2px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
}
.spotbtn:hover { border-color: #4a4a52; }
.spotbtn.on { border-color: var(--accent); background: rgba(145, 71, 255, 0.18); }
.spotbtn kbd { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font: 700 11px/18px Consolas, monospace; color: var(--muted); }

/* custom emojis and stickers */
.emoji { height: 24px; width: auto; vertical-align: -7px; margin: 0 1px; }
.sticker { display: block; max-width: 150px; max-height: 150px; margin-top: 6px; border-radius: 6px; }
.inrow { display: flex; gap: 6px; }
.inrow input { flex: 1; min-width: 0; }
.chat-foot { position: relative; }
.picker {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 100%;
  margin-bottom: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  z-index: 20;
  max-height: 300px;
  display: flex;
  flex-direction: column;
}
.pk-tabs { display: flex; border-bottom: 1px solid var(--line); }
.pk-tabs button { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; padding: 10px; cursor: pointer; }
.pk-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.pk-grid { padding: 8px; overflow-y: auto; display: grid; gap: 6px; }
.pk-grid.emoji { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
.pk-grid.sticker { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.pk-note { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding: 12px 4px; text-align: center; }
.pk { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pk:hover { border-color: var(--accent); }
.pk img { max-width: 100%; max-height: 64px; }
.pk-grid.emoji .pk img { height: 30px; width: 30px; object-fit: contain; }

.drop { border: 2px dashed #4a4a52; border-radius: 8px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(145, 71, 255, 0.1); color: var(--text); }
.egrid { display: flex; flex-direction: column; gap: 8px; }
.erow { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; }
.erow .thumb { width: 56px; height: 56px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.erow .thumb img { max-width: 100%; max-height: 100%; }

/* themed dropdowns */
.dd { position: relative; width: 100%; }
.dd-btn {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 0 12px;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.dd-btn:hover { border-color: #4a4a52; }
.dd-btn:focus-visible, .dd-btn.open { border-color: var(--accent); outline: none; }
.dd-btn:disabled { opacity: 0.5; cursor: default; }
.dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chev { width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); flex: none; }
.dd-btn.open .dd-chev { transform: rotate(-135deg) translate(-2px, -2px); }
.dd.sm { width: auto; min-width: 100px; }
.dd.sm .dd-btn { height: 28px; font-size: 12px; padding: 0 8px; border-width: 1px; }
.dd-menu {
  position: fixed;
  z-index: 85;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
  max-height: 300px;
  overflow-y: auto;
}
.dd-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.dd-menu button:hover, .dd-menu button:focus { background: rgba(255, 255, 255, 0.1); outline: none; }
.dd-menu button.on { color: #bf94ff; font-weight: 700; }

/* picture viewer */
.lb { position: fixed; inset: 0; z-index: 95; background: rgba(0, 0, 0, 0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; cursor: zoom-out; padding: 20px; }
.lb img { max-width: 94vw; max-height: 80vh; min-width: min(70vmin, 600px); object-fit: contain; border-radius: 8px; }
.lb-cap { color: #fff; font-size: 16px; font-weight: 700; }
.lb-hint { color: var(--muted); font-size: 12px; }
.zoom { cursor: zoom-in; }
.chatimg { display: block; max-width: 100%; max-height: 220px; margin-top: 6px; border-radius: 6px; }

/* people tab */
.psearch { padding: 10px 12px 0; }
.person .more { margin-left: auto; background: rgba(255,255,255,0.1); border: 0; color: var(--text); border-radius: 4px; padding: 2px 8px; font-size: 12px; cursor: pointer; }
.person .more:hover { background: rgba(255,255,255,0.18); }
.person.you { border-color: var(--accent); }
.person .acts .btn.on { background: var(--accent); color: #fff; }
.sect { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }

/* bigger, clearer emoji and sticker picker */
.picker { height: 380px; max-height: 72vh; }
.pk-search { margin: 8px 8px 0; width: calc(100% - 16px); height: 34px; }
.pk-grid { flex: 1; min-height: 0; align-content: start; grid-auto-rows: max-content; gap: 8px; padding: 10px; }
.pk-grid.emoji { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); }
.pk-grid.sticker { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); }
.pk { min-height: 54px; padding: 8px; flex-direction: column; gap: 4px; }
.pk-grid.emoji .pk img { width: 38px; height: 38px; }
.pk-grid.sticker .pk { min-height: 100px; }
.pk-grid.sticker .pk img { max-height: 80px; }
.pk-name { font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* clips */
.golive .btn.big { flex: none; }
.clipadmin { display: flex; flex-direction: column; gap: 12px; }
.cl-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--panel2); }
.cl-thumb { width: 160px; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; overflow: hidden; }
.cl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cl-title { font-weight: 700; margin-bottom: 2px; }
.cl-by { display: inline-flex; align-items: center; color: var(--text); font-weight: 600; }
.cl-comments { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.cl-comment { font-size: 13px; }
@media (max-width: 600px) { .cl-row { grid-template-columns: 1fr; } .cl-thumb { width: 100%; } }

/* site tabs and the clips page */
.sitetabs { display: flex; gap: 2px; background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 12px; }
.sitetabs button { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; padding: 12px 16px; cursor: pointer; }
.sitetabs button:hover { color: var(--text); }
.sitetabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.layout { height: calc(100vh - var(--nav-h) - 47px); }
@media (max-width: 900px) {
  .layout { height: calc(100vh - var(--nav-h) - 47px); height: calc(100dvh - var(--nav-h) - 47px); }
}

.clipsview { padding: 16px; max-width: 1200px; margin: 0 auto; }
.clips-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.clips-head h2 { margin: 0; }
.clips-tools { display: flex; gap: 8px; align-items: center; }
.clips-tools .dd { width: 150px; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 10px; }
.clip-card { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0 0 10px; cursor: pointer; color: var(--text); overflow: hidden; }
.clip-card:hover { border-color: var(--accent); }
.clip-thumb { position: relative; aspect-ratio: 16 / 9; background: #000; }
.clip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clip-len { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 4px; z-index: 1; }
.clip-title { font-weight: 700; padding: 8px 10px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-by { padding: 2px 10px 0; }
.clip-meta { padding: 2px 10px 0; color: var(--muted); font-size: 12px; }

.cm { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, 0.8); display: flex; align-items: center; justify-content: center; padding: 14px; }
.cm-box { width: 100%; max-width: 900px; max-height: 96vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cm-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.cm-title { font-size: 18px; font-weight: 700; }
.cm-by { color: var(--muted); margin-top: 2px; }
.cm-video { position: relative; background: #000; border-radius: 8px; aspect-ratio: 16 / 9; }
.cm-video video { width: 100%; height: 100%; display: block; border-radius: 8px; }
.cm-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.cm-actions { display: flex; align-items: center; gap: 12px; }
.cm-actions .btn.on { background: #d6337a; }
.cm-comments { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.cm-comment { font-size: 14px; overflow-wrap: anywhere; }
.cm-when { color: var(--muted); font-size: 12px; margin-left: 8px; }
.cm-form { display: flex; gap: 8px; }
.cm-form input { flex: 1; }
.cl-by { display: inline-flex; align-items: center; font-weight: 600; color: var(--text); }

/* clip video player */
.vp { position: relative; background: #000; border-radius: 8px; aspect-ratio: 16 / 9; overflow: hidden; }
.vp:fullscreen { border-radius: 0; aspect-ratio: auto; }
.vp video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; cursor: pointer; }
.vp-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); pointer-events: none; }
.vp-big { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; background: rgba(0, 0, 0, 0.65); border: 0; display: none; align-items: center; justify-content: center; cursor: pointer; }
.vp-big svg { width: 38px; height: 38px; fill: #fff; }
.vp.paused .vp-big { display: flex; }
.vp-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 8px; background: rgba(0, 0, 0, 0.62); transition: opacity 0.2s; }
.vp.idle:not(.paused) .vp-bar { opacity: 0; }
.vp.idle:not(.paused) { cursor: none; }
.vp-row { display: flex; align-items: center; gap: 6px; }
.vp-grow { flex: 1; }
.vp-btn { min-width: 34px; height: 34px; background: none; border: 0; color: #fff; cursor: pointer; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.vp-btn:hover { background: rgba(255, 255, 255, 0.18); }
.vp-btn svg { width: 22px; height: 22px; fill: #fff; }
.vp-text { font-size: 13px; font-weight: 700; }
.vp-btn.on { color: #bf94ff; }
.vp-time { color: #fff; font-size: 13px; margin-left: 6px; white-space: nowrap; }
.vp input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; --p: 0%; }
.vp input[type="range"]:focus { outline: none; }
.vp-seek { width: 100%; height: 16px; }
.vp-vol { width: 84px; height: 22px; --p: 100%; }
.vp input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background-color: rgba(255, 255, 255, 0.3); background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-size: var(--p) 100%; }
.vp input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -4.5px; border-radius: 50%; background: #fff; border: 0; }
.vp input[type="range"]::-moz-range-track { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.3); }
.vp input[type="range"]::-moz-range-progress { height: 5px; border-radius: 3px; background: var(--accent); }
.vp input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
@media (max-width: 600px) { .vp-vol { display: none; } }

/* gifts */
.msg.giftmsg { border: 1px solid; border-radius: 12px; margin: 4px 0; padding: 7px 10px; }
.giftpill { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 700; margin-left: 2px; }
.giftpanel {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 100%;
  margin-bottom: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
.gp-head { display: flex; align-items: center; gap: 10px; }
.gp-coin { width: 38px; height: 38px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: #f5c542; color: #7a5a00; font-weight: 800; font-size: 18px; border: 3px solid #c99a10; box-sizing: border-box; }
.gp-ttl { flex: 1; min-width: 0; }
.gp-title { font-weight: 700; font-size: 16px; }
.gp-sub { color: var(--muted); font-size: 12px; }
.gp-bal { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; color: #f5c542; font-weight: 700; font-size: 13px; white-space: nowrap; }
.gp-quick { display: flex; gap: 6px; }
.gp-quick button { flex: 1; background: var(--panel2); border: 2px solid var(--line); border-radius: 999px; color: var(--text); height: 34px; font-weight: 700; cursor: pointer; }
.gp-quick button:hover { border-color: #f5c542; }
.gp-quick button.on { border-color: #f5c542; background: rgba(245, 197, 66, 0.15); color: #f5c542; }
.gp-amtrow { position: relative; }
.gp-amtrow input { width: 100%; box-sizing: border-box; background: var(--bg); border: 2px solid var(--line); border-radius: 14px; color: var(--text); font: inherit; font-size: 20px; font-weight: 700; padding: 8px 70px 8px 14px; }
.gp-amtrow input:focus { border-color: var(--accent); outline: none; }
.gp-cur { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.giftpanel textarea { background: var(--bg); border: 2px solid var(--line); border-radius: 14px; color: var(--text); padding: 9px 12px; font: inherit; resize: none; height: 64px; }
.giftpanel textarea:focus { border-color: var(--accent); outline: none; }
.gp-prev { display: flex; align-items: center; gap: 10px; border-radius: 16px; padding: 8px 10px; font-weight: 700; transition: background 0.2s; }
.gp-pav { width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, 0.26); border: 2px solid rgba(255, 255, 255, 0.55); display: flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.gp-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-ppill { background: rgba(0, 0, 0, 0.3); border-radius: 999px; padding: 3px 12px; font-size: 13px; white-space: nowrap; }
.giftpanel .btn { border-radius: 999px; height: 40px; }
.tierlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.tierrow { display: grid; grid-template-columns: auto 90px auto 40px 1fr; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.tiersample { border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; text-align: center; }
.giftcol { display: flex; flex-direction: column; gap: 12px; }

/* music */
.np { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.np-art { width: 120px; height: 120px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); overflow: hidden; flex: none; }
.np-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-info { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.np-title { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.np-artist { color: var(--muted); }
.np-seekrow { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.studio .np-seekrow input[type="range"] { --p: 0%; }
.mlist { display: flex; flex-direction: column; gap: 8px; }
.mrow { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 12px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.mart { width: 52px; height: 52px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.mart img { width: 100%; height: 100%; object-fit: cover; display: block; }
.minfo { min-width: 0; }
.mtitle { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.martist { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mdur { color: var(--muted); font-size: 13px; }
.macts { display: flex; gap: 6px; }
@media (max-width: 700px) { .mrow { grid-template-columns: 52px 1fr; } .mdur { display: none; } .macts { grid-column: 1 / -1; } }

/* soundboard */
.soundgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.soundtile { position: relative; }
.soundtile .btn { width: 100%; height: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soundtile .x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; }
.soundtile .x:hover { color: #fff; background: var(--red); }

/* verified icon preview, and the studio's own textareas */
.tagpreview { width: 36px; height: 36px; border-radius: 6px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line); flex: none; }
.tagpreview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.studio textarea { background: var(--bg); border: 2px solid var(--line); border-radius: 4px; color: var(--text); padding: 8px 10px; font: inherit; resize: vertical; min-height: 70px; width: 100%; box-sizing: border-box; }
.studio textarea:focus { border-color: var(--accent); outline: none; }

/* the verified tick, next to a name in chat */
.verified-badge { width: 14px; height: 14px; vertical-align: -2px; margin-left: 3px; border-radius: 3px; object-fit: cover; }

/* the pinned notify-me bar under the top nav */
.notifyBar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

/* accounts: sign in tabs, the nav account button, pictures */
.authtabs { display: flex; gap: 2px; margin-bottom: 4px; }
.authtabs button { flex: 1; background: var(--panel2); border: 2px solid var(--line); border-radius: 4px; height: 36px; color: var(--muted); font-weight: 700; cursor: pointer; }
.authtabs button.on { color: var(--text); border-color: var(--accent); }
.gate-card form { display: flex; flex-direction: column; gap: 10px; }

.pfpsm, .pfpbig { border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--panel2); border: 2px solid var(--line); font-weight: 700; flex: none; }
.pfpsm { width: 26px; height: 26px; font-size: 12px; }
.pfpbig { width: 64px; height: 64px; font-size: 24px; }
.pfpsm img, .pfpbig img { width: 100%; height: 100%; object-fit: cover; }

.navacct { display: flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--text); font-weight: 700; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.navacct:hover { background: rgba(255, 255, 255, 0.08); }
.acctmenu { position: absolute; top: 54px; right: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 160px; z-index: 45; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.acctmenu button { background: none; border: 0; color: var(--text); text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.acctmenu button:hover { background: rgba(255, 255, 255, 0.08); }

/* the profile page */
.profileview { padding: 16px; max-width: 1200px; margin: 0 auto; }
.profilehead { display: flex; align-items: center; gap: 16px; margin: 14px 0 18px; }
.profilehead .pfpbig { width: 84px; height: 84px; font-size: 30px; }
.profwho { min-width: 0; }
.profname { font-size: 22px; font-weight: 700; }
.profuser { color: var(--muted); }
.profbio { margin-top: 6px; overflow-wrap: anywhere; }
