:root{
    --primary:#ffbdd5;
    --primary-dark:#ff9ebf;
    --bg-dark:rgba(78,63,74,0.55);
    --bg-darker:rgba(60,45,55,0.75);
    --border:rgba(255,255,255,0.14);
    --text:#fff8fc;
    --text-dim:rgba(255,248,252,0.7);
    --sat:env(safe-area-inset-top);
    --sab:env(safe-area-inset-bottom);
    --sal:env(safe-area-inset-left);
    --sar:env(safe-area-inset-right);
}

*{margin:0;padding:0;box-sizing:border-box;}

html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: transparent;
    viewport-fit: cover;
}

body {
    height: 100%;
    margin: 0;
    padding: 0;
    padding-top: var(--sat);
    padding-bottom: var(--sab);
    padding-left: var(--sal);
    padding-right: var(--sar);
    overflow-x: hidden;
    background: transparent;
}

body{
    font-family:'Nunito',sans-serif;
    background:transparent;
    color:var(--text);
    overflow-y:auto;
}

.bg {
    position: fixed !important;
    inset: 0 !important;
    background: 
        linear-gradient(180deg, rgba(45, 31, 46, 0.12) 0%, rgba(45, 31, 46, 0.22) 100%),
        linear-gradient(135deg, 
            #2d1f2e 0%, 
            #3d2a3e 15%, 
            #5c3d52 30%, 
            #ff9ebf 50%, 
            #ffbdd5 65%, 
            #9b8aa5 80%, 
            #4d3f4a 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    z-index: -5 !important;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}


#page-login{
    position:fixed;
    inset:0;
    display:none;
    align-items:center;
    justify-content:center;
    z-index:100;
    padding:20px;
    pointer-events:none;
}

#page-login.visible{
    display:flex;
    pointer-events:auto;
}

#page-login.hidden{
    display:none !important;
    pointer-events:none;
}

.login-container{
    background:rgba(255,255,255,0.12);
    border:1px solid rgba(255,255,255,0.15);
    border-radius:0;
    padding:40px;
    max-width:400px;
    width:100%;
    box-shadow:0 8px 32px rgba(78,63,74,0.3);
    backdrop-filter:blur(3px);
    -webkit-backdrop-filter:blur(3px);
}

.login-header{
    text-align:center;
    margin-bottom:30px;
}

.login-title{
    font-size:28px;
    font-weight:700;
    margin-bottom:8px;
    color:var(--text);
}

.login-subtitle{
    font-size:14px;
    color:var(--text-dim);
}

.login-form{
    display:flex;
    flex-direction:column;
    gap:20px;
}

.form-group{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.form-label{
    font-size:13px;
    font-weight:600;
    color:var(--text);
    text-transform:uppercase;
    opacity:0.9;
}

.form-input{
    padding:12px 16px;
    border:1px solid var(--border);
    border-radius:0;
    background:rgba(0,0,0,0.2);
    color:var(--text);
    font-family:'Nunito',sans-serif;
    font-size:14px;
    transition:all 0.3s;
}

.form-input::placeholder{
    color:rgba(255,248,252,0.5);
}

.form-input:focus{
    outline:none;
    border-color:var(--primary);
    background:rgba(0,0,0,0.3);
    box-shadow:0 0 10px rgba(255,189,213,0.2);
}

.avatar-picker{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:8px;
}

.avatar-option{
    padding:12px;
    border:2px solid var(--border);
    border-radius:0;
    background:rgba(0,0,0,0.2);
    font-size:24px;
    cursor:pointer;
    transition:all 0.3s;
    display:flex;
    align-items:center;
    justify-content:center;
}

.avatar-option:hover{
    border-color:var(--primary);
    background:rgba(255,189,213,0.2);
    transform:scale(1.1);
}

.avatar-option.selected{
    border-color:var(--primary);
    background:var(--primary);
    box-shadow:0 0 15px rgba(255,189,213,0.4);
}

.login-button{
    padding:14px;
    border:none;
    border-radius:0;
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
    color:#fff;
    font-weight:700;
    font-size:16px;
    cursor:pointer;
    transition:all 0.3s;
    margin-top:10px;
}

.login-button:hover{
    transform:translateY(-2px);
    box-shadow:0 8px 16px rgba(255,189,213,0.3);
}

.login-button:active{
    transform:translateY(0);
}

.auth-tabs{
    display:flex;
    gap:10px;
    margin-bottom:20px;
    border-bottom:2px solid var(--border);
}

.auth-tab{
    flex:1;
    padding:12px;
    border:none;
    background:transparent;
    color:var(--text-dim);
    font-weight:600;
    font-size:14px;
    cursor:pointer;
    transition:all 0.3s;
    border-bottom:3px solid transparent;
    margin-bottom:-2px;
}

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

.auth-tab.active{
    color:var(--primary);
    border-bottom-color:var(--primary);
}

.auth-form{
    display:none;
    opacity:0;
    transition:opacity 0.3s;
}

.auth-form.active{
    display:block;
    opacity:1;
}

.divider{
    text-align:center;
    color:var(--text-dim);
    font-size:12px;
    margin:15px 0;
    position:relative;
}

.divider::before,
.divider::after{
    content:'';
    position:absolute;
    top:50%;
    width:45%;
    height:1px;
    background:var(--border);
}

.divider::before{
    left:0;
}

.divider::after{
    right:0;
}

.google-button{
    width:100%;
    padding:12px;
    border:1px solid var(--border);
    border-radius:0;
    background:rgba(255,255,255,0.05);
    color:var(--text);
    font-weight:600;
    font-size:14px;
    cursor:pointer;
    transition:all 0.3s;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    font-family:'Nunito',sans-serif;
}

.google-button:hover{
    background:rgba(255,255,255,0.1);
    border-color:var(--primary);
}

.google-icon{
    font-size:18px;
}

.app-wrapper{
    max-width:980px;
    margin:0 auto;
    padding:20px 10px 100px;
    position:relative;
    z-index:1;
    min-height:100vh;
    overflow-x:hidden;
}
.page-view{
    display:none;
    opacity:0;
    transform:translateY(8px);
    transition:opacity 0.3s ease, transform 0.3s ease;
    overflow-y:auto;
}
.page-view.active{
    display:block;
    opacity:1;
    transform:translateY(0);
}
#page-messages.active{
    overflow-y:hidden !important;
}

.profile-header{
    display:grid;
    grid-template-columns:170px 1fr;
    grid-template-rows:auto auto auto;
    gap:15px;
    background:rgba(255,255,255,0.12);
    border:1px solid rgba(255,255,255,0.15);
    padding:0;
    margin-bottom:15px;
    overflow:visible;
    backdrop-filter:blur(3px);
    -webkit-backdrop-filter:blur(3px);
}

.profile-banner-image{
    grid-row:1;
    grid-column:1 / -1;
    height:200px;
    position:relative;
    background:rgba(0,0,0,0.2);
    overflow:visible;
}
.profile-banner-image img{
    width:100%;
    height:100%;
    object-fit:cover;
}
.banner-image-edit{
    position:absolute;
    top:12px;
    right:12px;
    width:32px;
    height:32px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(78,63,74,0.9);
    border:1px solid rgba(255,255,255,0.3);
    color:var(--text);
    font-size:14px;
    cursor:pointer;
    opacity:0.7;
    transition:opacity 0.2s, background 0.2s;
    z-index:5;
}
.banner-image-edit:hover{
    opacity:1;
    background:rgba(255,189,213,0.3);
}

.avatar-frame{
    grid-row:2;
    grid-column:1;
    width:150px;
    height:150px;
    border:3px solid var(--primary);
    overflow:hidden;
    background:rgba(0,0,0,0.3);
    margin:15px;
    margin-top:-75px;
    position:relative;
    z-index:3;
    flex-shrink:0;
}
.avatar-frame img{width:100%;height:100%;object-fit:cover;}
.avatar-display{border-radius:50%;cursor:pointer;transition:all 0.2s;}
.avatar-display:hover{transform:scale(1.05);box-shadow:0 0 12px rgba(255,189,213,0.4);}

.profile-info{
    grid-row:2;
    grid-column:2;
    padding:20px 15px 15px 0;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:4px;
}
.profile-name{
    font-size:22px;
    font-weight:700;
    display:flex;
    align-items:center;
    gap:6px;
}
.profile-status{
    font-size:13px;
    color:var(--text-dim);
}
.profile-emojis-row{
    display:flex;
    align-items:center;
    gap:6px;
    flex-wrap:wrap;
    margin-top:2px;
}
.profile-emojis{
    font-size:18px;
    letter-spacing:2px;
    display:flex;
    gap:6px;
}

.emoji-item{
    cursor:pointer;
    transition:transform 0.2s;
    display:inline-block;
    line-height:1;
}
.emoji-item:hover{
    transform:scale(1.3);
}
.emoji-item.removing{
    animation:emojiRemove 0.5s ease forwards;
}
@keyframes emojiRemove{
    0%{transform:scale(1) rotate(0deg);opacity:1;}
    50%{transform:scale(1.4) rotate(180deg);opacity:0.8;}
    100%{transform:scale(0) rotate(360deg);opacity:0;}
}

.emoji-add-btn{
    width:26px;height:26px;
    display:flex;align-items:center;justify-content:center;
    background:rgba(255,255,255,0.08);
    border:1px solid var(--border);
    color:var(--text);
    font-size:16px;
    cursor:pointer;
    transition:0.2s;
    line-height:1;
}
.emoji-add-btn:hover{
    background:rgba(255,189,213,0.25);
    border-color:var(--primary);
}
.action-buttons{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    min-height:32px;
    margin-top:10px;
}

.level-full{
    grid-row:3;
    grid-column:1 / -1;
    width:100%;
    background:var(--bg-darker);
    border-top:1px solid var(--border);
    padding:8px 15px;
    text-align:center;
}
.level-mini-title{
    font-size:11px;
    margin-bottom:6px;
    display:flex;
    justify-content:center;
    align-items:center;
    gap:10px;
}
.level-bar{
    height:6px;
    width:100%;
    max-width:300px;
    margin:0 auto;
    background:rgba(255,255,255,0.1);
    overflow:hidden;
}
.level-progress{
    height:100%;
    width:82%;
    background:linear-gradient(90deg,var(--primary),var(--primary-dark));
}
.level-xp{font-size:10px;color:var(--text-dim);margin-top:3px;}

.content-grid{
    display:grid;
    grid-template-columns:1fr 260px;
    gap:15px;
    overflow-x:hidden;
}

.panel{
    background:rgba(255,255,255,0.12);
    border:1px solid rgba(255,255,255,0.15);
    margin-bottom:15px;
    position:relative;
    backdrop-filter:blur(3px);
    -webkit-backdrop-filter:blur(3px);
}
.panel-header{
    padding:10px 12px;
    font-size:12px;
    font-weight:600;
    border-bottom:1px solid var(--border);
    background:rgba(255,255,255,0.03);
    display:flex;
    justify-content:space-between;
    align-items:center;
    position:relative;
}
.panel-body{padding:12px;}

.banner{
    text-align:center;
    padding:14px;
    background:rgba(255,189,213,0.08);
    font-size:13px;
    letter-spacing:1px;
    color:var(--text-dim);
    position:relative;
}
.banner-edit{
    position:absolute;
    top:8px;right:8px;
    width:26px;height:26px;
    display:flex;align-items:center;justify-content:center;
    background:rgba(78,63,74,0.85);
    border:1px solid rgba(255,255,255,0.2);
    color:var(--text);
    font-size:12px;
    cursor:pointer;
    opacity:0.5;
    transition:opacity 0.2s, background 0.2s;
}
.banner-edit:hover{opacity:1;background:rgba(255,189,213,0.3);}

.showcase-frame{
    border:2px solid rgba(255,189,213,0.3);
    overflow:hidden;
    position:relative;
    min-height: 441px;
    background-size: cover;
    background-position: center;
}
.showcase-frame img{width:100%;height:auto;display:block;}
.showcase-edit{
    position:absolute;
    top:10px;right:10px;
    width:30px;height:30px;
    display:flex;align-items:center;justify-content:center;
    background:rgba(78,63,74,0.85);
    border:1px solid rgba(255,255,255,0.2);
    color:var(--text);
    font-size:14px;
    cursor:pointer;
    opacity:0.5;
    transition:opacity 0.2s, background 0.2s;
}
.showcase-edit:hover{opacity:1;background:rgba(255,189,213,0.3);}

.guide-card{
    display:flex;
    gap:12px;
    align-items:center;
    padding:12px;
    background:rgba(255,255,255,0.03);
}
.guide-icon{
    width:54px;height:54px;
    background:rgba(255,189,213,0.15);
    border:1px solid var(--primary);
    display:flex;align-items:center;justify-content:center;
    font-size:26px;flex-shrink:0;
}
.guide-title{font-size:13px;font-weight:600;margin-bottom:2px;}
.guide-author{font-size:10px;color:var(--text-dim);}

.icons-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;
    justify-items:center;
}
.icon-item{
    width:54px;
    height:54px;
    background:rgba(255,255,255,0.05);
    border:1px solid var(--border);
    display:flex;align-items:center;justify-content:center;
    font-size:26px;
    cursor:pointer;transition:0.2s;
    backdrop-filter:blur(3px);
    -webkit-backdrop-filter:blur(3px);
}
.icon-item:hover{background:rgba(255,189,213,0.2);border-color:var(--primary);transform:translateY(-2px);}

.groups-list{display:flex;flex-direction:column;gap:6px;}
.group-item{display:flex;align-items:center;gap:10px;padding:10px;background:rgba(255,255,255,0.03);border-radius:6px;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);}
.group-icon{width:32px;height:32px;background:var(--primary);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0;}
.group-name{font-size:12px;font-weight:500;color:var(--text);}

.dock{
    position:fixed;
    bottom:15px;
    left:50%;
    transform:translateX(-50%);
    display:flex !important;
    flex-direction:row;
    gap:6px;
    padding:8px;
    background:rgba(77,63,74,0.95);
    border:1px solid rgba(255,255,255,0.18);
    backdrop-filter:blur(18px);
    z-index:100;
}
.dock-toggle{
    width:44px;height:44px;
    display:flex !important;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    font-size:20px;
    background:rgba(255,255,255,0.06);
    border:1px solid rgba(255,255,255,0.12);
}
.dock.open .dock-toggle{display:none !important;}
.dock-menu{
    display:none;
    gap:6px;
    flex-direction:row;
}
.dock.open .dock-menu{display:flex !important;}
.dock-item{
    width:44px;height:44px;
    display:flex;align-items:center;justify-content:center;
    cursor:pointer;
    background:rgba(255,255,255,0.06);
    border:1px solid rgba(255,255,255,0.12);
    font-size:20px;transition:0.2s;
    position:relative;
}
.dock-item:hover{background:rgba(255,189,213,0.25);transform:scale(1.08);}
.dock-item.active{background:rgba(255,189,213,0.35);border-color:var(--primary);}
.dock-item.active::after{
    content:'';
    position:absolute;
    bottom:4px;
    width:4px;height:4px;
    background:var(--primary);
    border-radius:50%;
}

.modal{
    position:fixed;
    top:0;left:0;right:0;bottom:0;
    background:rgba(0,0,0,0.6);
    backdrop-filter:blur(4px);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:200;
}
.modal.active{display:flex;}
.modal-content{
    background:var(--bg-darker);
    border:1px solid var(--border);
    padding:18px;
    width:90%;
    max-width:400px;
    max-height:80vh;
    overflow-y:auto;
}
.modal-content h4{font-size:14px;margin-bottom:12px;text-align:center;}
.modal-content input, .modal-content textarea{
    width:100%;
    padding:8px;
    margin-bottom:10px;
    background:rgba(255,255,255,0.08);
    border:1px solid var(--border);
    color:var(--text);
    font-family:inherit;
    font-size:12px;
}
.modal-content textarea{min-height:60px;resize:vertical;}
.modal-buttons{display:flex;gap:8px;justify-content:flex-end;}
.modal-buttons button{
    padding:6px 14px;
    border:none;
    cursor:pointer;
    font-size:12px;
    font-family:inherit;
}
.modal-buttons .cancel{background:transparent;color:var(--text);border:1px solid var(--border);}
.modal-buttons .confirm{background:var(--primary);color:#4d3f4a;font-weight:600;}

@media (min-width:769px){
    .profile-header > div:nth-last-of-type(2){
        grid-row:3;
        grid-column:1 / -1;
        padding:12px 15px !important;
        width:100% !important;
        margin-left:0 !important;
        margin-right:0 !important;
    }
    .profile-header .level-full{
        grid-row:4 !important;
    }
}

@media (max-width:768px){
    .profile-header{
        display:flex;
        flex-direction:column;
        align-items:center;
        text-align:center;
        gap:0;
        padding:0;
    }
    .profile-banner-image{width:100%;height:140px;}
    .avatar-frame{width:110px;height:110px;margin:0;margin-top:-55px;margin-bottom:10px;border-width:2px;}
    .avatar-frame img{width:100% !important;height:100% !important;object-fit:cover !important;}
    .avatar-display{width:110px !important;height:110px !important;font-size:40px !important;}
    .profile-info{padding:0 15px 12px;display:flex;flex-direction:column;align-items:center;gap:6px;}
    .profile-name{font-size:20px;justify-content:center;}
    .profile-status{font-size:12px;}
    .profile-emojis-row{justify-content:center;margin-top:4px;}
    .profile-emojis{font-size:22px;gap:10px;justify-content:center;}
    .level-full{padding:8px 15px;}
    .level-mini-title{font-size:11px;}
    .level-bar{max-width:220px;height:5px;}
    .content-grid{grid-template-columns:1fr;}
    .dock{bottom:10px;padding:6px;}
    .dock-toggle, .dock-item{width:38px;height:38px;font-size:16px;}
    .icons-grid{gap:10px;}
    .icon-item{width:48px;height:48px;font-size:22px;}
}
/* Typing indicator animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(60,45,55,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text);
    font-size: 13px;
    border-radius: 4px;
    width: fit-content;
}
.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    animation: typing 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-10px); opacity: 1; }
}

/* Notifications styling */
#notif-list {
    background: rgba(60,45,55,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 12px;
    border-radius: 4px 4px 0 0;
}
#notif-history {
    background: rgba(60,45,55,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-top: none;
    padding: 12px;
    border-radius: 0 0 4px 4px;
    margin-top: -1px;
}
.notif-item {
    background: rgba(255,255,255,0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(3px);
}
.notif-item.unread {
    background: rgba(255,189,213,0.18) !important;
    border-color: rgba(255, 189, 213, 0.28) !important;
}
.notif-item:hover {
    background: rgba(255,189,213,0.22) !important;
}

/* Верстка страницы сообщений (.msg-shell, .msg-contacts-bar, #page-messages.active
   и т.д.) целиком живёт в инлайновом <style> внутри секции #page-messages в
   index.html — там же и логика скролла #msgBubbles. Дублирующие/конфликтующие
   правила отсюда были убраны: старая версия форсировала .msg-shell в CSS Grid
   через !important и полностью ломала текущую flex-раскладку диалогов. */

@media (max-width:400px){
    .profile-banner-image{height:110px;}
    .avatar-frame{width:90px;height:90px;margin-top:-45px;}
    .avatar-display{width:90px !important;height:90px !important;font-size:32px !important;}
    .profile-name{font-size:17px;}
    .profile-emojis{font-size:20px;}
    .level-bar{max-width:180px;height:5px;}
}

/* Friends profile card preview */
.friend-card-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

.friend-card-preview {
    position: absolute;
    top: 0;
    left: 100%;
    transform: translateY(0);
    width: 280px;
    background: rgba(60,45,55,0.95);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none !important;
    margin-left: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    max-height: 85vh;
    box-sizing: border-box;
}

.friend-card-preview.visible {
    opacity: 1;
    visibility: visible;
}

.friend-preview-bg {
    width: 100%;
    height: 100px;
    background-size: cover;
    background-position: center;
    background: rgba(255,189,213,0.1);
}

.friend-preview-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,189,213,0.15);
    border: 2px solid rgba(255,189,213,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-left: 16px;
    margin-top: -30px;
    position: relative;
    z-index: 10;
}

.friend-preview-info {
    padding: 12px 16px;
}

.friend-preview-name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.friend-preview-status {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.friend-preview-level {
    font-size: 12px;
    color: var(--text-dim);
}


/* Post images styling */
.post-image {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin-top: 12px !important;
    border-radius: 6px !important;
    object-fit: cover !important;
}

.post-content {
    margin-bottom: 12px !important;
}

/* Like and comment button styling */
.like-btn,
.comment-btn {
    opacity: 0.8 !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
    font-size: 14px !important;
}

.like-btn::after,
.comment-btn::after {
    font-size: 11px !important;
}

.like-btn:hover,
.comment-btn:hover {
    opacity: 1 !important;
    transform: scale(1.1) !important;
}

.like-btn.liked {
    opacity: 1 !important;
    font-weight: 600 !important;
}

/* Comments styling */
.post-comment-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.post-comment-input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    -webkit-appearance: none;
    appearance: none;
}

.post-comment-input::placeholder {
    color: rgba(255, 248, 252, 0.45);
}

.post-comment-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 8px rgba(255, 189, 213, 0.15);
}

.post-comment-input:-webkit-autofill,
.post-comment-input:-webkit-autofill:hover,
.post-comment-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(40, 28, 38, 0.95) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--text);
    transition: background-color 5000s ease-in-out 0s;
}

.post-comment-send {
    padding: 8px 14px;
    background: var(--primary);
    color: #4d3f4a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 12px;
    flex-shrink: 0;
}

.post-comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px !important;
}

.post-comments-list > div {
    background: linear-gradient(135deg, rgba(255,182,193,0.15), rgba(221,160,221,0.1)) !important;
    padding: 12px !important;
    border-radius: 8px !important;
    border-left: 4px solid var(--primary) !important;
    margin-bottom: 0 !important;
}

/* Mobile: hide friend card previews on touch devices */
@media (max-width: 640px) {
    .friend-card-preview {
        display: none !important;
    }
}

/* ── Comments Page ─────────────────────────────────────────── */
.comments-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.comments-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    background: var(--bg);
    flex-shrink: 0;
}

.comments-back-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    padding: 4px 8px;
}

.comments-title {
    flex: 1;
    font-weight: 600;
    font-size: 16px;
}

.comments-count {
    font-size: 12px;
    color: var(--text-dim);
}

.comments-post-card {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
}

.comments-post-card .post-author {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.comments-post-card .post-date {
    font-size: 11px;
    opacity: 0.5;
    margin-bottom: 8px;
}

.comments-post-card .post-text {
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.comments-list .comment-item {
    background: linear-gradient(135deg, rgba(255,182,193,0.15), rgba(221,160,221,0.1));
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    margin-bottom: 10px;
    position: relative;
}

.comments-list .comment-author {
    font-weight: 700;
    color: var(--primary);
    font-size: 12px;
    margin-bottom: 4px;
}

.comments-list .comment-text {
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 6px;
    word-wrap: break-word;
}

.comments-list .comment-date {
    font-size: 10px;
    color: var(--text-dim);
}

.comments-list .comment-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.comments-list .comment-item:hover .comment-delete {
    opacity: 1;
}

.comments-list .comment-delete:hover {
    color: #ff6b6b;
}

.comments-list .comment-empty {
    color: var(--text-dim);
    text-align: center;
    padding: 24px;
    font-size: 13px;
}

.comments-input-row {
    display: flex;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    gap: 8px;
    background: var(--bg);
    flex-shrink: 0;
}

.comments-input-row input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
}

.comments-input-row input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.35);
}

.comments-input-row button {
    padding: 10px 18px;
    background: var(--primary);
    color: #4d3f4a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 14px;
    flex-shrink: 0;
}
