/* Sidebar, hamburger, responsive — index/sidebar.css */
    /* ===== SIDEBAR ===== */
    .sidebar {
      width: 220px;
      min-width: 220px;
      background: var(--bg-secondary);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      padding: 14px 12px;
      overflow-y: auto;
      overflow-x: hidden;
      transition: width 0.22s ease, min-width 0.22s ease, padding 0.22s ease;
      scrollbar-width: thin;
      scrollbar-color: transparent transparent;
      flex-shrink: 0;
      z-index: 5;
      position: relative;
      contain: content;
    }

    .sidebar:hover {
      scrollbar-color: rgba(128,128,128,0.5) transparent;
    }
    .sidebar::-webkit-scrollbar {
      width: 4px;
    }
    .sidebar::-webkit-scrollbar-track {
      background: transparent;
    }
    .sidebar::-webkit-scrollbar-thumb {
      background: transparent;
      border-radius: 4px;
    }
    .sidebar:hover::-webkit-scrollbar-thumb {
      background: rgba(128,128,128,0.5);
    }

    /* ===== SIDEBAR RESIZE HANDLE ===== */
    .sidebar-resize-handle {
      flex-shrink: 0;
      width: 5px;
      align-self: stretch;
      cursor: col-resize;
      z-index: 10;
      background: transparent;
      transition: background 0.15s;
      margin: 0px -3px;
    }
    .sidebar-resize-handle:hover,
    .sidebar-resize-handle.dragging {
      background: var(--accent);
      opacity: 0.5;
    }
    /* Disable transition during drag for instant feedback */
    .sidebar.resizing {
      transition: none !important;
    }
    .sidebar.collapsed {
      width: 0;
      min-width: 0;
      padding: 0;
      overflow: hidden;
      border-right: none;
    }

    /* Arrow tab — visible only when sidebar is collapsed */
    .sidebar-toggle-tab {
      flex-shrink: 0;
      align-self: center;
      width: 13px;
      height: 44px;
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-left: none;
      border-radius: 0 6px 6px 0;
      display: none;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      color: var(--text-muted);
      z-index: 6;
      transition: background 0.15s, color 0.15s;
      padding: 0;
      position: relative;
      margin: 0px -10px 0px 0px;

    }
    .sidebar-toggle-tab:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
    .sidebar-toggle-tab svg { transition: transform 0.22s; }
    .sidebar-collapsed .sidebar-toggle-tab {
      display: flex;
    }
    .sidebar-collapsed .sidebar-toggle-tab svg { transform: rotate(180deg); }

    /* Nav row — Dashboard + Settings side by side */
    .sidebar-nav-row {
      display: flex;
      gap: 6px;
      margin-bottom: 12px;
      align-items: stretch;
    }
    /* Dashboard nav button */
    .sidebar-nav-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 1;
      padding: 9px 12px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: 10px;
      color: var(--text-primary);
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      overflow: hidden;
      transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    }
    .sidebar-nav-btn:hover {
      background: var(--accent);
      border-color: var(--accent);
      color: #fff;
      box-shadow: 0 2px 10px rgba(79,142,247,0.28);
    }
    /* Settings icon-only button */
    .sidebar-settings-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      width: 38px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: 10px;
      color: var(--text-muted);
      cursor: pointer;
      transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    }
    .sidebar-settings-btn svg {
      transition: transform 0.45s cubic-bezier(.4,2,.6,1);
    }
    .sidebar-settings-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
      box-shadow: 0 2px 10px rgba(79,142,247,0.18);
    }
    .sidebar-settings-btn:hover svg {
      transform: rotate(90deg);
    }
    .saved-msg-nav-btn {
      display: flex;
      align-items: center;
      gap: 9px;
      width: 100%;
      padding: 9px 10px;
      margin-bottom: 8px;
      border: none;
      background: linear-gradient(135deg, rgba(79,142,247,0.12), rgba(124,91,255,0.12));
      color: var(--text-primary);
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.15s, border-color 0.15s, color 0.15s;
      box-sizing: border-box;
    }
    .saved-msg-nav-btn:hover { background: linear-gradient(135deg, rgba(79,142,247,0.22), rgba(124,91,255,0.22)); border-color: rgba(124,91,255,0.5); }
    .saved-msg-nav-btn.active { background: linear-gradient(135deg, #4f8ef7, #7c5bff); border-color: transparent; color: #fff; font-weight: 600; }

    /* Sidebar search */
    .sidebar-search-wrap {
      position: relative;
      display: flex;
      align-items: center;
      gap: 7px;
      margin-bottom: 12px;
      padding: 7px 10px;
      background: var(--bg-tertiary);
      border: 1.5px solid var(--border);
      border-radius: 10px;
      transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    }
    .sidebar-search-wrap:focus-within {
      border-color: var(--accent);
      background: var(--bg-primary);
      box-shadow: 0 0 0 3px rgba(79,142,247,0.12);
    }
    .sidebar-search-icon {
      font-size: 11px;
      color: var(--text-muted);
      flex-shrink: 0;
      transition: color 0.2s;
    }
    .sidebar-search-wrap:focus-within .sidebar-search-icon {
      color: var(--accent);
    }
    .sidebar-search-wrap input {
      flex: 1;
      border: none;
      background: transparent;
      outline: none;
      font-size: 12.5px;
      color: var(--text-primary);
      min-width: 0;
      font-family: inherit;
      padding: 0;
    }
    .sidebar-search-wrap input::placeholder {
      color: var(--text-muted);
      font-size: 12px;
    }
    .sidebar-search-clear {
      background: none;
      border: none;
      cursor: pointer;
      color: var(--text-muted);
      padding: 2px 4px;
      font-size: 11px;
      line-height: 1;
      flex-shrink: 0;
      border-radius: 4px;
      transition: color 0.15s, background 0.15s;
    }
    .sidebar-search-clear:hover {
      color: var(--text-primary);
      background: var(--bg-secondary);
    }

    .sidebar-label {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: var(--text-muted);
      margin-bottom: 8px;
      white-space: nowrap;
    }
    .sidebar-room-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 7px 8px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 12px;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: background 0.15s, color 0.15s;
      margin-bottom: 2px;
    }
    .sidebar-room-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
    .sidebar-room-item.active { background: var(--accent); color: #fff; font-weight: 600; }
    .sidebar-room-item .room-unread {
      margin-left: auto; background: var(--accent); color: #fff;
      border-radius: 10px; font-size: 10px; font-weight: 700;
      padding: 1px 6px; flex-shrink: 0;
    }
    .sidebar-room-item.active .room-unread { background: rgba(255,255,255,0.3); }
    .sidebar-room-item .room-hash { font-size: 15px; opacity: 0.6; flex-shrink: 0; }
    /* Scale down room-badge inside sidebar */
    .sidebar-room-item .room-badge {
      font-size: 9px;
      padding: 2px 5px;
      width: 20px;
      flex-shrink: 0;
      line-height: 12px;
    }
    .sidebar-room-item .room-badge i {
      margin-top: 2px;
    }
    .sidebar-room-item.sidebar-the-apps-item .room-badge{
      padding: 2px 3px;
    }
    .sidebar-room-item.active .room-badge {
      background: rgba(255,255,255,0.2) !important;
      color: #fff !important;
      border-color: rgba(255,255,255,0.3) !important;
    }

    /* ---- Room items with avatar (Telegram-style list) ---- */
    .sidebar-room-item.has-avatar {
      padding: 4px 10px;
      font-size: 14px;
      border-radius: 9px;
    }
    .sidebar-room-item.has-avatar .sidebar-room-name {
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 13px;
      line-height: 1.4;
    }
    .sidebar-room-item.has-avatar .dm-avatar {
      border-radius: 50%;
      color: #fff;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      flex-shrink: 0;
    }
    .sidebar-dm-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 4px 10px;
      cursor: pointer;
      font-size: 14px;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      position: relative;
      transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    }
    .sidebar-dm-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
    .sidebar-dm-item.active { background: var(--accent); color: #fff; font-weight: 600; }
    .sidebar-dm-item.secure-chat {
      background: linear-gradient(90deg, rgba(185, 28, 28, 0.12), rgba(239, 68, 68, 0.04));
      box-shadow: inset 3px 0 0 rgba(185, 28, 28, 0.55);
    }
    .sidebar-dm-item.secure-chat:hover {
      background: linear-gradient(90deg, rgba(185, 28, 28, 0.18), rgba(239, 68, 68, 0.07));
    }
    .sidebar-dm-item.secure-chat.active {
      background: linear-gradient(90deg, #991b1b, #b91c1c);
      box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.32);
    }
    .dm-item-info { display: flex; flex-direction: column; overflow: hidden; flex: 1; min-width: 0; gap: 0; line-height: 1.2; }
    .dm-item-row1 { display: flex; align-items: baseline; gap: 4px; overflow: hidden; }
    .dm-item-meta { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; flex-shrink: 0; margin-left: auto; }
    .dm-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.4; flex: 1; min-width: 0; }
    .dm-item-ts { font-size: 10px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
    .sidebar-dm-item.active .dm-item-ts { color: rgba(255,255,255,0.65); }
    .dm-item-status { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
    .dm-item-status.away-status { color: #f97316; }
    .dm-item-preview { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; unicode-bidi: plaintext; text-align: start; }
    .sidebar-dm-item.active .dm-item-status { color: rgba(255,255,255,0.65); }
    .sidebar-dm-item.active .dm-item-preview { color: rgba(255,255,255,0.65); }
    /* Room item info layout (name + preview) */
    .sidebar-room-info { display: flex; flex-direction: column; overflow: hidden; flex: 1; min-width: 0; gap: 0; line-height: 1.2; }
    .sidebar-room-item .sidebar-room-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.4; }
    .sidebar-room-item.active .dm-item-ts { color: rgba(255,255,255,0.65); }
    .sidebar-room-item.active .dm-item-preview { color: rgba(255,255,255,0.65); }
    .dm-avatar {
      border-radius: 50%; color: #fff; overflow: hidden;
      display: flex; align-items: center; justify-content: center;
      font-weight: 700; flex-shrink: 0;
    }
    .sidebar-dm-item .dm-avatar {
      width: 40px; height: 40px; font-size: 14px;
    }
    .dm-avatar-wrap {
      position: relative; 
      flex-shrink: 0;
      height: 40px;;
    }
    .dm-avatar-secure-badge {
      position: absolute;
      top: -2px;
      left: -2px;
      width: 15px;
      height: 15px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: #b91c1c;
      color: #fff;
      border: 2px solid var(--bg-secondary);
      box-shadow: 0 6px 14px rgba(127, 29, 29, 0.22);
      font-size: 7px;
      z-index: 2;
    }
    .sidebar-dm-item.secure-chat.active .dm-avatar-secure-badge {
      border-color: #991b1b;
      background: rgba(255, 255, 255, 0.22);
    }
    .dm-online-dot {
      position: absolute; bottom: -1px; right: 1px;
      width: 10px; height: 10px; border-radius: 50%;
      background: #22c55e;
      border: 2px solid var(--bg-secondary);
      display: none;
    }
    .dm-avatar-wrap.online .dm-online-dot { display: block; }
    .dm-avatar-wrap.away .dm-online-dot { display: block; background: #f97316; }
    .sidebar-dm-item.active .dm-online-dot { border-color: var(--accent); }
    .sidebar-dm-item .dm-unread {
      margin-left: auto; background: var(--accent); color: #fff;
      border-radius: 10px; font-size: 10px; font-weight: 700;
      padding: 1px 6px; flex-shrink: 0;
    }
    .sidebar-dm-item.active .dm-unread { background: rgba(255,255,255,0.3); }
    .sidebar-dm-item .dm-unread.muted {
      background: var(--text-muted);
      color: var(--bg-secondary);
      filter: grayscale(1);
      opacity: 0.82;
    }

    /* ---- DM Context Menu ---- */
    #dm-context-menu {
      position: fixed;
      z-index: 9999;
      min-width: 200px;
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 6px 0;
      box-shadow: 0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.18);
      display: none;
      overflow: hidden;
      animation: dm-ctx-in 0.15s cubic-bezier(.34,1.56,.64,1) both;
    }
    @keyframes dm-ctx-in {
      from { opacity: 0; transform: scale(0.9) translateY(-6px); }
      to   { opacity: 1; transform: scale(1) translateY(0); }
    }
    #dm-context-menu.open { display: block; }
    .dm-ctx-item {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 16px;
      font-size: 13px;
      color: var(--text-primary);
      cursor: pointer;
      transition: background 0.12s;
    }
    .dm-ctx-item:hover { background: var(--bg-tertiary); }
    .dm-ctx-item i { width: 16px; text-align: center; font-size: 14px; color: var(--text-muted); flex-shrink: 0; }
    .dm-ctx-item.danger { color: #ef4444; }
    .dm-ctx-item.danger i { color: #ef4444; }
    .dm-ctx-sep { height: 1px; background: var(--border); margin: 4px 0; }
    #dm-context-backdrop {
      position: fixed; inset: 0; z-index: 9998; display: none;
    }
    #dm-context-backdrop.open { display: block; }

    /* ---- Room Context Menu ---- */
    #room-context-menu {
      position: fixed;
      z-index: 9999;
      min-width: 200px;
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 6px 0;
      box-shadow: 0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.18);
      display: none;
      overflow: hidden;
      animation: dm-ctx-in 0.15s cubic-bezier(.34,1.56,.64,1) both;
    }
    #room-context-menu.open { display: block; }
    #room-context-backdrop {
      position: fixed; inset: 0; z-index: 9998; display: none;
    }
    #room-context-backdrop.open { display: block; }

    /* ---- Room mute badge in sidebar ---- */
    .sidebar-room-item .room-unread.muted {
      background: var(--text-muted);
      color: var(--bg-secondary);
      filter: grayscale(1);
      opacity: 0.82;
    }

    /* ---- Room unread badge on dashboard cards ---- */
    .room-unread-card {
      background: var(--accent); color: #fff; border-radius: 10px;
      font-size: 11px; font-weight: 700; padding: 2px 7px 0px 7px; flex-shrink: 0;
    }
    .room-unread-card.muted {
      background: var(--text-muted); color: var(--bg-secondary);
      filter: grayscale(1); opacity: 0.75;
    }
    /* ---- Room bell button ---- */
    .room-bell-btn {
      color: var(--text-muted);
      font-size: 13px;
    }
    .room-bell-btn:hover { color: var(--accent); }

 .saved-msg-item-icon {
      width: 34px; height: 34px; border-radius: 50%;
      background: linear-gradient(135deg, #4f8ef7, #7c5bff);
      display: flex; align-items: center; justify-content: center;
      color: #fff; font-size: 15px; flex-shrink: 0;
    }
    .saved-msg-item-icon-header {
      width: 36px; height: 36px; border-radius: 50%;
      background: linear-gradient(135deg, #4f8ef7, #7c5bff);
      display: flex; align-items: center; justify-content: center;
      color: #fff; font-size: 18px; flex-shrink: 0;
    }

    .sidebar .user-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 0;
      font-size: 13px;
      color: var(--text-secondary);
      white-space: nowrap;
    }
    .sidebar .user-item .dot {
      width: 7px; height: 7px;
      background: var(--success);
      border-radius: 50%;
      flex-shrink: 0;
    }

    .sidebar-actions {
      margin-top: auto;
      padding-top: 14px;
      border-top: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    /* ===== HAMBURGER (mobile only) ===== */
    .hamburger {
      display: none;
      flex-direction: column;
      justify-content: center;
      gap: 5px;
      background: none;
      border: none;
      cursor: pointer;
      padding: 6px;
      margin-right: 4px;
    }
    .hamburger span {
      display: block;
      width: 22px;
      height: 2px;
      background: var(--text-secondary);
      border-radius: 2px;
      transition: background 0.2s;
    }
    .hamburger:hover span { background: var(--text-primary); }

    /* ===== RESPONSIVE ===== */
    @media (max-width: 768px) {
      .hamburger { display: flex; }
      .sidebar-toggle-tab { display: none; }
      .sidebar-resize-handle { display: none; }
      .voice-speed-bar {
        width: 100%;
        border-radius: 0;
        padding: 3px 6px;
        gap: 5px;
        height: 36px;
        min-height: 36px;
      }
      .voice-speed-center {
        min-width: 0;
        gap: 4px;
        padding: 0;
      }
      .voice-speed-label {
        font-size: 8px;
        letter-spacing: 0.05em;
      }
      .voice-speed-action {
        width: 25px;
        height: 25px;
        border-radius: 5px;
      }
      .voice-speed-btn {
        min-width: 31px;
        padding: 1px 6px;
        font-size: 9px;
      }
      #ptt-floating-btn { width: 72px; height: 72px; }
      .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100%;
        width: 260px;
        min-width: 260px;
        z-index: 50;
        box-shadow: 4px 0 24px rgba(0,0,0,0.4);
        padding-top: 56px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
      }
      .sidebar.open {
        transform: translateX(0);
      }
      .sidebar.collapsed {
        width: 260px;
        min-width: 260px;
        padding-top: 56px;
        transform: translateX(-100%);
      }
      .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 49;
      }
      .sidebar-backdrop.open { display: block; }
      .auth-box { padding: 28px 24px; }
      .input-bar { padding: 10px 14px; }
      #messages { padding: 14px; }
      .rooms-body { padding: 16px; }
    }

    /* ============================================================
       SWIPE ITEMS — DM & Room list swipe-to-reveal actions
       ============================================================ */
    .swipe-item {
      position: relative;
      overflow: hidden;
      border-radius: 0px;
      margin-bottom: 6px;
      touch-action: pan-y;
    }
    .swipe-item .sidebar-room-item,
    .swipe-item .sidebar-dm-item {
      margin-bottom: 0;
    }
    .swipe-item-card {
      border-radius: 12px;
      margin-bottom: 6px;
    }
    .swipe-item-card .room-card {
      margin-bottom: 0;
    }
    .swipe-item .sidebar-room-item,
    .swipe-item .sidebar-dm-item,
    .swipe-item-card .room-card {
      min-height: 42px;
    }
    .swipe-item .sidebar-room-item.has-avatar,
    .swipe-item .sidebar-dm-item {
      gap: 10px;
      padding: 5px 13px;
      font-size: 18px;
      border-radius: 0;
    }
    .swipe-item .sidebar-room-item .sidebar-room-name,
    .swipe-item .dm-item-name {
      font-size: 15px;
    }
    .swipe-item .dm-item-preview,
    .swipe-item .dm-item-ts,
    .swipe-item .sidebar-room-item .room-unread,
    .swipe-item .sidebar-dm-item .dm-unread {
      font-size: 12px;
    }
    .swipe-item .sidebar-room-item .room-unread,
    .swipe-item .sidebar-dm-item .dm-unread {
      border-radius: 13px;
      padding: 2px 8px;
    }
    .swipe-item .dm-avatar,
    .swipe-item .sidebar-room-item.has-avatar .dm-avatar {
      width: 40px !important;
      height: 40px !important;
      font-size: 18px !important;
    }
    .swipe-item .dm-online-dot {
      width: 13px;
      height: 13px;
    }
    .swipe-item .sidebar-room-item .room-badge {
      width: 26px;
      font-size: 11px;
      line-height: 14px;
      padding: 3px 6px;
    }
    .swipe-action-left,
    .swipe-action-right {
      width: 96px;
    }
    .swipe-btn {
      width: 54px;
      height: 54px;
      font-size: 20px;
    }
    .swipe-item-card .swipe-action-left { border-radius: 12px 0 0 12px; }
    .swipe-item-card .swipe-action-right { border-radius: 0 12px 12px 0; }
    .swipe-inner {
      position: relative;
      z-index: 2;
      background: var(--bg-secondary);
      will-change: transform;
      user-select: none;
      -webkit-user-select: none;
      border-radius: 0px;
    }
    .swipe-action-left,
    .swipe-action-right {
      position: absolute;
      top: 0;
      bottom: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 80px;
      z-index: 1;
      opacity: 0;
      transition: opacity 0.15s;
      pointer-events: none;
    }
    .swipe-item.swiped-left .swipe-action-right,
    .swipe-item.swiped-right .swipe-action-left {
      pointer-events: auto;
    }
    .swipe-action-left {
      left: 0;
      background: var(--accent);
      border-radius: 0px;
    }
    .swipe-action-right {
      right: 0;
      background: #f59e0b;
      border-radius: 0px;
    }
    .swipe-item.swiping-right .swipe-action-left,
    .swipe-item.swiped-right .swipe-action-left,
    .swipe-item.swiping-left .swipe-action-right,
    .swipe-item.swiped-left .swipe-action-right {
      opacity: 1;
    }
    .swipe-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 42px;
      height: 42px;
      border: none;
      border-radius: 50%;
      background: rgba(255,255,255,0.2);
      color: #fff;
      font-size: 16px;
      cursor: pointer;
      transition: transform 0.15s, background 0.15s;
    }
    .swipe-btn:active {
      transform: scale(0.9);
      background: rgba(255,255,255,0.35);
    }
    .swipe-btn-archive { color: #fff; }
    .swipe-btn-profile { color: #fff; }
    .swipe-btn-settings { color: #fff; }

    /* ============================================================
       ARCHIVE FOLDER TOGGLE
       ============================================================ */
    .archive-folder-toggle {
      gap: 9px;
      width: 100%;
      padding: 9px 10px;
      margin-bottom: 8px;
      border: none;
      background: linear-gradient(135deg, rgba(79, 142, 247, 0.12), rgba(124, 91, 255, 0.12));
      font-size: 14px;
      font-weight: 500;
      white-space: nowrap;
      transition: background 0.15s, border-color 0.15s, color 0.15s;
      box-sizing: border-box;
      display: flex;
      align-items: center;
      margin-top: 6px;
      color: var(--text-muted);
      cursor: pointer;
    }
    .archive-folder-toggle .archive-title {
      flex: 1;
      padding-top: 4px;
      font-size: 14px;
    }

    .archive-folder-toggle:hover {
      background: var(--bg-tertiary);
      color: var(--text-primary);
    }
    .archive-folder-toggle > i:first-child {
      font-size: 14px;
      width: 18px;
      text-align: center;
      color: var(--accent);
    }
    .archive-folder-toggle .archive-count {
      background: var(--accent);
      color: #fff;
      border-radius: 10px;
      font-size: 10px;
      font-weight: 700;
      padding: 1px 7px;
    }
    .archive-folder-toggle .archive-chevron {
      font-size: 11px;
      color: var(--text-muted);
      width: auto;
      transition: transform 0.2s;
      transform: rotate(-90deg);
    }
    .archive-folder-toggle.archive-open .archive-chevron {
      transform: rotate(0deg);
    }
    .archive-section {
      max-height: 0;
      overflow: hidden;
      opacity: 0;
    }
    .archive-folder-toggle.archive-open + .archive-section {
      max-height: none;
      opacity: 1;
      padding: 2px 0 4px;
      border-bottom: 1px solid var(--border);
    }

    /* ============================================================
       ARCHIVED ITEM VISUAL DISTINCTION
       ============================================================ */
    .archive-section .sidebar-dm-item {
      opacity: 0.68;
      border-left: 3px solid var(--text-muted);
      border-radius: 0 9px 9px 0;
      padding-left: 7px;
      background: color-mix(in srgb, var(--bg-secondary) 50%, transparent);
      width: 90%;
    }
    .archive-section .sidebar-dm-item:hover {
      opacity: 1;
    }
    .archive-section .sidebar-dm-item.active {
      opacity: 1;
      background: var(--accent);
      border-left-color: rgba(255,255,255,0.5);
    }
    .archive-section .sidebar-dm-item.secure-chat {
      background: linear-gradient(90deg, rgba(185, 28, 28, 0.1), rgba(239, 68, 68, 0.03));
      border-left-color: rgba(185, 28, 28, 0.45);
    }
    .archive-section .sidebar-dm-item.secure-chat.active {
      background: linear-gradient(90deg, #991b1b, #b91c1c);
      border-left-color: rgba(255,255,255,0.5);
    }
    .archive-section .dm-item-name {
      color: var(--text-muted);
    }
    .archive-section .sidebar-dm-item.active .dm-item-name {
      color: #fff;
    }
    .archive-section .sidebar-dm-item:hover .dm-item-name {
      color: var(--text-primary);
    }
    