:root {
  color-scheme: dark;
  --bg-0: #07090d;
  --bg-1: #0d1117;
  --bg-2: #141a22;
  --panel: rgba(16, 21, 29, 0.92);
  --panel-2: rgba(20, 26, 35, 0.94);
  --panel-3: rgba(27, 34, 44, 0.98);
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.13);
  --line-accent: rgba(255, 136, 31, .28);
  --text: #eef3f9;
  --muted: #96a3b5;
  --muted-2: #6e7b8d;
  --accent: #ff881f;
  --accent-2: #ffab57;
  --accent-3: #ffcf8e;
  --ok: #45d483;
  --warn: #f2c056;
  --danger: #ff6b7a;
  --shadow-lg: 0 30px 80px rgba(0,0,0,.45);
  --shadow-md: 0 14px 40px rgba(0,0,0,.28);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.5;
  background:
    radial-gradient(circle at top right, rgba(255,136,31,.18), transparent 20%),
    radial-gradient(circle at 18% 14%, rgba(44,108,255,.14), transparent 24%),
    linear-gradient(180deg, #0a0d12 0%, #0b1015 40%, #07090d 100%);
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #fff; }
button, input, textarea, select { font: inherit; }
input, textarea, select { color: var(--text); }
img { max-width: 100%; }

.shell { min-height: 100vh; }
.stage { width: min(100% - 32px, 1520px); margin: 0 auto; }
.stage-page { padding: 22px 0 110px; }
.shell-watermark {
  position: fixed; inset: auto auto 18px 22px; width: 96px; height: 96px; pointer-events: none;
  background: radial-gradient(circle, rgba(255,136,31,.09), transparent 70%);
  filter: blur(14px); opacity: .5;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(7,9,13,.72);
  backdrop-filter: blur(18px);
}
.topbar-inner { width: min(100% - 32px, 1520px); margin: 0 auto; min-height: 78px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.brand-banner-link { display: inline-flex; max-width: min(100%, 620px); }
.brand-banner-image { display:block; width:100%; height:auto; object-fit:contain; }

.card, .auth-card, .panel, .workspace-sidebar, .room-sidebar, .subpanel, .settings-card-v3, .admin-user-card-v3 {
  background:
    linear-gradient(180deg, rgba(19,25,34,.96), rgba(12,16,23,.98)),
    radial-gradient(circle at top right, rgba(255,136,31,.06), transparent 28%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-xl);
}

.workspace-v3-shell, .room-shell-app { display:grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; align-items:start; }
.room-main-v3 { display:grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; }
.workspace-main-v3, .settings-main-v3 { min-width: 0; }

.v3-sidebar {
  position: sticky; top: 22px; padding: 18px; display:grid; gap:18px;
  background:
    linear-gradient(180deg, rgba(14,19,27,.98), rgba(10,14,20,.98)),
    radial-gradient(circle at top right, rgba(255,136,31,.08), transparent 24%);
}
.sidebar-brand-row, .panel-head-spread, .section-title-row, .chat-header, .device-card-head-clean, .activity-card-clean, .user-row-v3, .admin-user-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.sidebar-brand-row { margin-bottom: 2px; }
.icon-button, .icon-action {
  width: 46px; height: 46px; border-radius: 16px; border:1px solid var(--line); background: rgba(255,255,255,.03);
  display:grid; place-items:center; color:var(--text); cursor:pointer; transition:.18s ease;
}
.icon-button:hover, .icon-action:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--line-accent); background: rgba(255,136,31,.1); }
.icon-action:disabled { opacity:.45; cursor:not-allowed; }
.icon-action-accent { background: linear-gradient(135deg, rgba(255,136,31,.24), rgba(255,175,89,.1)); border-color: rgba(255,136,31,.26); }
.icon-action-neutral { background: rgba(255,255,255,.05); }
.icon-action-small { width: 38px; height: 38px; border-radius: 12px; }

.profile-chip {
  display:grid; grid-template-columns: 56px minmax(0, 1fr); gap:14px; align-items:center;
  padding: 14px; border-radius: 24px; border:1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
}
.profile-chip:hover { border-color: var(--line-accent); background: linear-gradient(180deg, rgba(255,136,31,.08), rgba(255,255,255,.02)); }
.profile-chip-copy { display:grid; gap:3px; min-width: 0; }
.profile-chip-copy strong { font-size: 1rem; }
.profile-chip-copy span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presence-chip { display:inline-flex; align-items:center; justify-content:center; width:max-content; max-width:100%; padding:4px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.08); font-size:.79rem; font-weight:700; letter-spacing:.01em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.presence-chip.presence-online { color:#bff5cf; background:rgba(69,212,131,.14); border-color:rgba(69,212,131,.28); }
.presence-chip.presence-busy { color:#ffd6ae; background:rgba(255,136,31,.15); border-color:rgba(255,136,31,.28); }
.presence-chip.presence-dnd { color:#ffbcbc; background:rgba(255,107,107,.15); border-color:rgba(255,107,107,.28); }
.presence-chip.presence-invisible { color:#c8d0db; background:rgba(173,181,189,.14); border-color:rgba(173,181,189,.24); }
.avatar-circle, .profile-avatar-fallback {
  width: 56px; height: 56px; border-radius: 18px; display:grid; place-items:center; font-weight:800;
  background: linear-gradient(135deg, rgba(255,136,31,.9), rgba(255,177,95,.75)); color:#130a02;
  box-shadow: 0 10px 30px rgba(255,136,31,.25);
}
.avatar-circle-image, .mini-avatar-image, .profile-avatar-preview { object-fit:cover; }
.avatar-circle-image { width:56px; height:56px; border-radius:18px; }
.mini-avatar, .room-title-token {
  width: 42px; height: 42px; border-radius: 14px; display:grid; place-items:center; font-weight:800; flex: 0 0 auto;
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); color: var(--text);
  border: 1px solid rgba(255,255,255,.08);
}
.avatar-0 { background: linear-gradient(135deg, #fe9a35, #ffcc80); color:#1d1206; }
.avatar-1 { background: linear-gradient(135deg, #79b8ff, #d0e6ff); color:#08131f; }
.avatar-2 { background: linear-gradient(135deg, #8be4b8, #d6ffe9); color:#07180f; }
.avatar-3 { background: linear-gradient(135deg, #d39aff, #f0dbff); color:#150822; }

.search-shell {
  display:grid; grid-template-columns: 20px 1fr auto; gap:10px; align-items:center;
  padding: 12px 14px; border-radius: 18px; border:1px solid var(--line); background: rgba(255,255,255,.03);
}
.search-input { background: transparent; border:0; outline:none; min-width:0; }
.search-input::placeholder { color: var(--muted-2); }
.search-shortcut, .badge, .status-pill, .status-chip {
  display:inline-flex; align-items:center; gap:8px; padding: 8px 11px; border-radius: 999px;
  border:1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); font-size: .8rem;
}
.badge-muted { background: rgba(255,255,255,.03); }
.status-chip, .status-pill { color: var(--text); }
.status-ok { border-color: rgba(69,212,131,.25); background: rgba(69,212,131,.08); color: #acf0ca; }

.sidebar-section, .compact-section { display:grid; gap:12px; }
.section-label, .eyebrow { margin:0; text-transform: uppercase; letter-spacing:.14em; font-size:.72rem; color: var(--muted-2); font-weight:700; }
.eyebrow { color: var(--accent-3); }
.sidebar-list, .modern-list, .participant-list, .security-card-list, .user-list-v3, .activity-log { display:grid; gap:10px; }
.sidebar-link-form, .footer-nav-form, .inline-action-form, .participant-action, .inline-form { margin:0; }
.sidebar-link-row, .participant-row, .user-row-v3, .device-card-clean, .activity-card-clean, .sidebar-stat-card, .room-current-card, .signal-card, .hero-stat-card, .empty-card, .empty-sidebar-note {
  border-radius: 20px; border:1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.035);
}
.sidebar-link-row, .participant-row, .user-row-v3 { display:flex; align-items:center; gap:12px; padding: 12px 13px; color: var(--text); }
.sidebar-link-row:hover, .participant-row:hover, .user-row-v3:hover, .signal-card-link:hover { border-color: var(--line-accent); background: rgba(255,136,31,.08); }
.sidebar-link-row-button { width:100%; cursor:pointer; text-align:left; }
.sidebar-link-copy, .participant-main, .user-meta-modern { display:grid; gap:3px; min-width:0; flex:1; }
.sidebar-link-copy span, .participant-main span, .user-meta-modern span, .muted-copy, .lead, .auth-alt, .field-hint { color: var(--muted); }
.sidebar-link-meta { color: var(--accent-3); font-size: .82rem; }
.empty-sidebar-note, .empty-card { padding: 16px; color: var(--muted); }
.sidebar-footer-nav { display:grid; gap:10px; margin-top:auto; }
.footer-nav-link, .footer-nav-button, .button {
  border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.03); color: var(--text);
  padding: 12px 16px; cursor:pointer; transition: .18s ease; display:inline-flex; justify-content:center; align-items:center; gap:10px;
}
.footer-nav-link:hover, .footer-nav-button:hover, .button:hover { transform: translateY(-1px); border-color: var(--line-accent); }
.footer-nav-danger, .button-danger { border-color: rgba(255,107,122,.22); background: rgba(255,107,122,.08); }
.button-primary { background: linear-gradient(135deg, rgba(255,136,31,.9), rgba(255,175,89,.82)); color:#1b1004; border-color: transparent; font-weight:800; }
.button-primary:hover { box-shadow: 0 12px 34px rgba(255,136,31,.28); }
.button-secondary, .button-ghost { background: rgba(255,255,255,.04); color: var(--text); }
.button-block { width:100%; }
.button-wide, .button-wide-mobile { width:100%; }

.home-command-center, .room-chat-panel-v3, .members-panel-v3, .settings-card-v3, .admin-card-v3 { padding: 22px; }
.command-hero-grid { display:grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .9fr); gap:18px; margin-bottom:18px; }
.command-hero-copy {
  padding: 24px; border-radius: 28px; border:1px solid rgba(255,255,255,.06);
  background:
    radial-gradient(circle at 78% 18%, rgba(255,136,31,.18), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
}
.command-hero-copy h1, .auth-copy-block h1 { margin: 6px 0 10px; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.02; }
.hero-lead { max-width: 58ch; color: var(--muted); font-size: 1.05rem; }
.hero-stat-strip, .command-hero-side { display:grid; gap:12px; }
.hero-stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 22px; }
.hero-stat-card, .signal-card { padding: 16px 18px; }
.hero-stat-card strong { display:block; font-size: 1.6rem; margin-bottom:4px; }
.signal-card { display:grid; gap:8px; min-height: 120px; }
.signal-card-kicker { color: var(--accent-3); font-size:.76rem; text-transform: uppercase; letter-spacing:.14em; }
.home-grid-v3 { display:grid; grid-template-columns: minmax(370px, .95fr) minmax(320px, 1.05fr); gap:18px; }
.subpanel-v3 { padding: 18px; display:grid; gap:18px; }
.subpanel-head-v3 { align-items:flex-start; }
.subpanel-head h3, .panel-head-spread h2, .chat-header h2, .members-head p.section-label, .auth-card h1 { margin: 4px 0 0; font-size: 1.4rem; }

.field, .actions, .stack-md, .stack-sm, .security-form-clean, .form-grid, .profile-fields-card, .profile-avatar-card, .settings-grid-v3, .admin-user-grid-v3 { display:grid; gap:14px; }
.label, label > span { display:block; margin-bottom:8px; color:#d9e2ef; font-size:.9rem; font-weight:600; }
.input, input[type="text"], input[type="password"], input[type="search"], select, textarea {
  width:100%; border-radius: 16px; border:1px solid rgba(255,255,255,.09); background: rgba(6,10,15,.72); color:var(--text);
  padding: 13px 14px; outline:none; transition:.18s ease;
}
.input:focus, input:focus, textarea:focus, select:focus { border-color: rgba(255,136,31,.45); box-shadow: 0 0 0 4px rgba(255,136,31,.08); }
.textarea-like { min-height: 120px; resize: vertical; }
.field-error { margin:0; color:#ffc1c8; font-size:.86rem; }
.checkbox-row, .checkbox-inline { display:flex; align-items:center; gap:10px; color: var(--text); }
.checkbox-row input, .checkbox-inline input { accent-color: var(--accent); }
.flash-stack { display:grid; gap:10px; margin-bottom: 16px; }
.flash { padding: 13px 14px; border-radius: 16px; border:1px solid var(--line); background: rgba(255,255,255,.04); }
.flash-success { border-color: rgba(69,212,131,.24); background: rgba(69,212,131,.08); }
.flash-error, .flash-message-error { border-color: rgba(255,107,122,.24); background: rgba(255,107,122,.08); }
.flash-warning { border-color: rgba(242,192,86,.24); background: rgba(242,192,86,.08); }

.participant-row-check-modern { justify-content:space-between; }
.participant-row-check-modern input { inline-size: 18px; block-size: 18px; accent-color: var(--accent); }
.profile-settings-grid { display:grid; grid-template-columns: 300px minmax(0, 1fr); gap:18px; }
.profile-avatar-card, .profile-fields-card, .totp-box {
  padding:18px; border-radius: 22px; border:1px solid var(--line); background: rgba(255,255,255,.03);
}
.profile-avatar-preview { width: 100%; aspect-ratio: 1 / 1; border-radius: 26px; border:1px solid var(--line); background:#0a0f15; }
.profile-avatar-fallback { width: 100%; aspect-ratio: 1 / 1; font-size: 4rem; }

.room-current-card-v3, .sidebar-stat-card { padding: 16px; display:grid; gap:4px; }
.room-main-v3 { min-width: 0; }
.chat-header-v3 { align-items:flex-start; padding-bottom: 16px; border-bottom:1px solid var(--line); margin-bottom:16px; }
.chat-header-title-row-v3 { display:flex; gap:14px; align-items:center; }
.room-title-token { background: linear-gradient(135deg, rgba(255,136,31,.9), rgba(255,175,89,.72)); color:#130b04; box-shadow: 0 12px 28px rgba(255,136,31,.24); }
.chat-header-actions-v3 { flex-wrap:wrap; }
.room-status-band {
  display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:10px; margin-bottom:16px;
}
.status-row { display:flex; align-items:center; gap:10px; min-width:0; }
.technical-status-row { padding: 12px 14px; border-radius: 16px; border:1px solid var(--line); background: rgba(255,255,255,.03); }
.status-dot, .online-dot, .status-green-dot, .participant-indicator-live {
  width:10px; height:10px; border-radius:50%; display:inline-block; flex:0 0 auto;
}
.status-info, .presence-online, .status-green-dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(69,212,131,.12); }
.presence-busy { background: var(--warn); box-shadow: 0 0 0 4px rgba(242,192,86,.12); }
.presence-dnd, .presence-invisible { background: var(--danger); box-shadow: 0 0 0 4px rgba(255,107,122,.12); }
.online-dot-large { width: 12px; height:12px; }
.chat-body-v3 {
  min-height: 420px; max-height: calc(100vh - 410px); overflow:auto; padding-right: 4px; margin-bottom:14px;
}
.chat-log-v3 { display:flex; flex:1 1 auto; min-height:0; height:100%; max-height:100%; flex-direction:column; justify-content:flex-end; gap:12px; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; padding: 0 8px 0 0; scrollbar-gutter: stable; }
.chat-empty, .activity-entry {
  padding: 14px 16px; border-radius: 16px; border:1px dashed rgba(255,255,255,.12); color: var(--muted);
}
.chat-message {
  max-width: min(82%, 720px); padding: 14px 16px; border-radius: 24px 24px 24px 10px; border:1px solid var(--line);
  background: rgba(255,255,255,.04); display:grid; gap:8px; align-self:flex-start; box-shadow: 0 16px 34px rgba(0,0,0,.18);
}
.chat-message-own { margin-left:auto; align-self:flex-end; border-radius: 24px 24px 10px 24px; background: linear-gradient(135deg, rgba(255,136,31,.2), rgba(255,255,255,.06)); border-color: rgba(255,136,31,.22); }
.chat-message-author { font-size:.78rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color: var(--accent-3); }
.chat-message-own .chat-message-author { color:#ffd6ab; }
.chat-message-body { color: var(--text); line-height:1.55; word-break:break-word; white-space:pre-wrap; }
.chat-message-link { color: var(--accent-2); text-decoration: underline; text-decoration-color: rgba(255,171,87,.45); text-underline-offset: 3px; }

.chat-form-v3 { display:grid; grid-template-columns: auto minmax(0, 1fr) auto; gap:12px; margin-bottom:14px; align-items:center; }
.chat-input-modern { min-height: 48px; height:48px; padding: 0 16px; border-radius: 16px; }
.chat-send-button {
  min-width: 48px; height:48px; padding: 0 16px; border:0; border-radius: 16px; background: linear-gradient(135deg, rgba(255,136,31,.95), rgba(255,175,89,.82));
  color:#1b1004; font-weight:900; cursor:pointer; box-shadow: 0 16px 34px rgba(255,136,31,.22);
}
.trust-status-button {
  min-width: 48px;
  height: 48px;
  padding: 0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
  color: #f1b183;
  box-shadow: 0 16px 34px rgba(0,0,0,.18);
}
.trust-status-button-icon {
  display:flex;
  align-items:center;
  justify-content:center;
  line-height: 1;
}
.trust-status-button-svg {
  width: 20px;
  height: 20px;
}
.trust-status-button .trust-lock-body,
.trust-status-button .trust-lock-shackle {
  vector-effect: non-scaling-stroke;
}
.trust-status-button.is-unverified,
.trust-status-button.is-waiting,
.trust-status-button.is-warning {
  color: #f29a78;
  border-color: rgba(242,154,120,.28);
  background: linear-gradient(180deg, rgba(242,154,120,.12), rgba(255,255,255,.03));
  box-shadow: 0 16px 34px rgba(0,0,0,.2);
}
.trust-status-button.is-verified {
  color: #7ad9a3;
  border-color: rgba(122,217,163,.28);
  background: linear-gradient(180deg, rgba(122,217,163,.14), rgba(255,255,255,.03));
  box-shadow: 0 16px 34px rgba(0,0,0,.2);
}
.trust-status-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.16);
  filter: brightness(1.03);
}
.trust-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
}
.trust-modal[hidden] {
  display: none;
}
.trust-modal-backdrop {
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.68);
}
.trust-modal-panel {
  position: relative;
  width: min(calc(100% - 32px), 760px);
  max-height: calc(100vh - 64px);
  overflow: auto;
  margin: 32px auto;
  border-radius: 28px;
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(16,21,29,.98), rgba(10,14,20,.99));
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}
.trust-modal-header,
.trust-modal-subtitle {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.trust-modal-header {
  margin-bottom: 14px;
}
.trust-modal-subtitle {
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.room-trust-collapse, .security-collapse {
  border:1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.03); overflow:hidden;
}
.room-trust-collapse-summary, .security-collapse summary {
  list-style:none; cursor:pointer; padding: 16px 18px; display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.room-trust-collapse-summary::-webkit-details-marker, .security-collapse summary::-webkit-details-marker { display:none; }
.room-trust-panel, .device-grid-clean, .backup-code-grid { display:grid; gap:12px; padding: 0 18px 18px; }
.room-trust-summary-row { display:grid; gap:6px; }
.trust-pill-ok { border-color: rgba(69,212,131,.2); background: rgba(69,212,131,.1); color: #b6f2cf; }
.trust-card, .device-card-clean, .activity-card-clean {
  padding: 16px; border-radius: 20px; border:1px solid var(--line); background: rgba(255,255,255,.025);
}
.trust-card-copy, .trust-card-meta { display:grid; gap:6px; }
.trust-card-button { margin-top:10px; }
.room-trust-list, .room-trust-self { display:grid; gap:10px; }
.audio-controls-v3 { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:14px; margin-top:14px; }
input[type="range"] { accent-color: var(--accent); }

.members-panel-v3 { display:grid; gap:16px; height: fit-content; position: sticky; top: 22px; }
.activity-log-modern { max-height: 240px; overflow:auto; }
.participant-presence-row.is-self { border-color: rgba(69,212,131,.18); background: rgba(69,212,131,.08); }

.global-call-dock {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: min(calc(100% - 32px), 1040px); z-index: 60;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding: 14px 16px; border-radius: 24px; border:1px solid rgba(255,136,31,.18);
  background: rgba(8,11,16,.92); backdrop-filter: blur(18px); box-shadow: 0 24px 70px rgba(0,0,0,.45);
}
.global-call-dock-hidden { display:none; }
.global-call-dock-main, .global-call-dock-copy, .global-call-dock-meta, .global-call-dock-actions { display:flex; align-items:center; gap:12px; }
.global-call-dock-copy { min-width:0; }
.global-call-dock-room-button, .dock-action {
  border:1px solid var(--line); background: rgba(255,255,255,.04); color:var(--text); border-radius: 14px; padding: 10px 14px; cursor:pointer;
}
.dock-action-danger { border-color: rgba(255,107,122,.2); background: rgba(255,107,122,.08); }
.global-call-dock-live-dot-pulse { animation: pulse 1.5s infinite; background: var(--ok); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(69,212,131,.45);} 70% { box-shadow: 0 0 0 10px rgba(69,212,131,0);} 100% { box-shadow: 0 0 0 0 rgba(69,212,131,0);} }

.app-statusbar {
  position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 50;
  display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap;
  width: min(calc(100% - 32px), 760px);
}
.app-statusbar-item {
  display:flex; align-items:center; gap:10px; padding: 10px 14px; border-radius: 999px;
  background: rgba(7,9,13,.72); border:1px solid var(--line); backdrop-filter: blur(16px); color: var(--muted);
}
.status-version-link { color: var(--accent-3); }
.status-shield, .crypto-shield-icon { width:16px; height:16px; border-radius:5px; background: linear-gradient(135deg, rgba(255,136,31,.95), rgba(255,175,89,.72)); display:inline-block; }
.status-bars { display:inline-flex; gap:2px; }
.status-bars span { display:block; width:3px; border-radius:999px; background: var(--ok); }
.status-bars span:nth-child(1) { height:8px; } .status-bars span:nth-child(2) { height:11px; } .status-bars span:nth-child(3) { height:14px; }

.patchnotes-modal { position: fixed; inset: 0; pointer-events:none; opacity:0; transition:.2s ease; z-index:70; }
.patchnotes-modal:target { opacity:1; pointer-events:auto; }
.patchnotes-backdrop { position:absolute; inset:0; background: rgba(0,0,0,.65); }
.patchnotes-panel {
  position: relative; width:min(calc(100% - 32px), 780px); max-height: calc(100vh - 80px); overflow:auto; margin: 40px auto;
  border-radius: 28px; border:1px solid var(--line); background: linear-gradient(180deg, rgba(16,21,29,.98), rgba(10,14,20,.99)); padding: 22px;
}
.patchnotes-close { position:absolute; top:18px; right:18px; font-size: 1.4rem; }
.patchnotes-list, .patchnotes-entry { display:grid; gap:12px; }
.patchnotes-entry { padding: 16px; border-radius: 18px; border:1px solid var(--line); background: rgba(255,255,255,.03); }
.patchnotes-entry ul { margin:0; padding-left: 18px; color: var(--muted); }

.auth-wrap-v3, .auth-wrap-admin { min-height: calc(100vh - 120px); display:grid; grid-template-columns: minmax(320px, 1.1fr) minmax(320px, .9fr); gap:24px; align-items:center; }
.auth-hero-panel { padding: 28px; display:grid; gap:18px; }
.auth-copy-block { padding: 22px; border-radius: 28px; border:1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.03); }
.auth-card-v3, .admin-card-v3 { padding: 24px; }
.auth-brand-shell { width: min(100%, 540px); }
.auth-brand-banner-image { display:block; width:100%; height:auto; object-fit:contain; }
.auth-wrap-admin { grid-template-columns: 1fr; justify-items:center; }
.admin-shell-v3, .admin-card-v3 { width:min(100%, 1080px); }
.admin-user-grid-v3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.actions { display:flex; gap:10px; flex-wrap:wrap; }
.actions-stack-mobile form { margin:0; }

.device-grid-clean { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.device-grid-clean dt { color: var(--muted-2); font-size: .82rem; margin-bottom:6px; }
.device-grid-clean dd { margin:0; color: var(--text); word-break:break-word; }
.activity-side-clean { display:grid; gap:8px; justify-items:end; text-align:right; }
.backup-code-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.backup-code-grid code, .totp-box code {
  padding: 12px 14px; border-radius: 14px; border:1px solid rgba(255,255,255,.08); background: rgba(6,10,15,.62); color: #ffd9b1;
}

.incoming-call-box {
  position: fixed; right: 22px; bottom: 22px; z-index: 65; width: min(calc(100% - 32px), 360px);
  padding: 16px; border-radius: 24px; border:1px solid var(--line-accent); background: rgba(8,11,16,.94); box-shadow: var(--shadow-lg);
}
.incoming-call-box .button-row { display:flex; gap:10px; margin-top:14px; }

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

@media (max-width: 1320px) {
  .room-main-v3 { grid-template-columns: 1fr; }
  .members-panel-v3 { position: static; }
}
@media (max-width: 1160px) {
  .workspace-v3-shell, .room-shell-app, .auth-wrap-v3 { grid-template-columns: 1fr; }
  .v3-sidebar { position: static; }
  .command-hero-grid, .home-grid-v3, .profile-settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .stage { width: min(100% - 20px, 1520px); }
  .stage-page { padding-top: 72px; }
  .app-statusbar { top: auto; bottom: 100px; width: min(calc(100% - 20px), 760px); }
  .global-call-dock { bottom: 16px; width: min(calc(100% - 20px), 1040px); flex-direction:column; align-items:stretch; }
  .global-call-dock-main, .global-call-dock-actions { width:100%; justify-content:space-between; }
  .hero-stat-strip, .room-status-band, .audio-controls-v3, .device-grid-clean { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
}


.room-chat-panel-v3 {
  min-height: calc(100vh - 44px);
  display:grid;
  grid-template-rows: auto auto minmax(320px, 1fr) auto auto auto;
  overflow:hidden;
}
.chat-body-v3 {
  min-height: 320px;
  height: min(52vh, 620px);
  max-height: min(52vh, 620px);
  overflow:hidden;
  padding: 8px 0 8px 0;
  margin-bottom:14px;
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:0;
}
.chat-header-v3 { gap: 18px; flex-wrap:wrap; }
.room-header-meta-row-v3 { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:10px; }
.chat-header-actions-v3 { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.chat-header-actions-v3 .icon-action { width:auto; min-width: 120px; height:42px; padding: 0 14px; border-radius: 14px; display:inline-flex; gap:10px; }
.chat-header-actions-v3 .icon-action span:last-child { font-size:.92rem; font-weight:700; }
.icon-glyph { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; color: currentColor; }
.icon-glyph::before { content:""; display:block; width:18px; height:18px; background-repeat:no-repeat; background-position:center; background-size:18px 18px; }
.icon-glyph-phone::before { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f7fb' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.86 19.86 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.86 19.86 0 0 1 2.12 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.12.9.33 1.78.63 2.62a2 2 0 0 1-.45 2.11L8 9.91a16 16 0 0 0 6.09 6.09l1.46-1.29a2 2 0 0 1 2.11-.45c.84.3 1.72.51 2.62.63A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E"); }
.icon-glyph-check::before { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f7fb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.icon-glyph-speaker::before { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f7fb' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'/%3E%3Cpath d='M15.54 8.46a5 5 0 0 1 0 7.07'/%3E%3Cpath d='M19.07 4.93a10 10 0 0 1 0 14.14'/%3E%3C/svg%3E"); }
.icon-glyph-speaker-off::before { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f7fb' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'/%3E%3Cline x1='23' y1='9' x2='17' y2='15'/%3E%3Cline x1='17' y1='9' x2='23' y2='15'/%3E%3C/svg%3E"); }
.icon-glyph-exit::before { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f7fb' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E"); }
.icon-glyph-voice::before { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f7fb' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 1a3 3 0 0 1 3 3v8a3 3 0 0 1-6 0V4a3 3 0 0 1 3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='23'/%3E%3Cline x1='8' y1='23' x2='16' y2='23'/%3E%3C/svg%3E"); }
.device-status-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.status-chip-current { border-color: rgba(255,136,31,.24); background: rgba(255,136,31,.1); color:#ffd4a5; }
.status-chip-muted { color: var(--muted); }
.status-chip-danger { border-color: rgba(255,107,122,.22); background: rgba(255,107,122,.08); color:#ffc1c8; }
.trust-pill { display:inline-flex; align-items:center; justify-content:center; padding: 8px 12px; border-radius:999px; border:1px solid var(--line); font-size:.8rem; font-weight:700; }
.trust-pill-warning { border-color: rgba(242,192,86,.22); background: rgba(242,192,86,.08); color:#ffe3a6; }
.trust-pill-muted { background: rgba(255,255,255,.04); color: var(--muted); }
.trust-card-label { color: var(--muted-2); font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; }
.trust-card-state { display:inline-flex; width:fit-content; padding:8px 12px; border-radius:999px; border:1px solid var(--line); font-size:.82rem; font-weight:700; }
.trust-card-state-ok { border-color: rgba(69,212,131,.24); background: rgba(69,212,131,.08); color:#b6f2cf; }
.trust-card-state-warning { border-color: rgba(242,192,86,.24); background: rgba(242,192,86,.08); color:#ffe3a6; }
.trust-card-state-muted { background: rgba(255,255,255,.04); color: var(--muted); }
.global-call-dock-live-dot { width:10px; height:10px; min-width:10px; min-height:10px; border-radius:999px; display:inline-block; }
.app-statusbar-floating-corner { top:auto; left:auto; right:22px; bottom:22px; transform:none; width:auto; justify-content:flex-end; }
.app-statusbar-floating-corner .app-statusbar-item { box-shadow: 0 22px 50px rgba(0,0,0,.34); }
.status-version-link { font-weight:700; min-width: 72px; text-align:center; }
@media (max-width: 820px) {
  .app-statusbar-floating-corner { right:16px; bottom:16px; }
  .chat-header-actions-v3 .icon-action { min-width: calc(50% - 5px); flex:1 1 calc(50% - 5px); }
  .room-header-meta-row-v3 { align-items:stretch; }
  .room-chat-panel-v3 { min-height: auto; grid-template-rows: auto auto minmax(280px, 1fr) auto auto auto; }
  .chat-body-v3 { height: min(46vh, 520px); max-height: min(46vh, 520px); }
}

.headline-inline { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.headline-inline h3 { margin:0; }
.room-status-band-inline { display:flex; flex-wrap:wrap; gap:8px; margin-top:0; }
.room-status-band-inline .status-dot { display:none; }
.status-pill-compact { padding: 7px 11px; font-size:.78rem; gap:8px; }
.status-pill-warm { border-color: rgba(242,192,86,.24); background: rgba(242,192,86,.09); color:#ffe3a6; }
.status-pill-muted { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: var(--muted); }
.status-pill-ok { border-color: rgba(69,212,131,.24); background: rgba(69,212,131,.1); color:#b6f2cf; }
.status-pill-warning { border-color: rgba(255,136,31,.26); background: rgba(255,136,31,.1); color:#ffd4a5; }
.member-selector-collapse summary .label { margin:0; }
.member-selector-collapse[open] summary { border-bottom:1px solid var(--line); }
.member-selector-collapse .participant-list { padding-top:14px; }
.member-selector-collapse .badge { margin-left:auto; }
.subpanel-head-v3 { align-items:flex-start; }
.empty-card { margin-bottom: 14px; }


.settings-tab-shell { display:grid; gap:18px; }
.settings-tab-bar { display:flex; flex-wrap:wrap; gap:10px; padding: 10px; border-radius: 22px; border:1px solid var(--line); background: rgba(255,255,255,.03); }
.settings-tab-button { border:1px solid rgba(255,255,255,.08); border-radius: 999px; background: rgba(255,255,255,.03); color: var(--muted); padding: 10px 16px; cursor:pointer; transition:.18s ease; }
.settings-tab-button:hover { border-color: var(--line-accent); color: var(--text); }
.settings-tab-button.is-active { background: linear-gradient(135deg, rgba(255,136,31,.18), rgba(255,255,255,.05)); border-color: rgba(255,136,31,.28); color: var(--text); }
.settings-tab-panel { display:block; }
.settings-grid-v3-tab { margin: 0; }

.chat-body-v3 {
  min-height: 300px;
  height: min(48vh, 560px);
  max-height: min(48vh, 560px);
  padding: 2px 0 0 0;
  margin-bottom: 8px;
}
.chat-log-v3 { gap: 9px; padding: 0 6px 0 0; }
.chat-message { max-width: min(78%, 680px); padding: 11px 13px; border-radius: 20px 20px 20px 10px; gap: 6px; }
.chat-message-own { border-radius: 20px 20px 10px 20px; }
.chat-empty { padding: 12px 14px; }
.chat-form-v3 { gap: 10px; margin-bottom: 6px; }
.label-spread { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.chat-input-modern { min-height: 44px; height:44px; padding: 0 14px; border-radius: 14px; }
.chat-send-button { min-width: 44px; height:44px; border-radius: 14px; }
.room-chat-panel-v3 { grid-template-rows: auto auto minmax(300px, 1fr) auto auto auto; }

@media (max-width: 820px) {
  .settings-tab-bar { padding: 8px; }
  .settings-tab-button { flex:1 1 calc(33.333% - 7px); justify-content:center; text-align:center; }
  .chat-body-v3 { height: min(44vh, 480px); max-height: min(44vh, 480px); }
}


.contacts-hero-content { display:grid; gap:10px; align-content:start; }
.contacts-empty-card { margin-bottom:0; }
.contacts-user-list { margin-top:0; }
.contacts-user-copy { display:grid; gap:3px; }
.contacts-user-name { display:inline-flex; align-items:center; gap:8px; }
.contacts-user-name .online-dot { margin-right:0; }
.settings-tab-panel { display:none; }
.settings-tab-panel.is-active { display:block; }
.room-chat-panel-v3 { min-height: calc(100vh - 44px); grid-template-rows: auto minmax(260px, 1fr) auto auto auto; row-gap: 10px; }
.chat-header-v3 { padding-bottom: 10px; margin-bottom: 0; }
.room-header-meta-row-v3 { margin-top: 8px; gap: 10px; }
.chat-body-v3 { min-height: 260px; height: min(42vh, 500px); max-height: min(42vh, 500px); padding: 0; margin-bottom: 0; }
.chat-log-v3 { gap: 8px; padding: 0 4px 0 0; }
.chat-form-v3 { margin-top: 0; margin-bottom: 0; gap: 8px; }
.chat-input-modern { min-height: 42px; height: 42px; }
.chat-send-button { min-width: 42px; height: 42px; }
@media (max-width: 820px) {
  .room-chat-panel-v3 { grid-template-rows: auto minmax(240px, 1fr) auto auto auto; row-gap: 8px; }
  .chat-body-v3 { height: min(38vh, 420px); max-height: min(38vh, 420px); }
}


/* v3.09 fixes */
.contacts-hero-content {
  gap: 0;
  align-content: start;
}
.contacts-empty-card {
  margin: 0 0 10px 0;
}
.contacts-empty-card.hidden,
.contacts-empty-card[hidden],
.contacts-empty-card[aria-hidden="true"] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  min-height: 0 !important;
}
.contacts-user-list {
  margin-top: 0 !important;
  align-content: start;
}
.contacts-user-name .online-dot {
  order: -1;
}
.room-chat-panel-v3 {
  row-gap: 6px;
}
.chat-header-v3 {
  padding-bottom: 6px;
}
.chat-body-v3 {
  margin-bottom: 0 !important;
}
.chat-log-v3 {
  padding-bottom: 0;
}
.chat-form-v3 {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  gap: 6px;
}
@media (max-width: 640px) {
  .trust-modal-panel {
    width: min(calc(100% - 20px), 760px);
    margin: 10px auto;
    max-height: calc(100vh - 20px);
    padding: 18px;
  }
}
.chat-input-modern {
  margin: 0;
}
.room-trust-collapse {
  margin-top: 0;
}
.audio-controls-v3 {
  margin-top: 8px;
}

.voice-collapse {
  margin-top: 0;
}
.voice-collapse summary,
.voice-gate-collapse summary {
  align-items: flex-start;
}
.voice-collapse-copy,
.voice-gate-collapse-copy {
  display: grid;
  gap: 4px;
}
.voice-collapse-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.field-wide { grid-column: 1 / -1; }
.voice-gate-collapse {
  margin-top: 4px;
}
.voice-gate-card {
  padding: 0 18px 18px;
}
.voice-gate-head, .voice-gate-toggle, .voice-gate-meter {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.voice-gate-toggle {
  font-size: .92rem;
  color: var(--muted);
}
.voice-gate-grid {
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:14px;
  margin-top: 12px;
}
.voice-gate-meter {
  margin-top: 12px;
}
.voice-gate-meter-bar {
  position:relative;
  flex:1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  overflow:hidden;
}
.voice-gate-meter-bar span {
  display:block;
  height:100%;
  width:0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(247,148,29,.45), rgba(247,148,29,.95));
  transition: width .08s linear, opacity .12s ease;
}
@media (max-width: 900px) {
  .voice-collapse-body,
  .voice-gate-grid {
    grid-template-columns: 1fr;
  }
}

body.modal-open { overflow: hidden; }


/* v3.19 layout and room fixes */
.home-grid-v317-fix {
  grid-template-columns: minmax(0, 760px) minmax(300px, 360px);
  align-items: start;
  justify-content: start;
  column-gap: 22px;
}
.create-group-panel-v3 {
  max-width: 760px;
  width: 100%;
  justify-self: start;
  align-self: start;
}
.friendlist-panel-v3 {
  align-self: start;
  width: 100%;
  justify-self: stretch;
  position: sticky;
  top: 24px;
}
.friend-list-static .user-row {
  margin: 0;
}
.voice-collapse-copy .label,
.voice-gate-collapse-copy .label {
  margin-bottom: 0;
}
.voice-collapse-body {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.voice-gate-collapse {
  grid-column: 1 / -1;
}
.room-chat-panel-v3 {
  row-gap: 2px;
}
.chat-header-v3 {
  padding-bottom: 2px;
}
.chat-body-v3 {
  min-height: 320px;
  height: 400px;
  max-height: 400px;
  padding: 0;
  margin-bottom: 2px;
}
.chat-log-v3 {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 4px 0 0;
}
.chat-form-v3 {
  margin-top: 0;
  margin-bottom: 0;
  gap: 8px;
}
@media (max-width: 1160px) {
  .home-grid-v317-fix {
    grid-template-columns: 1fr;
  }
  .create-group-panel-v3,
  .friendlist-panel-v3 {
    max-width: none;
    position: static;
  }
}
@media (max-width: 820px) {
  .chat-body-v3 {
    height: min(38vh, 380px);
    max-height: min(38vh, 380px);
  }
}


/* v3.20 layout and room tightening */
.home-layout-v320 {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(300px, 360px);
  align-items: start;
  justify-content: start;
  gap: 22px;
}
.create-group-panel-v3,
.friendlist-panel-v3 {
  padding: 22px;
}
.create-group-panel-v3 {
  width: 100%;
  max-width: 760px;
  align-self: start;
}
.friendlist-panel-v3 {
  width: 100%;
  align-self: start;
  position: sticky;
  top: 24px;
}
.workspace-main-home {
  min-width: 0;
}

.room-chat-panel-v3 {
  min-height: auto;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  row-gap: 8px;
}
.chat-body-v3 {
  min-height: 0;
  height: 260px;
  max-height: 260px;
  overflow: hidden;
  padding: 0;
  margin: 0;
}
.chat-log-v3 {
  height: 100%;
  min-height: 100%;
  justify-content: flex-end;
  align-content: end;
  gap: 8px;
  padding: 0 4px 0 0;
}
.chat-form-v3 {
  margin: 0;
  gap: 8px;
}
.audio-controls-v3 {
  margin-top: 2px;
}
.voice-collapse {
  margin-top: 0;
}

@media (max-width: 1160px) {
  .home-layout-v320 {
    grid-template-columns: 1fr;
  }
  .friendlist-panel-v3 {
    position: static;
  }
}

@media (max-width: 820px) {
  .chat-body-v3 {
    height: 220px;
    max-height: 220px;
  }
}


.app-statusbar-floating-corner { position: fixed; right: 22px; bottom: 18px; z-index: 40; display: grid; gap: 10px; }
.app-statusbar-floating-corner-left { left: 22px; right: auto; bottom: 18px; }
.legal-launcher { justify-items: start; }
.status-version-link { min-width: 112px; text-align: center; }
.legal-panel { width: min(760px, calc(100% - 28px)); }
.legal-copy-block { color: var(--muted); }
.legal-copy-block p { margin: 0; }
.patchnotes-modal-force-open { opacity: 1; pointer-events: auto; }
.invite-user-trigger { width: 100%; }

.patchnotes-backdrop-button { border: 0; padding: 0; background: transparent; width: 100%; height: 100%; display: block; cursor: pointer; }
.patchnotes-close-button { border: 0; background: transparent; cursor: pointer; }

/* v3.24 friends list modernization */
.presence-offline { background: rgba(173,181,189,.82); box-shadow: 0 0 0 4px rgba(173,181,189,.10); }
.presence-chip.presence-offline { color:#c8d0db; background:rgba(173,181,189,.12); border-color:rgba(173,181,189,.22); box-shadow:none; }
.friends-panel-v324 { overflow: visible; }
.friends-head-v324 { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.friends-content-v324 { gap:14px; }
.friend-add-form-v324 { display:grid; gap:8px; }
.friend-code-row-v324 {
  display:grid;
  grid-template-columns:minmax(0,1fr) 48px;
  gap:8px;
  align-items:center;
  padding:6px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  background:rgba(255,255,255,.035);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.friend-code-input-v324 {
  border:0;
  background:transparent;
  min-height:42px;
  height:42px;
  padding:0 10px;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.friend-code-input-v324:focus { box-shadow:none; outline:none; }
.friend-add-button-v324,
.friend-requests-trigger {
  width:48px;
  height:48px;
  border-radius:16px;
  border:1px solid rgba(255,136,31,.26);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#ffd2a3;
  background:linear-gradient(135deg, rgba(255,136,31,.17), rgba(255,255,255,.045));
  box-shadow:0 14px 30px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.06);
  cursor:pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.friend-add-button-v324 svg,
.friend-requests-icon { width:20px; height:20px; }
.friend-add-button-v324:hover,
.friend-requests-trigger:hover {
  transform: translateY(-1px);
  border-color:rgba(255,136,31,.46);
  background:linear-gradient(135deg, rgba(255,136,31,.24), rgba(255,255,255,.07));
  box-shadow:0 18px 36px rgba(255,136,31,.12), 0 14px 30px rgba(0,0,0,.22);
}
.friend-requests-trigger { position:relative; flex:0 0 auto; }
.friend-requests-trigger.has-requests {
  color:#1b1004;
  background:linear-gradient(135deg, rgba(255,136,31,.96), rgba(255,177,92,.82));
  border-color:rgba(255,190,112,.58);
  box-shadow:0 18px 40px rgba(255,136,31,.22), inset 0 1px 0 rgba(255,255,255,.18);
}
.friend-requests-count {
  position:absolute;
  right:-6px;
  top:-7px;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#1b1004;
  font-size:.72rem;
  font-weight:900;
  background:#ff9f3f;
  border:2px solid rgba(18,20,25,.96);
  box-shadow:0 0 0 4px rgba(255,136,31,.12), 0 10px 20px rgba(0,0,0,.24);
}
.friends-list-shell-v324 {
  display:grid;
  gap:10px;
  padding:12px;
  border:1px solid rgba(255,255,255,.075);
  border-radius:20px;
  background:rgba(0,0,0,.10);
}
.friends-list-title-v324 { padding:0 2px; }
.friends-list-v324 { gap:10px; }
.friend-card-v324 {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:12px;
  border:1px solid rgba(255,255,255,.075);
  border-radius:18px;
  background:linear-gradient(135deg, rgba(255,255,255,.052), rgba(255,255,255,.025));
  box-shadow:0 12px 28px rgba(0,0,0,.16);
}
.friend-card-main-v324 { min-width:0; }
.friend-avatar-wrap-v324 { position:relative; width:38px; height:38px; flex:0 0 auto; }
.friend-avatar-wrap-v324 .mini-avatar { width:38px; height:38px; }
.friend-status-dot-v324 {
  position:absolute;
  right:-2px;
  bottom:-2px;
  width:11px;
  height:11px;
  border:2px solid rgba(18,20,25,.96);
}
.friend-actions-v324 { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.button-compact-v324 { min-height:36px; padding:0 12px; border-radius:13px; }
.sent-requests-strip-v324 {
  display:grid;
  gap:8px;
  padding:10px 12px;
  border:1px solid rgba(255,136,31,.14);
  border-radius:18px;
  background:rgba(255,136,31,.06);
}
.sent-request-row-v324 {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
  padding:6px 0;
}
.friend-requests-panel-v324 { max-width:560px; }
.friend-requests-list-v324 { gap:10px; }
.friend-request-card-v324 {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  padding:14px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  background:rgba(255,255,255,.04);
}
.friend-request-actions-v324 { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.patchnotes-backdrop[data-modal-close] { border:0; padding:0; cursor:default; }
@media (max-width: 560px) {
  .friend-card-v324,
  .friend-request-card-v324 { grid-template-columns:1fr; align-items:start; }
  .friend-actions-v324,
  .friend-request-actions-v324 { justify-content:flex-start; }
}

/* v3.25 scalable list panels */
.v3-sidebar {
  max-height: calc(100vh - 44px);
  overflow: hidden;
  grid-template-rows: auto auto auto minmax(0, auto) minmax(0, auto) auto;
}
.sidebar-section-scroll-v325 { min-height: 0; }
.sidebar-list-scroll-v325 {
  max-height: clamp(160px, 24vh, 320px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}
.direct-list-v325 { max-height: clamp(140px, 22vh, 300px); }
.rooms-list-v325 { max-height: clamp(140px, 22vh, 300px); }
.friends-panel-v324 {
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.friends-content-v324 {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.friends-list-shell-v324 {
  min-height: 0;
  flex: 1 1 auto;
}
.friends-list-v324 {
  min-height: 0;
  max-height: clamp(240px, 46vh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}
.sidebar-list-scroll-v325::-webkit-scrollbar,
.friends-list-v324::-webkit-scrollbar { width: 8px; }
.sidebar-list-scroll-v325::-webkit-scrollbar-thumb,
.friends-list-v324::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 999px;
}
.sidebar-list-scroll-v325::-webkit-scrollbar-thumb:hover,
.friends-list-v324::-webkit-scrollbar-thumb:hover { background: rgba(255,136,31,.28); }
@media (max-width: 1160px) {
  .v3-sidebar,
  .friends-panel-v324 {
    max-height: none;
    overflow: visible;
  }
  .sidebar-list-scroll-v325,
  .friends-list-v324 {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}


/* v3.26 compact friends rows */
.friend-card-v326 {
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 10px;
}
.friend-card-body-v326 {
  display:flex;
  flex-direction:column;
  min-width:0;
  flex:1;
  gap:5px;
}
.friend-card-line-v326 {
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
  line-height:1.2;
}
.friend-display-name-v326 {
  min-width:0;
  max-width:48%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.friend-username-v326,
.friend-status-label-v326 {
  color:var(--muted);
  font-size:.82rem;
  white-space:nowrap;
}
.friend-username-v326 {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}
.friend-status-label-v326 {
  margin-left:auto;
  opacity:.82;
}
.friend-actions-v326 {
  justify-content:flex-start;
  gap:7px;
  padding-left:1px;
}
.friend-actions-v326 .button-compact-v324 {
  min-height:30px;
  padding:0 10px;
  border-radius:11px;
  font-size:.82rem;
}
@media (max-width: 560px) {
  .friend-card-line-v326 { flex-wrap:wrap; row-gap:3px; }
  .friend-display-name-v326 { max-width:100%; }
  .friend-status-label-v326 { margin-left:0; }
}

/* v3.27 friends search popup */
.friends-head-actions-v327 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.friends-total-badge-v327 {
  min-width: 28px;
  justify-content: center;
}

.friend-search-trigger-v327,
.friend-search-clear-v327 {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 24px rgba(0,0,0,.18);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, color .18s ease;
}

.friend-search-trigger-v327:hover,
.friend-search-clear-v327:hover,
.friend-search-clear-v327.is-active {
  color: var(--accent);
  border-color: rgba(255,136,31,.36);
  background: linear-gradient(180deg, rgba(255,136,31,.14), rgba(255,255,255,.045));
  transform: translateY(-1px);
}

.friend-search-clear-v327[hidden] { display: none !important; }
.friend-search-icon-v327 { width: 18px; height: 18px; }

.friend-search-panel-v327 { max-width: 520px; }
.friend-search-modal-body-v327 {
  display: grid;
  gap: 12px;
}

.friend-search-input-v327 {
  font-size: .98rem;
}

.friend-search-modal-actions-v327 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.friends-search-state-v327 {
  min-height: 22px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hidden-by-friend-search-v327 { display: none !important; }
.friends-search-empty-v327 { margin-top: 2px; }

@media (max-width: 760px) {
  .friends-head-actions-v327 { gap: 6px; }
  .friend-search-trigger-v327,
  .friend-search-clear-v327,
  .friend-requests-trigger { width: 36px; height: 36px; }
}

/* v3.28 compact sidebar profile and modal close consistency */
.profile-chip-compact-v328 {
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-radius: 20px;
}
.profile-chip-compact-v328 .avatar-circle,
.profile-chip-compact-v328 .avatar-circle-image {
  width: 46px;
  height: 46px;
  border-radius: 15px;
}
.profile-chip-copy-compact-v328 {
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  line-height:1.2;
}
.profile-chip-copy-compact-v328 strong {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:.96rem;
}
.profile-chip-username-v328 {
  color:var(--muted);
  font-size:.86rem;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.profile-chip-copy-compact-v328 .presence-chip {
  flex:0 0 auto;
  padding:3px 8px;
  font-size:.74rem;
}
button.patchnotes-close,
.patchnotes-close-button {
  border:0;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  line-height:1;
  width:34px;
  height:34px;
  border-radius:12px;
  display:grid;
  place-items:center;
  transition:.16s ease;
}
button.patchnotes-close:hover,
.patchnotes-close-button:hover {
  color:var(--text);
  background:rgba(255,255,255,.06);
}
@media (max-width: 560px) {
  .profile-chip-copy-compact-v328 { flex-wrap:wrap; row-gap:4px; }
}

/* v3.29 sidebar direct rows and profile chip alignment */
.friends-total-badge-v327 { display: none !important; }

.profile-chip-id-v329 {
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  flex:1 1 auto;
}
.profile-chip-presence-v329 {
  margin-left:auto;
}

.direct-avatar-wrap-v329 {
  position:relative;
  width:34px;
  height:34px;
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.direct-avatar-wrap-v329 .mini-avatar {
  width:34px;
  height:34px;
}
.direct-status-dot-v329 {
  position:absolute;
  right:-1px;
  bottom:-1px;
  width:10px;
  height:10px;
  border:2px solid rgba(11,13,18,.95);
  box-shadow:0 0 0 1px rgba(255,255,255,.08);
}
.sidebar-link-copy-direct-v329 {
  min-width:0;
  gap:0;
}
.direct-name-line-v329 {
  display:flex;
  align-items:baseline;
  gap:5px;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
}
.direct-name-line-v329 strong {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:.92rem;
}
.direct-name-line-v329 span {
  color:var(--muted);
  font-size:.8rem;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
@media (max-width: 560px) {
  .profile-chip-id-v329 { flex-wrap:wrap; row-gap:2px; }
  .profile-chip-presence-v329 { margin-left:0; }
}


/* v3.31 compact profile settings chip and single-line friends actions */
.profile-chip-profile-v331 {
  display:flex;
  align-items:center;
  gap:12px;
}
.profile-chip-copy-profile-v331 {
  width:100%;
  flex:1 1 auto;
}
.profile-chip-id-profile-v331 {
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
}
.profile-chip-username-v331 {
  color:var(--muted);
  font-size:.86rem;
  font-weight:500;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.friend-card-v326 {
  align-items:center;
}
.friend-card-body-v331 {
  flex:1 1 auto;
  min-width:0;
}
.friend-card-line-v331 {
  width:100%;
  gap:8px;
  flex-wrap:nowrap;
}
.friend-card-line-v331 .friend-display-name-v326 {
  flex:1 1 auto;
  min-width:0;
}
.friend-card-line-v331 .friend-status-label-v326 {
  flex:0 0 auto;
}
.friend-actions-v331 {
  margin-left:auto;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  flex-wrap:nowrap;
}
.friend-row-action-v331 {
  min-height:30px;
  padding:0 10px;
  border-radius:11px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.045);
  color:var(--text);
  font-size:.78rem;
  font-weight:650;
  letter-spacing:.01em;
  box-shadow:none;
}
.friend-row-action-v331:hover {
  border-color:rgba(255,136,31,.38);
  background:rgba(255,136,31,.10);
  transform:none;
}
.friend-row-action-danger-v331 {
  color:rgba(255,255,255,.72);
}
.friend-row-action-danger-v331:hover {
  color:#ffd6d6;
  border-color:rgba(255,96,96,.34);
  background:rgba(255,96,96,.10);
}
@media (max-width: 560px) {
  .friend-card-line-v331 {
    flex-wrap:wrap;
  }
  .friend-actions-v331 {
    width:100%;
    margin-left:0;
    justify-content:flex-start;
  }
  .profile-chip-id-profile-v331 {
    flex-wrap:wrap;
  }
}

/* v3.32 clean icon friend actions and overflow guard */
.friends-list-v324 {
  overflow-x: hidden;
}
.friend-card-v326,
.friend-card-line-v331 {
  min-width: 0;
}
.friend-card-line-v331 .friend-display-name-v326 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friend-icon-action-v332 {
  width: 28px;
  height: 28px;
  min-height: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.friend-action-icon-v332 {
  width: 15px;
  height: 15px;
}
.friend-actions-v331 {
  max-width: 66px;
}
.friend-row-action-danger-v331 .friend-action-icon-v332 {
  width: 14px;
  height: 14px;
}
@media (max-width: 560px) {
  .friend-actions-v331 {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
  }
}

/* v3.33 room panel alignment polish */
.room-profile-chip-v333 {
  min-width: 0;
}
.room-profile-copy-v333 {
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-width:0;
}
.room-profile-name-v333 {
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.room-profile-presence-v333 {
  margin-left:auto;
  flex:0 0 auto;
}
.room-header-meta-row-v3 {
  width:100%;
}
.room-header-meta-row-v3 > .room-status-band-inline {
  flex:1 1 auto;
  min-width:0;
}
.chat-header-actions-v3 {
  margin-left:auto;
  flex:0 0 auto;
  justify-content:flex-end;
}
.chat-header-title-row-v3 > div:last-child {
  min-width:0;
  flex:1 1 auto;
}
.participant-member-row-v333,
.participant-presence-row-v333,
.room-member-row-v333,
.room-invite-row-v333 {
  min-width:0;
}
.participant-avatar-wrap-v333 {
  position:relative;
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.participant-avatar-wrap-v333 .mini-avatar {
  width:34px;
  height:34px;
}
.participant-avatar-dot-v333 {
  position:absolute;
  right:-1px;
  bottom:-1px;
  width:10px;
  height:10px;
  border:2px solid rgba(11,13,18,.95);
  box-shadow:0 0 0 1px rgba(255,255,255,.08);
}
.participant-main-status-v333 {
  flex:1 1 auto;
  min-width:0;
  display:block;
}
.participant-name-status-line-v333 {
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  width:100%;
}
.participant-name-status-line-v333 strong {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.participant-status-text-v333 {
  margin-left:auto;
  flex:0 0 auto;
  color:var(--muted);
  font-size:.74rem;
  font-weight:650;
  letter-spacing:.02em;
  text-transform:none;
  white-space:nowrap;
}
.room-member-main-v333 {
  min-width:0;
  display:block;
}
.room-member-name-v333 {
  display:flex;
  align-items:baseline;
  gap:4px;
  min-width:0;
  overflow:hidden;
  white-space:nowrap;
}
.room-member-name-v333 > *:first-child,
.room-member-name-v333 {
  text-overflow:ellipsis;
}
.room-member-username-v333 {
  flex:0 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:.82rem;
  font-weight:500;
}
.room-member-row-v333 .participant-action {
  margin-left:auto;
  flex:0 0 auto;
}
.room-invite-row-v333 input[type="checkbox"] {
  margin-left:auto;
  flex:0 0 auto;
}
@media (max-width: 720px) {
  .chat-header-actions-v3 {
    width:100%;
  }
  .chat-header-actions-v3 .icon-action {
    min-width:calc(50% - 5px);
    flex:1 1 calc(50% - 5px);
  }
  .room-profile-copy-v333,
  .participant-name-status-line-v333 {
    gap:8px;
  }
}

/* v3.34 security/profile alignment and friends status pulse */
.security-profile-chip-v334 { min-width: 0; }
.security-profile-copy-v334 {
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-width:0;
}
.security-profile-name-v334 {
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.security-profile-presence-v334 {
  margin-left:auto;
  flex:0 0 auto;
}
.chat-header-actions-v3 {
  margin-left:0;
  justify-content:flex-start;
}
.room-header-meta-row-v3 > .room-status-band-inline {
  flex:0 1 auto;
}
.friends-list-v324 .friend-status-dot-v324.presence-online,
.friends-list-v324 .friend-status-dot-v324.presence-busy,
.friends-list-v324 .friend-status-dot-v324.presence-dnd {
  animation: friendStatusPulseV334 1.85s ease-in-out infinite;
}
.friends-list-v324 .friend-status-dot-v324.presence-offline,
.friends-list-v324 .friend-status-dot-v324.presence-invisible {
  animation:none;
}
@keyframes friendStatusPulseV334 {
  0%, 100% { transform:scale(1); filter:brightness(1); }
  50% { transform:scale(1.22); filter:brightness(1.18); }
}
@media (prefers-reduced-motion: reduce) {
  .friends-list-v324 .friend-status-dot-v324.presence-online,
  .friends-list-v324 .friend-status-dot-v324.presence-busy,
  .friends-list-v324 .friend-status-dot-v324.presence-dnd { animation:none; }
}
@media (max-width: 720px) {
  .security-profile-copy-v334 { gap:8px; }
}

/* v3.35 friends search dialog polish */
.friend-search-input-row-v335 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.friend-search-input-row-v335 .friend-search-input-v327 {
  min-width: 0;
}

.friend-search-apply-v335 {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 24px rgba(0,0,0,.18);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, color .18s ease;
}

.friend-search-apply-v335:hover,
.friend-search-apply-v335:focus-visible {
  color: var(--accent);
  border-color: rgba(255,136,31,.36);
  background: linear-gradient(180deg, rgba(255,136,31,.14), rgba(255,255,255,.045));
  transform: translateY(-1px);
  outline: none;
}

.friend-search-apply-icon-v335 {
  width: 18px;
  height: 18px;
}

/* v3.37 create room spacing */
.create-group-panel-v3 .subpanel-head-v3 {
  margin-bottom: 14px;
}

/* v3.38 friend request modal icon actions */
.friend-request-actions-v324 { gap:8px; flex-wrap:nowrap; }
.friend-request-icon-action-v338 { width:34px; height:34px; min-height:34px; padding:0; border-radius:12px; display:inline-flex; align-items:center; justify-content:center; border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.045); color:#dfe7f3; box-shadow:inset 0 1px 0 rgba(255,255,255,.06); transition:transform .14s ease, border-color .14s ease, background .14s ease, color .14s ease, box-shadow .14s ease; }
.friend-request-icon-action-v338:hover { transform:translateY(-1px); border-color:rgba(255,136,31,.34); background:rgba(255,136,31,.095); box-shadow:0 12px 26px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.08); }
.friend-request-accept-v338 { color:#8fe3a2; border-color:rgba(143,227,162,.20); }
.friend-request-accept-v338:hover { color:#b7f4c3; border-color:rgba(143,227,162,.38); background:rgba(143,227,162,.09); }
.friend-request-decline-v338 { color:#ffb0a6; border-color:rgba(255,121,105,.18); }
.friend-request-decline-v338:hover { color:#ffd0ca; border-color:rgba(255,121,105,.34); background:rgba(255,121,105,.08); }
.friend-request-action-icon-v338 { width:16px; height:16px; }

/* v3.39 friend request modal row alignment */
.friend-request-card-v324 .user-meta-modern {
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.friend-request-card-v324 .contacts-user-copy {
  min-width:0;
}
.friend-request-card-v324 .contacts-user-name {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* v3.40 create group friend selector row polish */
.group-member-select-row-v340 {
  min-width: 0;
}
.group-member-select-main-v340 {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
.group-member-select-main-v340 strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-member-select-username-v340 {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-member-select-row-v340 input[type="checkbox"] {
  flex: 0 0 auto;
}

/* v3.41 create group Friends collapse breathing room */
.member-selector-collapse .participant-list-selector {
  padding: 14px 12px 6px;
  box-sizing: border-box;
}
.member-selector-collapse .group-member-select-row-v340 {
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 640px) {
  .member-selector-collapse .participant-list-selector {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* v3.42 keep group room sidebar actions reachable */
.room-sidebar.v3-sidebar {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  overflow-x: hidden;
}
.room-members-sidebar-section,
.room-invite-sidebar-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}
.room-members-sidebar-section .section-title-row,
.room-invite-sidebar-section .section-title-row {
  flex: 0 0 auto;
}
.participant-list-sidebar-members,
.sidebar-invite-list {
  min-height: 160px;
  max-height: clamp(190px, 28vh, 340px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}
.sidebar-invite-list {
  min-height: 185px;
  max-height: clamp(210px, 30vh, 360px);
}
.room-invite-form-v342 {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.room-invite-form-v342 .sidebar-invite-list { flex: 0 0 auto; }
.room-side-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex: 0 0 auto;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(10,14,20,0), rgba(10,14,20,.98) 28%);
}
.participant-list-sidebar-members::-webkit-scrollbar,
.sidebar-invite-list::-webkit-scrollbar { width: 8px; }
.participant-list-sidebar-members::-webkit-scrollbar-thumb,
.sidebar-invite-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 999px;
}
.participant-list-sidebar-members::-webkit-scrollbar-thumb:hover,
.sidebar-invite-list::-webkit-scrollbar-thumb:hover { background: rgba(255,136,31,.28); }
@media (max-width: 1160px) {
  .room-sidebar.v3-sidebar {
    max-height: none;
    overflow: visible;
  }
  .participant-list-sidebar-members,
  .sidebar-invite-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .room-side-actions {
    position: static;
    background: transparent;
    padding-top: 0;
  }
}


/* v3.42 corrected invite sidebar density */
.sidebar-invite-list { gap: 7px; }
.sidebar-invite-list .room-invite-row-v333 {
  padding: 8px 10px;
  min-height: 0;
  border-radius: 16px;
  align-items: center;
}
.sidebar-invite-list .room-invite-row-v333 .mini-avatar {
  width: 30px; height: 30px; min-width: 30px; min-height: 30px; font-size: .82rem;
}
.sidebar-invite-list .room-invite-row-v333 .room-member-main-v333,
.sidebar-invite-list .room-invite-row-v333 .room-member-name-v333 { line-height: 1.15; }
.sidebar-invite-list .room-invite-row-v333 input[type="checkbox"] { inline-size: 16px; block-size: 16px; }

/* v3.43 admin user-management polish */
.admin-management-v43 { overflow:hidden; }
.admin-management-head { align-items:flex-start; }
.admin-create-user-link { white-space:nowrap; }
.admin-user-grid-clean { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items:stretch; }
.admin-user-card-clean {
  display:grid;
  gap:14px;
  padding:16px;
  overflow:hidden;
}
.admin-user-card-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  min-width:0;
}
.admin-user-identity {
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.admin-user-avatar {
  width:38px;
  height:38px;
  border-radius:13px;
  flex:0 0 auto;
}
.admin-user-copy {
  display:grid;
  gap:1px;
  min-width:0;
}
.admin-user-copy strong,
.admin-user-copy span {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.admin-user-copy strong { font-size:.98rem; }
.admin-user-copy span { color:var(--muted); font-size:.83rem; }
.admin-user-chips {
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:6px;
  flex:0 0 auto;
}
.admin-state-active { color:#bff5cf; background:rgba(69,212,131,.14); border-color:rgba(69,212,131,.28); }
.admin-state-disabled { color:#c8d0db; background:rgba(173,181,189,.12); border-color:rgba(173,181,189,.22); }
.admin-user-actions-clean {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  padding-top:12px;
  border-top:1px solid rgba(255,255,255,.07);
}
.admin-user-actions-clean form { margin:0; }
.admin-icon-action {
  width:34px;
  height:34px;
  border-radius:11px;
}
.admin-icon-action svg { width:16px; height:16px; }
.admin-icon-danger { color:#ffb8c0; border-color:rgba(255,107,122,.18); background:rgba(255,107,122,.06); }
.admin-icon-danger:hover:not(:disabled) { border-color:rgba(255,107,122,.35); background:rgba(255,107,122,.12); }
@media (max-width: 620px) {
  .admin-management-head { display:grid; }
  .admin-create-user-link { width:100%; justify-content:center; }
  .admin-user-card-top { align-items:flex-start; }
  .admin-user-chips { flex-direction:column; align-items:flex-end; }
}

.call-trust-gate {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,136,31,.22);
  background: rgba(255,136,31,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.call-trust-gate > * {
  background: transparent;
}
.call-trust-gate-kicker {
  margin: 0;
  color: var(--accent-3);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.call-trust-gate-title {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
}
.call-trust-gate-remote,
.call-trust-gate-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.call-trust-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.trust-card-meta-ok { color: #b6f2cf; }
.trust-card-meta-warning { color: #ffe3a6; }
.incoming-call-note {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: .92rem;
}

.call-trust-modal {
  position: fixed;
  inset: 0;
  z-index: 94;
}
.call-trust-modal[hidden] { display: none; }
.call-trust-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.70);
  backdrop-filter: blur(10px);
}
.call-trust-modal-panel {
  position: relative;
  width: min(calc(100% - 32px), 680px);
  max-height: calc(100vh - 64px);
  overflow: auto;
  margin: 32px auto;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(16,21,29,.98), rgba(9,13,19,.99));
  padding: 22px;
  box-shadow: 0 26px 80px rgba(0,0,0,.50);
}
.call-trust-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.call-trust-modal-header h3 { margin: 4px 0 0; }
.call-trust-modal-kicker {
  margin: 0;
  color: var(--accent-3);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.call-trust-modal-copy {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
}
.call-trust-remote-status {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.45;
}
.call-trust-peer-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.call-trust-peer-list .trust-card-self { display: none; }
.call-trust-modal-note {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}
.call-trust-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
@media (max-width: 620px) {
  .call-trust-modal-panel { margin: 16px auto; max-height: calc(100vh - 32px); }
  .call-trust-modal-actions .button { width: 100%; justify-content: center; }
}

/* v4.21 group room UI fixes */
.room-current-card-v421 { gap: 8px; }
.room-kind-line-v421 { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.group-trust-bypass-toggle-v421 { display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; user-select: none; }
.group-trust-bypass-toggle-v421 input { position: absolute; opacity: 0; pointer-events: none; }
.group-trust-bypass-box-v421 { width: 18px; height: 18px; flex: 0 0 18px; border-radius: 6px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
.group-trust-bypass-text-v421 { font-size: .72rem; line-height: 1; letter-spacing: .01em; color: rgba(237,240,245,.62); white-space: nowrap; transition: color .18s ease, opacity .18s ease; }
.group-trust-bypass-toggle-v421:hover .group-trust-bypass-box-v421 { border-color: rgba(255,157,77,.68); transform: translateY(-1px); }
.group-trust-bypass-toggle-v421:hover .group-trust-bypass-text-v421 { color: rgba(255,204,158,.9); }
.group-trust-bypass-toggle-v421 input:checked + .group-trust-bypass-box-v421 { background: linear-gradient(135deg, rgba(255,157,77,.94), rgba(255,112,67,.88)); border-color: rgba(255,184,108,.95); box-shadow: 0 0 0 3px rgba(255,157,77,.14), inset 0 0 0 1px rgba(255,255,255,.28); }
.group-trust-bypass-toggle-v421 input:checked + .group-trust-bypass-box-v421::after { content: ""; display: block; width: 8px; height: 4px; border-left: 2px solid rgba(20,16,18,.92); border-bottom: 2px solid rgba(20,16,18,.92); transform: rotate(-45deg); margin: 5px 0 0 4px; }
.group-trust-bypass-toggle-v421 input:checked ~ .group-trust-bypass-text-v421 { color: rgba(255,184,108,.96); }
.group-trust-bypass-toggle-v421 input:disabled + .group-trust-bypass-box-v421 { cursor: not-allowed; opacity: .55; }
.group-trust-bypass-toggle-v421 input:disabled ~ .group-trust-bypass-text-v421 { cursor: not-allowed; opacity: .55; }
.participant-avatar-wrap-v333 .mini-avatar-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* v4.21.2: keep live-presence avatars constrained even when uploaded images are very large. */
.participant-list-presence .participant-avatar-wrap-v333,
.participant-list-live-room .participant-avatar-wrap-v333 {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  overflow: visible;
}
.participant-list-presence .participant-avatar-wrap-v333 img.mini-avatar,
.participant-list-presence .participant-avatar-wrap-v333 .mini-avatar-image,
.participant-list-live-room .participant-avatar-wrap-v333 img.mini-avatar,
.participant-list-live-room .participant-avatar-wrap-v333 .mini-avatar-image {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

/* v4.21.3: apply the same hard avatar bounds to direct-room member lists and direct-call/contact avatar wrappers. */
.participant-list-members .participant-avatar-wrap-v333,
.participant-member-row-v333 .participant-avatar-wrap-v333,
.room-member-row-v333 .participant-avatar-wrap-v333 {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  overflow: visible;
}
.participant-list-members .participant-avatar-wrap-v333 img.mini-avatar,
.participant-list-members .participant-avatar-wrap-v333 .mini-avatar-image,
.participant-member-row-v333 .participant-avatar-wrap-v333 img.mini-avatar,
.participant-member-row-v333 .participant-avatar-wrap-v333 .mini-avatar-image,
.room-member-row-v333 .participant-avatar-wrap-v333 img.mini-avatar,
.room-member-row-v333 .participant-avatar-wrap-v333 .mini-avatar-image,
.direct-avatar-wrap-v329 img.mini-avatar,
.direct-avatar-wrap-v329 .mini-avatar-image {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}


/* v4.21.4: remove the unused room header avatar/token placeholder next to the call status. */
.chat-header-title-row-no-token-v4214 { gap: 0; }
.chat-header-title-row-no-token-v4214 > div:first-child { min-width: 0; flex: 1 1 auto; }

/* v4.21.6: stack room voice controls under the status pills so direct and group headers stay readable. */
.room-header-meta-stacked-v4216 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
}
.room-header-meta-stacked-v4216 > .room-status-line-v4216 {
  flex: 0 1 auto;
  width: 100%;
}
.room-header-meta-stacked-v4216 > .chat-header-actions-stacked-v4216 {
  width: 100%;
  margin-left: 0;
  justify-content: flex-start;
}
.room-header-meta-stacked-v4216 .icon-action {
  flex: 0 0 auto;
}
@media (max-width: 720px) {
  .room-header-meta-stacked-v4216 > .chat-header-actions-stacked-v4216 .icon-action {
    flex: 1 1 calc(50% - 6px);
    min-width: calc(50% - 6px);
  }
}

/* v4.21.7: keep group-room voice controls on the status line and anchor them to the right.
   Direct rooms intentionally keep the v4.21.6 stacked layout. */
[data-room-type="group"] .room-header-meta-stacked-v4216 {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}
[data-room-type="group"] .room-header-meta-stacked-v4216 > .room-status-line-v4216 {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
[data-room-type="group"] .room-header-meta-stacked-v4216 > .chat-header-actions-stacked-v4216 {
  flex: 0 0 auto;
  width: auto;
  margin-left: auto;
  justify-content: flex-end;
}
[data-room-type="group"] .room-header-meta-stacked-v4216 > .chat-header-actions-stacked-v4216 .icon-action {
  flex: 0 0 auto;
}
@media (max-width: 840px) {
  [data-room-type="group"] .room-header-meta-stacked-v4216 {
    flex-wrap: wrap;
  }
  [data-room-type="group"] .room-header-meta-stacked-v4216 > .chat-header-actions-stacked-v4216 {
    margin-left: auto;
  }
}
@media (max-width: 560px) {
  [data-room-type="group"] .room-header-meta-stacked-v4216 > .room-status-line-v4216,
  [data-room-type="group"] .room-header-meta-stacked-v4216 > .chat-header-actions-stacked-v4216 {
    width: 100%;
  }
  [data-room-type="group"] .room-header-meta-stacked-v4216 > .chat-header-actions-stacked-v4216 {
    justify-content: flex-start;
    margin-left: 0;
  }
}


/* v4.21.8: give the group-room status/actions row real full-width space so the voice buttons
   are visually anchored to the right instead of sitting directly beside the status pills. */
[data-room-type="group"] .chat-header-main,
[data-room-type="group"] .chat-header-title-row-v3,
[data-room-type="group"] .chat-header-title-row-v3 > div:first-child,
[data-room-type="group"] .room-header-meta-stacked-v4216 {
  width: 100%;
  max-width: 100%;
}
[data-room-type="group"] .chat-header-title-row-v3 > div:first-child {
  flex: 1 1 100%;
}
[data-room-type="group"] .room-header-meta-stacked-v4216 {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  column-gap: 28px;
}
[data-room-type="group"] .room-header-meta-stacked-v4216 > .room-status-line-v4216 {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
}
[data-room-type="group"] .room-header-meta-stacked-v4216 > .chat-header-actions-stacked-v4216 {
  flex: 0 0 auto;
  width: auto;
  margin-left: auto;
  justify-content: flex-end;
}
@media (max-width: 840px) {
  [data-room-type="group"] .room-header-meta-stacked-v4216 {
    column-gap: 14px;
  }
}
