﻿/* مسنجر داخلی مشترک — تم مدرن جوهر + فیروزه‌ای */
:root {
    --ms-ink: #0b1220;
    --ms-ink-soft: #152238;
    --ms-accent: #0d9488;
    --ms-accent-2: #0891b2;
    --ms-accent-soft: rgba(13, 148, 136, 0.12);
    --ms-line: rgba(15, 23, 42, 0.08);
    --ms-muted: #64748b;
    --ms-mine: linear-gradient(135deg, #0f766e 0%, #0e7490 100%);
    --ms-theirs: rgba(255, 255, 255, 0.92);
    --ms-shadow: 0 14px 36px rgba(15, 23, 42, 0.1);
}

.ms-body {
    overflow: hidden;
}

.ms-app {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

.ms-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-height: 100vh;
    max-height: 100dvh;
    background:
        radial-gradient(900px 420px at 100% -10%, rgba(8, 145, 178, 0.12), transparent 55%),
        radial-gradient(700px 360px at 0% 100%, rgba(13, 148, 136, 0.1), transparent 50%),
        rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(14px);
    border-right: 1px solid var(--ms-line);
}

.ms-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ms-line);
    background: rgba(255, 255, 255, 0.78);
    flex-shrink: 0;
}

.ms-back {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--ms-ink);
    background: rgba(15, 23, 42, 0.04);
    text-decoration: none;
    transition: background .15s;
}

.ms-back:hover {
    background: var(--ms-accent-soft);
}

.ms-back svg {
    width: 18px;
    height: 18px;
    transform: scaleX(-1);
}

.ms-header-info {
    min-width: 0;
    flex: 1;
}

.ms-header-info h1 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ms-ink);
}

.ms-header-info p {
    margin: 2px 0 0;
    font-size: .78rem;
    color: var(--ms-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 10px 16px 0;
    flex-shrink: 0;
}

.ms-tabs-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.ms-tabs-4 {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.ms-tabs-5 {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.ms-tabs-6 {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.ms-tabs-6 .ms-tab {
    font-size: .7rem;
    padding: 9px 4px;
}

@media (min-width: 720px) {
    .ms-tabs-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .ms-tabs-5 {
        grid-template-columns: repeat(5, 1fr);
    }

    .ms-tabs-5 .ms-tab {
        font-size: .76rem;
    }

    .ms-tabs-6 {
        grid-template-columns: repeat(6, 1fr);
    }

    .ms-tabs-6 .ms-tab {
        font-size: .72rem;
    }
}

.ms-tab {
    border: 1px solid var(--ms-line);
    background: rgba(255, 255, 255, 0.7);
    color: var(--ms-muted);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 800;
    padding: 9px 6px;
    border-radius: 14px;
    cursor: pointer;
    transition: .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.ms-tab-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-tab-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    line-height: 18px;
    flex-shrink: 0;
}

.ms-tab-badge[hidden] {
    display: none !important;
}

.ms-tab.active .ms-tab-badge {
    background: #fff;
    color: #0f766e;
}

.ms-tab.active {
    background: var(--ms-ink);
    border-color: var(--ms-ink);
    color: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.ms-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.ms-avatar.lg {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 1.05rem;
}

.ms-avatar-photo {
    padding: 0;
    overflow: hidden;
    background: #1e1433;
}

.ms-avatar-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* —— Inbox —— */
.ms-toolbar {
    display: grid;
    gap: 10px;
    padding: 12px 16px 8px;
    flex-shrink: 0;
}

.ms-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--ms-line);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.ms-search svg {
    width: 16px;
    height: 16px;
    color: var(--ms-muted);
    flex-shrink: 0;
}

.ms-search input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
    font-size: .9rem;
    color: var(--ms-ink);
}

.ms-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ms-filters[hidden] {
    display: none !important;
}


.ms-chip {
    border: 1px solid var(--ms-line);
    background: rgba(255, 255, 255, 0.75);
    color: var(--ms-muted);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: .15s ease;
}

.ms-chip.active {
    background: var(--ms-ink);
    border-color: var(--ms-ink);
    color: #fff;
}

.ms-chip.has-unread:not(.active) {
    border-color: rgba(13, 148, 136, 0.35);
    color: #0f766e;
    background: var(--ms-accent-soft);
}

.ms-unread-pill {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-right: 4px;
    border-radius: 999px;
    background: #0f766e;
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
}

.ms-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px 24px;
}

.ms-section-label {
    margin: 12px 8px 8px;
    font-size: .72rem;
    font-weight: 800;
    color: var(--ms-muted);
    letter-spacing: .02em;
}

.ms-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    margin-bottom: 6px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    color: inherit;
    text-align: right;
    cursor: pointer;
    font-family: inherit;
    transition: transform .15s, border-color .15s, box-shadow .15s, background .15s;
}

.ms-item:hover {
    transform: translateY(-1px);
    border-color: rgba(13, 148, 136, 0.22);
    box-shadow: var(--ms-shadow);
    background: #fff;
}

.ms-item.unread {
    background: linear-gradient(120deg, rgba(240, 253, 250, 0.95), rgba(255, 255, 255, 0.9));
    border-color: rgba(13, 148, 136, 0.18);
}

.ms-item-body {
    flex: 1;
    min-width: 0;
}

.ms-item-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

.ms-item-name {
    font-size: .95rem;
    font-weight: 800;
    color: var(--ms-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-item-time {
    font-size: .7rem;
    color: var(--ms-muted);
    flex-shrink: 0;
}

.ms-item-preview {
    margin: 0;
    font-size: .8rem;
    color: var(--ms-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-item.unread .ms-item-preview {
    color: #334155;
    font-weight: 600;
}

.ms-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.ms-badge-dot {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f766e, #0891b2);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.ms-tag {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    color: #0e7490;
    background: rgba(8, 145, 178, 0.1);
    padding: 2px 7px;
    border-radius: 999px;
    margin-top: 4px;
}

.ms-empty,
.ms-loading {
    padding: 48px 20px;
    text-align: center;
    color: var(--ms-muted);
    font-size: .92rem;
}

.ms-empty strong {
    display: block;
    color: var(--ms-ink);
    margin-bottom: 6px;
    font-size: 1rem;
}

/* —— Room —— */
.ms-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ms-msg {
    display: flex;
    max-width: min(78%, 480px);
    gap: 8px;
    position: relative;
}

.ms-msg.mine {
    align-self: flex-start;
}

.ms-msg.theirs {
    align-self: flex-end;
}

.ms-bubble-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ms-msg.mine .ms-bubble-wrap {
    align-items: flex-start;
}

.ms-msg.theirs .ms-bubble-wrap {
    align-items: flex-end;
}

.ms-icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--ms-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--ms-ink);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
}

.ms-icon-btn.active {
    background: var(--ms-ink);
    color: #fff;
    border-color: var(--ms-ink);
}

.ms-select-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.04);
    border-bottom: 1px solid var(--ms-line);
    font-size: .82rem;
    flex-shrink: 0;
}

.ms-select-bar[hidden] {
    display: none !important;
}

.ms-select-actions {
    display: flex;
    gap: 6px;
}

.ms-chip.danger {
    background: #991b1b;
    border-color: #991b1b;
    color: #fff;
}

.ms-chip.danger:disabled {
    opacity: .45;
}

.ms-msg.selectable {
    cursor: pointer;
}

.ms-msg.selected .ms-bubble {
    outline: 2px solid var(--ms-accent);
}

.ms-msg-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--ms-accent);
    background: #fff;
    flex-shrink: 0;
    align-self: center;
    cursor: pointer;
}

.ms-msg.selected .ms-msg-check {
    background: var(--ms-accent);
    box-shadow: inset 0 0 0 3px #fff;
}

.ms-msg-image {
    display: block;
    max-width: min(240px, 70vw);
    max-height: 240px;
    border-radius: 12px;
    margin-bottom: 6px;
    object-fit: cover;
    cursor: zoom-in;
}

.ms-delete-btn {
    border: none;
    background: transparent;
    color: #b91c1c;
    font-family: inherit;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 8px;
}

.ms-attach {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid var(--ms-line);
    cursor: pointer;
    flex-shrink: 0;
    color: var(--ms-ink);
}

.ms-attach svg {
    width: 18px;
    height: 18px;
}

.ms-image-preview {
    position: relative;
    display: inline-block;
    margin-bottom: 8px;
}

.ms-image-preview[hidden] {
    display: none !important;
}

.ms-image-preview img {
    max-width: 120px;
    max-height: 120px;
    border-radius: 12px;
    display: block;
    border: 1px solid var(--ms-line);
}

.ms-preview-remove {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    cursor: pointer;
}

.ms-item-ai .ms-tag {
    background: rgba(124, 58, 237, 0.12);
    color: #6d28d9;
}

.ms-bubble {
    padding: 10px 12px;
    border-radius: 18px;
    line-height: 1.55;
    font-size: .92rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    word-break: break-word;
    white-space: pre-wrap;
}

.ms-msg.mine .ms-bubble {
    background: var(--ms-mine);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.ms-msg.theirs .ms-bubble {
    background: var(--ms-theirs);
    color: var(--ms-ink);
    border: 1px solid var(--ms-line);
    border-bottom-left-radius: 6px;
}

.ms-bubble p {
    margin: 0 0 6px;
    white-space: pre-wrap;
}

.ms-bubble p:last-child {
    margin-bottom: 0;
}

.ms-msg-buttons {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.ms-msg-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 800;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid rgba(13, 148, 136, 0.28);
    background: rgba(13, 148, 136, 0.1);
    color: #0f766e;
    transition: .15s ease;
}

.ms-msg-btn:hover {
    background: rgba(13, 148, 136, 0.18);
}

.ms-msg.mine .ms-msg-btn {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.ms-quote {
    font-size: .75rem;
    padding: 7px 9px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.08);
    border-right: 3px solid rgba(255, 255, 255, 0.55);
    opacity: .95;
}

.ms-msg.theirs .ms-quote {
    background: rgba(13, 148, 136, 0.08);
    border-right-color: var(--ms-accent);
}

.ms-msg-time {
    font-size: .62rem;
    color: var(--ms-muted);
    padding: 0 4px;
}

.ms-msg-actions {
    display: flex;
    gap: 4px;
}

.ms-reply-btn {
    border: none;
    background: transparent;
    color: var(--ms-accent);
    font-family: inherit;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 8px;
}

.ms-reply-btn:hover {
    background: var(--ms-accent-soft);
}

.ms-compose {
    flex-shrink: 0;
    padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--ms-line);
    background: rgba(255, 255, 255, 0.94);
    position: relative;
    z-index: 6;
}

.ms-reply-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 14px;
    background: linear-gradient(90deg, var(--ms-accent-soft), rgba(255, 255, 255, 0.9));
    border: 1px solid rgba(13, 148, 136, 0.18);
}

.ms-reply-bar[hidden] {
    display: none !important;
}

.ms-reply-bar-inner {
    flex: 1;
    min-width: 0;
}

.ms-reply-bar-label {
    display: block;
    font-size: .68rem;
    font-weight: 800;
    color: #0f766e;
}

.ms-reply-bar-text {
    margin: 2px 0 0;
    font-size: .78rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-reply-bar-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.06);
    cursor: pointer;
    font-size: 1.05rem;
    color: var(--ms-muted);
}

.ms-emoji-strip {
    display: none;
    gap: 2px;
    padding: 2px 2px 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.ms-compose.ms-emoji-open .ms-emoji-strip {
    display: flex;
}

.ms-emoji-strip::-webkit-scrollbar {
    display: none;
}

.ms-emoji-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform .12s, background .12s;
}

.ms-emoji-btn:hover {
    transform: translateY(-1px) scale(1.05);
    background: var(--ms-accent-soft);
}

.ms-emoji-toggle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid var(--ms-line);
    cursor: pointer;
    flex-shrink: 0;
    color: var(--ms-ink);
    font-size: 1.15rem;
    font-family: inherit;
}

.ms-emoji-toggle.active {
    background: var(--ms-accent-soft);
    border-color: rgba(13, 148, 136, 0.35);
    color: #0f766e;
}

.ms-compose-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.ms-compose-row textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    resize: none;
    border: 1px solid var(--ms-line);
    border-radius: 16px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: .92rem;
    background: #fff;
    color: var(--ms-ink);
    outline: none;
    line-height: 1.45;
}

.ms-compose-row textarea:focus {
    border-color: rgba(13, 148, 136, 0.45);
    box-shadow: 0 0 0 3px var(--ms-accent-soft);
}

.ms-send {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 16px;
    background: var(--ms-mine);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 10px 22px rgba(14, 116, 144, 0.28);
    transition: transform .15s, opacity .15s;
}

.ms-send:disabled {
    opacity: .45;
    cursor: default;
    box-shadow: none;
}

.ms-send:not(:disabled):hover {
    transform: translateY(-1px);
}

.ms-send svg {
    width: 18px;
    height: 18px;
}

.ms-mobile-nav-hide {
    display: none !important;
}

@media (max-width: 860px) {
    .ms-main {
        border-right: none;
    }
    .ms-msg {
        max-width: 88%;
    }
    .ms-tabs-3 .ms-tab {
        font-size: .74rem;
        padding: 9px 4px;
    }
}

/* —— Group chat —— */
.ms-avatar-group {
    color: #fff;
}

.ms-group-ico {
    width: 55%;
    height: 55%;
}

.ms-item-group {
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.06), transparent 55%);
}

.ms-item-group.unread {
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.12), transparent 60%);
}

.ms-tag-competitive,
.ms-tag-comp_group {
    background: rgba(13, 148, 136, 0.12);
    color: #0f766e;
}

.ms-tag-national,
.ms-tag-national_group {
    background: rgba(8, 145, 178, 0.12);
    color: #0e7490;
}

.ms-section-comp {
    color: #0f766e;
}

.ms-section-national {
    color: #0e7490;
}

.ms-start-group {
    color: #0f766e;
    font-weight: 700;
}

.ms-sender-name {
    font-size: .72rem;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: .01em;
}

.ms-group-room .ms-messages {
    background:
        radial-gradient(600px 280px at 100% 0%, rgba(13, 148, 136, 0.07), transparent 55%),
        transparent;
}

.ms-empty-groups {
    padding: 28px 18px;
}

/* —— Room mobile shell (keyboard-safe) —— */
.ms-body.ms-room-page {
    position: fixed;
    inset: 0;
    width: 100%;
    height: var(--ms-vv-height, 100dvh);
    max-height: var(--ms-vv-height, 100dvh);
    overflow: hidden;
    overscroll-behavior: none;
}

.ms-room-page .ms-app {
    min-height: 0;
    height: 100%;
    max-height: 100%;
}

.ms-room-page .ms-main {
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.ms-room-page .ms-header {
    position: sticky;
    top: 0;
    z-index: 8;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
}

.ms-room-page .ms-messages {
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.ms-room-page.ms-keyboard-open .ms-emoji-strip {
    display: none !important;
}

.ms-room-page.ms-keyboard-open .ms-compose {
    padding-bottom: 8px;
}

/* —— Lightbox —— */
.ms-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(8px);
}

.ms-lightbox[hidden] {
    display: none !important;
}

.ms-lightbox-img {
    max-width: min(96vw, 920px);
    max-height: min(86dvh, 86vh);
    border-radius: 14px;
    object-fit: contain;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    background: #0b1220;
}

.ms-lightbox-close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 14px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.ms-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.24);
}

.ms-lightbox-hint {
    position: absolute;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    color: rgba(255, 255, 255, 0.72);
    font-size: .78rem;
    font-weight: 600;
}

/* ── Dark theme ── */
html[data-theme="dark"] {
    --ms-ink: #f1f5ff;
    --ms-ink-soft: #1b2035;
    --ms-accent-soft: rgba(13, 148, 136, 0.22);
    --ms-line: rgba(148, 163, 184, 0.2);
    --ms-muted: #9aa3c2;
    --ms-theirs: #1b2035;
    --ms-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .ms-main,
html[data-theme="dark"] .ms-header,
html[data-theme="dark"] .ms-compose,
html[data-theme="dark"] .ms-app {
    background: #14182a !important;
    color: var(--ms-ink) !important;
    border-color: var(--ms-line) !important;
}
html[data-theme="dark"] .ms-item,
html[data-theme="dark"] .ms-tab,
html[data-theme="dark"] .ms-chip,
html[data-theme="dark"] .ms-search,
html[data-theme="dark"] .ms-compose-row textarea {
    background: #1b2035 !important;
    color: var(--ms-ink) !important;
    border-color: var(--ms-line) !important;
}
html[data-theme="dark"] .ms-item-name,
html[data-theme="dark"] .ms-header-info h1,
html[data-theme="dark"] .ms-back,
html[data-theme="dark"] .ms-icon-btn {
    color: #eef2ff !important;
}
html[data-theme="dark"] .ms-item-preview,
html[data-theme="dark"] .ms-header-info p,
html[data-theme="dark"] .ms-section-label,
html[data-theme="dark"] .ms-search svg,
html[data-theme="dark"] .ms-search input,
html[data-theme="dark"] .ms-msg-time,
html[data-theme="dark"] .ms-reply-bar-text {
    color: #aab3d1 !important;
}
html[data-theme="dark"] .ms-tab.active,
html[data-theme="dark"] .ms-chip.active {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #0f172a !important;
}
html[data-theme="dark"] .ms-msg.theirs .ms-bubble {
    background: #222947 !important;
    color: #eef2ff !important;
    border-color: rgba(148, 163, 184, 0.26) !important;
}
html[data-theme="dark"] .ms-msg.mine .ms-bubble {
    color: #f8fafc !important;
}
html[data-theme="dark"] .ms-reply-bar {
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.2), rgba(30, 36, 62, 0.92)) !important;
    border-color: rgba(13, 148, 136, 0.35) !important;
}
html[data-theme="dark"] .ms-item.unread {
    background: linear-gradient(120deg, rgba(13, 148, 136, 0.16), rgba(30, 36, 62, 0.9)) !important;
}
html[data-theme="dark"] .ms-msg-check {
    background: #0f172a;
}
html[data-theme="dark"] .ms-room-page .ms-header {
    background: rgba(20, 24, 42, 0.96) !important;
}