/* Voice channel, video call, notifications, sessions, themes, alert — index/calls.css */
    /* ============ VOICE CHANNEL ============ */
    #voice-bar {
      display: none;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      background: var(--bg-secondary);
      border-bottom: 1px solid var(--border);
      font-size: 13px;
      flex-shrink: 0;
    }
    #voice-bar.active { display: flex; }
    .voice-label { color: var(--text-muted); font-size: 12px; display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
    .voice-label .vdot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: vpulse 1.2s infinite; }
    @keyframes vpulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
    @keyframes pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.5; transform:scale(1.25); } }
    .room-voice-dot {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      color: #4ade80;
      font-size: 10px;
      font-weight: 600;
      flex-shrink: 0;
    }
    .room-voice-dot .rvd { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; animation: vpulse 1.1s ease-in-out infinite; flex-shrink: 0; }
    .sidebar-room-item .room-voice-dot { font-size: 9px; }
    .sidebar-room-item .room-voice-dot .rvd { width: 6px; height: 6px; }
    .voice-participants { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
    .voice-call-timer {
      color: #4ade80;
      font-size: 15px;
      font-weight: 700;
      font-variant-numeric: tabular-nums;
      letter-spacing: 1.5px;
      min-width: 52px;
      text-align: center;
      flex-shrink: 0;
      text-shadow: 0 0 10px rgba(74,222,128,0.55);
    }
    .voice-participant {
      position: relative;
      display: flex; align-items: center; justify-content: center;
      transition: border-color 0.2s;
      cursor: default;
    }
    .voice-participant.speaking .vp-avatar { box-shadow: 0 0 0 2px #22c55e; }
    .voice-participant .vp-avatar {
      width: 30px; height: 30px; border-radius: 50%;
      color: #fff;
      display: flex; align-items: center; justify-content: center;
      font-size: 13px; font-weight: 700; flex-shrink: 0;
      border: 2px solid transparent; transition: box-shadow 0.2s;
      user-select: none; cursor: pointer;
    }
    .voice-participant .vp-muted-icon {
      position: absolute; bottom: -2px; right: -2px;
      background: #ef4444; border-radius: 50%; width: 12px; height: 12px;
      font-size: 8px; display: flex; align-items: center; justify-content: center;
    }
    /* Name tooltip on click */
    .voice-participant .vp-name-tip {
      display: none; position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
      background: #000; color: #fff; font-size: 11px; white-space: nowrap;
      padding: 3px 8px; border-radius: 6px; z-index: 100; pointer-events: none;
    }
    .voice-participant .vp-name-tip::after {
      content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
      border: 4px solid transparent; border-top-color: #000;
    }
    .voice-participant.show-name .vp-name-tip { display: block; }
    .voice-actions { display: flex; gap: 6px; margin-left: auto; flex-shrink: 0; }
    .voice-icon-btn {
      border: 1px solid var(--border); background: var(--bg-tertiary);
      color: var(--text-primary); border-radius: 50%; width: 32px; height: 32px;
      font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: all 0.18s; flex-shrink: 0;
    }
    .voice-icon-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
    .voice-icon-btn.muted { background: #ef4444; border-color: #ef4444; color: #fff; }
    .voice-icon-btn.leave { background: #ef4444; border-color: #ef4444; color: #fff; }
    .voice-btn { display: none; } /* legacy, hidden */
    .voice-join-hint {
      font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px;
    }
    /* Voice join button in header */
    .voice-header-btn {
      background: none; border: 1px solid var(--border); color: var(--text-muted);
      border-radius: 8px; padding: 6px 8px; font-size: 12px; cursor: pointer;
      display: flex; align-items: center; justify-content: center; transition: all 0.18s;
    }
    @media (hover: hover) {
      .voice-header-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
    }
    .voice-header-btn.in-voice { background: #22c55e22; border-color: #22c55e; color: #22c55e; }
    .voice-header-btn.calling { background: var(--accent); border-color: var(--accent); color: #fff; }

    /* ============ CHAT HEADER UPDATES ============ */
    .chat-header .header-left { display: flex; align-items: center; gap: 1px; padding-top: 9px; flex: 1; min-width: 0; overflow: hidden; }
    .back-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      font-size: 20px;
      cursor: pointer;
      padding: 4px;
      line-height: 1;
      transition: color 0.2s;
    }
    .back-btn:hover { color: var(--accent); }

    #modal-privacy-toggle::after {
      content: '';
      position: absolute;
      left: 3px; top: 3px;
      width: 14px; height: 14px;
      border-radius: 50%;
      background: #fff;
      transition: transform 0.2s;
    }
    #modal-privacy-toggle:checked::after { transform: translateX(16px); }

    /* ============ VIDEO CALL ============ */
    #vcall-overlay {
      display: none; position: fixed; inset: 0; z-index: 2000;
      background: #0a0a14; flex-direction: column; align-items: center; justify-content: center;
    }
    #vcall-overlay.active { display: flex; }
    #vcall-remote-video {
      width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0;
      background: #111;
    }
    #vcall-local-video {
      position: absolute; bottom: 90px; right: 16px;
      width: 110px; height: 150px; object-fit: cover;
      border-radius: 14px; border: 2px solid rgba(255,255,255,0.2);
      background: #1a1a2e; z-index: 10;
    }
    #vcall-status {
      position: absolute; top: 36px; left: 50%; transform: translateX(-50%);
      color: rgba(255,255,255,0.85); font-size: 15px; font-weight: 500; text-align: center;
      text-shadow: 0 1px 4px rgba(0,0,0,0.8); z-index: 10; white-space: nowrap;
      letter-spacing: 0.3px;
    }
    #vcall-timer {
      position: absolute; top: 66px; left: 50%; transform: translateX(-50%);
      color: rgba(255,255,255,0.97); font-size: 42px; font-weight: 200;
      letter-spacing: 6px;
      text-shadow: 0 0 28px rgba(255,255,255,0.22), 0 2px 10px rgba(0,0,0,0.9);
      z-index: 10; font-variant-numeric: tabular-nums;
      display: none;
    }
    #vcall-controls {
      position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
      display: flex; gap: 16px; z-index: 10;
    }
    .vcall-btn {
      width: 54px; height: 54px; border-radius: 50%; border: none;
      cursor: pointer; font-size: 18px;
      display: flex; align-items: center; justify-content: center;
      transition: transform 0.15s, opacity 0.15s;
    }
    .vcall-btn:active { transform: scale(0.92); }
    .vcall-btn.end   { background: #e94560; color: #fff; }
    .vcall-btn.mute  { background: rgba(255,255,255,0.15); color: #fff; }
    .vcall-btn.cam   { background: rgba(255,255,255,0.15); color: #fff; }
    .vcall-btn.flip  { background: rgba(255,255,255,0.15); color: #fff; }
    .vcall-btn.mute.off, .vcall-btn.cam.off { background: rgba(255,255,255,0.35); color: #000; }

    /* Incoming call modal */
    #vcall-incoming {
      display: none; position: fixed; inset: 0; z-index: 1999;
      background: rgba(0,0,0,0.75); align-items: center; justify-content: center;
    }
    #vcall-incoming.active { display: flex; }
    .vcall-incoming-box {
      background: var(--bg-secondary); border-radius: 20px; padding: 32px 28px;
      text-align: center; width: 280px; border: 1px solid var(--border);
      animation: fadeIn 0.2s ease;
    }
    .vcall-caller-avatar {
      width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 12px;
      display: flex; align-items: center; justify-content: center;
      font-size: 28px; font-weight: 700; color: #fff; overflow: hidden;
    }
    .vcall-caller-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
    .vcall-caller-sub  { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
    .vcall-incoming-btns { display: flex; gap: 20px; justify-content: center; }
    .vcall-incoming-btns .vcall-btn { width: 60px; height: 60px; font-size: 22px; }
    .vcall-incoming-btns .accept { background: #22c55e; color: #fff; }
    .vcall-incoming-btns .reject { background: #e94560; color: #fff; }
    /* Audio-only call overlay */
    #vcall-overlay.audio-only #vcall-remote-video,
    #vcall-overlay.audio-only #vcall-local-video { display: none; }
    #vcall-overlay.audio-only #vcall-cam-btn,
    #vcall-overlay.audio-only #vcall-flip-btn { display: none; }
    #vcall-audio-avatar {
      display: none; flex-direction: column; align-items: center; gap: 12px;
      position: absolute; top: 50%; left: 50%; transform: translate(-50%,-60%); z-index: 10;
    }
    #vcall-overlay.audio-only #vcall-audio-avatar { display: flex; }
    #vcall-audio-avatar .av-circle {
      width: 96px; height: 96px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 38px; font-weight: 700; color: #fff; overflow: hidden;
    }
    #vcall-audio-name { color: #fff; font-size: 20px; font-weight: 700; text-align: center; }
    #vcall-status.audio-mode {
      top: auto; bottom: 120px; transform: translateX(-50%);
      font-size: 14px; color: rgba(255,255,255,0.6); font-weight: 400;
    }
    /* ── Native-app notification settings modal ─────────────────────────── */
    .toggle-switch { position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; }
    .toggle-switch input { opacity:0; width:0; height:0; }
    .toggle-slider { position:absolute; cursor:pointer; inset:0; background:var(--border); border-radius:24px; transition:.2s; }
    .toggle-slider:before { position:absolute; content:""; height:18px; width:18px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.2s; }
    .toggle-switch input:checked + .toggle-slider { background:var(--accent); }
    .toggle-switch input:checked + .toggle-slider:before { transform:translateX(20px); }
    .settings-row { display:flex; align-items:center; justify-content:space-between; padding:14px 0; border-bottom:1px solid var(--border); gap:16px; }
    .settings-row:last-child { border-bottom:none; }
    .settings-row-text { flex:1; }
    .settings-row-title { font-size:14px; color:var(--text-primary); }
    .settings-row-sub { font-size:12px; color:var(--text-muted); margin-top:3px; }
    .settings-nav-row {
      display:flex; align-items:center; justify-content:space-between;
      padding:14px 0; border-bottom:1px solid var(--border); gap:16px;
      cursor:pointer; border-radius:4px;
      transition: background 0.12s;
    }
    .settings-nav-row:hover .settings-row-title { color:var(--accent); }
    .settings-nav-row:last-child { border-bottom:none; }
    .settings-nav-chevron { color:var(--text-muted); font-size:13px; flex-shrink:0; }
    .settings-sound-val { font-size:12px; color:var(--accent); margin-top:3px; }
    .settings-choose-btn { background:var(--bg-tertiary); border:1px solid var(--border); border-radius:8px; padding:6px 14px; color:var(--text-secondary); font-size:13px; cursor:pointer; white-space:nowrap; flex-shrink:0; }
    .settings-choose-btn:hover { border-color:var(--accent); color:var(--accent); }

    /* ── Active Sessions ─────────────────────────────────────────────── */
    .session-card {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 12px 14px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--bg-secondary);
    }
    .session-card-current { border-color: #6366f1; }
    .session-card-icon {
      width: 38px; height: 38px; border-radius: 10px;
      background: var(--bg-tertiary);
      display: flex; align-items: center; justify-content: center;
      color: var(--text-secondary); font-size: 16px; flex-shrink: 0;
    }
    .session-card-current .session-card-icon { background:#6366f1; color:#fff; }
    .session-card-info { flex: 1; min-width: 0; }
    .session-card-name { font-size: 14px; color: var(--text-primary); font-weight: 500; margin-bottom: 4px; }
    .session-card-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
    .session-badge-current {
      display: inline-block; padding: 1px 6px; border-radius: 20px;
      background: #6366f1; color: #fff; font-size: 10px; font-weight: 600; margin-inline-start: 4px;
    }
    .session-terminate-btn {
      background: none; border: 1px solid var(--border); border-radius: 8px;
      padding: 7px 10px; color: #ef4444; font-size: 14px; cursor: pointer;
      flex-shrink: 0; align-self: center; transition: background .15s;
    }
    .session-terminate-btn:hover { background: rgba(239,68,68,.1); border-color: #ef4444; }

    .settings-select {
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 6px 10px;
      color: var(--text-primary);
      font-size: 13px;
      min-width: 120px;
      max-width: 170px;
      cursor: pointer;
      font-family: inherit;
      outline: none;
    }
    .settings-select:focus { border-color: var(--accent); }

    /* ── Theme selector ──────────────────────────────────────────────── */
    .theme-section-label {
      font-size: 14px;
      color: var(--text-primary);
      margin-bottom: 12px;
      font-weight: 500;
    }
    .theme-grid {
      display: flex;
      gap: 12px;
      overflow-x: auto;
      padding-bottom: 6px;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    .theme-grid::-webkit-scrollbar { display: none; }
    .theme-card {
      flex: 0 0 auto;
      width: 80px;
      cursor: pointer;
      text-align: center;
      position: relative;
      transition: transform 0.15s ease;
    }
    .theme-card:active { transform: scale(0.96); }
    .theme-card-preview {
      width: 80px;
      height: 110px;
      border-radius: 12px;
      border: 2px solid transparent;
      overflow: hidden;
      position: relative;
      transition: border-color 0.2s ease;
    }
    .theme-card.selected .theme-card-preview {
      border-color: var(--accent);
    }
    .theme-card-bg {
      position: absolute;
      inset: 0;
    }
    .theme-card-bubble {
      position: absolute;
      border-radius: 8px;
      padding: 4px 8px;
      font-size: 7px;
      max-width: 52px;
      line-height: 1.3;
      word-break: break-all;
    }
    .theme-card-bubble.incoming {
      left: 6px;
      border-bottom-left-radius: 2px;
    }
    .theme-card-bubble.outgoing {
      right: 6px;
      border-bottom-right-radius: 2px;
    }
    .theme-card-input {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 18px;
      display: flex;
      align-items: center;
      padding: 0 6px;
      font-size: 6px;
      opacity: 0.7;
    }
    .theme-card-name {
      font-size: 11px;
      margin-top: 6px;
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: color 0.2s;
    }
    .theme-card.selected .theme-card-name {
      color: var(--accent);
      font-weight: 600;
    }
    .theme-card-check {
      display: none;
      position: absolute;
      top: 4px;
      right: 4px;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: var(--accent);
      color: #fff;
      font-size: 10px;
      align-items: center;
      justify-content: center;
      z-index: 2;
    }
    .theme-card.selected .theme-card-check {
      display: flex;
    }
    @media (max-width: 600px) {
      .theme-card { width: 72px; }
      .theme-card-preview { width: 72px; height: 100px; }
    }

    /* In-app popup for replacing browser alert dialogs */
    #app-popup {
      position: fixed;
      top: 14px;
      left: 50%;
      transform: translate(-50%, -12px);
      min-width: 220px;
      max-width: min(92vw, 460px);
      background: var(--bg-secondary);
      color: var(--text-primary);
      border: 1px solid var(--border);
      border-left: 4px solid var(--accent);
      border-radius: 10px;
      box-shadow: var(--shadow);
      padding: 10px 12px;
      font-size: 13px;
      line-height: 1.45;
      z-index: 100001;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease, transform 0.2s ease;
      white-space: pre-wrap;
      word-break: break-word;
    }
    #app-popup.show {
      opacity: 1;
      transform: translate(-50%, 0);
    }
    #app-popup.success { border-left-color: #22c55e; }
    #app-popup.warning { border-left-color: #f59e0b; }
    #app-popup.error { border-left-color: #ef4444; }
