/* =====================================================
   PingMe Design System — Stable Theme-Aware UI
   Light/Dark Mode + Fixed App Shell
   ===================================================== */

:root {
    --pm-font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --pm-font-mono: 'Fira Code', 'Cascadia Code', monospace;
    --pm-blue-50: #EFF6FF;
    --pm-blue-100: #DBEAFE;
    --pm-blue-200: #BFDBFE;
    --pm-blue-300: #93C5FD;
    --pm-blue-400: #60A5FA;
    --pm-blue-500: #3B82F6;
    --pm-blue-600: #2563EB;
    --pm-blue-700: #1D4ED8;
    --pm-blue-800: #1E40AF;
    --pm-blue-900: #1E3A8A;
    --pm-navy: #0F172A;
    --pm-sky: #38BDF8;
    --pm-radius-sm: 6px;
    --pm-radius-md: 12px;
    --pm-radius-lg: 20px;
    --pm-radius-xl: 28px;
    --pm-shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --pm-shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.06);
    --pm-shadow-lg: 0 16px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.08);
    --pm-shadow-blue: 0 4px 20px rgba(29, 78, 216, .25);
    --pm-trans: all .18s cubic-bezier(.4,0,.2,1);
    --pm-topbar-height: 64px;
    --pm-sidebar-expanded: 264px;
    --pm-sidebar-collapsed: 72px;
}

/* =====================================================
   Base
   ===================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body,
#app {
    margin: 0;
    padding: 0;
    min-height: 100%;
    height: 100%;
    font-family: var(--pm-font);
    background: var(--mud-palette-background) !important;
    color: var(--mud-palette-text-primary) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow: hidden;
}

.mud-typography {
    font-family: var(--pm-font) !important;
}

a {
    color: inherit;
}

/* =====================================================
   Shared Avatar Rendering
   ===================================================== */

.pm-avatar-shell,
.pm-avatar-wrap .mud-avatar-root,
.pm-chat-header .mud-avatar-root,
.pm-message-line.other .mud-avatar-root,
.pm-newchat-user .mud-avatar-root,
.pm-member-picker-row .mud-avatar-root,
.pm-gm-avatar {
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    background: #1e293b;
}

.pm-avatar-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 50%;
    background: #1e293b;
}

.pm-avatar-fallback,
.pm-chat-avatar-fallback,
.pm-avatar-initial {
    position: relative;
    z-index: 0;
    color: white !important;
    font-weight: 800;
    line-height: 1;
}

#blazor-error-ui,
#blazor-error-ui.blazor-error-boundary {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* =====================================================
   Splash Screen
   ===================================================== */

.pm-splash {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--pm-blue-700);
    gap: 16px;
    z-index: 9999;
}

.pm-splash-logo {
    animation: pm-bounce .8s ease-in-out infinite alternate;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,.3));
}

.pm-splash-text {
    color: white;
    font-family: var(--pm-font);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .02em;
    margin: 0;
    opacity: .9;
}

@keyframes pm-bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-8px);
    }
}

/* =====================================================
   MudBlazor Common Components
   ===================================================== */

.mud-card,
.mud-paper,
.mud-dialog,
.mud-dialog-content,
.mud-dialog-title {
    background-color: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
}

.mud-input,
.mud-input-control,
.mud-input-slot,
.mud-input-label,
.mud-list-item-text,
.mud-table,
.mud-table-cell {
    color: var(--mud-palette-text-primary) !important;
}

.mud-input-outlined .mud-input-outlined-border {
    border-color: var(--mud-palette-lines-inputs) !important;
    border-radius: var(--pm-radius-sm) !important;
}

.mud-input-outlined.mud-focused .mud-input-outlined-border {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .18) !important;
}

.mud-label.mud-focused {
    color: var(--mud-palette-primary) !important;
}

.mud-button-root,
.mud-icon-button {
    pointer-events: auto !important;
}

.mud-button-filled.mud-button-filled-primary {
    background: linear-gradient(135deg, var(--pm-blue-600), var(--pm-blue-700)) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .35) !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    letter-spacing: .01em !important;
    transition: var(--pm-trans) !important;
}

    .mud-button-filled.mud-button-filled-primary:hover {
        background: linear-gradient(135deg, var(--pm-blue-700), var(--pm-blue-800)) !important;
        box-shadow: 0 6px 20px rgba(37, 99, 235, .45) !important;
        transform: translateY(-1px) !important;
    }

    .mud-button-filled.mud-button-filled-primary:active {
        transform: translateY(0) !important;
    }

/* =====================================================
   Stable App Shell
   MainLayout uses:
   .pm-shell
   .pm-topbar
   .pm-side-nav-shell
   .pm-page-shell
   ===================================================== */

.pm-shell {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
}

/* ===== Topbar ===== */

.pm-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    height: var(--pm-topbar-height);
    min-height: var(--pm-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--pm-blue-700), var(--pm-blue-600));
    color: #ffffff;
    border-bottom: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .18);
}

.pm-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    height: 100%;
}

.pm-topbar-menu-btn {
    flex: 0 0 auto;
}

.pm-topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    min-width: 0;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.pm-topbar-brand-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: rgba(255,255,255,.18);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pm-topbar-brand-text {
    display: inline-block;
    color: #ffffff;
    font-size: 1.22rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.01em;
    font-family: var(--pm-font);
    white-space: nowrap;
}

.pm-topbar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 100%;
    flex: 0 0 auto;
}

/* ===== Sidebar nav ===== */

.pm-side-nav-shell {
    position: fixed;
    left: 0;
    top: var(--pm-topbar-height);
    bottom: 0;
    z-index: 1200;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-drawer-text);
    border-right: 1px solid var(--mud-palette-divider);
    transition: width .18s ease;
}

    .pm-side-nav-shell.expanded {
        width: var(--pm-sidebar-expanded);
    }

    .pm-side-nav-shell.collapsed {
        width: var(--pm-sidebar-collapsed);
    }

.pm-nav-menu {
    padding-top: 18px !important;
}

.pm-nav-item {
    position: relative !important;
    font-weight: 600 !important;
}

.pm-nav-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.pm-nav-label-unread {
    font-weight: 700 !important;
    color: var(--mud-palette-text-primary) !important;
}

.pm-side-nav-shell.expanded .pm-nav-has-badge {
    background: rgba(59, 130, 246, .08) !important;
}

.pm-side-nav-shell.expanded .pm-nav-has-badge .mud-nav-link-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.pm-nav-content {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.pm-nav-badge-slot {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 28px;
    min-width: 28px;
    height: 20px;
    margin-left: auto;
}

.pm-nav-has-badge .mud-nav-link-icon,
.pm-nav-has-badge .pm-nav-label {
    color: var(--mud-palette-primary) !important;
}

.pm-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #EF4444;
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, .92);
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(239, 68, 68, .34);
    pointer-events: none;
    z-index: 2;
    box-sizing: border-box;
}

.pm-side-nav-shell.collapsed .pm-nav-badge,
#pm-left-sidebar[style*="width:72px"] .pm-nav-badge {
    position: absolute;
    right: 9px;
    top: 7px;
    transform: none;
}

.pm-side-nav-shell .mud-nav-link {
    min-height: 46px !important;
    margin: 4px 12px !important;
    border-radius: 13px !important;
    color: var(--mud-palette-drawer-text) !important;
    transition: .15s ease !important;
}

    .pm-side-nav-shell .mud-nav-link:hover {
        background: rgba(59, 130, 246, .10) !important;
    }

    .pm-side-nav-shell .mud-nav-link.active,
    .pm-side-nav-shell .mud-nav-link.mud-nav-link-active {
        background: rgba(59, 130, 246, .16) !important;
        color: var(--mud-palette-primary) !important;
    }

.pm-side-nav-shell .mud-nav-link-icon {
    color: inherit !important;
}

.pm-side-nav-shell.collapsed .mud-nav-link {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.pm-side-nav-shell.collapsed .mud-nav-link-text {
    display: none !important;
}

.pm-side-nav-shell.collapsed .mud-divider {
    margin-left: 12px !important;
    margin-right: 12px !important;
}

/* ===== Main page ===== */

.pm-page-shell {
    position: relative;
    height: 100vh;
    min-height: 100vh;
    padding-top: var(--pm-topbar-height);
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    transition: margin-left .18s ease;
    overflow: hidden;
}

    .pm-page-shell.drawer-expanded,
    .pm-page-shell[style*="264px"] {
        margin-left: var(--pm-sidebar-expanded);
    }

    .pm-page-shell.drawer-collapsed,
    .pm-page-shell[style*="72px"] {
        margin-left: var(--pm-sidebar-collapsed);
    }

/* Prevent old Mud layout from affecting custom shell */
.mud-layout,
.mud-main-content {
    background: var(--mud-palette-background) !important;
    color: var(--mud-palette-text-primary) !important;
}

/* =====================================================
   Auth Pages
   ===================================================== */

.pm-auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pm-blue-900), var(--pm-blue-700) 50%, var(--pm-blue-500));
    padding: 24px;
    position: relative;
    overflow: hidden;
}

    .pm-auth-wrapper::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 20% 80%, rgba(56, 189, 248, .15) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(255,255,255,.08) 0%, transparent 40%);
        pointer-events: none;
    }

.pm-auth-card {
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    border-radius: var(--pm-radius-xl);
    box-shadow: var(--pm-shadow-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    animation: pm-slide-up .35s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

.pm-auth-logo {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 32px;
    text-align: center;
}

    .pm-auth-logo > div:not(.pm-auth-logo-icon) {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

.pm-auth-logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--pm-blue-600), var(--pm-blue-400));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--pm-shadow-blue);
    margin: 0 auto;
}

    .pm-auth-logo-icon svg,
    .pm-auth-logo-icon .mud-icon-root {
        color: white;
        font-size: 32px;
    }

.pm-auth-title {
    width: 100%;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--mud-palette-text-primary);
    letter-spacing: -.025em;
    line-height: 1.18;
    margin: 0;
}
.pm-auth-heading {
    width: 100%;
    text-align: center;
}
.pm-auth-subtitle {
    width: 100%;
    text-align: center;
    color: var(--mud-palette-text-secondary);
    font-size: .95rem;
    line-height: 1.5;
    margin: 8px 0 0;
}
.pm-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--mud-palette-text-secondary);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

    .pm-auth-divider::before,
    .pm-auth-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--mud-palette-divider);
    }

/* =====================================================
   Chat Layout
   ===================================================== */

.pm-chat-container {
    height: calc(100vh - var(--pm-topbar-height)) !important;
    width: 100%;
    display: flex;
    overflow: hidden;
    background: var(--mud-palette-background) !important;
    color: var(--mud-palette-text-primary) !important;
}

.pm-chat-sidebar {
    width: 360px !important;
    min-width: 320px !important;
    max-width: 380px !important;
    border-right: 1px solid var(--mud-palette-divider) !important;
    display: flex;
    flex-direction: column;
    background: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
    transition: var(--pm-trans);
}

.pm-chat-header {
    padding: 22px 20px 14px !important;
    border-bottom: none !important;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--mud-palette-surface) !important;
}

.pm-chat-title {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: var(--mud-palette-text-primary);
    letter-spacing: -.01em;
}

.pm-chat-search {
    padding: 0 16px 16px !important;
    border-bottom: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface) !important;
}

    .pm-chat-search .mud-input-control,
    .pm-chat-search .mud-input-root,
    .pm-chat-search .mud-input-slot {
        background: var(--mud-palette-surface) !important;
        color: var(--mud-palette-text-primary) !important;
    }

    .pm-chat-search input,
    .pm-chat-search textarea {
        color: var(--mud-palette-text-primary) !important;
    }

        .pm-chat-search input::placeholder,
        .pm-chat-search textarea::placeholder {
            color: var(--mud-palette-text-secondary) !important;
        }

/* =====================================================
   Conversation Items
   ===================================================== */

.pm-conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 10px !important;
    padding: 11px 12px !important;
    cursor: pointer;
    border-radius: 14px !important;
    transition: var(--pm-trans);
    position: relative;
    background: transparent !important;
    color: var(--mud-palette-text-primary) !important;
    border-right: none !important;
}

    .pm-conv-item:hover {
        background: rgba(59, 130, 246, .08) !important;
    }

    .pm-conv-item.active {
        background: rgba(59, 130, 246, .14) !important;
        box-shadow: inset 3px 0 0 var(--mud-palette-primary);
    }

        .pm-conv-item.active .pm-conv-name {
            color: var(--mud-palette-primary) !important;
            font-weight: 700;
        }

.pm-conv-name {
    font-size: .875rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary) !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-conv-preview {
    font-size: .8rem;
    color: var(--mud-palette-text-secondary) !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-conv-time {
    font-size: .7rem;
    color: var(--mud-palette-text-secondary) !important;
    white-space: nowrap;
}

.pm-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 800;
    line-height: 22px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(239, 68, 68, .30);
    flex-shrink: 0;
}

/* Mud list fallback */
.mud-list-item,
.mud-list-item:hover,
.mud-list-item.mud-selected-item,
.mud-list-item.mud-selected-item:hover {
    color: var(--mud-palette-text-primary) !important;
}

    .mud-list-item.mud-selected-item {
        background: rgba(59, 130, 246, .14) !important;
    }

/* =====================================================
   Online Indicator
   ===================================================== */

.pm-online-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22C55E;
    border: 2px solid var(--mud-palette-surface);
    position: absolute;
    bottom: 2px;
    right: 2px;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, .3);
}

.pm-offline-dot {
    background: #94A3B8;
    box-shadow: none;
}

/* =====================================================
   Messages Area
   ===================================================== */

.pm-messages-area,
#msgScroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scroll-behavior: smooth;
    background: var(--mud-palette-background) !important;
    color: var(--mud-palette-text-primary) !important;
}

    .pm-messages-area::-webkit-scrollbar,
    #msgScroll::-webkit-scrollbar {
        width: 4px;
    }

    .pm-messages-area::-webkit-scrollbar-track,
    #msgScroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .pm-messages-area::-webkit-scrollbar-thumb,
    #msgScroll::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, .35);
        border-radius: 4px;
    }

        .pm-messages-area::-webkit-scrollbar-thumb:hover,
        #msgScroll::-webkit-scrollbar-thumb:hover {
            background: rgba(148, 163, 184, .55);
        }

/* =====================================================
   Message Bubble
   ===================================================== */

.pm-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 72%;
    animation: pm-msg-in .2s ease-out;
}

@keyframes pm-msg-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pm-msg.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.pm-message-line {
    display: flex;
    gap: 8px;
    max-width: 72%;
    min-width: min(240px, 100%);
}

    .pm-message-line.other {
        align-items: flex-start;
    }

    .pm-message-line.own {
        align-items: flex-end;
        flex-direction: row-reverse;
    }

    .pm-message-line.other .mud-avatar-root {
        margin-top: 2px;
        flex-shrink: 0;
    }

.pm-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: .875rem;
    line-height: 1.5;
    word-break: normal;
    overflow-wrap: break-word;
    position: relative;
    max-width: 100%;
    min-width: 0;
}

    .pm-bubble.other {
        background: var(--mud-palette-surface) !important;
        color: var(--mud-palette-text-primary) !important;
        border: 1px solid var(--mud-palette-divider) !important;
        border-radius: 4px 18px 18px 18px;
        box-shadow: var(--pm-shadow-sm);
    }

        .pm-bubble.other span,
        .pm-bubble.other div,
        .pm-bubble.other p {
            color: var(--mud-palette-text-primary) !important;
        }

    .pm-bubble.own {
        background: linear-gradient(135deg, var(--pm-blue-600), var(--pm-blue-500)) !important;
        color: white !important;
        border-radius: 18px 18px 4px 18px;
    }

        .pm-bubble.own span,
        .pm-bubble.own div,
        .pm-bubble.own p {
            color: white !important;
        }

        .pm-bubble.own a {
            color: rgba(255,255,255,.90);
            text-decoration: underline;
        }

    .pm-bubble.deleted {
        background: rgba(148, 163, 184, .14) !important;
        color: var(--mud-palette-text-secondary) !important;
        border: 1px solid var(--mud-palette-divider);
        font-style: italic;
    }

        .pm-bubble.deleted.own {
            background: rgba(255,255,255,.20) !important;
            color: rgba(255,255,255,.75) !important;
        }

.pm-msg-time {
    font-size: .68rem;
    color: var(--mud-palette-text-secondary) !important;
    margin-top: 4px;
    padding: 0 4px;
}

.pm-msg.own .pm-msg-time {
    text-align: right;
}

.pm-msg-group {
    margin-bottom: 8px;
}

.pm-date-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--mud-palette-text-secondary);
    font-size: .75rem;
    font-weight: 500;
}

    .pm-date-separator::before,
    .pm-date-separator::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--mud-palette-divider);
    }

/* =====================================================
   Reply Preview / Reactions / Typing
   ===================================================== */

.pm-reply-preview {
    background: rgba(59, 130, 246, .08) !important;
    border-left: 3px solid var(--mud-palette-primary);
    border-radius: 0 var(--pm-radius-sm) var(--pm-radius-sm) 0;
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: .8rem;
    color: var(--mud-palette-text-primary) !important;
}

    .pm-reply-preview .author {
        font-weight: 600;
        color: var(--mud-palette-primary) !important;
    }

.pm-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: var(--mud-palette-surface) !important;
    border: 1px solid var(--mud-palette-divider);
    border-radius: 18px;
    box-shadow: var(--pm-shadow-sm);
    width: fit-content;
    color: var(--mud-palette-text-secondary) !important;
    font-size: .8rem;
}

.pm-typing-dots {
    display: flex;
    gap: 3px;
    align-items: center;
}

.pm-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pm-blue-400);
    animation: pm-typing-bounce .8s ease-in-out infinite;
}

    .pm-typing-dot:nth-child(2) {
        animation-delay: .15s;
    }

    .pm-typing-dot:nth-child(3) {
        animation-delay: .3s;
    }

@keyframes pm-typing-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: .5;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.pm-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.pm-reaction-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--mud-palette-surface) !important;
    border: 1.5px solid var(--mud-palette-divider) !important;
    color: var(--mud-palette-text-primary) !important;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: .8rem;
    cursor: pointer;
    transition: var(--pm-trans);
    user-select: none;
}

    .pm-reaction-pill:hover,
    .pm-reaction-pill.mine {
        border-color: var(--pm-blue-300) !important;
        background: rgba(59, 130, 246, .10) !important;
        color: var(--mud-palette-primary) !important;
    }

    .pm-reaction-pill .count {
        font-weight: 600;
    }

/* =====================================================
   Message Input
   ===================================================== */

.pm-input-area,
.pm-input-shell {
    border-top: 1px solid var(--mud-palette-divider) !important;
    padding: 12px 16px;
    background: var(--mud-palette-surface) !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pm-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--mud-palette-surface) !important;
    border: 2px solid rgba(59, 130, 246, .45) !important;
    border-radius: 999px;
    padding: 6px 8px;
    box-shadow: 0 0 0 2px rgba(59,130,246,.08);
}

    .pm-input-row:focus-within {
        border-color: var(--mud-palette-primary) !important;
        background: var(--mud-palette-surface) !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
    }

    .pm-input-row textarea,
    .pm-message-textarea {
        flex: 1;
        border: none;
        background: transparent !important;
        resize: none;
        font-family: var(--pm-font);
        font-size: .875rem;
        color: var(--mud-palette-text-primary) !important;
        outline: none;
        max-height: 120px;
        min-height: 36px;
        padding: 6px 0;
        line-height: 1.5;
        caret-color: var(--mud-palette-primary);
    }

        .pm-input-row textarea::placeholder,
        .pm-message-textarea::placeholder {
            color: var(--mud-palette-text-secondary) !important;
        }

.pm-input-icon-btn {
    color: var(--mud-palette-text-secondary) !important;
}

    .pm-input-icon-btn:hover {
        background: rgba(59, 130, 246, .12) !important;
        color: var(--mud-palette-primary) !important;
    }

.pm-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pm-blue-600), var(--pm-blue-500));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--pm-trans);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .35);
}

    .pm-send-btn:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(37, 99, 235, .45);
    }

    .pm-send-btn:active {
        transform: scale(.95);
    }

    .pm-send-btn:disabled {
        background: rgba(148, 163, 184, .24) !important;
        box-shadow: none;
        cursor: not-allowed;
        color: rgba(148, 163, 184, .85) !important;
    }

/* =====================================================
   Attachments / Files
   ===================================================== */

.pm-attachments {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pm-image-link {
    display: block;
    line-height: 0;
}

.pm-image-preview {
    max-width: min(340px, 70vw);
    max-height: 320px;
    border-radius: 14px;
    object-fit: cover;
    display: block;
    border: 1px solid var(--mud-palette-divider);
}

.pm-attachment-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--mud-palette-text-secondary) !important;
    word-break: break-word;
}

.pm-file-wrapper {
    color: var(--mud-palette-text-primary) !important;
}

.pm-file-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--mud-palette-text-primary) !important;
    background: rgba(59, 130, 246, .08) !important;
    border: 1px solid var(--mud-palette-divider) !important;
    width: 100%;
    box-sizing: border-box;
}

.pm-bubble.own .pm-file-card {
    background: rgba(255, 255, 255, .12) !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
}

.pm-file-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, .16) !important;
    color: var(--mud-palette-primary) !important;
    flex-shrink: 0;
}

.pm-bubble.own .pm-file-icon {
    background: rgba(255,255,255,.16) !important;
    color: white !important;
}

.pm-file-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.pm-file-name {
    color: var(--mud-palette-text-primary) !important;
    font-weight: 700;
    font-size: .86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-bubble.own .pm-file-name {
    color: white !important;
}

.pm-file-meta {
    color: var(--mud-palette-text-secondary) !important;
    font-size: .74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-bubble.own .pm-file-meta {
    color: rgba(255,255,255,.78) !important;
}

.pm-file-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.pm-file-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    text-decoration: none;
    font-size: .75rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary) !important;
    background: var(--mud-palette-surface) !important;
    border: 1px solid var(--mud-palette-divider) !important;
    transition: .15s ease;
}

    .pm-file-action-btn:hover {
        background: rgba(59, 130, 246, .12) !important;
        color: var(--mud-palette-primary) !important;
        text-decoration: none;
    }

    .pm-file-action-btn.primary {
        background: var(--mud-palette-primary) !important;
        border-color: var(--mud-palette-primary) !important;
        color: #ffffff !important;
    }

.pm-bubble.own .pm-file-action-btn {
    background: rgba(255,255,255,.16) !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,.20) !important;
}

    .pm-bubble.own .pm-file-action-btn.primary {
        background: #ffffff !important;
        color: var(--pm-blue-600) !important;
        border-color: #ffffff !important;
    }

/* =====================================================
   Code Blocks
   ===================================================== */

.pm-code-block {
    background: #0F172A;
    border-radius: var(--pm-radius-sm);
    overflow: hidden;
    margin: 6px 0;
    font-family: var(--pm-font-mono);
    font-size: .82rem;
    border: 1px solid rgba(148, 163, 184, .25);
}

.pm-code-header {
    background: rgba(255,255,255,.08);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #94A3B8;
    font-size: .75rem;
}

.pm-code-lang {
    color: var(--pm-sky);
    font-weight: 600;
}

.pm-code-copy {
    background: transparent;
    border: 1px solid rgba(255,255,255,.15);
    color: #94A3B8;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: .72rem;
    cursor: pointer;
    transition: var(--pm-trans);
}

    .pm-code-copy:hover {
        background: rgba(255,255,255,.10);
        color: white;
    }

.pm-code-body {
    padding: 12px;
    color: #E2E8F0;
    overflow-x: auto;
}

/* =====================================================
   Cards / Panels / Profile
   ===================================================== */

.pm-card {
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    border-radius: var(--pm-radius-md);
    box-shadow: var(--pm-shadow-sm);
    overflow: hidden;
}

.pm-panel-header {
    padding: 16px 20px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.pm-avatar-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.pm-avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    width: 30px;
    height: 30px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,.22);
    border: 1px solid var(--mud-palette-divider);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .18s ease;
    z-index: 5;
}

    .pm-avatar-upload-btn:hover {
        transform: translateY(-1px);
        background: var(--mud-palette-primary);
        color: white;
    }

.pm-page-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--mud-palette-text-primary) !important;
    letter-spacing: -.02em;
    margin: 0;
}

.pm-page-subtitle {
    font-size: .875rem;
    color: var(--mud-palette-text-secondary) !important;
    margin: 4px 0 0;
}

/* =====================================================
   Empty State
   ===================================================== */

.pm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 12px;
    color: var(--mud-palette-text-secondary);
}

.pm-empty-icon {
    opacity: .3;
    font-size: 64px !important;
    color: var(--pm-blue-400) !important;
}

.pm-empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary) !important;
    margin: 0;
}

.pm-empty-desc {
    font-size: .875rem;
    text-align: center;
    max-width: 260px;
    color: var(--mud-palette-text-secondary) !important;
    margin: 0;
}

/* =====================================================
   Animations
   ===================================================== */

@keyframes pm-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pm-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.pm-fade-in {
    animation: pm-fade-in .25s ease-out;
}

/* =====================================================
   Scrollbars
   ===================================================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .35);
    border-radius: 8px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: rgba(148, 163, 184, .55);
    }

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 900px) {
    .pm-side-nav-shell.expanded {
        width: 220px;
    }

    .pm-page-shell {
        margin-left: 220px !important;
    }

    .pm-chat-sidebar {
        width: 280px !important;
        min-width: 240px !important;
    }
}

@media (max-width: 700px) {
    .pm-topbar-brand-text {
        display: none;
    }

    .pm-side-nav-shell.expanded {
        width: var(--pm-sidebar-collapsed);
    }

        .pm-side-nav-shell.expanded .mud-nav-link-text {
            display: none !important;
        }

    .pm-page-shell {
        margin-left: var(--pm-sidebar-collapsed) !important;
    }

    .pm-chat-sidebar {
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        border-right: 0 !important;
        overflow: hidden !important;
    }

    .pm-message-line {
        max-width: 96%;
        min-width: 0;
    }

    .pm-bubble {
        max-width: 100%;
    }
}

/* =====================================================
   MODULE 1 — Markdown Message Rendering
   Phase 2: Developer / Security Chat Experience
   ===================================================== */

.pm-markdown-body {
    line-height: 1.65;
    word-break: normal;
    overflow-wrap: break-word;
    font-size: 0.93rem;
}

/* Headings */
.pm-markdown-body h1,
.pm-markdown-body h2,
.pm-markdown-body h3,
.pm-markdown-body h4,
.pm-markdown-body h5,
.pm-markdown-body h6 {
    font-weight: 700;
    line-height: 1.3;
    margin: 0.6em 0 0.3em;
    color: var(--mud-palette-text-primary);
}

.pm-markdown-body h1 { font-size: 1.25rem; }
.pm-markdown-body h2 { font-size: 1.1rem;  }
.pm-markdown-body h3 { font-size: 1.0rem;  }

/* Paragraphs */
.pm-markdown-body p {
    margin: 0.25em 0;
}

/* Bold / Italic */
.pm-markdown-body strong { font-weight: 700; }
.pm-markdown-body em     { font-style: italic; }

/* Links */
.pm-markdown-body a {
    color: var(--mud-palette-primary);
    text-decoration: underline;
    overflow-wrap: anywhere;
    word-break: normal;
}

.pm-markdown-body a:hover {
    opacity: 0.8;
}

/* Inline code */
.pm-markdown-body code {
    font-family: 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: 0.875em;
    background: rgba(99, 102, 241, 0.12);
    color: #818CF8;
    border-radius: 5px;
    padding: 0.15em 0.4em;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Code blocks (Markdig renders: <pre><code class="language-xxx">) */
.pm-markdown-body pre {
    position: relative;
    margin: 0.6em 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #0B1120;
}

.pm-markdown-body pre code {
    display: block;
    padding: 14px 16px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.65;
    background: transparent;
    color: #E5E7EB;
    border: none;
    border-radius: 0;
    white-space: pre;
    word-break: normal;
}

/* Copy button injected by enhanceCodeBlocks JS */
.pm-markdown-body pre .copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.75);
    color: #94A3B8;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    backdrop-filter: blur(4px);
    z-index: 1;
}

.pm-markdown-body pre .copy-code-btn:hover {
    background: #2563EB;
    color: white;
    border-color: #2563EB;
}

/* Lists */
.pm-markdown-body ul,
.pm-markdown-body ol {
    margin: 0.3em 0;
    padding-left: 1.5em;
}

.pm-markdown-body li {
    margin: 0.15em 0;
}

/* Task lists (GitHub-style checkboxes) */
.pm-markdown-body ul.contains-task-list {
    list-style: none;
    padding-left: 0.4em;
}

.pm-markdown-body .task-list-item input[type="checkbox"] {
    margin-right: 6px;
    accent-color: var(--mud-palette-primary);
}

/* Blockquote */
.pm-markdown-body blockquote {
    border-left: 3px solid var(--mud-palette-primary);
    margin: 0.4em 0;
    padding: 0.3em 0.8em;
    background: rgba(59, 130, 246, 0.07);
    border-radius: 0 8px 8px 0;
    color: var(--mud-palette-text-secondary);
    font-style: italic;
}

/* Tables */
.pm-markdown-body table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.87rem;
    margin: 0.5em 0;
    border-radius: 8px;
    overflow: hidden;
}

.pm-markdown-body th,
.pm-markdown-body td {
    border: 1px solid var(--mud-palette-divider);
    padding: 6px 12px;
    text-align: left;
}

.pm-markdown-body th {
    background: rgba(59, 130, 246, 0.1);
    font-weight: 700;
}

.pm-markdown-body tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.05);
}

/* Horizontal rule */
.pm-markdown-body hr {
    border: none;
    border-top: 1px solid var(--mud-palette-divider);
    margin: 0.6em 0;
}

/* Light-mode overrides for inline code */
[data-mud-theme="default"] .pm-markdown-body code,
.mud-theme-default .pm-markdown-body code {
    background: rgba(99, 102, 241, 0.08);
    color: #4F46E5;
    border-color: rgba(99, 102, 241, 0.16);
}

/* Snippet expiry / revoke badges */
.pm-snippet-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.pm-snippet-badge.expired  { background: rgba(239,68,68,.15); color: #EF4444; }
.pm-snippet-badge.revoked  { background: rgba(234,179,8,.15);  color: #CA8A04; }
.pm-snippet-badge.expiring { background: rgba(234,179,8,.12);  color: #B45309; }
.pm-snippet-badge.active   { background: rgba(34,197,94,.12);  color: #16A34A; }
/* Phase 2 syntax highlight fix: copy button for every <pre><code> block. */
pre .copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.75);
    color: #94A3B8;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    backdrop-filter: blur(4px);
    z-index: 2;
}

    pre .copy-code-btn:hover {
        background: #2563EB;
        color: white;
        border-color: #2563EB;
    }
/* =====================================================
   Phase 2 — Better inline code readability in chat
   ===================================================== */

/* Inline code chung trong markdown, không ảnh hưởng code block */
.pm-markdown-body p code,
.pm-markdown-body li code,
.pm-markdown-body td code,
.pm-markdown-body blockquote code {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    vertical-align: baseline;
    font-family: var(--pm-font-mono);
    font-size: 0.86em;
    font-weight: 700;
    line-height: 1.35;
    padding: 0.16em 0.48em;
    margin: 0 0.12em;
    border-radius: 7px;
    white-space: break-spaces;
    word-break: break-word;
    background: rgba(15, 23, 42, 0.10);
    color: var(--mud-palette-primary);
    border: 1px solid rgba(59, 130, 246, 0.22);
}

/* Inline code trong tin nhắn của mình: nền xanh nên cần màu nổi hơn */
.pm-bubble.own .pm-markdown-body p code,
.pm-bubble.own .pm-markdown-body li code,
.pm-bubble.own .pm-markdown-body td code,
.pm-bubble.own .pm-markdown-body blockquote code {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 255, 255, 0.34) !important;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

/* Inline code trong tin nhắn người khác */
.pm-bubble.other .pm-markdown-body p code,
.pm-bubble.other .pm-markdown-body li code,
.pm-bubble.other .pm-markdown-body td code,
.pm-bubble.other .pm-markdown-body blockquote code {
    background: rgba(59, 130, 246, 0.10) !important;
    color: var(--mud-palette-primary) !important;
    border: 1px solid rgba(59, 130, 246, 0.24) !important;
}

/* Đảm bảo code block không bị CSS inline code đè */
.pm-markdown-body pre code,
.pm-bubble.own .pm-markdown-body pre code,
.pm-bubble.other .pm-markdown-body pre code {
    display: block !important;
    padding: 14px 16px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: inherit;
    font-weight: 400;
    white-space: pre;
    word-break: normal;
}
/* =====================================================
   Phase 2 — Explicit IOC rendering via /ioc command
   ===================================================== */

.pm-ioc-message {
    width: 100%;
}

.pm-ioc-card {
    display: block;
    min-width: min(360px, 70vw);
    max-width: min(620px, 70vw);
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #E5E7EB;
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.20);
}

.pm-ioc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-bottom: 8px;
}

.pm-ioc-icon {
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1;
}

.pm-ioc-type {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.20);
    color: #93C5FD;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.pm-ioc-source {
    flex-shrink: 0;
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    color: #CBD5E1;
    font-size: 11px;
    font-weight: 800;
}

.pm-ioc-value {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #FFFFFF !important;
    font-family: var(--pm-font-mono);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.55;
    text-decoration: none !important;
    white-space: nowrap;
}

    .pm-ioc-value:hover {
        color: #BFDBFE !important;
        text-decoration: underline !important;
    }

.pm-ioc-value-text {
    white-space: normal;
    word-break: break-word;
}

.pm-ioc-note {
    margin-top: 8px;
    padding-top: 8px;
    color: #CBD5E1;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

/* CVE */
.pm-ioc-cve .pm-ioc-type {
    background: rgba(239, 68, 68, 0.18);
    color: #FCA5A5;
}

/* IP / Hash */
.pm-ioc-ip .pm-ioc-type,
.pm-ioc-md5 .pm-ioc-type,
.pm-ioc-sha256 .pm-ioc-type {
    background: rgba(59, 130, 246, 0.20);
    color: #93C5FD;
}

/* URL */
.pm-ioc-url .pm-ioc-type {
    background: rgba(16, 185, 129, 0.18);
    color: #6EE7B7;
}

/* Help / Error */
.pm-ioc-error .pm-ioc-type,
.pm-ioc-help .pm-ioc-type {
    background: rgba(245, 158, 11, 0.18);
    color: #FCD34D;
}

.pm-ioc-help-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #CBD5E1;
    font-size: 13px;
    line-height: 1.45;
}

    .pm-ioc-help-list b {
        color: #FFFFFF;
    }

/* Own blue bubble needs stable dark IOC card */
.pm-bubble.own .pm-ioc-card {
    background: rgba(15, 23, 42, 0.96) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
}

.pm-bubble.own .pm-ioc-note,
.pm-bubble.own .pm-ioc-help-list {
    color: #CBD5E1 !important;
}

.pm-bubble.own .pm-ioc-value {
    color: #FFFFFF !important;
}

/* Other user's bubble */
.pm-bubble.other .pm-ioc-card {
    background: #0B1120 !important;
}
/* =====================================================
   Phase 2 — Mention highlight
   ===================================================== */

.pm-mention {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    vertical-align: baseline;
    padding: 0.12em 0.48em;
    margin: 0 0.08em;
    border-radius: 999px;
    font-weight: 900;
    font-family: var(--pm-font);
    font-size: 0.92em;
    line-height: 1.35;
    white-space: nowrap;
}

.pm-mention-user {
    background: rgba(59, 130, 246, 0.12);
    color: var(--mud-palette-primary);
    border: 1px solid rgba(59, 130, 246, 0.24);
}

.pm-mention-all {
    background: rgba(245, 158, 11, 0.16);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.pm-bubble.own .pm-mention-user,
.pm-bubble.own .pm-mention-all {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #FFFFFF !important;
    border-color: rgba(255, 255, 255, 0.34) !important;
}

.pm-bubble.other .pm-mention-user {
    background: rgba(59, 130, 246, 0.12) !important;
    color: var(--mud-palette-primary) !important;
    border-color: rgba(59, 130, 246, 0.24) !important;
}

.pm-bubble.other .pm-mention-all {
    background: rgba(245, 158, 11, 0.16) !important;
    color: #F59E0B !important;
    border-color: rgba(245, 158, 11, 0.28) !important;
}
