/*
 * Custom Glassmorphism Theme
 */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Poppins:wght@400;500;600&family=Dancing+Script:wght@700&display=swap');

:root {
    --primary-color: #082044;
    --secondary-color: #103d7c;
    --accent-color: #e94560;
    --text-color: #dcdcdc;
    --text-secondary-color: #a0a0a0;
    
    --button-gradient: linear-gradient(45deg, #3a7bd5, #00d2ff);
    --button-hover-gradient: linear-gradient(45deg, #00d2ff, #3a7bd5);
    
    --bg-glass: rgba(10, 20, 30, 0.6);
    --bg-glass-light: rgba(16, 61, 124, 0.8);
    --bg-input: rgba(0, 0, 0, 0.25);
    
    --message-bot-bg: rgba(10, 46, 92, 0.75);
    --message-user-bg: rgba(20, 60, 110, 0.75);

    --border-color: rgba(255, 255, 255, 0.1);
}

@keyframes wave-animation {
    0% {
        transform: translateX(-100%) skewX(-20deg);
    }
    100% {
        transform: translateX(250%) skewX(-20deg);
    }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fade-in 0.5s ease-out forwards;
}

body {
    color: var(--text-color);
    font-family: 'Poppins', 'Segoe UI', 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    background: linear-gradient(to right top, #020b16, #051937, #00182c, #001521, #010606);
    height: 100vh;
    position: relative;
    overflow: hidden;
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.04) 50%, rgba(255, 255, 255, 0) 100%);
    animation: wave-animation 9s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.container {
    background: transparent;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    position: relative;
    z-index: 2;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--secondary-color); }

/* Header */
.app-header {
    background: none;
    border: none;
    padding: 0.25rem 0;
    text-align: center;
    flex-shrink: 0;
}

.logo-and-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.app-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 15px rgba(0, 191, 255, 0.3), 0 0 30px rgba(0, 191, 255, 0.2), 0 0 1px #000, 0 0 1px #000, 0 0 1px #000, 0 0 1px #000;
    background: linear-gradient(180deg, #1d5296 0%, #082044 50%, #1d5296 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    font-size: 2.5rem; 
    margin-bottom: -15px;
}

.app-subtitle {
    font-family: 'Dancing Script', cursive; 
    font-size: 1.5rem; 
    opacity: 0.8;
    color: #1d5296;
}

/* ── Active Chats Sidebar ─────────────────────────────────────────────── */
.active-chats-sidebar {
    width: 0;
    min-width: 0;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, min-width 0.25s ease, opacity 0.25s ease;
    opacity: 0;
}
.active-chats-sidebar.open {
    width: 270px;
    min-width: 270px;
    opacity: 1;
}
.acs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.acs-title { font-size: 14px; font-weight: 600; color: var(--text-color); white-space: nowrap; }
.acs-title i { margin-right: 6px; color: var(--accent-color); }
.acs-close-btn {
    background: none; border: none; color: var(--text-secondary-color);
    cursor: pointer; padding: 4px 6px; border-radius: 6px; font-size: 13px;
    transition: background 0.2s;
}
.acs-close-btn:hover { background: rgba(255,255,255,0.08); }
.acs-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.acs-empty { text-align: center; color: var(--text-secondary-color); padding: 32px 16px; font-size: 13px; line-height: 1.8; }
.acs-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.acs-item:hover { background: rgba(255,255,255,0.05); }
.acs-item.active { background: rgba(var(--accent-rgb,99,102,241),0.12); }
.acs-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; flex-shrink: 0; position: relative;
}
.acs-avatar-dot {
    position: absolute; bottom: 1px; right: 1px;
    width: 9px; height: 9px; border-radius: 50%;
    background: #22c55e; border: 2px solid var(--bg-color);
}
.acs-item-info { flex: 1; min-width: 0; }
.acs-item-name { font-size: 13px; font-weight: 600; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acs-item-preview { font-size: 11px; color: var(--text-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.acs-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.acs-item-time { font-size: 10px; color: var(--text-secondary-color); }
.acs-item-badge {
    background: var(--accent-color); color: white; font-size: 10px; font-weight: 700;
    border-radius: 10px; padding: 1px 6px; min-width: 18px; text-align: center;
}

/* ── Inline Friend Chat Header ─────────────────────────────────────────── */
.inline-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-glass);
    flex-shrink: 0;
    z-index: 2;
}
.ich-back-btn {
    background: none; border: none; color: var(--text-secondary-color);
    cursor: pointer; padding: 6px 8px; border-radius: 8px; font-size: 14px;
    transition: background 0.2s, color 0.2s;
}
.ich-back-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-color); }
.ich-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.ich-info { flex: 1; min-width: 0; }
.ich-name { font-size: 14px; font-weight: 600; color: var(--text-color); }
.ich-status { font-size: 11px; color: var(--text-secondary-color); }
.ich-status.online { color: #22c55e; }
.ich-ohm-btn {
    background: none; border: 1px solid var(--border-color);
    border-radius: 8px; color: var(--text-secondary-color);
    cursor: pointer; padding: 5px 10px; font-size: 14px; font-weight: 700;
    transition: all 0.2s;
}
.ich-ohm-btn:hover { border-color: var(--accent-color); color: var(--accent-color); background: rgba(var(--accent-rgb,99,102,241),0.1); }

/* Inline chat view */
.inline-chat-view { padding: 16px !important; }
.inline-chat-view .fhat-msg { display: flex; flex-direction: column; max-width: 75%; margin-bottom: 12px; }
.inline-chat-view .fhat-msg.mine { align-self: flex-end; align-items: flex-end; margin-left: auto; }
.inline-chat-view .fhat-msg.theirs { align-self: flex-start; align-items: flex-start; }
.inline-chat-view .fhat-msg.system { align-self: center; align-items: center; max-width: 90%; }

/* Main Layout */
.layout {
    display: flex;
    gap: 30px;
    flex-grow: 1;
    overflow: hidden; /* Prevent double scrollbars */
    position: relative;
    padding-bottom: 1rem;
}

/* Chat Area - Glassmorphism */
.chat-area {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    overflow: hidden;
    box-sizing: border-box;
    width: 100%; /* Ensure full width */
}

.chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Messages */
.messages {
    flex-grow: 1;
    padding: 20px;
    padding-bottom: 60px;
    overflow-y: auto;
}

.message-wrapper {
    margin-bottom: 15px;
    display: flex;
}

.bot-message { justify-content: flex-start; }
.user-message { justify-content: flex-end; }

.message {
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 80%;
}

.user-message .message {
    background: linear-gradient(135deg, #37474f 0%, #455a64 100%); /* More "responsive" styling */
    border-bottom-right-radius: 4px;
}

.bot-message .message {
    background: var(--message-bot-bg);
    border-bottom-left-radius: 4px;
    padding: 15px 20px;
    line-height: 1.6;
}

.agent-message {
    background-color: #2a3d45;
    color: #9ee6a3;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-bottom: 8px;
    display: inline-block;
}

/* Thinking Animation */
.thinking-animation {
    display: flex;
    align-items: center;
    padding: 10px 0;
}
.thinking-animation span {
    height: 8px;
    width: 8px;
    background: #a0a0a0;
    border-radius: 50%;
    margin: 0 3px;
    animation: thinking-dots 1.4s infinite both;
}
.thinking-animation span:nth-child(1) { animation-delay: 0.0s; }
.thinking-animation span:nth-child(2) { animation-delay: 0.2s; }
.thinking-animation span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-dots {
    0% { opacity: 0.2; transform: scale(0.9); }
    20% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.2; transform: scale(0.9); }
}

/* Message Footer (Status + TTS) */
.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: none;
}

.message-tts-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary-color);
    cursor: pointer;
    transition: all 0.2s;
}
.message-tts-btn:hover { background: var(--accent-color); color: white; }
.message-tts-btn.speaking { background: #4a2e00; color: #e8c86a; animation: breathing-beat 2s infinite; }

/* Ω pickup button — appears on every user & bot message */
.ohm-pickup-btn {
    background: none;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.2s, background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.message-wrapper:hover .ohm-pickup-btn,
.message-footer:hover .ohm-pickup-btn { opacity: 1; }
.ohm-pickup-btn:hover { background: rgba(var(--accent-rgb, 99,102,241), 0.18); color: var(--accent-color); opacity: 1; }

/* ── Mini Ωhm ring button (friend chat messages) ────────────────────── */
@property --fhat-ohm-spin { syntax: '<time>'; initial-value: 8s; inherits: false; }

.fhat-ohm-msg-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, --fhat-ohm-spin 0.6s ease-in-out;
    flex-shrink: 0;
    --fhat-ohm-spin: 8s;
}
.fhat-msg:hover .fhat-ohm-msg-btn { opacity: 0.7; }
.fhat-ohm-msg-btn:hover { opacity: 1 !important; }
.fhat-ohm-msg-btn.active { opacity: 1 !important; --fhat-ohm-spin: 0.5s; }

.fhat-ohm-ring {
    position: relative;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.fhat-ohm-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 1.5px;
    background: conic-gradient(
        from 0deg,
        transparent 0deg, transparent 40deg,
        #1d4ed8 80deg, #06b6d4 140deg,
        #8b5cf6 220deg, #3b82f6 310deg,
        transparent 360deg
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: ohmSpin var(--fhat-ohm-spin, 8s) linear infinite;
}
.fhat-ohm-ring-char {
    position: relative;
    z-index: 1;
    font-size: 11px;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}
.fhat-ohm-msg-btn.active .fhat-ohm-ring::before { animation-duration: 0.5s; }

/* Ωhm streaming response in inline chat */
.fhat-ohm-stream {
    align-self: stretch !important;
    max-width: 100% !important;
}
.fhat-ohm-stream-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    opacity: 0.75;
}
.fhat-ohm-stream-status {
    font-size: 11px;
    color: #8b5cf6;
    font-style: italic;
}
.fhat-ohm-stream .fhat-bubble {
    background: rgba(139,92,246,0.08) !important;
    border: 1px solid rgba(139,92,246,0.2) !important;
    color: var(--text-color, #e2e8f0) !important;
    border-radius: 12px !important;
    min-height: 32px;
}
/* Shimmer placeholder while waiting for first token */
.fhat-shimmer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}
.fhat-shimmer-line {
    height: 11px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(139,92,246,0.1) 25%, rgba(139,92,246,0.25) 50%, rgba(139,92,246,0.1) 75%);
    background-size: 200% 100%;
    animation: shimmerMove 1.4s infinite;
}
.fhat-shimmer-line.short { width: 55%; }
@keyframes shimmerMove {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes breathing-beat {
    0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(232,200,106,0.5);  background-color: #4a2e00; }
    50%  { transform: scale(1.1); box-shadow: 0 0 12px rgba(232,200,106,0.35); background-color: #7a4a00; }
    100% { transform: scale(1);   box-shadow: 0 0 0 15px rgba(232,200,106,0); background-color: #4a2e00; }
}

.handoff-separator {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin: 10px 0;
}

/* Message Input Form */
.message-form {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin: 0 10px; /* Add margin to the sides */
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    gap: 12px;
}

#message-input {
    flex-grow: 1;
    background: rgba(30, 41, 59, 0.6); /* Match the dark blue tone */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border-radius: 25px;
    padding: 12px 20px;    
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

#message-input:focus {
    outline: none;
    border-color: rgba(0, 198, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(0, 198, 255, 0.15), inset 0 2px 4px rgba(0,0,0,0.2);
}

#message-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

.message-form button {
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;    
    border-radius: 50%;
    margin-left: 0;
}

/* Disabled state for input controls */
.message-form button:disabled,
#voice-input-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    animation: none !important;
}

/* Voice Input Button */
#voice-input-btn {
    color: #a0a0a0;
    background: rgba(30, 41, 59, 0.4); /* Match the dark blue tone */
    border: 1px solid rgba(255, 255, 255, 0.1);
     
}

#voice-input-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

#voice-input-btn.listening {
    color: #fff;    
    background: #e94560;
    border-color: #e94560;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(233, 69, 96, 0); }
    100% { box-shadow: 0 0 0 0 rgba(233, 69, 96, 0); }
}

/* Send Button */
.message-form button[type="submit"] {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
     
    color: white;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.3);
}

.message-form button[type="submit"]:hover {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 6px 20px rgba(0, 114, 255, 0.5);
}

.message-form button[type="submit"]:active {
    transform: scale(0.95);
}

.message-form button i {
    font-size: 1.2rem;
}

/* Code Block Styles */
.bot-message pre {
    background-color: #011627;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px 16px 16px;
    overflow-x: auto;
    position: relative;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 14px;
}

.code-block-wrapper {
    position: relative;
    margin-top: 10px;
}

.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4f5b62;
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.code-block-wrapper:hover .copy-code-btn {
    opacity: 1;
}

/* Footer */
.footer {
    padding: 1rem 0 0.5rem;
    text-align: center;
    color: var(--text-secondary-color);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.agent-tag,
.agent-tag-web,
.agent-tag-coding,
.agent-tag-presentation,
.agent-tag-fast,
.agent-tag-general,
.agent-tag-document {
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 10px;
    display: inline-block;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.agent-tag-web { background-color: #3a7bd5; color: #fff; }
.agent-tag-coding { background-color: #4CAF50; color: #fff; }
.agent-tag-presentation { background-color: #f44336; color: #fff; }
.agent-tag-fast { background-color: #9c27b0; color: #fff; }
.agent-tag-general { background-color: #607d8b; color: #fff; }
.agent-tag-document { background-color: #ff9800; color: #fff; }

.query-status {
    font-size: 0.75rem;
    color: var(--text-secondary-color);
    margin-top: 10px;
    padding: 5px 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    display: inline-block;
}

.query-status span {
    margin-right: 15px;
}

.query-status strong {
    color: var(--text-color);
}

/* Individual Expert Styles */
.agent-message.expert-web {
    background-color: #2a4a6b;
    color: #c1e0ff;
}

.agent-message.expert-coding {
    background-color: #6b4a2a;
    color: #ffeed9;
}

.agent-message.expert-presentation {
    background-color: #6b2a2a;
    color: #ffd9d9;
}

.agent-message.expert-fast {
    background-color: #2a6b2a;
    color: #d9ffd9;
}

.agent-message.expert-general {
    background-color: #4a4a4a;
    color: #e0e0e0;
}

.agent-message.expert-creative-writing {
    background-color: #6b2a6b;
    color: #ffd9ff;
}

.agent-message.expert-summarization {
    background-color: #2a6b6b;
    color: #d9ffff;
}

.agent-message.expert-translation {
    background-color: #6b6b2a;
    color: #ffffd9;
}

/* ── NLP / IDP Info Section ───────────────────────────────────────────────── */
.cp-nlp-section {
    margin: 12px 0 0;
    padding: 14px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
.cp-nlp-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 700; color: var(--text-color);
    margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}
.cp-nlp-header i { color: var(--accent-color); }
.cp-nlp-badge {
    font-size: 9px; font-weight: 700; padding: 2px 6px;
    border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.cp-nlp-badge.idp { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.cp-nlp-badge.spacy { background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); }
.cp-nlp-badge.lc   { background: rgba(245,158,11,0.15);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.cp-nlp-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cp-nlp-chip {
    font-size: 11px; padding: 3px 9px; border-radius: 20px;
    background: rgba(255,255,255,0.06); color: var(--text-secondary-color);
    border: 1px solid var(--border-color);
}
.cp-nlp-chip i { margin-right: 4px; }
.cp-nlp-chip.table { border-color: rgba(16,185,129,0.3); color: #10b981; }
.cp-nlp-chip.img   { border-color: rgba(59,130,246,0.3); color: #60a5fa; }
.cp-nlp-sublabel { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.cp-nlp-titles { margin-top: 6px; }
.cp-nlp-title-row { font-size: 12px; color: var(--text-secondary-color); padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.04); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-nlp-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.cp-nlp-tag {
    font-size: 11px; padding: 3px 8px; border-radius: 5px;
    background: rgba(255,255,255,0.05); color: var(--text-secondary-color);
    border: 1px solid var(--border-color);
    cursor: default;
}
.cp-nlp-tag.keyword { border-color: rgba(139,92,246,0.3); color: #a78bfa; }
.cp-nlp-tag.entity  { border-color: rgba(59,130,246,0.25); color: #93c5fd; }
.cp-nlp-tag.entity em { font-style: normal; font-size: 9px; opacity: 0.6; margin-left: 4px; }

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    /* Active chats sidebar: full-width overlay on mobile */
    .active-chats-sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        z-index: 500;
        border-radius: 0;
        border-left: none;
        width: 0 !important;
        min-width: 0 !important;
    }
    .active-chats-sidebar.open {
        width: 85vw !important;
        min-width: 0 !important;
        max-width: 340px !important;
    }
    .container {
        padding: 0;
    }
    .chat-area {
        border-radius: 0;
        border: none;
    }
    .message {
        max-width: 90%;
    }
    .app-title {
        font-size: 1.8rem;
        margin-bottom: -5px;
    }
    .app-subtitle {
        font-size: 1.1rem;
        margin-bottom: 5px;
    }

    /* ── Sharper mobile submit bar ── */
    .message-form {
        padding: 8px 10px;
        margin: 0;
        gap: 8px;
        border-radius: 0;
        border-top: 1px solid rgba(255,255,255,0.08);
        background: rgba(10,14,22,0.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    #message-input {
        padding: 10px 14px;
        font-size: 0.95rem;
        border-radius: 18px;
        min-height: 40px;
        max-height: 120px;
    }

    .message-form button {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .message-form button[type="submit"] {
        background: linear-gradient(135deg, #2563eb, #3b82f6);
        border-radius: 50%;
        box-shadow: 0 2px 10px rgba(59,130,246,0.4);
        transition: transform 0.15s, box-shadow 0.15s;
    }

    .message-form button[type="submit"]:active {
        transform: scale(0.92);
        box-shadow: 0 1px 4px rgba(59,130,246,0.25);
    }

    /* ── Collapsible bottom nav ── */
    .mob-bottom-nav {
        transition: transform 0.3s cubic-bezier(.4,0,.2,1), opacity 0.25s ease !important;
    }
    .mob-bottom-nav.nav-hidden {
        transform: translateY(100%);
        opacity: 0;
        pointer-events: none;
    }
    /* When nav is hidden, remove the form margin */
    .mob-bottom-nav.nav-hidden ~ * .message-form,
    body.nav-hidden .message-form {
        margin-bottom: 0 !important;
    }

    /* ── Mobile content detail: render as full-screen fixed overlay ── */
    #cp-detail-view.visible {
        position: fixed !important;
        top: 0; left: 0; right: 0; bottom: 0;
        z-index: 450;
        background: var(--bg-color, #020b16) !important;
        display: flex !important;
        flex-direction: column;
        overflow: hidden;
        border-radius: 0 !important;
        border: none !important;
    }
    /* Ensure the preview body fills remaining height */
    #cp-detail-view.visible .cp-tab-panel.active { flex: 1; overflow: auto; min-height: 0; }
    #cp-detail-view.visible .cp-preview-body { flex: 1; overflow: auto; min-height: 0; }
}
