/* NEONCAM — UI scura, accento blu neon #00a8ff */

:root {
  --bg: #05080a;
  --bg-2: #0a0f14;
  --panel: #0c1218;
  --panel-2: #111a22;
  --line: #1b2833;
  --line-2: #263745;
  --txt: #dce8f2;
  --dim: #7e93a6;
  --accent: #00a8ff;
  --accent-2: #52d1ff;
  --danger: #ff4d6d;
  --ok: #38e8a0;
  --radius: 10px;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(0, 168, 255, .10), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(0, 168, 255, .06), transparent 60%),
    var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }

[hidden] { display: none !important; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: .18em;
  color: #fff;
}
.brand.small { font-size: 14px; letter-spacing: .16em; }
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent), 0 0 3px var(--accent);
}

.tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--dim);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------------- gate ---------------- */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-card {
  width: min(440px, 100%);
  background: linear-gradient(180deg, rgba(17, 26, 34, .9), rgba(8, 13, 17, .95));
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 30px 28px 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 168, 255, .05) inset;
}

.gate-card h1 {
  margin: 22px 0 6px;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.gate-card .sub { margin: 0 0 22px; color: var(--dim); font-size: 13px; }

.field { display: block; margin-bottom: 16px; }
.field span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--dim);
  margin-bottom: 6px;
}

.field input,
.chat-form input,
.dm-form input {
  width: 100%;
  background: #070c10;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--txt);
  padding: 11px 12px;
  outline: none;
}
.field input:focus,
.chat-form input:focus,
.dm-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 168, 255, .15); }

.primary {
  background: var(--accent);
  color: #001018;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 650;
  transition: filter .15s, transform .05s;
}
.primary:hover { filter: brightness(1.12); }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: .55; cursor: progress; }
.primary.big { width: 100%; padding: 13px 16px; font-size: 15px; }

.hint { margin: 12px 0 0; color: var(--dim); font-size: 11.5px; }

/* ---------------- app shell ---------------- */

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

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 10, 13, .85);
  backdrop-filter: blur(8px);
}

.roomline { display: flex; align-items: center; gap: 10px; min-width: 0; }
.roomline strong {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.controls { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.me {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent-2);
  border: 1px solid rgba(0, 168, 255, .35);
  background: rgba(0, 168, 255, .07);
  border-radius: 999px;
  padding: 4px 10px;
  max-width: 140px;
  cursor: pointer;
}
.me:hover, .me:focus-visible {
  border-color: var(--accent);
  background: rgba(0, 168, 255, .14);
  outline: none;
}
.me .medot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex: 0 0 auto;
}
.me #selfNick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.visitors {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}
.visitors .vdot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(56, 232, 160, .55);
}
.visitors #visitorCount { color: var(--txt); font-size: 12px; }
.visitors .vlabel { color: var(--dim); }

.ctl {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  letter-spacing: .02em;
}
.ctl:hover { border-color: var(--accent); }
.ctl.off { color: var(--danger); border-color: rgba(255, 77, 109, .45); }
.ctl.danger:hover { border-color: var(--danger); color: var(--danger); }
.ctl.reset { color: var(--dim); }
.ctl.reset:hover { border-color: rgba(255, 77, 109, .5); color: var(--danger); }
.reset-link {
  display: block;
  margin: 12px auto 0;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.reset-link[hidden] { display: none; }
.reset-link:hover { color: var(--danger); text-decoration: underline; }

.layout {
  min-height: 0;
  display: grid;
  grid-template-columns: var(--side-w, 232px) 8px minmax(0, 1fr) 8px var(--chat-w, 320px);
  gap: 0;
}

.gutter {
  cursor: col-resize;
  background: transparent;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  touch-action: none;
}
.gutter:hover, .gutter.dragging {
  background: rgba(0, 168, 255, .16);
  border-color: rgba(0, 168, 255, .35);
}
body.resizing { cursor: col-resize; user-select: none; }
body.resizing iframe { pointer-events: none; }

.side {
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: rgba(8, 13, 17, .45);
}

.side h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 4px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--dim);
}

.list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }

.room-item,
.user-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 9px;
  text-align: left;
  font-size: 12.5px;
  color: var(--txt);
}
.room-item:hover, .user-item:hover { background: var(--panel); border-color: var(--line); }
.room-item.active { background: rgba(0, 168, 255, .10); border-color: rgba(0, 168, 255, .45); }
.room-item { align-items: flex-start; }
.room-item .rbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.room-item .rline { display: flex; align-items: center; gap: 6px; min-width: 0; }
.room-item .rname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item .rsub {
  display: block;
  font-size: 10.5px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-item.active .rsub { color: #9fc7dc; }

.group-label {
  margin: 6px 4px 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #5b7183;
}
.group-empty { padding: 2px 6px 6px; font-size: 11px; color: #4a5f70; }

.user-item .uname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item .meta, .user-item .meta { font-family: var(--mono); font-size: 10px; color: var(--dim); }
.room-item .lock { font-size: 11px; opacity: .8; }

.room-item .pip, .user-item .pip {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(56, 232, 160, .6);
  flex: 0 0 auto;
}
.room-item .pip.off { background: #3a4a58; box-shadow: none; }

.user-item { cursor: default; flex-direction: column; align-items: stretch; gap: 3px; }
.user-item .u-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.user-item .u-top .uname { flex: 1; min-width: 0; }
.user-item .u-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding-left: 15px; }
.user-item .u-actions .call { padding: 2px 7px; font-size: 10px; }
.user-item .u-actions .meta { font-size: 9px; }
.user-item .call {
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  border-radius: 6px;
  font-size: 10.5px;
  padding: 3px 7px;
}
.user-item .call.msg { color: var(--accent-2); border-color: rgba(0, 168, 255, .35); }
.user-item .call.msg:hover { background: rgba(0, 168, 255, .12); }
.user-item .meta.nocam { color: #5b7183; font-size: 9.5px; }
.user-item .call:hover { border-color: var(--accent); color: var(--accent-2); }
.user-item.self .uname { color: var(--accent-2); }

.create-row { display: flex; gap: 6px; }
.create-row .ghost { flex: 1; }

.ghost {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  color: var(--dim);
}
.ghost:hover { border-color: var(--accent); color: var(--accent-2); }

.side .online { min-height: 0; }

/* ---------------- stage ---------------- */

.stage {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 10px;
}

.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.grid.n1 { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.grid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
.grid.n3 .slot:nth-child(3) { grid-column: 1 / -1; }

.privatestage {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 24px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: radial-gradient(600px 300px at 50% 0%, rgba(0, 168, 255, .10), transparent 70%), #070c10;
}
.privatestage .plock { font-size: 30px; }
.privatestage .ptitle {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.privatestage .pwith { font-size: 17px; }
.privatestage .pnote { font-size: 11px; color: var(--dim); max-width: 300px; }

.slot {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(135deg, #0b1319, #0a1015);
  border: 1px solid var(--line);
  min-height: 0;
}
.slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #04070a;
}
.slot.self video { transform: scaleX(-1); }
.slot.empty { display: grid; place-items: center; }
.slot.empty::after {
  content: "posto libero";
  font-family: var(--mono);
  font-size: 11px;
  color: #354757;
  letter-spacing: .08em;
}
.slot .name {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 16px);
  background: rgba(3, 7, 10, .72);
  border: 1px solid rgba(38, 55, 69, .8);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 11.5px;
  backdrop-filter: blur(4px);
}
.slot .name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot .eye {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 10, .72);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  opacity: .85;
}
.slot .eye:hover { opacity: 1; border-color: var(--accent); }
.slot .eye.off { border-color: rgba(255, 196, 107, .55); opacity: 1; }

.slot .badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .06em;
  color: #ffd0d8;
  background: rgba(120, 14, 34, .78);
  border: 1px solid rgba(255, 77, 109, .45);
  border-radius: 5px;
  padding: 2px 6px;
}
.slot .badge.micoff { color: #d7e3ee; background: rgba(20, 30, 38, .85); border-color: var(--line-2); }
.slot .conn {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: #7ea3bb;
  background: rgba(4, 8, 11, .55);
  z-index: 3;
}
.slot .conn.bad { color: #ff9db0; }
.slot .tap {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 4;
  border: 1px solid rgba(0, 168, 255, .55);
  background: rgba(3, 10, 15, .88);
  color: #bfe9ff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  white-space: nowrap;
}

.slot .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 30px;
  color: #2a3a47;
  background: repeating-linear-gradient(45deg, #080d11, #080d11 12px, #0a1015 12px, #0a1015 24px);
  z-index: 1;
}

.people {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
  padding: 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.people:not([hidden]) { display: block; }

.stage-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
}
.note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- chat stanza ---------------- */

.chatcol {
  min-height: 0;
  display: grid;
  grid-template-rows: 46px minmax(0, 1fr) auto;
  border-left: 1px solid var(--line);
  background: rgba(7, 11, 15, .6);
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.chat-head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--dim);
}

.chat-log {
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scrollbar-width: thin;
}

.msg { font-size: 13px; overflow-wrap: anywhere; }
.msg .who {
  font-weight: 650;
  font-size: 12px;
  margin-right: 6px;
}
.msg .time {
  font-family: var(--mono);
  font-size: 9.5px;
  color: #53697b;
  margin-left: 6px;
}
.msg.system {
  font-size: 11.5px;
  color: var(--dim);
  text-align: center;
  font-family: var(--mono);
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}
.chat-form input { padding: 9px 11px; }
.chat-form button { padding: 9px 14px; }

/* ---------------- DM ---------------- */

.dm-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 400px;
  max-height: calc(100dvh - 90px);
  display: flex;
  flex-direction: column;
  background: #080d11;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .7);
  z-index: 40;
  overflow: hidden;
}

.dm-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 6px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.dm-tab {
  border: 1px solid transparent;
  border-bottom: 0;
  background: transparent;
  border-radius: 7px 7px 0 0;
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
}
.dm-tab.active { background: var(--panel); border-color: var(--line); color: var(--txt); }
.dm-tab .unread {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 5px;
  vertical-align: middle;
}

.dm-body { display: flex; flex-direction: column; min-height: 0; }

.dm-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.dm-head .who { font-weight: 650; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-head .sts { font-family: var(--mono); font-size: 10px; color: var(--dim); }
.dm-head button {
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
}
.dm-head button:hover { border-color: var(--danger); color: var(--danger); }

.dm-videos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
}
.dm-v {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #04080b;
  border: 1px solid var(--line);
}
.dm-v video { width: 100%; height: 100%; object-fit: cover; display: block; }
.dm-v.self video { transform: scaleX(-1); }
.dm-v .lbl {
  position: absolute;
  left: 6px; bottom: 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  background: rgba(3, 7, 10, .75);
  border-radius: 4px;
  padding: 1px 5px;
  color: #cfe0ee;
}
.dm-v .nocam {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 10px; color: #3a4d5d;
  background: repeating-linear-gradient(45deg, #070b0e, #070b0e 10px, #0a1014 10px, #0a1014 20px);
}

.dm-body.chatonly .dm-chat {
  min-height: 280px;
  max-height: 52dvh;
}
.dm-body.chatonly .dm-form { padding-bottom: 12px; }

.dm-chat {
  min-height: 90px;
  max-height: 190px;
  overflow-y: auto;
  padding: 4px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-top: 1px solid var(--line);
}
.dm-chat .msg { font-size: 12.5px; }

.dm-form {
  display: flex;
  gap: 7px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--line);
}
.dm-form input { padding: 8px 10px; }
.dm-form button { padding: 8px 12px; }

.dm-wait {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  color: var(--dim);
  font-size: 12.5px;
}

/* ---------------- inviti / modal / toast ---------------- */

.invites {
  position: fixed;
  top: 66px;
  right: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.invite {
  width: 300px;
  background: #0a1117;
  border: 1px solid rgba(0, 168, 255, .45);
  border-left: 3px solid var(--accent);
  border-radius: 9px;
  padding: 10px 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  font-size: 12.5px;
}
.invite .row { display: flex; gap: 8px; margin-top: 9px; }
.invite button {
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 11.5px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
}
.invite button.yes { background: var(--accent); border-color: var(--accent); color: #001018; font-weight: 650; }
.invite button:hover { filter: brightness(1.1); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(2, 5, 8, .72);
  backdrop-filter: blur(3px);
  padding: 20px;
}
.modal-card {
  width: min(380px, 100%);
  background: #0b1117;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
}
.modal-card h3 { margin: 0 0 4px; font-size: 16px; }
.modal-card p { margin: 0 0 16px; color: var(--dim); font-size: 12px; }
.modal-card .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal-card .row .ghost { width: auto; padding: 8px 14px; }
.modal-card input {
  width: 100%;
  background: #070c10;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--txt);
  padding: 10px 11px;
  margin-bottom: 10px;
  outline: none;
}
.modal-card input:focus { border-color: var(--accent); }

.updatebar {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0d151c;
  border: 1px solid rgba(0, 168, 255, .55);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 12.5px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .6);
  white-space: nowrap;
}
.updatebar .primary { padding: 5px 12px; font-size: 11.5px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 90;
  background: #0d151c;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 9px 15px;
  font-size: 12.5px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .6);
  max-width: min(560px, calc(100vw - 32px));
}
.toast.warn { border-color: rgba(255, 176, 77, .45); color: #ffcf9a; }
.toast.err { border-color: rgba(255, 77, 109, .5); color: #ffb9c5; }

/* ---------------- responsive ---------------- */

@media (max-width: 1080px) {
  .layout { grid-template-columns: 208px minmax(0, 1fr) 290px; }
  .dm-dock { width: 360px; }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100dvh; grid-template-rows: 54px auto; }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }
  .gutter { display: none; }
  .side {
    order: 3;
    border-right: 0;
    border-top: 1px solid var(--line);
    flex-direction: row;
    gap: 18px;
    align-items: flex-start;
  }
  .side section { flex: 1; min-width: 0; }
  .stage { order: 1; padding: 10px; }
  .grid { min-height: 40vh; max-height: 50vh; }
  .chatcol {
    order: 2;
    height: 46vh;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .dm-dock {
    right: 0; bottom: 0; width: 100%;
    max-height: 88dvh;
    border-radius: 12px 12px 0 0;
  }
  .invites { top: 60px; right: 8px; left: 8px; }
  .invite { width: auto; }
}

@media (max-width: 560px) {
  .top { gap: 6px; padding: 0 8px; }
  .brand.small { display: none; }
  .visitors { padding: 3px 7px; gap: 5px; }
  .visitors .vlabel { display: none; }
  .me { max-width: 96px; padding: 3px 7px; font-size: 10.5px; }
  .roomline strong { max-width: 18vw; }
  .brand.small { flex: 0 0 auto; font-size: 11px; letter-spacing: .1em; }
  .roomline { flex: 1 1 auto; min-width: 0; gap: 6px; }
  .roomline strong { max-width: 27vw; }
  .roomline .tag { display: none; }
  .controls { flex: 0 0 auto; gap: 5px; }
  .ctl { padding: 6px 7px; font-size: 10.5px; white-space: nowrap; }
  .side { flex-direction: column; }
  .grid { gap: 6px; }
  .stage-foot .note:last-child { display: none; }
}

@media (max-width: 430px) {
  .me { max-width: 82px; font-size: 10px; }
  .roomline strong { max-width: 22vw; }
  .ctl { padding: 6px 6px; }
}

@media (prefers-reduced-motion: no-preference) {
  .gate-card { animation: rise .35s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
}
