/* DChat dark mode + online status polish */
html.dchat-dark {
    color-scheme: dark;
    --color-neutrals-n-00: #0f172a;
    --color-neutrals-n-00-rgb: 15, 23, 42;
    --color-neutrals-n-10: #111827;
    --color-neutrals-n-10-rgb: 17, 24, 39;
    --color-neutrals-n-20: #172033;
    --color-neutrals-n-20-rgb: 23, 32, 51;
    --color-neutrals-n-30: #243047;
    --color-neutrals-n-30-rgb: 36, 48, 71;
    --color-neutrals-n-40: #334155;
    --color-neutrals-n-40-rgb: 51, 65, 85;
    --color-neutrals-n-50: #475569;
    --color-neutrals-n-50-rgb: 71, 85, 105;
    --color-neutrals-n-100: #64748b;
    --color-neutrals-n-100-rgb: 100, 116, 139;
    --color-neutrals-n-200: #94a3b8;
    --color-neutrals-n-200-rgb: 148, 163, 184;
    --color-neutrals-n-300: #cbd5e1;
    --color-neutrals-n-300-rgb: 203, 213, 225;
    --color-neutrals-n-400: #dbeafe;
    --color-neutrals-n-400-rgb: 219, 234, 254;
    --color-neutrals-n-500: #eef6ff;
    --color-neutrals-n-500-rgb: 238, 246, 255;
    --color-neutrals-n-600: #f8fafc;
    --color-neutrals-n-600-rgb: 248, 250, 252;
    --color-neutrals-surface: #111827;
    --color-neutrals-on-app-bar: #eef6ff;
    --color-alternative-a-02: #3c90d6;
    --color-alternative-opacity-a-02: rgba(60, 144, 214, .18);
}

html.dchat-dark body,
html.dchat-dark #root,
html.dchat-dark .CCpbui,
html.dchat-dark .taDlgO,
html.dchat-dark .main-section-container,
html.dchat-dark .sX5uwF,
html.dchat-dark .jNceb7,
html.dchat-dark .css-cssveg,
html.dchat-dark ._TKhhJ,
html.dchat-dark .Cj8WoU {
    background-color: var(--color-neutrals-n-00) !important;
    color: var(--color-neutrals-n-500) !important;
}

html.dchat-dark .qHFpb6,
html.dchat-dark .YtfZZh,
html.dchat-dark .gRchi5,
html.dchat-dark .dchat-reply-bar,
html.dchat-dark .dchat-reply-quote,
html.dchat-dark .dchat-emoji-panel,
html.dchat-dark .dchat-gif-panel,
html.dchat-dark .dchat-topbar-search-bar,
html.dchat-dark .HuknNt,
html.dchat-dark .GM6Plj,
html.dchat-dark .xDi8im,
html.dchat-dark .field-wrapper,
html.dchat-dark .RyZMwx,
html.dchat-dark .u0fjao,
html.dchat-dark .swal2-popup {
    background-color: var(--color-neutrals-n-10) !important;
    border-color: rgba(148, 163, 184, .22) !important;
    color: var(--color-neutrals-n-500) !important;
}

html.dchat-dark .qHFpb6:hover,
html.dchat-dark .IRzoCT,
html.dchat-dark .kXxU2w:hover,
html.dchat-dark .YtfZZh:hover,
html.dchat-dark .dchat-emoji-cat:hover {
    background-color: rgba(60, 144, 214, .14) !important;
}

html.dchat-dark .oUKPfP,
html.dchat-dark .DpBzG1,
html.dchat-dark .nhYi60,
html.dchat-dark .GAx5un,
html.dchat-dark .Y0tLmm,
html.dchat-dark .yE62DB,
html.dchat-dark .u__pfW,
html.dchat-dark .dchat-reply-title,
html.dchat-dark .dchat-reply-quote-title,
html.dchat-dark .swal2-title {
    color: var(--color-neutrals-n-500) !important;
}

html.dchat-dark .bTAleN,
html.dchat-dark .dchat-preview,
html.dchat-dark .dchat-time,
html.dchat-dark .dchat-presence-row,
html.dchat-dark .dchat-presence-text,
html.dchat-dark .dchat-reply-text,
html.dchat-dark .dchat-reply-quote-text,
html.dchat-dark .BiH935,
html.dchat-dark .swal2-html-container,
html.dchat-dark [style*="rgba(9,30,66,.55)"],
html.dchat-dark [style*="rgba(9, 30, 66, .55)"],
html.dchat-dark [style*="rgba(9,30,66,.45)"],
html.dchat-dark [style*="rgba(9, 30, 66, .45)"] {
    color: rgba(226, 232, 240, .72) !important;
}

html.dchat-dark input,
html.dchat-dark textarea,
html.dchat-dark select,
html.dchat-dark .Li3xai,
html.dchat-dark .dchat-topbar-search-input,
html.dchat-dark .dchat-emoji-search {
    background-color: #0b1220 !important;
    border-color: rgba(148, 163, 184, .28) !important;
    color: #eef6ff !important;
}

html.dchat-dark input::placeholder,
html.dchat-dark textarea::placeholder {
    color: rgba(226, 232, 240, .48) !important;
}

html.dchat-dark svg path[fill="#091E42"],
html.dchat-dark svg path[fill="#5E6C84"],
html.dchat-dark svg g[fill="#5E6C84"] {
    fill: #dbeafe !important;
}

html.dchat-dark svg path[stroke="#5E6C84"],
html.dchat-dark svg path[stroke="rgba(9,30,66,.54)"] {
    stroke: #dbeafe !important;
}

html.dchat-dark .Dp2f1p {
    background-color: #0f172a !important;
}

.Dp2f1p.I9bN5C.is-online:after,
.Dp2f1p.I9bN5C.online:after,
.Dp2f1p.I9bN5C.dchat-online:after {
    background-color: #00B894 !important;
    box-shadow: 0 0 0 2px rgba(0, 184, 148, .18), 0 0 10px rgba(0, 184, 148, .5);
}

.Dp2f1p.I9bN5C.is-offline:after,
.Dp2f1p.I9bN5C.offline:after {
    background-color: var(--color-neutrals-n-100) !important;
    box-shadow: none;
}

.dchat-theme-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dchat-theme-toggle {
    width: 50px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    padding: 3px;
    cursor: pointer;
    background: linear-gradient(135deg, #f9d976 0%, #f39f86 100%);
    box-shadow: inset 0 0 0 1px rgba(9, 30, 66, .08), 0 8px 18px rgba(9, 30, 66, .14);
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    transition: background .22s ease, box-shadow .22s ease;
    position: relative;
    overflow: hidden;
}

.dchat-theme-toggle .dchat-theme-knob {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .96);
    color: #f59e0b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .22s ease, color .22s ease, background .22s ease;
    box-shadow: 0 3px 10px rgba(9, 30, 66, .22);
}

.dchat-theme-toggle .dchat-theme-sun,
.dchat-theme-toggle .dchat-theme-moon {
    position: absolute;
    width: 15px;
    height: 15px;
    transition: opacity .18s ease, transform .18s ease;
}

.dchat-theme-toggle .dchat-theme-moon {
    opacity: 0;
    transform: scale(.75) rotate(-20deg);
}

html.dchat-dark .dchat-theme-toggle {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .24), 0 8px 18px rgba(0, 0, 0, .28);
}

html.dchat-dark .dchat-theme-toggle .dchat-theme-knob {
    transform: translateX(-20px);
    background: #dbeafe;
    color: #334155;
}

html.dchat-dark .dchat-theme-toggle .dchat-theme-sun {
    opacity: 0;
    transform: scale(.75) rotate(30deg);
}

html.dchat-dark .dchat-theme-toggle .dchat-theme-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.dchat-theme-feature-card { user-select: none; }

.dchat-theme-feature-card .dchat-theme-card-icon {
    width: 29px;
    height: 29px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(249, 217, 118, .28), rgba(243, 159, 134, .28));
}

html.dchat-dark .dchat-theme-feature-card .dchat-theme-card-icon {
    background: linear-gradient(135deg, rgba(96, 165, 250, .25), rgba(15, 23, 42, .8));
}

.dchat-theme-feature-card .dchat-theme-state {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: rgba(9, 30, 66, .55);
}

html.dchat-dark .dchat-theme-feature-card .dchat-theme-state {
    color: rgba(226, 232, 240, .72) !important;
}

/* DChat dark mode fixes v2: consistent icons, logo, message/search text */
html.dchat-dark {
    --color-bubble-out-primary: #123b4a;
    --color-bubble-out-primary-rgb: 18, 59, 74;
    --color-bubble-in-primary: #182235;
    --color-bubble-in-primary-rgb: 24, 34, 53;
    --color-bubble-low-text: #aab7ca;
    --color-bubble-low-text-rgb: 170, 183, 202;
    --background-chat: #0f172a;
    --color-link: #7cc7ff;
    --color-fixed-link: #7cc7ff;
}

html.dchat-dark .dchat-text-logo,
html.dchat-dark .AYy0G8 img[src*="text_logo"],
html.dchat-dark img[src*="text_logo.png"] {
    filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(255,255,255,.16)) !important;
    opacity: .96;
}

html.dchat-dark .kXxU2w,
html.dchat-dark .tf8V56,
html.dchat-dark .dchat-chat-search-btn,
html.dchat-dark .dchat-chat-search-nav,
html.dchat-dark .dchat-chat-search-close,
html.dchat-dark .dchat-topbar-search-back,
html.dchat-dark .dchat-topbar-search-icon,
html.dchat-dark .dchat-media-more-btn,
html.dchat-dark .dchat-progress-btn,
html.dchat-dark button[aria-label],
html.dchat-dark [role="button"] {
    color: #dbeafe !important;
}

html.dchat-dark .kXxU2w svg,
html.dchat-dark .tf8V56 svg,
html.dchat-dark .dchat-chat-search-btn svg,
html.dchat-dark .dchat-chat-search-panel svg,
html.dchat-dark .dchat-topbar-search-bar svg,
html.dchat-dark .dchat-media-more-btn svg,
html.dchat-dark .dchat-progress-btn svg,
html.dchat-dark button[aria-label] svg,
html.dchat-dark [role="button"] svg {
    color: #dbeafe !important;
}

html.dchat-dark .kXxU2w svg [fill]:not([fill="none"]),
html.dchat-dark .tf8V56 svg [fill]:not([fill="none"]),
html.dchat-dark .dchat-chat-search-btn svg [fill]:not([fill="none"]),
html.dchat-dark .dchat-chat-search-panel svg [fill]:not([fill="none"]),
html.dchat-dark .dchat-topbar-search-bar svg [fill]:not([fill="none"]),
html.dchat-dark button[aria-label] svg [fill]:not([fill="none"]),
html.dchat-dark [role="button"] svg [fill]:not([fill="none"]) {
    fill: currentColor !important;
}

html.dchat-dark .kXxU2w svg [stroke]:not([stroke="none"]),
html.dchat-dark .tf8V56 svg [stroke]:not([stroke="none"]),
html.dchat-dark .dchat-chat-search-btn svg [stroke]:not([stroke="none"]),
html.dchat-dark .dchat-chat-search-panel svg [stroke]:not([stroke="none"]),
html.dchat-dark .dchat-topbar-search-bar svg [stroke]:not([stroke="none"]),
html.dchat-dark button[aria-label] svg [stroke]:not([stroke="none"]),
html.dchat-dark [role="button"] svg [stroke]:not([stroke="none"]) {
    stroke: currentColor !important;
}

html.dchat-dark .Oh0n5T,
html.dchat-dark .Wdw5cr,
html.dchat-dark .dchat-file-card,
html.dchat-dark .dchat-media-card:not(.dchat-sticker-card) {
    background-color: #182235 !important;
    color: #eef6ff !important;
    box-shadow: 0 8px 22px rgba(0,0,0,.20) !important;
}

html.dchat-dark .Oh0n5T.UfD_bO,
html.dchat-dark .Wdw5cr.UfD_bO,
html.dchat-dark .message-item.LtdUd1 .Oh0n5T,
html.dchat-dark .message-item.LtdUd1 .Wdw5cr {
    background: linear-gradient(135deg, #123b4a 0%, #164e63 100%) !important;
    color: #eef6ff !important;
}

html.dchat-dark .KTwPFW,
html.dchat-dark .KTwPFW .p,
html.dchat-dark .KTwPFW .dchat-message-content,
html.dchat-dark .dchat-message-content,
html.dchat-dark .dchat-message-content span,
html.dchat-dark .dchat-message-content p,
html.dchat-dark .p[dir="rtl"],
html.dchat-dark .HMaaOP,
html.dchat-dark .nMlHDG,
html.dchat-dark #dchat-room-title {
    color: #eef6ff !important;
}

html.dchat-dark .S6fyPQ,
html.dchat-dark .NZyGek,
html.dchat-dark .IheVs2,
html.dchat-dark #dchat-online-count,
html.dchat-dark .dchat-file-size,
html.dchat-dark .dchat-media-caption,
html.dchat-dark .dchat-upload-pending-text {
    color: rgba(226, 232, 240, .72) !important;
}

html.dchat-dark .dchat-reply-quote {
    background: rgba(96,165,250,.16) !important;
    box-shadow: inset 0 0 0 1px rgba(96,165,250,.22) !important;
}

html.dchat-dark .message-item.LtdUd1 .KTwPFW .dchat-reply-quote {
    background: rgba(255,255,255,.12) !important;
    box-shadow: inset 0 0 0 1px rgba(219,234,254,.18) !important;
}

html.dchat-dark .KTwPFW .dchat-reply-quote-title,
html.dchat-dark .dchat-reply-title {
    color: #93c5fd !important;
}

html.dchat-dark .KTwPFW .dchat-reply-quote-text,
html.dchat-dark .dchat-reply-text {
    color: rgba(226,232,240,.76) !important;
}

html.dchat-dark .dchat-topbar-search-shell {
    filter: drop-shadow(0 10px 28px rgba(0,0,0,.32));
}

html.dchat-dark .dchat-topbar-search-bar,
html.dchat-dark .dchat-chat-search-panel {
    background: rgba(15,23,42,.96) !important;
    border-color: rgba(148,163,184,.18) !important;
    box-shadow: 0 10px 28px rgba(0,0,0,.28) !important;
}

html.dchat-dark .dchat-topbar-search-icon,
html.dchat-dark .dchat-chat-search-box {
    background: linear-gradient(135deg, rgba(96,165,250,.18), rgba(57,204,200,.12)) !important;
    border-color: rgba(96,165,250,.24) !important;
    color: #bfdbfe !important;
    box-shadow: inset 0 0 0 1px rgba(148,163,184,.08) !important;
}

html.dchat-dark .dchat-chat-search-input,
html.dchat-dark .dchat-topbar-search-input {
    background: transparent !important;
    color: #eef6ff !important;
}

html.dchat-dark .dchat-chat-search-input::placeholder,
html.dchat-dark .dchat-topbar-search-input::placeholder {
    color: rgba(226,232,240,.52) !important;
}

html.dchat-dark .dchat-chat-search-meta {
    color: rgba(226,232,240,.68) !important;
}

html.dchat-dark .dchat-chat-search-nav,
html.dchat-dark .dchat-chat-search-close,
html.dchat-dark .dchat-topbar-search-back {
    background: rgba(148,163,184,.12) !important;
    border-color: rgba(148,163,184,.16) !important;
}

html.dchat-dark .dchat-chat-search-close {
    color: #fca5a5 !important;
}

html.dchat-dark .dchat-chat-search-nav:hover,
html.dchat-dark .dchat-chat-search-close:hover,
html.dchat-dark .dchat-topbar-search-back:hover {
    background: rgba(96,165,250,.18) !important;
    border-color: rgba(96,165,250,.25) !important;
}

html.dchat-dark .dchat-chat-search-btn:hover,
html.dchat-dark .dchat-chat-search-btn.is-active,
html.dchat-dark .kXxU2w:hover {
    background-color: rgba(96,165,250,.14) !important;
}

html.dchat-dark .dchat-dot.offline {
    background: rgba(148,163,184,.35) !important;
}

html.dchat-dark .YtfZZh svg,
html.dchat-dark .qHFpb6 svg,
html.dchat-dark .IRzoCT svg,
html.dchat-dark .dchat-theme-feature-card svg,
html.dchat-dark .oc02UB svg,
html.dchat-dark .C9E7RO {
    color: #dbeafe !important;
}

html.dchat-dark .YtfZZh svg [fill]:not([fill="none"]),
html.dchat-dark .qHFpb6 svg [fill]:not([fill="none"]),
html.dchat-dark .IRzoCT svg [fill]:not([fill="none"]),
html.dchat-dark .dchat-theme-feature-card svg [fill]:not([fill="none"]),
html.dchat-dark .oc02UB svg [fill]:not([fill="none"]),
html.dchat-dark .C9E7RO [fill]:not([fill="none"]) {
    fill: currentColor !important;
}

html.dchat-dark .YtfZZh svg [stroke]:not([stroke="none"]),
html.dchat-dark .qHFpb6 svg [stroke]:not([stroke="none"]),
html.dchat-dark .IRzoCT svg [stroke]:not([stroke="none"]),
html.dchat-dark .dchat-theme-feature-card svg [stroke]:not([stroke="none"]),
html.dchat-dark .oc02UB svg [stroke]:not([stroke="none"]),
html.dchat-dark .C9E7RO [stroke]:not([stroke="none"]) {
    stroke: currentColor !important;
}

html.dchat-dark #dchat-sidebar-loading,
html.dchat-dark #dchat-sidebar-end {
    color: rgba(226,232,240,.64) !important;
}


/* Profile drawer dark mode */
html.dchat-dark .dchat-profile-overlay {
    background: rgba(2, 6, 23, .58) !important;
}

html.dchat-dark .dchat-profile-drawer,
html.dchat-dark .dchat-profile-tabs {
    background: #0f172a !important;
    color: #eef6ff !important;
    border-color: rgba(148, 163, 184, .16) !important;
}

html.dchat-dark .dchat-profile-drawer {
    box-shadow: -22px 0 58px rgba(0, 0, 0, .44) !important;
}

html.dchat-dark .dchat-profile-topbar,
html.dchat-dark .dchat-profile-hero,
html.dchat-dark .dchat-profile-tabs {
    border-color: rgba(148, 163, 184, .16) !important;
}

html.dchat-dark .dchat-profile-title-small,
html.dchat-dark .dchat-profile-name,
html.dchat-dark .dchat-profile-member-name,
html.dchat-dark .dchat-profile-file-name,
html.dchat-dark .dchat-profile-info-card,
html.dchat-dark .dchat-group-input,
html.dchat-dark .dchat-group-textarea {
    color: #eef6ff !important;
}

html.dchat-dark .dchat-profile-subtitle,
html.dchat-dark .dchat-profile-bio,
html.dchat-dark .dchat-profile-section-title,
html.dchat-dark .dchat-profile-member-sub,
html.dchat-dark .dchat-profile-file-sub,
html.dchat-dark .dchat-profile-empty,
html.dchat-dark .dchat-group-avatar-meta,
html.dchat-dark .dchat-group-field label,
html.dchat-dark .dchat-group-toggle span {
    color: rgba(226, 232, 240, .72) !important;
}

html.dchat-dark .dchat-profile-icon-btn {
    color: #dbeafe !important;
}

html.dchat-dark .dchat-profile-icon-btn:hover {
    background: rgba(148, 163, 184, .12) !important;
}

html.dchat-dark .dchat-profile-tab,
html.dchat-dark .dchat-profile-info-card,
html.dchat-dark .dchat-profile-member-row,
html.dchat-dark .dchat-profile-file-row,
html.dchat-dark .dchat-group-settings-card {
    background: #111827 !important;
    border-color: rgba(148, 163, 184, .16) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .20) !important;
}

html.dchat-dark .dchat-profile-tab {
    color: rgba(226, 232, 240, .76) !important;
}

html.dchat-dark .dchat-profile-tab.is-active {
    color: #8fd0ff !important;
    background: rgba(60, 144, 214, .16) !important;
    border-color: rgba(143, 208, 255, .28) !important;
}

html.dchat-dark .dchat-profile-media-tile,
html.dchat-dark .dchat-group-input,
html.dchat-dark .dchat-group-textarea {
    background: #0b1220 !important;
    border-color: rgba(148, 163, 184, .22) !important;
}

html.dchat-dark .dchat-profile-file-icon {
    background: rgba(60, 144, 214, .16) !important;
    color: #8fd0ff !important;
}

html.dchat-dark .dchat-group-btn {
    background: rgba(60, 144, 214, .16) !important;
    color: #8fd0ff !important;
}

html.dchat-dark .dchat-group-btn.primary {
    background: #3c90d6 !important;
    color: #fff !important;
}

html.dchat-dark .dchat-group-btn.danger,
html.dchat-dark .dchat-profile-member-remove {
    background: rgba(239, 68, 68, .14) !important;
    color: #fca5a5 !important;
}

/* Better download and message menu in dark mode */
html.dchat-dark .dchat-progress-btn::before {
    background: #111827 !important;
}

html.dchat-dark .dchat-download-btn {
    color: #8fd0ff !important;
}

html.dchat-dark .dchat-message-menu {
    background: rgba(17, 24, 39, .96) !important;
    border-color: rgba(148, 163, 184, .18) !important;
    box-shadow: 0 22px 54px rgba(0, 0, 0, .42) !important;
    color: var(--color-neutrals-n-500) !important;
}

html.dchat-dark .dchat-message-menu button,
html.dchat-dark .dchat-message-menu .dchat-message-menu-btn {
    color: var(--color-neutrals-n-500) !important;
}

html.dchat-dark .dchat-message-menu button:hover,
html.dchat-dark .dchat-message-menu .dchat-message-menu-btn:hover {
    background: rgba(60, 144, 214, .14) !important;
}

html.dchat-dark .dchat-message-menu .dchat-menu-icon {
    background: rgba(148, 163, 184, .10) !important;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .14) !important;
    color: #dbeafe !important;
}

html.dchat-dark .dchat-message-menu button[data-action="delete"] {
    color: #fca5a5 !important;
}

html.dchat-dark .dchat-message-menu button[data-action="delete"] .dchat-menu-icon {
    background: rgba(239, 68, 68, .13) !important;
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .16) !important;
    color: #fca5a5 !important;
}

/* Contacts action menu */
.dchat-contacts-menu-actions {
    margin: 14px 12px 10px !important;
    padding: 7px !important;
    list-style: none !important;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(9,30,66,.08);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(9,30,66,.08);
    direction: rtl;
}

.dchat-contacts-menu-actions .osHIJc {
    border-radius: 14px;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease;
}

.dchat-contacts-menu-actions .osHIJc:hover {
    background: rgba(60,144,214,.10) !important;
    transform: translateY(-1px);
}

.dchat-contacts-menu-actions .osHIJc.is-disabled {
    opacity: .62;
    cursor: default;
}

.dchat-contacts-menu-actions .osHIJc.is-disabled:hover {
    transform: none;
}

html.dchat-dark .dchat-contacts-menu-actions {
    background: rgba(17,24,39,.94) !important;
    border-color: rgba(148,163,184,.16) !important;
    box-shadow: 0 14px 32px rgba(0,0,0,.28) !important;
}

html.dchat-dark .dchat-contacts-menu-actions .osHIJc:hover {
    background: rgba(60,144,214,.14) !important;
}

html.dchat-dark .dchat-contacts-menu-actions .B0w5tA {
    color: #eef6ff !important;
}

html.dchat-dark .dchat-contacts-menu-actions svg path[fill]:not([fill="none"]) {
    fill: #dbeafe !important;
}

/* Theme toggle: keep an actual night/day icon visible on the knob and track */
.dchat-theme-toggle::before,
.dchat-theme-toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    transform: translateY(-50%);
    opacity: .78;
    pointer-events: none;
    background: rgba(255,255,255,.92);
}

.dchat-theme-toggle::before {
    right: 8px;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='%23000'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-width='2' d='M12 2v2m0 16v2M2 12h2m16 0h2M4.93 4.93l1.42 1.42m11.3 11.3 1.42 1.42m0-14.14-1.42 1.42M6.35 17.65l-1.42 1.42'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='%23000'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-width='2' d='M12 2v2m0 16v2M2 12h2m16 0h2M4.93 4.93l1.42 1.42m11.3 11.3 1.42 1.42m0-14.14-1.42 1.42M6.35 17.65l-1.42 1.42'/%3E%3C/svg%3E") center / contain no-repeat;
}

.dchat-theme-toggle::after {
    left: 8px;
    opacity: .38;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20.3 14.3A8 8 0 0 1 9.7 3.7 8.5 8.5 0 1 0 20.3 14.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20.3 14.3A8 8 0 0 1 9.7 3.7 8.5 8.5 0 1 0 20.3 14.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

html.dchat-dark .dchat-theme-toggle::before { opacity: .35; }
html.dchat-dark .dchat-theme-toggle::after { opacity: .92; background: #dbeafe; }


/* SweetAlert2 dark-mode polish: readable text + coordinated fields */
html.dchat-dark .swal2-container,
html.dchat-dark .swal2-backdrop-show {
    background: rgba(2, 6, 23, .62) !important;
}

html.dchat-dark .swal2-popup {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
    color: #eef6ff !important;
    border: 1px solid rgba(148, 163, 184, .20) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .48) !important;
}

html.dchat-dark .swal2-title,
html.dchat-dark .swal2-html-container,
html.dchat-dark .swal2-content,
html.dchat-dark .swal2-footer,
html.dchat-dark .swal2-validation-message,
html.dchat-dark .swal2-popup label,
html.dchat-dark .swal2-popup p,
html.dchat-dark .swal2-popup span,
html.dchat-dark .swal2-popup div {
    color: #eef6ff !important;
}

html.dchat-dark .swal2-html-container .dchat-swal-sub,
html.dchat-dark .swal2-html-container .dchat-room-target-kind,
html.dchat-dark .swal2-html-container small,
html.dchat-dark .swal2-html-container .muted,
html.dchat-dark .swal2-popup .text-muted {
    color: rgba(226, 232, 240, .68) !important;
}

html.dchat-dark .swal2-input,
html.dchat-dark .swal2-textarea,
html.dchat-dark .swal2-select,
html.dchat-dark .swal2-file,
html.dchat-dark .swal2-popup input,
html.dchat-dark .swal2-popup textarea,
html.dchat-dark .swal2-popup select {
    background: rgba(15, 23, 42, .72) !important;
    background-color: rgba(15, 23, 42, .72) !important;
    background-image: none !important;
    color: #eef6ff !important;
    border: 1px solid rgba(148, 163, 184, .14) !important;
    box-shadow: none !important;
    caret-color: #8fd0ff !important;
    outline: none !important;
}

html.dchat-dark .swal2-input:focus,
html.dchat-dark .swal2-textarea:focus,
html.dchat-dark .swal2-select:focus,
html.dchat-dark .swal2-popup input:focus,
html.dchat-dark .swal2-popup textarea:focus,
html.dchat-dark .swal2-popup select:focus {
    background: rgba(15, 23, 42, .88) !important;
    background-color: rgba(15, 23, 42, .88) !important;
    border-color: rgba(143, 208, 255, .34) !important;
    box-shadow: 0 0 0 2px rgba(60, 144, 214, .12) !important;
    outline: none !important;
}

html.dchat-dark .swal2-input::placeholder,
html.dchat-dark .swal2-textarea::placeholder,
html.dchat-dark .swal2-popup input::placeholder,
html.dchat-dark .swal2-popup textarea::placeholder {
    color: rgba(226, 232, 240, .48) !important;
}

html.dchat-dark .swal2-popup input:-webkit-autofill,
html.dchat-dark .swal2-popup textarea:-webkit-autofill,
html.dchat-dark input:-webkit-autofill,
html.dchat-dark textarea:-webkit-autofill {
    -webkit-text-fill-color: #eef6ff !important;
    box-shadow: 0 0 0 1000px #0f172a inset !important;
    transition: background-color 9999s ease-out 0s !important;
}

html.dchat-dark .swal2-actions .swal2-confirm {
    background: #3c90d6 !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(60, 144, 214, .24) !important;
}

html.dchat-dark .swal2-actions .swal2-cancel,
html.dchat-dark .swal2-actions .swal2-deny {
    background: rgba(148, 163, 184, .14) !important;
    color: #eef6ff !important;
    border: 1px solid rgba(148, 163, 184, .18) !important;
}

html.dchat-dark .swal2-close {
    color: #cbd5e1 !important;
}

html.dchat-dark .swal2-close:hover {
    color: #fff !important;
}

html.dchat-dark .swal2-validation-message {
    background: rgba(239, 68, 68, .12) !important;
    border: 1px solid rgba(248, 113, 113, .20) !important;
}

/* Restore requested upgraded reply-bar look */
html.dchat-dark #dchat-reply-bar.dchat-reply-bar {
    background: linear-gradient(180deg, rgba(17,24,39,.98) 0%, rgba(12,18,30,.98) 100%) !important;
    box-shadow: 0 16px 34px rgba(0,0,0,.28), inset 0 0 0 1px rgba(148,163,184,.12) !important;
}

html.dchat-dark #dchat-reply-bar .dchat-reply-icon {
    background: rgba(60, 144, 214, .16) !important;
    color: #8fd0ff !important;
}

html.dchat-dark #dchat-reply-bar .dchat-reply-close {
    background: rgba(148,163,184,.10) !important;
    color: #dbeafe !important;
}

html.dchat-dark #dchat-reply-bar .dchat-reply-close:hover {
    background: rgba(148,163,184,.18) !important;
    color: #ffffff !important;
}

html.dchat-dark #dchat-reply-bar .dchat-reply-title {
    color: #8fd0ff !important;
}

html.dchat-dark #dchat-reply-bar .dchat-reply-text {
    color: rgba(226, 232, 240, .82) !important;
}

/* Keep sidebar contact actions exactly on their own surface */
#dchat-actions,
#dchat-actions .qb1_1D,
#dchat-actions .osHIJc {
    box-sizing: border-box;
}

/* Exact contacts actions menu markup requested */
#dchat-actions > .qb1_1D {
    list-style: none !important;
    background: rgba(255, 255, 255, .92);
    direction: rtl;
    box-sizing: border-box;
}

#dchat-actions > .qb1_1D > .osHIJc {
    cursor: pointer;
    transition: background .16s ease, transform .16s ease;
    box-sizing: border-box;
}

#dchat-actions > .qb1_1D > .osHIJc:hover {
    background: rgba(60,144,214,.10) !important;
    transform: translateY(-1px);
}

#dchat-actions > .qb1_1D > .osHIJc:focus-visible {
    outline: 2px solid rgba(60,144,214,.42);
    outline-offset: 2px;
}

html.dchat-dark #dchat-actions > .qb1_1D {
    background: rgba(17,24,39,.94) !important;
    border-color: rgba(148,163,184,.16) !important;
    box-shadow: 0 14px 32px rgba(0,0,0,.28) !important;
}

html.dchat-dark #dchat-actions > .qb1_1D > .osHIJc:hover {
    background: rgba(60,144,214,.14) !important;
}

html.dchat-dark #dchat-actions > .qb1_1D .B0w5tA {
    color: #eef6ff !important;
}

html.dchat-dark #dchat-actions > .qb1_1D svg path[fill]:not([fill="none"]) {
    fill: #dbeafe !important;
}


/* ===== Header/shared moved from templates/shared/header_references.html ===== */
@font-face {
        font-family: "DChatVazir";
        src: local("Vazirmatn"), local("Vazir"),
             url("/static/font/Vazirmatn-Regular.woff2") format("woff2"),
             url("/static/font/Vazir.woff2") format("woff2");
        font-weight: 400;
        font-style: normal;
        font-display: swap;
    }
    @font-face {
        font-family: "DChatVazir";
        src: local("Vazirmatn Medium"), local("Vazir Medium"),
             url("/static/font/Vazirmatn-Medium.woff2") format("woff2"),
             url("/static/font/Vazir-Medium.woff2") format("woff2");
        font-weight: 500 700;
        font-style: normal;
        font-display: swap;
    }
    :root { --dchat-font: "DChatVazir", "Vazirmatn", "Vazir", Shabnam, Tahoma, Arial, sans-serif; }
    body, input, button, textarea, select { font-family: var(--dchat-font) !important; }

body {
        font-family: var(--dchat-font);
        font-size: 1.6rem;
        background-color: var(--color-neutrals-n-00);
        margin: 0;
        overflow: hidden;
        height: calc(var(--vh, 1vh) * 100);
    }

    #root {
        height: 100%;
        background-color: var(--color-neutrals-n-00);
    }

    .oval_container {
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .splash-container {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .splash {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 2rem;
        padding: 1rem;
    }

    @media (min-width: 992px) {
        .splash {
            max-width: 400px;
        }
    }

    .splash > .logo {
        width: 150px;
        display: block;
    }

    .splash > .description {
        font-size: 1rem;
        text-align: center;
        line-height: 1.5;
    }

    .spin {
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        100% {
            -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
        }
    }

/* ===== Sidebar moved from templates/shared/site_sidebar_component.html ===== */
.dchat-presence-row {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-top: 6px;
        color: rgba(9, 30, 66, .55);
        font-size: 12px;
        direction: rtl;
    }

    .dchat-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(9, 30, 66, .25);
        display: inline-block;
        flex: 0 0 auto;
    }

    .dchat-dot.online {
        background: #00B894;
    }

    .dchat-dot.offline {
        background: rgba(9, 30, 66, .25);
    }

    .dchat-saved-avatar-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        color: #3c90d6;
    }
    .dchat-saved-avatar-icon svg {
        width: 56%;
        height: 56%;
        display: block;
    }

    .hidden {
        display: none !important;
    }


    .dchat-topbar-search-shell {
        position: absolute;
        inset: 8px 10px auto 10px;
        z-index: 20;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .16s ease, transform .16s ease;
    }

    .dchat-topbar-search-shell.is-open {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .dchat-topbar-search-bar {
        height: 44px;
        border-radius: 999px;
        border: 1px solid rgba(9,30,66,.10);
        background: #fff;
        box-shadow: 0 8px 24px rgba(9,30,66,.14);
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 12px;
        box-sizing: border-box;
        direction: rtl;
    }

    .dchat-topbar-search-back {
        width: 32px;
        height: 32px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        flex: 0 0 auto;
    }

    .dchat-topbar-search-back:hover {
        background: rgba(9,30,66,.06);
    }

    .dchat-topbar-search-icon {
        width: 30px;
        height: 30px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: rgba(9,30,66,.52);
        background: rgba(60,144,214,.08);
        flex: 0 0 auto;
    }

    .dchat-topbar-search-input {
        border: 0;
        outline: none;
        min-width: 0;
        flex: 1 1 auto;
        height: 40px;
        font-size: 13px;
        color: #091E42;
        background: transparent;
        direction: rtl;
    }

    .dchat-topbar-search-input::placeholder {
        color: rgba(9,30,66,.45);
    }

/* ===== Room detail moved from core/templates/core/room_detail.html ===== */
html, body {
            height: 100%;
        }

        body {
            font-family: var(--dchat-font);
            font-size: 1.6rem;
            background-color: var(--color-neutrals-n-00);
            margin: 0;
            overflow: hidden;

            height: 100dvh;
            height: calc(var(--vh, 1vh) * 100);
        }

        #root {
            height: 100%;
            background-color: var(--color-neutrals-n-00);
        }

        @media (max-width: 768px) {
            #main_navigation_wrapper,
            #sidebar_wrapper {
                display: none !important;
            }
        }

        body.swal2-height-auto {
            height: 100dvh !important;
            height: calc(var(--vh, 1vh) * 100) !important;
        }

        #chat_footer {
            padding-bottom: env(safe-area-inset-bottom, 0px);
        }

        #message_list_scroller_id {
            box-sizing: border-box;
        }

        #chat_footer .wARcwd {
            position: relative;
        }

        .dchat-emoji-panel {
            position: absolute;
            bottom: calc(64px + env(safe-area-inset-bottom, 0px));
            inset-inline-start: 12px;
            width: min(380px, calc(100vw - 24px));
            max-height: 360px;
            background: #fff;
            border: 1px solid rgba(9, 30, 66, 0.12);
            border-radius: 12px;
            box-shadow: 0 8px 24px rgba(9, 30, 66, 0.18);
            overflow: hidden;
            z-index: 9999;
        }

        .dchat-emoji-hidden {
            display: none !important;
        }

        .dchat-emoji-header {
            display: flex;
            gap: 8px;
            padding: 10px;
            border-bottom: 1px solid rgba(9, 30, 66, 0.08);
            align-items: center;
        }

        .dchat-emoji-search {
            flex: 1;
            border: 1px solid rgba(9, 30, 66, 0.12);
            border-radius: 10px;
            padding: 10px 12px;
            outline: none;
            font-family: var(--dchat-font);
            font-size: 14px;
            direction: rtl;
        }

        .dchat-emoji-close {
            border: 1px solid rgba(9, 30, 66, 0.12);
            border-radius: 10px;
            background: #fff;
            padding: 8px 10px;
            cursor: pointer;
            font-family: var(--dchat-font);
            font-size: 13px;
            white-space: nowrap;
        }

        .dchat-emoji-cats {
            display: flex;
            gap: 6px;
            padding: 8px 10px;
            border-bottom: 1px solid rgba(9, 30, 66, 0.08);
            overflow-x: auto;
        }

        .dchat-emoji-cat {
            border: 1px solid rgba(9, 30, 66, 0.12);
            border-radius: 999px;
            padding: 6px 10px;
            background: #fff;
            cursor: pointer;
            font-family: var(--dchat-font);
            font-size: 12px;
            white-space: nowrap;
            user-select: none;
        }

        .dchat-emoji-cat.is-active {
            background: rgba(0, 184, 148, 0.10);
            border-color: rgba(0, 184, 148, 0.35);
        }

        .dchat-emoji-grid {
            padding: 10px;
            display: grid;
            grid-template-columns: repeat(10, 1fr);
            gap: 6px;
            overflow: auto;
            max-height: 260px;
        }

        .dchat-emoji-btn {
            height: 30px;
            width: 30px;
            border-radius: 8px;
            border: 1px solid transparent;
            background: transparent;
            cursor: pointer;
            font-size: 18px;
            line-height: 1;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .dchat-emoji-btn:hover {
            background: rgba(9, 30, 66, 0.06);
        }

        .dchat-emoji-empty {
            padding: 14px 10px;
            color: rgba(9, 30, 66, 0.70);
            font-family: var(--dchat-font);
            font-size: 13px;
        }

        .dchat-attachments {
            margin-top: 8px;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: flex-start;
            max-width: 100%;
            min-width: 0;
            box-sizing: border-box;
        }

        .dchat-media-card,
        .dchat-file-card {
            position: relative;
            border: 1px solid rgba(9, 30, 66, .12);
            border-radius: 14px;
            background: rgba(9, 30, 66, .03);
            overflow: hidden;
            max-width: min(340px, calc(100vw - 96px));
            box-sizing: border-box;
        }

        .dchat-media-button {
            display: block;
            padding: 0;
            margin: 0;
            border: 0;
            background: transparent;
            cursor: zoom-in;
            width: 100%;
            text-align: inherit;
        }

        .dchat-media-card img {
            width: auto;
            max-width: 100%;
            max-height: 260px;
            height: auto;
            object-fit: cover;
            display: block;
        }

        .dchat-video-card {
            background: #06080d;
        }

        .dchat-video-preview {
            width: min(340px, calc(100vw - 96px));
            max-width: 100%;
            max-height: 260px;
            display: block;
            background: #000;
            border: 0;
            outline: 0;
        }
        .dchat-sticker-message-marker { display: none !important; }

        .message-item,
        .message-block,
        .Wdw5cr,
        .rZmPFS,
        .QUefjv {
            max-width: 100%;
            min-width: 0;
            box-sizing: border-box;
        }

        .message-item.dchat-sticker-message .Wdw5cr {
            background: transparent !important;
            border-color: transparent !important;
            box-shadow: none !important;
            padding: 0 !important;
        }

        .message-item.dchat-sticker-message .rZmPFS {
            background: transparent !important;
        }

        .message-item.dchat-sticker-message .dchat-attachments {
            margin-top: 0;
        }

        .message-item.dchat-sticker-message {
            margin-top: 2px !important;
            margin-bottom: 2px !important;
            min-height: 0 !important;
        }

        .message-item.dchat-sticker-message .message-block {
            padding-top: 0 !important;
            padding-bottom: 0 !important;
        }

        .message-item.dchat-sticker-message .QUefjv {
            margin: 0 !important;
            padding: 0 !important;
            line-height: 1 !important;
            min-height: 0 !important;
        }

        .message-item.dchat-sticker-message .QUefjv + .QUefjv {
            height: 0 !important;
            overflow: visible !important;
        }

        .message-item.dchat-sticker-message .KTwPFW {
            display: none !important;
        }

        .message-item.dchat-sticker-message .IheVs2 {
            position: absolute !important;
            right: 6px;
            bottom: 4px;
            margin: 0 !important;
            padding: 2px 6px !important;
            border-radius: 999px;
            background: rgba(9,30,66,.42);
            color: #fff;
            backdrop-filter: blur(4px);
            transform: scale(.88);
            transform-origin: right bottom;
            pointer-events: none;
        }

        .message-item.LtdUd1.dchat-sticker-message .IheVs2 {
            right: auto;
            left: 6px;
            transform-origin: left bottom;
        }

        .message-item.dchat-sticker-message .HMaaOP,
        .message-item.dchat-sticker-message .Jqtglx {
            display: none !important;
        }

        .dchat-sticker-card {
            border: 0 !important;
            background: transparent !important;
            border-radius: 0 !important;
            box-shadow: none !important;
            overflow: visible !important;
            max-width: min(184px, calc(100vw - 110px));
        }

        .dchat-sticker-button {
            cursor: default;
            width: auto;
        }

        .dchat-sticker-card img,
        .dchat-sticker-card video,
        .dchat-tgs-sticker {
            width: min(172px, calc(100vw - 116px));
            height: min(172px, calc(100vw - 116px));
            max-width: 172px;
            max-height: 172px;
            object-fit: contain;
            display: block;
            background: transparent;
            border-radius: 0;
        }

        .dchat-tgs-sticker {
            display: flex;
            align-items: center;
            justify-content: center;
            color: rgba(9,30,66,.55);
            font-size: 11px;
            direction: ltr;
            position: relative;
            overflow: hidden;
            isolation: isolate;
            contain: layout paint;
        }

        .dchat-tgs-sticker svg {
            width: 100% !important;
            height: 100% !important;
            max-width: 100% !important;
            max-height: 100% !important;
            display: block !important;
            flex: 0 0 auto !important;
        }

        .dchat-tgs-sticker svg + svg,
        .dchat-tgs-sticker canvas + canvas,
        .dchat-tgs-sticker > *:not(:first-child) {
            display: none !important;
        }

        .dchat-tgs-fallback {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 46px;
            height: 46px;
            border-radius: 14px;
            background: rgba(60,144,214,.10);
            color: #3c90d6;
            font-weight: 900;
            letter-spacing: .04em;
        }

        .dchat-saved-media-tile .dchat-tgs-sticker {
            width: 100%;
            height: 100%;
            max-width: 100%;
            max-height: 100%;
        }


        .dchat-media-caption {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 8px 10px;
            color: #fff;
            background: rgba(0,0,0,.72);
            font-size: 12px;
            direction: ltr;
            text-align: left;
        }

        .dchat-open-large {
            border: 0;
            border-radius: 999px;
            padding: 5px 9px;
            background: rgba(255,255,255,.16);
            color: #fff;
            cursor: pointer;
            font-family: var(--dchat-font);
            font-size: 11px;
            white-space: nowrap;
        }

        .dchat-file-card {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px;
            min-width: 220px;
            max-width: min(320px, 76vw);
            direction: rtl;
        }

        .dchat-file-icon {
            width: 42px;
            height: 42px;
            border-radius: 12px;
            background: rgba(60, 144, 214, .12);
            color: #3c90d6;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 19px;
            flex: 0 0 auto;
        }

        .dchat-file-meta {
            flex: 1;
            min-width: 0;
        }

        .dchat-file-name {
            color: #091E42;
            font-size: 13px;
            margin: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            direction: ltr;
            text-align: left;
        }

        .dchat-file-size {
            color: rgba(9, 30, 66, .65);
            font-size: 11px;
            margin: 3px 0 0 0;
            direction: ltr;
            text-align: left;
        }

        .dchat-progress-btn {
            --p: 0;
            width: 38px;
            height: 38px;
            border-radius: 999px;
            border: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: #3c90d6;
            background: conic-gradient(#3c90d6 calc(var(--p) * 1%), rgba(9, 30, 66, .13) 0);
            position: relative;
            flex: 0 0 auto;
            font-family: var(--dchat-font);
            transition: transform .15s ease;
            z-index: 2;
        }

        .dchat-progress-btn:hover { transform: scale(1.05); }

        .dchat-progress-btn::before {
            content: "";
            position: absolute;
            inset: 4px;
            background: #fff;
            border-radius: inherit;
        }

        .dchat-progress-btn > span {
            position: relative;
            z-index: 1;
            font-size: 16px;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .dchat-download-btn > span {
            width: 20px;
            height: 20px;
            font-size: 0 !important;
        }

        .dchat-download-btn > span::before {
            content: "";
            width: 20px;
            height: 20px;
            display: block;
            background: currentColor;
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 4v10m0 0 4-4m-4 4-4-4M5 19h14'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 4v10m0 0 4-4m-4 4-4-4M5 19h14'/%3E%3C/svg%3E") center / contain no-repeat;
        }

        .dchat-download-btn:hover > span::before { transform: translateY(1px); }

        .dchat-progress-btn.is-active > span,
        .dchat-progress-btn.is-cancel > span {
            color: #e74c3c;
            font-size: 19px;
        }

        .dchat-progress-btn.is-active > span::before,
        .dchat-progress-btn.is-cancel > span::before { display: none !important; }

        .dchat-media-card .dchat-progress-btn {
            position: absolute;
            top: 8px;
            left: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,.18);
        }

        .dchat-upload-pending-message {
            opacity: .92;
        }

        .dchat-upload-error {
            outline: 1px solid rgba(231, 76, 60, .35);
        }

        .dchat-viewer-overlay {
            position: fixed;
            inset: 0;
            z-index: 100060;
            background: rgba(0,0,0,.88);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 18px;
            box-sizing: border-box;
        }

        .dchat-viewer-inner {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .dchat-viewer-inner img,
        .dchat-viewer-inner video {
            max-width: 100%;
            max-height: 100%;
            border-radius: 14px;
            background: #000;
            box-shadow: 0 16px 48px rgba(0,0,0,.38);
        }

        .dchat-viewer-bar {
            position: fixed;
            top: calc(16px + env(safe-area-inset-top, 0px));
            right: 16px;
            left: 16px;
            display: flex;
            align-items: center;
            gap: 10px;
            z-index: 100061;
            direction: rtl;
        }

        .dchat-viewer-title {
            color: #fff;
            font-size: 13px;
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            direction: ltr;
            text-align: left;
        }

        .dchat-viewer-action {
            border: 1px solid rgba(255,255,255,.24);
            background: rgba(255,255,255,.12);
            color: #fff;
            border-radius: 999px;
            min-width: 42px;
            height: 42px;
            padding: 0 13px;
            cursor: pointer;
            font-family: var(--dchat-font);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            text-decoration: none;
        }

        .dchat-viewer-action[disabled] {
            opacity: .35;
            pointer-events: none;
        }

        .dchat-viewer-counter {
            color: rgba(255,255,255,.82);
            font-size: 12px;
            min-width: 48px;
            text-align: center;
            direction: ltr;
        }

        .dchat-viewer-nav {
            position: fixed;
            top: 50%;
            transform: translateY(-50%);
            z-index: 100061;
            width: 48px;
            height: 48px;
            border-radius: 999px;
            border: 1px solid rgba(255,255,255,.24);
            background: rgba(0,0,0,.32);
            color: #fff;
            cursor: pointer;
            font-size: 32px;
            line-height: 1;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .dchat-viewer-nav.prev { right: 18px; }
        .dchat-viewer-nav.next { left: 18px; }
        .dchat-viewer-nav[disabled] { display: none; }

        @media (max-width: 720px) {
            .dchat-viewer-nav {
                width: 42px;
                height: 42px;
                font-size: 26px;
                top: auto;
                bottom: calc(22px + env(safe-area-inset-bottom, 0px));
                transform: none;
            }
            .dchat-viewer-nav.prev { right: 20px; }
            .dchat-viewer-nav.next { left: 20px; }
        }


        .dchat-gif-card::after {
            content: "GIF";
            position: absolute;
            right: 8px;
            bottom: 8px;
            background: rgba(0,0,0,.64);
            color: #fff;
            border-radius: 999px;
            padding: 3px 8px;
            font-size: 10px;
            font-family: var(--dchat-font);
            pointer-events: none;
        }

        .dchat-save-gif-btn {
            position: absolute;
            right: 8px;
            top: 8px;
            z-index: 3;
            border: 0;
            border-radius: 999px;
            min-width: 34px;
            height: 34px;
            padding: 0 9px;
            background: rgba(0,0,0,.58);
            color: #fff;
            font-size: 11px;
            font-family: var(--dchat-font);
            cursor: pointer;
            backdrop-filter: blur(4px);
        }

        .dchat-save-gif-btn.is-saved {
            background: rgba(60,144,214,.88);
        }

        .dchat-gif-button {
            user-select: none;
            font-family: var(--dchat-font);
            font-size: 11px;
            font-weight: 700;
            color: #5E6C84;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .dchat-gif-button svg {
            width: 27px;
            height: 27px;
            display: block;
        }

        .dchat-gif-button .dchat-media-picker-icon-badge {
            font-family: var(--dchat-font), sans-serif;
            font-size: 5.2px;
            font-weight: 800;
            letter-spacing: .1px;
        }

        .dchat-reply-bar {
            position: relative;
            margin: 0 12px 7px 12px;
            padding: 7px 38px 7px 10px;
            border-radius: 13px;
            background: rgba(60,144,214,.09);
            border-inline-start: 3px solid #3c90d6;
            color: #091E42;
            direction: rtl;
            font-family: var(--dchat-font);
            display: none;
            box-shadow: 0 6px 18px rgba(9,30,66,.06);
        }

        .dchat-reply-bar.is-visible { display: block; }

        .dchat-reply-close {
            position: absolute;
            right: 9px;
            top: 50%;
            transform: translateY(-50%);
            width: 24px;
            height: 24px;
            border-radius: 999px;
            border: 0;
            background: rgba(9,30,66,.08);
            cursor: pointer;
            color: #091E42;
            line-height: 24px;
        }

        .dchat-reply-title,
        .dchat-reply-quote-title {
            margin: 0 0 1px 0;
            color: #3c90d6;
            font-size: 11px;
            line-height: 1.35;
            font-weight: 800;
        }

        .dchat-reply-text,
        .dchat-reply-quote-text {
            margin: 0;
            color: rgba(9,30,66,.72);
            font-size: 11px;
            line-height: 1.35;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .dchat-reply-quote {
            display: block;
            box-sizing: border-box;
            border-inline-start: 3px solid #3c90d6;
            background: rgba(60,144,214,.08);
            border-radius: 10px;
            padding: 5px 8px;
            margin: 0 0 5px 0;
            cursor: pointer;
            width: fit-content;
            max-width: min(230px, 58vw);
            overflow: hidden;
        }

        .dchat-reply-quote * {
            max-width: 100%;
            min-width: 0;
        }

        .KTwPFW .dchat-reply-quote + br { display: none; }


        /* Chat-local message search */
        .dchat-chat-search-btn {
            border: 0;
            background: transparent;
            padding: 0;
            margin: 0;
            width: 42px;
            height: 42px;
            border-radius: 999px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: #42526E;
        }

        .dchat-chat-search-btn:hover,
        .dchat-chat-search-btn.is-active { background: rgba(9,30,66,.07); }

        .dchat-chat-search-panel {
            display: none;
            align-items: center;
            gap: 8px;
            padding: 8px 14px;
            background: rgba(252,253,253,.97);
            border-bottom: 1px solid rgba(9,30,66,.08);
            box-shadow: 0 8px 22px rgba(9,30,66,.06);
            direction: rtl;
            z-index: 50;
            position: relative;
            font-family: var(--dchat-font);
        }

        .dchat-chat-search-panel.is-open { display: flex; }

        .dchat-chat-search-box {
            flex: 1;
            min-width: 0;
            height: 42px;
            border-radius: 999px;
            background: linear-gradient(135deg, rgba(60,144,214,.10), rgba(57,204,200,.10));
            border: 1px solid rgba(60,144,214,.16);
            display: flex;
            align-items: center;
            gap: 9px;
            padding: 0 13px;
            color: rgba(60,144,214,.92);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
        }

        .dchat-chat-search-input {
            flex: 1;
            min-width: 0;
            height: 100%;
            border: 0;
            outline: 0;
            background: transparent;
            color: #091E42;
            font-family: var(--dchat-font);
            font-size: 13px;
            direction: rtl;
        }

        .dchat-chat-search-input::placeholder { color: rgba(9,30,66,.45); }

        .dchat-chat-search-meta {
            min-width: 58px;
            text-align: center;
            color: rgba(9,30,66,.62);
            font-size: 12px;
            white-space: nowrap;
        }

        .dchat-chat-search-nav,
        .dchat-chat-search-close {
            width: 36px;
            height: 36px;
            border-radius: 999px;
            border: 1px solid rgba(9,30,66,.08);
            background: rgba(255,255,255,.88);
            color: #42526E;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-family: var(--dchat-font);
            font-size: 17px;
            line-height: 1;
            transition: background .16s ease, color .16s ease, transform .16s ease, border-color .16s ease;
        }

        .dchat-chat-search-nav:hover,
        .dchat-chat-search-close:hover {
            background: rgba(60,144,214,.12);
            color: #3c90d6;
            border-color: rgba(60,144,214,.20);
            transform: translateY(-1px);
        }

        .dchat-chat-search-close { color: #de350b; }

        .dchat-chat-search-nav:disabled { opacity: .38; cursor: default; }

        .message-item.dchat-search-match .Wdw5cr {
            box-shadow: 0 0 0 2px rgba(255, 193, 7, .38), 0 8px 24px rgba(9,30,66,.10) !important;
        }

        .message-item.dchat-search-active .Wdw5cr {
            box-shadow: 0 0 0 3px rgba(60,144,214,.55), 0 10px 28px rgba(60,144,214,.18) !important;
        }

        .dchat-reply-bar {
            margin: 0 10px 6px 10px;
            padding: 6px 34px 6px 10px;
            border-radius: 12px;
            background: rgba(60,144,214,.075);
            box-shadow: none;
            min-height: 34px;
        }

        .dchat-reply-close {
            right: 7px;
            width: 22px;
            height: 22px;
            line-height: 22px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
        }

        .dchat-reply-title,
        .dchat-reply-quote-title {
            font-size: 10.5px;
            line-height: 1.2;
            margin: 0;
        }

        .dchat-reply-text,
        .dchat-reply-quote-text {
            font-size: 10.5px;
            line-height: 1.25;
            max-width: 100%;
        }

        .dchat-reply-quote {
            display: inline-block;
            vertical-align: top;
            width: auto;
            max-width: min(190px, 52vw);
            min-width: 0;
            padding: 4px 7px;
            margin: 0 0 4px 0;
            border-radius: 8px;
            background: rgba(60,144,214,.065);
            box-shadow: none;
        }

        .dchat-reply-quote-title,
        .dchat-reply-quote-text { max-width: 174px; }

        @media (max-width: 640px) {
            .dchat-chat-search-panel { padding: 7px 9px; gap: 6px; }
            .dchat-chat-search-meta { min-width: 48px; font-size: 11px; }
            .dchat-chat-search-nav, .dchat-chat-search-close { width: 32px; height: 32px; }
            .dchat-reply-quote { max-width: min(170px, 48vw); }
        }

        .dchat-message-menu {
            position: fixed;
            z-index: 100002;
            min-width: 186px;
            border-radius: 18px;
            background: rgba(255,255,255,.96);
            border: 1px solid rgba(9,30,66,.08);
            box-shadow: 0 20px 48px rgba(9,30,66,.18);
            padding: 7px;
            direction: rtl;
            font-family: var(--dchat-font);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
        }

        .dchat-message-menu button,
        .dchat-message-menu .dchat-message-menu-btn {
            width: 100%;
            border: 0;
            background: transparent;
            border-radius: 13px;
            padding: 11px 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            text-align: right;
            cursor: pointer;
            color: #091E42;
            font-family: var(--dchat-font);
            font-size: 13.5px;
            font-weight: 800;
            line-height: 1.2;
            transition: background .16s ease, color .16s ease, transform .16s ease;
        }

        .dchat-message-menu button:hover,
        .dchat-message-menu .dchat-message-menu-btn:hover {
            background: rgba(9,30,66,.06);
            transform: translateY(-1px);
        }

        .dchat-message-menu .dchat-menu-label {
            flex: 1 1 auto;
            min-width: 0;
        }

        .dchat-message-menu .dchat-menu-icon {
            flex: 0 0 34px;
            width: 34px;
            height: 34px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 11px;
            background: rgba(60,144,214,.10);
            color: #3c90d6;
            box-shadow: inset 0 0 0 1px rgba(60,144,214,.11);
        }

        .dchat-message-menu .dchat-menu-icon svg {
            width: 18px;
            height: 18px;
            display: block;
        }

        .dchat-message-menu button[data-action="delete"] { color: #c0392b; }

        .dchat-message-menu button[data-action="delete"] .dchat-menu-icon {
            background: rgba(192,57,43,.10);
            box-shadow: inset 0 0 0 1px rgba(192,57,43,.12);
            color: #c0392b;
        }


        .message-item {
            position: relative;
            touch-action: pan-y;
        }
        .dchat-swipe-reply-hint {
            position: absolute;
            right: -34px;
            top: 50%;
            transform: translateY(-50%);
            width: 28px;
            height: 28px;
            border-radius: 999px;
            background: rgba(60,144,214,.14);
            color: #3c90d6;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity .12s ease;
            pointer-events: none;
        }

        .message-item.dchat-swiping-reply .dchat-swipe-reply-hint { opacity: 1; }

        .dchat-gif-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 8px;
            max-height: min(54vh, 420px);
            overflow: auto;
            padding: 2px;
        }

        .dchat-gif-tile {
            position: relative;
            border: 0;
            padding: 0;
            border-radius: 12px;
            overflow: hidden;
            background: rgba(9,30,66,.06);
            cursor: pointer;
            aspect-ratio: 1 / 1;
        }

        .dchat-gif-tile img {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
        }

        .dchat-gif-remove {
            position: absolute;
            top: 5px;
            left: 5px;
            width: 26px;
            height: 26px;
            border-radius: 999px;
            border: 0;
            background: rgba(0,0,0,.58);
            color: #fff;
            cursor: pointer;
        }

        .dchat-gif-empty {
            padding: 18px 8px;
            color: rgba(9,30,66,.72);
            font-family: var(--dchat-font);
            font-size: 13px;
            line-height: 1.8;
            text-align: center;
        }

        .dchat-media-more-btn,
        .dchat-gif-more-btn {
            position: absolute;
            right: 8px;
            top: 8px;
            z-index: 4;
            width: 34px;
            height: 34px;
            border: 0;
            border-radius: 999px;
            background: rgba(0,0,0,.56);
            color: #fff;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            line-height: 1;
            backdrop-filter: blur(4px);
        }

        .dchat-media-picker {
            position: absolute;
            left: 10px;
            right: 10px;
            bottom: calc(64px + env(safe-area-inset-bottom, 0px));
            max-height: min(46vh, 420px);
            background: rgba(255,255,255,.98);
            border: 1px solid rgba(9,30,66,.10);
            border-radius: 22px 22px 14px 14px;
            box-shadow: 0 18px 48px rgba(9,30,66,.18);
            z-index: 10000;
            direction: rtl;
            font-family: var(--dchat-font);
            overflow: hidden;
            backdrop-filter: blur(10px);
        }

        .dchat-media-picker-head {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px;
            border-bottom: 1px solid rgba(9,30,66,.08);
        }

        .dchat-media-picker-tabs {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            padding: 3px;
            border-radius: 999px;
            background: rgba(9,30,66,.06);
        }

        .dchat-media-picker-tab {
            border: 0;
            border-radius: 999px;
            background: transparent;
            color: rgba(9,30,66,.70);
            font-family: var(--dchat-font);
            font-size: 12px;
            font-weight: 800;
            padding: 8px 10px;
            cursor: pointer;
        }

        .dchat-media-picker-tab.is-active {
            background: #fff;
            color: #3c90d6;
            box-shadow: 0 6px 18px rgba(9,30,66,.08);
        }

        .dchat-media-picker-close,
        .dchat-media-picker-add {
            border: 0;
            border-radius: 12px;
            background: rgba(9,30,66,.06);
            color: #091E42;
            width: 36px;
            height: 36px;
            cursor: pointer;
            font-family: var(--dchat-font);
            font-weight: 800;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .dchat-media-picker-add {
            color: #3c90d6;
            background: rgba(60,144,214,.10);
        }

        .dchat-media-picker-body {
            padding: 10px;
            overflow: auto;
            max-height: calc(min(46vh, 420px) - 58px);
        }

        .dchat-saved-media-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 8px;
        }

        .dchat-saved-media-tile {
            position: relative;
            border: 0;
            padding: 0;
            aspect-ratio: 1 / 1;
            border-radius: 16px;
            overflow: hidden;
            background: rgba(9,30,66,.06);
            cursor: pointer;
        }

        .dchat-saved-media-tile img,
        .dchat-saved-media-tile video {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
        }

        .dchat-saved-media-tile.is-sticker {
            background: linear-gradient(135deg, rgba(60,144,214,.08), rgba(9,30,66,.04));
        }

        .dchat-saved-media-remove {
            position: absolute;
            left: 5px;
            top: 5px;
            width: 24px;
            height: 24px;
            border: 0;
            border-radius: 999px;
            background: rgba(0,0,0,.58);
            color: #fff;
            cursor: pointer;
            z-index: 2;
        }

        .dchat-saved-media-fallback {
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 8px;
            text-align: center;
            color: rgba(9,30,66,.72);
            font-size: 11px;
            line-height: 1.6;
        }

        .dchat-media-picker-empty {
            padding: 24px 10px;
            text-align: center;
            color: rgba(9,30,66,.68);
            font-size: 13px;
            line-height: 1.9;
        }

        @media (max-width: 540px) {
            .dchat-saved-media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
            .dchat-media-picker { left: 6px; right: 6px; border-radius: 20px 20px 12px 12px; }
        }

        .dchat-forwarded-label {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: #3c90d6;
            font-size: 12px;
            font-weight: 700;
            margin-bottom: 5px;
            direction: rtl;
        }

        .message-item.dchat-selected .Wdw5cr {
            box-shadow: 0 0 0 2px rgba(60,144,214,.40), 0 8px 26px rgba(9,30,66,.12);
        }

        .dchat-select-dot {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            right: 8px;
            width: 26px;
            height: 26px;
            border-radius: 999px;
            border: 2px solid rgba(60,144,214,.55);
            background: #fff;
            z-index: 5;
            display: none;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 15px;
        }

        .message-item.dchat-selection-mode .dchat-select-dot,
        .message-item.dchat-selected .dchat-select-dot { display: flex; }

        .message-item.dchat-selected .dchat-select-dot {
            background: #3c90d6;
            border-color: #3c90d6;
        }

        .message-item.dchat-selected .dchat-select-dot::after { content: "✓"; }

        .dchat-selection-bar {
            position: fixed;
            top: max(10px, env(safe-area-inset-top, 0px));
            left: 50%;
            transform: translateX(-50%);
            width: min(520px, calc(100vw - 20px));
            z-index: 100003;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 10px;
            border: 1px solid rgba(9,30,66,.10);
            border-radius: 18px;
            background: rgba(255,255,255,.96);
            box-shadow: 0 18px 48px rgba(9,30,66,.18);
            direction: rtl;
            font-family: var(--dchat-font);
            backdrop-filter: blur(10px);
        }

        .dchat-selection-title {
            margin: 0;
            font-size: 13px;
            color: #091E42;
            white-space: nowrap;
        }

        .dchat-selection-actions { display: flex; align-items: center; gap: 8px; }

        .dchat-selection-action {
            border: 0;
            border-radius: 12px;
            padding: 9px 11px;
            cursor: pointer;
            font-family: var(--dchat-font);
            font-size: 12px;
            background: rgba(9,30,66,.06);
            color: #091E42;
        }

        .dchat-selection-action.primary { background: rgba(60,144,214,.12); color: #2b78b6; }
        .dchat-selection-action.danger { background: rgba(231,76,60,.10); color: #c0392b; }

        .dchat-room-target-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: min(54vh, 420px);
            overflow: auto;
            padding: 2px;
            direction: rtl;
        }

        .dchat-room-target {
            display: flex;
            align-items: center;
            gap: 10px;
            border: 1px solid rgba(9,30,66,.10);
            border-radius: 14px;
            padding: 10px;
            cursor: pointer;
            background: #fff;
            font-family: var(--dchat-font);
            text-align: right;
        }

        .dchat-room-target input { margin: 0; accent-color: #3c90d6; }
        .dchat-room-target-title { flex: 1; min-width: 0; font-size: 13px; color: #091E42; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .dchat-room-target-kind { font-size: 11px; color: rgba(9,30,66,.55); }

        @media (max-width: 720px) {
            .dchat-selection-bar { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); top: auto; }
            .dchat-selection-action { padding: 9px 10px; }
            .dchat-select-dot { right: 4px; }
        }

        @media (max-width: 540px) {
            body, #root, #app_main_wrapper { overflow-x: hidden; }
            .dchat-media-card,
            .dchat-file-card {
                max-width: calc(100vw - 62px);
            }
            .dchat-media-card img,
            .dchat-video-preview {
                max-width: calc(100vw - 68px);
                width: auto;
                max-height: 220px;
            }
            .dchat-video-preview { width: calc(100vw - 68px); }
            .dchat-file-card {
                min-width: 0;
                width: min(320px, calc(100vw - 68px));
            }
            .dchat-sticker-card,
            .dchat-sticker-card img,
            .dchat-sticker-card video,
            .dchat-tgs-sticker {
                max-width: 148px;
            }
            .dchat-sticker-card img,
            .dchat-sticker-card video,
            .dchat-tgs-sticker {
                width: 148px;
                height: 148px;
            }
        }

        .dchat-hidden-file {
            display: none !important;
        }

        .dchat-drop-overlay {
            position: fixed;
            inset: 0;
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(9, 30, 66, .35);
            backdrop-filter: blur(2px);
            color: #fff;
            font-family: var(--dchat-font);
            font-size: 16px;
            text-align: center;
            padding: 20px;
        }

        .dchat-swal-attach {
            text-align: right;
            direction: rtl;
        }

        .dchat-swal-title {
            font-family: var(--dchat-font);
            font-size: 16px;
            margin: 0 0 8px 0;
            color: #091E42;
        }

        .dchat-swal-sub {
            font-family: var(--dchat-font);
            font-size: 12px;
            margin: 0 0 14px 0;
            color: rgba(9, 30, 66, .70);
            line-height: 1.6;
        }

        .dchat-swal-filelist {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 14px;
            max-height: 260px;
            overflow: auto;
            padding-inline-end: 4px;
        }

        .dchat-swal-fileitem {
            border: 1px solid rgba(9, 30, 66, .12);
            border-radius: 12px;
            padding: 10px;
            background: rgba(9, 30, 66, .02);
        }

        .dchat-swal-row {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .dchat-swal-thumb {
            width: 54px;
            height: 54px;
            border-radius: 12px;
            border: 1px solid rgba(9, 30, 66, .12);
            background: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            flex: 0 0 auto;
        }

        .dchat-swal-thumb img,
        .dchat-swal-thumb video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .dchat-swal-meta {
            flex: 1;
            min-width: 0;
        }

        .dchat-swal-name {
            font-family: var(--dchat-font);
            font-size: 13px;
            color: #091E42;
            margin: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            direction: ltr;
            text-align: left;
        }

        .dchat-swal-size {
            font-family: var(--dchat-font);
            font-size: 11px;
            color: rgba(9, 30, 66, .70);
            margin: 4px 0 0 0;
            direction: ltr;
            text-align: left;
        }

        .dchat-swal-remove {
            border: 1px solid rgba(9, 30, 66, .12);
            border-radius: 10px;
            background: #fff;
            padding: 6px 10px;
            cursor: pointer;
            font-family: var(--dchat-font);
            font-size: 12px;
            white-space: nowrap;
        }

        .dchat-swal-caption-wrap {
            margin-top: 10px;
        }

        .dchat-swal-caption {
            width: 100%;
            min-height: 84px;
            resize: none;
            border: 1px solid rgba(9, 30, 66, .12);
            border-radius: 12px;
            padding: 10px 12px;
            outline: none;
            font-family: var(--dchat-font);
            font-size: 13px;
            direction: rtl;
            line-height: 1.7;
            box-sizing: border-box;
            background: #fff;
        }

        .dchat-swal-actions {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            margin-top: 14px;
        }

        .dchat-swal-btn {
            border: 1px solid rgba(9, 30, 66, .12);
            border-radius: 12px;
            padding: 10px 12px;
            cursor: pointer;
            font-family: var(--dchat-font);
            font-size: 13px;
            text-decoration: none;
            background: #fff;
            color: #091E42;
            user-select: none;
        }

        .dchat-swal-btn.primary {
            border-color: rgba(0, 184, 148, .35);
            background: rgba(0, 184, 148, .10);
            color: #3c90d6;
        }

        .dchat-swal-btn.danger {
            background: rgba(255, 0, 0, .05);
            border-color: rgba(255, 0, 0, .15);
            color: #C0392B;
        }

        .dchat-swal-popup {
            padding: 18px !important;
            width: 100%;
            max-width: 450px;
            direction: rtl;
            font-family: inherit;
        }

        .dchat-swal-title-main {
            color: #091E42 !important;
            font-size: 17px !important;
            font-weight: 900 !important;
            padding-top: 4px !important;
        }

        .dchat-swal-html-main {
            margin: 0 !important;
            color: #42526E !important;
            font-size: 13px !important;
        }

        .dchat-swal-actions-main {
            gap: 8px !important;
            margin-top: 16px !important;
        }

        .dchat-swal-confirm-main,
        .dchat-swal-cancel-main,
        .dchat-swal-deny-main {
            border: 0 !important;
            border-radius: 14px !important;
            padding: 10px 16px !important;
            min-width: 88px;
            font-weight: 800 !important;
            cursor: pointer !important;
            box-shadow: none !important;
        }

        .dchat-swal-confirm-main {
            background: #3C90D6 !important;
            color: #fff !important;
        }

        .dchat-swal-cancel-main {
            background: #EEF4FB !important;
            color: #42526E !important;
        }

        .dchat-swal-deny-main,
        .dchat-swal-danger-btn {
            background: rgba(255,77,79,.12) !important;
            color: #cf1322 !important;
        }

        .swal2-container {
            z-index: 100500 !important;
        }

        .dchat-delete-choice {
            display: grid;
            gap: 10px;
            text-align: right;
        }

        .dchat-delete-choice-btn {
            width: 100%;
            border: 1px solid rgba(9,30,66,.10);
            background: #fff;
            border-radius: 16px;
            padding: 12px 14px;
            text-align: right;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            transition: transform .12s ease, border-color .12s ease, background .12s ease;
        }

        .dchat-delete-choice-btn:hover {
            transform: translateY(-1px);
            border-color: rgba(60,144,214,.40);
            background: #F7FBFF;
        }

        .dchat-delete-choice-btn.danger {
            border-color: rgba(255,77,79,.24);
        }

        .dchat-delete-choice-title {
            margin: 0;
            color: #091E42;
            font-size: 14px;
            font-weight: 900;
        }

        .dchat-delete-choice-sub {
            margin: 3px 0 0;
            color: #6B778C;
            font-size: 12px;
            line-height: 1.6;
        }


/* v60: delete-message modal dark-mode readability */
html.dchat-dark .swal2-popup .dchat-delete-choice-btn {
    background: rgba(15, 23, 42, .82) !important;
    border-color: rgba(148, 163, 184, .18) !important;
    color: #eef6ff !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.02) !important;
}

html.dchat-dark .swal2-popup .dchat-delete-choice-btn:hover {
    background: rgba(30, 41, 59, .92) !important;
    border-color: rgba(143, 208, 255, .34) !important;
}

html.dchat-dark .swal2-popup .dchat-delete-choice-btn.danger {
    background: rgba(127, 29, 29, .24) !important;
    border-color: rgba(248, 113, 113, .34) !important;
}

html.dchat-dark .swal2-popup .dchat-delete-choice-title {
    color: #f8fafc !important;
}

html.dchat-dark .swal2-popup .dchat-delete-choice-sub {
    color: rgba(226, 232, 240, .72) !important;
}

html.dchat-dark .swal2-popup .dchat-swal-btn {
    background: rgba(15, 23, 42, .72) !important;
    border-color: rgba(148, 163, 184, .20) !important;
    color: #eef6ff !important;
}

html.dchat-dark .swal2-popup .dchat-swal-btn:hover {
    background: rgba(30, 41, 59, .88) !important;
}
    

        /* Final control centering fixes */
        .dchat-progress-btn,
        .dchat-progress-btn > span,
        .dchat-gif-remove,
        .dchat-saved-media-remove {
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            padding: 0 !important;
            line-height: 1 !important;
            text-align: center !important;
        }




        .JL_RzJ > .dcVtOk.St2BTl { display: none !important; }

        .dchat-day-divider {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 14px 0 10px;
            pointer-events: none;
            direction: rtl;
        }

        .dchat-day-divider > span {
            background: rgba(255,255,255,.86);
            color: rgba(9,30,66,.68);
            border: 1px solid rgba(9,30,66,.08);
            box-shadow: 0 4px 14px rgba(9,30,66,.06);
            border-radius: 999px;
            padding: 5px 12px;
            font-size: 12px;
            font-weight: 700;
            font-family: var(--dchat-font);
            line-height: 1.4;
        }

        .dchat-block-notice {
            margin: 8px 12px 0;
            padding: 9px 12px;
            border-radius: 14px;
            background: rgba(231,76,60,.08);
            color: #a63a2f;
            font-size: 12px;
            font-family: var(--dchat-font);
            text-align: center;
            border: 1px solid rgba(231,76,60,.12);
            display: none;
        }

        .dchat-block-notice.is-visible { display: block; }

        .dchat-input-disabled {
            opacity: .65;
            cursor: not-allowed;
        }

        .dchat-room-header-clickable {
            cursor: pointer;
            user-select: none;
        }

        .dchat-room-header-clickable:hover .N5ck6R,
        .dchat-room-header-clickable:hover .nMlHDG {
            filter: brightness(.98);
        }

        .dchat-profile-overlay {
            position: fixed;
            inset: 0;
            background: rgba(9, 30, 66, .28);
            z-index: 100020;
            display: flex;
            justify-content: flex-end;
            direction: rtl;
        }

        .dchat-profile-overlay.dchat-emoji-hidden { display: none !important; }

        .dchat-profile-drawer {
            width: min(430px, 100vw);
            height: 100%;
            background: #fcfdfd;
            box-shadow: -18px 0 48px rgba(9, 30, 66, .18);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            animation: dchatProfileIn .18s ease-out;
        }

        @keyframes dchatProfileIn {
            from { transform: translateX(-18px); opacity: .75; }
            to { transform: translateX(0); opacity: 1; }
        }

        .dchat-profile-topbar {
            height: 58px;
            padding: 0 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            border-bottom: 1px solid rgba(9, 30, 66, .08);
            flex: 0 0 auto;
        }

        .dchat-profile-title-small {
            margin: 0;
            font-size: 15px;
            font-weight: 700;
            color: #091E42;
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .dchat-profile-icon-btn {
            width: 38px;
            height: 38px;
            border: 0;
            border-radius: 999px;
            background: transparent;
            color: #42526E;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            line-height: 1;
            font-family: var(--dchat-font);
        }

        .dchat-profile-icon-btn:hover {
            background: rgba(9, 30, 66, .06);
        }

        .dchat-profile-body {
            flex: 1;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding-bottom: env(safe-area-inset-bottom, 0px);
        }

        .dchat-profile-hero {
            padding: 22px 18px 16px;
            text-align: center;
            border-bottom: 1px solid rgba(9, 30, 66, .08);
        }

        .dchat-profile-avatar-lg {
            width: 112px;
            height: 112px;
            border-radius: 50%;
            margin: 0 auto 14px;
            background: var(--color-alternative-a-02);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            font-size: 44px;
            font-weight: 700;
            box-shadow: 0 8px 24px rgba(9, 30, 66, .12);
            border: 0;
            cursor: zoom-in;
            padding: 0;
        }

        .dchat-profile-avatar-lg img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .dchat-profile-name {
            margin: 0;
            font-size: 20px;
            font-weight: 800;
            color: #091E42;
            overflow-wrap: anywhere;
        }

        .dchat-profile-subtitle {
            margin: 6px 0 0;
            font-size: 12px;
            color: rgba(9, 30, 66, .62);
        }

        .dchat-profile-bio {
            margin: 10px auto 0;
            max-width: 340px;
            font-size: 13px;
            line-height: 1.8;
            color: rgba(9, 30, 66, .76);
            overflow-wrap: anywhere;
        }

        .dchat-profile-tabs {
            position: sticky;
            top: 0;
            z-index: 2;
            background: #fcfdfd;
            display: flex;
            gap: 6px;
            padding: 10px 12px;
            border-bottom: 1px solid rgba(9, 30, 66, .08);
        }

        .dchat-profile-tab {
            flex: 1;
            height: 36px;
            border: 1px solid rgba(9, 30, 66, .10);
            border-radius: 999px;
            background: #fff;
            color: #42526E;
            cursor: pointer;
            font-size: 12px;
            font-family: var(--dchat-font);
        }

        .dchat-profile-tab.is-active {
            color: #3c90d6;
            background: rgba(60, 144, 214, .10);
            border-color: rgba(60, 144, 214, .22);
            font-weight: 700;
        }

        .dchat-profile-section { padding: 12px; }

        .dchat-profile-info-card,
        .dchat-profile-member-row,
        .dchat-profile-file-row {
            background: #fff;
            border: 1px solid rgba(9, 30, 66, .08);
            border-radius: 16px;
            box-shadow: 0 4px 14px rgba(9, 30, 66, .04);
        }

        .dchat-profile-info-card {
            padding: 14px;
            margin-bottom: 10px;
            color: #091E42;
            font-size: 13px;
            line-height: 1.8;
        }

        .dchat-profile-section-title {
            margin: 6px 2px 10px;
            color: rgba(9, 30, 66, .62);
            font-size: 12px;
            font-weight: 700;
        }

        .dchat-profile-members-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .dchat-profile-member-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px;
        }

        .dchat-profile-member-avatar {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            background: var(--color-alternative-a-02);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            flex: 0 0 auto;
            font-weight: 700;
        }

        .dchat-profile-member-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .dchat-profile-member-meta { min-width: 0; flex: 1; }
        .dchat-profile-member-name { margin: 0; color: #091E42; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .dchat-profile-member-sub { margin: 3px 0 0; color: rgba(9, 30, 66, .55); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .dchat-profile-owner-badge { color: #3c90d6; font-size: 10px; font-weight: 700; margin-inline-start: 5px; }

        .dchat-profile-member-actions {
            flex: 0 0 auto;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .dchat-profile-member-remove {
            width: 32px;
            height: 32px;
            border: 0;
            border-radius: 999px;
            background: rgba(255, 82, 82, .10);
            color: #D92D20;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            line-height: 1;
            font-family: var(--dchat-font);
            transition: background .15s ease, transform .15s ease;
        }

        .dchat-profile-member-remove:hover {
            background: rgba(255, 82, 82, .16);
            transform: translateY(-1px);
        }

        .dchat-profile-media-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 6px;
        }

        .dchat-profile-media-tile {
            position: relative;
            aspect-ratio: 1 / 1;
            border: 0;
            border-radius: 12px;
            overflow: hidden;
            background: rgba(9, 30, 66, .06);
            cursor: pointer;
            padding: 0;
        }

        .dchat-profile-media-tile img,
        .dchat-profile-media-tile video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .dchat-profile-media-badge {
            position: absolute;
            left: 6px;
            bottom: 6px;
            border-radius: 999px;
            background: rgba(0,0,0,.58);
            color: #fff;
            font-size: 10px;
            padding: 2px 6px;
        }

        .dchat-profile-file-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .dchat-profile-file-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px;
            text-decoration: none;
            color: inherit;
            direction: rtl;
        }

        .dchat-profile-file-icon {
            width: 40px;
            height: 40px;
            border-radius: 12px;
            background: rgba(60, 144, 214, .12);
            color: #3c90d6;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 800;
            flex: 0 0 auto;
        }

        .dchat-profile-file-meta { min-width: 0; flex: 1; }
        .dchat-profile-file-name { margin: 0; color: #091E42; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: left; }
        .dchat-profile-file-sub { margin: 3px 0 0; color: rgba(9, 30, 66, .55); font-size: 11px; direction: ltr; text-align: left; }

        .dchat-profile-empty {
            padding: 22px 12px;
            color: rgba(9, 30, 66, .55);
            font-size: 13px;
            text-align: center;
        }

        .dchat-group-settings-form {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .dchat-group-settings-card {
            background: #fff;
            border: 1px solid rgba(9, 30, 66, .08);
            border-radius: 18px;
            box-shadow: 0 6px 18px rgba(9, 30, 66, .04);
            padding: 14px;
        }

        .dchat-group-avatar-editor {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .dchat-group-avatar-pick {
            width: 74px;
            height: 74px;
            border-radius: 50%;
            overflow: hidden;
            border: 0;
            background: var(--color-alternative-a-02);
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 28px;
            font-weight: 800;
            cursor: pointer;
            box-shadow: 0 8px 22px rgba(9, 30, 66, .12);
            flex: 0 0 auto;
            position: relative;
        }

        .dchat-group-avatar-pick img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .dchat-group-avatar-pick::after {
            content: "تغییر";
            position: absolute;
            inset-inline: 0;
            bottom: 0;
            padding: 3px 0;
            background: rgba(0,0,0,.48);
            color: #fff;
            font-size: 10px;
            text-align: center;
        }

        .dchat-group-avatar-meta {
            min-width: 0;
            flex: 1;
            color: rgba(9, 30, 66, .64);
            font-size: 12px;
            line-height: 1.8;
        }

        .dchat-group-field {
            display: flex;
            flex-direction: column;
            gap: 7px;
        }

        .dchat-group-field label,
        .dchat-group-toggle span {
            color: rgba(9, 30, 66, .72);
            font-size: 12px;
            font-weight: 800;
        }

        .dchat-group-input,
        .dchat-group-textarea {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid rgba(9, 30, 66, .12);
            border-radius: 14px;
            background: rgba(9, 30, 66, .035);
            color: #091E42;
            outline: 0;
            font-family: var(--dchat-font);
            font-size: 13px;
            padding: 11px 12px;
            direction: rtl;
        }

        .dchat-group-input:focus,
        .dchat-group-textarea:focus {
            border-color: rgba(60, 144, 214, .42);
            box-shadow: 0 0 0 3px rgba(60, 144, 214, .10);
        }

        .dchat-group-textarea { min-height: 96px; resize: vertical; line-height: 1.8; }

        .dchat-group-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 10px 0 4px;
        }

        .dchat-group-toggle input { width: 18px; height: 18px; accent-color: #3c90d6; }

        .dchat-invite-row {
            display: flex;
            gap: 8px;
            align-items: stretch;
            direction: ltr;
        }

        .dchat-invite-row .dchat-group-input {
            direction: ltr;
            text-align: left;
            flex: 1;
            min-width: 0;
            font-family: Arial, sans-serif;
            font-size: 12px;
        }

        .dchat-group-btn {
            border: 0;
            border-radius: 13px;
            background: rgba(60, 144, 214, .12);
            color: #2477b8;
            font-family: var(--dchat-font);
            font-size: 12px;
            font-weight: 800;
            cursor: pointer;
            padding: 10px 12px;
            white-space: nowrap;
        }

        .dchat-group-btn:hover { background: rgba(60, 144, 214, .18); }
        .dchat-group-btn.danger { background: rgba(255, 82, 82, .10); color: #D92D20; }
        .dchat-group-btn.primary { background: #3c90d6; color: #fff; }

        .dchat-group-actions { display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; }

        @media (max-width: 640px) {
            .dchat-profile-drawer { width: 100vw; }
            .dchat-profile-overlay { background: #fcfdfd; }
            .dchat-profile-avatar-lg { width: 104px; height: 104px; }
            .dchat-profile-media-grid { gap: 4px; }
        }


        .dchat-progress-btn.is-active > span,
        .dchat-progress-btn.is-cancel > span,
        .dchat-gif-remove,
        .dchat-saved-media-remove {
            font-family: Arial, sans-serif !important;
            font-weight: 700 !important;
        }

        .dchat-gif-remove { font-size: 17px !important; }
        .dchat-saved-media-remove { font-size: 18px !important; }



        /* Compact Telegram-like reply and external link preview */
        .KTwPFW,
        .KTwPFW .p {
            max-width: 100%;
            min-width: 0;
            overflow-wrap: anywhere;
        }

        .dchat-reply-quote {
            display: inline-flex !important;
            flex-direction: column;
            align-items: stretch;
            width: auto !important;
            min-width: 92px !important;
            max-width: min(176px, 46vw) !important;
            box-sizing: border-box;
            padding: 4px 7px !important;
            margin: 0 0 3px 0 !important;
            border-radius: 8px !important;
            border-inline-start: 3px solid #3c90d6 !important;
            background: rgba(60,144,214,.075) !important;
            color: #091E42;
            cursor: pointer;
            overflow: hidden !important;
            vertical-align: top;
            line-height: 1.2 !important;
            white-space: normal !important;
            flex: 0 1 auto !important;
        }

        .dchat-reply-break,
        .KTwPFW .dchat-reply-quote + br.dchat-reply-break {
            display: block !important;
            line-height: 0 !important;
            height: 0 !important;
            margin: 0 !important;
            padding: 0 !important;
        }

        .KTwPFW .dchat-reply-quote + br:not(.dchat-reply-break) { display: none; }

        .dchat-reply-quote-title,
        .dchat-reply-quote-text {
            display: block;
            margin: 0 !important;
            padding: 0 !important;
            max-width: 100% !important;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            direction: rtl;
        }

        .dchat-reply-quote-title {
            color: #3c90d6;
            font-size: 10.5px !important;
            font-weight: 800;
            line-height: 1.18 !important;
        }

        .dchat-reply-quote-text {
            color: rgba(9,30,66,.68);
            font-size: 10px !important;
            line-height: 1.18 !important;
            margin-top: 1px !important;
        }

        .dchat-reply-bar {
            max-width: min(460px, calc(100vw - 28px));
            align-self: center;
        }

        .dchat-link-preview-break { display: block; }

        .dchat-link-preview {
            display: block;
            max-width: min(310px, 66vw);
            margin-top: 6px;
            direction: rtl;
            font-family: var(--dchat-font);
        }

        .dchat-link-preview-card {
            display: flex;
            align-items: stretch;
            gap: 9px;
            width: 100%;
            min-width: 0;
            box-sizing: border-box;
            text-decoration: none !important;
            color: inherit !important;
            background: rgba(9,30,66,.045);
            border: 1px solid rgba(9,30,66,.075);
            border-inline-start: 3px solid #3c90d6;
            border-radius: 12px;
            padding: 7px;
            overflow: hidden;
        }

        .dchat-link-preview-thumb {
            flex: 0 0 72px;
            width: 72px;
            height: 72px;
            border-radius: 10px;
            background: rgba(9,30,66,.08);
            overflow: hidden;
            order: 2;
        }

        .dchat-link-preview-thumb img {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
        }

        .dchat-link-preview-body {
            flex: 1 1 auto;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 2px;
            text-align: right;
            order: 1;
        }

        .dchat-link-preview-site,
        .dchat-link-preview-title,
        .dchat-link-preview-desc,
        .dchat-link-preview-url {
            display: block;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            max-width: 100%;
        }

        .dchat-link-preview-site {
            color: #3c90d6;
            font-size: 10.5px;
            font-weight: 800;
        }

        .dchat-link-preview-title {
            color: #091E42;
            font-size: 12.5px;
            font-weight: 800;
            line-height: 1.35;
        }

        .dchat-link-preview-desc {
            color: rgba(9,30,66,.68);
            font-size: 11px;
            line-height: 1.35;
            white-space: normal;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }

        .dchat-link-preview-url {
            color: rgba(9,30,66,.52);
            font-size: 10px;
            direction: ltr;
            text-align: left;
            margin-top: 1px;
        }

        @media (max-width: 640px) {
            .dchat-reply-quote {
                max-width: min(158px, 44vw) !important;
                min-width: 84px !important;
                padding: 4px 6px !important;
            }
            .dchat-link-preview { max-width: min(280px, 72vw); }
            .dchat-link-preview-card { gap: 7px; padding: 6px; border-radius: 11px; }
            .dchat-link-preview-thumb { flex-basis: 58px; width: 58px; height: 58px; }
        }

        /* Telegram-style reply preview: selected reply above input + embedded replied message */
        .dchat-reply-bar {
            position: relative !important;
            display: none !important;
            align-items: center;
            gap: 9px;
            width: calc(100% - 24px);
            max-width: min(620px, calc(100vw - 24px)) !important;
            align-self: center;
            margin: 0 auto 8px auto !important;
            padding: 9px 14px 9px 10px !important;
            border: 1px solid rgba(60,144,214,.18) !important;
            border-radius: 18px !important;
            border-inline-start: 0 !important;
            background: rgba(255,255,255,.94) !important;
            box-shadow: 0 10px 28px rgba(9,30,66,.10) !important;
            color: #091E42;
            direction: rtl;
            overflow: hidden;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
        }

        .dchat-reply-bar.is-visible {
            display: flex !important;
            animation: dchatReplyBarIn .16s ease-out;
        }

        @keyframes dchatReplyBarIn {
            from { opacity: 0; transform: translateY(8px) scale(.985); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        .dchat-reply-accent {
            position: absolute;
            inset-block: 10px;
            inset-inline-start: 10px;
            width: 5px;
            border-radius: 999px;
            background: linear-gradient(180deg, #3c90d6 0%, #1f78c8 100%);
            box-shadow: 0 0 0 5px rgba(60,144,214,.10);
        }

        .dchat-reply-icon {
            flex: 0 0 39px;
            width: 39px;
            height: 39px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 999px;
            background: rgba(60,144,214,.12);
            color: #3c90d6;
            font-size: 19px;
            font-weight: 900;
            margin-inline-start: 12px;
            box-shadow: inset 0 0 0 1px rgba(60,144,214,.12);
        }

        .dchat-reply-content {
            flex: 1 1 auto;
            min-width: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 3px;
            padding-inline-end: 6px;
        }

        .dchat-reply-close {
            position: static !important;
            transform: none !important;
            flex: 0 0 36px;
            width: 36px !important;
            height: 36px !important;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 999px !important;
            border: 0 !important;
            background: rgba(9,30,66,.06) !important;
            color: #5E6C84 !important;
            font-size: 22px;
            line-height: 1 !important;
            cursor: pointer;
            transition: background .15s ease, color .15s ease, transform .15s ease;
        }

        .dchat-reply-close:hover {
            background: rgba(9,30,66,.12) !important;
            color: #091E42 !important;
            transform: scale(1.04) !important;
        }

        .dchat-reply-title {
            margin: 0 !important;
            color: #3c90d6 !important;
            font-size: 13px !important;
            line-height: 1.35 !important;
            font-weight: 900 !important;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .dchat-reply-text {
            margin: 0 !important;
            color: rgba(9,30,66,.70) !important;
            font-size: 12.5px !important;
            line-height: 1.45 !important;
            font-weight: 600 !important;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .KTwPFW .dchat-reply-quote {
            position: relative !important;
            display: inline-flex !important;
            flex-direction: column !important;
            align-items: stretch !important;
            gap: 1px;
            width: auto !important;
            min-width: 128px !important;
            max-width: min(278px, 68vw) !important;
            box-sizing: border-box !important;
            padding: 6px 11px 6px 10px !important;
            margin: 0 0 5px 0 !important;
            border: 0 !important;
            border-radius: 11px !important;
            background: rgba(60,144,214,.105) !important;
            box-shadow: inset 0 0 0 1px rgba(60,144,214,.13) !important;
            color: #091E42;
            cursor: pointer;
            overflow: hidden !important;
            vertical-align: top;
            line-height: 1.25 !important;
            white-space: normal !important;
            flex: 0 1 auto !important;
        }

        .KTwPFW .dchat-reply-quote::before {
            content: "";
            position: absolute;
            inset-block: 6px;
            inset-inline-start: 0;
            width: 4px;
            border-radius: 999px;
            background: #3c90d6;
        }

        .message-item.LtdUd1 .KTwPFW .dchat-reply-quote {
            background: rgba(255,255,255,.42) !important;
            box-shadow: inset 0 0 0 1px rgba(60,144,214,.18) !important;
        }

        .KTwPFW .dchat-reply-quote:hover {
            background: rgba(60,144,214,.15) !important;
        }

        .KTwPFW .dchat-reply-quote-title,
        .KTwPFW .dchat-reply-quote-text {
            display: block !important;
            margin: 0 !important;
            padding: 0 !important;
            max-width: 100% !important;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            direction: rtl;
        }

        .KTwPFW .dchat-reply-quote-title {
            color: #3c90d6 !important;
            font-size: 11px !important;
            font-weight: 900 !important;
            line-height: 1.28 !important;
        }

        .KTwPFW .dchat-reply-quote-text {
            color: rgba(9,30,66,.70) !important;
            font-size: 10.7px !important;
            font-weight: 500;
            line-height: 1.28 !important;
            margin-top: 1px !important;
        }

        @media (max-width: 640px) {
            .dchat-reply-bar {
                width: calc(100% - 16px);
                max-width: calc(100vw - 16px) !important;
                margin-bottom: 6px !important;
                padding: 8px 12px 8px 8px !important;
                border-radius: 16px !important;
            }
            .dchat-reply-icon {
                flex-basis: 29px;
                width: 29px;
                height: 29px;
                margin-inline-start: 8px;
            }
            .KTwPFW .dchat-reply-quote {
                min-width: 112px !important;
                max-width: min(236px, 70vw) !important;
                padding: 5px 10px 5px 9px !important;
                border-radius: 10px !important;
            }
        }



        /* Final Telegram-like reply fixes: full-width input preview + block quote above message */
        #dchat-reply-bar.dchat-reply-bar {
            width: 100% !important;
            min-width: 100% !important;
            max-width: 100% !important;
            flex-shrink: 0 !important;
            margin: 0 0 10px 0 !important;
            align-self: stretch !important;
            box-sizing: border-box !important;
            padding: 12px 14px 12px 12px !important;
            min-height: 66px !important;
            border-radius: 18px !important;
            background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(247,250,255,.96) 100%) !important;
            box-shadow: 0 14px 34px rgba(9,30,66,.10), inset 0 0 0 1px rgba(60,144,214,.10) !important;
            gap: 10px !important;
            overflow: hidden !important;
        }

        #dchat-reply-bar.dchat-reply-bar.is-visible { display: flex !important; }

        .KTwPFW .p,
        .KTwPFW .dchat-message-content {
            display: block !important;
            width: 100%;
            max-width: 100%;
            min-width: 0;
        }

        .KTwPFW .dchat-reply-quote {
            position: relative !important;
            display: flex !important;
            flex-direction: column !important;
            align-items: stretch !important;
            clear: both !important;
            float: none !important;
            width: 100% !important;
            min-width: 0 !important;
            max-width: min(320px, 100%) !important;
            box-sizing: border-box !important;
            margin: 0 0 7px 0 !important;
            padding: 7px 12px 7px 10px !important;
            border: 0 !important;
            border-radius: 12px !important;
            background: rgba(60,144,214,.105) !important;
            box-shadow: inset 0 0 0 1px rgba(60,144,214,.14) !important;
            vertical-align: top !important;
            white-space: normal !important;
            overflow: hidden !important;
        }

        .KTwPFW .dchat-reply-quote + br,
        .KTwPFW .dchat-reply-break { display: none !important; }

        .KTwPFW .dchat-reply-quote-title,
        .KTwPFW .dchat-reply-quote-text {
            display: block !important;
            width: 100% !important;
            max-width: 100% !important;
            margin: 0 !important;
            padding: 0 !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            white-space: nowrap !important;
        }

        @media (max-width: 640px) {
            #dchat-reply-bar.dchat-reply-bar {
                width: 100% !important;
                min-width: 100% !important;
                max-width: 100% !important;
                margin-inline: 0 !important;
                padding: 11px 12px 11px 10px !important;
                min-height: 62px !important;
                border-radius: 16px !important;
            }
            .KTwPFW .dchat-reply-quote {
                max-width: 100% !important;
                padding: 6px 10px !important;
            }
        }

        .dchat-mention-link,
        .dchat-url-link {
            color: #2f80d7 !important;
            font-weight: 700;
            text-decoration: none !important;
            direction: ltr;
            unicode-bidi: plaintext;
        }
        .dchat-mention-link:hover,
        .dchat-url-link:hover { text-decoration: underline !important; }
        .dchat-join-room-button {
            border: 0;
            outline: 0;
            min-width: 180px;
            height: 44px;
            padding: 0 22px;
            border-radius: 999px;
            background: #3c90d6;
            color: #fff;
            font-family: var(--dchat-font);
            font-size: 14px;
            font-weight: 800;
            cursor: pointer;
            box-shadow: 0 10px 24px rgba(60,144,214,.22);
        }
        .dchat-join-room-button:disabled { opacity: .65; cursor: default; }
        .dchat-send-locked-text {
            width: 100%;
            max-width: 520px;
            border-radius: 18px;
            padding: 12px 16px;
            background: rgba(9, 30, 66, .06);
            color: rgba(9, 30, 66, .68);
            font-family: var(--dchat-font);
            font-size: 13px;
            text-align: center;
            direction: rtl;
        }

        .dchat-saved-avatar-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            color: #3c90d6;
        }
        .dchat-saved-avatar-icon svg {
            width: 56%;
            height: 56%;
            display: block;
        }

/* ===== DChat mobile composer and no-white-scroll fixes ===== */
html,
body,
#root,
.SyM7vJ,
.K4prvv,
#app_main_wrapper {
    height: 100%;
    max-height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none;
}

#main-section {
    min-height: 0;
    overflow: hidden !important;
}

.JL_RzJ {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

#message_list_scroller_id {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#chat_footer,
#dchat_join_footer,
#dchat_locked_footer {
    flex: 0 0 auto;
    z-index: 25;
    background: var(--color-neutrals-n-00, #fcfdfd);
    transform: translateZ(0);
}

#chat_footer .wARcwd,
#chat_footer .wARcwd.nWw2Ql {
    overflow: visible !important;
    max-height: none !important;
    flex: 0 0 auto;
    transform: translateZ(0);
}

.dchat-faq-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    text-align: right;
    direction: rtl;
}

.dchat-faq-item {
    border: 1px solid rgba(60,144,214,.14);
    border-radius: 14px;
    background: rgba(60,144,214,.045);
    overflow: hidden;
}

.dchat-faq-item summary {
    cursor: pointer;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 800;
    color: #091E42;
    list-style: none;
}

.dchat-faq-item summary::-webkit-details-marker {
    display: none;
}

.dchat-faq-item div {
    padding: 0 14px 13px;
    color: rgba(9,30,66,.68);
    font-size: 12px;
    line-height: 1.9;
}

.dchat-faq-empty {
    padding: 14px;
    border-radius: 14px;
    background: rgba(9,30,66,.04);
    color: rgba(9,30,66,.62);
    font-size: 13px;
}

@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        height: 100dvh;
        height: calc(var(--vh, 1vh) * 100);
        max-height: 100dvh;
        max-height: calc(var(--vh, 1vh) * 100);
        position: fixed;
        inset: 0;
        overflow: hidden !important;
        touch-action: manipulation;
    }

    #root,
    .SyM7vJ,
    .K4prvv,
    #app_main_wrapper,
    #main-section {
        width: 100vw;
        height: 100dvh;
        height: calc(var(--vh, 1vh) * 100);
        max-height: 100dvh;
        max-height: calc(var(--vh, 1vh) * 100);
        overflow: hidden !important;
    }

    #main-section {
        display: flex !important;
        flex-direction: column;
    }

    #main-section > .kvGVCY,
    #dchat-chat-search-panel,
    #dchat-reply-bar,
    #dchat-block-notice,
    #chat_footer,
    #dchat_join_footer,
    #dchat_locked_footer {
        flex: 0 0 auto;
    }

    .JL_RzJ {
        flex: 1 1 auto;
        min-height: 0;
        height: auto !important;
        overflow: hidden !important;
    }

    #message_list_scroller_id {
        min-height: 0;
        padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
        background-clip: padding-box;
    }

    #chat_footer {
        position: sticky;
        bottom: 0;
        inset-inline: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    #chat_footer .wARcwd.nWw2Ql {
        min-height: 58px;
        max-height: 45vh !important;
        overflow: visible !important;
    }

    html.dchat-mobile-room-list-open #sidebar_wrapper {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        max-width: none !important;
        height: 100dvh !important;
        height: calc(var(--vh, 1vh) * 100) !important;
        z-index: 9000 !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
    }

    html.dchat-mobile-room-list-open #main_navigation_wrapper {
        display: flex !important;
        z-index: 9001 !important;
    }

    html.dchat-mobile-room-list-open #main-section,
    html.dchat-mobile-room-list-open .YuEQkT {
        display: none !important;
    }
}


/* ===== DChat chat background pattern + auth mobile fixes ===== */
#message_list_scroller_id {
    background-color: #eef5fb !important;
    background-image:
        linear-gradient(rgba(238,245,251,.84), rgba(238,245,251,.84)),
        url("/static/backgrounds/new-pattern-6.png") !important;
    background-repeat: repeat !important;
    background-size: auto, 360px auto !important;
    background-position: center !important;
}
html.dchat-dark #message_list_scroller_id {
    background-color: #0f172a !important;
    background-image:
        linear-gradient(rgba(15,23,42,.88), rgba(15,23,42,.88)),
        url("/static/backgrounds/new-pattern-6.png") !important;
}

.dchat-auth-body {
    min-height: 100dvh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    background: var(--color-neutrals-n-00, #fcfdfd);
}
.dchat-auth-body #root,
.dchat-auth-body .Gy0oqD {
    min-height: 100dvh;
    height: auto !important;
    overflow: visible !important;
}
.dchat-auth-body .Gy0oqD.dchat-auth-page {
    margin-top: 0 !important;
    padding: max(20px, env(safe-area-inset-top, 0px)) 14px max(24px, env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: center;
}
.dchat-auth-body .cTIKE6 {
    width: 100%;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
}
.dchat-auth-body .GbmG2D,
.dchat-auth-body .iC4wP2,
.dchat-auth-body .oS1ItX,
.dchat-auth-body .tv420R {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}
.dchat-auth-body .iC4wP2,
.dchat-auth-body .tv420R {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}
.dchat-auth-body .YSu_bq,
.dchat-auth-body .VAfYXF {
    max-width: 100%;
}
.dchat-auth-body .EsJPBs {
    line-height: 1.8;
}
@media (max-width: 480px), (max-height: 720px) {
    .dchat-auth-body .Gy0oqD.dchat-auth-page {
        align-items: flex-start;
        justify-content: flex-start;
        padding-top: 14px;
    }
    .dchat-auth-body .u0fjao {
        padding-top: 8px !important;
    }
    .dchat-auth-body .wjg7DG[style*="margin-bottom: 2rem"] {
        margin-bottom: 1rem !important;
    }
    .dchat-auth-body .GAx5un {
        font-size: 18px !important;
    }
    .dchat-auth-body .YSu_bq {
        min-width: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    #main-section { height: 100dvh !important; height: calc(var(--vh, 1vh) * 100) !important; }
    .JL_RzJ { min-height: 0 !important; }
    #chat_footer {
        position: relative !important;
        flex-shrink: 0 !important;
        bottom: auto !important;
        overflow: visible !important;
    }
    #chat_footer .wARcwd.nWw2Ql {
        min-height: 58px;
        overflow: visible !important;
        overscroll-behavior: none;
    }
    #message_list_scroller_id {
        overscroll-behavior-y: contain !important;
    }
}

@media (max-width: 768px) {
    html.dchat-auth-html,
    html.dchat-auth-html body.dchat-auth-body {
        position: static !important;
        inset: auto !important;
        height: auto !important;
        min-height: 100dvh !important;
        max-height: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        touch-action: auto !important;
    }
}

/* ===== DChat v3: stronger chat pattern, search-panel pattern, swipe reply ===== */
#message_list_scroller_id {
    background-color: #e8f2fb !important;
    background-image:
        linear-gradient(rgba(232, 242, 251, .56), rgba(232, 242, 251, .56)),
        url("/static/backgrounds/new-pattern-6.png") !important;
    background-repeat: repeat !important;
    background-size: auto, 320px auto !important;
    background-position: center !important;
}

#dchat-chat-search-panel,
.dchat-chat-search-panel {
    background-color: #e8f2fb !important;
    background-image:
        linear-gradient(rgba(232, 242, 251, .62), rgba(232, 242, 251, .62)),
        url("/static/backgrounds/new-pattern-6.png") !important;
    background-repeat: repeat !important;
    background-size: auto, 320px auto !important;
    background-position: center !important;
}

html.dchat-dark #message_list_scroller_id {
    background-color: #0b1220 !important;
    background-image:
        linear-gradient(rgba(11, 18, 32, .54), rgba(11, 18, 32, .54)),
        url("/static/backgrounds/new-pattern-6.png") !important;
    background-repeat: repeat !important;
    background-size: auto, 320px auto !important;
    background-position: center !important;
}

html.dchat-dark #dchat-chat-search-panel,
html.dchat-dark .dchat-chat-search-panel {
    background-color: #0b1220 !important;
    background-image:
        linear-gradient(rgba(11, 18, 32, .58), rgba(11, 18, 32, .58)),
        url("/static/backgrounds/new-pattern-6.png") !important;
    background-repeat: repeat !important;
    background-size: auto, 320px auto !important;
    background-position: center !important;
}

.message-item {
    transition: transform .16s ease, filter .16s ease;
}

.message-item.dchat-swipe-reply-active {
    transform: translateX(22px);
    filter: brightness(1.03);
}

.message-item.dchat-swipe-reply-active .Wdw5cr {
    box-shadow: 0 0 0 2px rgba(60, 144, 214, .30), 0 8px 22px rgba(60, 144, 214, .14) !important;
}

.dchat-message-menu button[data-action="copy"] .dchat-menu-icon {
    background: rgba(57, 204, 200, .12);
    box-shadow: inset 0 0 0 1px rgba(57, 204, 200, .16);
    color: #159b98;
}

html.dchat-dark .dchat-message-menu button[data-action="copy"] .dchat-menu-icon {
    background: rgba(45, 212, 191, .13) !important;
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .18) !important;
    color: #99f6e4 !important;
}

/* ===== DChat message edit UI ===== */
.dchat-edited-label {
    color: rgba(9, 30, 66, .45);
    font-size: 10.5px;
    line-height: 1;
    white-space: nowrap;
}
html.dchat-dark .dchat-edited-label,
body.dchat-dark .dchat-edited-label {
    color: rgba(226, 232, 240, .58);
}
.dchat-edit-message-modal {
    width: min(100%, 460px);
    direction: rtl;
}
.dchat-edit-message-textarea {
    width: 100%;
    min-height: 140px;
    max-height: 45vh;
    resize: vertical;
    border: 1px solid rgba(60, 144, 214, .22);
    border-radius: 16px;
    padding: 12px 14px;
    outline: none;
    background: rgba(255, 255, 255, .86);
    color: #091e42;
    font-family: var(--dchat-font, Tahoma, sans-serif);
    font-size: 14px;
    line-height: 1.9;
}
.dchat-edit-message-textarea:focus {
    border-color: rgba(60, 144, 214, .58);
    box-shadow: 0 0 0 4px rgba(60, 144, 214, .12);
}
html.dchat-dark .dchat-edit-message-textarea,
body.dchat-dark .dchat-edit-message-textarea {
    background: rgba(15, 23, 42, .82);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, .24);
}
.dchat-message-menu button[data-action="edit"] .dchat-menu-icon {
    background: rgba(60,144,214,.12);
    color: #3c90d6;
}
html.dchat-dark .dchat-message-menu button[data-action="edit"] .dchat-menu-icon,
body.dchat-dark .dchat-message-menu button[data-action="edit"] .dchat-menu-icon {
    background: rgba(96,165,250,.18);
    color: #93c5fd;
}

/* ===== DChat v5: E2EE message UI ===== */
.dchat-e2ee-placeholder,
.dchat-e2ee-error {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(60,144,214,.08);
  color: rgba(9,30,66,.72);
  font-size: 12px;
  line-height: 1.7;
}
.dchat-e2ee-error {
  background: rgba(231,76,60,.09);
  color: #b03a2e;
}
.dchat-e2ee-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  line-height: 1;
  color: rgba(60,144,214,.9);
  white-space: nowrap;
}
.message-item[data-e2ee-status="ok"] .Wdw5cr {
  box-shadow: 0 4px 18px rgba(57,204,200,.08);
}
html.dchat-dark .dchat-e2ee-placeholder,
body.dchat-dark .dchat-e2ee-placeholder {
  background: rgba(57,204,200,.10);
  color: rgba(231,255,255,.78);
}
html.dchat-dark .dchat-e2ee-error,
body.dchat-dark .dchat-e2ee-error {
  background: rgba(231,76,60,.16);
  color: #ffb6ad;
}
html.dchat-dark .dchat-e2ee-badge,
body.dchat-dark .dchat-e2ee-badge {
  color: #7ef3ee;
}

/* ===== DChat v6 fixes: clean search bar, balanced chat pattern, viewer/profile icons, composer edit ===== */
#message_list_scroller_id {
    background-color: #edf5fc !important;
    background-image:
        linear-gradient(rgba(237, 245, 252, .78), rgba(237, 245, 252, .78)),
        url("/static/backgrounds/new-pattern-6.png") !important;
    background-repeat: repeat !important;
    background-size: auto, 340px auto !important;
    background-position: center !important;
}

html.dchat-dark #message_list_scroller_id {
    background-color: #07111f !important;
    background-image:
        linear-gradient(rgba(7, 17, 31, .38), rgba(7, 17, 31, .38)),
        url("/static/backgrounds/new-pattern-6.png") !important;
    background-repeat: repeat !important;
    background-size: auto, 320px auto !important;
    background-position: center !important;
}

#dchat-chat-search-panel,
.dchat-chat-search-panel,
html.dchat-dark #dchat-chat-search-panel,
html.dchat-dark .dchat-chat-search-panel {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    background: #fff !important;
    background-image: none !important;
    background-color: #fff !important;
    border-bottom: 1px solid rgba(9,30,66,.08) !important;
    box-shadow: 0 8px 22px rgba(9,30,66,.06) !important;
}

html.dchat-dark #dchat-chat-search-panel,
html.dchat-dark .dchat-chat-search-panel {
    background: #fff !important;
    background-image: none !important;
    background-color: #fff !important;
    border-bottom-color: rgba(9,30,66,.08) !important;
    box-shadow: 0 8px 22px rgba(9,30,66,.06) !important;
}

.dchat-chat-search-box {
    width: 100% !important;
}

#dchat-viewer-download.dchat-download-btn > span,
.dchat-viewer-bar .dchat-download-btn > span {
    width: 21px !important;
    height: 21px !important;
    font-size: 0 !important;
}

#dchat-viewer-download.dchat-download-btn > span::before,
.dchat-viewer-bar .dchat-download-btn > span::before {
    content: "" !important;
    width: 21px !important;
    height: 21px !important;
    display: block !important;
    background: currentColor !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 3.75v10.5m0 0 4.25-4.25M12 14.25 7.75 10M5 19.25h14' stroke='%23000' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat !important;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 3.75v10.5m0 0 4.25-4.25M12 14.25 7.75 10M5 19.25h14' stroke='%23000' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat !important;
}

#dchat-profile-more svg {
    width: 26px;
    height: 26px;
    display: block;
}

.dchat-editing-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    direction: rtl;
    background: rgba(252,253,253,.98);
    border-top: 1px solid rgba(60,144,214,.16);
    box-shadow: 0 -4px 16px rgba(9,30,66,.04);
    font-family: var(--dchat-font);
}

.dchat-editing-bar.is-visible {
    display: flex;
}

html.dchat-dark .dchat-editing-bar {
    background: rgba(17,24,39,.98);
    border-top-color: rgba(96,165,250,.22);
}

.dchat-editing-accent {
    width: 4px;
    align-self: stretch;
    min-height: 34px;
    border-radius: 999px;
    background: #3c90d6;
    flex: 0 0 auto;
}

.dchat-editing-icon {
    color: #3c90d6;
    font-size: 18px;
    line-height: 1;
    flex: 0 0 auto;
}

.dchat-editing-content {
    min-width: 0;
    flex: 1;
}

.dchat-editing-title {
    margin: 0;
    color: #3c90d6;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
}

.dchat-editing-text {
    margin: 0;
    color: rgba(9,30,66,.62);
    font-size: 12px;
    line-height: 1.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html.dchat-dark .dchat-editing-text {
    color: rgba(226,232,240,.68);
}

.dchat-editing-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: rgba(9,30,66,.06);
    color: #42526E;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

html.dchat-dark .dchat-editing-close {
    background: rgba(255,255,255,.08);
    color: #e5e7eb;
}

/* ===== DChat v7: stronger dark pattern, softer light pattern, verified badges, unified reply/edit bars ===== */
#message_list_scroller_id {
    background-color: #f4f9fd !important;
    background-image:
        linear-gradient(rgba(244, 249, 253, .94), rgba(244, 249, 253, .94)),
        url("/static/backgrounds/new-pattern-6.png") !important;
    background-repeat: repeat !important;
    background-size: auto, 360px auto !important;
    background-position: center !important;
}

html.dchat-dark #message_list_scroller_id,
body.dchat-dark #message_list_scroller_id {
    background-color: #06101d !important;
    background-image:
        linear-gradient(rgba(6, 16, 29, .08), rgba(6, 16, 29, .08)),
        url("/static/backgrounds/new-pattern-6.png") !important;
    background-repeat: repeat !important;
    background-size: auto, 300px auto !important;
    background-position: center !important;
}

.dchat-verified-badge {
    width: 18px;
    height: 18px;
    margin-inline-start: 5px;
    display: inline-flex;
    vertical-align: -4px;
    flex: 0 0 auto;
    position: relative;
    background: linear-gradient(180deg, #29b6ff 0%, #0095f6 52%, #0077d9 100%);
    clip-path: polygon(
        50% 0%, 58% 10%, 70% 6%, 76% 18%, 89% 18%, 90% 31%,
        100% 39%, 92% 50%, 100% 61%, 90% 69%, 89% 82%, 76% 82%,
        70% 94%, 58% 90%, 50% 100%, 42% 90%, 30% 94%, 24% 82%,
        11% 82%, 10% 69%, 0% 61%, 8% 50%, 0% 39%, 10% 31%,
        11% 18%, 24% 18%, 30% 6%, 42% 10%
    );
    filter: drop-shadow(0 2px 4px rgba(0,149,246,.28));
}
.dchat-verified-badge::before {
    content: "";
    position: absolute;
    inset: 2px;
    clip-path: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,.38), rgba(255,255,255,0) 48%);
    pointer-events: none;
}
.dchat-verified-badge::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 4.5px;
    left: 4.7px;
    top: 5.6px;
    border-inline-start: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    border-radius: 1px;
}
.dchat-verified-badge-inline {
    width: 15px;
    height: 15px;
    vertical-align: -3px;
    margin-inline-start: 4px;
}
.dchat-verified-badge-inline::after {
    width: 6.8px;
    height: 3.8px;
    left: 3.9px;
    top: 4.7px;
    border-inline-start-width: 1.8px;
    border-bottom-width: 1.8px;
}

.dchat-initial-avatar {
    color: #fff !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.dchat-initial-avatar .Tofrx1 { color: #fff !important; }

#dchat-reply-bar.dchat-reply-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    direction: rtl;
    background: rgba(252,253,253,.98);
    border-top: 1px solid rgba(60,144,214,.16);
    box-shadow: 0 -4px 16px rgba(9,30,66,.04);
    font-family: var(--dchat-font);
}
#dchat-reply-bar.dchat-reply-bar.is-visible { display: flex !important; }
#dchat-reply-bar .dchat-reply-accent {
    width: 4px;
    align-self: stretch;
    min-height: 34px;
    border-radius: 999px;
    background: #3c90d6;
    flex: 0 0 auto;
}
#dchat-reply-bar .dchat-reply-icon {
    color: #3c90d6;
    font-size: 18px;
    line-height: 1;
    flex: 0 0 auto;
}
#dchat-reply-bar .dchat-reply-content { min-width: 0; flex: 1; }
#dchat-reply-bar .dchat-reply-title {
    margin: 0;
    color: #3c90d6;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
}
#dchat-reply-bar .dchat-reply-text {
    margin: 0;
    color: rgba(9,30,66,.62);
    font-size: 12px;
    line-height: 1.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#dchat-reply-bar .dchat-reply-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: rgba(9,30,66,.06);
    color: #42526E;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
html.dchat-dark #dchat-reply-bar.dchat-reply-bar,
body.dchat-dark #dchat-reply-bar.dchat-reply-bar {
    background: rgba(17,24,39,.98);
    border-top-color: rgba(96,165,250,.22);
}
html.dchat-dark #dchat-reply-bar .dchat-reply-text,
body.dchat-dark #dchat-reply-bar .dchat-reply-text {
    color: rgba(226,232,240,.68);
}
html.dchat-dark #dchat-reply-bar .dchat-reply-close,
body.dchat-dark #dchat-reply-bar .dchat-reply-close {
    background: rgba(255,255,255,.08);
    color: #e5e7eb;
}


/* ===== DChat v8: make reply bar use the exact edit-bar visual system ===== */
#dchat-reply-bar.dchat-editing-bar {
    display: none !important;
}
#dchat-reply-bar.dchat-editing-bar.is-visible {
    display: flex !important;
}
#dchat-reply-bar .dchat-reply-accent,
#dchat-reply-bar .dchat-reply-icon,
#dchat-reply-bar .dchat-reply-content,
#dchat-reply-bar .dchat-reply-title,
#dchat-reply-bar .dchat-reply-text,
#dchat-reply-bar .dchat-reply-close {
    all: unset;
}
#dchat-reply-bar .dchat-reply-accent.dchat-editing-accent {
    width: 4px;
    align-self: stretch;
    min-height: 34px;
    border-radius: 999px;
    background: #3c90d6;
    flex: 0 0 auto;
}
#dchat-reply-bar .dchat-reply-icon.dchat-editing-icon {
    color: #3c90d6;
    font-size: 18px;
    line-height: 1;
    flex: 0 0 auto;
}
#dchat-reply-bar .dchat-reply-content.dchat-editing-content {
    min-width: 0;
    flex: 1;
    display: block;
}
#dchat-reply-bar .dchat-reply-title.dchat-editing-title {
    display: block;
    margin: 0;
    color: #3c90d6;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
}
#dchat-reply-bar .dchat-reply-text.dchat-editing-text {
    display: block;
    margin: 0;
    color: rgba(9,30,66,.62);
    font-size: 12px;
    line-height: 1.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#dchat-reply-bar .dchat-reply-close.dchat-editing-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: rgba(9,30,66,.06);
    color: #42526E;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
html.dchat-dark #dchat-reply-bar .dchat-reply-text.dchat-editing-text,
body.dchat-dark #dchat-reply-bar .dchat-reply-text.dchat-editing-text {
    color: rgba(226,232,240,.68);
}
html.dchat-dark #dchat-reply-bar .dchat-reply-close.dchat-editing-close,
body.dchat-dark #dchat-reply-bar .dchat-reply-close.dchat-editing-close {
    background: rgba(255,255,255,.08);
    color: #e5e7eb;
}

/* ===== DChat v9: exact edit-bar styling for reply bar + verified icon SVG + visible dark moon ===== */
#dchat-reply-bar.dchat-reply-bar.dchat-editing-bar,
#dchat-reply-bar.dchat-editing-bar,
html.dchat-dark #dchat-reply-bar.dchat-reply-bar.dchat-editing-bar,
body.dchat-dark #dchat-reply-bar.dchat-reply-bar.dchat-editing-bar {
    display: none !important;
    align-items: center !important;
    gap: 10px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    align-self: stretch !important;
    flex-shrink: 0 !important;
    position: relative !important;
    inset: auto !important;
    margin: 0 !important;
    padding: 9px 14px !important;
    direction: rtl !important;
    border: 0 !important;
    border-radius: 0 !important;
    border-top: 1px solid rgba(60,144,214,.16) !important;
    border-inline-start: 0 !important;
    background: rgba(252,253,253,.98) !important;
    background-image: none !important;
    box-shadow: 0 -4px 16px rgba(9,30,66,.04) !important;
    color: inherit !important;
    font-family: var(--dchat-font) !important;
    overflow: visible !important;
    transform: none !important;
    animation: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-sizing: border-box !important;
}
#dchat-reply-bar.dchat-reply-bar.dchat-editing-bar.is-visible,
#dchat-reply-bar.dchat-editing-bar.is-visible {
    display: flex !important;
}
html.dchat-dark #dchat-reply-bar.dchat-reply-bar.dchat-editing-bar,
body.dchat-dark #dchat-reply-bar.dchat-reply-bar.dchat-editing-bar {
    background: rgba(17,24,39,.98) !important;
    background-image: none !important;
    border-top-color: rgba(96,165,250,.22) !important;
}
#dchat-reply-bar.dchat-editing-bar .dchat-reply-accent.dchat-editing-accent {
    all: unset !important;
    width: 4px !important;
    align-self: stretch !important;
    min-height: 34px !important;
    border-radius: 999px !important;
    background: #3c90d6 !important;
    flex: 0 0 auto !important;
    display: block !important;
    position: static !important;
    inset: auto !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}
#dchat-reply-bar.dchat-editing-bar .dchat-reply-icon.dchat-editing-icon {
    all: unset !important;
    color: #3c90d6 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    flex: 0 0 auto !important;
    display: inline-block !important;
    position: static !important;
    box-sizing: border-box !important;
}
#dchat-reply-bar.dchat-editing-bar .dchat-reply-content.dchat-editing-content {
    all: unset !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    display: block !important;
    box-sizing: border-box !important;
}
#dchat-reply-bar.dchat-editing-bar .dchat-reply-title.dchat-editing-title {
    all: unset !important;
    display: block !important;
    margin: 0 !important;
    color: #3c90d6 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.6 !important;
    font-family: var(--dchat-font) !important;
    box-sizing: border-box !important;
}
#dchat-reply-bar.dchat-editing-bar .dchat-reply-text.dchat-editing-text {
    all: unset !important;
    display: block !important;
    margin: 0 !important;
    color: rgba(9,30,66,.62) !important;
    font-size: 12px !important;
    line-height: 1.7 !important;
    font-family: var(--dchat-font) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
}
#dchat-reply-bar.dchat-editing-bar .dchat-reply-close.dchat-editing-close {
    all: unset !important;
    width: 30px !important;
    height: 30px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(9,30,66,.06) !important;
    color: #42526E !important;
    cursor: pointer !important;
    font-size: 20px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    position: static !important;
    transform: none !important;
    box-sizing: border-box !important;
}
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-text.dchat-editing-text,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-text.dchat-editing-text {
    color: rgba(226,232,240,.68) !important;
}
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-close.dchat-editing-close,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-close.dchat-editing-close {
    background: rgba(255,255,255,.08) !important;
    color: #e5e7eb !important;
}

.dchat-verified-badge,
.dchat-verified-badge-inline {
    display: inline-block !important;
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    min-height: 15px !important;
    margin-inline-start: 6px !important;
    vertical-align: -2.5px !important;
    flex: 0 0 auto !important;
    background-color: transparent !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256' viewBox='0 0 256 256'%3E%3Cg transform='translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)'%3E%3Cpolygon points='45,6.18 57.06,0 64.41,11.38 77.94,12.06 78.62,25.59 90,32.94 83.82,45 90,57.06 78.62,64.41 77.94,77.94 64.41,78.62 57.06,90 45,83.82 32.94,90 25.59,78.62 12.06,77.94 11.38,64.41 0,57.06 6.18,45 0,32.94 11.38,25.59 12.06,12.06 25.59,11.38 32.94,0' fill='rgb(0,150,241)'/%3E%3Cpolygon points='40.16,58.47 26.24,45.08 29.7,41.48 40.15,51.52 61.22,31.08 64.7,34.67' fill='rgb(255,255,255)'/%3E%3C/g%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    clip-path: none !important;
    filter: drop-shadow(0 1px 2px rgba(0,150,241,.26)) !important;
    position: relative !important;
}
.dchat-verified-badge::before,
.dchat-verified-badge::after,
.dchat-verified-badge-inline::before,
.dchat-verified-badge-inline::after {
    content: none !important;
    display: none !important;
}
.nMlHDG .dchat-verified-badge,
.dchat-profile-name .dchat-verified-badge {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    vertical-align: -2px !important;
    margin-inline-start: 7px !important;
}
.HMaaOP .dchat-verified-badge,
.oUKPfP .dchat-verified-badge,
.dchat-profile-member-name .dchat-verified-badge {
    width: 13px !important;
    height: 13px !important;
    min-width: 13px !important;
    min-height: 13px !important;
    vertical-align: -2px !important;
    margin-inline-start: 5px !important;
}

html.dchat-dark .dchat-theme-toggle .dchat-theme-knob {
    background: #f8fbff !important;
    color: #0f172a !important;
}
html.dchat-dark .dchat-theme-toggle .dchat-theme-moon,
html.dchat-dark .dchat-theme-toggle .dchat-theme-moon path {
    color: #0f172a !important;
    fill: #0f172a !important;
    opacity: 1 !important;
}
html.dchat-dark .dchat-theme-toggle .dchat-theme-sun,
html.dchat-dark .dchat-theme-toggle .dchat-theme-sun path,
html.dchat-dark .dchat-theme-toggle .dchat-theme-sun circle {
    opacity: 0 !important;
}

/* v11: consistent colored fallback avatars everywhere */
.dchat-member-avatar.dchat-initial-avatar,
.dchat-profile-member-avatar.dchat-initial-avatar,
.dchat-profile-avatar-lg.dchat-initial-avatar,
.N5ck6R.dchat-initial-avatar {
    color: #fff !important;
    background: var(--color-alternative-a-02);
}
.dchat-member-avatar.has-image,
.dchat-member-avatar.has-image img {
    overflow: hidden;
}
.dchat-member-avatar.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.dchat-member-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-weight: 800;
    color: #fff;
}

/* ===== DChat mobile room list reliability fix ===== */
@media (max-width: 768px) {
    html.dchat-mobile-room-list-open,
    html.dchat-mobile-room-list-open body {
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
    }

    html.dchat-mobile-room-list-open #app_main_wrapper {
        display: block !important;
        width: 100vw !important;
        height: 100dvh !important;
        height: calc(var(--vh, 1vh) * 100) !important;
        overflow: hidden !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
    }

    html.dchat-mobile-room-list-open #sidebar_wrapper {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        inset: 0 0 calc(56px + env(safe-area-inset-bottom, 0px)) 0 !important;
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        z-index: 9000 !important;
        overflow: hidden !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
        border: 0 !important;
    }

    html.dchat-mobile-room-list-open #sidebar_wrapper > .taDlgO {
        flex: 0 0 56px !important;
        height: 56px !important;
        min-height: 56px !important;
    }

    html.dchat-mobile-room-list-open #dchat-sidebar-scroller {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
        padding-bottom: 12px !important;
    }

    html.dchat-mobile-room-list-open #dchat-item-list {
        min-height: 160px !important;
    }

    html.dchat-mobile-room-list-open #main_navigation_wrapper {
        display: flex !important;
        position: fixed !important;
        inset: auto 0 0 0 !important;
        width: 100vw !important;
        height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        z-index: 9001 !important;
        background: var(--color-neutrals-n-10, #f6f8fb) !important;
        border-radius: 10px 10px 0 0 !important;
    }

    html.dchat-mobile-room-list-open #main-section,
    html.dchat-mobile-room-list-open .YuEQkT {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}


/* ===== DChat mobile /chat room-list direct-load fix ===== */
@media (max-width: 768px) {
    #root.dchat-room-list-page,
    #root.dchat-room-list-page .SyM7vJ,
    #root.dchat-room-list-page .K4prvv,
    #root.dchat-room-list-page #app_main_wrapper {
        display: block !important;
        width: 100vw !important;
        height: 100dvh !important;
        height: calc(var(--vh, 1vh) * 100) !important;
        max-height: 100dvh !important;
        max-height: calc(var(--vh, 1vh) * 100) !important;
        overflow: hidden !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
    }

    #root.dchat-room-list-page #main_navigation_wrapper {
        display: flex !important;
        position: fixed !important;
        inset: auto 0 0 0 !important;
        width: 100vw !important;
        height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        z-index: 9001 !important;
        background: var(--color-neutrals-n-10, #f6f8fb) !important;
        border-radius: 10px 10px 0 0 !important;
        box-shadow: 0 -8px 24px rgba(9, 30, 66, .08) !important;
    }

    #root.dchat-room-list-page #sidebar_wrapper {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        inset: 0 0 calc(56px + env(safe-area-inset-bottom, 0px)) 0 !important;
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        z-index: 9000 !important;
        overflow: hidden !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
        border: 0 !important;
        pointer-events: auto !important;
    }

    #root.dchat-room-list-page #sidebar_wrapper > .taDlgO {
        flex: 0 0 56px !important;
        height: 56px !important;
        min-height: 56px !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
    }

    #root.dchat-room-list-page #sidebar_wrapper > div:not(.taDlgO) {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
    }

    #root.dchat-room-list-page .jNceb7,
    #root.dchat-room-list-page .jNceb7 > div {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: hidden !important;
    }

    #root.dchat-room-list-page #dchat-sidebar-scroller {
        display: block !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
        padding-bottom: 14px !important;
        box-sizing: border-box !important;
    }

    #root.dchat-room-list-page #dchat-sidebar-scroller > [data-viewport-type="element"] {
        position: relative !important;
        height: auto !important;
        min-height: 100% !important;
        top: auto !important;
        width: 100% !important;
    }

    #root.dchat-room-list-page #dchat-item-list {
        min-height: 180px !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
    }

    #root.dchat-room-list-page .main-section-container.YuEQkT,
    #root.dchat-room-list-page .main-section-container.css-0 {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* ===== DChat mobile chat-list final layout fix ===== */
@media (max-width: 768px) {
    html.dchat-mobile-room-list-open,
    #root.dchat-room-list-page {
        --dchat-mobile-nav-h: 74px;
        --dchat-mobile-nav-bottom-gap: 8px;
        --dchat-mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    }

    html.dchat-mobile-room-list-open,
    html.dchat-mobile-room-list-open body,
    #root.dchat-room-list-page,
    #root.dchat-room-list-page .SyM7vJ,
    #root.dchat-room-list-page .K4prvv {
        width: 100vw !important;
        height: 100dvh !important;
        height: calc(var(--vh, 1vh) * 100) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
    }

    html.dchat-mobile-room-list-open #app_main_wrapper,
    #root.dchat-room-list-page #app_main_wrapper {
        position: fixed !important;
        inset: 0 !important;
        display: block !important;
        width: 100vw !important;
        height: 100dvh !important;
        height: calc(var(--vh, 1vh) * 100) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
    }

    html.dchat-mobile-room-list-open #main-section,
    html.dchat-mobile-room-list-open .YuEQkT,
    #root.dchat-room-list-page #main-section,
    #root.dchat-room-list-page .main-section-container.YuEQkT,
    #root.dchat-room-list-page .main-section-container.css-0 {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    html.dchat-mobile-room-list-open #main_navigation_wrapper,
    #root.dchat-room-list-page #main_navigation_wrapper {
        display: flex !important;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: none !important;
        height: calc(var(--dchat-mobile-nav-h) + var(--dchat-mobile-safe-bottom) + var(--dchat-mobile-nav-bottom-gap)) !important;
        min-height: calc(var(--dchat-mobile-nav-h) + var(--dchat-mobile-safe-bottom) + var(--dchat-mobile-nav-bottom-gap)) !important;
        max-height: calc(var(--dchat-mobile-nav-h) + var(--dchat-mobile-safe-bottom) + var(--dchat-mobile-nav-bottom-gap)) !important;
        padding: 0 0 calc(var(--dchat-mobile-safe-bottom) + var(--dchat-mobile-nav-bottom-gap)) !important;
        margin: 0 !important;
        z-index: 9005 !important;
        overflow: visible !important;
        background: var(--color-neutrals-n-10, #f6f8fb) !important;
        border-top: 1px solid var(--color-neutrals-n-30, rgba(9,30,66,.08)) !important;
        border-radius: 14px 14px 0 0 !important;
        box-shadow: 0 -10px 28px rgba(9, 30, 66, .10) !important;
        direction: ltr !important;
    }

    html.dchat-mobile-room-list-open #main_navigation_wrapper .NQWeKw,
    #root.dchat-room-list-page #main_navigation_wrapper .NQWeKw {
        display: flex !important;
        flex-direction: row-reverse !important;
        align-items: stretch !important;
        justify-content: space-around !important;
        width: 100% !important;
        height: var(--dchat-mobile-nav-h) !important;
        min-height: var(--dchat-mobile-nav-h) !important;
        max-height: var(--dchat-mobile-nav-h) !important;
        padding: 0 !important;
        margin: 0 !important;
        flex: 0 0 var(--dchat-mobile-nav-h) !important;
    }

    html.dchat-mobile-room-list-open #main_navigation_wrapper .mROrNt,
    #root.dchat-room-list-page #main_navigation_wrapper .mROrNt {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
        height: var(--dchat-mobile-nav-h) !important;
        min-height: 0 !important;
        max-height: var(--dchat-mobile-nav-h) !important;
        padding: 7px 0 6px !important;
        margin: 0 !important;
        row-gap: 4px !important;
        justify-content: center !important;
        align-items: center !important;
        overflow: hidden !important;
        border-radius: 12px !important;
    }

    html.dchat-mobile-room-list-open #main_navigation_wrapper ._eLqlc,
    #root.dchat-room-list-page #main_navigation_wrapper ._eLqlc {
        width: 28px !important;
        height: 28px !important;
        min-height: 28px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 28px !important;
    }

    html.dchat-mobile-room-list-open #main_navigation_wrapper svg,
    #root.dchat-room-list-page #main_navigation_wrapper svg {
        width: 23px !important;
        height: 23px !important;
        display: block !important;
    }

    html.dchat-mobile-room-list-open #main_navigation_wrapper .Y0tLmm,
    #root.dchat-room-list-page #main_navigation_wrapper .Y0tLmm {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        font-size: 11.5px !important;
        line-height: 16px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    html.dchat-mobile-room-list-open #sidebar_wrapper,
    #root.dchat-room-list-page #sidebar_wrapper {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: calc(var(--dchat-mobile-nav-h) + var(--dchat-mobile-safe-bottom) + var(--dchat-mobile-nav-bottom-gap)) !important;
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        z-index: 9000 !important;
        overflow: hidden !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
        border: 0 !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    html.dchat-mobile-room-list-open #sidebar_wrapper > .taDlgO,
    #root.dchat-room-list-page #sidebar_wrapper > .taDlgO {
        flex: 0 0 60px !important;
        height: 60px !important;
        min-height: 60px !important;
        max-height: 60px !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
    }

    html.dchat-mobile-room-list-open #sidebar_wrapper > div:not(.taDlgO),
    #root.dchat-room-list-page #sidebar_wrapper > div:not(.taDlgO) {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        width: 100% !important;
        overflow: hidden !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
        transform: none !important;
    }

    html.dchat-mobile-room-list-open #sidebar_wrapper .css-cssveg,
    #root.dchat-room-list-page #sidebar_wrapper .css-cssveg {
        flex: 0 0 auto !important;
    }

    html.dchat-mobile-room-list-open #sidebar_wrapper .jNceb7,
    #root.dchat-room-list-page #sidebar_wrapper .jNceb7 {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: hidden !important;
        animation: none !important;
    }

    html.dchat-mobile-room-list-open #sidebar_wrapper .jNceb7 > div,
    #root.dchat-room-list-page #sidebar_wrapper .jNceb7 > div {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: 100% !important;
        overflow: hidden !important;
        touch-action: pan-y !important;
    }

    html.dchat-mobile-room-list-open #dchat-sidebar-scroller,
    #root.dchat-room-list-page #dchat-sidebar-scroller {
        display: block !important;
        flex: 1 1 auto !important;
        width: 100% !important;
        min-height: 0 !important;
        height: 100% !important;
        max-height: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        touch-action: pan-y !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
        box-sizing: border-box !important;
        padding: 0 0 18px !important;
        position: relative !important;
        direction: ltr !important;
    }

    html.dchat-mobile-room-list-open #dchat-sidebar-scroller > [data-viewport-type="element"],
    #root.dchat-room-list-page #dchat-sidebar-scroller > [data-viewport-type="element"] {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100% !important;
        overflow: visible !important;
    }

    html.dchat-mobile-room-list-open #dchat-item-list,
    #root.dchat-room-list-page #dchat-item-list {
        display: block !important;
        min-height: 220px !important;
        padding-bottom: 18px !important;
        background: var(--color-neutrals-n-00, #fcfdfd) !important;
        direction: rtl !important;
    }
}

/* ===== DChat v24: restore native message flow + exact edge spacing ===== */
/*
   The original chat stylesheet adds padding-right:32px on .rNDrxh and
   translateX(40px) on own messages in mobile. Those two rules push the
   sender bubble outside the viewport. We reset only those native offsets
   and put the small edge spacing on .message-block itself.
*/
#message_list_scroller_id {
    padding-inline: 0 !important;
    overflow-x: hidden !important;
}

#message_list_scroller_id .message-item.rNDrxh {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    margin: 2px 0 !important;
    display: flex !important;
    align-items: flex-end !important;
    position: relative !important;
    transform: none !important;
    overflow: visible !important;
}

#message_list_scroller_id .message-item.rNDrxh .message-block.KYOWTf {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-block: 2px !important;
    padding-inline: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: flex-end !important;
    overflow: visible !important;
    transform: none !important;
}

#message_list_scroller_id .message-item.rNDrxh.LtdUd1 .message-block.KYOWTf {
    flex-direction: row-reverse !important;
}

#message_list_scroller_id .message-item.rNDrxh:not(.LtdUd1) .message-block.KYOWTf {
    flex-direction: row !important;
}

#message_list_scroller_id .message-item.rNDrxh .message-block.KYOWTf.WVcUh4,
#message_list_scroller_id .message-item.rNDrxh .message-block.KYOWTf.LtdUd1.WVcUh4,
#message_list_scroller_id .message-item.rNDrxh.LtdUd1.WVcUh4,
#message_list_scroller_id .message-item.rNDrxh.WVcUh4 {
    transform: none !important;
}

#message_list_scroller_id .message-item.rNDrxh .message-block.KYOWTf > .Wdw5cr,
#message_list_scroller_id .message-item.rNDrxh .message-block.KYOWTf > .OvBc_z {
    max-width: min(76%, 364px) !important;
    min-width: 0 !important;
    width: fit-content !important;
    box-sizing: border-box !important;
    direction: rtl !important;
    text-align: right !important;
}

#message_list_scroller_id .message-item.rNDrxh:not(.LtdUd1) .message-block.KYOWTf > .Wdw5cr,
#message_list_scroller_id .message-item.rNDrxh:not(.LtdUd1) .message-block.KYOWTf > .OvBc_z {
    margin-left: 10px !important;
    margin-right: 0 !important;
}

#message_list_scroller_id .message-item.rNDrxh.LtdUd1 .message-block.KYOWTf > .Wdw5cr,
#message_list_scroller_id .message-item.rNDrxh.LtdUd1 .message-block.KYOWTf > .OvBc_z {
    margin-right: 10px !important;
    margin-left: 0 !important;
}

#message_list_scroller_id .message-item.rNDrxh .Wdw5cr,
#message_list_scroller_id .message-item.rNDrxh .Oh0n5T,
#message_list_scroller_id .message-item.rNDrxh .rZmPFS,
#message_list_scroller_id .message-item.rNDrxh .QUefjv,
#message_list_scroller_id .message-item.rNDrxh .KTwPFW,
#message_list_scroller_id .message-item.rNDrxh .dchat-message-content {
    box-sizing: border-box !important;
    max-width: 100% !important;
}

#message_list_scroller_id .message-item.rNDrxh .QUefjv,
#message_list_scroller_id .message-item.rNDrxh .KTwPFW,
#message_list_scroller_id .message-item.rNDrxh .dchat-message-content {
    direction: rtl !important;
    text-align: right !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

#message_list_scroller_id .message-item.rNDrxh.dchat-sticker-message .message-block.KYOWTf > .Wdw5cr,
#message_list_scroller_id .message-item.rNDrxh.dchat-sticker-message .message-block.KYOWTf > .OvBc_z {
    max-width: min(34vw, 230px) !important;
}

@media (max-width: 576px) {
    #message_list_scroller_id .message-item.rNDrxh {
        margin: 1px 0 !important;
        padding-inline: 0 !important;
    }

    #message_list_scroller_id .message-item.rNDrxh .message-block.KYOWTf {
        padding-inline: 0 !important;
        padding-block: 1px !important;
    }

    #message_list_scroller_id .message-item.rNDrxh:not(.LtdUd1) .message-block.KYOWTf > .Wdw5cr,
    #message_list_scroller_id .message-item.rNDrxh:not(.LtdUd1) .message-block.KYOWTf > .OvBc_z {
        margin-left: 4px !important;
        margin-right: 0 !important;
    }

    #message_list_scroller_id .message-item.rNDrxh.LtdUd1 .message-block.KYOWTf > .Wdw5cr,
    #message_list_scroller_id .message-item.rNDrxh.LtdUd1 .message-block.KYOWTf > .OvBc_z {
        margin-right: 4px !important;
        margin-left: 0 !important;
    }

    #message_list_scroller_id .message-item.rNDrxh .message-block.KYOWTf > .Wdw5cr,
    #message_list_scroller_id .message-item.rNDrxh .message-block.KYOWTf > .OvBc_z {
        max-width: calc(100% - 8px) !important;
    }

    #message_list_scroller_id .message-item.rNDrxh:not(.dchat-sticker-message) .message-block.KYOWTf > .Wdw5cr,
    #message_list_scroller_id .message-item.rNDrxh:not(.dchat-sticker-message) .message-block.KYOWTf > .OvBc_z {
        max-width: min(76%, calc(100% - 8px)) !important;
    }

    #message_list_scroller_id .message-item.rNDrxh.dchat-sticker-message .message-block.KYOWTf > .Wdw5cr,
    #message_list_scroller_id .message-item.rNDrxh.dchat-sticker-message .message-block.KYOWTf > .OvBc_z {
        max-width: min(54vw, 195px) !important;
    }
}


/* ===== DChat v25: dark mode polish for in-chat search, emoji and media pickers ===== */
html.dchat-dark #dchat-chat-search-panel,
html.dchat-dark .dchat-chat-search-panel {
    background: #0f172a !important;
    background-image: none !important;
    border-bottom-color: rgba(148, 163, 184, .18) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .28) !important;
    color: #e2e8f0 !important;
}

html.dchat-dark #dchat-chat-search-panel .dchat-chat-search-box,
html.dchat-dark .dchat-chat-search-panel .dchat-chat-search-box {
    background: #111827 !important;
    border-color: rgba(96, 165, 250, .24) !important;
    color: #bfdbfe !important;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .08) !important;
}

html.dchat-dark #dchat-chat-search-panel .dchat-chat-search-input,
html.dchat-dark .dchat-chat-search-panel .dchat-chat-search-input {
    background: transparent !important;
    color: #f8fafc !important;
    caret-color: #60a5fa !important;
}

html.dchat-dark #dchat-chat-search-panel .dchat-chat-search-input::placeholder,
html.dchat-dark .dchat-chat-search-panel .dchat-chat-search-input::placeholder {
    color: rgba(226, 232, 240, .50) !important;
}

html.dchat-dark .dchat-chat-search-meta {
    color: rgba(226, 232, 240, .68) !important;
}

html.dchat-dark .dchat-chat-search-nav,
html.dchat-dark .dchat-chat-search-close,
html.dchat-dark .dchat-chat-search-btn {
    background: rgba(148, 163, 184, .10) !important;
    border-color: rgba(148, 163, 184, .16) !important;
    color: #dbeafe !important;
}

html.dchat-dark .dchat-chat-search-nav:hover,
html.dchat-dark .dchat-chat-search-close:hover,
html.dchat-dark .dchat-chat-search-btn:hover,
html.dchat-dark .dchat-chat-search-btn.is-active {
    background: rgba(96, 165, 250, .18) !important;
    color: #ffffff !important;
}

html.dchat-dark .dchat-emoji-panel,
html.dchat-dark .dchat-media-picker {
    background: rgba(15, 23, 42, .98) !important;
    border-color: rgba(148, 163, 184, .18) !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .42) !important;
    color: #e2e8f0 !important;
}

html.dchat-dark .dchat-emoji-header,
html.dchat-dark .dchat-emoji-cats,
html.dchat-dark .dchat-media-picker-head {
    border-color: rgba(148, 163, 184, .14) !important;
    background: rgba(15, 23, 42, .72) !important;
}

html.dchat-dark .dchat-emoji-search {
    background: #0b1220 !important;
    border-color: rgba(148, 163, 184, .24) !important;
    color: #f8fafc !important;
    caret-color: #60a5fa !important;
}

html.dchat-dark .dchat-emoji-search::placeholder {
    color: rgba(226, 232, 240, .48) !important;
}

html.dchat-dark .dchat-emoji-close,
html.dchat-dark .dchat-emoji-cat,
html.dchat-dark .dchat-emoji-btn,
html.dchat-dark .dchat-media-picker-close,
html.dchat-dark .dchat-media-picker-add,
html.dchat-dark .dchat-media-picker-tab {
    background: rgba(148, 163, 184, .10) !important;
    border-color: rgba(148, 163, 184, .16) !important;
    color: #e2e8f0 !important;
}

html.dchat-dark .dchat-emoji-btn {
    background: transparent !important;
}

html.dchat-dark .dchat-emoji-btn:hover,
html.dchat-dark .dchat-emoji-cat:hover,
html.dchat-dark .dchat-emoji-close:hover,
html.dchat-dark .dchat-media-picker-close:hover,
html.dchat-dark .dchat-media-picker-add:hover,
html.dchat-dark .dchat-media-picker-tab:hover {
    background: rgba(96, 165, 250, .18) !important;
    color: #fff !important;
}

html.dchat-dark .dchat-emoji-cat.is-active,
html.dchat-dark .dchat-media-picker-tab.is-active {
    background: linear-gradient(135deg, rgba(60, 144, 214, .34), rgba(57, 204, 200, .20)) !important;
    border-color: rgba(96, 165, 250, .34) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .22) !important;
}

html.dchat-dark .dchat-media-picker-tabs {
    background: rgba(2, 6, 23, .42) !important;
    border: 1px solid rgba(148, 163, 184, .12) !important;
}

html.dchat-dark .dchat-saved-media-tile {
    background: rgba(148, 163, 184, .10) !important;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .10) !important;
}

html.dchat-dark .dchat-saved-media-tile.is-sticker {
    background: linear-gradient(135deg, rgba(96, 165, 250, .14), rgba(45, 212, 191, .08)) !important;
}

html.dchat-dark .dchat-media-picker-empty,
html.dchat-dark .dchat-saved-media-fallback,
html.dchat-dark .dchat-emoji-empty {
    color: rgba(226, 232, 240, .70) !important;
}

/* Hide successful E2EE labels in the message footer; decrypted messages already render normally. */
.message-item[data-e2ee-status="ok"] .dchat-e2ee-badge {
    display: none !important;
}

/* ===== DChat phone verification notice ===== */
.dchat-phone-verify-alert {
    margin: 8px 12px 10px;
    padding: 10px 11px;
    border-radius: 16px;
    border: 1px solid rgba(60, 144, 214, .22);
    background: linear-gradient(135deg, rgba(60, 144, 214, .12), rgba(57, 204, 200, .09));
    display: flex;
    align-items: center;
    gap: 10px;
    direction: rtl;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 8px 22px rgba(9, 30, 66, .06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dchat-phone-verify-alert:hover,
.dchat-phone-verify-alert:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(60, 144, 214, .38);
    box-shadow: 0 12px 28px rgba(9, 30, 66, .09);
    outline: none;
}
.dchat-phone-verify-alert-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, #3c90d6, #39cbc8);
    box-shadow: 0 7px 16px rgba(60, 144, 214, .28);
}
.dchat-phone-verify-alert-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.5;
}
.dchat-phone-verify-alert-text strong {
    color: #091e42;
    font-size: 12.5px;
    font-weight: 850;
}
.dchat-phone-verify-alert-text span {
    color: rgba(9, 30, 66, .62);
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dchat-phone-verify-modal {
    direction: rtl;
    text-align: right;
}
.dchat-phone-verify-modal .dchat-phone-verify-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 900;
    color: #091e42;
}
.dchat-phone-verify-modal .dchat-phone-verify-sub {
    margin: 0 0 14px;
    color: rgba(9, 30, 66, .68);
    font-size: 13px;
    line-height: 1.9;
}
.dchat-phone-verify-steps {
    display: grid;
    gap: 9px;
    margin: 12px 0 14px;
}
.dchat-phone-verify-step {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 10px;
    border-radius: 14px;
    background: rgba(60, 144, 214, .07);
    border: 1px solid rgba(60, 144, 214, .12);
    color: #091e42;
    font-size: 12.5px;
    line-height: 1.8;
}
.dchat-phone-verify-step-no {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #3c90d6;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
}
.dchat-phone-verify-step-text {
    min-width: 0;
    flex: 1;
}
.dchat-phone-verify-inline-code {
    display: inline-flex;
    align-items: center;
    direction: ltr;
    unicode-bidi: isolate;
    padding: 1px 7px;
    margin: 0 3px;
    border-radius: 999px;
    background: rgba(60, 144, 214, .12);
    color: #1e6fae;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.8;
    letter-spacing: .2px;
    white-space: nowrap;
}
.dchat-phone-verify-limits {
    margin: 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 174, 0, .12);
    border: 1px solid rgba(255, 174, 0, .24);
    color: #6f4a00;
    font-size: 12.2px;
    line-height: 1.85;
}
html.dchat-dark .dchat-phone-verify-alert {
    background: linear-gradient(135deg, rgba(60, 144, 214, .18), rgba(57, 204, 200, .10));
    border-color: rgba(96, 165, 250, .28);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}
html.dchat-dark .dchat-phone-verify-alert-text strong { color: #e5edf7; }
html.dchat-dark .dchat-phone-verify-alert-text span { color: rgba(226, 232, 240, .68); }
html.dchat-dark .dchat-phone-verify-modal .dchat-phone-verify-title { color: #e5edf7; }
html.dchat-dark .dchat-phone-verify-modal .dchat-phone-verify-sub { color: rgba(226, 232, 240, .70); }
html.dchat-dark .dchat-phone-verify-step {
    background: rgba(96, 165, 250, .10);
    border-color: rgba(96, 165, 250, .18);
    color: #e5edf7;
}
html.dchat-dark .dchat-phone-verify-inline-code {
    background: rgba(96, 165, 250, .16);
    color: #93c5fd;
}
html.dchat-dark .dchat-phone-verify-limits {
    background: rgba(245, 158, 11, .12);
    border-color: rgba(245, 158, 11, .28);
    color: #facc15;
}
@media (max-width: 576px) {
    .dchat-phone-verify-alert {
        margin: 7px 10px 9px;
        padding: 9px 10px;
        border-radius: 15px;
    }
}

/* ===== DChat active sessions modal ===== */

.dchat-sessions-feature-card .gRchi5 svg.dchat-sessions-feature-icon {
    width: 31px;
    height: 31px;
    display: block;
}
.dchat-sessions-feature-card:hover .gRchi5 svg.dchat-sessions-feature-icon rect,
.dchat-sessions-feature-card:hover .gRchi5 svg.dchat-sessions-feature-icon path:first-of-type {
    stroke: #3c90d6;
}


/* v47: keep active-sessions feature neutral on hover */
.dchat-sessions-feature-card:hover,
html.dchat-dark .dchat-sessions-feature-card:hover {
    background-color: transparent !important;
}
.dchat-sessions-feature-card:hover .gRchi5 svg.dchat-sessions-feature-icon rect,
.dchat-sessions-feature-card:hover .gRchi5 svg.dchat-sessions-feature-icon path:first-of-type {
    stroke: var(--color-neutrals-n-400) !important;
}
@media (min-width: 768px) {
    .dchat-sessions-modal .ZxNIcu {
        max-height: min(78vh, 720px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .dchat-sessions-modal .dchat-sessions-list {
        flex: 1 1 auto;
    }
}

.dchat-sessions-modal { direction: rtl; text-align: right; }
.dchat-session-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 14px 0 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(60,144,214,.08);
    border: 1px solid rgba(60,144,214,.14);
    color: rgba(9,30,66,.78);
    font-size: 13px;
    font-weight: 800;
}
.dchat-session-summary button,
.dchat-session-action {
    border: 0;
    outline: 0;
    border-radius: 999px;
    background: #3c90d6;
    color: #fff;
    cursor: pointer;
    font-family: var(--dchat-font, inherit);
    font-size: 12px;
    font-weight: 800;
    padding: 8px 12px;
    transition: transform .16s ease, opacity .16s ease, background .16s ease;
    white-space: nowrap;
}
.dchat-session-summary button:disabled { opacity: .45; cursor: not-allowed; }
.dchat-session-summary button:not(:disabled):hover,
.dchat-session-action:hover { transform: translateY(-1px); }
.dchat-session-action.danger { background: #ef4444; }
.dchat-sessions-list {
    display: grid;
    gap: 10px;
    max-height: min(62vh, 540px);
    overflow: auto;
    padding: 2px 2px 2px 6px;
}
.dchat-session-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(9,30,66,.08);
    box-shadow: 0 8px 22px rgba(9,30,66,.06);
}
.dchat-session-row.is-current { border-color: rgba(60,144,214,.28); background: rgba(60,144,214,.06); }
.dchat-session-row.is-revoked { opacity: .62; }
.dchat-session-main { min-width: 0; flex: 1; }
.dchat-session-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.dchat-session-title-row strong {
    color: #091e42;
    font-size: 14px;
    line-height: 1.4;
}
.dchat-session-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    background: rgba(100,116,139,.11);
    color: #475569;
}
.dchat-session-pill.current { background: rgba(60,144,214,.14); color: #2563eb; }
.dchat-session-pill.active { background: rgba(16,185,129,.13); color: #059669; }
.dchat-session-pill.off { background: rgba(239,68,68,.12); color: #dc2626; }
.dchat-session-meta,
.dchat-session-key {
    margin: 0;
    font-size: 12px;
    line-height: 1.75;
    color: rgba(9,30,66,.58);
    word-break: break-word;
}
.dchat-session-key.ok { color: #059669; }
.dchat-session-key.warn { color: #b45309; }
.dchat-session-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(245,158,11,.10);
    color: rgba(120,53,15,.92);
    font-size: 12px;
    line-height: 1.8;
}
html.dchat-dark .dchat-session-summary {
    background: rgba(59,130,246,.12);
    border-color: rgba(96,165,250,.20);
    color: rgba(226,232,240,.84);
}
html.dchat-dark .dchat-session-row {
    background: rgba(15,23,42,.88);
    border-color: rgba(148,163,184,.14);
    box-shadow: none;
}
html.dchat-dark .dchat-session-row.is-current {
    background: rgba(59,130,246,.12);
    border-color: rgba(96,165,250,.24);
}
html.dchat-dark .dchat-session-title-row strong { color: #e5edf7; }
html.dchat-dark .dchat-session-meta { color: rgba(226,232,240,.60); }
html.dchat-dark .dchat-session-key.ok { color: #34d399; }
html.dchat-dark .dchat-session-key.warn { color: #fbbf24; }
html.dchat-dark .dchat-session-note {
    background: rgba(245,158,11,.12);
    color: rgba(253,230,138,.90);
}
@media (max-width: 560px) {
    .dchat-session-summary { align-items: stretch; flex-direction: column; }
    .dchat-session-summary button { width: 100%; }
    .dchat-session-row { align-items: stretch; flex-direction: column; }
    .dchat-session-action { width: 100%; }
}

/* v37: keep reply/edit bar visible and readable in dark mode */
html.dchat-dark #dchat-reply-bar.dchat-reply-bar.dchat-editing-bar,
html.dchat-dark #dchat-reply-bar.dchat-editing-bar,
body.dchat-dark #dchat-reply-bar.dchat-reply-bar.dchat-editing-bar,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar {
    background: linear-gradient(135deg, rgba(15,23,42,.98), rgba(17,34,64,.96)) !important;
    border: 1px solid rgba(96,165,250,.28) !important;
    box-shadow: 0 -10px 26px rgba(0,0,0,.28) !important;
    color: #e5edf8 !important;
}
html.dchat-dark #dchat-reply-bar.dchat-editing-bar.is-visible,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar.is-visible {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-title,
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-title,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-title,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-title {
    color: #f8fafc !important;
}
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-text,
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-text,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-text,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-text {
    color: rgba(226,232,240,.78) !important;
}
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-icon,
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-icon,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-icon,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-icon {
    background: rgba(59,130,246,.18) !important;
    color: #93c5fd !important;
}

/* v39: make reply bar dark mode match the edit bar exactly */
html.dchat-dark #dchat-reply-bar.dchat-editing-bar,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar {
    background: rgba(17,24,39,.98) !important;
    border: 0 !important;
    border-top: 1px solid rgba(96,165,250,.22) !important;
    box-shadow: 0 -4px 16px rgba(0,0,0,.16) !important;
    color: #e5edf7 !important;
}
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-title,
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-title,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-title,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-title {
    color: #e5edf7 !important;
}
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-text,
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-text,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-text,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-text {
    color: rgba(226,232,240,.68) !important;
}
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-icon,
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-icon,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-icon,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-icon {
    background: transparent !important;
    color: #3c90d6 !important;
}


/* v46: Treasure nav icon alignment + empty state/options polish */
#dchat-nav-treasure ._eLqlc {
    display: flex;
    align-items: center;
    justify-content: center;
}
#dchat-nav-treasure .DqEQFk {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
#dchat-nav-treasure .MmNSd8,
#dchat-nav-treasure .dchat-treasure-nav-svg {
    position: absolute;
    inset: 0;
    margin: auto;
    display: block;
    transform: none !important;
}
#dchat-nav-treasure .dchat-treasure-nav-svg path {
    transition: fill .4s ease;
}
.dchat-treasure-grid > .dchat-media-picker-empty,
.dchat-treasure-grid > .dchat-treasure-empty {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 128px;
    box-sizing: border-box;
    border-radius: 18px;
    background: rgba(9, 30, 66, .045);
    border: 1px dashed rgba(9, 30, 66, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px 14px;
}
.dchat-treasure-save.is-saved {
    pointer-events: auto;
}
.dchat-treasure-viewer .dchat-viewer-inner img,
.dchat-treasure-viewer .dchat-viewer-inner video {
    object-fit: contain;
}
.dchat-treasure-large-fallback {
    width: min(70vw, 420px);
    height: min(70vw, 420px);
    border-radius: 22px;
    background: rgba(255,255,255,.10);
    color: #fff;
    font-size: 24px;
}
html.dchat-dark .dchat-treasure-grid > .dchat-media-picker-empty,
html.dchat-dark .dchat-treasure-grid > .dchat-treasure-empty {
    background: rgba(148, 163, 184, .08) !important;
    border-color: rgba(148, 163, 184, .18) !important;
    color: rgba(226, 232, 240, .74) !important;
}
@media (max-width: 540px) {
    #dchat-nav-treasure .MmNSd8,
    #dchat-nav-treasure .dchat-treasure-nav-svg {
        width: 23px !important;
        height: 23px !important;
    }
    .dchat-treasure-grid > .dchat-media-picker-empty,
    .dchat-treasure-grid > .dchat-treasure-empty {
        min-height: 116px;
        border-radius: 16px;
    }
}

/* ===== DChat Treasure (public GIF/sticker collection) ===== */
.dchat-treasure-wrap {
    direction: rtl;
    padding: 10px 10px 18px;
    font-family: var(--dchat-font);
}
.dchat-treasure-head {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: -10px -10px 0;
    background: rgba(252, 253, 253, .96);
    backdrop-filter: blur(12px);
}
.dchat-treasure-hint {
    margin: 10px 0 12px;
    padding: 9px 11px;
    border-radius: 14px;
    background: rgba(60, 144, 214, .08);
    color: rgba(9, 30, 66, .66);
    font-size: 12px;
    line-height: 1.8;
    text-align: right;
}
.dchat-treasure-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}
.dchat-treasure-card {
    position: relative;
    min-width: 0;
}
.dchat-treasure-card .dchat-saved-media-tile {
    width: 100%;
    display: block;
    box-shadow: inset 0 0 0 1px rgba(9, 30, 66, .06);
}
.dchat-treasure-card .dchat-saved-media-tile img,
.dchat-treasure-card .dchat-saved-media-tile video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.dchat-treasure-save {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    min-width: 24px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 0;
    background: rgba(0, 0, 0, .58);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(6px);
}
.dchat-treasure-save.is-saved {
    background: rgba(60, 144, 214, .92);
    font-size: 14px;
}
.dchat-treasure-delete {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 4;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 999px;
    background: rgba(220, 53, 69, .92);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
    backdrop-filter: blur(6px);
}
.dchat-treasure-delete svg {
    width: 17px;
    height: 17px;
    display: block;
}
.dchat-treasure-delete:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}
.dchat-treasure-download {
    position: absolute !important;
    left: 6px !important;
    bottom: 6px !important;
    z-index: 3 !important;
}
.dchat-treasure-card .dchat-saved-media-fallback {
    background: linear-gradient(135deg, rgba(60,144,214,.10), rgba(57,204,200,.08));
    font-weight: 900;
}
html.dchat-dark .dchat-treasure-head {
    background: rgba(15, 23, 42, .96) !important;
    border-color: rgba(148, 163, 184, .14) !important;
}
html.dchat-dark .dchat-treasure-hint {
    background: rgba(96, 165, 250, .12) !important;
    color: rgba(226, 232, 240, .72) !important;
}
html.dchat-dark .dchat-treasure-card .dchat-saved-media-tile {
    background: rgba(148, 163, 184, .10) !important;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .10) !important;
}
@media (max-width: 540px) {
    .dchat-treasure-wrap { padding: 8px 8px 16px; }
    .dchat-treasure-head { margin: -8px -8px 0; }
    .dchat-treasure-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
}

/* ===== DChat v50: group join/leave system messages + dark file names ===== */
.message-item.dchat-system-message {
    justify-content: center !important;
    align-items: center !important;
    margin: 8px 0 !important;
    min-height: auto !important;
    pointer-events: none;
}
.message-item.dchat-system-message .dchat-select-dot,
.message-item.dchat-system-message .message-block,
.message-item.dchat-system-message .Wdw5cr,
.message-item.dchat-system-message .rZmPFS,
.message-item.dchat-system-message .Jqtglx,
.message-item.dchat-system-message .IheVs2 {
    display: none !important;
}
.dchat-system-event-marker { display: none !important; }
.dchat-system-event-pill {
    max-width: min(92%, 520px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(9, 30, 66, .07);
    color: rgba(9, 30, 66, .72);
    border: 1px solid rgba(9, 30, 66, .08);
    font-family: var(--dchat-font);
    font-size: 12px;
    line-height: 1.8;
    direction: rtl;
    text-align: center;
    box-shadow: 0 6px 18px rgba(9, 30, 66, .05);
    pointer-events: auto;
}
.dchat-system-event-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #3c90d6;
    flex: 0 0 auto;
}
.dchat-system-event-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dchat-system-event-time {
    color: rgba(9, 30, 66, .48);
    direction: ltr;
    font-size: 11px;
    flex: 0 0 auto;
}
html.dchat-dark .dchat-file-name,
html.dchat-dark .dchat-file-card .dchat-file-name,
html.dchat-dark .message-item .dchat-file-name {
    color: #eef6ff !important;
}
html.dchat-dark .dchat-system-event-pill {
    background: rgba(148, 163, 184, .12) !important;
    color: rgba(226, 232, 240, .86) !important;
    border-color: rgba(148, 163, 184, .18) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22) !important;
}
html.dchat-dark .dchat-system-event-time {
    color: rgba(226, 232, 240, .56) !important;
}
@media (max-width: 540px) {
    .dchat-system-event-pill {
        max-width: 88vw;
        padding: 6px 10px;
        font-size: 11.5px;
    }
}

/* ===== DChat v50: admin owner metadata in treasure modal ===== */
.dchat-treasure-owner-note {
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 10px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(60, 144, 214, .08);
    color: rgba(9, 30, 66, .72);
    border: 1px solid rgba(60, 144, 214, .12);
    font-size: 12px;
    line-height: 1.8;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
}
.dchat-treasure-owner-note strong {
    color: #091E42;
}
.dchat-treasure-owner-note small {
    font-size: 11px;
    color: rgba(9, 30, 66, .48);
    direction: ltr;
}
html.dchat-dark .dchat-treasure-owner-note {
    background: rgba(96, 165, 250, .12) !important;
    border-color: rgba(96, 165, 250, .18) !important;
    color: rgba(226, 232, 240, .82) !important;
}
html.dchat-dark .dchat-treasure-owner-note strong {
    color: #eef6ff !important;
}
html.dchat-dark .dchat-treasure-owner-note small {
    color: rgba(226, 232, 240, .56) !important;
}

/* Static server-rendered system messages keep the existing bubble DOM, so only the visual chrome is removed. */
.message-item.dchat-system-message .message-block {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 0 !important;
}
.message-item.dchat-system-message .Wdw5cr,
.message-item.dchat-system-message .rZmPFS,
.message-item.dchat-system-message .QUefjv,
.message-item.dchat-system-message .KTwPFW,
.message-item.dchat-system-message .dchat-message-content {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.message-item.dchat-system-message .dchat-system-event-text {
    max-width: min(92%, 520px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(9, 30, 66, .07);
    color: rgba(9, 30, 66, .72);
    border: 1px solid rgba(9, 30, 66, .08);
    font-family: var(--dchat-font);
    font-size: 12px;
    line-height: 1.8;
    direction: rtl;
    text-align: center;
    box-shadow: 0 6px 18px rgba(9, 30, 66, .05);
}
.message-item.dchat-system-message .dchat-system-event-text::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #3c90d6;
    flex: 0 0 auto;
}
html.dchat-dark .message-item.dchat-system-message .dchat-system-event-text {
    background: rgba(148, 163, 184, .12) !important;
    color: rgba(226, 232, 240, .86) !important;
    border-color: rgba(148, 163, 184, .18) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22) !important;
}

/* ===== DChat v52: compact clean group system events ===== */
.message-item.dchat-system-message {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 6px 0 !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    min-height: 0 !important;
    pointer-events: none !important;
}
.message-item.dchat-system-message > .dchat-system-event-pill {
    width: auto !important;
    max-width: min(86vw, 420px) !important;
    min-width: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 5px 10px !important;
    border-radius: 999px !important;
    line-height: 1.7 !important;
    font-size: 11.5px !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
}
.message-item.dchat-system-message .dchat-system-event-label {
    min-width: 0 !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-break: break-word !important;
}
.message-item.dchat-system-message .dchat-system-event-time {
    font-size: 10.5px !important;
    white-space: nowrap !important;
}
.message-item.dchat-system-message .message-block,
.message-item.dchat-system-message .Wdw5cr,
.message-item.dchat-system-message .rZmPFS,
.message-item.dchat-system-message .QUefjv,
.message-item.dchat-system-message .KTwPFW,
.message-item.dchat-system-message .dchat-message-content,
.message-item.dchat-system-message .Jqtglx,
.message-item.dchat-system-message .IheVs2,
.message-item.dchat-system-message .dchat-select-dot {
    display: none !important;
}
@media (max-width: 540px) {
    .message-item.dchat-system-message { padding: 0 8px !important; }
    .message-item.dchat-system-message > .dchat-system-event-pill {
        max-width: 82vw !important;
        padding: 4px 9px !important;
        font-size: 11px !important;
    }
}

/* ===== DChat v54: cleaner admin delete icon + system-event delete affordance ===== */
.dchat-treasure-delete {
    background: linear-gradient(135deg, rgba(239, 68, 68, .96), rgba(190, 18, 60, .96));
    box-shadow: 0 10px 22px rgba(190, 18, 60, .24), inset 0 0 0 1px rgba(255, 255, 255, .22);
}
.dchat-treasure-delete svg {
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .18));
}
.message-item.dchat-system-message > .dchat-system-event-pill {
    cursor: context-menu !important;
    user-select: none;
}
.message-item.dchat-system-message > .dchat-system-event-pill:hover {
    box-shadow: 0 6px 18px rgba(9, 30, 66, .10);
}
.dchat-system-message-menu {
    min-width: 132px;
}

/* ===== DChat v56: paged treasure infinite scroll ===== */
.dchat-treasure-loading {
    grid-column: 1 / -1;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 0 2px;
}
.dchat-treasure-loading span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(60, 144, 214, .72);
    animation: dchatTreasureLoading 900ms ease-in-out infinite;
}
.dchat-treasure-loading span:nth-child(2) { animation-delay: 120ms; }
.dchat-treasure-loading span:nth-child(3) { animation-delay: 240ms; }
@keyframes dchatTreasureLoading {
    0%, 80%, 100% { transform: translateY(0); opacity: .45; }
    40% { transform: translateY(-4px); opacity: 1; }
}
html.dchat-dark .dchat-treasure-loading span {
    background: rgba(96, 165, 250, .82);
}

/* v57: lazy loading indicator for personal GIF/sticker picker inside chat */
.dchat-media-picker-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 0 4px;
}

.dchat-media-picker-loading span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(60, 144, 214, .55);
    animation: dchatMediaPickerDot 1s ease-in-out infinite;
}

.dchat-media-picker-loading span:nth-child(2) { animation-delay: .12s; }
.dchat-media-picker-loading span:nth-child(3) { animation-delay: .24s; }

@keyframes dchatMediaPickerDot {
    0%, 80%, 100% { transform: translateY(0); opacity: .35; }
    40% { transform: translateY(-4px); opacity: 1; }
}

html.dchat-dark .dchat-media-picker-loading span {
    background: rgba(96, 165, 250, .8);
}

/* ===== v66: message bubble max-width tuned to requested compact width ===== */
#message_list_scroller_id .message-item.rNDrxh .message-block.KYOWTf > .Wdw5cr,
#message_list_scroller_id .message-item.rNDrxh .message-block.KYOWTf > .OvBc_z {
    max-width: min(76%, 364px) !important;
}

@media (max-width: 576px) {
    #message_list_scroller_id .message-item.rNDrxh:not(.dchat-sticker-message) .message-block.KYOWTf > .Wdw5cr,
    #message_list_scroller_id .message-item.rNDrxh:not(.dchat-sticker-message) .message-block.KYOWTf > .OvBc_z {
        max-width: min(76%, calc(100% - 8px)) !important;
    }
}

/* ===== v59: Telegram-like text formatting + safe pasted text ===== */
#message_list_scroller_id .dchat-message-content,
#message_list_scroller_id .dchat-message-content *:not(.dchat-link-preview):not(.dchat-link-preview *):not(.dchat-spoiler) {
    font-family: inherit !important;
}

#message_list_scroller_id .dchat-message-content [style]:not(.dchat-link-preview):not(.dchat-link-preview *):not(.dchat-spoiler) {
    background: transparent !important;
    background-color: transparent !important;
    color: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

#message_list_scroller_id .dchat-message-content strong {
    font-weight: 800;
}

#message_list_scroller_id .dchat-message-content em {
    font-style: italic;
}

#message_list_scroller_id .dchat-message-content u {
    text-underline-offset: 3px;
}

#message_list_scroller_id .dchat-message-content s {
    opacity: .9;
}

#message_list_scroller_id .dchat-inline-code,
#message_list_scroller_id .dchat-code-block {
    direction: ltr;
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    background: rgba(15, 23, 42, .08) !important;
    border: 1px solid rgba(15, 23, 42, .08);
    color: inherit !important;
}

#message_list_scroller_id .dchat-inline-code {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 7px;
    font-size: .92em;
}

#message_list_scroller_id .dchat-code-block {
    display: block;
    margin: 6px 0;
    padding: 9px 10px;
    border-radius: 12px;
    white-space: pre-wrap;
    overflow-x: auto;
}

#message_list_scroller_id .dchat-code-block code {
    font-family: inherit !important;
}

#message_list_scroller_id .dchat-spoiler {
    border-radius: 6px;
    padding: 0 4px;
    background: rgba(15, 23, 42, .85) !important;
    color: transparent !important;
    cursor: pointer;
    transition: color .16s ease, background .16s ease;
}

#message_list_scroller_id .dchat-spoiler:hover,
#message_list_scroller_id .dchat-spoiler:focus,
#message_list_scroller_id .dchat-spoiler.is-revealed {
    color: inherit !important;
    background: rgba(15, 23, 42, .10) !important;
}

html.dchat-dark #message_list_scroller_id .dchat-inline-code,
html.dchat-dark #message_list_scroller_id .dchat-code-block {
    background: rgba(255, 255, 255, .10) !important;
    border-color: rgba(255, 255, 255, .12);
}

html.dchat-dark #message_list_scroller_id .dchat-spoiler {
    background: rgba(226, 232, 240, .82) !important;
}

html.dchat-dark #message_list_scroller_id .dchat-spoiler:hover,
html.dchat-dark #message_list_scroller_id .dchat-spoiler:focus,
html.dchat-dark #message_list_scroller_id .dchat-spoiler.is-revealed {
    background: rgba(255, 255, 255, .16) !important;
    color: #eef6ff !important;
}


/* ===== v67: keep image/GIF/video media centered inside compact message bubbles ===== */
#message_list_scroller_id .message-item.dchat-image-media-message .dchat-attachments {
    width: 100% !important;
    justify-content: center !important;
    align-items: center !important;
}

#message_list_scroller_id .message-item.dchat-image-media-message .dchat-media-card:not(.dchat-sticker-card),
#message_list_scroller_id .message-item.dchat-image-media-message .dchat-video-card:not(.dchat-sticker-card) {
    margin-left: auto !important;
    margin-right: auto !important;
}

#message_list_scroller_id .message-item.dchat-image-media-message .dchat-media-button {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

#message_list_scroller_id .message-item.dchat-image-media-message .dchat-image-card:not(.dchat-sticker-card) img,
#message_list_scroller_id .message-item.dchat-image-media-message .dchat-gif-card:not(.dchat-sticker-card) img,
#message_list_scroller_id .message-item.dchat-image-media-message .dchat-video-preview {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100% !important;
}

/* v71: composer line breaks, reply/edit dark consistency, mobile screenshare/search polish */
@media (max-width: 576px) {
    #screenshare-button {
        display: none !important;
    }
}

/* Dark-mode chat search icon: no background/shadow in normal state; show only on hover/active. */
html.dchat-dark #dchat-chat-search-toggle.dchat-chat-search-btn,
body.dchat-dark #dchat-chat-search-toggle.dchat-chat-search-btn {
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
    border-color: transparent !important;
}
html.dchat-dark #dchat-chat-search-toggle.dchat-chat-search-btn:hover,
html.dchat-dark #dchat-chat-search-toggle.dchat-chat-search-btn.is-active,
body.dchat-dark #dchat-chat-search-toggle.dchat-chat-search-btn:hover,
body.dchat-dark #dchat-chat-search-toggle.dchat-chat-search-btn.is-active {
    background: rgba(96, 165, 250, .18) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,.16) !important;
    color: #ffffff !important;
}

/* Make reply preview in the composer match edit preview in dark mode. */
html.dchat-dark #dchat-reply-bar.dchat-reply-bar.dchat-editing-bar,
body.dchat-dark #dchat-reply-bar.dchat-reply-bar.dchat-editing-bar {
    background: rgba(17,24,39,.98) !important;
    border: 0 !important;
    border-top: 1px solid rgba(96,165,250,.22) !important;
    box-shadow: 0 -4px 16px rgba(0,0,0,.16) !important;
    color: #e5edf7 !important;
}
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-accent,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-accent,
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-accent,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-accent {
    background: #3c90d6 !important;
}
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-icon,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-icon,
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-icon,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-icon {
    background: transparent !important;
    color: #3c90d6 !important;
    box-shadow: none !important;
}
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-title,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-title,
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-title,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-title {
    color: #e5edf7 !important;
}
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-text,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-reply-text,
html.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-text,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar .dchat-editing-text {
    color: rgba(226,232,240,.68) !important;
}

/* Embedded replied-message cards in dark bubbles should stay on the same visual system. */
html.dchat-dark .KTwPFW .dchat-reply-quote,
body.dchat-dark .KTwPFW .dchat-reply-quote {
    background: rgba(15,23,42,.34) !important;
    border-inline-start-color: #3c90d6 !important;
    color: #e5edf7 !important;
}
html.dchat-dark .KTwPFW .dchat-reply-quote-title,
body.dchat-dark .KTwPFW .dchat-reply-quote-title {
    color: #e5edf7 !important;
}
html.dchat-dark .KTwPFW .dchat-reply-quote-text,
body.dchat-dark .KTwPFW .dchat-reply-quote-text {
    color: rgba(226,232,240,.68) !important;
}


/* ===== DChat v73 fixes: handles, send dedupe, dark reply, multiline composer ===== */
#message-input.TrTErO,
#message-input[contenteditable="true"] {
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

#send-button.dchat-send-disabled {
    pointer-events: none !important;
    opacity: .58 !important;
    filter: grayscale(.15) !important;
}

html.dchat-dark #dchat-reply-bar,
body.dchat-dark #dchat-reply-bar,
html.dchat-dark #dchat-reply-bar.dchat-reply-bar,
body.dchat-dark #dchat-reply-bar.dchat-reply-bar,
html.dchat-dark #dchat-reply-bar.dchat-editing-bar,
body.dchat-dark #dchat-reply-bar.dchat-editing-bar {
    background: rgba(17,24,39,.98) !important;
    background-color: rgba(17,24,39,.98) !important;
    background-image: none !important;
    border-top-color: rgba(96,165,250,.22) !important;
    color: #e5edf7 !important;
    box-shadow: 0 -4px 16px rgba(0,0,0,.16) !important;
}

html.dchat-dark #dchat-reply-bar *,
body.dchat-dark #dchat-reply-bar * {
    background-image: none !important;
}

html.dchat-dark #dchat-reply-bar .dchat-reply-title,
body.dchat-dark #dchat-reply-bar .dchat-reply-title,
html.dchat-dark #dchat-reply-bar .dchat-editing-title,
body.dchat-dark #dchat-reply-bar .dchat-editing-title {
    color: #e5edf7 !important;
}

html.dchat-dark #dchat-reply-bar .dchat-reply-text,
body.dchat-dark #dchat-reply-bar .dchat-reply-text,
html.dchat-dark #dchat-reply-bar .dchat-editing-text,
body.dchat-dark #dchat-reply-bar .dchat-editing-text {
    color: rgba(226,232,240,.72) !important;
}

html.dchat-dark #dchat-reply-bar .dchat-reply-close,
body.dchat-dark #dchat-reply-bar .dchat-reply-close,
html.dchat-dark #dchat-reply-bar .dchat-editing-close,
body.dchat-dark #dchat-reply-bar .dchat-editing-close {
    background: rgba(255,255,255,.08) !important;
    color: #e5e7eb !important;
}

html.dchat-dark .KTwPFW .dchat-reply-quote,
body.dchat-dark .KTwPFW .dchat-reply-quote {
    background: rgba(15,23,42,.46) !important;
    background-color: rgba(15,23,42,.46) !important;
    background-image: none !important;
    border-inline-start-color: #3c90d6 !important;
    color: #e5edf7 !important;
}

/* ===== DChat v74: edit flow without modal + dark locked-send notice ===== */
#message-input.dchat-composer-soft-error,
.TrTErO.NMmp70.dchat-composer-soft-error {
    outline: 0 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, .22) inset !important;
    animation: dchatComposerSoftErrorShake .28s ease-in-out 0s 1;
}
@keyframes dchatComposerSoftErrorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(2px); }
    50% { transform: translateX(-2px); }
    75% { transform: translateX(1px); }
}
html.dchat-dark .dchat-send-locked-text,
body.dchat-dark .dchat-send-locked-text,
[data-theme="dark"] .dchat-send-locked-text {
    background: rgba(15, 23, 42, .92) !important;
    color: rgba(226, 232, 240, .92) !important;
    border: 1px solid rgba(148, 163, 184, .22) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22) !important;
}

/* ===== DChat v81: search drawer, channel reply guard, nicer swipe reply ===== */
#dchat-chat-search-panel.dchat-search-drawer-overlay {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 100050 !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
    background: rgba(9, 30, 66, .28) !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    direction: rtl !important;
}
#dchat-chat-search-panel.dchat-search-drawer-overlay.is-open {
    display: flex !important;
}
.dchat-search-drawer {
    width: min(430px, 100vw) !important;
    height: 100% !important;
    background: #fcfdfd !important;
    background-image: none !important;
    box-shadow: -18px 0 48px rgba(9, 30, 66, .18) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}
.dchat-search-drawer-topbar {
    flex: 0 0 auto;
}
.dchat-search-drawer-close {
    color: #de350b !important;
}
.dchat-search-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    overflow: hidden;
}
#dchat-chat-search-panel .dchat-search-drawer-box {
    flex: 0 0 auto;
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, rgba(60,144,214,.10), rgba(57,204,200,.10)) !important;
    border: 1px solid rgba(60,144,214,.16) !important;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.45) !important;
}
.dchat-search-drawer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}
.dchat-search-results {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 2px 0 max(10px, env(safe-area-inset-bottom, 0px));
}
.dchat-search-result-row {
    width: 100%;
    border: 1px solid rgba(9, 30, 66, .08);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(9, 30, 66, .04);
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: right;
    font-family: var(--dchat-font);
    color: #091E42;
    transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.dchat-search-result-row:hover,
.dchat-search-result-row.is-active {
    border-color: rgba(60, 144, 214, .26);
    background: rgba(60, 144, 214, .075);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(60,144,214,.10);
}
.dchat-search-result-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dchat-search-result-title {
    font-size: 12px;
    font-weight: 800;
    color: #3c90d6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dchat-search-result-snippet {
    font-size: 12.5px;
    line-height: 1.65;
    color: rgba(9, 30, 66, .74);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.dchat-search-result-time {
    flex: 0 0 auto;
    color: rgba(9, 30, 66, .46);
    font-size: 11px;
    direction: ltr;
}
.dchat-search-empty {
    margin: 10px 4px;
    color: rgba(9,30,66,.58);
    font-size: 12px;
    line-height: 1.9;
    text-align: center;
}
html.dchat-dark #dchat-chat-search-panel.dchat-search-drawer-overlay,
body.dchat-dark #dchat-chat-search-panel.dchat-search-drawer-overlay {
    background: rgba(0, 0, 0, .45) !important;
    background-image: none !important;
}
html.dchat-dark .dchat-search-drawer,
body.dchat-dark .dchat-search-drawer {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    box-shadow: -18px 0 48px rgba(0,0,0,.45) !important;
}
html.dchat-dark #dchat-chat-search-panel .dchat-search-drawer-box,
body.dchat-dark #dchat-chat-search-panel .dchat-search-drawer-box {
    background: #111827 !important;
    border-color: rgba(96, 165, 250, .24) !important;
    color: #bfdbfe !important;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .08) !important;
}
html.dchat-dark .dchat-search-result-row,
body.dchat-dark .dchat-search-result-row {
    background: rgba(17, 24, 39, .92) !important;
    border-color: rgba(148, 163, 184, .16) !important;
    color: #e2e8f0 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.18) !important;
}
html.dchat-dark .dchat-search-result-row:hover,
html.dchat-dark .dchat-search-result-row.is-active,
body.dchat-dark .dchat-search-result-row:hover,
body.dchat-dark .dchat-search-result-row.is-active {
    background: rgba(96, 165, 250, .15) !important;
    border-color: rgba(96, 165, 250, .32) !important;
}
html.dchat-dark .dchat-search-result-title,
body.dchat-dark .dchat-search-result-title { color: #93c5fd !important; }
html.dchat-dark .dchat-search-result-snippet,
body.dchat-dark .dchat-search-result-snippet { color: rgba(226,232,240,.78) !important; }
html.dchat-dark .dchat-search-result-time,
body.dchat-dark .dchat-search-result-time,
html.dchat-dark .dchat-search-empty,
body.dchat-dark .dchat-search-empty { color: rgba(226,232,240,.58) !important; }

.message-item.dchat-swipe-reply-active {
    transform: translateX(var(--dchat-swipe-x, -28px));
    filter: brightness(1.035);
}
.message-item.dchat-swipe-reply-active .message-block {
    position: relative;
}
.message-item.dchat-swipe-reply-active .message-block::after {
    content: "↩";
    position: absolute;
    top: 50%;
    right: -42px;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(60,144,214,.16);
    color: #3c90d6;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(60,144,214,.14), inset 0 0 0 1px rgba(60,144,214,.18);
    opacity: .92;
    transform: scale(.92);
    transition: transform .14s ease, background .14s ease, color .14s ease;
}
.message-item.dchat-swipe-reply-ready .message-block::after {
    transform: scale(1.08);
    background: #3c90d6;
    color: #fff;
}
html.dchat-dark .message-item.dchat-swipe-reply-active .message-block::after,
body.dchat-dark .message-item.dchat-swipe-reply-active .message-block::after {
    background: rgba(96,165,250,.20);
    color: #bfdbfe;
    box-shadow: 0 8px 18px rgba(0,0,0,.28), inset 0 0 0 1px rgba(147,197,253,.20);
}
html.dchat-dark .message-item.dchat-swipe-reply-ready .message-block::after,
body.dchat-dark .message-item.dchat-swipe-reply-ready .message-block::after {
    background: #60a5fa;
    color: #0f172a;
}
@media (max-width: 576px) {
    .dchat-search-drawer { width: 100vw !important; }
    .dchat-search-drawer-body { padding: 10px; }
}

/* ===== DChat v82: stronger Telegram-like swipe-to-reply feedback ===== */
.message-item.dchat-swipe-reply-active {
    transform: translateX(var(--dchat-swipe-x, -36px));
    transition: transform .12s cubic-bezier(.2, .8, .2, 1), filter .12s ease;
    will-change: transform;
}
.message-item.dchat-swipe-reply-triggered {
    transform: translateX(var(--dchat-swipe-x, -132px)) scale(.992);
    filter: brightness(1.06);
    transition: transform .18s cubic-bezier(.16, 1, .3, 1), filter .18s ease;
}
.message-item.dchat-swipe-reply-active .message-block::after {
    right: -48px;
    transform: scale(.9) rotate(-8deg);
    transition: transform .16s cubic-bezier(.16, 1, .3, 1), background .14s ease, color .14s ease, opacity .14s ease;
}
.message-item.dchat-swipe-reply-ready .message-block::after {
    transform: scale(1.08) rotate(0deg);
}
.message-item.dchat-swipe-reply-triggered .message-block::after {
    transform: scale(1.18) rotate(0deg);
    opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
    .message-item.dchat-swipe-reply-active,
    .message-item.dchat-swipe-reply-triggered,
    .message-item.dchat-swipe-reply-active .message-block::after {
        transition: none !important;
    }
}

/* ===== DChat v83: real row-wide swipe-to-reply movement ===== */
#message_list_scroller_id .message-item[data-mid]:not(.dchat-system-message) {
    touch-action: pan-y;
}
#message_list_scroller_id .message-item.dchat-swipe-reply-active,
#message_list_scroller_id .message-item.dchat-swipe-reply-triggered {
    transform: none !important;
    filter: none !important;
}
#message_list_scroller_id .message-item.dchat-swipe-reply-active .message-block {
    transform: translateX(var(--dchat-swipe-x, -42px));
    filter: brightness(1.035);
    transition: transform .10s cubic-bezier(.2, .8, .2, 1), filter .10s ease;
    will-change: transform;
}
#message_list_scroller_id .message-item.dchat-swipe-reply-triggered .message-block {
    transform: translateX(var(--dchat-swipe-x, -168px)) scale(.992);
    filter: brightness(1.06);
    transition: transform .18s cubic-bezier(.16, 1, .3, 1), filter .18s ease;
}
#message_list_scroller_id .message-item.dchat-swipe-reply-active .message-block::after {
    right: -52px;
}
#message_list_scroller_id .message-item.dchat-swipe-reply-ready .message-block::after,
#message_list_scroller_id .message-item.dchat-swipe-reply-triggered .message-block::after {
    right: -56px;
}
@media (prefers-reduced-motion: reduce) {
    #message_list_scroller_id .message-item.dchat-swipe-reply-active .message-block,
    #message_list_scroller_id .message-item.dchat-swipe-reply-triggered .message-block,
    #message_list_scroller_id .message-item.dchat-swipe-reply-active .message-block::after {
        transition: none !important;
    }
}

/* ===== DChat v84: force visible swipe movement on the real message block ===== */
/*
   A previous layout reset uses a stronger selector on `.message-block.KYOWTf.WVcUh4`
   with `transform: none !important`. The swipe classes in v83 were weaker, so
   the CSS variable was being updated but the bubble stayed visually fixed.
   These selectors intentionally match the reset specificity and come after it.
*/
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-active .message-block.KYOWTf.WVcUh4,
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-active .message-block.KYOWTf.LtdUd1.WVcUh4 {
    transform: translate3d(var(--dchat-swipe-x, -42px), 0, 0) !important;
    filter: brightness(1.035) !important;
    transition: transform .10s cubic-bezier(.2, .8, .2, 1), filter .10s ease !important;
    will-change: transform !important;
}

#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-triggered .message-block.KYOWTf.WVcUh4,
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-triggered .message-block.KYOWTf.LtdUd1.WVcUh4 {
    transform: translate3d(var(--dchat-swipe-x, -168px), 0, 0) scale(.992) !important;
    filter: brightness(1.06) !important;
    transition: transform .18s cubic-bezier(.16, 1, .3, 1), filter .18s ease !important;
    will-change: transform !important;
}

#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-active .message-block.KYOWTf.WVcUh4::after,
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-active .message-block.KYOWTf.LtdUd1.WVcUh4::after {
    right: -52px !important;
}

#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-ready .message-block.KYOWTf.WVcUh4::after,
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-ready .message-block.KYOWTf.LtdUd1.WVcUh4::after,
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-triggered .message-block.KYOWTf.WVcUh4::after,
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-triggered .message-block.KYOWTf.LtdUd1.WVcUh4::after {
    right: -56px !important;
}

@media (prefers-reduced-motion: reduce) {
    #message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-active .message-block.KYOWTf.WVcUh4,
    #message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-active .message-block.KYOWTf.LtdUd1.WVcUh4,
    #message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-triggered .message-block.KYOWTf.WVcUh4,
    #message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-triggered .message-block.KYOWTf.LtdUd1.WVcUh4 {
        transition: none !important;
    }
}


/* ===== DChat v85: softer bounded swipe-to-reply motion ===== */
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-active .message-block.KYOWTf.WVcUh4,
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-active .message-block.KYOWTf.LtdUd1.WVcUh4 {
    transform: translate3d(var(--dchat-swipe-x, -36px), 0, 0) !important;
    filter: brightness(1.018) !important;
    transition: transform .085s cubic-bezier(.22, .9, .24, 1), filter .14s ease !important;
    will-change: transform !important;
}

#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-triggered .message-block.KYOWTf.WVcUh4,
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-triggered .message-block.KYOWTf.LtdUd1.WVcUh4 {
    transform: translate3d(var(--dchat-swipe-x, calc(-1 * var(--dchat-swipe-limit, 72px))), 0, 0) scale(.996) !important;
    filter: brightness(1.035) !important;
    transition: transform .24s cubic-bezier(.16, 1, .3, 1), filter .20s ease !important;
    will-change: transform !important;
}

#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-active .message-block.KYOWTf.WVcUh4::after,
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-active .message-block.KYOWTf.LtdUd1.WVcUh4::after {
    right: -42px !important;
    transform: scale(.86) rotate(-6deg) !important;
    transition: transform .18s cubic-bezier(.16, 1, .3, 1), background .16s ease, color .16s ease, opacity .16s ease !important;
}

#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-ready .message-block.KYOWTf.WVcUh4::after,
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-ready .message-block.KYOWTf.LtdUd1.WVcUh4::after,
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-triggered .message-block.KYOWTf.WVcUh4::after,
#message_list_scroller_id .message-item.rNDrxh.dchat-swipe-reply-triggered .message-block.KYOWTf.LtdUd1.WVcUh4::after {
    right: -46px !important;
    transform: scale(1.02) rotate(0deg) !important;
}
