/* ============================================================
   Nexus — оформление
   ============================================================ */

:root {
  --bg: #06110c;
  --bg-2: #081711;
  --panel: #0b1a13;
  --panel-2: #10251a;
  --panel-3: #173322;
  --text: #eaf7ef;
  --muted: #91aa9c;
  --muted-2: #6b8275;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --accent: #3ddc84;
  --accent-2: #12b8a6;
  --accent-soft: rgba(61, 220, 132, 0.16);
  --green: #3ddc84;
  --green-soft: rgba(61, 220, 132, 0.14);
  --red: #ff5d73;
  --yellow: #ffd166;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI Variable Text", "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

input,
textarea,
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a {
  color: #8be3b6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hidden,
[hidden] {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ico {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  pointer-events: none;
}

.ico .fill {
  fill: currentColor;
  stroke: none;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ===================== WELCOME ===================== */

.welcome {
  position: fixed;
  inset: 0;
  overflow: auto;
  background: radial-gradient(1200px 700px at 15% 0%, #1b1f3d 0%, transparent 60%),
    radial-gradient(1000px 600px at 100% 100%, #2a1340 0%, transparent 55%),
    linear-gradient(160deg, #080910 0%, #0a0c14 45%, #08090f 100%);
}

.welcome-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 75%);
  pointer-events: none;
  opacity: 0.55;
}

.welcome-inner {
  position: relative;
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 40px;
  display: grid;
  grid-template-columns: 1.05fr 440px;
  gap: 56px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 44px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(145deg, #7c8cff, #12b8a6 55%, #6d2bd9);
  display: grid;
  place-items: center;
  box-shadow: 0 14px 40px rgba(124, 140, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 55%);
}

.brand-mark span {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -1px;
  color: #fff;
}

.brand h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.8px;
  font-weight: 700;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.welcome-title {
  margin: 0 0 18px;
  font-size: clamp(38px, 4vw, 54px);
  line-height: 1.04;
  letter-spacing: -2px;
  font-weight: 800;
  background: linear-gradient(115deg, #fff 10%, #b9bfff 55%, #c39bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-text {
  margin: 0 0 30px;
  max-width: 480px;
  color: #aeb4cc;
  font-size: 15px;
  line-height: 1.65;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 520px;
}

.feature-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.feature-list .fi {
  font-size: 20px;
  line-height: 1.2;
}

.feature-list b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.feature-list small {
  color: var(--muted-2);
  font-size: 12px;
}

.welcome-foot {
  margin-top: 34px;
  color: var(--muted-2);
  font-size: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.welcome-foot .dot {
  opacity: 0.4;
}

.welcome-card {
  background: linear-gradient(180deg, rgba(23, 27, 44, 0.92), rgba(13, 16, 26, 0.96));
  border: 1px solid var(--line-2);
  border-radius: 24px;
  padding: 30px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
}

.welcome-card h3 {
  margin: 0 0 22px;
  font-size: 20px;
  letter-spacing: -0.4px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: 0.2px;
}

.field input,
.input {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  background: rgba(6, 8, 14, 0.8);
  border: 1px solid var(--line-2);
  padding: 0 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  user-select: text;
}

.field input:focus,
.input:focus {
  border-color: rgba(124, 140, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.16);
}

.field input::placeholder {
  color: #565b72;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 12px;
}

.colors {
  display: flex;
  gap: 9px;
}

.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.color-dot:hover {
  transform: scale(1.08);
}

.color-dot.active {
  box-shadow: 0 0 0 2px #0b0d15, 0 0 0 4px rgba(255, 255, 255, 0.85);
}

.tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 12px;
  margin: 4px 0 18px;
}

.tab {
  flex: 1;
  height: 36px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: linear-gradient(180deg, rgba(124, 140, 255, 0.28), rgba(124, 140, 255, 0.14));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn:active {
  transform: scale(0.985);
}

.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, #3ddc84, #18b981);
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(61, 220, 132, 0.35);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7d8bff, #a86aff);
}

.btn-lg {
  width: 100%;
  height: 48px;
  font-size: 14.5px;
  border-radius: 14px;
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  background: rgba(255, 77, 109, 0.14);
  border-color: rgba(255, 77, 109, 0.35);
  color: #ff8ba0;
}

.btn-danger:hover {
  background: rgba(255, 77, 109, 0.24);
}

.hint {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted-2);
}

.welcome-error {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid rgba(255, 77, 109, 0.3);
  color: #ff9db0;
  font-size: 12.5px;
  line-height: 1.45;
  user-select: text;
}

.welcome-note {
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.5;
}

.invite-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(46, 230, 168, 0.07);
  border: 1px solid rgba(46, 230, 168, 0.24);
  animation: fadeUp 0.3s ease;
}

.invite-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7ff0c8;
  margin-bottom: 8px;
}

.invite-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.invite-row code {
  flex: 1;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 14px;
  color: #d8fff1;
  user-select: text;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invite-hint {
  margin-top: 8px;
  font-size: 11.5px;
  color: #8fd8bf;
  line-height: 1.5;
}

.recent {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s;
}

.recent-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.recent-item b {
  color: var(--text);
  font-weight: 500;
}

/* ===================== APP ===================== */

.app {
  display: grid;
  grid-template-columns: 72px 252px minmax(0, 1fr);
  height: 100vh;
  background: var(--bg);
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  background: linear-gradient(180deg, #0a0c14, #080910);
  border-right: 1px solid var(--line);
}

.rail-logo {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: linear-gradient(145deg, #7c8cff, #12b8a6 60%, #6d2bd9);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 140, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  margin-bottom: 8px;
  cursor: default;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rail-spacer {
  flex: 1;
}

.rail-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
}

.rail-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.rail-btn.active {
  color: #fff;
  background: linear-gradient(165deg, rgba(61, 220, 132, 0.32), rgba(18, 184, 166, 0.18));
  border-color: rgba(140, 155, 255, 0.35);
  box-shadow: 0 8px 22px rgba(61, 220, 132, 0.22);
}

.rail-btn.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #8b9bff, #12b8a6);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.server-head {
  height: 58px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.server-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.2px;
}

.server-title span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-badge {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: linear-gradient(145deg, #7c8cff, #12b8a6);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex: none;
}

.channels {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 8px 12px;
}

.ch-group {
  margin-bottom: 20px;
}

.ch-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted-2);
}

.ch-group-head button {
  margin-left: auto;
  color: var(--muted-2);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.ch-group:hover .ch-group-head button {
  opacity: 1;
}

.ch-group-head button:hover {
  color: var(--text);
}

.channel {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: background 0.13s, color 0.13s;
  font-size: 13.5px;
}

.channel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #d5d9ea;
}

.channel.active {
  background: linear-gradient(90deg, rgba(61, 220, 132, 0.22), rgba(61, 220, 132, 0.06));
  color: #fff;
}

.channel.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: #8b9bff;
}

.channel .ch-icon {
  font-size: 15px;
  opacity: 0.85;
  width: 18px;
  text-align: center;
}

.channel .ch-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel .ch-count {
  font-size: 11px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 1px 7px;
}

.channel .ch-lock {
  font-size: 12px;
  color: var(--muted-2);
}

.voice-users {
  padding: 2px 0 4px 30px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.voice-user {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 12.5px;
  color: #b9bed2;
  cursor: default;
}

.voice-user:hover {
  background: rgba(255, 255, 255, 0.04);
}

.voice-user .vu-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-user .vu-icons {
  display: flex;
  gap: 3px;
  color: var(--red);
}

.voice-user .vu-icons .ico {
  width: 13px;
  height: 13px;
}

.voice-user .stream-dot {
  color: #c084fc;
}

.userbar {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 12px;
  background: #0a0c13;
  border-top: 1px solid var(--line);
}

.ub-avatar .avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 13px;
}

.ub-info {
  flex: 1;
  min-width: 0;
}

.ub-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ub-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 1px;
}

.ping-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(46, 230, 168, 0.7);
}

.ping-dot.warn {
  background: var(--yellow);
  box-shadow: 0 0 8px rgba(255, 200, 87, 0.6);
}

.ping-dot.bad {
  background: var(--red);
  box-shadow: 0 0 8px rgba(255, 77, 109, 0.6);
}

.ub-actions {
  display: flex;
  gap: 2px;
}

.ub-actions .icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.ub-actions .icon-btn .ico {
  width: 17px;
  height: 17px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: color 0.13s, background 0.13s;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.icon-btn.on {
  color: #fff;
  background: rgba(61, 220, 132, 0.25);
}

.icon-btn.danger {
  color: #ff8ba0;
  background: rgba(255, 77, 109, 0.14);
}

.icon-btn.danger:hover {
  background: rgba(255, 77, 109, 0.24);
  color: #ffb3c0;
}

.icon-btn.big {
  width: 44px;
  height: 44px;
  border-radius: 13px;
}

.icon-btn.big .ico {
  width: 21px;
  height: 21px;
}

/* ===================== MAIN ===================== */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: radial-gradient(1200px 600px at 60% -10%, rgba(61, 220, 132, 0.07), transparent 60%), var(--bg-2);
}

.topbar {
  height: 58px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 20, 0.75);
  backdrop-filter: blur(12px);
  z-index: 5;
}

.tb-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.tb-icon {
  color: var(--muted-2);
  display: grid;
  place-items: center;
}

.tb-titles {
  min-width: 0;
}

.tb-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-topic {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.pill.live {
  color: #ffb3c0;
  background: rgba(255, 77, 109, 0.12);
  border-color: rgba(255, 77, 109, 0.3);
}

.pill.good {
  color: #7ff0c8;
  background: rgba(46, 230, 168, 0.1);
  border-color: rgba(46, 230, 168, 0.24);
}

.pill.live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 1.6s infinite;
}

.content {
  flex: 1;
  min-height: 0;
  display: flex;
}

/* ===================== STAGE ===================== */

.stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 500px at 50% 0%, rgba(61, 220, 132, 0.09), transparent 70%),
    linear-gradient(180deg, #0b0e17, #090b12);
}

.stage-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px 0;
}

.sh-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
}

.sh-title .ico {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.sh-sub {
  color: var(--muted-2);
  font-size: 12px;
}

.sh-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tiles {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px;
  display: grid;
  gap: 14px;
  align-content: center;
  justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.tiles.streams {
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  align-content: center;
  align-items: center;
}

.content {
  transition: padding-bottom 0.18s ease;
}

.tiles.streams.single {
  grid-template-columns: minmax(0, 1fr);
}

.stage-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted-2);
  text-align: center;
  padding: 30px;
}

.stage-empty .big-emoji {
  font-size: 46px;
  filter: grayscale(0.2);
  opacity: 0.85;
}

.stage-empty h4 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  letter-spacing: -0.3px;
}

.stage-empty p {
  margin: 0;
  font-size: 13px;
  max-width: 360px;
  line-height: 1.55;
}

.tile {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  min-height: 150px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.tile-participant {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px 14px;
  min-height: 176px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
}

.tile-participant:hover {
  border-color: var(--line-2);
}

.tile-participant.speaking {
  border-color: rgba(46, 230, 168, 0.55);
  box-shadow: 0 0 0 1px rgba(46, 230, 168, 0.25), 0 0 34px rgba(46, 230, 168, 0.14);
}

.avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.5px;
  flex: none;
  user-select: none;
}

.avatar-sm {
  width: 22px;
  height: 22px;
  font-size: 9px;
  border-radius: 7px;
}

.avatar-md {
  width: 34px;
  height: 34px;
  font-size: 12px;
  border-radius: 11px;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 24px;
  border-radius: 22px;
}

.avatar-xl {
  width: 92px;
  height: 92px;
  font-size: 30px;
  border-radius: 28px;
}

.avatar-wrap .avatar {
  width: 100%;
  height: 100%;
  transition: box-shadow 0.2s;
}

.level-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(46, 230, 168, 0);
  transition: border-color 0.12s, box-shadow 0.12s;
  pointer-events: none;
}

.tile-participant.speaking .level-ring {
  border-color: rgba(46, 230, 168, 0.9);
  box-shadow: 0 0 18px rgba(46, 230, 168, 0.35), inset 0 0 14px rgba(46, 230, 168, 0.12);
}

.tile-name {
  font-weight: 600;
  font-size: 13.5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-name .you {
  color: var(--muted-2);
  font-weight: 400;
}

.tile-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted-2);
  max-width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.badge .ico {
  width: 11px;
  height: 11px;
}

.badge.accent {
  color: #c4b5fd;
  background: rgba(18, 184, 166, 0.14);
  border-color: rgba(18, 184, 166, 0.3);
}

.badge.live {
  color: #ffb3c0;
  background: rgba(255, 77, 109, 0.14);
  border-color: rgba(255, 77, 109, 0.3);
}

.badge.green {
  color: #7ff0c8;
  background: rgba(46, 230, 168, 0.12);
  border-color: rgba(46, 230, 168, 0.28);
}

/* Стрим-плитка */

.tile-stream {
  background: #000;
  border-color: rgba(255, 255, 255, 0.1);
  aspect-ratio: 16 / 9;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-stream video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.tile-stream .tile-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 26%, transparent 72%, rgba(0, 0, 0, 0.72));
  opacity: 1;
  transition: opacity 0.2s;
}

.tile-stream .tile-top {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3;
}

.tile-stream .tile-bottom {
  position: absolute;
  bottom: 9px;
  left: 12px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3;
}

.tile-stream .stream-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  min-width: 0;
}

.tile-stream .stream-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-stream .stream-stats {
  margin-left: auto;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 600;
  color: #e9ecf7;
  background: rgba(10, 12, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.chip.good {
  color: #7ff0c8;
  border-color: rgba(46, 230, 168, 0.3);
}

.chip.warn {
  color: #ffd58a;
  border-color: rgba(255, 200, 87, 0.3);
}

.chip.bad {
  color: #ff9db0;
  border-color: rgba(255, 77, 109, 0.3);
}

.tile-stream .stream-actions {
  position: absolute;
  right: 10px;
  bottom: 44px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s, transform 0.18s;
  z-index: 4;
}

.tile-stream:hover .stream-actions {
  opacity: 1;
  transform: translateY(0);
}

.stream-actions .icon-btn {
  background: rgba(10, 12, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #dfe3f0;
  width: 32px;
  height: 32px;
  backdrop-filter: blur(8px);
}

.stream-actions .icon-btn:hover {
  background: rgba(20, 24, 38, 0.9);
  color: #fff;
}

.stream-actions .icon-btn.on {
  color: #fff;
  background: rgba(61, 220, 132, 0.65);
}

.tile-stream.pinned {
  grid-column: 1 / -1;
}

.tile-stream.local .badge.you {
  color: #c4b5fd;
  background: rgba(18, 184, 166, 0.16);
  border-color: rgba(18, 184, 166, 0.35);
}

.tile-preview-muted {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 12.5px;
  background: rgba(0, 0, 0, 0.55);
}

/* Нижняя панель голоса */

.voicebar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: rgba(10, 12, 20, 0.82);
  backdrop-filter: blur(14px);
}

.vb-timer {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 108px;
  padding-left: 4px;
}

.vb-timer b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

.vb-timer span {
  font-size: 10.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.vb-sep {
  width: 1px;
  height: 30px;
  background: var(--line);
  margin: 0 4px;
}

.vb-btn {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #cfd4e6;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
}

.vb-btn .ico {
  width: 21px;
  height: 21px;
}

.vb-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.vb-btn:active {
  transform: scale(0.96);
}

.vb-btn.on {
  color: #fff;
  background: linear-gradient(150deg, rgba(61, 220, 132, 0.5), rgba(18, 184, 166, 0.35));
  border-color: rgba(140, 155, 255, 0.5);
  box-shadow: 0 6px 20px rgba(61, 220, 132, 0.25);
}

.vb-btn.muted {
  color: #ff9db0;
  background: rgba(255, 77, 109, 0.16);
  border-color: rgba(255, 77, 109, 0.35);
}

.vb-btn.share.live {
  color: #fff;
  background: linear-gradient(150deg, #ff4d6d, #b91c4b);
  border-color: transparent;
  box-shadow: 0 6px 22px rgba(255, 77, 109, 0.4);
}

.vb-btn.leave {
  margin-left: auto;
  width: 52px;
  color: #ff9db0;
  background: rgba(255, 77, 109, 0.12);
  border-color: rgba(255, 77, 109, 0.3);
}

.vb-btn.leave:hover {
  background: rgba(255, 77, 109, 0.28);
  color: #fff;
}

.vb-spacer {
  flex: 1;
}

.vb-quality {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted-2);
  padding-right: 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vb-quality b {
  color: var(--muted);
  font-weight: 600;
}

/* ===================== CHAT ===================== */

.chatpane {
  width: 372px;
  flex: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--panel);
  border-left: 1px solid var(--line);
}

.app.text-mode .chatpane {
  width: auto;
  flex: 1;
  border-left: 0;
}

.chat-head {
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.chat-tab {
  height: 28px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chat-tab:hover {
  color: var(--text);
}

.chat-tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.chat-head .unread-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8b9bff;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  user-select: text;
}

.msg {
  display: flex;
  gap: 10px;
  padding: 3px 8px;
  border-radius: 8px;
  position: relative;
}

.msg:hover {
  background: rgba(255, 255, 255, 0.03);
}

.msg .avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 11px;
  margin-top: 2px;
}

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 1px;
}

.msg-name {
  font-weight: 600;
  font-size: 13px;
}

.msg-time {
  font-size: 10.5px;
  color: var(--muted-2);
  opacity: 0;
  transition: opacity 0.12s;
}

.msg:hover .msg-time {
  opacity: 1;
}

.msg-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: #d7dbeb;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.msg-text code {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1px 4px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.msg-text pre.code {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  overflow-x: auto;
  margin: 5px 0;
}

.msg-text b {
  color: #fff;
}

.msg-grouped {
  padding-top: 0;
}

.msg-grouped .msg-head {
  display: none;
}

.msg-grouped .avatar {
  opacity: 0;
  pointer-events: none;
}

.msg.system {
  justify-content: center;
  padding: 6px 8px;
}

.msg.system .system-text {
  font-size: 11px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 3px 10px;
}

.day-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 6px 8px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.day-sep::before,
.day-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.empty-chat {
  margin: auto;
  text-align: center;
  color: var(--muted-2);
  padding: 30px;
}

.empty-chat .big {
  font-size: 34px;
  margin-bottom: 8px;
}

.empty-chat b {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}

.composer {
  flex: none;
  padding: 10px 12px 14px;
}

.composer-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 8, 14, 0.75);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 5px 6px 5px 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.composer-box:focus-within {
  border-color: rgba(124, 140, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.12);
}

.composer-box input {
  flex: 1;
  height: 36px;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 13.5px;
  user-select: text;
}

.composer-box input::placeholder {
  color: #565b72;
}

.composer-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 16px;
  transition: background 0.13s, color 0.13s;
}

.composer-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.composer-btn.send {
  color: #c7cdff;
  background: rgba(61, 220, 132, 0.16);
}

.composer-btn.send:hover {
  background: rgba(61, 220, 132, 0.3);
  color: #fff;
}

.composer-btn.send .ico {
  width: 17px;
  height: 17px;
}

.emoji-pop {
  position: absolute;
  bottom: 66px;
  left: 12px;
  right: 12px;
  background: #141827;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  box-shadow: var(--shadow);
  z-index: 30;
}

.emoji-pop button {
  height: 32px;
  border-radius: 8px;
  font-size: 17px;
}

.emoji-pop button:hover {
  background: rgba(255, 255, 255, 0.07);
}

/* ===================== MEMBERS ===================== */

.members {
  width: 236px;
  flex: none;
  border-left: 1px solid var(--line);
  background: var(--panel);
  overflow-y: auto;
  padding: 14px 10px;
  min-height: 0;
}

.app.members-hidden .members {
  display: none;
}

.members-group {
  margin-bottom: 16px;
}

.members-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0 8px 7px;
}

.member {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 10px;
  transition: background 0.13s;
}

.member:hover {
  background: rgba(255, 255, 255, 0.04);
}

.member .avatar {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 11px;
}

.member-info {
  min-width: 0;
  flex: 1;
}

.member-name {
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.member-sub {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member .ico {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
}

.member .ico.off {
  color: var(--red);
}

.member-you {
  font-size: 9.5px;
  color: var(--muted-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 4px;
}

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 62px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.member:hover .vol-slider {
  opacity: 1;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cfd4e6;
  cursor: pointer;
}

/* ===================== DRAWER / SOUNDPAD ===================== */

.drawer {
  position: fixed;
  left: 72px;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(16, 19, 30, 0.97);
  border-top: 1px solid var(--line-2);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(18px);
  animation: slideUp 0.2s ease;
  max-height: 62vh;
  display: flex;
  flex-direction: column;
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h3 {
  margin: 0;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-head .hint {
  margin: 0;
}

.drawer-body {
  padding: 14px 18px 18px;
  overflow-y: auto;
}

.pads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 9px;
}

.pad {
  position: relative;
  border-radius: 13px;
  padding: 11px 10px;
  min-height: 74px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

.pad:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line-2);
  transform: translateY(-1px);
}

.pad:active,
.pad.playing {
  transform: scale(0.97);
  border-color: var(--pad-color, var(--accent));
  box-shadow: 0 0 0 1px var(--pad-color, var(--accent)), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.pad-emoji {
  font-size: 20px;
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}

.pad-name {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pad-key {
  position: absolute;
  top: 7px;
  right: 8px;
  font-size: 9.5px;
  color: var(--muted-2);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  padding: 1px 5px;
}

.pad-del {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: none;
  place-items: center;
  background: rgba(255, 77, 109, 0.85);
  color: #fff;
}

.pad:hover .pad-del {
  display: grid;
}

.pad-del .ico {
  width: 12px;
  height: 12px;
}

.drawer-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.drawer-controls .hint {
  margin: 0;
}

.slider-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: var(--muted);
}

input[type="range"].slider {
  -webkit-appearance: none;
  appearance: none;
  width: 130px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #dfe3f2;
  box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.25);
  cursor: pointer;
}

/* ===================== MODALS ===================== */

.modals {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(4, 5, 10, 0.66);
  backdrop-filter: blur(8px);
}

.modals.open {
  display: grid;
  animation: fade 0.16s ease;
}

.modal {
  width: min(560px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #161a29, #10131e);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  animation: popIn 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

.modal.wide {
  width: min(880px, 100%);
}

.modal.narrow {
  width: min(430px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 16.5px;
  letter-spacing: -0.3px;
  flex: 1;
}

.modal-head .sub {
  font-size: 12px;
  color: var(--muted-2);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  min-height: 0;
}

.modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
}

.modal-foot .spacer {
  flex: 1;
}

.modal-tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.modal-tab {
  height: 42px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted-2);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.modal-tab:hover {
  color: var(--text);
}

.modal-tab.active {
  color: #fff;
  border-bottom-color: var(--accent);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.form-row:last-child {
  border-bottom: 0;
}

.form-row .label {
  font-size: 13px;
  font-weight: 500;
}

.form-row .desc {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 3px;
  line-height: 1.45;
  max-width: 330px;
}

.form-row select,
select.input {
  height: 38px;
  min-width: 170px;
  border-radius: 10px;
  background: rgba(6, 8, 14, 0.8);
  border: 1px solid var(--line-2);
  padding: 0 10px;
  color: var(--text);
  outline: none;
}

.form-row select:focus {
  border-color: rgba(124, 140, 255, 0.7);
}

.switch {
  position: relative;
  width: 44px;
  height: 25px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.18s;
  flex: none;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.switch.on {
  background: linear-gradient(135deg, #3ddc84, #12b8a6);
}

.switch.on::after {
  transform: translateX(19px);
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-2);
  font-size: 11px;
  font-family: inherit;
  color: #cfd4e6;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 20px 0 10px;
}

.section-title:first-child {
  margin-top: 0;
}

/* Пресеты войс-ченджера */

.presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.preset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.preset:hover {
  background: rgba(255, 255, 255, 0.07);
}

.preset .p-emoji {
  font-size: 20px;
}

.preset .p-name {
  font-size: 12px;
  font-weight: 600;
}

.preset.active {
  border-color: rgba(140, 155, 255, 0.65);
  background: linear-gradient(160deg, rgba(61, 220, 132, 0.22), rgba(18, 184, 166, 0.1));
  box-shadow: 0 0 0 1px rgba(140, 155, 255, 0.25);
}

.preset.active::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 9px;
  font-size: 11px;
  color: #b9c2ff;
}

.preset {
  position: relative;
}

/* Пресеты стрима */

.quality-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quality-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.quality-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.quality-row.active {
  border-color: rgba(140, 155, 255, 0.6);
  background: rgba(61, 220, 132, 0.12);
}

.quality-row .q-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  flex: none;
  position: relative;
}

.quality-row.active .q-radio {
  border-color: #8b9bff;
}

.quality-row.active .q-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #8b9bff;
}

.quality-row .q-info {
  flex: 1;
  min-width: 0;
}

.quality-row .q-name {
  font-size: 13px;
  font-weight: 600;
}

.quality-row .q-desc {
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 2px;
}

.quality-row .q-rate {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Выбор экрана */

.screens {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.screen-source {
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  text-align: left;
  transition: border-color 0.15s, transform 0.15s;
}

.screen-source:hover {
  border-color: rgba(140, 155, 255, 0.55);
  transform: translateY(-2px);
}

.screen-source img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #05070c;
  border-bottom: 1px solid var(--line);
}

.screen-source .src-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  font-size: 11.5px;
  color: #cfd4e6;
  overflow: hidden;
}

.screen-source .src-meta img {
  width: 16px;
  height: 16px;
  aspect-ratio: auto;
  border: 0;
  background: none;
  border-radius: 4px;
}

.screen-source .src-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Статистика */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.stat-card {
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
}

.stat-card .sc-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-card .sc-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-card .sc-sub {
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 3px;
}

.stat-card.accent {
  border-color: rgba(140, 155, 255, 0.3);
  background: linear-gradient(160deg, rgba(61, 220, 132, 0.16), rgba(18, 184, 166, 0.05));
}

.chart-box {
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  padding: 12px 12px 6px;
}

.chart-box .cb-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.chart-box .cb-head b {
  color: var(--text);
  font-weight: 600;
}

.chart-box canvas {
  width: 100%;
  height: 110px;
  display: block;
}

.chart-box.tall canvas {
  height: 150px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}

.data-table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted-2);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #cfd4e6;
  font-variant-numeric: tabular-nums;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.data-table .num {
  text-align: right;
}

.data-table .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 7px;
}

.stream-table-wrap {
  max-height: 230px;
  overflow: auto;
}

/* Приглашение */

.invite-modal-addr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-2);
  margin: 4px 0 14px;
}

.invite-modal-addr code {
  flex: 1;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 16px;
  color: #dfe4ff;
  user-select: text;
}

.steps {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  position: relative;
  padding-left: 32px;
  font-size: 12.5px;
  color: #b9bed2;
  line-height: 1.5;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 21px;
  height: 21px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(61, 220, 132, 0.18);
  border: 1px solid rgba(140, 155, 255, 0.35);
  color: #b9c2ff;
  font-size: 10.5px;
  font-weight: 700;
}

.callout {
  margin-top: 14px;
  padding: 12px 13px;
  border-radius: 12px;
  background: rgba(255, 200, 87, 0.07);
  border: 1px solid rgba(255, 200, 87, 0.22);
  color: #f0d79a;
  font-size: 11.5px;
  line-height: 1.55;
}

.callout b {
  color: #ffe3ab;
}

/* ===================== TOASTS ===================== */

.toasts {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(22, 26, 41, 0.96);
  border: 1px solid var(--line-2);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
  font-size: 12.5px;
  color: #dfe3f0;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1), opacity 0.2s;
  max-width: 520px;
}

.toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8b9bff;
  box-shadow: 0 0 10px rgba(139, 155, 255, 0.7);
  flex: none;
}

.toast-success .toast-dot {
  background: var(--green);
  box-shadow: 0 0 10px rgba(46, 230, 168, 0.7);
}

.toast-error .toast-dot {
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 77, 109, 0.7);
}

.toast-warn .toast-dot {
  background: var(--yellow);
  box-shadow: 0 0 10px rgba(255, 200, 87, 0.6);
}

.audio-sink {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ===================== ANIMATIONS ===================== */

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes ringPulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 230, 168, 0.35); }
  70% { box-shadow: 0 0 0 14px rgba(46, 230, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 230, 168, 0); }
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 1280px) {
  .chatpane { width: 330px; }
  .members { width: 210px; }
}

@media (max-width: 1120px) {
  .app { grid-template-columns: 64px 220px minmax(0, 1fr); }
  .members { display: none; }
  .welcome-inner { grid-template-columns: 1fr; gap: 34px; padding: 30px 22px; }
  .feature-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 60px 200px minmax(0, 1fr); }
  .chatpane { display: none; }
  .tiles.streams { grid-template-columns: 1fr; }
}

/* ===================== АККАУНТЫ, СЕРВЕРЫ, ЛС ===================== */

.rail-logo {
  border: 0;
  cursor: default;
  padding: 0;
  flex: none;
}

.rail-home {
  margin-bottom: 2px;
}

.rail-home.active {
  color: #fff;
  background: linear-gradient(150deg, rgba(61, 220, 132, 0.5), rgba(18, 184, 166, 0.3));
  border-color: rgba(140, 155, 255, 0.45);
}

.rail-nav {
  width: 100%;
  align-items: center;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 240px);
  padding: 2px 0;
  scrollbar-width: none;
}

.rail-nav::-webkit-scrollbar {
  display: none;
}

.rail-server {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: border-radius 0.15s, transform 0.15s, box-shadow 0.15s;
  flex: none;
}

.rail-server:hover {
  border-radius: 16px;
  transform: translateY(-1px);
}

.rail-server.active {
  border-radius: 16px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 8px 22px rgba(0, 0, 0, 0.35);
}

.rail-server.active::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #8b9bff, #12b8a6);
}

.rail-add {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
  color: #9aa0b8;
  flex: none;
}

.rail-add:hover {
  color: #fff;
  border-color: rgba(140, 155, 255, 0.55);
  background: rgba(61, 220, 132, 0.12);
}

.dm-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.13s;
}

.dm-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dm-item.active {
  background: linear-gradient(90deg, rgba(61, 220, 132, 0.22), rgba(61, 220, 132, 0.05));
}

.dm-item .avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 11px;
}

.dm-info {
  flex: 1;
  min-width: 0;
}

.dm-name {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-name .online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(46, 230, 168, 0.7);
  flex: none;
}

.dm-preview {
  font-size: 11.5px;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

.dm-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #3ddc84;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.dm-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.55;
}

.dm-empty b {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.msg.dm .msg-name {
  color: #fff;
}

.popover {
  position: fixed;
  right: 18px;
  bottom: 74px;
  width: 260px;
  background: #151a28;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  padding: 8px;
  z-index: 150;
  animation: popIn 0.14s ease;
}

.popover-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.popover-head .avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 13px;
}

.popover-name {
  font-weight: 700;
  font-size: 13.5px;
}

.popover-sub {
  color: var(--muted-2);
  font-size: 11px;
}

.popover-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  color: #cfd4e6;
  font-size: 12.5px;
  text-align: left;
}

.popover-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.popover-btn.danger {
  color: #ff9db0;
}

.popover-btn.danger:hover {
  background: rgba(255, 77, 109, 0.12);
}

.server-color-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.invite-code {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 20px;
  letter-spacing: 3px;
  color: #dfe4ff;
  user-select: text;
}

.settings-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.settings-section h4 {
  margin: 0 0 4px;
  font-size: 13.5px;
}

.settings-section .desc {
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.member.offline {
  opacity: 0.55;
}

.member .online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.sidebar-empty {
  padding: 18px 12px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.welcome-card .btn-lg {
  margin-top: 2px;
}

.welcome-card #w-host-hint {
  margin: 8px 0 16px;
}

.cloud-link {
  display: inline-block;
  margin: -6px 0 16px;
  padding: 0;
  color: #8fa0ff;
  font-size: 11.5px;
  text-align: left;
}

.cloud-link:hover {
  color: #c0c9ff;
  text-decoration: underline;
}

.welcome-card #w-color-field.hidden {
  display: none;
}

.avatar-img {
  overflow: hidden;
  background: #0b0d15;
}

.avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rail-server img,
.server-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 700;
  border: 1px solid currentColor;
  opacity: 0.9;
  margin-left: 4px;
  vertical-align: middle;
}

.server-badge.big {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 20px;
  flex: none;
}

.role-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.role-row:last-child {
  border-bottom: 0;
}

.role-member {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.role-member:last-child {
  border-bottom: 0;
}

.role-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--muted);
  cursor: pointer;
}

.role-chip input {
  accent-color: #3ddc84;
  width: 12px;
  height: 12px;
}

.role-chip:has(input:checked) {
  border-color: rgba(140, 155, 255, 0.5);
  background: rgba(61, 220, 132, 0.1);
  color: #dfe3f2;
}

/* Полноэкранный просмотр стрима */

.stream-focus {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.stream-focus video {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: #000;
}

.stream-focus .sf-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent);
  opacity: 1;
  transition: opacity 0.2s;
}

.stream-focus:hover .sf-top,
.stream-focus:focus-within .sf-top {
  opacity: 1;
}

.sf-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 13px;
  text-shadow: 0 1px 6px #000;
}

.sf-stats {
  display: flex;
  gap: 5px;
  margin-left: auto;
  flex-wrap: wrap;
}

.sf-actions {
  display: flex;
  gap: 4px;
}

.sf-actions .icon-btn {
  background: rgba(10, 12, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
}

.stream-focus-open {
  overflow: hidden;
}

/* Экономный режим: без анимаций и переходов */
body.eco *,
body.eco *::before,
body.eco *::after {
  animation-duration: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0s !important;
}

/* Камеры: плитка вместо аватара и оверлей на демке */
.tile-camera video {
  object-fit: cover;
}

.tile-camera .tile-top {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent);
}

.screen-cams {
  --cam-size: 170px;
  position: absolute;
  right: 12px;
  bottom: 52px;
  z-index: 8;
  width: min(62%, 760px);
  max-height: 62%;
  padding: 8px;
  border-radius: 12px;
  background: rgba(8, 10, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  overflow: auto;
}

.sc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 7px;
  color: #dfe3f2;
  font-size: 11px;
  font-weight: 600;
}

.sc-head b {
  color: #a5b0ff;
  margin-left: 3px;
}

.sc-head > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sc-actions {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.sc-actions .icon-btn {
  width: 24px;
  height: 24px;
  color: #cfd5e8;
}

.sc-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--cam-size), 1fr));
  gap: 7px;
}

.screen-cam {
  position: relative;
  aspect-ratio: 16 / 9;
  min-width: var(--cam-size);
  border-radius: 8px;
  overflow: hidden;
  background: #05070d;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.screen-cam > .avatar {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 42px !important;
  height: 42px !important;
}

.screen-cam video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sc-name {
  position: absolute;
  z-index: 2;
  left: 6px;
  bottom: 5px;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(4, 6, 12, 0.68);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.sc-fs {
  position: absolute;
  z-index: 2;
  right: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  background: rgba(4, 6, 12, 0.6);
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
}

.screen-cam:hover .sc-fs {
  opacity: 1;
}

.screen-cams.cams-hidden .sc-list {
  display: none;
}

.screen-cams.cams-hidden {
  width: auto;
  min-width: 150px;
  max-height: none;
}

/* GIF-панель */
.chat-gif {
  display: block;
  max-width: 340px;
  max-height: 260px;
  margin-top: 5px;
  border-radius: 9px;
  border: 1px solid var(--line);
  object-fit: contain;
  background: #05070d;
}

.gif-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 60px;
  z-index: 60;
  max-width: 520px;
  max-height: min(440px, 62vh);
  display: flex;
  flex-direction: column;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(13, 16, 28, 0.98);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.gif-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px;
  border-bottom: 1px solid var(--line);
}

.gif-head input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.gif-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  overflow-y: auto;
}

.gif-item {
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #05070d;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  border: 1px solid transparent;
}

.gif-item:hover {
  border-color: rgba(140, 155, 255, 0.65);
}

.gif-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gif-hint {
  padding: 6px 10px 9px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
}

#btn-gif {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #c9d0ff;
}

/* Активности: CS 1.6 внутри Nexus */
.modal.activity-modal {
  width: min(1280px, 95vw);
  max-width: none;
  height: min(840px, 90vh);
  display: flex;
  flex-direction: column;
}

.activity-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.ah-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  white-space: nowrap;
}

.ah-title .sub {
  color: var(--muted-2);
  font-size: 11px;
}

.ah-tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.ah-actions {
  display: flex;
  gap: 4px;
}

.activity-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #05070d;
}

.activity-webview {
  width: 100%;
  height: 100%;
  flex: 1;
  border: 0;
  background: #05070d;
}

.activity-hint {
  padding: 5px 10px;
  font-size: 10.5px;
  color: var(--muted-2);
  background: #0b0e18;
  border-top: 1px solid var(--line);
  text-align: center;
}

/* Чат открывается по кнопке, а не всегда справа */
.app.voice-mode .chatpane { display: none; }
.app.voice-mode.chat-open .content { position: relative; }
.app.voice-mode.chat-open .chatpane {
  display: flex;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 92vw);
  z-index: 30;
  box-shadow: -24px 0 60px rgba(0,0,0,.55);
}
.app.text-mode .chatpane {
  display: flex;
  position: static;
  width: auto;
  flex: 1;
}

/* Кнопка удаления сообщения */
.msg { position: relative; }
.msg-del {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 24px;
  height: 24px;
  display: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(10,12,20,.9);
  color: #ff9db0;
}
.msg:hover .msg-del { display: grid; }

.channel .ch-actions { display: none; margin-left: auto; gap: 2px; }
.channel:hover .ch-actions { display: inline-flex; }
.ch-actions .ch-btn { width: 22px; height: 22px; padding: 0; opacity: .75; }
.ch-actions .ch-btn:hover { opacity: 1; }

.member-mute {
  width: 22px; height: 22px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 6px;
  background: transparent; color: var(--muted-2); margin-left: 2px;
}
.member-mute:hover { color: #fff; border-color: var(--line-2); }
.chat-img { max-width: 340px; max-height: 260px; border-radius: 9px; display: block; margin-top: 5px; }
.chat-file { display: inline-flex; gap: 6px; margin-top: 5px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: #b9c6ff; }

/* GIF-панель: не растягиваем гифки, сохраняем пропорции */
.gif-results { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.gif-item { aspect-ratio: auto; height: auto; min-height: 80px; display: block; }
.gif-item img { width: 100%; height: auto; max-height: 220px; object-fit: contain; }

.audit-list { max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.audit-row { display: grid; grid-template-columns: 135px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 12.5px; }
.audit-row:last-child { border-bottom: 0; }
.audit-time { color: var(--muted-2); font-size: 11px; white-space: nowrap; }
.settings-actions { margin-top: 10px; display: flex; justify-content: flex-end; }

.soundpad-menu {
  position: fixed; z-index: 500; min-width: 220px; padding: 5px;
  background: #10141f; border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 18px 50px #000a;
}
.soundpad-menu button {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; padding: 8px 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text); text-align: left; cursor: pointer; font-size: 12.5px;
}
.soundpad-menu button:hover { background: #1a2030; }
.soundpad-menu .hint { font-size: 10.5px; }

.pad-edit {
  position: absolute; top: 5px; left: 5px; z-index: 2;
  width: 20px; height: 20px; display: grid; place-items: center;
  border-radius: 5px; background: #0b0e18cc; color: #dbe3ff; font-size: 12px; cursor: pointer;
}
.pad-edit:hover { background: #3ddc84; }

/* Театр: демка + камеры + аватары в сетке */
.sf-theater { display: block; padding-top: 52px; }
.sf-grid {
  position: absolute; inset: 52px 0 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 6px;
  padding: 6px;
  background: #05070d;
}
.sf-tile {
  position: relative; overflow: hidden; min-height: 0;
  border-radius: 8px; background: #0b0f18;
  display: grid; place-items: center;
}
.sf-tile video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.sf-tile .sf-avatar { position: absolute; inset: 0; display: grid; place-items: center; }
.sf-tile video + .sf-avatar { display: none; }
.sf-label {
  position: absolute; left: 8px; bottom: 7px; z-index: 2;
  padding: 3px 7px; border-radius: 5px;
  background: #05070dcc; color: #fff; font-size: 11.5px;
  max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sf-tile.sf-screen { border: 1px solid #29345a; }
@media (max-width: 700px) {
  .sf-grid { grid-template-columns: 1fr; }
}
.sf-tile.sf-no-video .sf-avatar { display: grid; }
.sf-tile.sf-no-video video { display: none; }

/* Полноэкранное уведомление от администратора */
.admin-notice {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: rgba(3,5,12,.92); backdrop-filter: blur(10px);
}
.admin-notice-card {
  width: min(560px, 92vw); padding: 32px; text-align: center;
  background: #0d1220; border: 1px solid #5b2b3a; border-radius: 18px;
  box-shadow: 0 30px 100px #000;
}
.admin-notice-icon { font-size: 44px; margin-bottom: 10px; }
.admin-notice-card h2 { margin: 0 0 10px; font-size: 24px; }
.admin-notice-card p { margin: 0 0 14px; color: #c3c8da; font-size: 14px; white-space: pre-line; }
.admin-notice-until { margin-bottom: 16px; color: #ffd28a; font-size: 13px; }

/* Мини-окно демки */
.stream-mini{position:fixed;right:18px;bottom:86px;z-index:80;width:min(360px,42vw);background:#0b101b;border:1px solid #334063;border-radius:14px;overflow:hidden;box-shadow:0 20px 60px #000b}
.stream-mini video{display:block;width:100%;aspect-ratio:16/9;background:#000;object-fit:contain;cursor:zoom-in}
.mini-head{display:flex;align-items:center;gap:7px;padding:8px 10px;background:#111827;font-size:12px}
.mini-head b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mini-dot{width:7px;height:7px;border-radius:50%;background:#22c55e;flex:none}
.mini-btn{margin-left:auto;border:0;background:transparent;color:#cbd5f5;cursor:pointer;padding:2px;display:flex}
.mini-btn+.mini-btn{margin-left:2px}
.mini-foot{padding:5px 10px;color:#8b94b2;font-size:10.5px;background:#0d1320}
@media(max-width:700px){.stream-mini{width:46vw;right:8px;bottom:74px}}
