/* lg-messenger.css — Logozavr Universal Messenger & Admin Moderation */

.lg-msg-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    background: #f8fafc;
    overflow: hidden;
}

.lg-msg-wrap {
    flex: 1 1 auto;
    display: flex;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    height: 100%;
    background: #fff;
    border-left: 1px solid var(--lg-border, #e2e8f0);
    border-right: 1px solid var(--lg-border, #e2e8f0);
    overflow: hidden;
}

.lg-msg-search-box {
    position: relative;
    margin-top: 10px;
}

.lg-msg-search-box input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--lg-border, #e2e8f0);
    border-radius: 10px;
    font-size: 13px;
    background: #f8fafc;
    color: var(--lg-text, #1e293b);
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
}

.lg-msg-search-box input:focus {
    border-color: var(--lg-emerald, #059669);
    background: #fff;
}

.lg-msg-search-box i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
}

/* Sidebar */
.lg-msg-sidebar {
    width: 360px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--lg-border, #e2e8f0);
    background: #fff;
    flex-shrink: 0;
}

.lg-msg-sidebar__head {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--lg-border, #e2e8f0);
    background: #fff;
}

.lg-msg-sidebar__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lg-msg-sidebar__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--lg-blue, #0f2d52);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lg-msg-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    background: rgba(15, 45, 82, 0.05);
    padding: 3px;
    border-radius: 999px;
}

.lg-msg-tab {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--lg-muted, #64748b);
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-align: center;
    white-space: nowrap;
}

.lg-msg-tab.is-active {
    background: var(--lg-blue, #0f2d52);
    color: #fff;
}

.lg-msg-threads {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.lg-msg-thread-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
    width: 100%;
    background: transparent;
    border: none;
    font-family: inherit;
}

.lg-msg-thread-item:hover {
    background: #f8fafc;
}

.lg-msg-thread-item.is-active {
    background: rgba(5, 150, 105, 0.08);
    border-left: 3px solid var(--lg-emerald, #059669);
    padding-left: 13px;
}

.lg-msg-thread-item__ava {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e2e8f0;
}

.lg-msg-thread-item__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lg-msg-thread-item__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.lg-msg-thread-item__name {
    font-size: 14px;
    font-weight: 700;
    color: var(--lg-blue, #0f2d52);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lg-msg-thread-item__time {
    font-size: 11px;
    color: var(--lg-muted, #64748b);
    flex-shrink: 0;
}

.lg-msg-thread-item__preview {
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.lg-msg-thread-item__meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--lg-emerald, #059669);
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.16);
    padding: 2px 7px;
    border-radius: 6px;
    align-self: flex-start;
    line-height: 1.35;
}

.lg-msg-thread-item__blocked-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #b91c1c;
    background: #fee2e2;
    border: 1px solid rgba(185, 28, 28, 0.16);
    padding: 2px 7px;
    border-radius: 6px;
    align-self: flex-start;
    line-height: 1.35;
}

/* Stage / Chat view */
.lg-msg-stage {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    background-color: #eaf3fb;
    background-image: url('/assets/png/messenger-bg.png');
    background-repeat: repeat;
    background-position: center top;
    background-size: 420px auto;
}

.lg-msg-empty {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
    color: var(--lg-muted, #64748b);
}

.lg-msg-empty[hidden],
.lg-msg-chat[hidden] {
    display: none !important;
}

.lg-msg-empty__icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.lg-msg-empty__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--lg-blue, #0f2d52);
    margin: 0 0 6px;
}

/* Active chat */
.lg-msg-chat {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

.lg-msg-chat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--lg-border, #e2e8f0);
    background: #fff;
    flex-shrink: 0;
}

.lg-msg-chat__head-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.lg-msg-chat__back {
    display: none;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--lg-blue, #0f2d52);
    cursor: pointer;
    padding: 8px 10px;
    margin-left: -8px;
}

.lg-msg-chat__peer-ava {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.lg-msg-chat__peer-clickable {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.lg-msg-chat__peer-clickable:hover {
    background: rgba(15, 45, 82, 0.04);
}

.lg-msg-chat__peer-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lg-msg-chat__peer-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--lg-blue, #0f2d52);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lg-msg-chat__peer-sub {
    font-size: 12px;
    font-weight: 600;
    color: var(--lg-emerald, #059669);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lg-msg-chat__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lg-msg-chat__settings-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--lg-border, #e2e8f0);
    background: #fff;
    color: var(--lg-blue, #0f2d52);
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.lg-msg-chat__settings-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.lg-msg-chat__settings-btn:active {
    transform: scale(0.94);
}

.lg-msg-chat__tool-btn--danger {
    color: #b91c1c;
}

.lg-msg-chat__tool-btn--danger:hover {
    color: #fff;
    background: #dc2626;
    border-color: #dc2626;
}

/* Messages area */
.lg-msg-stream {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Card Widget Message */
/* Card Widget Message */
.lg-msg-card-bubble {
    align-self: flex-start;
    max-width: 440px;
    width: 100%;
    margin: 6px 0;
}

.lg-msg-card-bubble.is-mine {
    align-self: flex-end;
}

.lg-msg-card {
    background: #fff;
    border: 1px solid var(--lg-border, #e2e8f0);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 4px 14px rgba(15, 45, 82, 0.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lg-msg-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--lg-emerald, #059669);
    background: rgba(5, 150, 105, 0.1);
    padding: 3px 8px;
    border-radius: 999px;
    align-self: flex-start;
}

.lg-msg-card__content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lg-msg-card__ava {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.lg-msg-card__meta {
    flex: 1 1 auto;
    min-width: 0;
}

.lg-msg-card__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--lg-blue, #0f2d52);
    margin: 0 0 2px;
    line-height: 1.25;
}

.lg-msg-card__role {
    font-size: 12px;
    font-weight: 600;
    color: var(--lg-emerald, #059669);
    line-height: 1.35;
    margin: 0 0 2px;
}

.lg-msg-card__city {
    font-size: 11px;
    color: var(--lg-muted, #64748b);
    display: flex;
    align-items: center;
    gap: 4px;
}

.lg-msg-card__question {
    background: #f8fafc;
    border-left: 3px solid var(--lg-emerald, #059669);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #1e293b;
    line-height: 1.45;
    word-break: break-word;
}

.lg-msg-card__foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.lg-msg-card__time {
    font-size: 10px;
    color: var(--lg-muted, #64748b);
}

/* Text message bubbles */
.lg-msg-bubble {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    position: relative;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

.lg-msg-bubble--mine {
    align-self: flex-end;
    background: var(--lg-blue, #0f2d52);
    color: #fff;
    border-bottom-right-radius: 3px;
}

.lg-msg-bubble--mine .lg-msg-bubble__time {
    color: rgba(255, 255, 255, 0.7);
}

.lg-msg-bubble--peer {
    align-self: flex-start;
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 3px;
}

.lg-msg-bubble--deleted {
    font-style: italic;
    opacity: 0.6;
    background: #f1f5f9 !important;
    color: #64748b !important;
    border: 1px dashed #cbd5e1 !important;
}

/* Support message styling */
.lg-msg-bubble--support {
    border: 1.5px solid #059669;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.12);
}

.lg-msg-bubble--support.lg-msg-bubble--mine {
    background: #0f2d52;
    border-color: #10b981;
}

.lg-msg-bubble--support.lg-msg-bubble--peer {
    background: #f0fdf4;
    border-color: #059669;
}

.lg-msg-bubble__support-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 5px;
    align-self: flex-start;
}

.lg-msg-bubble--mine .lg-msg-bubble__support-tag {
    background: rgba(16, 185, 129, 0.25);
    color: #34d399;
}

.lg-msg-bubble--peer .lg-msg-bubble__support-tag {
    background: #dcfce7;
    color: #065f46;
}

.lg-msg-bubble__sender {
    font-size: 11px;
    font-weight: 700;
    color: var(--lg-emerald, #059669);
    margin-bottom: 2px;
}

.lg-msg-bubble__time {
    font-size: 10px;
    color: var(--lg-muted, #64748b);
    align-self: flex-end;
    margin-top: 4px;
}

.lg-msg-bubble__del-action {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    color: #ef4444;
    cursor: pointer;
    background: transparent;
    border: none;
    font-size: 11px;
    padding: 2px;
}

/* Compose bar */
.lg-msg-compose {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--lg-border, #e2e8f0);
    background: #fff;
    flex-shrink: 0;
}

.lg-msg-compose input {
    flex: 1 1 auto;
    border: 1px solid var(--lg-border, #e2e8f0);
    border-radius: 12px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--lg-text, #1e293b);
    background: #f8fafc;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.lg-msg-compose input:focus {
    border-color: var(--lg-emerald, #059669);
    background: #fff;
}

.lg-msg-compose__send {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: var(--lg-emerald, #059669);
    color: #fff;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.15s ease;
}

.lg-msg-compose__send:hover {
    background: #047857;
    transform: translateY(-1px);
}

.lg-msg-compose__send:active {
    transform: translateY(0);
}

.lg-msg-blocked-notice {
    padding: 12px 18px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 13px;
    text-align: center;
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 768px) {
    body.lg-msg-thread-open .lg-header,
    body.lg-msg-thread-open header.lg-header {
        display: none !important;
    }

    body.lg-msg-thread-open .lg-msg-page {
        height: 100vh !important;
        height: 100dvh !important;
    }

    .lg-msg-wrap {
        height: calc(100vh - 56px);
        border: none;
    }

    body.lg-msg-thread-open .lg-msg-wrap {
        height: 100vh !important;
        height: 100dvh !important;
    }

    .lg-msg-sidebar {
        width: 100%;
        min-width: 100%;
    }

    .lg-msg-stage {
        display: none;
    }

    body.lg-msg-thread-open .lg-msg-sidebar {
        display: none;
    }

    body.lg-msg-thread-open .lg-msg-stage {
        display: flex;
    }

    .lg-msg-chat__back {
        display: inline-flex;
    }
}

/* Thread Item Badges & Indicators */
.lg-msg-thread-item {
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.lg-msg-thread-item.is-pressing {
    background: #e2e8f0 !important;
    transform: scale(0.985);
    transition: transform 0.1s ease, background 0.1s ease;
}

.lg-msg-thread-item__unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--lg-emerald, #059669);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.lg-msg-thread-item__pin-icon {
    font-size: 11px;
    color: #94a3b8;
    margin-right: 4px;
}

.lg-msg-thread-item__mute-icon {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 4px;
}

/* Pinned Message Bar */
.lg-msg-pinned-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    background: #f0fdf4;
    border-bottom: 1px solid #bbf7d0;
    flex-shrink: 0;
    z-index: 5;
}

.lg-msg-pinned-bar__content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    cursor: pointer;
}

.lg-msg-pinned-bar__icon {
    color: var(--lg-emerald, #059669);
    font-size: 15px;
    flex-shrink: 0;
}

.lg-msg-pinned-bar__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lg-msg-pinned-bar__title {
    font-size: 11px;
    font-weight: 700;
    color: var(--lg-emerald, #059669);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.lg-msg-pinned-bar__body {
    font-size: 13px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lg-msg-pinned-bar__unpin {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.lg-msg-pinned-bar__unpin:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.05);
}

/* Context Action Bar (Reply / Edit Mode) */
.lg-msg-context-bar {
    padding: 8px 16px;
    background: #f1f5f9;
    border-top: 1px solid var(--lg-border, #e2e8f0);
    flex-shrink: 0;
    animation: lgMsgSlideDown 0.18s ease;
}

@keyframes lgMsgSlideDown {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.lg-msg-context-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lg-msg-context-bar__left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.lg-msg-context-bar__icon {
    color: var(--lg-emerald, #059669);
    font-size: 16px;
    flex-shrink: 0;
}

.lg-msg-context-bar__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lg-msg-context-bar__title {
    font-size: 12px;
    font-weight: 700;
    color: var(--lg-emerald, #059669);
}

.lg-msg-context-bar__preview {
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lg-msg-context-bar__cancel {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
}

.lg-msg-context-bar__cancel:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.05);
}

/* Quoted Reply inside message bubble */
.lg-msg-bubble__reply-quote {
    background: rgba(0, 0, 0, 0.06);
    border-left: 3px solid var(--lg-emerald, #059669);
    border-radius: 6px;
    padding: 5px 8px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lg-msg-bubble--mine .lg-msg-bubble__reply-quote {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: #fff;
    color: #fff;
}

.lg-msg-bubble__reply-name {
    font-weight: 700;
    font-size: 11px;
    color: var(--lg-emerald, #059669);
}

.lg-msg-bubble--mine .lg-msg-bubble__reply-name {
    color: #a7f3d0;
}

.lg-msg-bubble__reply-text {
    color: inherit;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lg-msg-bubble__edited {
    font-size: 10px;
    opacity: 0.65;
    margin-left: 4px;
}

.lg-msg-bubble {
    user-select: text;
    -webkit-user-select: text;
    -webkit-touch-callout: none;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.lg-msg-bubble.is-pressing {
    transform: scale(0.97);
    opacity: 0.85;
}

.lg-msg-bubble.is-highlighted {
    animation: lgMsgHighlight 1.5s ease;
}

@keyframes lgMsgHighlight {
    0% { outline: 3px solid var(--lg-emerald, #059669); }
    100% { outline: 3px solid transparent; }
}

/* Bottom Sheet / Context Actions Modal */
.lg-msg-sheet {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.lg-msg-sheet[hidden] {
    display: none !important;
}

.lg-msg-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: lgFadeIn 0.18s ease;
}

@keyframes lgFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lg-msg-sheet__panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 12px 16px 24px;
    box-shadow: 0 -8px 30px rgba(15, 45, 82, 0.15);
    animation: lgSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

@media (min-width: 769px) {
    .lg-msg-sheet {
        align-items: center;
    }
    .lg-msg-sheet__panel {
        border-radius: 18px;
        padding: 18px 20px;
        box-shadow: 0 12px 40px rgba(15, 45, 82, 0.2);
    }
}

@keyframes lgSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.lg-msg-sheet__handle {
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 0 auto 12px;
}

@media (min-width: 769px) {
    .lg-msg-sheet__handle {
        display: none;
    }
}

.lg-msg-sheet__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--lg-border, #e2e8f0);
    margin-bottom: 8px;
}

.lg-msg-sheet__ava {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    background: #e2e8f0;
}

.lg-msg-sheet__user {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lg-msg-sheet__name {
    margin: 0 0 2px;
    font-size: 16px;
    font-weight: 700;
    color: var(--lg-blue, #0f2d52);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lg-msg-sheet__sub {
    margin: 3px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--lg-emerald, #059669);
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.16);
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    align-self: flex-start;
}

.lg-msg-sheet__quote {
    background: #f8fafc;
    border-left: 3px solid var(--lg-emerald, #059669);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #334155;
    margin-bottom: 10px;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.lg-msg-sheet__menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lg-msg-sheet__item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.lg-msg-sheet__item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--lg-blue, #0f2d52);
}

.lg-msg-sheet__item:hover {
    background: #f1f5f9;
}

.lg-msg-sheet__item:active {
    background: #e2e8f0;
}

.lg-msg-sheet__item--danger {
    color: #dc2626;
}

.lg-msg-sheet__item--danger i {
    color: #dc2626;
}

.lg-msg-sheet__item--danger:hover {
    background: #fee2e2;
}

.lg-msg-sheet__item--warn {
    color: #b45309;
}

.lg-msg-sheet__item--warn i {
    color: #b45309;
}

.lg-msg-sheet__item--warn:hover {
    background: #fef3c7;
}

/* Report Modal */
.lg-msg-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.lg-msg-modal[hidden] {
    display: none !important;
}

.lg-msg-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
}

.lg-msg-modal__box {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 45, 82, 0.2);
    overflow: hidden;
    animation: lgScaleUp 0.18s ease;
}

@keyframes lgScaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lg-msg-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--lg-border, #e2e8f0);
}

.lg-msg-modal__head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--lg-blue, #0f2d52);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lg-msg-modal__close {
    background: transparent;
    border: none;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
}

.lg-msg-modal__body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lg-msg-report-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #1e293b;
    cursor: pointer;
    padding: 4px 0;
}

.lg-msg-report-option input[type="radio"] {
    accent-color: var(--lg-emerald, #059669);
    width: 16px;
    height: 16px;
}

.lg-msg-modal__textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--lg-border, #e2e8f0);
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    color: #1e293b;
    background: #f8fafc;
    box-sizing: border-box;
    outline: none;
    resize: none;
    margin-top: 6px;
}

.lg-msg-modal__textarea:focus {
    border-color: var(--lg-emerald, #059669);
    background: #fff;
}

.lg-msg-modal__foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--lg-border, #e2e8f0);
}

.lg-btn-secondary {
    border: 1px solid var(--lg-border, #e2e8f0);
    background: #fff;
    color: #334155;
    padding: 8px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.lg-btn-danger {
    border: none;
    background: #dc2626;
    color: #fff;
    padding: 8px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.lg-btn-primary {
    border: none;
    background: var(--lg-emerald, #059669);
    color: #fff;
    padding: 11px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
    text-decoration: none;
    box-sizing: border-box;
}

.lg-btn-primary:hover {
    background: #047857;
    transform: translateY(-1px);
}

.lg-btn-primary:active {
    transform: translateY(0);
}

/* Parent Profile Stub Modal */
.lg-msg-parent-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--lg-emerald, #059669);
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.18);
    padding: 3px 10px;
    border-radius: 999px;
}

.lg-msg-parent-card__body {
    padding: 14px 22px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.lg-msg-parent-card__ava-wrap {
    position: relative;
    margin-bottom: 12px;
}

.lg-msg-parent-card__ava {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f1f5f9;
    box-shadow: 0 4px 14px rgba(15, 45, 82, 0.12);
    display: block;
}

.lg-msg-parent-card__role-tag {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--lg-blue, #0f2d52);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.lg-msg-parent-card__name {
    margin: 4px 0 2px;
    font-size: 18px;
    font-weight: 700;
    color: var(--lg-blue, #0f2d52);
}

.lg-msg-parent-card__sub {
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.lg-msg-parent-card__notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    text-align: left;
    margin-bottom: 14px;
    width: 100%;
    box-sizing: border-box;
}

.lg-msg-parent-card__notice-icon {
    font-size: 16px;
    color: var(--lg-emerald, #059669);
    margin-top: 2px;
    flex-shrink: 0;
}

.lg-msg-parent-card__notice-text strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--lg-blue, #0f2d52);
    margin-bottom: 3px;
}

.lg-msg-parent-card__notice-text p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #475569;
}

.lg-msg-parent-card__details {
    width: 100%;
    text-align: left;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    box-sizing: border-box;
}

.lg-msg-parent-card__details-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    margin-bottom: 4px;
}

.lg-msg-parent-card__details-val {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.4;
    word-break: break-word;
}

/* Toast */
.lg-msg-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--lg-blue, #0f2d52);
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(15, 45, 82, 0.25);
    z-index: 10005;
    pointer-events: none;
    animation: lgToastPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

@keyframes lgToastPop {
    from { opacity: 0; transform: translate(-50%, 15px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Reactions bar inside bottom sheet */
.lg-msg-reactions-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 6px 10px;
    margin-bottom: 12px;
    background: #f8fafc;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-x: contain;
}

.lg-msg-reactions-bar::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.lg-msg-reaction-btn {
    flex: 0 0 auto;
    flex-shrink: 0;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    min-width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.lg-msg-reaction-btn:hover {
    transform: scale(1.22);
    background: rgba(15, 45, 82, 0.08);
}

.lg-msg-reaction-btn:active {
    transform: scale(0.92);
}

/* Reactions pill row on message bubble */
.lg-msg-reactions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    position: relative;
    z-index: 2;
}

.lg-msg-bubble--mine .lg-msg-reactions,
.lg-msg-card-bubble.is-mine .lg-msg-reactions {
    justify-content: flex-end;
}

.lg-msg-bubble--peer .lg-msg-reactions,
.lg-msg-card-bubble:not(.is-mine) .lg-msg-reactions {
    justify-content: flex-start;
}

.lg-msg-rx-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.lg-msg-rx-pill:hover {
    transform: scale(1.08);
}

.lg-msg-rx-pill:active {
    transform: scale(0.95);
}

.lg-msg-rx-pill__emoji {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
}

.lg-msg-rx-pill__count {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* Peer bubble reactions (light bubble) */
.lg-msg-bubble--peer .lg-msg-rx-pill,
.lg-msg-card-bubble:not(.is-mine) .lg-msg-rx-pill {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(15, 45, 82, 0.06);
}

.lg-msg-bubble--peer .lg-msg-rx-pill:hover,
.lg-msg-card-bubble:not(.is-mine) .lg-msg-rx-pill:hover {
    background: #e2e8f0;
}

.lg-msg-bubble--peer .lg-msg-rx-pill.is-active,
.lg-msg-card-bubble:not(.is-mine) .lg-msg-rx-pill.is-active {
    background: rgba(5, 150, 105, 0.12);
    border-color: #059669;
    color: #059669;
    box-shadow: 0 1px 4px rgba(5, 150, 105, 0.18);
}

/* Mine bubble reactions (dark blue #0f2d52 bubble) */
.lg-msg-bubble--mine .lg-msg-rx-pill,
.lg-msg-card-bubble.is-mine .lg-msg-rx-pill {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.lg-msg-bubble--mine .lg-msg-rx-pill:hover,
.lg-msg-card-bubble.is-mine .lg-msg-rx-pill:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lg-msg-bubble--mine .lg-msg-rx-pill.is-active,
.lg-msg-card-bubble.is-mine .lg-msg-rx-pill.is-active {
    background: rgba(16, 185, 129, 0.35);
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 1px 6px rgba(16, 185, 129, 0.3);
}

/* Double-tap reaction pop animation */
@keyframes lgReactionPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3) rotate(-15deg);
    }
    45% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.4) rotate(0deg);
    }
    75% {
        opacity: 0.95;
        transform: translate(-50%, -55%) scale(1.15) rotate(5deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -85%) scale(0.85);
    }
}

.lg-msg-double-tap-pop {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 44px;
    line-height: 1;
    pointer-events: none;
    z-index: 25;
    animation: lgReactionPop 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}
