    html.theme-dark .login-card,
    html.theme-dark .onboarding-card,
    html.theme-dark .chat-panel,
    html.theme-dark .profile-panel,
    html.theme-dark .profile-card,
    html.theme-dark .settings-profile,
    html.theme-dark .settings-edit-card,
    html.theme-dark .settings-link-card,
    html.theme-dark .settings-detail-card,
    html.theme-dark .forward-preview-card,
    html.theme-dark .chat-contact-banner,
    html.theme-dark .chat-pinned-banner,
    html.theme-dark .chat-search-panel,
    html.theme-dark .composer,
    html.theme-dark .sidebar-item,
    html.theme-dark .shared-file-item,
    html.theme-dark .shared-link-item,
    html.theme-dark .shared-voice-item,
    html.theme-dark .shared-media-item,
    html.theme-dark .composer-sticker-picker,
    html.theme-dark .composer-mention-picker,
    html.theme-dark .chat-compose-actions-card,
    html.theme-dark .message-actions-toolbar,
    html.theme-dark .chat-info-public-card,
    html.theme-dark .chat-info-meta-card,
    html.theme-dark .chat-info-onboarding-card,
    html.theme-dark .chat-info-permissions-card,
    html.theme-dark .chat-info-invite-card {
      background: var(--panel-soft);
      border-color: var(--panel-border);
      box-shadow: var(--shadow);
      color: var(--text);
    }

    html.theme-dark .chat-header,
    html.theme-dark .sidebar-panel-header,
    html.theme-dark .profile-panel-header,
    html.theme-dark .bottom-tabs {
      background: rgba(9, 17, 29, 0.74);
      border-color: rgba(30, 45, 67, 0.82);
      color: var(--text);
      backdrop-filter: blur(20px) saturate(1.35);
      -webkit-backdrop-filter: blur(20px) saturate(1.35);
    }

    html.theme-dark .input,
    html.theme-dark .chat-search-input,
    html.theme-dark textarea,
    html.theme-dark select,
    html.theme-dark .phone-input,
    html.theme-dark .chat-list-search-input,
    html.theme-dark .composer-input {
      background: rgba(7, 14, 25, 0.78);
      border-color: rgba(33, 49, 73, 0.96);
      color: var(--text);
    }

    html.theme-dark input::placeholder,
    html.theme-dark textarea::placeholder {
      color: rgba(154, 169, 188, 0.82);
    }

    html.theme-dark .message-row.other .message-bubble {
      background: var(--bubble-other);
      border-color: rgba(39, 50, 65, 0.92);
    }

    html.theme-dark .message-row.self .message-bubble {
      background: var(--bubble-self);
      border-color: rgba(94, 168, 255, 0.2);
    }

    html.theme-dark .button-secondary,
    html.theme-dark .chat-search-close,
    html.theme-dark .shared-file-sort-button,
    html.theme-dark .shared-file-filter-chip {
      background: rgba(12, 22, 37, 0.92);
      border-color: rgba(30, 45, 67, 0.96);
      color: var(--text);
    }

    html.theme-dark .settings-link-card:active,
    html.theme-dark .shared-file-item:active,
    html.theme-dark .shared-link-item:active,
    html.theme-dark .shared-voice-item:active {
      background: rgba(255, 255, 255, 0.07);
      border-color: rgba(94, 168, 255, 0.22);
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
    }

    html.theme-dark .settings-toggle-switch {
      background: rgba(255, 255, 255, 0.12);
      border-color: rgba(39, 50, 65, 0.96);
    }

    html.theme-dark .settings-toggle-input:checked + .settings-toggle-switch {
      background: rgba(94, 168, 255, 0.28);
      border-color: rgba(94, 168, 255, 0.5);
    }

    html.theme-dark .settings-toggle-switch::before {
      background: #f7fbff;
    }

    html.theme-dark .settings-link-copy strong,
    html.theme-dark .settings-toggle-copy strong,
    html.theme-dark .sidebar-item-title,
    html.theme-dark .profile-name,
    html.theme-dark .chat-title,
    html.theme-dark .profile-panel-title {
      color: var(--text);
    }

    html.theme-dark .settings-link-copy span,
    html.theme-dark .settings-link-value,
    html.theme-dark .settings-toggle-copy span,
    html.theme-dark .sidebar-item-subtitle,
    html.theme-dark .chat-subtitle,
    html.theme-dark .contacts-meta,
    html.theme-dark .status-line,
    html.theme-dark .shared-file-meta,
    html.theme-dark .shared-link-domain,
    html.theme-dark .shared-voice-meta {
      color: var(--muted);
    }

    html.theme-dark .app-shell,
    html.theme-dark .sidebar,
    html.theme-dark .sidebar-panel,
    html.theme-dark .chat-panel,
    html.theme-dark .profile-panel {
      background-color: transparent;
    }

    html.theme-dark .sidebar-item,
    html.theme-dark .chat-search-history-row,
    html.theme-dark .chat-search-result,
    html.theme-dark .chat-folder-manage-item,
    html.theme-dark .chat-folder-chat-option {
      background: rgba(8, 15, 26, 0.16);
      border-color: rgba(30, 45, 67, 0.78);
    }

    html.theme-dark .sidebar-item.active {
      background: rgba(24, 51, 88, 0.66);
      border-color: rgba(31, 122, 236, 0.34);
    }

    html.theme-dark .chat-list-swipe-shell > .sidebar-item {
      background: rgba(12, 21, 34, 0.98);
      border-color: rgba(30, 45, 67, 0.78);
    }

    html.theme-dark .chat-list-swipe-shell > .sidebar-item.active,
    html.theme-dark .chat-list-swipe-shell > .sidebar-item:hover {
      background: rgba(12, 21, 34, 0.98);
    }

    html.theme-dark .sidebar-item:active,
    html.theme-dark .chat-search-result:active,
    html.theme-dark .chat-folder-chat-option:active {
      background: rgba(18, 36, 61, 0.82);
    }

    html.theme-dark .chat-folder-chip {
      background: rgba(11, 20, 34, 0.86);
      border-color: rgba(30, 45, 67, 0.88);
      color: var(--muted);
    }

    html.theme-dark .chat-folder-chip.active {
      background: rgba(18, 50, 93, 0.84);
      border-color: rgba(31, 122, 236, 0.42);
      color: #dbeaff;
      box-shadow: 0 10px 24px rgba(8, 20, 38, 0.32);
    }

    html.theme-dark .chat-list-actions-card {
      background: rgba(12, 21, 34, 0.96);
      border-color: rgba(30, 45, 67, 0.92);
      box-shadow: 0 24px 56px rgba(2, 7, 14, 0.48);
    }

    html.theme-dark .chat-list-actions-card.is-below-anchor::before {
      border-left-color: rgba(30, 45, 67, 0.92);
      border-top-color: rgba(30, 45, 67, 0.92);
    }

    html.theme-dark .chat-list-actions-card.is-above-anchor::before {
      border-right-color: rgba(30, 45, 67, 0.92);
      border-bottom-color: rgba(30, 45, 67, 0.92);
    }

    html.theme-dark .chat-list-quick-action,
    html.theme-dark .chat-list-folder-picker-option {
      background: rgba(16, 29, 46, 0.96);
      color: var(--text);
      box-shadow: inset 0 0 0 1px rgba(38, 56, 80, 0.92);
    }

    html.theme-dark .chat-list-quick-action.is-danger {
      background: rgba(78, 24, 37, 0.96);
      color: #ffd9e0;
      box-shadow: inset 0 0 0 1px rgba(126, 52, 67, 0.9);
    }

    html.theme-dark .chat-list-swipe-shell > .sidebar-item.is-action-target {
      background: rgba(18, 50, 93, 0.84);
      box-shadow: 0 18px 38px rgba(2, 7, 14, 0.34);
    }


    html.theme-dark #contactsSortButton::after {
      box-shadow: 0 0 0 2px rgba(12, 21, 34, 0.96);
    }

    html.theme-dark #contactsSortButton.is-open {
      background: rgba(18, 50, 93, 0.84);
      box-shadow: inset 0 0 0 1px rgba(31, 122, 236, 0.42);
    }

    html.theme-dark .chat-list-folder-picker {
      border-top-color: rgba(30, 45, 67, 0.92);
    }

    html.theme-dark .chat-search-button,
    html.theme-dark .chat-search-nav-button,
    html.theme-dark .chat-back-button,
    html.theme-dark .chat-search-clear,
    html.theme-dark .composer-sticker-button,
    html.theme-dark .sidebar-header-action,
    html.theme-dark .chat-folder-manage-order {
      background: rgba(12, 22, 37, 0.9);
      border-color: rgba(30, 45, 67, 0.92);
      color: var(--accent-dark);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
    }

    html.theme-dark .chat-search-clear {
      color: var(--muted);
    }

    html.theme-dark .composer-input-shell {
      background: rgba(10, 18, 31, 0.94);
      border-color: rgba(30, 45, 67, 0.94);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
    }

    html.theme-dark .composer-reply-banner,
    html.theme-dark .composer-edit-banner {
      background: rgba(12, 24, 40, 0.96);
      border-color: rgba(31, 122, 236, 0.2);
    }

    html.theme-dark .message-link-preview {
      background: rgba(10, 18, 31, 0.94);
      border-color: rgba(30, 45, 67, 0.94);
      box-shadow: 0 10px 28px rgba(2, 8, 18, 0.28);
    }

    html.theme-dark .message-footer-badge {
      background: rgba(7, 15, 26, 0.72);
      border-color: rgba(53, 73, 102, 0.52);
      color: #d8e7ff;
    }

    html.theme-dark .message-row.self .message-footer-badge {
      background: rgba(7, 19, 34, 0.56);
      border-color: rgba(112, 172, 255, 0.26);
    }

    html.theme-dark .message-reactions,
    html.theme-dark .message-reactions-picker,
    html.theme-dark .message-reactions-picker-floating,
    html.theme-dark .message-actions-toolbar {
      background: rgba(10, 18, 31, 0.96);
      border-color: rgba(30, 45, 67, 0.92);
      box-shadow: 0 16px 36px rgba(2, 8, 18, 0.34);
    }

    html.theme-dark .status-badge,
    html.theme-dark .sidebar-header-action-count {
      background: rgba(31, 122, 236, 0.18);
      color: #dbeaff;
    }

    html.theme-dark .chat-contact-banner,
    html.theme-dark .chat-pinned-banner {
      background: rgba(11, 21, 36, 0.88);
      border-color: rgba(30, 45, 67, 0.88);
      box-shadow: 0 12px 30px rgba(2, 8, 18, 0.24);
    }

    html.theme-dark .chat-pinned-banner-nav {
      background: rgba(94, 168, 255, 0.12);
      color: #dbe7f6;
    }

    html.theme-dark .shared-media-search-icon {
      color: rgba(201, 214, 230, 0.72);
    }

    html.theme-dark .media-viewer-nav {
      background: rgba(13, 22, 35, 0.58);
      color: #e9f2ff;
    }

    html.theme-dark .bottom-tab-button {
      color: var(--muted);
    }

    html.theme-dark .bottom-tab-button.active {
      color: #dcebff;
    }

    html.theme-dark .composer-sticker-tabs {
      background: rgba(9, 17, 29, 0.94);
      border-color: rgba(30, 45, 67, 0.9);
    }

    html.theme-dark .composer-sticker-tab.active {
      background: rgba(31, 122, 236, 0.18);
      color: var(--accent-dark);
    }

    html.theme-dark .composer-sticker-option {
      background: linear-gradient(180deg, rgba(18, 34, 56, 0.98) 0%, rgba(12, 24, 40, 0.98) 100%);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    }
