/* =========================================================
   MINDLYCHAT
   Apple Liquid Glass UI
   Global Base Styles
========================================================= */


/* =========================================================
   VARIABLES
========================================================= */

:root {

    --bg: #f4f6fa;

    --text: #11131a;
    --muted: #858a96;

    --glass: rgba(255, 255, 255, 0.62);
    --glass-strong: rgba(255, 255, 255, 0.78);

    --border: rgba(255, 255, 255, 0.82);

    --shadow:
        0 20px 60px rgba(30, 40, 70, 0.08);

    --shadow-soft:
        0 10px 35px rgba(30, 40, 70, 0.06);

    --blue: #5b7cff;
    --blue-light: #6d8aff;
    --purple: #8d70ff;

    --green: #34c759;

    --radius-large: 28px;
    --radius-medium: 22px;

    --safe-top:
        env(
            safe-area-inset-top,
            0px
        );

    --safe-bottom:
        env(
            safe-area-inset-bottom,
            0px
        );
}


/* =========================================================
   RESET
========================================================= */

*,
*::before,
*::after {

    box-sizing: border-box;

    margin: 0;
    padding: 0;

    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}


html {

    width: 100%;
    min-height: 100%;

    background: var(--bg);

    overflow-x: hidden;

    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;

    -webkit-tap-highlight-color: transparent;
}


body {

    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    margin: 0;
    padding: 0;
    
 font-weight: 400;

   font-family:
        "Manrope",
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        "SF Pro Text",
        "Segoe UI",
        Arial,
        sans-serif;

    color: var(--text);

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;

    overflow-x: hidden;

    overscroll-behavior-x: none;
}


/* =========================================================
   FORM ELEMENTS
   IMPORTANT FOR iOS
========================================================= */

button,
input,
textarea,
select {

    font-family: inherit;

    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;

    touch-action: manipulation;
}


input,
textarea,
select {

    /*
     * iOS Safari автоматически увеличивает страницу,
     * если размер текста input меньше 16px.
     */

    font-size: 16px;
    
     font-weight: 500;
}


button {

    border: 0;

    background: none;

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;
}


a {

    color: inherit;

    text-decoration: none;

    -webkit-tap-highlight-color: transparent;

    touch-action: manipulation;
}


img {

    display: block;

    max-width: 100%;
}


button:focus,
input:focus,
textarea:focus,
select:focus {

    outline: none;
}


/* =========================================================
   MOBILE STATIC UI
========================================================= */

html,
body {

    /*
     * Не позволяем браузеру самостоятельно
     * изменять масштаб текста.
     */

    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;

    /*
     * Запрещаем горизонтальный overflow.
     */

    overflow-x: hidden;

    /*
     * Предотвращаем горизонтальный overscroll.
     */

    overscroll-behavior-x: none;
}


/* =========================================================
   APP SHELL
========================================================= */

.app-shell {

    position: relative;

    width: 100%;

    min-height: 100vh;
    min-height: 100dvh;

    overflow-x: hidden;
    overflow-y: visible;
}


/* =========================================================
   MAIN APP CONTAINER
========================================================= */

/*
   Текущая структура app.php:

   .app-shell
       .messenger-app
           .app-topbar
           .search-panel
           .app-content
           .new-chat
           .bottom-nav
*/

.messenger-app {

    position: relative;

    width: min(
        100%,
        1200px
    );

    min-height: 100vh;
    min-height: 100dvh;

    margin: 0 auto;

    padding:
        18px
        18px
        calc(
            115px + var(--safe-bottom)
        );

    z-index: 2;
}


/*
   Совместимость со старой структурой.
*/

.app {

    position: relative;

    width: min(
        100%,
        1200px
    );

    min-height: 100vh;
    min-height: 100dvh;

    margin: 0 auto;

    padding:
        18px
        18px
        calc(
            115px + var(--safe-bottom)
        );

    z-index: 2;
}


/* =========================================================
   DESKTOP CENTERING
========================================================= */

@media (min-width: 901px) {

    .messenger-app,
    .app {

        width: min(
            calc(100% - 40px),
            1200px
        );

        padding-left: 0;
        padding-right: 0;
    }

}


/* =========================================================
   AMBIENT LIGHT
========================================================= */

.ambient {

    position: fixed;

    width: 420px;
    height: 420px;

    border-radius: 50%;

    filter: blur(90px);

    pointer-events: none;

    opacity: .55;

    z-index: 0;

    will-change: transform;
}


.ambient-one {

    top: -180px;
    left: -120px;

    background:
        rgba(
            120,
            150,
            255,
            .28
        );
}


.ambient-two {

    top: 35%;
    right: -180px;

    background:
        rgba(
            188,
            130,
            255,
            .20
        );
}


.ambient-three {

    bottom: -180px;
    left: 20%;

    background:
        rgba(
            90,
            210,
            220,
            .17
        );
}


/* =========================================================
   GLASS
========================================================= */

.glass {

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.76),
            rgba(255,255,255,.45)
        );

    border:
        1px solid var(--border);

    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(
            255,
            255,
            255,
            .95
        );

    backdrop-filter:
        blur(30px)
        saturate(160%);

    -webkit-backdrop-filter:
        blur(30px)
        saturate(160%);
}


/* =========================================================
   TOP BAR
========================================================= */

.app-topbar,
.topbar {

    position: sticky;

    top: 14px;

    z-index: 20;

    display: flex;

    align-items: center;

    justify-content: space-between;

    width: 100%;

    padding:
        14px 15px;

    margin-bottom: 18px;

    border-radius:
        var(--radius-large);
}


/* =========================================================
   BRAND
========================================================= */

.brand {

    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 0;
}


.brand-mark {

    position: relative;

    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background:
        linear-gradient(
            145deg,
            #eef2ff,
            #ffffff
        );

    box-shadow:
        0 8px 20px
        rgba(
            91,
            124,
            255,
            .15
        ),

        inset 0 1px 0 #fff;
}





.brand-name {

    font-size: 17px;

    font-weight: 800;

    letter-spacing: -0.7px;
}


.brand-subtitle {

    margin-top: 2px;

    color: var(--muted);

    font-size: 10px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

    max-width: 280px;
    
     font-weight: 500;
    letter-spacing: -0.1px;
}


/* =========================================================
   TOP ACTIONS
========================================================= */

.top-actions {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    flex: 0 0 auto;
}


.icon-button,
.profile-button {

    position: relative;

    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background:
        rgba(
            255,
            255,
            255,
            .58
        );

    box-shadow:
        inset 0 1px 0 #fff;

    transition:
        transform .2s ease,
        background .2s ease;
}


.icon-button:active,
.profile-button:active {

    transform:
        scale(.94);
}


.icon-button svg {

    width: 20px;
    height: 20px;

    fill: none;

    stroke: #535967;

    stroke-width: 1.8;

    stroke-linecap: round;
}


/* =========================================================
   PROFILE BUTTON
========================================================= */

.profile-button {

    overflow: visible;
}


.profile-button img,
.profile-button > span {

    width: 32px;
    height: 32px;

    border-radius: 50%;

    object-fit: cover;
}


.profile-button > span {

    display: flex;

    align-items: center;
    justify-content: center;

    color: white;

    font-size: 13px;

    font-weight: 700;

    background:
        linear-gradient(
            145deg,
            #647eff,
            #a071ff
        );
}


/* =========================================================
   ONLINE DOT
========================================================= */

.online-dot {

    position: absolute;

    width: 9px;
    height: 9px;

    right: 1px;
    bottom: 1px;

    border:
        2px solid white;

    border-radius: 50%;

    background:
        var(--green);
}


/* =========================================================
   SEARCH PANEL
========================================================= */

.search-panel {

    display: none;

    width: 100%;

    padding: 10px;

    margin-bottom: 18px;

    border-radius: 20px;

    animation:
        panelIn .25s ease;
}


.search-panel.visible {

    display: block;
}


.search-field {

    display: flex;

    align-items: center;

    gap: 9px;

    width: 100%;

    min-height: 44px;

    padding:
        0 10px;

    border-radius: 14px;

    background:
        rgba(
            255,
            255,
            255,
            .7
        );
}


.search-field svg {

    width: 18px;
    height: 18px;

    flex: 0 0 18px;

    fill: none;

    stroke: #9297a2;

    stroke-width: 1.8;

    stroke-linecap: round;
}


.search-field input {

    flex: 1;

    min-width: 0;

    width: 100%;

    height: 42px;

    border: 0;

    outline: none;

    background: transparent;

    color: var(--text);

    /*
     * Не уменьшаем ниже 16px.
     */

    font-size: 16px;

    -webkit-appearance: none;
    appearance: none;
}


.search-field input::placeholder {

    color: #9ca0aa;

    opacity: 1;
}


.search-field button {

    flex: 0 0 auto;

    min-width: 32px;
    min-height: 32px;

    font-size: 24px;

    color: #858a94;

    line-height: 1;
}


/* =========================================================
   CONTENT
========================================================= */

.app-content,
.content {

    position: relative;

    z-index: 2;

    width: 100%;
}


/* =========================================================
   SECTION HEADING
========================================================= */

.section-heading {

    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 20px;

    padding:
        5px
        5px
        14px;
}


.section-heading h1 {

    font-size: 29px;

   font-weight: 800;
   
    letter-spacing: -1.2px;
}


.section-heading p {

    margin-top: 4px;
    
     font-weight: 500;

    color: var(--muted);

    font-size: 13px;
}


/* =========================================================
   FILTER
========================================================= */

.filter-button {

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    padding:
        9px
        12px;

    border-radius: 13px;

    color: #686d78;

    background:
        rgba(
            255,
            255,
            255,
            .5
        );

    font-size: 12px;

    white-space: nowrap;

    box-shadow:
        inset 0 1px 0 white;
}


.filter-button span {

    width: 7px;
    height: 7px;

    flex: 0 0 7px;

    border-radius: 50%;

    background:
        var(--blue);
}


/* =========================================================
   CHAT LIST
========================================================= */

.chat-list {

    display: flex;

    flex-direction: column;

    gap: 10px;

    width: 100%;
}


/* =========================================================
   CHAT CARD
========================================================= */

.chat-card {

    position: relative;

    display: flex;

    align-items: center;

    gap: 14px;

    width: 100%;

    min-height: 84px;

    padding:
        13px
        14px;

    border-radius:
        var(--radius-medium);

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;

    overflow: hidden;
}


.chat-card::after {

    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: 50%;
    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(
                255,
                255,
                255,
                .9
            ),
            transparent
        );

    opacity: .8;
}


.chat-card:hover {

    transform:
        translateY(-2px);

    box-shadow:
        0 22px 50px
        rgba(
            30,
            40,
            70,
            .12
        ),

        inset 0 1px 0 white;
}


.chat-card:active {

    transform:
        scale(.985);
}


/* =========================================================
   CHAT AVATAR
========================================================= */

.chat-avatar {

    position: relative;

    width: 55px;
    height: 55px;

    flex: 0 0 55px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 18px;

    overflow: visible;

    color: white;

    font-size: 18px;

    font-weight: 700;

    box-shadow:
        inset 0 1px 0
        rgba(
            255,
            255,
            255,
            .45
        ),

        0 8px 20px
        rgba(
            0,
            0,
            0,
            .08
        );
}


.chat-avatar img {

    width: 100%;
    height: 100%;

    border-radius: inherit;

    object-fit: cover;
}


.avatar-blue {

    background:
        linear-gradient(
            145deg,
            #6484ff,
            #6eacff
        );
}


.avatar-purple {

    background:
        linear-gradient(
            145deg,
            #a072ff,
            #d178ff
        );
}


.avatar-green {

    background:
        linear-gradient(
            145deg,
            #36bd8a,
            #55d8b1
        );
}


.status-dot {

    position: absolute;

    right: -2px;
    bottom: -2px;

    width: 13px;
    height: 13px;

    border-radius: 50%;

    border:
        3px solid
        rgba(
            255,
            255,
            255,
            .9
        );

    background:
        var(--green);
}


.group-avatar svg {

    width: 28px;
    height: 28px;

    fill: none;

    stroke: white;

    stroke-width: 1.6;

    stroke-linecap: round;

    stroke-linejoin: round;
}


/* =========================================================
   CHAT INFO
========================================================= */

.chat-info {

    flex: 1;

    min-width: 0;

    overflow: hidden;
}


.chat-top,
.chat-bottom {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    min-width: 0;
}


.chat-top h2 {

    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-size: 15px;

   font-weight: 700;
   
    letter-spacing: -0.25px;
}


.chat-top time {

    flex: 0 0 auto;

    color: #9296a0;

    font-size: 11px;
    
     font-weight: 500;
}


.chat-bottom {

    margin-top: 6px;
}


.chat-bottom p {

    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    color: #7c818c;

    font-size: 13px;
    
     font-weight: 400;
}


.chat-bottom strong {

    color: #606570;
    
    font-weight: 600;
}


/* =========================================================
   UNREAD
========================================================= */

.unread {

    min-width: 21px;
    height: 21px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding:
        0 6px;

    flex: 0 0 auto;

    border-radius: 10px;

    color: white;

    background:
        linear-gradient(
            135deg,
            #6583ff,
            #806dff
        );

    font-size: 10px;

    font-weight: 700;
}


.photo-message {

    display: flex;

    align-items: center;

    gap: 6px;
}


.photo-icon {

    font-size: 14px;

    color: #777d89;
}


/* =========================================================
   NEW CHAT
========================================================= */

.new-chat {

    position: fixed;

    right:
        max(
            22px,
            calc(
                (100vw - 1200px) / 2 + 22px
            )
        );

    bottom:
        calc(
            92px + var(--safe-bottom)
        );

    z-index: 30;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 48px;

    padding:
        13px
        17px;

    border-radius: 18px;

    color: #fff;

    background:
        linear-gradient(
            135deg,
            rgba(91,124,255,.94),
            rgba(128,102,255,.94)
        );

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            .5
        );

    box-shadow:
        0 16px 35px
        rgba(
            91,
            124,
            255,
            .28
        ),

        inset 0 1px 0
        rgba(
            255,
            255,
            255,
            .4
        );

    font-size: 13px;

    font-weight: 700;

    transition:
        transform .2s ease;
}


.new-chat:hover {

    transform:
        translateY(-3px);
}


.new-chat:active {

    transform:
        scale(.95);
}


.new-chat svg {

    width: 18px;
    height: 18px;

    flex: 0 0 18px;

    fill: none;

    stroke: white;

    stroke-width: 2;

    stroke-linecap: round;
}


/* =========================================================
   BOTTOM NAVIGATION
   ALWAYS CENTERED
========================================================= */

.bottom-nav {

    position: fixed;

    left: 50%;

    bottom:
        calc(
            14px + var(--safe-bottom)
        );

    transform:
        translateX(-50%);

    z-index: 25;

    width:
        min(
            calc(100% - 28px),
            520px
        );

    min-height: 62px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding:
        7px;

    border-radius: 24px;
}


/*
   Каждый пункт занимает одинаковую ширину,
   а содержимое находится строго по центру.
*/

.nav-item {

    position: relative;

    width: 33.333333%;

    min-height: 48px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 4px;

    padding:
        7px 5px;

    border-radius: 17px;

    color: #8b909a;

    text-align: center;

    transition:
        background .2s ease,
        color .2s ease,
        transform .2s ease;
}


.nav-item svg {

    width: 21px;
    height: 21px;

    flex: 0 0 21px;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.7;

    stroke-linecap: round;

    stroke-linejoin: round;
}


.nav-item span {

    display: block;

    width: 100%;

    font-size: 10px;

    font-weight: 600;

    line-height: 1;

    text-align: center;
}


.nav-item.active {

    color: #5c78ef;

    background:
        rgba(
            255,
            255,
            255,
            .65
        );

    box-shadow:
        inset 0 1px 0 white;
}


.nav-item:active {

    transform:
        scale(.94);
}


/* =========================================================
   OVERLAY
========================================================= */

.overlay {

    position: fixed;

    inset: 0;

    z-index: 50;

    background:
        rgba(
            25,
            30,
            45,
            .18
        );

    backdrop-filter:
        blur(5px);

    -webkit-backdrop-filter:
        blur(5px);

    opacity: 0;

    visibility: hidden;

    transition:
        opacity .25s ease,
        visibility .25s ease;
}


.overlay.visible {

    opacity: 1;

    visibility: visible;
}


/* =========================================================
   PROFILE SHEET
========================================================= */

.profile-sheet {

    position: fixed;

    left: 50%;

    bottom: 0;

    z-index: 60;

    width:
        min(
            100%,
            520px
        );

    padding:
        14px
        22px
        calc(
            25px + var(--safe-bottom)
        );

    border-radius:
        32px
        32px
        0
        0;

    transform:
        translate(-50%, 110%);

    transition:
        transform .35s
        cubic-bezier(
            .2,
            .8,
            .2,
            1
        );

    text-align: center;
}


.profile-sheet.visible {

    transform:
        translate(-50%, 0);
}


/* =========================================================
   SHEET HANDLE
========================================================= */

.sheet-handle {

    width: 42px;
    height: 5px;

    margin:
        0 auto 24px;

    border-radius: 5px;

    background:
        rgba(
            120,
            125,
            135,
            .22
        );
}


/* =========================================================
   PROFILE AVATAR
========================================================= */

.profile-large-avatar {

    position: relative;

    width: 82px;
    height: 82px;

    margin:
        0 auto 15px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 28px;

    overflow: visible;

    color: white;

    font-size: 28px;

    font-weight: 700;

    background:
        linear-gradient(
            145deg,
            #647eff,
            #a071ff
        );

    box-shadow:
        0 15px 35px
        rgba(
            91,
            124,
            255,
            .25
        );
}


.profile-large-avatar img {

    width: 100%;
    height: 100%;

    border-radius: inherit;

    object-fit: cover;
}


.profile-sheet h2 {

    font-size: 20px;
}


.profile-sheet > p {

    margin-top: 4px;

    color: #34a853;

    font-size: 13px;
}


.profile-status {

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 6px;

    margin-top: 8px;

    color: #34a853;

    font-size: 12px;
}


.profile-status span {

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background:
        var(--green);
}


/* =========================================================
   SHEET BUTTONS
========================================================= */

.sheet-button {

    width: 100%;

    min-height: 48px;

    margin-top: 18px;

    padding: 14px;

    border-radius: 16px;

    color: white;

    background:
        linear-gradient(
            135deg,
            #617eff,
            #806bff
        );

    font-size: 14px;

    font-weight: 600;
}


.sheet-button.secondary {

    margin-top: 8px;

    color: #777d88;

    background:
        rgba(
            255,
            255,
            255,
            .6
        );
}


/* =========================================================
   MODAL
========================================================= */

.modal {

    position: fixed;

    inset: 0;

    z-index: 100;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(
            20,
            25,
            40,
            .18
        );

    backdrop-filter:
        blur(10px);

    -webkit-backdrop-filter:
        blur(10px);

    opacity: 0;

    visibility: hidden;

    transition:
        opacity .25s ease,
        visibility .25s ease;
}


.modal.visible {

    opacity: 1;

    visibility: visible;
}


.modal-card {

    position: relative;

    width:
        min(
            100%,
            390px
        );

    padding: 30px;

    border-radius: 30px;

    text-align: center;

    transform:
        translateY(20px)
        scale(.97);

    transition:
        transform .3s
        cubic-bezier(
            .2,
            .8,
            .2,
            1
        );
}


.modal.visible .modal-card {

    transform:
        translateY(0)
        scale(1);
}


.modal-close {

    position: absolute;

    top: 15px;
    right: 15px;

    width: 34px;
    height: 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 12px;

    color: #777c87;

    background:
        rgba(
            255,
            255,
            255,
            .6
        );

    font-size: 22px;
}


.modal-icon {

    width: 62px;
    height: 62px;

    margin:
        0 auto 17px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 21px;

    color: white;

    background:
        linear-gradient(
            135deg,
            #637fff,
            #8870ff
        );

    font-size: 30px;

    box-shadow:
        0 14px 30px
        rgba(
            91,
            124,
            255,
            .25
        );
}


.modal-card h2 {

    font-size: 22px;

    letter-spacing: -.5px;
    
    font-weight: 800;
}


.modal-card > p {

    margin-top: 7px;

    color: #858a95;

    font-size: 13px;
    
     font-weight: 400;

    line-height: 1.5;
}


/* =========================================================
   MODAL INPUT
========================================================= */

.modal-input {

    display: flex;

    align-items: center;

    gap: 5px;

    margin-top: 20px;

    min-height: 48px;

    padding:
        0 14px;

    border-radius: 16px;

    background:
        rgba(
            255,
            255,
            255,
            .72
        );

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            .8
        );

    box-shadow:
        inset 0 1px 0 white;
}


.modal-input span {

    flex: 0 0 auto;

    color: #7d828e;

    font-weight: 650;
}


.modal-input input {

    width: 100%;

    min-width: 0;

    height: 46px;

    border: 0;

    outline: none;

    background: transparent;

    /*
     * ВАЖНО:
     * минимум 16px для iOS.
     */

    font-size: 16px;

    color: var(--text);

    -webkit-appearance: none;
    appearance: none;
}


.modal-input input::placeholder {

    color: #9ca0aa;
}


/* =========================================================
   PRIMARY BUTTON
========================================================= */

.primary-button {

    width: 100%;

    min-height: 48px;

    margin-top: 12px;

    padding:
        0 18px;

    border-radius: 16px;

    color: white;

    background:
        linear-gradient(
            135deg,
            #607eff,
            #806cff
        );

    font-size: 14px;

    font-weight: 700;

    box-shadow:
        0 12px 25px
        rgba(
            91,
            124,
            255,
            .23
        );
}


/* =========================================================
   MODAL MESSAGE
========================================================= */

.modal-message {

    min-height: 20px;

    margin-top: 10px;

    color: #c04c5c;

    font-size: 13px;

    line-height: 1.4;
}


/* =========================================================
   EMPTY STATE
========================================================= */

.empty-state {

    display: none;

    padding:
        80px 20px;

    text-align: center;
}


.empty-state.visible {

    display: block;
}


.empty-icon {

    width: 64px;
    height: 64px;

    margin:
        0 auto 18px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 22px;

    color: #6c7fff;

    background:
        rgba(
            255,
            255,
            255,
            .65
        );

    font-size: 27px;

    box-shadow:
        inset 0 1px 0 white;
}


.empty-state h2 {

    font-size: 18px;
}


.empty-state p {

    margin-top: 5px;

    color: var(--muted);

    font-size: 13px;
}


/* =========================================================
   EMPTY CHATS
========================================================= */

.empty-chats {

    width: 100%;

    padding:
        70px 20px;

    text-align: center;
}


.empty-chats-icon {

    width: 64px;
    height: 64px;

    margin:
        0 auto 18px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 22px;

    color: #6c7fff;

    background:
        rgba(
            255,
            255,
            255,
            .65
        );

    font-size: 27px;

    box-shadow:
        inset 0 1px 0 white;
}


.empty-chats h2 {

    font-size: 20px;
}


.empty-chats p {

    max-width: 360px;

    margin:
        8px auto 0;

    color: var(--muted);

    font-size: 13px;

    line-height: 1.5;
}


.empty-chats .primary-button {

    width: auto;

    min-width: 150px;

    margin-top: 20px;

    padding:
        0 22px;
}


/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes panelIn {

    from {

        opacity: 0;

        transform:
            translateY(-7px);
    }

    to {

        opacity: 1;

        transform:
            translateY(0);
    }
}


.chat-card {

    animation:
        chatAppear .45s
        cubic-bezier(
            .2,
            .8,
            .2,
            1
        )
        both;
}


.chat-card:nth-child(1) {

    animation-delay: .05s;
}


.chat-card:nth-child(2) {

    animation-delay: .10s;
}


.chat-card:nth-child(3) {

    animation-delay: .15s;
}


@keyframes chatAppear {

    from {

        opacity: 0;

        transform:
            translateY(12px)
            scale(.98);
    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

    .messenger-app,
    .app {

        width: 100%;

        padding:
            14px
            14px
            calc(
                112px + var(--safe-bottom)
            );
    }


    .new-chat {

        right: 22px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 560px) {

    .messenger-app,
    .app {

        width: 100%;

        padding:
            10px
            10px
            calc(
                104px + var(--safe-bottom)
            );
    }


    .app-topbar,
    .topbar {

        top: 8px;

        padding:
            12px;

        border-radius: 23px;
    }


    .brand {

        gap: 9px;
    }


    .brand-mark {

        width: 40px;
        height: 40px;

        flex-basis: 40px;

        border-radius: 13px;
    }


    .brand-name {

        font-size: 16px;
    }


    .brand-subtitle {

        max-width: 185px;

        font-size: 9px;
    }


    .icon-button,
    .profile-button {

        width: 40px;
        height: 40px;

        flex-basis: 40px;
    }


    .section-heading {

        padding:
            5px
            3px
            14px;
    }


    .section-heading h1 {

        font-size: 26px;
    }


    .section-heading p {

        font-size: 12px;
    }


    .chat-card {

        min-height: 80px;

        padding:
            11px 12px;

        border-radius: 21px;
    }


    .chat-avatar {

        width: 52px;
        height: 52px;

        flex-basis: 52px;

        border-radius: 17px;
    }


    .chat-top h2 {

        font-size: 15px;
    }


    .chat-bottom p {

        font-size: 13px;
    }


    /*
     * Нижнее меню.
     * Всё строго по центру.
     */

    .bottom-nav {

        width:
            calc(
                100% - 20px
            );

        max-width: 520px;

        bottom:
            calc(
                8px + var(--safe-bottom)
            );

        padding: 6px;

        border-radius: 22px;
    }


    .nav-item {

        min-height: 48px;

        padding:
            7px 4px;

        gap: 4px;

        justify-content: center;
    }


    .nav-item svg {

        width: 20px;
        height: 20px;
    }


    .nav-item span {

        font-size: 10px;

        text-align: center;
        
        font-weight: 600;
    }


    /*
     * Floating new chat.
     */

    .new-chat {

        right: 17px;

        bottom:
            calc(
                84px + var(--safe-bottom)
            );

        width: 48px;
        height: 48px;

        min-height: 48px;

        padding: 0;

        border-radius: 17px;
    }


    .new-chat span {

        display: none;
    }


    .new-chat svg {

        width: 20px;
        height: 20px;
    }


    /*
     * Profile sheet.
     */

    .profile-sheet {

        width: 100%;

        padding-left: 18px;
        padding-right: 18px;
    }


    /*
     * Modal.
     */

    .modal {

        padding:
            15px;
    }


    .modal-card {

        width: 100%;

        padding:
            28px 20px 24px;

        border-radius: 27px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 370px) {

    .brand-subtitle {

        display: none;
    }


    .section-heading {

        align-items: center;
    }


    .filter-button {

        padding:
            8px 9px;
            
      font-weight: 600;
    }


    .chat-top h2 {

        font-size: 14px;
    }


    .chat-bottom p {

        font-size: 12px;
    }


    .chat-avatar {

        width: 49px;
        height: 49px;

        flex-basis: 49px;
    }


    .bottom-nav {

        width:
            calc(
                100% - 14px
            );
    }


    .nav-item span {

        font-size: 9px;
    }

}


/* =========================================================
   VERY SMALL DEVICES
========================================================= */

@media (max-width: 330px) {

    .app-topbar,
    .topbar {

        padding:
            10px;
    }


    .brand {

        gap: 7px;
    }


    .brand-mark {

        width: 36px;
        height: 36px;

        flex-basis: 36px;
    }


    .brand-name {

        font-size: 14px;
    }


    .icon-button,
    .profile-button {

        width: 36px;
        height: 36px;

        flex-basis: 36px;
    }


    .section-heading h1 {

        font-size: 23px;
    }


    .filter-button {

        font-size: 11px;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        animation-duration: .01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: .01ms !important;

        scroll-behavior: auto !important;
    }

}

/* =========================================================
   MINDLYCHAT
   GLOBAL IOS / MOBILE INPUT FIX
========================================================= */

/* ---------------------------------------------------------
   IOS TEXT SCALE
--------------------------------------------------------- */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
}


body {
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}


/* ---------------------------------------------------------
   INPUT / TEXTAREA / SELECT
--------------------------------------------------------- */

input,
textarea,
select {
    /*
     * Главный фикс Safari/iPhone.
     * При 16px Safari не делает automatic zoom
     * при фокусе.
     */
    font-size: 16px !important;

    /*
     * Запрещаем Safari самостоятельно
     * масштабировать текст.
     */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;

    /*
     * Убираем стандартный внешний вид iOS.
     */
    -webkit-appearance: none;
    appearance: none;

    /*
     * Не даём полю вызывать горизонтальный overflow.
     */
    max-width: 100%;
    
     font-weight: 500;
}


/* ---------------------------------------------------------
   INPUT PLACEHOLDER
--------------------------------------------------------- */

input::placeholder,
textarea::placeholder {
    font-size: 16px;
}


/* ---------------------------------------------------------
   FOCUS
--------------------------------------------------------- */

input:focus,
textarea:focus,
select:focus {
    outline: none;
}


/* ---------------------------------------------------------
   BUTTONS
--------------------------------------------------------- */

button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}


/* ---------------------------------------------------------
   LINKS
--------------------------------------------------------- */

a {
    -webkit-tap-highlight-color: transparent;
}


/* ---------------------------------------------------------
   PREVENT HORIZONTAL OVERFLOW
--------------------------------------------------------- */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/*
=========================================================
AVATAR UPLOAD
=========================================================
*/

.settings-avatar-wrap {

    position: relative;

    width: 78px;
    height: 78px;

    flex: 0 0 78px;

}


.settings-avatar {

    position: relative;

    width: 78px;
    height: 78px;

    padding: 0;

    border: 0;

    border-radius: 26px;

    overflow: hidden;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        linear-gradient(
            145deg,
            #dce8ff,
            #b9cffb
        );

    color:
        #3767b9;

    font-family: inherit;

    font-size: 28px;

    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 12px 30px rgba(54,101,183,.14),
        inset 0 1px 2px rgba(255,255,255,.95);

    transition:
        transform .2s ease,
        box-shadow .2s ease;

}


.settings-avatar:hover {

    transform:
        translateY(-2px);

    box-shadow:
        0 15px 35px rgba(54,101,183,.20),
        inset 0 1px 2px rgba(255,255,255,.95);

}


.settings-avatar:active {

    transform:
        scale(.96);

}


.settings-avatar img {

    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

}


.avatar-edit-badge {

    position: absolute;

    right: 5px;
    bottom: 5px;

    width: 27px;
    height: 27px;

    border-radius: 10px;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        rgba(255,255,255,.90);

    color:
        #3478f6;

    box-shadow:
        0 5px 15px rgba(30,60,100,.18);

    backdrop-filter:
        blur(12px);

    -webkit-backdrop-filter:
        blur(12px);

}


.avatar-edit-badge svg {

    width: 14px;
    height: 14px;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.8;

    stroke-linecap: round;

    stroke-linejoin: round;

}


.avatar-actions {

    margin-top: 8px;

}


.avatar-delete-button {

    padding: 0;

    border: 0;

    background: none;

    color:
        var(--red);

    font-family: inherit;

    font-size: 12px;

    font-weight: 650;

    cursor: pointer;

}


.avatar-delete-button:hover {

    text-decoration: underline;

}


.avatar-message {

    min-height: 17px;

    margin-top: 5px;

    color:
        var(--text-soft);

    font-size: 11px;

    line-height: 1.35;

}


.settings-avatar.is-loading {

    pointer-events: none;

    opacity: .55;

}


.settings-avatar.is-loading::after {

    content: "";

    position: absolute;

    width: 22px;
    height: 22px;

    border-radius: 50%;

    border: 2px solid
        rgba(255,255,255,.45);

    border-top-color:
        #3478f6;

    animation:
        avatarSpin .7s linear infinite;

}


@keyframes avatarSpin {

    to {
        transform: rotate(360deg);
    }

}


@media (max-width: 640px) {

    .settings-avatar-wrap {

        width: 64px;
        height: 64px;

        flex-basis: 64px;

    }


    .settings-avatar {

        width: 64px;
        height: 64px;

        border-radius: 21px;

        font-size: 24px;

    }


    .avatar-edit-badge {

        width: 23px;
        height: 23px;

        right: 4px;
        bottom: 4px;

        border-radius: 8px;

    }


    .avatar-edit-badge svg {

        width: 12px;
        height: 12px;

    }

}


/* =====================================================
   LOGOUT BUTTON — LIQUID GLASS
===================================================== */

.logout-button {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    
     margin-top: 15px;

    min-height: 44px;
    padding: 0 18px;

    border: 1px solid rgba(255, 90, 90, 0.18);
    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.72),
            rgba(255, 245, 245, 0.52)
        );

    color: #e54848;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    letter-spacing: -0.01em;

    cursor: pointer;

    box-shadow:
        0 8px 24px rgba(40, 50, 70, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);

    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);

    transition:
        transform 0.22s ease,
        background 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        color 0.22s ease;

    -webkit-tap-highlight-color: transparent;
}


/* ICON */

.logout-button svg {
    width: 18px;
    height: 18px;

    flex: 0 0 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition:
        transform 0.22s ease;
}


/* HOVER */

.logout-button:hover {
    color: #d93636;

    border-color:
        rgba(255, 70, 70, 0.30);

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.88),
            rgba(255, 238, 238, 0.72)
        );

    box-shadow:
        0 12px 30px rgba(220, 60, 60, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);

    transform:
        translateY(-1px);
}


.logout-button:hover svg {
    transform:
        translateX(2px);
}


/* ACTIVE */

.logout-button:active {
    transform:
        translateY(1px) scale(0.97);

    box-shadow:
        0 5px 15px rgba(220, 60, 60, 0.10),
        inset 0 1px 3px rgba(0, 0, 0, 0.04);
}


/* FOCUS */

.logout-button:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(255, 90, 90, 0.14),
        0 10px 28px rgba(220, 60, 60, 0.10);
}


/* LOADING / DISABLED */

.logout-button:disabled {
    cursor: default;
    opacity: 0.65;
    transform: none;
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 600px) {

    .logout-button {
        width: 100%;
        min-height: 46px;

        border-radius: 15px;

        font-size: 14px;
    }

}

