/* =========================================================
   GenACNH NookPhone Island Messenger & Friends Stylesheet
   Animal Crossing: New Horizons Themed Floating Dock & Tabs
   ========================================================= */

:root {
    --acnh-bg-dark: #071916;
    --acnh-bg-card: #0e2722;
    --acnh-bg-card-hover: #163832;
    --acnh-bg-input: #12332d;
    --acnh-border: rgba(45, 212, 191, 0.22);
    --acnh-border-subtle: rgba(255, 255, 255, 0.08);
    --acnh-text-main: #f0fdfa;
    --acnh-text-muted: #99f6e4;
    --acnh-text-dim: #5eead4;
    --acnh-teal: #2dd4bf;
    --acnh-green: #10b981;
    --acnh-gold: #fbbf24;
    --acnh-purple: #c084fc;
    --acnh-coral: #fb7185;
    --acnh-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(45, 212, 191, 0.15);
}

/* Bulletproof Mobile Background Scroll Lock */
body.ms-panel-open, html.ms-panel-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    touch-action: none !important;
    -webkit-overflow-scrolling: auto !important;
}

/* Modals and full-screen overlays with z-index >= 100000 naturally layer above the messenger without hiding it */
#genacnh-messenger-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: 'Varela Round', 'Plus Jakarta Sans', sans-serif;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#genacnh-messenger-root * {
    box-sizing: border-box;
}

/* =========================================================
   Floating Facebook-Style Live Chat Launcher Bubble
   ========================================================= */
.messenger-launcher-bubble {
    pointer-events: auto !important;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0084ff 0%, #00b4d8 50%, #2dd4bf 100%);
    border: 2.5px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 30px rgba(0, 132, 255, 0.5), 0 4px 15px rgba(0, 0, 0, 0.6);
    color: #ffffff;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    outline: none;
    user-select: none;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

.messenger-launcher-bubble:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 16px 40px rgba(0, 132, 255, 0.65), 0 6px 20px rgba(0, 0, 0, 0.7);
    border-color: #ffffff;
}

.messenger-launcher-bubble:active {
    transform: scale(0.94);
}

/* User Profile Avatar in Floating Launcher */
.messenger-launcher-bubble.has-avatar {
    background: linear-gradient(135deg, #064e3b 0%, #0e2722 50%, #163832 100%);
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.45), 0 4px 15px rgba(0, 0, 0, 0.6);
    overflow: visible;
}

/* Inner circular wrapper clips icon speech bubble tails and avatar scale */
.messenger-launcher-avatar-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden !important;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    background: #09201c;
}

.messenger-launcher-avatar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    background: #09201c;
    z-index: 2;
}

.messenger-launcher-bubble.has-avatar:hover .messenger-launcher-avatar {
    transform: scale(1.06);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.messenger-launcher-bubble.has-avatar.presence-online {
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.5), 0 4px 15px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.95);
}

.messenger-launcher-bubble.has-avatar.presence-idle {
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.5), 0 4px 15px rgba(0, 0, 0, 0.6);
    border-color: rgba(254, 240, 138, 0.95);
}

.messenger-launcher-bubble.has-avatar.presence-dnd {
    box-shadow: 0 10px 28px rgba(239, 68, 68, 0.5), 0 4px 15px rgba(0, 0, 0, 0.6);
    border-color: rgba(254, 202, 202, 0.95);
}

.messenger-launcher-bubble.has-avatar.presence-invisible,
.messenger-launcher-bubble.has-avatar.presence-offline {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65);
    border-color: rgba(148, 163, 184, 0.8);
}

/* Visibility rules between avatar & main icon */
.messenger-launcher-bubble.has-avatar.avatar-loaded #messenger-launcher-icon,
.messenger-launcher-bubble.has-avatar.avatar-loaded .messenger-icon-main,
.messenger-launcher-bubble.has-avatar.avatar-loaded i.messenger-icon-main,
.messenger-launcher-bubble.has-avatar.avatar-loaded svg.messenger-icon-main {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.messenger-launcher-bubble .messenger-launcher-avatar {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease-in;
}

.messenger-launcher-bubble.has-avatar.avatar-loaded:not(.is-open) .messenger-launcher-avatar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 2 !important;
}

.messenger-launcher-bubble:not(.has-avatar) .messenger-launcher-avatar {
    display: none !important;
}

#messenger-launcher-btn.is-open,
.messenger-launcher-bubble.is-open {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.messenger-icon-main {
    font-size: 1.85rem;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
    padding: 0;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
    z-index: 2;
}

.messenger-launcher-bubble:hover .messenger-icon-main {
    transform: scale(1.1);
}

/* Launcher Floating Presence Status Pip (Dynamic Online, Idle, DND, Offline) - Overlayed on Avatar */
.messenger-launcher-pip {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid #071916;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    pointer-events: none;
    z-index: 15 !important;
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Online Pip (Green) */
.messenger-launcher-pip.online {
    background: #10b981;
    border-color: #071916;
    box-shadow: 0 0 10px #10b981;
    animation: msPipGlow 2s infinite;
}

@keyframes msPipGlow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 8px #10b981; }
    50% { transform: scale(1.18); box-shadow: 0 0 14px #34d399; }
}

/* Idle Pip (Amber / Yellow) */
.messenger-launcher-pip.idle {
    background: #f59e0b;
    border-color: #071916;
    box-shadow: 0 0 10px #f59e0b;
    animation: msPipIdleGlow 2.5s infinite;
}

@keyframes msPipIdleGlow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 8px #f59e0b; }
    50% { transform: scale(1.18); box-shadow: 0 0 14px #fbbf24; }
}

/* DND / Do Not Disturb Pip (Red) */
.messenger-launcher-pip.dnd {
    background: #ef4444;
    border-color: #071916;
    box-shadow: 0 0 10px #ef4444;
    animation: msPipDndGlow 2.5s infinite;
}

@keyframes msPipDndGlow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 8px #ef4444; }
    50% { transform: scale(1.18); box-shadow: 0 0 14px #f87171; }
}

/* Invisible / Offline Pip (Slate Gray) */
.messenger-launcher-pip.invisible,
.messenger-launcher-pip.offline {
    background: #475569;
    border-color: #071916;
    box-shadow: none;
    animation: none;
}

.messenger-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 20px;
    border: 2.5px solid var(--acnh-bg-dark);
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.6);
    animation: acnhPulse 1.8s infinite;
    z-index: 20 !important;
}

@keyframes acnhPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* =========================================================
   Main Messenger Dock Panel (NookPhone Island Theme)
   ========================================================= */
.messenger-dock-window {
    pointer-events: auto;
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 390px;
    height: 575px;
    max-height: calc(100vh - 120px);
    background: linear-gradient(180deg, var(--acnh-bg-dark) 0%, #051412 100%);
    border: 2px solid var(--acnh-border);
    border-radius: 26px;
    box-shadow: var(--acnh-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    animation: acnhPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes acnhPopIn {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Panel Header */
.messenger-panel-header {
    background: linear-gradient(135deg, rgba(14, 39, 34, 0.98) 0%, rgba(7, 25, 22, 0.98) 100%);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1.5px solid var(--acnh-border);
    position: relative;
}

.messenger-user-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.messenger-my-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.messenger-my-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(45, 212, 191, 0.1);
    border: 2px solid var(--acnh-teal);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}

.messenger-presence-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #475569;
    border: 2px solid var(--acnh-bg-card);
    transition: all 0.3s ease;
}

.messenger-presence-dot.online {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
    animation: pulse-online 2s infinite;
}

.messenger-presence-dot.idle {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.messenger-presence-dot.dnd {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
}

.messenger-presence-dot.invisible,
.messenger-presence-dot.offline {
    background: #475569;
    box-shadow: none;
}

.ms-presence-text-tag {
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.01em;
    transition: color 0.25s ease;
}
.ms-presence-text-tag.online { color: #10b981 !important; }
.ms-presence-text-tag.idle { color: #f59e0b !important; }
.ms-presence-text-tag.dnd { color: #ef4444 !important; }
.ms-presence-text-tag.invisible,
.ms-presence-text-tag.offline { color: #94a3b8 !important; }

/* Discord-Style Status Picker Dropdown */
.ms-presence-dropdown {
    position: absolute;
    top: 66px;
    left: 14px;
    z-index: 999999;
    background: rgba(8, 26, 23, 0.98);
    border: 1.5px solid var(--acnh-teal);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(45, 212, 191, 0.25);
    width: 250px;
    animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ms-presence-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ms-presence-option:hover {
    background: rgba(45, 212, 191, 0.15);
}

.ms-presence-option.active {
    background: rgba(45, 212, 191, 0.22);
    border-left: 3px solid var(--acnh-teal);
}

.ms-presence-opt-info {
    flex: 1;
    min-width: 0;
}

.ms-presence-opt-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ms-presence-opt-desc {
    font-size: 0.68rem;
    color: #94a3b8;
}

@keyframes pulse-online {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.messenger-user-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.messenger-my-name-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    line-height: 1 !important;
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
}

#genacnh-messenger-root .fa,
#genacnh-messenger-root .fas,
#genacnh-messenger-root .fab,
#genacnh-messenger-root .far {
    vertical-align: middle !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.messenger-name-text {
    font-size: 0.95rem !important;
    font-weight: 900 !important;
    color: #fff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
    letter-spacing: 0.2px !important;
    line-height: 1.2 !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

.messenger-passport-title {
    font-size: 0.72rem;
    color: var(--acnh-teal);
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* =========================================================
   ACNH Styled Badges (Passport Stamp Aesthetics)
   ========================================================= */
.messenger-badge-pill {
    font-size: 0.62rem !important;
    font-weight: 900 !important;
    height: 18px !important;
    padding: 0 6px !important;
    border-radius: 9px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.messenger-badge-pill.badge-icon-only {
    padding: 0 5px !important;
    min-width: 20px !important;
    width: auto !important;
    justify-content: center !important;
    cursor: default !important;
}

.messenger-badge-pill.badge-icon-only i {
    font-size: 0.62rem !important;
    margin: 0 !important;
}

.badge-staff {
    background: linear-gradient(135deg, #ef4444 0%, #3b82f6 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.45), 0 2px 10px rgba(59, 130, 246, 0.45) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) !important;
}

.badge-vip {
    background: linear-gradient(135deg, #fbbf24, #b45309);
    color: #042f2c;
    border: 1px solid #fef08a;
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.5);
}

.badge-elite {
    background: linear-gradient(135deg, #2dd4bf, #0e7490);
    color: #042f2c;
    border: 1px solid #99f6e4;
    box-shadow: 0 2px 10px rgba(45, 212, 191, 0.5);
}

.badge-islander {
    background: rgba(45, 212, 191, 0.12);
    color: #5eead4;
    border: 1px solid rgba(45, 212, 191, 0.25);
}

.messenger-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.messenger-btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--acnh-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.messenger-btn-icon:hover {
    background: var(--acnh-teal);
    color: #042f2c;
    transform: scale(1.08);
}

/* =========================================================
   ACNH Tabs Navigation Bar
   ========================================================= */
.messenger-tabs-nav {
    display: flex;
    background: rgba(14, 39, 34, 0.85);
    border-bottom: 1.5px solid var(--acnh-border);
    padding: 0 4px;
}

.ms-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 2px;
    color: #94a3b8;
    font-size: 0.80rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    font-family: inherit;
}

.ms-tab-btn:hover {
    color: var(--acnh-teal);
}

.ms-tab-btn.active {
    color: var(--acnh-teal);
    border-bottom-color: var(--acnh-teal);
}

.ms-tab-count {
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 12px;
}

/* Tab Contents */
.messenger-tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.messenger-tab-content.active {
    display: flex;
}

/* Search Bar */
.messenger-search-bar {
    padding: 10px 14px;
    position: relative;
    background: var(--acnh-bg-dark);
    border-bottom: 1px solid var(--acnh-border-subtle);
}

.messenger-search-bar i {
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--acnh-teal);
    font-size: 0.85rem;
}

.messenger-search-bar input {
    width: 100%;
    background: var(--acnh-bg-input);
    border: 1.5px solid var(--acnh-border);
    border-radius: 20px;
    padding: 8px 14px 8px 36px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.messenger-search-bar input:focus {
    border-color: var(--acnh-teal);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.25);
}

/* Scroll List */
.messenger-scroll-list {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 8px 10px;
}

.messenger-scroll-list::-webkit-scrollbar {
    width: 6px;
}

.messenger-scroll-list::-webkit-scrollbar-thumb {
    background: rgba(45, 212, 191, 0.2);
    border-radius: 10px;
}

/* Empty State */
.ms-empty-state {
    padding: 35px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.6;
}

.ms-empty-state i {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 12px;
    color: rgba(45, 212, 191, 0.3);
}

/* Resident / Conversation Cards */
.ms-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(14, 39, 34, 0.5);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 6px;
}

.ms-user-item:hover {
    background: var(--acnh-bg-card-hover);
    border-color: var(--acnh-border);
    transform: translateX(3px);
}

.ms-user-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.ms-avatar-container {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
}

.ms-avatar-container img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(45, 212, 191, 0.12);
    border: 1.5px solid var(--acnh-teal);
    display: block;
    overflow: hidden;
    font-size: 0;
    color: transparent;
}

.ms-item-details {
    min-width: 0;
    flex: 1;
}

.ms-item-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    min-width: 0;
    flex: 1;
}

.ms-item-name {
    font-size: 0.92rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 0 1 auto;
}

.ms-item-preview {
    font-size: 0.78rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-item-preview.unread {
    font-weight: 900;
    color: var(--acnh-teal);
}

.ms-item-preview.staff-gold {
    color: #fbbf24 !important;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.4), 0 1px 2px rgba(0, 0, 0, 0.8);
}

.ms-item-preview.staff-gold.unread {
    color: #fde68a !important;
    font-weight: 800;
    text-shadow: 0 0 14px rgba(251, 191, 36, 0.65), 0 1px 2px rgba(0, 0, 0, 0.8);
}

.ms-discord-toast-text.staff-gold {
    color: #fbbf24 !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.35);
}

.ms-user-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-left: 8px;
    position: relative;
}

.ms-conv-close-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.72rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
    line-height: 1;
}

.ms-user-item:hover .ms-conv-close-btn {
    display: inline-flex;
}

.ms-conv-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: scale(1.1);
}

.ms-item-time {
    font-size: 0.7rem;
    color: #64748b;
}

.ms-item-unread-pill {
    background: var(--acnh-teal);
    color: #042f2c;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 12px;
}

/* Section Header */
.ms-section-label {
    font-size: 0.72rem !important;
    font-weight: 900 !important;
    color: var(--acnh-teal) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    padding: 8px 6px 4px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    line-height: 1 !important;
    margin: 0 !important;
}

.ms-section-label i {
    font-size: 0.8rem !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
}

.ms-btn-small {
    background: rgba(45, 212, 191, 0.15);
    border: 1px solid var(--acnh-border);
    color: var(--acnh-teal);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.ms-btn-small:hover {
    background: var(--acnh-teal);
    color: #042f2c;
    transform: scale(1.05);
}

.ms-request-card {
    background: rgba(14, 39, 34, 0.5) !important;
    border: 1px solid var(--acnh-border-subtle) !important;
    border-radius: 14px !important;
    padding: 8px 12px !important;
    margin-bottom: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    min-height: 54px !important;
    box-sizing: border-box !important;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.ms-request-card:hover {
    background: var(--acnh-bg-card-hover) !important;
    border-color: var(--acnh-border) !important;
}

.ms-request-card.removing {
    opacity: 0 !important;
    transform: scale(0.92) translateX(15px) !important;
    margin-bottom: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.ms-empty-state-centered {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 14px 12px !important;
    color: #64748b !important;
    font-size: 0.78rem !important;
    background: rgba(14, 39, 34, 0.25) !important;
    border: 1px dashed rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    margin: 6px 0 !important;
    gap: 4px !important;
    line-height: 1.3 !important;
}

/* Discord Friends Hub Sub-Navigation */
.ms-discord-friends-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    padding: 6px 8px !important;
    border-bottom: 1.5px solid var(--acnh-border) !important;
    background: rgba(4, 20, 18, 0.4) !important;
    margin-bottom: 10px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.ms-friends-subtab {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 8px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1;
    white-space: nowrap;
    transition: all 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
    flex-shrink: 0;
}

.ms-friends-subtab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
}

.ms-friends-subtab.active {
    background: rgba(45, 212, 191, 0.2);
    color: var(--acnh-teal);
    font-weight: 800;
}

.ms-friends-subtab.add {
    background: #10b981;
    color: #042f2c;
    font-weight: 800;
    margin-left: auto;
}

.ms-friends-subtab.add:hover {
    background: #34d399;
    color: #022c22;
}

.ms-subtab-count-badge {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    height: 16px !important;
    min-width: 16px !important;
    padding: 0 5px !important;
    border-radius: 8px !important;
    display: inline-grid !important;
    place-items: center !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    margin-left: 3px !important;
}

.ms-friends-subtab.active .ms-subtab-count-badge {
    background: rgba(45, 212, 191, 0.25) !important;
    color: var(--acnh-teal) !important;
}

.ms-pending-pill {
    background: #ef4444 !important;
    color: #fff !important;
    font-size: 0.62rem !important;
    font-weight: 900 !important;
    height: 16px !important;
    min-width: 16px !important;
    padding: 0 5px !important;
    border-radius: 8px !important;
    display: inline-grid;
    place-items: center;
    line-height: 1 !important;
    box-sizing: border-box !important;
    margin-left: 3px !important;
}

.ms-pending-pill.hidden,
.ms-pending-pill[style*="display: none"] {
    display: none !important;
}

.ms-request-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

.ms-btn-accept {
    background: linear-gradient(135deg, #2dd4bf, #10b981) !important;
    border: none !important;
    color: #042f2c !important;
    font-weight: 900 !important;
    font-size: 0.74rem !important;
    height: 26px !important;
    padding: 0 12px !important;
    border-radius: 13px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    line-height: 26px !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    vertical-align: middle !important;
}

.ms-btn-accept:hover {
    transform: scale(1.05);
}

.ms-btn-decline {
    background: rgba(255, 255, 255, 0.08) !important;
    border: none !important;
    color: #94a3b8 !important;
    font-weight: 800 !important;
    font-size: 0.74rem !important;
    height: 26px !important;
    padding: 0 8px !important;
    border-radius: 13px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 26px !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    vertical-align: middle !important;
}

.ms-btn-decline:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #ef4444 !important;
}

.ms-btn-cancel-req {
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    color: #f87171 !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 10px !important;
    border-radius: 13px !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    line-height: 26px !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    vertical-align: middle !important;
    text-align: center !important;
}

.ms-btn-cancel-req:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: #ef4444 !important;
    color: #fff !important;
    transform: scale(1.04);
}

.ms-btn-cancel-req i {
    font-size: 0.68rem !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Channel Cards */
.ms-channel-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background: var(--acnh-bg-card);
    border: 1.5px solid var(--acnh-border);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.ms-channel-card:hover {
    background: var(--acnh-bg-card-hover);
    transform: translateY(-2px);
    border-color: var(--acnh-teal);
    box-shadow: 0 8px 25px rgba(45, 212, 191, 0.2);
}

.ms-channel-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.ms-channel-title {
    font-size: 0.96rem;
    font-weight: 900;
    color: #fff;
}

.ms-channel-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
}

.ms-plaza-dock-header {
    background: var(--acnh-bg-card);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1.5px solid var(--acnh-border);
}

.ms-btn-mod-delete {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.72rem;
    padding: 2px 5px;
    border-radius: 6px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.ms-btn-mod-delete:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.2);
}

/* =========================================================
   ACNH Floating Pop-Up Chat Tabs (Nook Dialogue Windows)
   ========================================================= */
.messenger-chat-tabs-dock {
    pointer-events: none;
    position: absolute;
    bottom: 0;
    right: 410px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.messenger-chat-tab-box {
    pointer-events: auto;
    width: 335px;
    height: 450px;
    background: linear-gradient(180deg, var(--acnh-bg-dark) 0%, #051412 100%);
    border: 2px solid var(--acnh-border);
    border-radius: 20px 20px 0 0;
    box-shadow: var(--acnh-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: acnhTabPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes acnhTabPop {
    from { opacity: 0; transform: translateY(30px) scale(0.85); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.messenger-chat-tab-box.minimized {
    height: 52px;
}

.messenger-chat-tab-box.minimized .ms-tab-chat-body,
.messenger-chat-tab-box.minimized .ms-tab-chat-footer {
    display: none;
}

/* Chat Tab Header */
.ms-tab-chat-header {
    background: linear-gradient(135deg, var(--acnh-bg-card) 0%, #071916 100%);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1.5px solid var(--acnh-border);
    cursor: pointer;
    user-select: none;
}

.ms-tab-chat-partner {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ms-tab-chat-partner img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--acnh-teal);
}

.ms-tab-chat-partner-name {
    font-size: 0.9rem;
    font-weight: 900;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ms-tab-chat-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Chat Tab Message Body */
.ms-tab-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #061513;
}

.ms-msg-row {
    display: flex;
    flex-direction: column;
    max-width: 82%;
}

.ms-msg-row.mine {
    align-self: flex-end;
    align-items: flex-end;
}

.ms-msg-row.theirs {
    align-self: flex-start;
    align-items: flex-start;
}

.ms-msg-bubble {
    padding: 9px 14px;
    border-radius: 18px;
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
}

/* Discord-Style Message Rows (Town Square & DMs) */
.ms-discord-msg-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 7px 12px;
    margin: 2px 0;
    border-radius: 8px;
    position: relative;
    transition: background 0.15s ease;
}

.ms-discord-msg-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.ms-discord-msg-row.mine {
    background: rgba(45, 212, 191, 0.04);
}

.ms-discord-msg-row.mine:hover {
    background: rgba(45, 212, 191, 0.08);
}

.ms-discord-msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    background: rgba(15, 42, 38, 0.8);
    border: 1.5px solid rgba(45, 212, 191, 0.3);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.ms-discord-msg-avatar:hover {
    transform: scale(1.06);
    border-color: var(--acnh-teal);
}

.ms-discord-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-discord-msg-body {
    flex: 1;
    min-width: 0;
}

.ms-discord-msg-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 3px;
    line-height: 1.2;
}

.ms-discord-author {
    font-size: 0.86rem;
    font-weight: 800;
    color: #f1f5f9;
    cursor: pointer;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

.ms-discord-author:hover {
    color: var(--acnh-teal);
    text-decoration: underline;
}

.ms-discord-author.staff {
    color: #c084fc;
}

.ms-discord-author.elite {
    color: #2dd4bf;
}

.ms-discord-author.vip {
    color: #fbbf24;
}

.ms-discord-island {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
}

.ms-discord-time {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 500;
    margin-left: 2px;
}

.ms-discord-msg-text {
    font-size: 0.86rem;
    color: #e2e8f0;
    line-height: 1.45;
    word-break: break-word;
}

/* GenACNH Employee Exclusive Gold Message Display */
.ms-discord-msg-text.staff-gold,
.ms-discord-msg-row.staff-msg .ms-discord-msg-text,
.ms-msg-bubble.staff-gold,
.ms-msg-row.staff-msg .ms-msg-bubble {
    color: #fbbf24 !important;
    font-weight: 600 !important;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.4), 0 1px 2px rgba(0, 0, 0, 0.8) !important;
    letter-spacing: 0.15px;
}

.ms-discord-msg-text.staff-gold a,
.ms-discord-msg-row.staff-msg .ms-discord-msg-text a {
    color: #fde68a !important;
    text-decoration: underline;
}

.ms-discord-msg-row.staff-msg {
    border-left: 2.5px solid rgba(251, 191, 36, 0.5) !important;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.06) 0%, transparent 70%) !important;
}

.ms-discord-msg-row.staff-msg:hover {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.12) 0%, rgba(255, 255, 255, 0.03) 100%) !important;
}

/* GenACNH Employee Exclusive Gold Typing Styles */
.ms-chat-input.staff-gold,
.ms-direct-input.staff-gold,
#ms-plaza-input.staff-gold,
#ms-direct-input-box.staff-gold,
.messenger-panel.is-employee .ms-chat-input,
.messenger-panel.is-employee .ms-direct-input {
    color: #fbbf24 !important;
    caret-color: #fbbf24 !important;
    font-weight: 600 !important;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.45) !important;
}

.ms-chat-input.staff-gold::placeholder,
.ms-direct-input.staff-gold::placeholder,
#ms-plaza-input.staff-gold::placeholder,
#ms-direct-input-box.staff-gold::placeholder,
.messenger-panel.is-employee .ms-chat-input::placeholder,
.messenger-panel.is-employee .ms-direct-input::placeholder {
    color: rgba(251, 191, 36, 0.55) !important;
    text-shadow: none !important;
    font-weight: 500 !important;
}

.ms-chat-input.staff-gold:focus,
.ms-direct-input.staff-gold:focus,
#ms-plaza-input.staff-gold:focus,
#ms-direct-input-box.staff-gold:focus,
.messenger-panel.is-employee .ms-chat-input:focus,
.messenger-panel.is-employee .ms-direct-input:focus {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.35) !important;
}

/* Discord-Style Floating Action Bar on Message Hover */
.ms-discord-msg-actions {
    position: absolute;
    top: 6px;
    right: 8px;
    display: flex;
    opacity: 0;
    align-items: center;
    gap: 4px;
    background: rgba(8, 26, 23, 0.96);
    border: 1px solid rgba(45, 212, 191, 0.45);
    border-radius: 8px;
    padding: 2px 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
    z-index: 50;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.ms-discord-msg-row:hover .ms-discord-msg-actions,
.ms-discord-msg-row:active .ms-discord-msg-actions,
.ms-discord-msg-row:focus-within .ms-discord-msg-actions {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.ms-discord-msg-action-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.76rem;
    transition: all 0.15s ease;
}

.ms-discord-msg-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: scale(1.1);
}

.ms-discord-msg-action-btn.delete {
    color: #f87171;
}

.ms-discord-msg-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ef4444;
    transform: scale(1.15);
}

.ms-discord-msg-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.ms-discord-msg-action-btn.report:hover {
    background: rgba(245, 158, 11, 0.25);
    color: #f59e0b;
}

/* Chat Tab Footer Input */
.ms-tab-chat-footer {
    padding: 10px 12px;
    background: var(--acnh-bg-card);
    border-top: 1.5px solid var(--acnh-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ms-chat-input {
    flex: 1;
    background: var(--acnh-bg-input);
    border: 1.5px solid var(--acnh-border);
    border-radius: 22px;
    padding: 9px 16px;
    color: #fff;
    font-size: 0.88rem;
    outline: none;
    font-family: inherit;
}

.ms-chat-input:focus {
    border-color: var(--acnh-teal);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}

.ms-btn-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2dd4bf, #10b981);
    border: none;
    color: #042f2c;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: transform 0.15s;
    flex-shrink: 0;
}

.ms-btn-send:hover {
    transform: scale(1.1);
}

/* =========================================================
   Mobile Phone & Tablet Specific Optimizations
   ========================================================= */

/* 📱 Mobile Phones & Devices (iPhone SE, Pro Max, Galaxy, Foldables - Width <= 600px) */
@media (max-width: 600px) {
    #genacnh-messenger-root {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
        right: 12px !important;
        z-index: 99999 !important;
    }

    #messenger-launcher-btn,
    .messenger-launcher-bubble {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.25rem !important;
    }

    #messenger-launcher-btn.is-open,
    .messenger-launcher-bubble.is-open {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .messenger-dock-window {
        position: fixed !important;
        bottom: var(--mobile-keyboard-height, 0px) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: calc(100dvh - 54px - var(--mobile-keyboard-height, 0px)) !important;
        max-height: calc(100dvh - 54px - var(--mobile-keyboard-height, 0px)) !important;
        padding-left: env(safe-area-inset-left, 0px) !important;
        padding-right: env(safe-area-inset-right, 0px) !important;
        border-radius: 24px 24px 0 0 !important;
        border: none !important;
        border-top: 2px solid var(--acnh-teal) !important;
        box-shadow: 0 -12px 45px rgba(0, 0, 0, 0.95) !important;
        margin: 0 !important;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        will-change: transform, height, bottom;
        transition: bottom 0.15s ease-out, height 0.15s ease-out;
    }

    /* When keyboard is active on mobile, hide the tabs row to maximize chat view */
    body.ms-keyboard-active .messenger-tabs-nav,
    html.ms-keyboard-active .messenger-tabs-nav {
        display: none !important;
    }

    body.ms-keyboard-active .messenger-panel-header,
    html.ms-keyboard-active .messenger-panel-header {
        padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px 12px !important;
    }

    #ms-chats-direct-view {
        height: 100% !important;
        min-height: 0 !important;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .messenger-panel-header {
        padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 10px 10px !important;
        gap: 6px !important;
    }

    .messenger-user-summary {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .messenger-header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
    }

    .messenger-btn-icon {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.78rem !important;
    }

    .ms-direct-back-btn {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.88rem !important;
        flex-shrink: 0 !important;
    }

    .messenger-my-name-row {
        gap: 4px !important;
    }

    .messenger-name-text {
        max-width: 105px !important;
        font-size: 0.80rem !important;
    }

    .messenger-tabs-nav {
        padding: 4px 6px !important;
        gap: 4px !important;
    }

    .ms-tab-btn {
        padding: 6px 4px !important;
        font-size: 0.72rem !important;
    }

    .ms-direct-messages-body,
    .ms-tab-chat-body {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: auto !important;
        overflow-anchor: auto !important;
        padding: 8px 6px !important;
        gap: 6px !important;
    }

    .ms-discord-msg-row {
        padding: 6px 6px !important;
        gap: 8px !important;
        border-radius: 6px !important;
    }

    .ms-discord-msg-avatar {
        width: 32px !important;
        height: 32px !important;
    }

    .ms-discord-msg-text {
        font-size: 0.82rem !important;
    }

    .ms-direct-footer {
        padding: 8px 10px !important;
        padding-bottom: var(--ms-footer-pb, calc(8px + env(safe-area-inset-bottom, 0px))) !important;
        gap: 6px !important;
        background: rgba(4, 20, 18, 0.98) !important;
        flex-shrink: 0 !important;
        z-index: 10 !important;
    }

    .ms-tab-chat-footer {
        padding: 8px 10px !important;
        padding-bottom: var(--ms-footer-pb, calc(8px + env(safe-area-inset-bottom, 0px))) !important;
        gap: 6px !important;
        background: rgba(4, 20, 18, 0.98) !important;
        flex-shrink: 0 !important;
        z-index: 10 !important;
    }

    .ms-direct-input, 
    .ms-chat-input,
    .messenger-search-bar input {
        font-size: 16px !important; /* Prevents auto-zoom on mobile Safari */
        height: 38px !important;
    }

    .ms-direct-send-btn,
    .ms-direct-attach-btn,
    .ms-btn-send {
        width: 38px !important;
        height: 38px !important;
        font-size: 0.88rem !important;
        flex-shrink: 0 !important;
    }

    /* All Passport, Report & Settings Modal Popups on Mobile */
    .ms-passport-card-popup,
    .ms-resident-card-popup,
    .ms-report-card-popup {
        width: calc(100vw - 20px) !important;
        max-width: 350px !important;
        max-height: calc(100dvh - 36px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin: auto !important;
        border-radius: 20px !important;
    }

    .ms-passport-page {
        padding: 12px 10px !important;
        gap: 10px !important;
    }

    .ms-settings-section {
        padding: 10px !important;
        gap: 4px !important;
    }

    .ms-settings-option-card {
        padding: 8px 8px !important;
        gap: 8px !important;
    }

    .ms-option-title {
        font-size: 0.76rem !important;
    }

    .ms-option-desc {
        font-size: 0.65rem !important;
    }

    .ms-discord-friends-nav {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding-bottom: 4px !important;
    }

    .ms-discord-friends-nav::-webkit-scrollbar {
        display: none;
    }

    .ms-msg-attachment-img {
        max-width: 170px !important;
        max-height: 140px !important;
    }
}

/* 📱 Ultra-Compact Mobile Screens (Galaxy Z Fold Cover Screen, iPhone SE / mini <= 360px) */
@media (max-width: 360px) {
    .messenger-name-text {
        max-width: 78px !important;
        font-size: 0.74rem !important;
    }

    .messenger-header-actions {
        gap: 2px !important;
    }

    .messenger-btn-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.72rem !important;
    }

    .ms-tab-btn {
        padding: 5px 2px !important;
        font-size: 0.68rem !important;
    }

    .ms-direct-back-btn {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.80rem !important;
    }
}

/* 📱 Dual-Screen / Spanned Foldables (Surface Duo, Galaxy Z Fold spanned) */
@media (horizontal-viewport-segments: 2), (screen-spanning: single-fold-vertical) {
    .messenger-dock-window {
        left: auto !important;
        right: 16px !important;
        width: 380px !important;
        max-width: calc(50vw - 20px) !important;
        border-radius: 22px !important;
        border: 2px solid var(--acnh-teal) !important;
    }
}

/* 📱 Touch Device (Mobile/Tablet) Actions & Tap Target Optimization */
@media (hover: none) and (pointer: coarse) {
    .messenger-btn-icon,
    .ms-direct-back-btn,
    .ms-direct-send-btn,
    .ms-direct-attach-btn,
    .ms-btn-send {
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .ms-discord-msg-actions {
        opacity: 0.75 !important;
        pointer-events: auto !important;
        background: rgba(8, 26, 23, 0.88) !important;
        padding: 1px 3px !important;
    }

    .ms-discord-msg-row:active .ms-discord-msg-actions,
    .ms-discord-msg-row:focus .ms-discord-msg-actions {
        opacity: 1 !important;
    }

    .ms-discord-msg-action-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.8rem !important;
    }
}

/* 📱 Tablets & Small Laptops (iPad Mini, iPad Air, Surface - 601px to 1024px) */
@media (min-width: 601px) and (max-width: 1024px) {
    #genacnh-messenger-root {
        bottom: 82px !important;
        right: 18px !important;
        z-index: 99999 !important;
    }

    .messenger-dock-window {
        position: fixed !important;
        bottom: 82px !important;
        right: 18px !important;
        left: auto !important;
        width: 380px !important;
        height: 600px !important;
        max-height: 78vh !important;
        border-radius: 22px !important;
        border: 2px solid var(--acnh-teal) !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(45, 212, 191, 0.2) !important;
    }

    .ms-resident-card-popup {
        width: 340px !important;
    }
}

.ms-author-clickable {
    cursor: pointer;
    transition: color 0.15s, text-decoration 0.15s;
}

.ms-author-clickable:hover {
    color: var(--acnh-teal) !important;
    text-decoration: underline;
}

/* =========================================================
   Resident Passport Profile Modal / Card
   ========================================================= */
.ms-modal-overlay {
    pointer-events: auto;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100005;
    animation: fadeIn 0.2s ease-out;
    overscroll-behavior: contain;
}

.ms-resident-card-popup {
    width: 320px;
    background: linear-gradient(180deg, #0e2722 0%, #061412 100%);
    border: 2px solid var(--acnh-teal);
    border-radius: 24px;
    padding: 24px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.9), 0 0 25px rgba(45, 212, 191, 0.25);
    position: relative;
    animation: acnhPopIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =========================================================
   ACNH NookPhone Island Passport Modal Styles (Enhanced v3)
   ========================================================= */
.ms-passport-card-popup {
    width: 440px;
    max-width: 95vw;
    background: #041411;
    border: 2px solid var(--acnh-teal);
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.95), 0 0 35px rgba(45, 212, 191, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: acnhPopIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ms-passport-header {
    background: linear-gradient(135deg, #0e352e 0%, #061e19 100%);
    padding: 12px 18px;
    border-bottom: 2px dashed rgba(45, 212, 191, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ms-passport-header-emblem {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: var(--acnh-teal);
    text-transform: uppercase;
}

.ms-passport-header-emblem i {
    font-size: 0.95rem;
}

.ms-passport-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ms-passport-serial-code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.68rem;
    font-weight: 800;
    color: #5eead4;
    background: rgba(45, 212, 191, 0.08);
    border: 1px solid rgba(45, 212, 191, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.ms-modal-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(14, 45, 39, 0.85);
    border: 1.5px solid rgba(45, 212, 191, 0.4);
    color: #99f6e4;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    padding: 0;
    margin: 0;
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.ms-modal-close-btn:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #fca5a5;
    color: #ffffff;
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.6), 0 3px 8px rgba(0, 0, 0, 0.5);
}

.ms-modal-close-btn:active {
    transform: scale(0.92) rotate(90deg);
}

.ms-modal-close-btn i {
    pointer-events: none;
    line-height: 1;
}

.ms-passport-page {
    padding: 16px 18px 14px;
    background: radial-gradient(circle at top right, rgba(45, 212, 191, 0.06) 0%, transparent 70%);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: calc(85vh - 120px);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.ms-passport-top-row {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.ms-passport-photo-section {
    flex-shrink: 0;
}

.ms-passport-photo-frame {
    position: relative;
    width: 66px;
    height: 66px;
    border-radius: 20px;
    background: #09211c;
    border: 2.5px solid var(--acnh-teal);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(45, 212, 191, 0.25);
}

.ms-passport-photo-frame img {
    width: 100%;
    height: 100%;
    border-radius: 17px;
    object-fit: cover;
    display: block;
    background: #09211c;
}

.ms-passport-identity-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ms-passport-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ms-passport-name {
    font-size: 1.22rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.2px;
    line-height: 1.2;
}

.ms-passport-handle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ms-passport-handle {
    font-size: 0.74rem;
    font-weight: 700;
    color: #94a3b8;
}

.ms-passport-presence-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
}

.ms-passport-presence-label.idle {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

.ms-passport-presence-label.dnd {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
}

.ms-passport-presence-label.offline,
.ms-passport-presence-label.invisible {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.25);
}

.ms-passport-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
}
.ms-passport-status-dot.idle { background: #fbbf24; }
.ms-passport-status-dot.dnd { background: #f87171; }
.ms-passport-status-dot.offline,
.ms-passport-status-dot.invisible { background: #94a3b8; }

.ms-passport-stamp-seal {
    position: absolute;
    right: 0;
    top: 0;
    opacity: 0.6;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.58rem;
    font-weight: 950;
    color: var(--acnh-teal);
    letter-spacing: 0.6px;
    transform: rotate(-6deg);
    border: 1.5px dashed var(--acnh-teal);
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(45, 212, 191, 0.05);
}

/* 4-Tile Grid */
.ms-passport-meta-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ms-passport-tile {
    background: rgba(4, 20, 17, 0.75);
    border: 1.5px solid rgba(45, 212, 191, 0.2);
    border-radius: 14px;
    padding: 9px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    transition: all 0.2s ease;
}

.ms-passport-tile:hover {
    border-color: rgba(45, 212, 191, 0.38);
    background: rgba(5, 26, 22, 0.88);
}

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

.ms-passport-label {
    font-size: 0.62rem;
    font-weight: 900;
    color: #5eead4;
    letter-spacing: 0.75px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ms-passport-edit-badge {
    font-size: 0.58rem;
    font-weight: 800;
    color: #34d399;
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.3);
    padding: 1px 5px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.ms-passport-val-container {
    min-height: 28px;
    display: flex;
    align-items: center;
}

.ms-passport-value {
    font-size: 0.86rem;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ms-passport-arrival-text,
.ms-passport-title-text {
    color: #e2e8f0;
    font-size: 0.82rem;
}

/* Fruit Pills */
.ms-passport-fruit-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.fruit-apple  { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.fruit-cherry { border-color: rgba(244, 63, 94, 0.4); background: rgba(244, 63, 94, 0.12); color: #fda4af; }
.fruit-orange { border-color: rgba(249, 115, 22, 0.4); background: rgba(249, 115, 22, 0.12); color: #fdba74; }
.fruit-peach  { border-color: rgba(244, 114, 182, 0.4); background: rgba(244, 114, 182, 0.12); color: #f9a8d4; }
.fruit-pear   { border-color: rgba(132, 204, 22, 0.4); background: rgba(132, 204, 22, 0.12); color: #bef264; }

/* Edit Controls inside Tiles */
.ms-passport-edit-field-wrap {
    width: 100%;
    margin-top: 2px;
}

.ms-passport-edit-input,
.ms-passport-edit-select {
    width: 100%;
    background: #02120f;
    border: 1.5px solid var(--acnh-teal);
    border-radius: 9px;
    color: #ffffff;
    padding: 5px 9px;
    font-size: 0.82rem;
    font-weight: 700;
    outline: none;
    font-family: inherit;
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.2);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.ms-passport-edit-input:focus,
.ms-passport-edit-select:focus {
    border-color: #5eead4;
    box-shadow: 0 0 15px rgba(45, 212, 191, 0.4);
}

.ms-passport-edit-select option {
    background: #07211b;
    color: #ffffff;
}

/* Island Motto Section */
.ms-passport-motto-section {
    background: rgba(4, 20, 17, 0.85);
    border: 1.5px solid rgba(45, 212, 191, 0.22);
    border-radius: 16px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.ms-passport-counter {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 700;
}

.ms-passport-motto-bubble {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.08) 0%, rgba(13, 148, 136, 0.04) 100%);
    border-left: 3px solid var(--acnh-teal);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.84rem;
    font-style: italic;
    color: #e2e8f0;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
}

.ms-motto-quote-mark {
    font-size: 1.05rem;
    color: var(--acnh-teal);
    font-weight: 900;
    line-height: 0;
    vertical-align: -2px;
    margin: 0 2px;
}

/* Passport Actions */
.ms-passport-actions {
    padding: 12px 18px 16px;
    background: rgba(3, 14, 12, 0.85);
    border-top: 1px solid rgba(45, 212, 191, 0.15);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ms-passport-action-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.ms-btn-passport-primary {
    width: 100%;
    padding: 10px 14px;
    border-radius: 16px;
    font-weight: 900;
    font-size: 0.88rem;
    background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%);
    color: #032b27;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(45, 212, 191, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.ms-btn-passport-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(45, 212, 191, 0.5);
}

.ms-btn-passport-edit {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    color: #012420;
}

.ms-btn-passport-save {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #012420;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.ms-btn-passport-save:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.ms-passport-action-subrow {
    display: flex;
    gap: 8px;
}

.ms-btn-passport-sub {
    flex: 1;
    padding: 8px 12px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
    font-family: inherit;
}

.ms-btn-passport-sub.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.ms-btn-passport-sub.secondary:hover {
    background: rgba(45, 212, 191, 0.15);
    border-color: var(--acnh-teal);
    color: var(--acnh-teal);
}

.ms-btn-passport-sub.secondary.active {
    background: rgba(45, 212, 191, 0.15);
    border-color: rgba(45, 212, 191, 0.4);
    color: #5eead4;
}

.ms-btn-passport-sub.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #032b27;
    border: none;
    font-weight: 900;
}

.ms-btn-passport-sub.warning {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.ms-btn-passport-sub.danger {
    flex: 0 0 auto;
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 8px 14px;
}

.ms-btn-passport-sub.danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #fff;
}

.ms-passport-edit-status-msg {
    font-size: 0.75rem;
    font-weight: 800;
    text-align: center;
    margin-top: 4px;
    min-height: 16px;
    color: #34d399;
}
.ms-passport-edit-status-msg.error {
    color: #f87171;
}

.ms-presence-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 0;
}

.ms-presence-opt-passport {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ms-presence-opt-passport:hover {
    background: rgba(45, 212, 191, 0.12);
}

.ms-presence-passport-icon {
    font-size: 1.05rem;
    color: #2dd4bf;
    flex-shrink: 0;
}

.ms-btn-modal-action:hover {
    transform: scale(1.04);
}

/* Touch-friendly delete button for both Mobile & Desktop */
.ms-btn-mod-delete {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
    border-radius: 6px;
    cursor: pointer;
    padding: 3px 6px;
    font-size: 0.65rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: 22px;
    min-height: 22px;
    -webkit-tap-highlight-color: transparent;
    vertical-align: middle;
}

.ms-btn-mod-delete:hover,
.ms-btn-mod-delete:active {
    background: #ef4444;
    color: #fff;
    transform: scale(1.15);
    border-color: #ef4444;
}

/* Recent Searches & Suggested Sections */
.ms-search-section-header {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--acnh-teal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 10px 4px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Active Islander Highlight */
.ms-user-item.ms-item-active-now {
    border-left: 3px solid #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.ms-user-item.ms-item-active-now:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    border-left: 3px solid #10b981;
}

.ms-search-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.ms-search-tag {
    background: rgba(45, 212, 191, 0.12);
    border: 1px solid rgba(45, 212, 191, 0.25);
    color: #5eead4;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.ms-search-tag:hover {
    background: rgba(45, 212, 191, 0.25);
    border-color: var(--acnh-teal);
    color: #fff;
    transform: translateY(-1px);
}

.ms-search-tag-remove {
    color: #94a3b8;
    font-size: 0.65rem;
    margin-left: 2px;
    cursor: pointer;
}

.ms-search-tag-remove:hover {
    color: #f87171;
}

/* Direct Report Flag Button */
.ms-btn-report-direct {
    background: transparent;
    border: none;
    color: #64748b;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.65rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: 18px;
    min-height: 18px;
    vertical-align: middle;
}

.ms-btn-report-direct:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
    transform: scale(1.15);
}

/* =========================================================
   Discord-Style Pop-up Notification Toasts
   ========================================================= */
#ms-discord-toast-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 9999999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
    max-width: 360px;
    width: calc(100% - 40px);
}

.ms-discord-toast {
    background: rgba(8, 26, 23, 0.96);
    border: 1.5px solid var(--acnh-teal);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 18px;
    padding: 12px 14px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.7), 0 0 20px rgba(45, 212, 191, 0.25);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    pointer-events: auto;
    animation: discordSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.ms-discord-toast:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: #5eead4;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(45, 212, 191, 0.4);
}

.ms-discord-toast.hiding {
    animation: discordSlideOut 0.3s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

@keyframes discordSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes discordSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(120px) scale(0.85);
    }
}

.ms-discord-toast-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.ms-discord-toast-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--acnh-teal);
    background: rgba(45, 212, 191, 0.1);
    display: block;
    overflow: hidden;
    font-size: 0;
}

.ms-discord-toast-content {
    flex: 1;
    min-width: 0;
}

.ms-discord-toast-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.ms-discord-toast-name {
    font-size: 0.88rem;
    font-weight: 900;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.ms-discord-toast-text {
    font-size: 0.78rem;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.ms-discord-toast-close {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
    flex-shrink: 0;
}

.ms-discord-toast-close:hover {
    color: #ef4444;
}

.ms-discord-toast-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

/* =========================================================
   Unified In-Panel Discord DM Chat
   ========================================================= */
.ms-direct-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(4, 20, 18, 0.7);
    border-bottom: 1.5px solid var(--acnh-border);
    flex-shrink: 0;
}

.ms-direct-back-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--acnh-teal);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.ms-direct-back-btn:hover {
    background: var(--acnh-teal);
    color: #042f2c;
    transform: scale(1.08);
}

.ms-direct-target-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ms-direct-target-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.ms-direct-target-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.ms-direct-target-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ms-direct-target-name-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    line-height: 1.2 !important;
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
}

.ms-direct-target-name {
    font-size: 0.9rem !important;
    font-weight: 900 !important;
    color: #fff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
}

.ms-direct-target-subtitle {
    font-size: 0.68rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-direct-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ms-direct-action-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    transition: all 0.15s ease;
}

.ms-direct-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.ms-direct-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.ms-direct-messages-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: auto;
    overflow-anchor: auto;
}

/* Facebook Messenger Animated Typing Indicator (In-Stream Bubble) */
.ms-typing-indicator-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 6px 14px 8px;
    animation: msFadeIn 0.2s ease-out;
    margin-top: 4px;
    z-index: 2;
    flex-shrink: 0;
}

.ms-typing-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid rgba(45, 212, 191, 0.5);
    background: #0f172a;
}

.ms-typing-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ms-typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 16px;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(45, 212, 191, 0.35);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ms-typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2dd4bf;
    display: inline-block;
    animation: msTypingBounce 1.4s infinite ease-in-out both;
}

.ms-typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.ms-typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.ms-typing-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes msTypingBounce {
    0%, 80%, 100% {
        transform: scale(0.65);
        opacity: 0.35;
    }
    40% {
        transform: scale(1.18);
        opacity: 1;
    }
}

/* Typing Bar Above Input Box */
.ms-direct-typing-bar {
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2dd4bf;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(4, 20, 18, 0.65);
    border-top: 1px solid rgba(45, 212, 191, 0.2);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.ms-typing-dots-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.ms-typing-dots-inline span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2dd4bf;
    display: inline-block;
    animation: msTypingBounce 1.4s infinite ease-in-out both;
}

.ms-typing-dots-inline span:nth-child(1) { animation-delay: -0.32s; }
.ms-typing-dots-inline span:nth-child(2) { animation-delay: -0.16s; }
.ms-typing-dots-inline span:nth-child(3) { animation-delay: 0s; }

/* Conversation List Item Typing Status Preview */
.ms-conv-typing-status {
    color: #2dd4bf !important;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-style: italic;
}

.ms-typing-dots-mini {
    display: inline-flex;
    align-items: center;
    gap: 2.5px;
}

.ms-typing-dots-mini span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #2dd4bf;
    display: inline-block;
    animation: msTypingBounce 1.4s infinite ease-in-out both;
}

.ms-typing-dots-mini span:nth-child(1) { animation-delay: -0.32s; }
.ms-typing-dots-mini span:nth-child(2) { animation-delay: -0.16s; }
.ms-typing-dots-mini span:nth-child(3) { animation-delay: 0s; }

.ms-direct-attachment-tray {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(4, 20, 18, 0.9);
    border-top: 1px solid var(--acnh-border);
    position: relative;
    flex-shrink: 0;
}

.ms-direct-attachment-tray img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1.5px solid var(--acnh-teal);
}

.ms-direct-preview-cancel {
    background: #ef4444;
    border: none;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    transition: transform 0.15s ease;
}

.ms-direct-preview-cancel:hover {
    transform: scale(1.15);
}

.ms-direct-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(4, 20, 18, 0.85);
    border-top: 1.5px solid var(--acnh-border);
    flex-shrink: 0;
}

.ms-direct-attach-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--acnh-teal);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.ms-direct-attach-btn:hover {
    background: var(--acnh-teal);
    color: #042f2c;
    transform: scale(1.08);
}

.ms-direct-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid var(--acnh-border);
    color: #fff;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.82rem;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
}

.ms-direct-input:focus {
    border-color: var(--acnh-teal);
    background: rgba(255, 255, 255, 0.09);
}

.ms-direct-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2dd4bf, #10b981);
    border: none;
    color: #042f2c;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.ms-direct-send-btn:hover {
    transform: scale(1.08);
}

/* Clickable image attachment thumbnail */
.ms-msg-attachment-img {
    margin-top: 6px;
    max-width: 220px;
    max-height: 180px;
    border-radius: 12px;
    border: 1.5px solid rgba(45, 212, 191, 0.3);
    cursor: pointer;
    object-fit: cover;
    display: block;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.ms-msg-attachment-img:hover {
    transform: scale(1.03);
    border-color: var(--acnh-teal);
}

/* =========================================================
   Messenger Settings & Privacy Modal Styles
   ========================================================= */
.ms-settings-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(4, 20, 17, 0.6);
    border: 1px solid rgba(45, 212, 191, 0.15);
    border-radius: 16px;
    padding: 12px 14px;
}

.ms-settings-title {
    font-size: 0.85rem;
    font-weight: 900;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ms-settings-desc {
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.35;
    margin-bottom: 4px;
}

.ms-settings-options-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.ms-settings-option-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.ms-settings-option-card:hover {
    background: rgba(45, 212, 191, 0.08);
    border-color: rgba(45, 212, 191, 0.3);
    transform: translateY(-1px);
}

.ms-settings-option-card:has(input[type="radio"]:checked),
.ms-settings-option-card.selected {
    background: rgba(45, 212, 191, 0.12) !important;
    border-color: rgba(45, 212, 191, 0.6) !important;
    box-shadow: 0 0 14px rgba(45, 212, 191, 0.25) !important;
}

.ms-settings-option-card:has(input[type="radio"]:checked) .ms-option-title,
.ms-settings-option-card.selected .ms-option-title {
    color: var(--acnh-teal) !important;
}

.ms-settings-option-card input[type="radio"] {
    accent-color: var(--acnh-teal);
    margin-top: 3px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.ms-option-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.ms-option-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s ease;
}

.ms-option-desc {
    font-size: 0.7rem;
    color: #94a3b8;
    line-height: 1.35;
}

.ms-settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 800;
    color: #f1f5f9;
    margin-top: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 12px;
    transition: all 0.2s ease;
    user-select: none;
}

.ms-settings-toggle-row:hover {
    background: rgba(45, 212, 191, 0.08);
    border-color: rgba(45, 212, 191, 0.3);
}

.ms-settings-toggle-row input[type="checkbox"] {
    accent-color: var(--acnh-teal);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* =========================================================
   Discord-Style Clean Image Lightbox Modal Styles
   ========================================================= */
.ms-discord-lightbox {
    z-index: 9999999 !important;
    background: rgba(0, 0, 0, 0.88) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(12px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px));
    touch-action: manipulation;
    animation: discordFadeIn 0.15s ease-out;
}

@keyframes discordFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.ms-discord-lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 94vw;
    max-height: 92dvh;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

#ms-lightbox-img {
    max-width: 92vw;
    max-height: 78dvh;
    border-radius: 8px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.95);
    object-fit: contain;
    cursor: pointer;
    border: none;
    background: transparent;
}

.ms-discord-lightbox-footer {
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.ms-discord-lightbox-link {
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ms-discord-lightbox-link:hover,
.ms-discord-lightbox-link:active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    text-decoration: none;
}

/* Discord-Style "Jump to Present" Floating Pill */
#ms-chats-direct-view,
#ms-tab-channels {
    position: relative;
}

.ms-jump-bottom-btn {
    position: absolute;
    bottom: 66px;
    right: 14px;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.95), rgba(15, 118, 110, 0.95));
    color: #ffffff;
    border: 1px solid rgba(45, 212, 191, 0.45);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.74rem;
    font-weight: 800;
    display: none;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    z-index: 100;
    transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ms-jump-bottom-btn:hover {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.45);
}

.ms-jump-bottom-btn:active {
    transform: translateY(0);
}

.ms-jump-unread-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 2px;
    display: inline-block;
}

/* =========================================================
   Guest Island Messenger & Community Hub Styles
   ========================================================= */
.messenger-panel-header.guest-header {
    background: linear-gradient(135deg, rgba(8, 28, 24, 0.98) 0%, rgba(6, 21, 18, 0.98) 100%);
    border-bottom: 1.5px solid rgba(45, 212, 191, 0.35);
}

.ms-guest-hub-view {
    padding: 18px 16px;
    height: calc(100% - 66px);
    overflow-y: auto;
    background: #061513;
    display: flex;
    flex-direction: column;
}

.ms-guest-hub-card {
    background: linear-gradient(160deg, rgba(14, 39, 34, 0.95) 0%, rgba(8, 26, 23, 0.98) 100%);
    border: 1.5px solid rgba(45, 212, 191, 0.35);
    border-radius: 24px;
    padding: 24px 18px;
    text-align: center;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
}

.ms-guest-hub-badge {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #0084ff 0%, #00b4d8 50%, #2dd4bf 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(0, 132, 255, 0.45);
}

.ms-guest-hub-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 8px;
    font-family: 'Varela Round', sans-serif;
}

.ms-guest-hub-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.45;
    margin-bottom: 18px;
}

.ms-guest-hub-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.ms-guest-hub-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(8, 22, 19, 0.7);
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: 14px;
    padding: 10px 12px;
}

.ms-gh-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(45, 212, 191, 0.15);
    color: var(--acnh-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.ms-gh-info strong {
    display: block;
    font-size: 0.82rem;
    color: #f1f5f9;
    margin-bottom: 2px;
}

.ms-gh-info span {
    display: block;
    font-size: 0.73rem;
    color: #94a3b8;
    line-height: 1.35;
}

.ms-guest-auth-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.ms-btn-discord-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #5865F2;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 12px 18px;
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.45);
}

.ms-btn-discord-hero:hover {
    background: #4752c4;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 101, 242, 0.65);
    text-decoration: none;
}

.ms-btn-google-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 11px 18px;
    border-radius: 14px;
    text-decoration: none;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.ms-btn-google-hero:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.38);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.12);
    text-decoration: none;
}

.ms-guest-hub-note {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 10px;
}

/* =========================================================
   Ultra-Sleek Island Trust & Safety Report System Styles
   ========================================================= */
.ms-report-card-popup {
    width: 380px;
    max-width: 95vw;
    background: linear-gradient(180deg, #10211d 0%, #071513 100%);
    border: 1.5px solid rgba(239, 68, 68, 0.45);
    border-radius: 24px;
    box-shadow: 0 22px 65px rgba(0, 0, 0, 0.95), 0 0 35px rgba(239, 68, 68, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: acnhPopIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ms-report-header {
    background: linear-gradient(135deg, rgba(65, 18, 18, 0.95) 0%, rgba(26, 8, 8, 0.98) 100%);
    padding: 13px 18px;
    border-bottom: 2px dashed rgba(239, 68, 68, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ms-report-header-emblem {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: #fca5a5;
    text-transform: uppercase;
}

.ms-report-header-emblem i {
    font-size: 0.95rem;
    color: #f87171;
}

.ms-report-beacon-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
    animation: pulse-online 1.5s infinite;
}

.ms-report-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ms-report-confidential-tag {
    font-size: 0.62rem;
    font-weight: 800;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 2px 7px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ms-report-page {
    padding: 15px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 72vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(239, 68, 68, 0.3) transparent;
}

.ms-report-target-card {
    background: rgba(239, 68, 68, 0.07);
    border: 1.5px solid rgba(239, 68, 68, 0.25);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.ms-report-target-avatar-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.ms-report-target-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(239, 68, 68, 0.6);
    background: rgba(0, 0, 0, 0.3);
}

.ms-report-target-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 0.52rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #071513;
}

.ms-report-target-info {
    min-width: 0;
    flex: 1;
}

.ms-report-target-name {
    font-size: 0.92rem;
    font-weight: 900;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.ms-report-target-meta {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.ms-report-context-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 800;
    color: #fca5a5;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 3px 8px;
    border-radius: 8px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ms-report-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.ms-report-section-label {
    font-size: 0.68rem;
    font-weight: 900;
    color: #5eead4;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ms-report-char-count {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 700;
}

.ms-report-category-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ms-report-cat-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    border-radius: 12px;
    background: rgba(14, 39, 34, 0.55);
    border: 1.5px solid rgba(45, 212, 191, 0.16);
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.ms-report-cat-card:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

.ms-report-cat-card.selected {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, rgba(185, 28, 28, 0.1) 100%);
    border-color: #ef4444;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.28);
}

.ms-report-cat-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.ms-report-cat-icon.toxicity { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.ms-report-cat-icon.scam { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.ms-report-cat-icon.spam { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.35); }
.ms-report-cat-icon.other { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }

.ms-report-cat-body {
    min-width: 0;
    flex: 1;
}

.ms-report-cat-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.ms-report-cat-desc {
    font-size: 0.67rem;
    color: #94a3b8;
    line-height: 1.2;
    margin-top: 1px;
}

.ms-report-cat-radio {
    margin-left: auto;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    color: transparent;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.ms-report-cat-card.selected .ms-report-cat-radio {
    border-color: #ef4444;
    background: #ef4444;
    color: #fff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.ms-report-textarea-wrap textarea {
    width: 100%;
    background: rgba(5, 16, 14, 0.85);
    border: 1.5px solid rgba(45, 212, 191, 0.25);
    border-radius: 12px;
    padding: 9px 11px;
    color: #fff;
    font-size: 0.78rem;
    outline: none;
    font-family: inherit;
    resize: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
    line-height: 1.35;
}

.ms-report-textarea-wrap textarea:focus {
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
    background: rgba(7, 20, 18, 0.95);
}

.ms-report-textarea-wrap textarea::placeholder {
    color: #64748b;
}

.ms-report-privacy-pill {
    background: rgba(16, 185, 129, 0.08);
    border: 1px dashed rgba(52, 211, 153, 0.3);
    border-radius: 11px;
    padding: 7px 11px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.68rem;
    color: #94a3b8;
    line-height: 1.35;
}

.ms-report-privacy-pill i {
    color: #34d399;
    font-size: 0.82rem;
    margin-top: 1px;
    flex-shrink: 0;
}

.ms-report-footer {
    padding: 11px 18px 15px;
    background: rgba(5, 16, 14, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.ms-btn-report-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ms-btn-report-cancel:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.ms-btn-report-submit {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.45);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.ms-btn-report-submit:hover:not(:disabled) {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 22px rgba(239, 68, 68, 0.6);
    filter: brightness(1.08);
}

.ms-btn-report-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.ms-report-success-screen {
    padding: 36px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    animation: acnhPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ms-report-success-shield {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.15) 100%);
    border: 2px solid #10b981;
    color: #34d399;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.4);
    margin-bottom: 4px;
}

.ms-report-success-title {
    font-size: 1.05rem;
    font-weight: 950;
    color: #fff;
    margin: 0;
}

.ms-report-success-desc {
    font-size: 0.76rem;
    color: #94a3b8;
    line-height: 1.4;
    max-width: 290px;
    margin: 0;
}

.ms-report-success-badge {
    margin-top: 4px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.35);
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}



