/* =============================================
   Lethe Web – Chat Interface Styles
   Design: Dark, matching Android App
   ============================================= */

:root {
    --bg:          #07131F;
    --surface:     #0F1E35;
    --surface2:    #162840;
    --surface3:    #1D3250;
    --primary:     #A8A800;
    --primary-dim: #6B6B00;
    --text:        rgba(255,255,255,0.92);
    --text-dim:    rgba(255,255,255,0.55);
    --text-faint:  rgba(255,255,255,0.30);
    --bubble-own:  #2E5878;
    --bubble-partner: #1A3050;
    --border:      rgba(255,255,255,0.07);
    --accent-red:  #E53935;
    --accent-green: #43A047;
    --radius:      12px;
    --sidebar-w:   360px;
    --input-h:     56px;
    --header-h:    60px;
    --transition:  0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    font-size: 15px;
}

.hidden { display: none !important; }

/* =============================================
   AUTH SCREEN
   ============================================= */
#auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 60% 40%, #0D2640 0%, #07131F 70%);
    padding: 24px;
}

.auth-wrapper {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.auth-logo { text-align: center; }
.auth-logo-icon { font-size: 56px; margin-bottom: 8px; }
.auth-logo h1 { font-size: 32px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.auth-subtitle { color: var(--text-dim); font-size: 14px; }

.qr-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.qr-steps {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.qr-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-dim);
}
.step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #000;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.qr-step strong { color: var(--text); }

.qr-canvas-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
    background: #fff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}
#qr-canvas {
    border-radius: 8px;
    display: block;
}
.qr-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.85);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qr-spinner {
    width: 40px; height: 40px;
    border: 4px solid #ddd;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.qr-status {
    font-size: 13px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--primary);
    display: inline-block;
}
.status-dot.pulsing {
    animation: pulse 1.4s ease-in-out infinite;
}
.status-dot.success { background: var(--accent-green); }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.3;} }

/* =============================================
   MAIN APP LAYOUT
   ============================================= */
#app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.sidebar-header {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.my-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary);
    color: #000;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.sidebar-title-area { flex: 1; }
.sidebar-my-name { font-weight: 600; font-size: 15px; }

.sidebar-actions { display: flex; gap: 4px; }

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.search-icon { color: var(--text-dim); flex-shrink: 0; }
.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 14px;
}
.search-bar input::placeholder { color: var(--text-dim); }

.contacts-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}
.contacts-list::-webkit-scrollbar { width: 4px; }
.contacts-list::-webkit-scrollbar-track { background: transparent; }
.contacts-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.contact-item:hover { background: var(--surface2); }
.contact-item.active { background: var(--surface3); }

.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--surface3);
    color: var(--primary);
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.contact-info { flex: 1; min-width: 0; }
.contact-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-last-msg { font-size: 13px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.contact-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.contact-time { font-size: 11px; color: var(--text-faint); }
.unread-badge {
    min-width: 20px; height: 20px;
    background: var(--primary);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.section-label {
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: var(--bg);
}
.no-contacts { padding: 32px 16px; text-align: center; color: var(--text-faint); font-size: 14px; }

/* =============================================
   CHAT AREA
   ============================================= */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
}

/* Welcome screen */
.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.welcome-content { text-align: center; max-width: 320px; }
.welcome-icon { font-size: 64px; margin-bottom: 16px; }
.welcome-content h2 { font-size: 26px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.welcome-content p { color: var(--text-dim); font-size: 14px; line-height: 1.6; }
.welcome-hint { margin-top: 12px; font-size: 12px; color: var(--text-faint); }

/* Chat view */
.chat-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat Header */
.chat-header {
    height: var(--header-h);
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    flex-shrink: 0;
}
.back-btn { display: none; }
.chat-header-avatar {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--surface3);
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-partner-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-partner-status { font-size: 12px; color: var(--text-dim); }
.chat-partner-status.online { color: var(--accent-green); }
.chat-partner-status.typing { color: var(--primary); font-style: italic; }
.chat-header-actions { display: flex; gap: 4px; }

/* Messages */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px 6%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.messages-container::-webkit-scrollbar { width: 5px; }
.messages-container::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }

.date-separator {
    text-align: center;
    margin: 16px 0;
}
.date-separator span {
    background: var(--surface2);
    color: var(--text-dim);
    font-size: 12px;
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* Message wrapper */
.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    margin-bottom: 6px;
    position: relative;
}
.message-wrapper.own { align-self: flex-start; align-items: flex-start; }
.message-wrapper.partner { align-self: flex-end; align-items: flex-end; }

.message-bubble {
    padding: 8px 12px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.bubble-own {
    background: var(--bubble-own);
    border-bottom-left-radius: 4px;
}
.bubble-partner {
    background: var(--bubble-partner);
    border-bottom-right-radius: 4px;
}

.msg-text { font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.msg-link { color: var(--primary); text-decoration: underline; }
.msg-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    float: right;
    clear: both;
}
.msg-time { font-size: 11px; color: rgba(255,255,255,0.5); }
.edited-mark { font-size: 11px; color: rgba(255,255,255,0.4); }

/* Ticks */
.tick { font-size: 13px; }
.tick.pending { color: rgba(255,255,255,0.4); }
.tick.sent { color: rgba(255,255,255,0.5); }
.tick.delivered { color: rgba(255,255,255,0.6); }
.tick.read { color: #4FC3F7; }

/* Media messages */
.msg-image {
    max-width: 280px;
    max-height: 320px;
    border-radius: 12px;
    cursor: pointer;
    display: block;
    object-fit: cover;
}
.msg-video {
    max-width: 280px;
    max-height: 320px;
    border-radius: 12px;
    display: block;
    background: #000;
}
.msg-caption { font-size: 13px; margin-top: 6px; color: var(--text-dim); }

/* Audio player */
.audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    max-width: 280px;
}
.audio-play-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #000;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity var(--transition);
}
.audio-play-btn:hover { opacity: 0.85; }
.audio-waveform {
    flex: 1;
    height: 28px;
    background: rgba(255,255,255,0.1);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}
.audio-progress {
    height: 100%;
    background: var(--primary);
    opacity: 0.5;
    transition: width 0.08s linear;
}
.audio-duration { font-size: 12px; color: var(--text-dim); flex-shrink: 0; white-space: nowrap; }

/* Poll */
.poll-card {
    min-width: 220px;
    max-width: 280px;
}
.poll-header { font-size: 13px; color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.poll-question { font-weight: 600; margin-bottom: 8px; }
.poll-options { display: flex; flex-direction: column; gap: 6px; }
.poll-option {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition);
}
.poll-option:hover { background: rgba(168,168,0,0.2); }
.poll-option.voted {
    background: rgba(168,168,0,0.25);
    border-color: var(--primary);
}
.poll-result-bar {
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    margin-top: 4px;
    transition: width 0.4s ease;
}

/* Link Preview */
.link-preview {
    max-width: 280px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
}
.link-preview-img { width: 100%; max-height: 140px; object-fit: cover; }
.link-preview-content { padding: 8px 10px; }
.link-preview-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.link-preview-desc { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.link-preview-url { font-size: 11px; color: var(--primary); }

/* File card */
.file-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.06);
    padding: 10px 14px;
    border-radius: 12px;
    min-width: 180px;
}
.file-icon { font-size: 28px; }
.file-name { color: var(--primary); font-size: 13px; text-decoration: none; }
.file-name:hover { text-decoration: underline; }

/* Embed */
.embed-container { max-width: 280px; }
.embed-thumb {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}
.embed-img { width: 100%; max-height: 160px; object-fit: cover; display: block; }
.embed-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px; height: 48px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}
.embed-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    color: #fff;
}
.embed-badge.yt { background: #FF0000; }
.embed-badge.tt { background: #000; border: 1px solid #69C9D0; }

/* Reply quote inside bubble */
.reply-preview-bubble {
    background: rgba(0,0,0,0.25);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    padding: 5px 8px;
    margin-bottom: 6px;
    font-size: 13px;
}
.reply-sender-name { color: var(--primary); font-weight: 600; font-size: 12px; margin-bottom: 1px; }
.reply-content-preview { color: var(--text-dim); }

/* Reaction */
.msg-reaction-area { margin-top: 2px; }
.msg-reaction {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 16px;
    cursor: pointer;
}
.msg-reaction-btn {
    display: inline-block;
    font-size: 14px;
    opacity: 0;
    cursor: pointer;
    transition: opacity var(--transition);
    padding: 2px 4px;
}
.message-wrapper:hover .msg-reaction-btn { opacity: 0.5; }

/* Reply Preview Bar (input area) */
.reply-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--surface2);
    border-top: 1px solid var(--border);
}
.reply-bar { width: 3px; height: 36px; background: var(--primary); border-radius: 2px; flex-shrink: 0; }
.reply-info { flex: 1; min-width: 0; }
.reply-sender { font-size: 12px; color: var(--primary); font-weight: 600; display: block; }
.reply-text { font-size: 13px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.reply-cancel-btn { background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; flex-shrink: 0; }

/* Input Area */
.input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    background: var(--surface2);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    min-height: var(--input-h);
    position: relative;
}

.icon-btn {
    width: 40px; height: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--surface3); color: var(--text); }

.emoji-toggle { font-size: 22px; }

.attachment-wrapper { position: relative; }
.attach-panel {
    position: absolute;
    bottom: 52px;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 120px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.attach-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 10px;
    font-size: 14px;
    transition: background var(--transition);
}
.attach-item:hover { background: var(--surface2); }
.attach-icon { font-size: 22px; }

#message-input {
    flex: 1;
    background: var(--surface3);
    border: none;
    outline: none;
    border-radius: 22px;
    padding: 10px 16px;
    color: var(--text);
    font-size: 15px;
    resize: none;
    max-height: 140px;
    overflow-y: auto;
    line-height: 1.4;
    font-family: inherit;
}
#message-input::placeholder { color: var(--text-dim); }
#message-input::-webkit-scrollbar { width: 4px; }

.send-btn {
    width: 40px; height: 40px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity var(--transition), transform var(--transition);
}
.send-btn:hover { opacity: 0.85; transform: scale(1.05); }

.voice-btn.recording {
    background: var(--accent-red) !important;
    color: #fff !important;
    animation: pulse-rec 1s ease-in-out infinite;
}
@keyframes pulse-rec { 0%,100%{transform:scale(1);} 50%{transform:scale(1.1);} }

/* Emoji Picker */
.emoji-picker-panel {
    position: absolute;
    bottom: calc(var(--input-h) + 4px);
    left: 8px;
    width: 320px;
    max-height: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow-y: auto;
    z-index: 200;
    padding: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.emoji-picker-panel::-webkit-scrollbar { width: 4px; }
.emoji-cat-label { font-size: 12px; color: var(--text-faint); padding: 4px 0; }
.emoji-grid { display: flex; flex-wrap: wrap; }
.emoji-item {
    font-size: 22px;
    padding: 4px;
    cursor: pointer;
    border-radius: 6px;
    transition: background var(--transition);
    line-height: 1;
}
.emoji-item:hover { background: var(--surface2); }

/* Lumis Picker */
.lumis-picker-panel {
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    flex-shrink: 0;
}
.lumis-picker-title { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.lumis-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.lumis-btn {
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 6px 14px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}
.lumis-btn:hover { background: rgba(168,168,0,0.2); border-color: var(--primary); }

/* =============================================
   MODALS
   ============================================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.modal img { max-width: 94vw; max-height: 94vh; border-radius: 8px; object-fit: contain; }
.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}
.embed-wrapper {
    width: min(92vw, 900px);
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}
.embed-wrapper iframe { width: 100%; height: 100%; }

/* Dialog */
.modal-dialog {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.dialog-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dialog-card h3 { font-size: 17px; font-weight: 700; }
.dialog-input {
    width: 100%;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
.dialog-input:focus { border-color: var(--primary); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.btn-primary { background: var(--primary); color: #000; border: none; border-radius: 10px; padding: 9px 20px; font-weight: 600; cursor: pointer; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); border-radius: 10px; padding: 9px 16px; cursor: pointer; font-size: 14px; }
.btn-secondary { background: var(--surface3); color: var(--text); border: none; border-radius: 10px; padding: 8px 14px; cursor: pointer; font-size: 13px; }

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    min-width: 160px;
    z-index: 800;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.ctx-item {
    padding: 12px 18px;
    cursor: pointer;
    font-size: 14px;
    transition: background var(--transition);
}
.ctx-item:hover { background: var(--surface2); }
.ctx-delete { color: var(--accent-red); }

/* Reaction Picker */
.reaction-picker {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 6px 12px;
    display: flex;
    gap: 4px;
    z-index: 700;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.reaction-emoji {
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: transform var(--transition), background var(--transition);
}
.reaction-emoji:hover { transform: scale(1.3); background: var(--surface2); }

/* Lumis Overlay */
.lumis-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 600;
    overflow: hidden;
}
.lumis-particle {
    position: absolute;
    top: -50px;
    animation: fallDown linear forwards;
    user-select: none;
    pointer-events: none;
}
@keyframes fallDown {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* Upload Progress */
.upload-progress {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 500;
    font-size: 13px;
    color: var(--text-dim);
    min-width: 200px;
}
.upload-bar {
    height: 3px;
    width: 80px;
    background: var(--surface3);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}
.upload-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 40%;
    background: var(--primary);
    border-radius: 2px;
    animation: slide 1.2s ease-in-out infinite;
}
@keyframes slide { 0%{transform:translateX(-100%);} 100%{transform:translateX(300%);} }

/* Recording Indicator */
.recording-indicator {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-red);
    color: #fff;
    border-radius: 24px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 500;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(229,57,53,0.4);
}
.rec-dot {
    width: 10px; height: 10px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}
.recording-indicator button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
}

/* =============================================
   RESPONSIVE – Mobile
   ============================================= */
@media (max-width: 768px) {
    :root { --sidebar-w: 100vw; }

    #app { flex-direction: column; }

    .sidebar {
        width: 100%;
        min-width: unset;
        display: flex;
    }

    .chat-area { display: none; width: 100%; }

    #app.chat-open .sidebar { display: none; }
    #app.chat-open .chat-area { display: flex; }

    .back-btn { display: flex; }
    .welcome-screen { display: none; }

    .messages-container { padding: 8px 3%; }
    .message-wrapper { max-width: 90%; }

    .emoji-picker-panel { width: calc(100vw - 20px); left: 10px; }
}
