.msgr {
    display: grid;
    grid-template-columns: 300px 1fr;

    grid-template-rows: minmax(0, 1fr);
    height: 78vh;
    min-height: 420px;
    overflow: hidden;
    padding: 0;
}
.msgr__side {
    border-right: 1px solid rgba(var(--color-darken) / 13%);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.msgr__title {
    font-size: 26px;
    font-weight: 700;
    padding: 18px 18px 12px;
}
.msgr__search {
    position: relative;
    padding: 0 14px 14px;
}
.msgr__search i,
.msgr__search span[class*="fa-"] {
    position: absolute;
    left: 28px;
    top: 12px;
    font-size: 13px;
    color: var(--color-muted);
}
.msgr__search input {
    width: 100%;
    padding: 9px 12px 9px 38px!important;
    border: 0!important;
    border-radius: 20px!important;
    background: rgba(var(--color-darken) / 7%)!important;
    color: var(--color-text)!important;
    font: inherit!important;
    font-size: 14px!important;
    outline: none!important;
	min-height: unset!important;
}
.msgr__list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.msgr__empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--color-muted);
    font-size: 14px;
}
.msgr__item {
    display: flex;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    cursor: pointer;
    background: none;
    border: 0;
    color: var(--color-text);
    font: inherit;
}
.msgr__item:hover { background: rgba(var(--color-darken) / 6%); }
.msgr__item.is-active { background: rgba(255, 92, 87, .1); }
.msgr__item-foto {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.msgr__item-body { flex: 1; min-width: 0; }
.msgr__item-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.msgr__item-name { font-weight: 600; font-size: 15px; }
.msgr__item-ago { color: var(--color-muted); font-size: 11px; flex-shrink: 0; }
.msgr__item-last {
    color: var(--color-muted);
    font-size: 13px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msgr__item-unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--color-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.msgr__chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.msgr__placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
    font-size: 15px;
}
.msgr__placeholder[hidden] { display: none; }
.msgr__room { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.msgr__room[hidden] { display: none; }
.msgr__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(var(--color-darken) / 13%);
	margin-right: 30px;
}
.msgr__head-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text);
}
.msgr__head-foto {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}
.msgr__head-name { font-weight: 700; font-size: 16px; }
.msgr__head-status { color: var(--color-muted); font-size: 12px; margin-top: 1px; }
.msgr__head-status.is-online { color: var(--color-green, #3ecf8e); }
.msgr__menu { position: relative; }
.msgr__menu-btn {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    color: var(--color-muted);
    font-size: 17px;
    cursor: pointer;
}
.msgr__menu-btn:hover { color: var(--color-text); background: rgba(var(--color-darken) / 8%); }
.msgr__menu-drop {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
    width: 240px;
    background: var(--card-bg, #242525);
    border: 1px solid rgba(var(--color-darken) / 13%);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    padding: 6px;
}
.msgr__menu-drop[hidden] { display: none; }
.msgr__menu-drop button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--color-text);
    font-size: 14px;
    cursor: pointer;
}
.msgr__menu-drop button:hover { background: rgba(var(--color-darken) / 8%); }
.msgr__menu-danger { color: var(--color-red) !important; }
.msgr__feed {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.msgr__date {
    text-align: center;
    color: var(--color-muted);
    font-size: 12px;
    margin: 10px 0 4px;
}
.msgr__msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 72%;
}
.msgr__msg--my { align-self: flex-end; flex-direction: row-reverse; }
.msgr__msg-foto {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.msgr__msg-bubble {
    background: rgba(var(--color-darken) / 8%);
    border-radius: 16px;
    padding: 9px 14px;
    font-size: 14px;
    line-height: 1.4;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.msgr__unread-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
    color: var(--color-red);
    font-size: 12px;
    flex-shrink: 0;
}
.msgr__unread-line::before,
.msgr__unread-line::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 92, 87, .35);
}

.msgr__more {
    align-self: center;
    padding: 6px 14px;
    margin-bottom: 4px;
    border-radius: 14px;
    background: rgba(var(--color-darken) / 8%);
    color: var(--color-muted);
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
}
.msgr__more:hover { color: var(--color-text); }

.msgr__msg, .msgr__date, .msgr__notice { flex-shrink: 0; }
.msgr__msg--my .msgr__msg-bubble { background: rgba(255, 92, 87, .16); }
.msgr__msg-time {
    color: var(--color-muted);
    font-size: 11px;
    flex-shrink: 0;
}

.msgr__tick {
    color: var(--color-muted);
    font-size: 11px;
}
.msgr__tick.is-read { color: var(--color-red); }
.msgr__item-ago .msgr__tick { margin-right: 4px; }

.msgr__notice {
    text-align: center;
    color: var(--color-muted);
    font-size: 13px;
    padding: 8px 16px;
}
.msgr__form {
    display: flex;
    gap: 10px;

    align-items: flex-end;
    padding: 12px 16px;
    border-top: 1px solid rgba(var(--color-darken) / 13%);
}
.msgr__form input,
.msgr__form textarea {
    flex: 1;
    padding: 11px 16px;
    border: 0;
    border-radius: 12px;
    background: rgba(var(--color-darken) / 7%);
    color: var(--color-text);
    font: inherit;
    font-size: 14px;
    outline: none;
}

.msgr__form textarea {
    resize: none;
    overflow-y: auto;
    min-height: 42px;
    height: 42px;
    max-height: 132px;
    line-height: 1.35;
    display: block;
}
.msgr__form input:disabled,
.msgr__form textarea:disabled { opacity: .5; }
.msgr__send {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    color: var(--color-muted);
    font-size: 17px;
    cursor: pointer;
}
.msgr__send:hover { color: var(--color-red); }

.msgr__back { display: none; }

@media screen and (max-width: 900px) {

    .msgr {
        grid-template-columns: 1fr;

        height: calc(100vh - 120px);
        height: calc(100dvh - 120px);
        min-height: 320px;
    }
    .msgr__side { border-right: 0; }
    .msgr__list { max-height: none; }


    .msgr__chat { display: none; }
    .msgr.is-chat-open .msgr__side { display: none; }
    .msgr.is-chat-open .msgr__chat { display: flex; }


    .msgr__placeholder { display: none; }

    .msgr__back {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        margin-left: -6px;
        font-size: 18px;
        color: var(--color-text);
        flex: none;
    }

    .msgr__head { gap: 8px; }
    .msgr__head-user { flex: 1; min-width: 0; }
    .msgr__head-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.msgr-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.msgr-modal[hidden] { display: none; }
.msgr-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}
.msgr-modal__box {
    position: relative;
    width: 100%;
    max-width: 560px;
    height: 92vh;

    height: 92dvh;

    background: var(--card-bg);
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: msgrModalUp .18s ease-out;
}
@keyframes msgrModalUp { from { transform: translateY(18px); opacity: .6; } }
.msgr-modal__close {
    position: absolute;
    right: 8px;
    top: 14px;
    z-index: 2;
    width: 34px;
    height: 34px;
    font-size: 17px;
    color: var(--color-muted);
}
.msgr-modal__close:hover { color: var(--color-text); }

.msgr--modal {
    min-height: 0;
    max-height: none;
    height: auto;
    flex: 1;
    border-radius: 0;
    background: var(--card-bg);
}

body.is-msgr-open { overflow: hidden; }

@media screen and (min-width: 901px) {

    .msgr-modal { display: none; }
}
