@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── DARK THEME (default) ── */
:root, [data-theme="dark"] {
    --bg-primary: #0d1b2a;
    --bg-secondary: #112236;
    --bg-card: #152840;
    --bg-hover: #1a3050;
    --border: #1e3a56;
    --text-primary: #ffffff;
    --text-secondary: #a3b8cc;
    --text-muted: #6b8a9e;
    --accent: #ffffff;
    --accent-hover: #e5e5e5;
    --accent-glow: rgba(255,255,255,0.1);
    --cyan: #06b6d4;
    --success: #10b981;
    --score-excellent: #6ee7b7;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-w: 260px;
    --right-w: 300px;
    --navbar-bg: rgba(13,27,42,0.95);
    --feed-header-bg: rgba(13,27,42,0.95);
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
    --bg-primary: #e6e9ee;
    --bg-secondary: #d9dce3;
    --bg-card: #f5f6f8;
    --bg-hover: #cdd0d8;
    --border: #bcc1cb;
    --text-primary: #000000;
    --text-secondary: #3d3d3d;
    --text-muted: #808080;
    --accent: #000000;
    --accent-hover: #1a1a1a;
    --accent-glow: rgba(0,0,0,0.08);
    --cyan: #0891b2;
    --success: #059669;
    --score-excellent: #047857;
    --warning: #d97706;
    --danger: #dc2626;
    --navbar-bg: rgba(230,233,238,0.95);
    --feed-header-bg: rgba(230,233,238,0.95);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.mr-navbar {
    position: sticky; top: 0; z-index: 1000;
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: 60px; display: flex; align-items: center;
    padding: 0;
}

.mr-logo {
    font-size: 1.4rem; font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
}
[data-theme="dark"] .mr-logo { color: #fbbf24; }
[data-theme="light"] .mr-logo { color: #1e3a56; }

.mr-search { flex: 1; max-width: 400px; position: relative; }
.mr-search input {
    width: 100%; background: var(--bg-secondary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 20px;
    padding: 0.45rem 1rem 0.45rem 2.5rem; font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.mr-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.mr-search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.8rem; }
.mr-nav-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

.mr-layout { display: flex; max-width: 1200px; margin: 0 auto; min-height: calc(100vh - 60px); }

.mr-sidebar {
    width: var(--sidebar-w); position: sticky; top: 60px;
    height: calc(100vh - 60px); overflow-y: auto;
    padding: 1.5rem 1rem; flex-shrink: 0;
    border-right: 1px solid var(--border);
}

.mr-nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; border-radius: 12px;
    color: var(--text-secondary); font-size: 0.95rem; font-weight: 500;
    transition: all 0.15s; margin-bottom: 0.25rem;
}
.mr-nav-item:hover, .mr-nav-item.active { background: var(--bg-hover); color: var(--text-primary); }
.mr-nav-item.active { color: var(--accent); }
.mr-nav-item i { width: 20px; text-align: center; font-size: 1.1rem; }
.mr-nav-item .material-icons,
.mr-nav-item .material-icons-outlined { font-size: 1.25rem; width: 20px; text-align: center; line-height: 1; vertical-align: middle; }
.mi { font-size: 1em; vertical-align: -0.2em; line-height: 1; }

.mr-nav-cta {
    display: block;
    background: var(--accent);
    color: var(--bg-primary) !important; text-align: center;
    padding: 0.8rem; border-radius: 25px; font-weight: 700;
    margin-top: 1rem; transition: opacity 0.2s, transform 0.2s;
}
.mr-nav-cta:hover { opacity: 0.85; transform: translateY(-1px); color: var(--bg-primary) !important; }

.mr-main { flex: 1; border-right: 1px solid var(--border); min-width: 0; }

.mr-feed-header {
    padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
    font-size: 1.1rem; font-weight: 700;
    position: sticky; top: 60px;
    background: var(--feed-header-bg); backdrop-filter: blur(12px); z-index: 10;
}

.mr-composer { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; gap: 0.75rem; }
.mr-composer-inner { flex: 1; }
.mr-composer textarea {
    width: 100%; background: transparent; border: none; color: var(--text-primary);
    font-size: 1rem; font-family: inherit; resize: none; min-height: 60px; padding: 0.5rem 0;
}
.mr-composer textarea::placeholder { color: var(--text-muted); }
.mr-composer textarea:focus { outline: none; }
.mr-composer-actions {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 0.75rem; border-top: 1px solid var(--border); margin-top: 0.5rem;
}
.mr-char-count { font-size: 0.75rem; color: var(--text-muted); }

.mr-post { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); transition: background 0.15s; animation: fadeIn 0.3s ease; }
.mr-post:hover { background: rgba(255,255,255,0.02); }
.mr-post-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.mr-post-content { font-size: 0.95rem; line-height: 1.6; color: var(--text-primary); margin-bottom: 0.75rem; white-space: pre-wrap; word-break: break-word; }
.mr-content-link { color: #fbbf24; text-decoration: none; word-break: break-all; }
.mr-content-link:hover { text-decoration: underline; }
[data-theme="light"] .mr-content-link { color: #1e3a56; }
.mr-post-image { max-width: 100%; height: auto; max-height: 700px; object-fit: contain; display: block; border-radius: 12px; margin-bottom: 0.75rem; cursor: pointer; }
.mr-post-actions { display: flex; gap: 1.5rem; align-items: center; }

.mr-reaction-btn {
    background: none; border: none; color: var(--text-muted); font-size: 0.875rem;
    cursor: pointer; display: flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0.75rem; border-radius: 20px; transition: background 0.15s, color 0.15s;
}
.mr-reaction-btn:hover { background: var(--accent-glow); color: var(--accent); }
.mr-reaction-btn.liked    { color: #3b82f6; background: rgba(59,130,246,0.12);  transition: none; }
.mr-reaction-btn.disliked { color: #ef4444; background: rgba(239,68,68,0.12);   transition: none; }
.mr-reaction-btn.laughed   { color: #fbbf24; background: rgba(251,191,36,0.12);  transition: none; }
.mr-reaction-btn.bookmarked { color: var(--accent); transition: none; }

.mr-delete-btn {
    background: none; border: none; color: var(--text-muted); font-size: 0.8rem;
    cursor: pointer; margin-left: auto; padding: 0.35rem; border-radius: 6px; transition: color 0.15s;
}
.mr-delete-btn:hover { color: var(--danger); }

.mr-avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.mr-avatar-placeholder {
    border-radius: 50%; background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--bg-primary); flex-shrink: 0; font-size: 0.9rem;
}

.mr-score-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700;
}
.mr-score-badge.excellent { background: rgba(16,185,129,0.15); color: var(--score-excellent); }
.mr-score-badge.good { background: rgba(245,158,11,0.15); color: #f59e0b; }
.mr-score-badge.fair { background: rgba(249,115,22,0.15); color: #f97316; }
.mr-score-badge.needs-work { background: rgba(239,68,68,0.15); color: #ef4444; }
.mr-score-badge.unrated { background: rgba(100,116,139,0.15); color: var(--text-muted); }

.mr-right {
    width: var(--right-w); position: sticky; top: 60px;
    height: calc(100vh - 60px); overflow-y: auto;
    padding: 1.5rem 1rem; flex-shrink: 0;
}

.mr-widget { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 16px; padding: 1rem; margin-bottom: 1rem; }
.mr-widget-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text-primary); }

.mr-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; }

.btn-mr {
    background: var(--accent);
    color: var(--bg-primary); border: none; border-radius: 25px;
    padding: 0.5rem 1.25rem; font-weight: 600; font-size: 0.875rem;
    cursor: pointer; transition: opacity 0.2s, transform 0.2s; font-family: inherit; display: inline-block;
}
.btn-mr:hover { opacity: 0.85; transform: translateY(-1px); color: var(--bg-primary); text-decoration: none; }

.btn-mr-outline {
    background: transparent; color: var(--accent); border: 1.5px solid var(--accent);
    border-radius: 25px; padding: 0.45rem 1.2rem; font-weight: 600; font-size: 0.875rem;
    cursor: pointer; transition: all 0.2s; font-family: inherit; display: inline-block;
}
.btn-mr-outline:hover { background: var(--accent-glow); color: var(--accent); text-decoration: none; }


.mr-profile-banner { height: 180px; background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
.mr-profile-avatar-wrap { position: relative; display: inline-block; margin-top: -50px; margin-left: 1.5rem; }
.mr-profile-info { padding: 0.5rem 1.5rem 1.5rem; }
.mr-profile-name { font-size: 1.3rem; font-weight: 800; margin: 0.25rem 0 0.1rem; }
.mr-profile-username { color: var(--text-muted); font-size: 0.9rem; }
.mr-profile-bio { margin: 0.75rem 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; }
.mr-profile-stats { display: flex; gap: 1.5rem; margin: 0.75rem 0; font-size: 0.875rem; }
.mr-profile-stat strong { color: var(--text-primary); font-weight: 700; }
.mr-profile-stat span { color: var(--text-muted); }
a.mr-profile-stat-link { text-decoration: none; color: inherit; transition: opacity 0.15s; }
a.mr-profile-stat-link:hover { opacity: 0.75; }

.mr-score-display { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.mr-score-item { flex: 1; min-width: 110px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; text-align: center; }
.mr-score-item .score-val { font-size: 2rem; font-weight: 800; line-height: 1; }
.mr-score-item .score-lbl { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em; }

.mr-question-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; margin-bottom: 1rem; }
.mr-question-card:has(input:checked) { border-color: var(--accent); }
.mr-question-num { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.mr-question-text { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; line-height: 1.5; }
.mr-option { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem; border-radius: 10px; cursor: pointer; transition: background 0.15s, border-color 0.15s; border: 1.5px solid transparent; margin-bottom: 0.4rem; }
.mr-option:hover { background: var(--bg-hover); }
.mr-option:has(input[type="radio"]:checked) { background: rgba(251,191,36,0.12); border-color: var(--accent); }
.mr-option:has(input[type="radio"]:checked) span { color: var(--text-primary); font-weight: 600; }
.mr-option input[type="radio"] { margin-top: 2px; accent-color: var(--accent); width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; }
.mr-option span { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.4; }

.mr-category-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.2rem 0.6rem; border-radius: 20px; margin-bottom: 0.75rem; }
.cat-mate { background: rgba(239,68,68,0.15); color: #ef4444; }
.cat-employee { background: rgba(59,130,246,0.15); color: #3b82f6; }
.cat-character { background: rgba(250,204,21,0.15); color: #facc15; }

.mr-progress { height: 8px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; }
.mr-progress-bar { height: 100%; border-radius: 4px; background: var(--accent); transition: width 0.5s ease; }

.mr-lb-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-radius: 10px; transition: background 0.15s; }
.mr-lb-row:hover { background: var(--bg-hover); }
.mr-lb-rank { font-size: 1rem; font-weight: 800; color: var(--text-muted); width: 28px; text-align: center; }
.mr-lb-rank.gold { color: #fbbf24; }
.mr-lb-rank.silver { color: #94a3b8; }
.mr-lb-rank.bronze { color: #b45309; }

.mr-input { background: var(--bg-secondary); border: 1.5px solid var(--border); color: var(--text-primary); border-radius: 10px; padding: 0.65rem 1rem; font-size: 0.9rem; font-family: inherit; width: 100%; transition: border-color 0.2s, box-shadow 0.2s; }
.mr-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.mr-form-label { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.4rem; display: block; }

.mr-auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-primary); padding: 1.5rem; }
.mr-auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 2.5rem; width: 100%; max-width: 420px; box-shadow: 0 25px 50px rgba(0,0,0,0.5); }

.mr-alert { padding: 0.75rem 1rem; border-radius: 10px; font-size: 0.875rem; margin-bottom: 1rem; }
.mr-alert-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.mr-alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
[data-theme="light"] .mr-alert-success { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.5); color: #065f46; }
[data-theme="light"] .mr-alert-danger { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.4); color: #991b1b; }
.dropdown-menu .dropdown-item:hover, .dropdown-menu .dropdown-item:focus { background: var(--bg-hover) !important; }
.mr-signout-btn { width:100%;padding:0.6rem 1rem;background:rgba(239,68,68,0.12);color:#ef4444;border:1.5px solid rgba(239,68,68,0.35);border-radius:10px;font-size:0.9rem;font-weight:600;cursor:pointer;font-family:inherit;transition:background 0.15s,border-color 0.15s; }
.mr-signout-btn:hover { background:rgba(239,68,68,0.22);border-color:rgba(239,68,68,0.6); }

.mr-person-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-radius: 10px; transition: background 0.15s; }
.mr-person-row:hover { background: var(--bg-hover); }

.mr-divider { border: none; border-top: 1px solid var(--border); margin: 0.75rem 0; }

.mr-tabs { display: flex; border-bottom: 1px solid var(--border); }
.mr-tab { flex: 1; text-align: center; padding: 0.85rem; color: var(--text-muted); font-weight: 600; font-size: 0.9rem; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; background: none; border-top: none; border-left: none; border-right: none; }
.mr-tab.active { color: var(--text-secondary); border-bottom-color: var(--text-secondary); }
.mr-tab:hover { background: var(--bg-hover); color: var(--text-secondary); }

.btn-mr-subtle { background: transparent; color: var(--text-secondary); border: 1.5px solid var(--text-secondary); border-radius: 25px; padding: 0.45rem 1.2rem; font-weight: 600; font-size: 0.875rem; cursor: pointer; transition: all 0.2s; font-family: inherit; display: inline-block; }
.btn-mr-subtle:hover { background: var(--bg-hover); text-decoration: none; color: var(--text-primary); border-color: var(--text-primary); }

.mr-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.mr-empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.mr-empty-title { font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 0.5rem; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Profile action row (avatar + buttons) */
.mr-profile-actions-row { display:flex; justify-content:space-between; align-items:flex-end; padding-right:1.5rem; flex-wrap:wrap; gap:0.5rem; }

/* Profile score/content sections */
.mr-profile-section { padding:1.25rem 1.5rem 1.5rem; border-bottom:1px solid var(--border); }

/* Results page 3-column score grid */
.mr-results-score-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; margin-bottom:1.5rem; }

/* Comments thread */
.mr-comments-thread { background: var(--bg-secondary); border-top: 2px solid var(--border); }
.mr-comment-post { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.mr-comment-post:hover { background: rgba(255,255,255,0.03); }
.mr-comment-post .mr-post-content,
.mr-comment-post .mr-post-actions,
.mr-post .mr-post-content,
.mr-post .mr-post-actions { padding-left: calc(44px + 0.75rem); }
.mr-replies { border-left: 2px solid var(--border); margin-left: 2.5rem; background: var(--bg-card); }
.mr-reply-composer { border-top: 1px solid var(--border); border-bottom: none !important; }

@media (max-width: 1100px) { .mr-right { display: none; } }

@media (max-width: 768px) {
    /* Layout */
    .mr-sidebar { display: none; }
    .mr-navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1001; }
    .mr-layout { flex-direction: column; padding-top: 60px; }
    .mr-main { border: none; padding-bottom: 56px; }
    .mr-mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 56px; background: var(--bg-secondary); border-top: 1px solid var(--border); display: flex; justify-content: space-around; align-items: center; padding: 0 0.25rem; z-index: 1000; }

    /* Tighten horizontal padding */
    .mr-post, .mr-comment-post { padding-left: 0.75rem; padding-right: 0.75rem; }
    .mr-composer { padding-left: 0.75rem; padding-right: 0.75rem; }
    .mr-feed-header { padding: 0.75rem; }

    /* Post actions — smaller gaps, allow wrap */
    .mr-post-actions { gap: 0.5rem; flex-wrap: wrap; }
    .mr-reaction-btn { padding: 0.3rem 0.5rem; font-size: 0.82rem; }

    /* Comment/reply indentation */
    .mr-comment-post .mr-post-content,
    .mr-comment-post .mr-post-actions,
    .mr-post .mr-post-content,
    .mr-post .mr-post-actions { padding-left: calc(38px + 0.5rem); }
    .mr-replies { margin-left: 1rem; }

    /* Profile */
    .mr-profile-banner { height: 120px; }
    .mr-profile-avatar-wrap { margin-left: 0.75rem; }
    .mr-profile-info { padding: 0.5rem 0.75rem 1.25rem; }
    .mr-profile-stats { gap: 0.75rem; flex-wrap: wrap; }

    /* Score cards */
    .mr-score-display { gap: 0.5rem; }
    .mr-score-item { min-width: 80px; padding: 0.75rem 0.5rem; }
    .mr-score-item .score-val { font-size: 1.5rem; }

    .dm-chat-wrap {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
        height: calc(100dvh - 116px) !important;
        overflow: hidden;
        max-width: none !important;
        margin: 0 !important;
        min-height: unset !important;
    }
    /* Prevent messages scroll from bleeding into page (stops navbar jump) */
    #dm-messages {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    /* Push toasts above the bottom nav */
    #notif-toast-container { bottom: calc(56px + 0.75rem) !important; right: 0.75rem !important; max-width: calc(100vw - 1.5rem) !important; }
    /* Hide desktop keyboard hint on touch devices */
    .dm-hint { display: none; }
    /* Wider bubbles on narrow screens */
    .dm-msg-wrap { max-width: 82%; }
    .dm-bubble { font-size: 0.9rem; }

    /* Profile action row + sections */
    .mr-profile-actions-row { padding-right: 0.75rem; }
    .mr-profile-section { padding: 1.25rem 0.75rem 1.25rem; }

    /* Cards and question cards */
    .mr-card { padding: 1rem 0.75rem; }
    .mr-question-card { padding: 1rem 0.75rem; }
}

@media (max-width: 480px) {
    /* Navbar logo size */
    .mr-logo { font-size: 1.15rem; }

    /* Even tighter on very small phones */
    .mr-post, .mr-comment-post, .mr-composer { padding-left: 0.6rem; padding-right: 0.6rem; }
    .mr-post-actions { gap: 0.3rem; }
    .mr-reaction-btn { padding: 0.28rem 0.4rem; font-size: 0.78rem; }

    /* Score cards single row on tiny screens */
    .mr-score-item { min-width: 70px; }
    .mr-score-item .score-val { font-size: 1.3rem; }

    /* Auth card */
    .mr-auth-card { padding: 1.5rem 1rem; }

    /* Results score grid — stack to single column on small phones */
    .mr-results-score-grid { grid-template-columns: 1fr; gap: 0.5rem; }
}

@media (min-width: 769px) { .mr-mobile-nav { display: none; } }

/* DM / Chat — conversation container */
.dm-chat-wrap {
    max-width: 620px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 68px);   /* 60px navbar + 8px breathing room */
    min-height: 400px;
}

/* DM / Chat bubbles */
.dm-bubble-row { display: flex; margin: 0.15rem 0; }
.dm-mine { justify-content: flex-end; }
.dm-theirs { justify-content: flex-start; }
.dm-bubble { padding: 0.55rem 0.9rem; border-radius: 18px; font-size: 0.925rem; line-height: 1.45; word-break: break-word; width: 100%; box-sizing: border-box; }
.dm-bubble-mine { background: var(--accent); color: #0d1b2a; border-bottom-right-radius: 4px; }
.dm-bubble-theirs { background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
[data-theme="light"] .dm-bubble-mine { color: #fff; }
.dm-bubble .mr-content-link { text-decoration: underline !important; }
.dm-bubble-mine .mr-content-link { color: #1e3a56 !important; }
.dm-bubble-theirs .mr-content-link { color: #fbbf24 !important; }
[data-theme="light"] .dm-bubble-mine .mr-content-link { color: #fbbf24 !important; }
[data-theme="light"] .dm-bubble-theirs .mr-content-link { color: #1e3a56 !important; }
.dm-delete-btn { opacity: 0; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.75rem; padding: 0.2rem 0.35rem; border-radius: 50%; transition: opacity 0.15s, color 0.15s; }
.dm-bubble-row.dm-mine { align-items: flex-end; }
.dm-bubble-row.dm-theirs { align-items: flex-end; }
.dm-bubble-row:hover .dm-delete-btn { opacity: 1; }
.dm-delete-btn:hover { color: #ef4444; }
.dm-msg-wrap { display: flex; flex-direction: column; min-width: 50%; max-width: 72%; }
.dm-mine .dm-reactions { justify-content: flex-end; }
.dm-reactions { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.2rem; }
.dm-rpill { display: inline-flex; align-items: center; background: none; border: none; padding: 0.1rem 0.15rem; font-size: 1.1rem; cursor: pointer; user-select: none; transition: transform 0.1s; opacity: 0.75; }
.dm-rpill:hover { transform: scale(1.25); opacity: 1; }
.dm-rpill.mine { opacity: 1; }
.dm-react-trigger { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 0.25rem; border-radius: 50%; opacity: 0; transition: opacity 0.15s, color 0.15s; flex-shrink: 0; align-self: center; }
.dm-bubble-row:hover .dm-react-trigger { opacity: 1; }
.dm-react-trigger:hover { color: var(--accent); opacity: 1 !important; }
.dm-emoji-picker { position: absolute; z-index: 100; background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px; padding: 0.35rem 0.5rem; display: flex; gap: 0.1rem; box-shadow: 0 4px 20px rgba(0,0,0,0.35); }
.dm-emoji-btn { background: none; border: none; font-size: 1.3rem; cursor: pointer; padding: 0.15rem 0.2rem; border-radius: 8px; transition: background 0.1s, transform 0.1s; line-height: 1; }
.dm-emoji-btn:hover { background: var(--bg-hover); transform: scale(1.2); }
.dm-emoji-btn.active { background: var(--accent-glow); }
.dm-typing-wrap { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0; }
.dm-typing-dots { display: inline-flex; gap: 4px; padding: 0.45rem 0.75rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 18px; border-bottom-left-radius: 4px; }
.dm-typing-dots span { width: 7px; height: 7px; background: var(--text-muted); border-radius: 50%; animation: dmTypingBounce 1.2s infinite; }
.dm-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.dm-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dmTypingBounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
