/* Chat screen, header, search, media modal, tabs, profile dropdown — index/header.css */
    /* ============ CHAT SCREEN ============ */
    #chat-screen {
      display: none;
      position: fixed;
      inset: 0;
      flex-direction: column;
      --split-workspace-width: 0px;
    }

    /* ============ CHAT EMPTY STATE (desktop only) ============ */
    #chat-empty-state {
      display: none;
    }
    .chat-empty-icon {
      font-size: 56px;
      color: var(--text-muted);
      opacity: 0.4;
      line-height: 1;
    }
    .chat-empty-title {
      font-size: 18px;
      font-weight: 600;
      color: var(--text-secondary);
    }
    .chat-empty-sub {
      font-size: 13px;
      color: var(--text-muted);
      text-align: center;
      line-height: 1.6;
      background-color: #ffffff73;
      padding: 7px 19px;
      border-radius: 7px;
    }

    /* --- Header --- */
    .chat-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: var(--main-header-height);
      padding: 0 20px;
      padding-inline-end: calc(20px + var(--split-workspace-width));
      background: var(--bg-secondary);
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
      position: sticky;
      top: 0;
      z-index: 10;
    }

    .chat-header .title { display: none; }

    .chat-header .room-name {
      color: var(--text-secondary);
      font-size: 13px;
    }

    .header-room-title {
      font-size: 16px;
      font-weight: 600;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex: 1;
      min-width: 0;
      max-width: 100%;
	  line-height: 19px
    }

    .header-room-title-row {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
      flex: 1;
    }

    .header-room-member-count {
      display: block;
      font-size: 11px;
      color: var(--text-muted);
      line-height: 1.2;
      padding: 2px 0 0;
    }

    .header-refresh-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 2px 4px;
      font-size: 12px;
      display: flex;
      align-items: center;
      line-height: 1;
      flex-shrink: 0;
    }

    .header-back-btn {
      background: none; border: none; color: var(--text-muted);
      cursor: pointer; font-size: 16px; padding: 0px 9px 4px 1px;
      border-radius: 8px; transition: all 0.2s; flex-shrink: 0;
      display: flex; align-items: center;
    }
    .header-back-btn:hover { color: var(--accent); background: var(--bg-tertiary); }

    .header-avatar-circle {
      width: 39px;
      height: 36px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-weight: 700;
      color: #fff;
      flex-shrink: 0;
      overflow: hidden;
    }
    .header-avatar-wrap-inner {
      position: relative; display: inline-flex; flex-shrink: 0;
    }
    .header-secure-badge {
      position: absolute;
      top: -3px;
      left: -2px;
      width: 16px;
      height: 16px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: rgba(185, 28, 28, 0.92);
      color: #fff;
      border: 2px solid var(--bg-secondary);
      font-size: 8px;
      box-shadow: 0 8px 16px rgba(127, 29, 29, 0.18);
      z-index: 1;
    }
    .header-auto-delete-badge {
      position: absolute;
      top: -3px;
      left: -2px;
      width: 16px;
      height: 16px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: rgba(185, 100, 28, 0.92);
      color: #fff;
      border: 2px solid var(--bg-secondary);
      font-size: 7px;
      box-shadow: 0 8px 16px rgba(127, 60, 29, 0.18);
      z-index: 1;
    }
    #header-online-dot {
      position: absolute; bottom: -2px; right: 0px;
      width: 11px; height: 11px; border-radius: 50%;
      background: #ef4444;
      border: 2px solid var(--bg-secondary);
    }
    #header-avatar-wrap,
    #header-room-info {
      user-select: none;
      cursor: pointer;
    }
    #header-avatar-wrap.dm-profile-clickable,
    #header-room-info.dm-profile-clickable {
      cursor: pointer;
    }

    .online-count {
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--success);
      font-size: 13px;
    }

    .online-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--success);
      animation: pulse 2s infinite;
    }

    .chat-header-right {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .room-auto-delete-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 5px 18px;
      background: linear-gradient(90deg, rgb(127 29 29 / 18%), rgba(239, 68, 68, 0.08));
      border-bottom: 1px solid rgba(239, 68, 68, 0.22);
      color: #7f1d1d;
      position: sticky;
      top: var(--main-header-height);
      z-index: 9;
      backdrop-filter: blur(10px);
    }
    .room-auto-delete-banner-copy {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      font-size: 12px;
      font-weight: 600;
      letter-spacing: 0.01em;
    }
    .room-auto-delete-banner-copy span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .room-auto-delete-banner-copy i {
      color: #dc2626;
      font-size: 12px;
      flex-shrink: 0;
    }
    .room-auto-delete-banner-actions {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    #room-auto-delete-banner-disable {
      border: 1px solid rgb(185 28 28 / 34%);
      background: rgba(255, 255, 255, 0.72);
      color: #991b1b;
      border-radius: 7px;
      padding: 3px 9px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      flex-shrink: 0;
      transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }
    #room-auto-delete-banner-disable:hover {
      background: rgba(255, 255, 255, 0.92);
      border-color: rgba(185, 28, 28, 0.3);
      transform: translateY(-1px);
    }
    #room-auto-delete-banner-hide {
      border: 1px solid rgb(185 28 28 / 22%);
      background: transparent;
      color: #991b1b;
      border-radius: 7px;
      padding: 3px 8px;
      font-size: 11px;
      cursor: pointer;
      flex-shrink: 0;
      opacity: 0.72;
      transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
    }
    #room-auto-delete-banner-hide:hover {
      opacity: 1;
      background: rgba(255, 255, 255, 0.55);
      transform: translateY(-1px);
    }

    @media (max-width: 768px) {
      .room-auto-delete-banner {
        padding: 9px 12px;
        gap: 10px;
      }
      .room-auto-delete-banner-copy {
        font-size: 11px;
      }
      #room-auto-delete-banner-disable,
      #room-auto-delete-banner-hide {
        padding: 5px 10px;
        font-size: 10px;
      }
    }

    @keyframes menuQuickIn {
      from { opacity: 0; transform: translateY(-4px) scale(0.97); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    /* Room 3-dots menu */
    #room-menu-wrap { position: relative; }
    #room-menu-dropdown {
      position: absolute; top: calc(100% + 6px); right: 0;
      background: var(--bg-secondary); border: 1px solid var(--border);
      border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,0.35);
      min-width: 190px; z-index: 500; padding: 5px 0;
      transform-origin: top right;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transform: translateY(-4px) scale(0.97);
      transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
    }
    #room-menu-dropdown.open { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
    .room-menu-item {
      display: flex; align-items: center; gap: 10px;
      padding: 9px 14px; font-size: 13px; color: var(--text);
      cursor: pointer; transition: background 0.14s;
    }
    .room-menu-item:hover { background: var(--bg-hover, rgba(255,255,255,0.06)); }
    .room-menu-item .rmi-icon { width: 16px; text-align: center; color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
    .room-menu-item.danger { color: #ef4444; }
    .room-menu-item.danger .rmi-icon { color: #ef4444; }
    .room-menu-sep { height: 1px; background: var(--border); margin: 4px 0; }

    #header-actions-wrap { position: relative; }
    #header-actions-dropdown {
      position: absolute; top: calc(100% + 6px); right: 0;
      background: var(--bg-secondary); border: 1px solid var(--border);
      border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,0.35);
      min-width: 188px; z-index: 520; padding: 5px 0;
      transform-origin: top right;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transform: translateY(-4px) scale(0.97);
      transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
    }
    #header-actions-dropdown.open { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
    .header-action-item {
      display: flex; align-items: center; gap: 10px;
      padding: 7px 14px; font-size: 13px; color: var(--text-primary);
      cursor: pointer; transition: background 0.14s;
    }
    .header-action-item:hover { background: var(--bg-hover, rgba(255,255,255,0.06)); }
    .header-action-item .hai-icon {
      width: 16px; text-align: center; color: var(--text-muted); font-size: 12px; flex-shrink: 0;
    }
    .header-action-item.disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }
    .header-action-item.disabled:hover { background: transparent; }
    .header-action-item.active {
      background: rgba(34,197,94,0.12);
      color: #86efac;
    }
    .header-action-item.active .hai-icon { color: #86efac; }

    #desktop-split-workspace {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      width: var(--split-workspace-width);
      min-width: 0;
      display: none;
      overflow: hidden;
      border-inline-start: 1px solid var(--border);
      background:
        linear-gradient(180deg, color-mix(in srgb, var(--bg-secondary) 82%, transparent), color-mix(in srgb, var(--bg-primary) 96%, transparent));
      box-shadow: -18px 0 36px rgba(0,0,0,0.16);
      z-index: 11;
    }

    #desktop-split-workspace-resizer {
      position: absolute;
      top: 0;
      bottom: 0;
      left: -5px;
      width: 10px;
      cursor: col-resize;
      z-index: 6;
      touch-action: none;
    }

    #desktop-split-workspace-resizer::before {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 3px;
      height: 74px;
      transform: translate(-50%, -50%);
      border-radius: 999px;
      background: color-mix(in srgb, var(--accent) 36%, var(--border));
      opacity: 0.55;
      transition: opacity 0.14s ease, background 0.14s ease;
    }

    #desktop-split-workspace-resizer:hover::before,
    #desktop-split-workspace-resizer.is-dragging::before {
      opacity: 1;
      background: color-mix(in srgb, var(--accent) 86%, #fff 14%);
    }

    #chat-screen.split-workspace-open #desktop-split-workspace {
      display: block;
    }

    #chat-screen.split-workspace-app-only #desktop-split-workspace {
      display: block;
      top: var(--main-header-height);
      width: 100%;
      border-inline-start: none;
      box-shadow: none;
    }

    #chat-screen.split-workspace-app-only #desktop-split-workspace-resizer,
    #chat-screen.split-workspace-app-only #chat-body,
    #chat-screen.split-workspace-app-only #chat-empty-state {
      display: none !important;
    }

    #chat-screen.split-workspace-app-only .chat-header {
      padding-inline-end: 20px;
    }

    #chat-screen.split-workspace-open #chat-body {
      padding-inline-end: var(--split-workspace-width);
    }

    #desktop-split-panes {
      display: flex;
      width: 100%;
      height: 100%;
      min-width: 0;
    }

    .split-pane {
      position: relative;
      min-width: 280px;
      flex: 1 1 0;
      display: flex;
      flex-direction: column;
      background: color-mix(in srgb, var(--bg-secondary) 92%, var(--bg-primary));
      min-height: 0;
      overflow: hidden;
    }

    .split-pane + .split-pane {
      border-inline-start: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
    }

    .split-pane-resizer {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0px;
      width: 4px;
      cursor: col-resize;
      z-index: 3;
      touch-action: none;
      background-color: #61626d24;
    }

    .split-pane-resizer::before {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 3px;
      height: 54px;
      transform: translate(-50%, -50%);
      border-radius: 999px;
      background: color-mix(in srgb, var(--accent) 40%, var(--border));
      opacity: 0.48;
      transition: opacity 0.14s ease, background 0.14s ease;
    }

    .split-pane-resizer:hover::before,
    .split-pane-resizer.is-dragging::before {
      opacity: 1;
      background: color-mix(in srgb, var(--accent) 88%, #fff 12%);
    }

    .split-pane-header {
      display: none;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      min-height: var(--main-header-height);
      padding: 0 12px 0 18px;
      border-bottom: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
      background: color-mix(in srgb, var(--bg-secondary) 94%, var(--bg-primary));
      position: relative;
      z-index: 4;
      flex-shrink: 0;
    }

    .split-pane.split-pane-has-shell-header .split-pane-header {
      display: flex;
    }

    .split-pane-header-copy {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .split-pane-header-kicker {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--text-muted);
    }

    .split-pane-header-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .split-pane-close-btn {
      width: 34px;
      height: 34px;
      border-radius: 11px;
      border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
      background: color-mix(in srgb, var(--bg-primary) 78%, transparent);
      backdrop-filter: blur(10px);
      color: var(--text-muted);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      flex-shrink: 0;
      transition: background 0.14s ease, color 0.14s ease;
    }

    .split-pane-close-btn:hover {
      background: color-mix(in srgb, var(--accent) 14%, transparent);
      color: var(--accent);
    }

    .split-pane-close-btn-inline {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      backdrop-filter: none;
    }

    .split-pane-body {
      flex: 1;
      min-height: 0;
      position: relative;
      background: var(--bg-primary-dark);
    }

    .split-pane-loading {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      background:
        linear-gradient(180deg, color-mix(in srgb, var(--bg-secondary) 92%, transparent), color-mix(in srgb, var(--bg-primary) 98%, transparent));
      color: var(--text-secondary);
      z-index: 2;
      transition: opacity 0.18s ease, visibility 0.18s ease;
    }

    .split-pane-loading[aria-hidden="true"] {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    .split-pane-loading-spinner {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      border: 2px solid color-mix(in srgb, var(--border) 82%, transparent);
      border-top-color: var(--accent);
      animation: splitPaneSpin 0.85s linear infinite;
    }

    .split-pane-loading-label {
      font-size: 12px;
      color: var(--text-muted);
    }

    .split-pane-iframe {
      width: 100%;
      height: 100%;
      border: 0;
      background: var(--bg-primary);
    }

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

    .split-pane-placeholder {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      background:
        radial-gradient(circle at top, color-mix(in srgb, var(--accent) 10%, transparent), transparent 40%),
        var(--bg-primary-dark);
    }

    .split-pane-placeholder-card {
      max-width: 280px;
      border-radius: 18px;
      border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
      background: color-mix(in srgb, var(--bg-secondary) 92%, transparent);
      padding: 22px 20px;
      text-align: center;
      box-shadow: 0 18px 48px rgba(0,0,0,0.2);
    }

    .split-pane-placeholder-card i {
      font-size: 28px;
      color: var(--accent);
      margin-bottom: 12px;
    }

    .split-pane-placeholder-card h3 {
      margin: 0 0 8px;
      font-size: 15px;
      color: var(--text-primary);
    }

    .split-pane-placeholder-card p {
      margin: 0;
      font-size: 12px;
      line-height: 1.7;
      color: var(--text-muted);
    }

    @media (max-width: 959px) {
      .chat-header {
        padding-inline-end: 20px;
      }

      #desktop-split-workspace {
        display: none !important;
      }
    }

    /* --- In-header search bar --- */
    #chat-search-bar {
      display: none;
      position: absolute;
      inset: 0;
      background: var(--bg-secondary);
      border-bottom: 1px solid var(--border);
      align-items: center;
      gap: 8px;
      padding: 0 10px 0 6px;
      z-index: 20;
    }
    #chat-search-bar.active { display: flex; }
    .csb-back-btn {
      background: none; border: none; color: var(--text-muted);
      cursor: pointer; font-size: 17px; padding: 6px 10px;
      border-radius: 8px; flex-shrink: 0; transition: color 0.15s;
      display: flex; align-items: center; justify-content: center;
    }
    .csb-back-btn:hover { color: var(--accent); }
    .csb-input-wrap {
      flex: 1; min-width: 0; position: relative;
      display: flex; align-items: center;
    }
    .csb-input-wrap .csb-icon {
      position: absolute; left: 10px; color: var(--text-muted);
      font-size: 12px; pointer-events: none;
    }
    #chat-search-input {
      width: 100%; background: var(--bg-tertiary);
      border: 1px solid var(--border); border-radius: 20px;
      padding: 7px 12px 7px 30px;
      color: var(--text-primary); font-size: 13px; outline: none;
      transition: border-color 0.15s;
    }
    #chat-search-input:focus { border-color: var(--accent); }
    #chat-search-input::placeholder { color: var(--text-muted); }
    .csb-counter {
      font-size: 12px; color: var(--text-muted); white-space: nowrap;
      min-width: 48px; text-align: center; flex-shrink: 0;
    }
    .csb-nav-btn {
      background: none; border: none; color: var(--text-muted);
      cursor: pointer; font-size: 14px; padding: 5px 7px;
      border-radius: 8px; display: flex; align-items: center;
      justify-content: center; transition: color 0.15s;
      flex-shrink: 0;
    }
    .csb-nav-btn:hover { color: var(--accent); }
    .csb-nav-btn:disabled { opacity: 0.3; cursor: default; }
    .csb-nav-btn:disabled:hover { color: var(--text-muted); }
    /* highlight on found messages while search is active */
    .msg-search-match { background: rgba(var(--accent-rgb, 99,102,241), 0.13) !important; border-radius: 8px; }
    .msg-search-current { background: rgba(var(--accent-rgb, 99,102,241), 0.30) !important; outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
    .msg-search-target-persistent {
      background: rgba(var(--accent-rgb, 99,102,241), 0.22) !important;
      outline: 2px solid color-mix(in srgb, var(--accent) 86%, white);
      outline-offset: -2px;
      border-radius: 8px;
      box-shadow: 0 0 0 1px rgba(var(--accent-rgb, 99,102,241), 0.18), 0 10px 24px rgba(0,0,0,0.10);
    }

    /* ---- Chat media modal ---- */
    #chat-media-modal {
      display: flex; position: fixed; inset: 0;
      background: rgba(9, 12, 20, 0.72);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      z-index: 1200; flex-direction: column;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.18s ease, visibility 0.18s;
    }
    #chat-media-modal.open {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }
    #chat-media-modal > * {
      transform: translateY(10px);
      opacity: 0;
      transition: transform 0.18s ease, opacity 0.18s ease;
    }
    #chat-media-modal.open > * {
      transform: none;
      opacity: 1;
    }
    .cmm-header {
      display: flex; align-items: center; gap: 10px;
      padding: 0 8px 0 4px; height: 56px;
      background: var(--bg-secondary); border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .cmm-back {
      background: none; border: none; color: var(--text-muted);
      cursor: pointer; font-size: 17px; padding: 8px 12px;
      border-radius: 8px; display: flex; align-items: center;
      transition: color 0.15s;
    }
    .cmm-back:hover { color: var(--accent); }
    .cmm-title { font-size: 15px; font-weight: 600; color: var(--text-primary); flex: 1; }
    /* Tabs */
    .cmm-tabs {
      display: flex; border-bottom: 1px solid var(--border);
      background: var(--bg-secondary); flex-shrink: 0; overflow-x: auto;
      scrollbar-width: none;
    }
    .cmm-tabs::-webkit-scrollbar { display: none; }
    .cmm-tab {
      flex: 1; min-width: 72px; padding: 12px 6px 10px;
      text-align: center; font-size: 13px; font-weight: 500;
      color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent;
      transition: color 0.15s, border-color 0.15s; white-space: nowrap;
      display: flex; align-items: center; justify-content: center; gap: 5px;
    }
    .cmm-tab:hover { color: var(--text-primary); }
    .cmm-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
    /* Panels */
    .cmm-panel { display: none; flex: 1; overflow-y: auto; padding: 12px; }
    .cmm-panel.active { display: block; }
    /* Image grid */
    .cmm-image-grid {
      display: grid; grid-template-columns: repeat(3, 1fr);
      gap: 3px;
    }
    .cmm-image-thumb {
      aspect-ratio: 1; overflow: hidden; cursor: pointer;
      border-radius: 4px; background: var(--bg-tertiary);
      position: relative;
    }
    .cmm-image-thumb img {
      width: 100%; height: 100%; object-fit: cover; display: block;
      transition: transform 0.2s;
    }
    .cmm-image-thumb:hover img { transform: scale(1.04); }
    /* Video grid */
    .cmm-video-grid {
      display: grid; grid-template-columns: repeat(2, 1fr);
      gap: 8px;
    }
    .cmm-video-item {
      border-radius: 10px; overflow: hidden; background: var(--bg-tertiary);
      cursor: pointer; position: relative;
    }
    .cmm-video-thumb {
      width: 100%; aspect-ratio: 16/9; background: #000;
      display: flex; align-items: center; justify-content: center;
      font-size: 28px; color: rgba(255,255,255,0.7);
      position: relative; overflow: hidden;
    }
    .cmm-video-thumb video {
      position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    }
    .cmm-video-thumb img {
      position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    }
    .cmm-video-thumb .cmm-video-placeholder {
      font-size: 32px; color: rgba(255,255,255,0.4);
    }
    .cmm-video-thumb .cmm-play-icon {
      position: relative; z-index: 1; pointer-events: none;
      background: rgba(0,0,0,0.5); border-radius: 50%;
      width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    }
    .cmm-video-name {
      font-size: 11px; color: var(--text-muted); padding: 5px 8px 7px;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    /* File list */
    .cmm-file-list { display: flex; flex-direction: column; gap: 6px; }
    .cmm-file-item {
      display: flex; align-items: center; gap: 12px;
      padding: 10px 12px; border-radius: 10px;
      background: var(--bg-secondary); text-decoration: none;
      color: var(--text-primary); border: 1px solid var(--border);
      transition: border-color 0.15s;
    }
    .cmm-file-item:hover { border-color: var(--accent); }
    .cmm-file-icon { font-size: 22px; flex-shrink: 0; width: 28px; text-align: center; }
    .cmm-file-info { flex: 1; min-width: 0; }
    .cmm-file-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cmm-file-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
    .cmm-file-dl { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
    /* Audio list */
    .cmm-audio-list { display: flex; flex-direction: column; gap: 6px; }
    .cmm-audio-item {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 12px; border-radius: 10px;
      background: var(--bg-secondary); border: 1px solid var(--border);
    }
    .cmm-audio-info { flex: 1; min-width: 0; }
    .cmm-audio-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cmm-audio-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
    .cmm-audio-player { flex: 1; min-width: 0; }
    /* empty state */
    .cmm-empty {
      display: flex; flex-direction: column; align-items: center;
      justify-content: center; padding: 60px 20px; gap: 12px;
      color: var(--text-muted); font-size: 14px; text-align: center;
    }
    .cmm-empty i { font-size: 36px; opacity: 0.35; }

    #ptt-floating-wrap {
      position: absolute;
      left: 50%;
      bottom: 102px;
      transform: translateX(-50%);
      display: none;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      z-index: 16;
    }
    #ptt-floating-wrap.visible { display: flex; }
    .ptt-floating-label {
      background: rgba(2,6,23,0.82);
      border: 1px solid rgba(148,163,184,0.22);
      color: #e2e8f0;
      font-size: 12px;
      font-weight: 600;
      padding: 7px 12px;
      border-radius: 999px;
      backdrop-filter: blur(8px);
      box-shadow: 0 8px 24px rgba(2,6,23,0.28);
      white-space: nowrap;
    }
    #ptt-floating-btn {
      width: 80px;
      height: 80px;
      border: none;
      border-radius: 50%;
      background: linear-gradient(135deg, #ef4444, #f97316);
      color: #fff;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 30px;
      cursor: pointer;
      box-shadow: 0 18px 36px rgba(239,68,68,0.34);
      transition: transform 0.16s, box-shadow 0.16s, filter 0.16s;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
    }
    #ptt-floating-btn:hover { transform: scale(1.03); filter: brightness(1.04); }
    #ptt-floating-btn.active {
      transform: scale(1.08);
      box-shadow: 0 0 0 8px rgba(248,113,113,0.18), 0 24px 42px rgba(239,68,68,0.42);
    }
    #ptt-floating-btn.active i { animation: pttPulse 0.9s ease-in-out infinite; }
    #ptt-cancel-btn {
      border: 1px solid rgba(148,163,184,0.28);
      background: rgba(15,23,42,0.88);
      color: #f8fafc;
      border-radius: 999px;
      padding: 6px 12px;
      font-size: 11px;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      box-shadow: 0 10px 24px rgba(2,6,23,0.22);
      transition: transform 0.16s, background 0.16s, border-color 0.16s;
    }
    #ptt-cancel-btn:hover {
      transform: translateY(-1px);
      background: rgba(30,41,59,0.96);
      border-color: rgba(248,113,113,0.34);
    }
    @keyframes pttPulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.12); }
    }

    .room-delete-btn {
      width: 100%;
      background: var(--room-delete-bg, #7f1d1d);
      color: var(--room-delete-color, #fca5a5);
      border: 1px solid var(--room-delete-border, #991b1b);
      border-radius: 8px;
      padding: 9px 16px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: all 0.2s;
    }
    .room-delete-btn:hover {
      filter: brightness(1.15);
    }

    /* --- Profile dropdown --- */
    .profile-wrap {
      position: relative;
      display: flex;
      align-items: center;
      gap: 0px;
    }
    .profile-dots-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 6px 8px;
      font-size: 16px;
      display: flex;
      align-items: center;
      border-radius: 8px;
      transition: all 0.2s;
    }
    .profile-dots-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

    .profile-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: 13px;
      padding: 6px 12px 6px 8px;
      cursor: pointer;
      transition: border-color 0.2s;
      color: var(--text-primary);
      font-size: 13px;
      font-family: inherit;
    }

    .profile-btn:hover { border-color: var(--accent); }

    .profile-avatar {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 700;
      color: white;
      flex-shrink: 0;
    }

    .profile-dropdown {
      position: absolute;
      top: calc(100% + 4px);
      right: 0;
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: 10px;
      min-width: 190px;
      box-shadow: var(--shadow);
      overflow: hidden;
      z-index: 60;
      transform-origin: top right;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transform: translateY(-4px) scale(0.97);
      transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
    }

    .profile-wrap.open .profile-dropdown { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }

    .profile-dropdown button {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      padding: 8px 16px;
      background: none;
      border: none;
      color: var(--text-secondary);
      font-size: 13px;
      font-family: inherit;
      cursor: pointer;
      text-align: left;
      transition: background 0.15s, color 0.15s;
    }

    .profile-dropdown button:hover { background: var(--bg-tertiary); color: var(--text-primary); }
    .profile-dropdown button.danger:hover { color: var(--accent); }

    /* --- Sidebar (Online Users) --- */
    .chat-body {
      display: flex;
      flex: 1;
      overflow: hidden;
    }

    /* ── Pin bar ──────────────────────────────────────────────────────────── */
    #pin-bar {
      display: flex;
      align-items: center;
      background:  color-mix(in srgb, var(--bg-secondary) 70%, transparent);;
      border-bottom: 1px solid var(--border);
      min-height: 44px;
      flex-shrink: 0;
      overflow: hidden;
      transition: background 0.15s;
      position: relative;
      z-index: 2;
    }
    .pin-bar-indicator {
      width: 3px;
      align-self: stretch;
      background: var(--accent);
      flex-shrink: 0;
    }
    .pin-bar-icon {
      font-size: 13px;
      color: var(--accent);
      flex-shrink: 0;
      padding: 0 10px;
    }
    .pin-bar-body {
      flex: 1;
      min-width: 0;
      padding: 8px 4px 2px 3px;
      cursor: pointer;
    }
    .pin-bar-body:hover .pin-bar-text { color: var(--text-primary); }
    .pin-bar-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--accent);
      line-height: 1.3;
    }
    .pin-bar-text {
      font-size: 13px;
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
      transition: color 0.15s;
      line-height: 18px;
      direction: rtl;
    }
    .pin-bar-counter {
      font-size: 11px;
      color: var(--text-muted);
      flex-shrink: 0;
      padding: 0 4px;
    }
    .pin-bar-nav {
      display: flex;
      flex-direction: column;
      gap: 1px;
      flex-shrink: 0;
      padding: 0 2px;
    }
    .pin-bar-nav-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 10px;
      padding: 3px 6px;
      border-radius: 4px;
      transition: color 0.15s, background 0.15s;
      line-height: 1;
    }
    .pin-bar-nav-btn:hover { color: var(--accent); background: var(--bg-tertiary); }
    .pin-bar-close-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 14px;
      padding: 8px 12px;
      transition: color 0.15s;
      flex-shrink: 0;
    }
    .pin-bar-close-btn:hover { color: var(--text-primary); }

