/* 29-messaging.css — Messaging accounts & chat styles */

/* ── Page container ── */

.msg-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 80px;
    animation: msg-fadeIn 0.25s ease;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes msg-fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ── */

.msg-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.msg-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    flex: 1;
    letter-spacing: -0.01em;
}

.msg-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
    width: 100%;
}

/* ── Mini navigation bar ── */

.msg-mini-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    background: var(--panel-2);
    border-radius: 10px;
    overflow-x: auto;
}

.msg-mini-nav__item {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border: none;
    transition: all 0.15s ease;
}

.msg-mini-nav__item:hover {
    color: var(--text);
    background: rgba(var(--green-rgb), 0.06);
}

.msg-mini-nav__item--active {
    color: var(--green);
    background: rgba(var(--green-rgb), 0.12);
    font-weight: 600;
}

/* ── Platform sections ── */

.msg-platform-section {
    margin-bottom: 24px;
}

.msg-platform-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.msg-platform-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

/* ── Account cards grid ── */

.msg-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Account card ── */

.msg-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    position: relative;
}

.msg-card:hover {
    border-color: rgba(var(--green-rgb), 0.3);
}

.msg-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.msg-card__platform {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.msg-card__name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-card__display,
.msg-card__phone {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.msg-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* ── Auth form ── */

.msg-auth {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    animation: msg-fadeIn 0.25s ease;
}

.msg-auth__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 12px 0 20px 0;
}

.msg-auth-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
    overflow-x: auto;
}

.msg-auth-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: -1px;
    transition: all 0.15s ease;
    font-family: inherit;
}

.msg-auth-tab:hover {
    color: var(--text);
}

.msg-auth-tab--active {
    color: var(--green);
    border-bottom-color: var(--green);
    font-weight: 600;
}

.msg-auth-content {
    animation: msg-fadeIn 0.2s ease;
    padding-top: 4px;
}

.msg-auth-error {
    padding: 10px 14px;
    background: rgba(var(--red-rgb), 0.1);
    border: 1px solid rgba(var(--red-rgb), 0.3);
    border-radius: 8px;
    color: var(--red);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.msg-auth-qr {
    text-align: center;
    padding: 20px 0;
}

.msg-auth-qr__img {
    max-width: 240px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 2px solid var(--line);
}

/* ── Form fields ── */

.msg-field {
    margin-bottom: 16px;
}

.msg-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.msg-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.msg-input:focus {
    border-color: var(--green);
}

.msg-input::placeholder {
    color: var(--muted);
}

.msg-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.msg-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.msg-textarea:focus {
    border-color: var(--green);
}

.msg-textarea::placeholder {
    color: var(--muted);
}

/* ── Buttons ── */

.msg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    font-family: inherit;
}

.msg-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.msg-btn:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

.msg-btn:hover:not(:disabled) {
    border-color: var(--green);
    color: var(--green);
}

.msg-btn--primary {
    background: var(--green);
    color: var(--bg);
    border-color: var(--green);
}

.msg-btn--primary:hover:not(:disabled) {
    opacity: 0.85;
    color: var(--bg);
    transform: translateY(-1px);
}

.msg-btn--primary:active:not(:disabled) {
    transform: translateY(0);
}

.msg-btn--danger {
    background: transparent;
    border-color: var(--line);
    color: var(--red);
}

.msg-btn--danger:hover:not(:disabled) {
    border-color: var(--red);
    background: rgba(var(--red-rgb), 0.1);
    color: var(--red);
}

.msg-btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
    padding: 6px 10px;
}

.msg-btn--ghost:hover:not(:disabled) {
    color: var(--green);
    background: rgba(var(--green-rgb), 0.08);
    border-color: transparent;
}

.msg-btn--small {
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* ── Chat list ── */

.msg-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.msg-chat-header__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    flex: 1;
}

.msg-chats {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.msg-chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--panel);
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.msg-chat-item:hover {
    border-color: rgba(var(--green-rgb), 0.2);
    background: var(--panel-2);
}

.msg-chat-item__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(var(--green-rgb), 0.12);
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.msg-chat-item__body {
    flex: 1;
    min-width: 0;
}

.msg-chat-item__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

.msg-chat-item__name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.msg-chat-item__time {
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.msg-chat-item__bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.msg-chat-item__preview {
    font-size: 0.82rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.msg-chat-item__unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--green);
    color: var(--bg);
    flex-shrink: 0;
}

/* ── Chat thread ── */

.msg-thread-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.msg-thread-header__name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-thread {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 280px);
    min-height: 200px;
    padding: 8px 0;
    margin-bottom: 12px;
}

.msg-load-more {
    text-align: center;
    padding: 8px 0;
}

/* ── Message bubbles ── */

.msg-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    position: relative;
    animation: msg-fadeIn 0.15s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.msg-bubble--own {
    align-self: flex-end;
    background: rgba(var(--green-rgb), 0.15);
    border: 1px solid rgba(var(--green-rgb), 0.2);
    border-bottom-right-radius: 4px;
}

.msg-bubble--other {
    align-self: flex-start;
    background: var(--panel);
    border: 1px solid var(--line);
    border-bottom-left-radius: 4px;
}

.msg-bubble__sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--green);
    margin-bottom: 3px;
}

.msg-bubble__text {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
}

.msg-bubble__attach {
    padding: 4px 8px;
    margin: 4px 0;
    background: rgba(var(--green-rgb), 0.06);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text);
}

.msg-bubble__time {
    font-size: 0.68rem;
    color: var(--muted);
    text-align: right;
    margin-top: 4px;
}

/* ── Input bar ── */

.msg-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.msg-input-bar__field {
    flex: 1;
    padding: 10px 14px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.4;
}

.msg-input-bar__field:focus {
    border-color: var(--green);
}

.msg-input-bar__field::placeholder {
    color: var(--muted);
}

.msg-input-bar__field:disabled {
    opacity: 0.5;
}

.msg-input-bar__send {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.1rem;
}

/* ── Badges ── */

.msg-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.msg-badge--active {
    background: rgba(var(--green-rgb), 0.12);
    color: var(--green);
}

.msg-badge--pending {
    background: rgba(var(--amber-rgb), 0.12);
    color: var(--amber);
}

.msg-badge--error {
    background: rgba(var(--red-rgb), 0.12);
    color: var(--red);
}

/* ── Loading / spinner ── */

.msg-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 14px;
    color: var(--muted);
    font-size: 0.9rem;
}

.msg-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--line);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: msg-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes msg-spin {
    to { transform: rotate(360deg); }
}

/* ── Empty state ── */

.msg-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
    animation: msg-fadeIn 0.25s ease;
}

.msg-empty__icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.4;
    display: block;
}

/* ── Responsive ── */

@media (max-width: 720px) {
    .msg-header {
        flex-wrap: wrap;
    }

    .msg-platform-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .msg-bubble {
        max-width: 85%;
    }

    .msg-thread {
        max-height: calc(100vh - 320px);
    }
}

@media (max-width: 480px) {
    .msg-auth { padding: 14px; }
    .msg-card__actions { flex-wrap: wrap; }
    .msg-mini-nav { gap: 2px; }
    .msg-chat-item { padding: 10px 12px; }
    .msg-chat-item__avatar { width: 36px; height: 36px; font-size: 0.85rem; }
}

/* ── Tabs ── */
.msg-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}
.msg-tab {
    padding: 6px 16px;
    border: none;
    border-radius: 6px 6px 0 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: color 0.15s, background 0.15s;
}
.msg-tab:hover { background: rgba(var(--green-rgb), 0.05); }
.msg-tab--active {
    color: var(--green);
    background: rgba(var(--green-rgb), 0.1);
    font-weight: 500;
}

/* ── Folder tabs ── */
.msg-folders {
    display: flex;
    gap: 4px;
    padding: 6px 12px;
    overflow-x: auto;
    scrollbar-width: none;
}
.msg-folders::-webkit-scrollbar { display: none; }
.msg-folder-btn {
    padding: 4px 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: all 0.15s;
}
.msg-folder-btn:hover { border-color: var(--green); color: var(--text); }
.msg-folder-btn--active {
    background: rgba(var(--green-rgb), 0.1);
    border-color: var(--green);
    color: var(--green);
    font-weight: 500;
}

/* ── Contacts ── */
.msg-contacts-list { display: flex; flex-direction: column; gap: 2px; }
.msg-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.msg-contact-item:hover { background: rgba(var(--green-rgb), 0.05); }
.msg-contact-item__avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--panel-2);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.9rem; color: var(--green);
    flex-shrink: 0;
}
.msg-contact-item__info { flex: 1; min-width: 0; }
.msg-contact-item__name { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.msg-contact-item__phone { font-size: 0.75rem; color: var(--muted); }

/* ── Search bar ── */

.msg-search-wrap {
    margin-bottom: 12px;
}

.msg-search {
    width: 100%;
    padding: 9px 14px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.msg-search:focus {
    border-color: var(--green);
}

.msg-search::placeholder {
    color: var(--muted);
}

/* ── Bubble action buttons ── */

.msg-bubble__actions {
    position: absolute;
    top: 4px;
    right: 6px;
    display: flex;
    gap: 2px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.msg-bubble--other .msg-bubble__actions {
    right: auto;
    left: 6px;
}

.msg-bubble:hover .msg-bubble__actions {
    opacity: 1;
    pointer-events: auto;
}

.msg-bubble__action {
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: var(--panel-2);
    cursor: pointer;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    opacity: 0.7;
}

.msg-bubble__action:hover {
    background: rgba(var(--red-rgb), 0.15);
    opacity: 1;
}

/* ── Inline edit ── */

.msg-bubble__edit-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.msg-bubble__edit-input {
    width: 100%;
    padding: 6px 10px;
    background: var(--panel-2);
    border: 1px solid var(--green);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.88rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    min-height: 36px;
    box-sizing: border-box;
}

.msg-bubble__edit-btns {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

/* ── Mobile: always show actions on touch ── */

@media (hover: none) {
    .msg-bubble__actions {
        opacity: 0.6;
        pointer-events: auto;
    }
}

/* ── Chat Info Modal ── */

.msg-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: msg-fadeIn 0.15s ease;
}

.msg-modal {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    width: 380px;
    max-width: 92vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.msg-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.msg-modal__title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.msg-modal__close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.msg-modal__close:hover { color: var(--text); }

.msg-modal__body {
    padding: 16px;
}

.msg-info-top {
    text-align: center;
    margin-bottom: 16px;
}

.msg-info-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.msg-info-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(var(--green-rgb), 0.15);
    color: var(--green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.msg-info-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.msg-info-type {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 2px;
}

.msg-info-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.msg-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid rgba(var(--green-rgb), 0.06);
    gap: 12px;
}
.msg-info-row:last-child { border-bottom: none; }

.msg-info-label {
    font-size: 0.82rem;
    color: var(--muted);
    flex-shrink: 0;
}

.msg-info-val {
    font-size: 0.88rem;
    color: var(--text);
    text-align: right;
    word-break: break-word;
}

/* ── Audit ── */

.msg-audit-filters {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.msg-audit-count {
    font-size: 0.78rem;
    color: var(--muted);
    margin-left: auto;
}

.msg-audit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.msg-audit-event {
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid var(--line);
    background: var(--panel);
}

.msg-audit-event--edit { border-left-color: var(--amber); }
.msg-audit-event--delete { border-left-color: var(--red); }

.msg-audit-event__header {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.msg-audit-event__icon { font-size: 0.9rem; }
.msg-audit-event__type { font-weight: 600; font-size: 0.82rem; color: var(--text); }
.msg-audit-event__platform { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; }
.msg-audit-event__chat { font-size: 0.8rem; color: var(--green); }
.msg-audit-event__time { font-size: 0.75rem; color: var(--muted); margin-left: auto; }
.msg-audit-event__sender { font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }

.msg-audit-event__text {
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 3px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.msg-audit-event__text--old {
    background: rgba(var(--red-rgb, 255,80,80), 0.08);
    color: var(--text);
}

.msg-audit-event__text--new {
    background: rgba(var(--green-rgb), 0.08);
    color: var(--text);
}

.msg-audit-label {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--muted);
}

.msg-audit-event__meta {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 4px;
}

/* ── Date separators ── */
.msg-date-sep {
    text-align: center;
    padding: 8px 0;
    font-size: 0.72rem;
    color: var(--muted);
    position: relative;
}
.msg-date-sep::before,
.msg-date-sep::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 50px);
    height: 1px;
    background: var(--line);
}
.msg-date-sep::before { left: 0; }
.msg-date-sep::after { right: 0; }

/* ── Empty thread ── */
.msg-empty-thread {
    text-align: center;
    color: var(--muted);
    padding: 60px 20px;
    font-size: 0.85rem;
}

/* ── Unread chat highlight ── */
.msg-chat-item--unread {
    background: rgba(var(--green-rgb), 0.04);
}
.msg-chat-item--unread .msg-chat-item__name {
    font-weight: 700;
}
.msg-chat-item--unread .msg-chat-item__preview {
    color: var(--text);
    font-weight: 500;
}
