.auth-page {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 26px 0;
}

.auth-card,
.profile-edit-card,
.user-page-header,
.chat-header,
.chat-box,
.chat-form-card,
.author-profile-card {
    background: #ffffff;
    border: 1px solid #e0e4e8;
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

.auth-card {
    width: min(100%, 520px);
}

.auth-card h1,
.profile-edit-card h1,
.user-page-header h1,
.chat-header h1,
.author-profile-card h1 {
    margin: 0 0 12px;
    font-size: 38px;
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.auth-hint,
.profile-edit-card__hint,
.user-page-header p {
    margin: 0 0 20px;
    color: #6b7280;
    font-size: 16px;
}

/* PROFILE */

.author-profile-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 26px;
}

.author-profile-card__avatar img {
    width: 150px;
    height: 150px;
    border-radius: 26px;
    object-fit: cover;
    border: 1px solid #e0e4e8;
    background: #f3f5f7;
}

.avatar-open-btn {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.avatar-open-btn img {
    display: block;
}

.author-profile-card__kicker {
    margin: 0 0 6px;
    color: #0b5ed7;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.author-profile-card__username {
    margin: 6px 0 14px;
    color: #6b7280;
    font-weight: 800;
}

.author-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.profile-tabs {
    gap: 10px;
}

.profile-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f5f7;
    border: 1px solid #e0e4e8;
    border-radius: 999px;
    padding: 9px 14px;
    color: #374151;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-tab:hover {
    background: #eef4ff;
    color: #0b5ed7;
}

.profile-tab.is-active {
    background: #0b5ed7;
    border-color: #0b5ed7;
    color: #ffffff;
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.is-active {
    display: block;
}

.author-rating-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 18px;
}

.author-rating-box span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff7e6;
    border: 1px solid #ffd591;
    color: #92400e;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 14px;
    font-weight: 900;
}

.author-bio {
    margin: 16px 0;
    color: #374151;
    font-size: 17px;
}

.author-location {
    color: #6b7280;
    font-weight: 700;
}

.author-actions,
.author-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.author-btn,
.dashboard-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 900;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}

.author-btn:hover,
.dashboard-button:hover {
    text-decoration: none;
}

.author-btn--primary,
.dashboard-button--primary {
    background: #0b5ed7;
    color: #ffffff;
    border-color: #0b5ed7;
}

.author-btn--primary:hover,
.dashboard-button--primary:hover {
    background: #094db2;
}

.author-btn--secondary,
.dashboard-button--secondary {
    background: #ffffff;
    color: #111827;
    border-color: #ccd3da;
}

.author-btn--secondary:hover,
.dashboard-button--secondary:hover {
    background: #f3f5f7;
}

.author-socials a {
    background: #eef4ff;
    color: #0b5ed7;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 900;
}

/* PROFILE USER LISTS */

.profile-list-section {
    margin-top: 22px;
}

.profile-user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid #e0e4e8;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.04);
}

.profile-user-card__avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    overflow: hidden;
    flex: 0 0 58px;
    background: #eef4ff;
}

.profile-user-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-user-card__body {
    flex: 1;
    min-width: 0;
}

.profile-user-card__name {
    color: #111827;
    font-size: 17px;
    font-weight: 900;
}

.profile-user-card__name:hover {
    color: #0b5ed7;
    text-decoration: none;
}

.profile-user-card__body p {
    margin: 3px 0 0;
    color: #6b7280;
    font-weight: 700;
}

.profile-user-card__button {
    display: inline-flex;
    border: 1px solid #ccd3da;
    border-radius: 999px;
    padding: 8px 12px;
    color: #111827;
    font-weight: 900;
    white-space: nowrap;
}

.profile-user-card__button:hover {
    background: #eef4ff;
    color: #0b5ed7;
    text-decoration: none;
}

/* AVATAR MODAL */

.avatar-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(17, 24, 39, 0.72);
}

.avatar-modal.is-open {
    display: flex;
}

.avatar-modal__content {
    max-width: min(96vw, 900px);
    max-height: 90vh;
    background: #ffffff;
    border-radius: 22px;
    padding: 14px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.avatar-modal__content img {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 28px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
}

.avatar-modal__close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #111827;
    font-size: 24px;
    font-weight: 900;
    cursor: pointer;
    z-index: 10001;
}

.avatar-modal__close:hover {
    background: #eef4ff;
}

/* PROFILE EDIT */

.profile-edit-page {
    display: flex;
    justify-content: center;
}

.profile-edit-card {
    width: min(100%, 760px);
}

/* USER PAGES */

.user-page,
.chat-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.notification-list,
.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.notification-card,
.conversation-card {
    background: #ffffff;
    border: 1px solid #e0e4e8;
    border-radius: 18px;
    padding: 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.04);
}

.notification-card--new,
.conversation-card--unread {
    border-color: #bcd7ff;
    background: #f3f7ff;
}

.notification-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #eef4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex: 0 0 44px;
}

.notification-card__body,
.conversation-card__body {
    flex: 1;
    min-width: 0;
}

.notification-card__body p {
    margin: 0 0 5px;
    color: #111827;
    font-weight: 800;
}

.notification-card__badge,
.conversation-card__badge {
    background: #0b5ed7;
    color: #ffffff;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.notification-actions,
.notification-card__actions,
.chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.notification-actions button,
.notification-card__actions button,
.chat-actions button {
    border: 1px solid #ccd3da;
    background: #ffffff;
    color: #111827;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 900;
    cursor: pointer;
}

.notification-actions button:hover,
.notification-card__actions button:hover,
.chat-actions button:hover {
    background: #eef4ff;
}

/* CONVERSATIONS */

.conversation-card__avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    overflow: hidden;
    background: #eef4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 58px;
    font-size: 26px;
}

.conversation-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.conversation-card__top {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.conversation-card__top h2 {
    margin: 0;
    font-size: 22px;
}

.conversation-card__preview {
    margin: 8px 0 4px;
    color: #374151;
}

.conversation-card__open {
    display: inline-flex;
    margin-top: 10px;
    font-weight: 900;
}

/* CHAT */

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-back {
    border: 1px solid #ccd3da;
    border-radius: 999px;
    padding: 9px 13px;
    color: #111827;
    font-weight: 900;
    white-space: nowrap;
}

.chat-back:hover {
    background: #eef4ff;
    color: #0b5ed7;
    text-decoration: none;
}

.chat-message {
    display: flex;
    margin-bottom: 14px;
}

.chat-message--mine {
    justify-content: flex-end;
}

.chat-message--other {
    justify-content: flex-start;
}

.chat-message__bubble {
    max-width: min(78%, 680px);
    border-radius: 18px;
    padding: 13px 15px;
    border: 1px solid #e0e4e8;
}

.chat-message--mine .chat-message__bubble {
    background: #e8f8e8;
    border-color: #cde8cd;
    text-align: right;
}

.chat-message--other .chat-message__bubble {
    background: #ffffff;
    text-align: left;
}

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

.chat-message--mine .chat-message__meta {
    flex-direction: row-reverse;
}

.chat-message__meta strong {
    color: #111827;
}

.chat-message__meta small {
    color: #6b7280;
    font-size: 12px;
}

.chat-message__text {
    color: #1f2933;
    line-height: 1.55;
}

.chat-message__text p {
    margin: 0 0 8px;
}

.chat-message__image {
    display: block;
    margin-top: 10px;
}

.chat-message__image img {
    max-width: 100%;
    max-height: 360px;
    border-radius: 14px;
}

/* COMMENTS */

.comment-card {
    background: #ffffff;
    border: 1px solid #e0e4e8;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.04);
}

.comment-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 14px;
}

.comment-card__meta a {
    font-weight: 900;
}

.comment-card__text {
    color: #1f2933;
}

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

.comment-card__actions form {
    margin: 0;
}

.comment-card__actions button {
    border: 1px solid #ccd3da;
    background: #ffffff;
    color: #111827;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.comment-card__actions button:hover {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

/* BLOG / ARTICLE ACTIONS */

.article-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.article-actions form {
    margin: 0;
}

.portal-comment-row {
    display: block;
    padding: 10px 0;
    border-top: 1px solid #edf0f3;
    color: #111827;
}

.portal-comment-row:first-of-type {
    border-top: none;
}

.portal-comment-row:hover {
    color: #0b5ed7;
    text-decoration: none;
}

.portal-comment-row strong {
    display: block;
    font-weight: 900;
}

.portal-comment-row span {
    display: block;
    color: #374151;
    margin-top: 3px;
}

.portal-comment-row small {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    margin-top: 4px;
}

/* TOP BLOGGERS */

.user-rating-mini {
    display: inline-flex;
    margin-left: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff7e6;
    border: 1px solid #ffd591;
    color: #92400e;
    font-size: 12px;
    font-weight: 900;
}

.top-blogger-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid #edf0f3;
    color: #111827;
}

.top-blogger-row:first-of-type {
    border-top: none;
}

.top-blogger-row:hover {
    color: #0b5ed7;
    text-decoration: none;
}

.top-blogger-row strong {
    font-weight: 900;
}

.top-blogger-row span {
    color: #92400e;
    font-weight: 900;
}

/* MOBILE */

@media (max-width: 760px) {
    .auth-card,
    .profile-edit-card,
    .user-page-header,
    .chat-header,
    .chat-box,
    .chat-form-card,
    .author-profile-card {
        padding: 18px;
        border-radius: 18px;
    }

    .auth-card h1,
    .profile-edit-card h1,
    .user-page-header h1,
    .chat-header h1,
    .author-profile-card h1 {
        font-size: 31px;
    }

    .author-profile-card {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .author-profile-card__avatar img {
        width: 120px;
        height: 120px;
        border-radius: 22px;
    }

    .author-stats,
    .author-rating-box,
    .author-actions,
    .author-socials {
        gap: 8px;
    }

    .profile-tab {
        padding: 8px 12px;
        font-size: 14px;
    }

    .profile-user-card {
        align-items: flex-start;
        padding: 13px;
    }

    .profile-user-card__button {
        padding: 7px 10px;
        font-size: 14px;
    }

    .avatar-modal {
        padding: 12px;
    }

    .avatar-modal__content {
        max-width: 96vw;
        border-radius: 18px;
        padding: 10px;
    }

    .avatar-modal__content img {
        max-height: calc(90vh - 20px);
        border-radius: 14px;
    }

    .chat-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chat-message__bubble {
        max-width: 90%;
    }

    .conversation-card,
    .notification-card {
        padding: 14px;
        border-radius: 16px;
    }
}
/* =========================================================
   MODERN MESSENGER UI
   ========================================================= */

.messenger-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 980px;
    margin: 0 auto;
}

.messenger-inbox-hero,
.messenger-chat-header,
.messenger-search-card,
.messenger-dialog-card,
.messenger-editor-card,
.messenger-system-note,
.messenger-empty-state {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 26px;
    box-shadow: 0 16px 46px rgba(15, 23, 42, 0.08);
}

.messenger-inbox-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 26px;
}

.messenger-inbox-hero h1 {
    margin: 4px 0 8px;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1;
    letter-spacing: -0.06em;
    color: #0f172a;
}

.messenger-inbox-hero p:last-child {
    margin: 0;
    color: #64748b;
    font-size: 18px;
}

.messenger-ghost-btn,
.messenger-danger-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    border-radius: 999px;
    padding: 11px 16px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.messenger-ghost-btn:hover {
    background: #eff6ff;
    color: #2563eb;
    text-decoration: none;
}

.messenger-danger-light:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.messenger-search-card {
    padding: 12px;
}

.messenger-search-card input {
    width: 100%;
    border: none;
    background: #f1f5f9;
    border-radius: 18px;
    padding: 15px 18px;
    font-size: 16px;
    outline: none;
}

.messenger-inbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.messenger-dialog-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    color: #0f172a;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.messenger-dialog-card:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 18px 56px rgba(37, 99, 235, 0.12);
    text-decoration: none;
}

.messenger-dialog-card.is-unread {
    border-color: #60a5fa;
    background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.messenger-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    color: #2563eb;
    font-size: 22px;
    font-weight: 900;
}

.messenger-avatar--lg {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    border-radius: 20px;
}

.messenger-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.messenger-dialog-card__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    flex: 1;
}

.messenger-dialog-card__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.messenger-dialog-card__top strong,
.messenger-block-card strong {
    font-size: 18px;
    font-weight: 950;
    color: #0f172a;
}

.messenger-dialog-card__top time {
    color: #94a3b8;
    font-size: 13px;
    white-space: nowrap;
}

.messenger-dialog-card__preview {
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messenger-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 950;
}

.messenger-chat-page {
    max-width: 920px;
    padding-bottom: 92px;
}

.messenger-chat-header {
    position: sticky;
    top: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    backdrop-filter: blur(18px);
}

.messenger-back {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 24px;
    font-weight: 900;
    text-decoration: none;
}

.messenger-back:hover {
    background: #dbeafe;
    color: #2563eb;
    text-decoration: none;
}

.messenger-peer {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: #0f172a;
    text-decoration: none;
}

.messenger-peer:hover {
    text-decoration: none;
}

.messenger-peer__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.messenger-peer__body strong {
    font-size: 18px;
    font-weight: 950;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messenger-peer__body small {
    color: #64748b;
    font-weight: 700;
}

.messenger-actions-menu {
    position: relative;
}

.messenger-actions-menu summary {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #f1f5f9;
    font-size: 26px;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
}

.messenger-actions-menu summary::-webkit-details-marker {
    display: none;
}

.messenger-actions-menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 230px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.messenger-actions-menu__panel a,
.messenger-actions-menu__panel button {
    width: 100%;
    border: none;
    border-radius: 13px;
    background: transparent;
    padding: 10px 12px;
    text-align: left;
    color: #0f172a;
    font-weight: 850;
    cursor: pointer;
    text-decoration: none;
}

.messenger-actions-menu__panel a:hover,
.messenger-actions-menu__panel button:hover {
    background: #f1f5f9;
    text-decoration: none;
}

.messenger-system-note {
    padding: 13px 16px;
    color: #334155;
    font-weight: 800;
}

.messenger-system-note--warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.messenger-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.messenger-message {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.messenger-message.is-mine {
    justify-content: flex-end;
}

.messenger-message.is-other {
    justify-content: flex-start;
}

.messenger-message__avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 14px;
}

.messenger-message__bubble {
    max-width: min(78%, 680px);
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 12px 14px 9px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.messenger-message.is-mine .messenger-message__bubble {
    border-bottom-right-radius: 7px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border-color: #2563eb;
}

.messenger-message.is-other .messenger-message__bubble {
    border-bottom-left-radius: 7px;
    background: #ffffff;
    color: #0f172a;
}

.messenger-message__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.messenger-message__top strong {
    font-size: 13px;
    opacity: .82;
}

.messenger-quote-btn {
    border: none;
    background: rgba(255, 255, 255, 0.16);
    color: inherit;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    opacity: .78;
}

.messenger-message.is-other .messenger-quote-btn {
    background: #f1f5f9;
    color: #334155;
}

.messenger-quote-btn:hover {
    opacity: 1;
}

.messenger-message__text {
    font-size: 16px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.messenger-message__text p {
    margin: 0 0 8px;
}

.messenger-message__text p:last-child {
    margin-bottom: 0;
}

.messenger-message__text blockquote {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-left: 4px solid currentColor;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.07);
    opacity: .9;
}

.messenger-message.is-mine .messenger-message__text blockquote {
    background: rgba(255, 255, 255, 0.16);
}

.messenger-message__image {
    display: block;
    margin-top: 10px;
}

.messenger-message__image img {
    display: block;
    max-width: min(100%, 360px);
    max-height: 420px;
    border-radius: 16px;
    object-fit: cover;
}

.messenger-message__time {
    display: block;
    margin-top: 7px;
    text-align: right;
    font-size: 12px;
    opacity: .72;
}

.messenger-composer {
    position: sticky;
    bottom: 10px;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: end;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(203, 213, 225, 0.95);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(20px);
}

.messenger-composer--locked {
    display: block;
    color: #64748b;
    font-weight: 900;
    text-align: center;
}

.messenger-editor-card {
    padding: 8px;
    border-radius: 20px;
    box-shadow: none;
}

.messenger-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.messenger-editor-toolbar button {
    border: none;
    background: #f1f5f9;
    color: #0f172a;
    border-radius: 10px;
    padding: 7px 10px;
    font-weight: 900;
    cursor: pointer;
}

.messenger-editor-toolbar button:hover {
    background: #dbeafe;
    color: #2563eb;
}

.messenger-reply-preview {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding: 9px 10px;
    border-left: 4px solid #2563eb;
    border-radius: 13px;
    background: #eff6ff;
}

.messenger-reply-preview strong {
    display: block;
    color: #1d4ed8;
    font-size: 13px;
}

.messenger-reply-preview p {
    margin: 2px 0 0;
    color: #334155;
    font-size: 14px;
}

.messenger-reply-preview button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: #ffffff;
    cursor: pointer;
    font-weight: 900;
}

.messenger-editor {
    min-height: 48px;
    max-height: 180px;
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: 15px;
    background: #f8fafc;
    outline: none;
    font-size: 16px;
    line-height: 1.45;
}

.messenger-editor:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
}

.messenger-file-btn,
.messenger-send-btn {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 22px;
    font-weight: 900;
}

.messenger-file-btn {
    background: #f1f5f9;
    color: #0f172a;
}

.messenger-file-btn input {
    display: none;
}

.messenger-file-name {
    align-self: center;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.messenger-send-btn {
    background: #2563eb;
    color: #ffffff;
}

.messenger-send-btn:hover {
    background: #1d4ed8;
}

.messenger-empty-state {
    padding: 34px 20px;
    text-align: center;
    color: #64748b;
}

.messenger-empty-state div {
    font-size: 42px;
    margin-bottom: 8px;
}

.messenger-empty-state h2 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 26px;
}

.messenger-empty-state p {
    margin: 0;
}

.messenger-block-card {
    color: #0f172a;
}

@media (max-width: 760px) {
    .messenger-page {
        gap: 14px;
    }

    .messenger-inbox-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px;
        border-radius: 24px;
    }

    .messenger-chat-page {
        padding-bottom: 110px;
    }

    .messenger-chat-header {
        top: 6px;
        border-radius: 22px;
    }

    .messenger-peer__body strong {
        max-width: 150px;
    }

    .messenger-message__bubble {
        max-width: 86%;
    }

    .messenger-message__avatar {
        display: none;
    }

    .messenger-composer {
        grid-template-columns: 1fr auto auto;
        bottom: 8px;
        border-radius: 24px;
    }

    .messenger-file-name {
        display: none;
    }

    .messenger-editor-toolbar {
        gap: 4px;
    }

    .messenger-editor-toolbar button {
        padding: 6px 8px;
        font-size: 13px;
    }

    .messenger-editor {
        min-height: 44px;
        max-height: 130px;
    }

    .messenger-dialog-card {
        padding: 14px;
        border-radius: 22px;
    }
}

/* MESSAGE REACTIONS / EDIT / DELETE */
.messenger-message-tools {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.messenger-message-menu {
    position: relative;
}

.messenger-message-menu summary {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    cursor: pointer;
    list-style: none;
    font-weight: 900;
    color: #64748b;
}

.messenger-message-menu summary::-webkit-details-marker {
    display: none;
}

.messenger-message-menu summary:hover {
    background: rgba(15, 23, 42, 0.08);
}

.messenger-message-menu > div {
    position: absolute;
    top: 34px;
    right: 0;
    z-index: 20;
    min-width: 170px;
    padding: 8px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
}

.messenger-message-menu button,
.messenger-edit-form button {
    width: 100%;
    border: none;
    background: transparent;
    color: #0f172a;
    text-align: left;
    border-radius: 10px;
    padding: 9px 10px;
    font-weight: 800;
    cursor: pointer;
}

.messenger-message-menu button:hover,
.messenger-edit-form button:hover {
    background: #f1f5f9;
}

.messenger-message__deleted {
    color: #94a3b8;
    font-style: italic;
    font-weight: 700;
}

.messenger-message__bubble.is-deleted {
    opacity: 0.76;
}

.messenger-reaction-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(3px);
    transition: all 0.15s ease;
}

.messenger-message__bubble:hover .messenger-reaction-bar,
.messenger-message__bubble:focus-within .messenger-reaction-bar {
    opacity: 1;
    transform: translateY(0);
}

.messenger-reaction-bar form {
    margin: 0;
}

.messenger-reaction-bar button,
.messenger-reaction-counts span {
    border: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.84);
    border-radius: 999px;
    padding: 4px 8px;
    cursor: pointer;
    line-height: 1;
    font-size: 15px;
}

.messenger-reaction-bar button:hover,
.messenger-reaction-bar button.is-active,
.messenger-reaction-counts span.is-active {
    background: #dbeafe;
    border-color: #93c5fd;
}

.messenger-reaction-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.messenger-edit-form {
    margin-top: 10px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(148, 163, 184, 0.45);
}

.messenger-edit-form textarea {
    width: 100%;
    min-height: 90px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    outline: none;
}

.messenger-edit-form textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.messenger-edit-form > div {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.messenger-edit-form button {
    width: auto;
    background: #2563eb;
    color: #ffffff;
    text-align: center;
}

.messenger-edit-form .messenger-edit-cancel {
    background: #e2e8f0;
    color: #0f172a;
}

.messenger-read-status {
    margin-left: 5px;
    color: #2563eb;
    font-weight: 900;
    letter-spacing: -0.12em;
}

@media (max-width: 760px) {
    .messenger-reaction-bar {
        opacity: 1;
        transform: none;
    }

    .messenger-message-menu > div {
        right: -8px;
    }
}


/* === Messenger light polish pack === */
.messenger-message.is-mine .messenger-message__bubble,
.chat-message--mine .chat-message__bubble {
    background: #d9fdd3 !important;
    border-color: #b7e8ae !important;
    color: #102313 !important;
}

.messenger-message.is-other .messenger-message__bubble,
.chat-message--other .chat-message__bubble {
    background: #ffffff !important;
    border-color: #e0e4e8 !important;
}

.messenger-system-note:not(.messenger-system-note--warning) {
    display: none !important;
}

.messenger-call-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -8px 0 8px;
}

.messenger-call-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #d7dde5;
    background: #ffffff;
    color: #17212b;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.messenger-call-chip:hover {
    background: #eef7ff;
    color: #168acd;
    text-decoration: none;
}

/* compact users list */
.portal-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.portal-user-card {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e6ebf0;
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.045);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.portal-user-card:hover {
    transform: translateY(-1px);
    border-color: #cfe4ff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
}

.portal-user-card__avatar {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    overflow: visible;
    background: #eef4ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 54px;
}

.portal-user-card__avatar img {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.portal-user-card__avatar .online-dot,
.online-dot {
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 13px;
    height: 13px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #a3aab4;
}

.online-dot.is-online {
    background: #21c45d;
}

.portal-user-card__body {
    min-width: 0;
}

.portal-user-card__name {
    display: block;
    color: #111827;
    font-size: 16px;
    line-height: 1.15;
    font-weight: 950;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.portal-user-card__name:hover {
    color: #168acd;
    text-decoration: none;
}

.portal-user-card__username,
.portal-user-card__location,
.portal-user-card__status,
.portal-user-card__role {
    margin: 3px 0 0;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.portal-user-card__role {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 3px 8px;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 950;
}

.portal-user-card__status.is-online {
    color: #128c4a;
}

.portal-user-card__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
}

.portal-user-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid #d7dde5;
    background: #ffffff;
    color: #17212b;
    padding: 7px 11px;
    font-size: 13px;
    font-weight: 950;
    text-decoration: none;
    white-space: nowrap;
}

.portal-user-btn:hover {
    background: #eef7ff;
    color: #168acd;
    text-decoration: none;
}

.portal-user-btn--primary {
    background: #168acd;
    border-color: #168acd;
    color: #ffffff;
}

.portal-user-btn--primary:hover {
    background: #0f77b4;
    color: #ffffff;
}

@media (max-width: 720px) {
    .portal-users-grid {
        grid-template-columns: 1fr;
    }

    .portal-user-card {
        grid-template-columns: 48px minmax(0, 1fr) auto;
        padding: 10px;
    }

    .portal-user-card__avatar,
    .portal-user-card__avatar img {
        width: 48px;
        height: 48px;
    }

    .portal-user-card__actions {
        flex-direction: row;
    }

    .portal-user-btn:not(.portal-user-btn--primary) {
        display: none;
    }
}


/* =========================================================
   PROFILE STATUS / VIP / BUSINESS
========================================================= */

.profile-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 10px 0 12px;
}

.profile-status-badge,
.profile-status-mini,
.classified-seller-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 13px;
    font-weight: 950;
    line-height: 1;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    color: #374151;
}

.profile-status-badge.is-verified,
.profile-status-mini.is-verified,
.classified-seller-status.is-verified {
    background: #eef6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.profile-status-badge.is-vip,
.profile-status-mini.is-vip,
.classified-seller-status.is-vip {
    background: linear-gradient(135deg, #fff7d6, #ffe08a);
    border-color: #f4c542;
    color: #7a4b00;
    box-shadow: 0 8px 22px rgba(244, 197, 66, .18);
}

.profile-status-badge.is-business,
.profile-status-mini.is-business,
.classified-seller-status.is-business {
    background: linear-gradient(135deg, #161616, #3b2b08);
    border-color: rgba(244, 197, 66, .48);
    color: #ffe08a;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .18);
}

.profile-business-name {
    color: #6b7280;
    font-weight: 850;
}

.author-profile-card {
    position: relative;
    overflow: hidden;
}

.author-profile-card__cover {
    position: absolute;
    inset: 0 0 auto 0;
    height: 150px;
    background-size: cover;
    background-position: center;
    opacity: .95;
}

.author-profile-card--with-cover {
    padding-top: 118px;
}

.author-profile-card--with-cover::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 150px;
    background: linear-gradient(180deg, rgba(15,23,42,.10), rgba(255,255,255,.92));
    pointer-events: none;
}

.author-profile-card--with-cover > *:not(.author-profile-card__cover) {
    position: relative;
    z-index: 2;
}

.pinned-blog-card {
    margin: 0 0 18px;
    padding: 18px;
    border: 1px solid rgba(244, 197, 66, .55);
    border-radius: 22px;
    background: linear-gradient(135deg, #fffdf2, #ffffff);
    box-shadow: 0 12px 32px rgba(244, 197, 66, .10);
}

.pinned-blog-card p {
    margin: 0 0 8px;
    color: #9a6700;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 13px;
}

.pinned-blog-card h3 {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.15;
}

.pinned-blog-card a {
    color: #111827;
    text-decoration: none;
}

@media (max-width: 760px) {
    .author-profile-card__cover {
        height: 120px;
    }

    .author-profile-card--with-cover {
        padding-top: 96px;
    }

    .author-profile-card--with-cover::after {
        height: 120px;
    }
}

/* v14: выразительный онлайн/оффлайн */
.profile-online-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2f7;
    color: #7b8491;
    font-size: 14px;
    font-weight: 850;
    vertical-align: middle;
}

.profile-online-status.is-online {
    background: #dcfce7;
    color: #087a3d;
    box-shadow: 0 8px 24px rgba(18, 172, 90, .18);
}

.profile-online-status.is-hidden {
    background: #f1f5f9;
    color: #94a3b8;
}

.online-dot {
    box-shadow: none;
}

.online-dot.is-online {
    background: #18b95b;
    box-shadow: 0 0 0 4px rgba(24, 185, 91, .16), 0 0 12px rgba(24, 185, 91, .55);
}

.online-dot.is-hidden {
    background: #cbd5e1;
}

.portal-user-card__status.is-online {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 4px 9px;
    background: #dcfce7;
    color: #087a3d;
    font-weight: 950;
}

.portal-user-card__status.is-hidden {
    color: #94a3b8;
}

.auth-hint--warning {
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 16px;
    padding: 12px 14px;
}

.auth-dev-link a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: #08aa68;
    color: #ffffff;
    font-weight: 900;
    text-decoration: none;
}


/* v15: онлайн заметнее, оффлайн спокойнее */
.profile-online-status.is-online,
.portal-user-card__status.is-online {
    background: linear-gradient(135deg, #d9ffe9 0%, #bff6d5 100%) !important;
    color: #00854a !important;
    border: 1px solid rgba(0, 176, 99, .28) !important;
    box-shadow: 0 8px 22px rgba(0, 176, 99, .16) !important;
    font-weight: 900 !important;
}

.profile-online-status:not(.is-online):not(.is-hidden),
.portal-user-card__status:not(.is-online):not(.is-hidden) {
    background: transparent !important;
    color: #8b95a3 !important;
    box-shadow: none !important;
}

.online-dot.is-online,
.portal-user-card__online-dot.is-online {
    background: #00b86b !important;
    box-shadow: 0 0 0 5px rgba(0, 184, 107, .16), 0 0 16px rgba(0, 184, 107, .75) !important;
}

.auth-email-notice {
    margin: 0 0 22px;
    padding: 16px 18px;
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    background: #eff6ff;
    color: #142033;
}

.auth-email-notice strong {
    display: block;
    margin-bottom: 8px;
    color: #0b5ed7;
    font-size: 17px;
    font-weight: 950;
}

.auth-email-notice p {
    margin: 6px 0 0;
    color: #475569;
    line-height: 1.55;
}

.auth-hint--small {
    margin-top: -8px;
    font-size: 14px;
}

.auth-hint--small a {
    color: #0b5ed7;
    font-weight: 900;
}

/* Telegram Login */
.telegram-auth-box {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid #d7e9ff;
    border-radius: 18px;
    background: #f3f8ff;
    text-align: center;
}

.telegram-auth-title {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.telegram-auth-note {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.45;
}

.social-auth-box{margin:14px 0}.social-login-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:44px;border:1px solid #d7dbe3;border-radius:10px;background:#fff;color:#1f2937;font-weight:700;text-decoration:none;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}.social-login-btn:hover{border-color:#c32026;box-shadow:0 8px 22px rgba(17,24,39,.08);transform:translateY(-1px);color:#c32026}.social-login-icon{width:24px;height:24px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;border:1px solid #d7dbe3;font-weight:800}

/* Google login button */
.social-auth-stack {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}
.google-auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid #d8dee8;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    text-decoration: none;
    font-weight: 850;
    box-shadow: 0 8px 22px rgba(17, 24, 39, .06);
}
.google-auth-button:hover,
.google-auth-button:focus-visible {
    border-color: #b8c2d3;
    background: #f8fafc;
    color: #111827;
}
.google-auth-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    font-weight: 900;
    color: #2563eb;
    background: #fff;
}
