* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    font-size: 14px;
    color: #222;
    background: #f5f5f5;
}

button {
    font: inherit;
    cursor: pointer;
    background: #fff;
    border: 1px solid #c0c0c0;
    padding: 6px 14px;
    color: #222;
}

button:hover {
    background: #ededed;
}

button:active {
    background: #e0e0e0;
}

input[type="text"], input[type="password"] {
    font: inherit;
    background: #fff;
    border: 1px solid #c0c0c0;
    padding: 6px 10px;
    color: #222;
    outline: none;
}

input:focus {
    border-color: #888;
}

.hidden {
    display: none !important;
}

.error {
    color: #b00020;
    font-size: 13px;
    margin-top: 4px;
    min-height: 1em;
}

/* ----- Login screen ----- */

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

.login-card {
    width: 320px;
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-card h1 {
    font-size: 18px;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.login-card label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-card label span {
    font-size: 12px;
    color: #555;
}

.login-card button {
    margin-top: 8px;
}

/* ----- Main screen ----- */

.main-screen {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.header {
    flex: 0 0 auto;
    height: 52px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 12px;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-left #account-input {
    width: 200px;
}

.login-name {
    color: #555;
    font-size: 13px;
}

.content {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
}

/* ----- Sidebar ----- */

.sidebar {
    flex: 0 0 260px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.sidebar-title {
    flex: 0 0 auto;
    /* Высота автоматическая под содержимое (2 или 3 строки в зависимости от
       наличия username), padding одинаков сверху/снизу. */
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e0e0e0;
    color: #444;
    font-weight: 600;
    overflow: hidden;
}

.sidebar-title .acc-avatar-link {
    flex: 0 0 auto;
    display: block;
    line-height: 0;
}

.sidebar-title .acc-avatar {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border: 1px solid #d4d4d4;
    background: #ededed;
    display: block;
    image-rendering: pixelated; /* для маленьких сидерных PNG'ок не размывало */
}

.sidebar-title .acc-avatar-placeholder {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 16px;
    font-weight: 600;
    image-rendering: auto;
}

.sidebar-title .acc-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}

.sidebar-title .acc-name {
    font-weight: 600;
    color: #222;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-title .acc-sub {
    font-weight: 400;
    color: #777;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* «ВЫКИНУТЬ» — необратимый вывод аккаунта из работы. Красная и заметная:
   нажимать её нужно осознанно, но искать глазами оператор не должен. */
.sidebar-title .acc-drop-btn {
    margin-top: 4px;
    align-self: flex-start;
    padding: 2px 8px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: #b00020;
    background: #fff;
    border: 1px solid #d44;
    border-radius: 3px;
    cursor: pointer;
}

.sidebar-title .acc-drop-btn:hover {
    background: #fbeaea;
}

.sidebar-title .acc-drop-btn:active {
    background: #f5d8d8;
}

.sidebar-title .acc-dropped {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: #b00020;
}

.dialogs-list {
    flex: 1 1 auto;
    overflow-y: auto;
}

.dialog-item {
    padding: 10px 14px;
    border-bottom: 1px solid #ededed;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.dialog-item:hover {
    background: #fafafa;
}

.dialog-item.last-in {
    background: #d4d4d4;
}

.dialog-item.last-in:hover {
    background: #c8c8c8;
}

.dialog-item.active,
.dialog-item.last-in.active {
    background: #eef3f8;
}

.dialog-item.banned .di-name {
    color: #999;
    text-decoration: line-through;
}

.dialog-item.banned .di-preview {
    color: #aaa;
}

.dialog-item .di-line1 {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
    min-width: 0;
}

.dialog-item .di-name {
    font-weight: 600;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 auto;
}

.dialog-item .di-time {
    color: #888;
    font-size: 12px;
    flex: 0 0 auto;
}

.dialog-item .di-line2 {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.dialog-item .di-preview {
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

.dialog-item .di-badge {
    flex: 0 0 auto;
    background: #4a6fa5;
    color: #fff;
    border-radius: 4px;
    padding: 0 6px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 12px;
}

/* ----- Chat ----- */

.chat {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fafafa;
}

.chat-header {
    flex: 0 0 auto;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chat-header .ch-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-header .ch-name {
    font-weight: 600;
    color: #222;
}

.chat-header .ch-meta {
    color: #777;
    font-size: 12px;
}

.chat-header .ch-peer {
    margin-top: 2px;
    font-size: 12px;
    min-height: 1em;
}

.ch-peer-online {
    color: #2e8a4f;
    font-weight: 600;
}

.ch-peer-offline,
.ch-peer-wait {
    color: #777;
}

.ch-peer-unknown {
    color: #999;
    font-style: italic;
}

.chat-header .ch-actions {
    flex: 0 0 auto;
}

.ban-btn {
    border-color: #d44;
    color: #b00020;
}

.ban-btn:hover {
    background: #fbeaea;
}

.ban-btn:active {
    background: #f5d8d8;
}

.ch-banned {
    color: #b00020;
    font-weight: 600;
    font-size: 13px;
}

.messages-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message {
    max-width: 70%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    word-wrap: break-word;
    word-break: break-word;
}

.message.in {
    align-self: flex-start;
    background: #f0f0f0;
    color: #222;
}

.message.out {
    align-self: flex-end;
    background: #dde6f1;
    border-color: #c8d4e3;
    color: #222;
}

.message .m-text {
    white-space: pre-wrap;
}

.message .m-time {
    margin-top: 4px;
    font-size: 11px;
    color: #777;
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.message.pending {
    opacity: 0.6;
}

.message.failed {
    border-color: #d44;
    background: #fbeaea;
}

.message.failed .m-time {
    color: #b00020;
}

/* ----- Edit ----- */

/* Карандашик появляется только при hover на сообщении (hover-only по решению
   2026-05-21). Чтобы поле read-receipt справа не дёргалось — выравниваем
   через flex с пустым местом под кнопку.*/
.message .m-edit-btn {
    background: transparent;
    border: none;
    padding: 0 4px;
    margin-left: auto;  /* прижимаем вправо */
    color: #4a6fa5;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.1s;
}

.message:hover .m-edit-btn {
    opacity: 1;
}

.message .m-edit-btn:hover {
    color: #234070;
}

.message .m-edited {
    color: #888;
    font-style: italic;
    cursor: help;
}

.message .m-read {
    color: #888;
    font-weight: 600;
}

.message .m-read.read {
    color: #2e8a4f;
}

.message.editing {
    background: #fff;
    border-color: #888;
}

.message .m-editor {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.message .m-editor-input {
    width: 100%;
    min-height: 60px;
    font: inherit;
    padding: 6px 8px;
    border: 1px solid #c0c0c0;
    background: #fff;
    resize: vertical;
    box-sizing: border-box;
}

.message .m-editor-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.message .m-editor-actions button {
    padding: 4px 10px;
    font-size: 12px;
}

/* ----- Load older messages ----- */

.load-older {
    align-self: center;
    margin: 4px 0 10px;
    background: #fff;
    border: 1px solid #c0c0c0;
    padding: 6px 14px;
    color: #444;
    cursor: pointer;
    font-size: 12px;
}

.load-older:hover {
    background: #ededed;
}

.load-older:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ----- Media ----- */

.message .m-photo-link {
    display: block;
    margin-bottom: 4px;
}

.message .m-photo {
    display: block;
    max-width: 100%;
    max-height: 320px;
    border: 1px solid #d4d4d4;
}

.message .m-voice {
    display: block;
    width: 100%;
    max-width: 280px;
    margin-bottom: 4px;
}

.message .m-sticker {
    display: block;
    max-width: 128px;
    max-height: 128px;
    margin-bottom: 4px;
}

.message .m-doc {
    display: inline-block;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #d4d4d4;
    color: #2c5aa0;
    text-decoration: none;
    margin-bottom: 4px;
    word-break: break-all;
}

.message .m-doc:hover {
    background: #f5f5f5;
}

.message .m-media-stub {
    color: #888;
    font-style: italic;
    margin-bottom: 4px;
}

/* Собеседник удалил сообщение: текст остаётся видимым, но зачёркнутым и
   приглушённым — оператор должен понимать, что именно стёрли. */
.message.deleted .m-text {
    text-decoration: line-through;
    color: #999;
}

.message.deleted .m-media-stub,
.message.deleted .m-photo,
.message.deleted .m-sticker {
    opacity: 0.5;
}

.message .m-deleted {
    color: #b00020;
    font-style: italic;
    cursor: help;
}

/* Звонок — служебное событие по центру ленты, не пузырь. */
.m-call {
    align-self: center;
    max-width: 70%;
    margin: 6px 0;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 12px;
    color: #555;
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.m-call.missed {
    border-color: #e0b4b4;
    color: #b00020;
}

.m-call .m-call-time {
    color: #999;
    font-size: 11px;
}

.send-form {
    flex: 0 0 auto;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 10px;
    display: flex;
    gap: 8px;
}

.send-form input {
    flex: 1 1 auto;
}

.chat-empty {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
}

/* ----- Вкладки «Работа» / «Удачные» ----- */

.tabs {
    display: flex;
    gap: 0;
    margin-right: 8px;
}

.tab-btn {
    border-right-width: 0;
    color: #555;
}

.tab-btn:last-child {
    border-right-width: 1px;
}

.tab-btn.active {
    background: #eef3f8;
    border-color: #9fb4cc;
    color: #222;
    font-weight: 600;
}

/* Соседняя кнопка не должна съедать левую границу активной. */
.tab-btn.active + .tab-btn {
    border-left-color: #9fb4cc;
}

/* ----- Витрина «Удачные» ----- */

.good-panel {
    flex: 0 0 300px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.good-title {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid #e0e0e0;
    color: #444;
    font-weight: 600;
}

.good-refresh {
    background: transparent;
    border: none;
    padding: 0;
    width: 22px;
    height: 22px;
    line-height: 22px;
    font-size: 15px;
    text-align: center;
    opacity: 0.6;
}

.good-refresh:hover {
    background: transparent;
    opacity: 1;
}

.good-list {
    flex: 1 1 auto;
    overflow-y: auto;
}

.good-empty,
.good-view-empty {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 13px;
    pointer-events: none;
}

.good-view-empty {
    top: 0;
}

.good-item {
    padding: 10px 14px;
    border-bottom: 1px solid #ededed;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.good-item:hover {
    background: #fafafa;
}

.good-item.active {
    background: #eef3f8;
}

.good-item .gi-line1 {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
    min-width: 0;
}

.good-item .gi-name {
    font-weight: 600;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 auto;
}

.good-item .gi-time,
.good-item .gi-count {
    color: #888;
    font-size: 12px;
    flex: 0 0 auto;
}

.good-item .gi-meta {
    color: #777;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.good-item .gi-preview {
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.good-more {
    display: block;
    width: calc(100% - 24px);
    margin: 12px;
}

.good-loading {
    padding: 12px 14px;
    color: #888;
    font-size: 13px;
}

.good-view {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fafafa;
    position: relative;
}

.good-view-header {
    flex: 0 0 auto;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.good-view-header .gv-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.good-view-header .gv-name {
    font-weight: 600;
    color: #222;
}

.good-view-header .gv-meta,
.good-view-header .gv-marked {
    color: #777;
    font-size: 12px;
}

.gv-badge {
    flex: 0 0 auto;
    color: #2e8a4f;
    border: 1px solid #9ccfae;
    background: #f0f8f2;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
}

.good-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.good-note {
    color: #999;
    font-size: 13px;
    align-self: center;
}

/* ----- Pinned panel ----- */

.pinned-panel {
    flex: 0 0 180px;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.pinned-title {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid #e0e0e0;
    color: #444;
    font-weight: 600;
}

.pinned-clear {
    background: transparent;
    border: none;
    padding: 0;
    width: 22px;
    height: 22px;
    line-height: 22px;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    opacity: 0.6;
}

.pinned-clear:hover {
    opacity: 1;
}

.pinned-clear:disabled {
    opacity: 0.3;
    cursor: default;
}

.pinned-list {
    flex: 1 1 auto;
    overflow-y: auto;
}

.pinned-empty {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    pointer-events: none;
}

.pin-item {
    padding: 10px 14px;
    border-bottom: 1px solid #ededed;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #222;
}

.pin-item:hover {
    background: #fafafa;
}

/* ----- Pin button in chat header ----- */

.pin-btn {
    border-color: #c0c0c0;
    color: #222;
    margin-right: 6px;
}

.pin-btn.active {
    border-color: #888;
    background: #ededed;
}

/* ----- Flag (пометка) button in chat header ----- */

.flag-btn {
    border-color: #c0c0c0;
    color: #222;
    margin-right: 6px;
}

.flag-btn:hover {
    background: #f0ecfb;
}

.flag-btn.active {
    background: #e6dcff;
    border-color: #8a6fd8;
    color: #40297f;
    font-weight: 600;
}

/* ----- Training label buttons in chat header ----- */

.train-btn {
    margin-right: 6px;
    border-color: #c0c0c0;
    color: #444;
}

.train-btn.good:hover {
    background: #ecf5ee;
}

.train-btn.bad:hover {
    background: #fbeaea;
}

/* Активная метка — заметная заливка. Зелёный для good, красный для bad,
   обе кнопки видимы одновременно (можно переключить вторую за один клик). */
.train-btn.good.active {
    background: #d4edd9;
    border-color: #6fab7a;
    color: #1f6b30;
    font-weight: 600;
}

.train-btn.bad.active {
    background: #f4d4d4;
    border-color: #c08080;
    color: #7a1f1f;
    font-weight: 600;
}

/* ----- Notifications panel ----- */

.notifications {
    flex: 0 0 260px;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.notif-title {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    color: #444;
    font-weight: 600;
}

.notif-search {
    flex: 0 0 auto;
    margin: 8px 12px;
    padding: 5px 8px;
    border: 1px solid #c0c0c0;
    background: #fff;
}

.notif-list {
    flex: 1 1 auto;
    overflow-y: auto;
}

.notif-empty {
    position: absolute;
    top: 84px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    pointer-events: none;
}

.notif-item {
    padding: 10px 14px;
    border-bottom: 1px solid #ededed;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.notif-item:hover {
    background: #fafafa;
}

.notif-item.notif-unread {
    background: #fff8c5;
}

.notif-item.notif-unread:hover {
    background: #fff2a3;
}

/* notif-marked — диалог помечен оператором (dialogs.flagged). Сиреневый
   специально не пересекается с жёлтым «непрочитано» и зелёным «свежее»:
   определён ПОСЛЕ notif-unread (перебивает его фон) и ДО .fresh, поэтому
   свежее уведомление сначала мигает зелёным, а через 8с оседает сиреневым.
   Полоска слева — inset box-shadow, а не border: не сдвигает paddings и
   переживает смену фона любым из соседних классов. */
.notif-item.notif-marked {
    background: #e6dcff;
    box-shadow: inset 3px 0 0 #6b46c1;
}

.notif-item.notif-marked:hover {
    background: #dccdff;
}

/* fresh — 8-секундная зелёная мигалка для свежепришедших.
   Определена ПОСЛЕ notif-unread, поэтому при пересечении (новое уведомление
   почти всегда непрочитано) выигрывает зелёный — оператор видит «новое»,
   а уже на 9-й секунде остаётся жёлтый «непрочитано». */
.notif-item.fresh {
    background: #f3f8ec;
}

.notif-item.fresh:hover {
    background: #ebf3df;
}

.notif-item .nf-time {
    color: #888;
    font-size: 12px;
}

.notif-item .nf-account {
    color: #555;
    font-size: 12px;
}

.notif-item .nf-sender {
    color: #222;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-item .nf-phone {
    color: #555;
    font-size: 12px;
}

.notif-item .nf-text {
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-item .nf-text.muted {
    color: #888;
    font-style: italic;
}

/* ----- Allowed addresses modal ----- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: #fff;
    border: 1px solid #c0c0c0;
    width: 520px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: #444;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 16px;
    padding: 2px 8px;
    color: #555;
}

.modal-close:hover {
    background: #ededed;
}

.modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 14px;
}

.modal-empty {
    color: #888;
    text-align: center;
    padding: 30px 0;
}

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

.addr-card {
    border: 1px solid #e0e0e0;
    background: #fafafa;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.addr-label {
    font-weight: 600;
    color: #222;
    font-size: 13px;
}

.addr-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #444;
    word-break: break-all;
    cursor: pointer;
    padding: 2px 4px;
    border: 1px dashed transparent;
}

.addr-value:hover {
    background: #fff;
    border-color: #c0c0c0;
}

/* ----- Общие группы с собеседником ----- */

.common-chats-btn {
    border-color: #c0c0c0;
    color: #222;
    margin-right: 6px;
}

.common-chats-btn:hover {
    background: #eaf1f8;
}

/* Окно шире адресного: в строке живут автор, время и текст сообщения. */
.modal-card-wide {
    width: 720px;
}

.cc-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cc-note {
    color: #7a5c00;
    background: #fdf6e3;
    border: 1px solid #e8d9a8;
    padding: 6px 8px;
    font-size: 12px;
}

.cc-group {
    border: 1px solid #e0e0e0;
    background: #fafafa;
}

.cc-group-head {
    padding: 6px 10px;
    border-bottom: 1px solid #e0e0e0;
    background: #f0f0f0;
    font-weight: 600;
    font-size: 13px;
    color: #222;
    position: sticky;
    top: 0;
}

.cc-group-meta {
    font-weight: 400;
    color: #777;
    font-size: 12px;
}

.cc-group-error {
    padding: 8px 10px;
    color: #888;
    font-size: 12px;
}

.cc-msg {
    padding: 5px 10px;
    border-bottom: 1px solid #ededed;
}

.cc-msg:last-child {
    border-bottom: none;
}

/* Строки собеседника — ради них окно и открывают. */
.cc-msg.peer {
    background: #eef5ff;
    border-left: 3px solid #5b8dd6;
}

/* Наши собственные сообщения в группе. */
.cc-msg.own {
    border-left: 3px solid #cfcfcf;
}

.cc-msg-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    margin-bottom: 2px;
}

.cc-author {
    font-weight: 600;
    color: #444;
}

.cc-time {
    color: #999;
    white-space: nowrap;
}

.cc-msg-text {
    font-size: 13px;
    color: #222;
    white-space: pre-wrap;
    word-break: break-word;
}

.cc-media {
    color: #777;
    font-style: italic;
}
