   :root {
            --bg-primary: #000000;
            --bg-secondary: #0a0a0a;
            --bg-sidebar: #171717;
            --bg-item-hover: #2a2a2a;
            --text-primary: #ffffff;
            --text-secondary: #888888;
            --border-color: #2a2a2a;
            --btn-bg: #1a1a1a;
            --btn-border: #2a2a2a;
            --chat-user-bg: #2a2a2a;
            --chat-user-border: #3a3a3a;
            --input-btn-bg: #ffffff;
            --input-btn-icon: #000000;
            --input-wrapper-bg: #1f1f1f;
        }

        body[data-theme="light"] {
            --bg-primary: #ffffff;
            --bg-secondary: #f7f7f7;
            --bg-sidebar: #ffffff;
            --bg-item-hover: #e8e8e8;
            --text-primary: #111111;
            --text-secondary: #666666;
            --border-color: #dddddd;
            --btn-bg: #f8f8f8;
            --btn-border: #dddddd;
            --chat-user-bg: #e0f0ff;
            --chat-user-border: #cce0ff;
            --input-btn-bg: #444444;
            --input-btn-icon: #ffffff;
            --input-wrapper-bg: #f0f0f0;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }
        
        body { 
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif; 
            background: var(--bg-primary); 
            color: var(--text-primary); 
            height: 100vh; 
            overflow: hidden; 
            transition: background 0.3s, color 0.3s;
        }
        
        .container { display: flex; height: 100vh; position: relative; }
        
        .overlay { 
            display: none; 
            position: fixed; 
            top: 0; left: 0; right: 0; bottom: 0; 
            background: rgba(0,0,0,0.7); 
            z-index: 99;
            backdrop-filter: blur(4px);
        }
        .overlay.active { display: block; }

        ::-webkit-scrollbar { width: 8px; height: 8px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { 
            background: var(--border-color); 
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

        .sidebar { 
            width: 280px; 
            background: var(--bg-sidebar); 
            border-right: 1px solid var(--border-color); 
            display: flex; 
            flex-direction: column;
            transition: transform 0.3s ease;
        }
        
        .sidebar-header { 
            padding: 16px; 
            border-bottom: 1px solid var(--border-color); 
        }
        
        .sidebar-header img {
            width: 90px;           
            border-radius: 8px;
        }
        
        .new-chat-btn { 
            margin: 16px; 
            padding: 14px; 
            background: var(--btn-bg); 
            border: 1px solid var(--btn-border); 
            border-radius: 8px; 
            color: var(--text-primary); 
            font-size: 15px; 
            cursor: pointer; 
            transition: all 0.2s; 
            display: flex; 
            align-items: center; 
            justify-content: center; 
            gap: 8px;
        }
        
        .new-chat-btn:hover { 
            background: var(--bg-item-hover);
            transform: translateY(-2px);
        }
        
        .chat-list { 
            flex: 1; 
            overflow-y: auto; 
            padding: 8px; 
        }
        
        .chat-list-label { 
            padding: 12px; 
            font-size: 12px; 
            color: var(--text-secondary); 
            font-weight: 600; 
            text-transform: uppercase; 
        }
        
        .chat-item { 
            padding: 12px; 
            margin: 4px 0; 
            border-radius: 8px; 
            cursor: pointer; 
            transition: all 0.2s;
        }
        
        .chat-item:hover { 
            background: var(--bg-item-hover);
            transform: translateX(4px);
        }
        
        .judul-percakapan { 
            font-size: 14px; 
            font-weight: 500; 
            color: var(--text-primary); 
            margin-bottom: 4px;
        }
        
        .cuplikan-balasan { 
            font-size: 13px; 
            color: var(--text-secondary); 
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .sidebar-footer {
            padding: 16px;
            border-top: 1px solid var(--border-color);
        }

        .user-info {
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }

        .logout-btn {
            width: 100%;
            padding: 12px;
            background: #dc3545;
            border: none;
            border-radius: 8px;
            color: white;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .logout-btn:hover {
            background: #c82333;
        }

        .main-area { 
            flex: 1; 
            display: flex; 
            flex-direction: column; 
        }

        .navbar { 
            background: var(--bg-secondary); 
            border-bottom: 1px solid var(--border-color); 
            padding: 12px 20px; 
            display: flex; 
            align-items: center; 
            justify-content: space-between; 
            height: 60px; 
        }
        
        .navbar-left { 
            display: flex; 
            align-items: center; 
            gap: 16px; 
        }
        
        .menu-toggle { 
            display: none; 
            width: 40px; 
            height: 40px; 
            background: var(--btn-bg); 
            border: 1px solid var(--btn-border); 
            border-radius: 8px; 
            color: var(--text-primary); 
            cursor: pointer;
            align-items: center;
            justify-content: center;
            font-size: 20px;
        }
        
        .menu-toggle:hover { background: var(--bg-item-hover); }
        
        .navbar-brand { 
            display: flex; 
            align-items: center; 
            gap: 12px; 
            padding: 6px 12px; 
            background: var(--btn-bg); 
            border-radius: 8px; 
        }
        
        .navbar-brand img {
            width: 70px;           
            border-radius: 6px;
        }

        .brand-text {
            font-size: 16px;
            font-weight: 600;
        }
        
        .navbar-right { 
            display: flex; 
            align-items: center; 
            gap: 12px; 
        }
        
        .nav-btn { 
            width: 40px; 
            height: 40px; 
            background: var(--btn-bg); 
            border: 1px solid var(--btn-border); 
            border-radius: 8px; 
            cursor: pointer; 
            display: flex; 
            align-items: center; 
            justify-content: center; 
        }
        
        .nav-btn:hover { background: var(--bg-item-hover); }
        
        .nav-btn svg {
            width: 20px;
            height: 20px;
        }
        
        .icon-dark, .icon-light { display: none; }
        body[data-theme="dark"] .icon-dark { display: block; }
        body[data-theme="light"] .icon-light { display: block; }

        .chat-area { 
            flex: 1; 
            overflow-y: auto; 
            max-width: 900px; 
            width: 100%; 
            margin: 0 auto; 
            padding: 20px;
            scroll-behavior: smooth;
        }
        
        .message { 
            margin-bottom: 16px; 
            display: flex; 
            width: 100%;
        }
        
        .message.user { justify-content: flex-end; }
        .message.assistant { justify-content: flex-start; }
        
        .message-bubble-wrapper { 
            position: relative; 
            display: inline-block; 
            max-width: 80%; 
        }
        
        .message-bubble { 
            padding: 12px 18px; 
            border-radius: 20px; 
            font-size: 15px; 
            line-height: 1.6;
            word-wrap: break-word;
        }
        
        .message-bubble.new-message { 
            animation: blurIn 0.4s ease-out;
        }
        
        @keyframes blurIn {
            from {
                opacity: 0;
                filter: blur(10px);
                transform: scale(0.95);
            }
            to {
                opacity: 1;
                filter: blur(0);
                transform: scale(1);
            }
        }
        
        .message.user .message-bubble { 
            background: var(--chat-user-bg); 
            border: 1px solid var(--chat-user-border); 
            border-bottom-right-radius: 6px; 
        }
        
        .message.assistant .message-bubble { 
            background: var(--btn-bg); 
            border: 1px solid var(--btn-border); 
            border-bottom-left-radius: 6px; 
        }

        .message-bubble strong {
            font-weight: 600;
        }

        .message-bubble p {
            margin: 8px 0;
        }

        .message-bubble p:first-child { margin-top: 0; }
        .message-bubble p:last-child { margin-bottom: 0; }

        .message-bubble ul, .message-bubble ol {
            margin: 8px 0;
            padding-left: 20px;
        }

        .message-bubble li { margin: 4px 0; }

        .message-bubble code {
            background: rgba(255,255,255,0.1);
            padding: 2px 6px;
            border-radius: 4px;
            font-family: monospace;
        }

        .image-preview-msg {
            background: var(--btn-bg);
            border: 1px solid var(--btn-border);
            border-radius: 12px;
            padding: 12px;
            margin-bottom: 12px;
            max-width: 250px;
            animation: blurIn 0.4s ease-out;
        }

        .image-preview-msg img {
            max-width: 100%;
            border-radius: 8px;
            display: block;
            margin-bottom: 8px;
        }

        .image-preview-msg .image-name {
            font-size: 12px;
            color: var(--text-secondary);
            word-break: break-all;
        }

        .loading-dots {
            display: flex;
            gap: 6px;
            align-items: center;
            justify-content: center;
            padding: 10px 0;
        }

        .loading-dots span {
            width: 8px;
            height: 8px;
            background: var(--text-secondary);
            border-radius: 50%;
            animation: bounce 1.4s infinite ease-in-out;
        }

        .loading-dots span:nth-child(1) { animation-delay: -0.32s; }
        .loading-dots span:nth-child(2) { animation-delay: -0.16s; }

        @keyframes bounce {
            0%, 80%, 100% {
                transform: scale(0);
                opacity: 0.5;
            }
            40% {
                transform: scale(1);
                opacity: 1;
            }
        }

        .copy-btn { 
            position: absolute; 
            top: 8px; 
            right: 8px; 
            width: 28px; 
            height: 28px; 
            background: var(--btn-bg); 
            border: 1px solid var(--btn-border); 
            border-radius: 6px; 
            cursor: pointer; 
            display: none; 
            align-items: center; 
            justify-content: center; 
            opacity: 0.7;
        }
        
        .copy-btn:hover { 
            opacity: 1; 
            background: var(--bg-item-hover);
        }
        
        .message-bubble-wrapper:hover .copy-btn { display: flex; }
        .copy-btn svg { width: 14px; height: 14px; }
        .copy-btn.copied { 
            background: #10b981; 
            border-color: #10b981;
        }

        .chart-container {
            width: 100%;
            background: var(--btn-bg);
            border: 1px solid var(--btn-border);
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .chart-container.expanded {
            position: fixed;
            top: 80px;
            left: 50%;
            transform: translateX(-50%);
            width: 90vw;
            height: 80vh;
            z-index: 100;
        }

        .chart-expanded-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            z-index: 99;
            backdrop-filter: blur(4px);
        }

        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            border-bottom: 1px solid var(--border-color);
            background: var(--bg-secondary);
        }

        .chart-info {
            display: flex;
            gap: 12px;
            align-items: center;
        }

        .chart-symbol {
            font-weight: 600;
            font-size: 14px;
        }

        .chart-timeframe {
            font-size: 13px;
            color: var(--text-secondary);
            padding: 4px 8px;
            background: var(--btn-bg);
            border-radius: 4px;
        }

        .chart-actions {
            display: flex;
            gap: 8px;
        }

        .chart-action-btn {
            width: 32px;
            height: 32px;
            background: var(--btn-bg);
            border: 1px solid var(--btn-border);
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .chart-action-btn:hover {
            background: var(--bg-item-hover);
        }

        .chart-action-btn svg {
            width: 16px;
            height: 16px;
        }

        .notification-badge {
            position: absolute;
            top: -2px;
            right: -2px;
            background: #ef4444;
            color: white;
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 10px;
            font-weight: 600;
        }

        .chart-wrapper {
            width: 100%;
            height: 400px;
        }

        .chart-container.expanded .chart-wrapper {
            height: calc(80vh - 60px);
        }

        .input-area { 
            position: sticky; 
            bottom: 0; 
            width: 100%; 
            border-top: 1px solid var(--border-color); 
            background: var(--bg-secondary); 
            padding: 16px; 
        }
        
        .input-container { 
            max-width: 900px; 
            margin: 0 auto; 
        }
        
        .mode-selector { margin-bottom: 12px; }
        
        .mode-dropdown { position: relative; }
        
        .mode-btn { 
            padding: 8px 16px; 
            background: var(--btn-bg); 
            border: 1px solid var(--btn-border); 
            border-radius: 20px; 
            color: var(--text-primary); 
            font-size: 13px; 
            cursor: pointer; 
            display: flex; 
            align-items: center; 
            gap: 8px;
        }
        
        .mode-btn:hover { background: var(--bg-item-hover); }

        .dropdown-arrow {
            transition: transform 0.2s;
            font-size: 10px;
        }

        .dropdown-arrow.open { transform: rotate(180deg); }
        
        .mode-options { 
            position: absolute; 
            bottom: 100%; 
            left: 0; 
            background: var(--bg-sidebar); 
            border: 1px solid var(--border-color); 
            border-radius: 12px; 
            padding: 8px; 
            margin-bottom: 8px; 
            display: none; 
            min-width: 220px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        }
        
        .mode-options.active { display: block; }
        
        .mode-option { 
            padding: 10px 12px; 
            cursor: pointer; 
            border-radius: 8px; 
            font-size: 14px;
        }
        
        .mode-option:hover { background: var(--bg-item-hover); }
        .mode-option.selected { background: var(--bg-item-hover); font-weight: 500; }
        
        .file-preview { 
            padding: 8px 0; 
            display: none; 
            gap: 8px;
            flex-wrap: wrap;
        }
        
        .file-preview.active { display: flex; }
        
        .file-item { 
            padding: 6px 12px; 
            background: var(--btn-bg); 
            border: 1px solid var(--btn-border); 
            border-radius: 16px; 
            font-size: 12px; 
            display: flex; 
            align-items: center; 
            gap: 8px; 
        }
        
        .input-wrapper { 
            background: var(--input-wrapper-bg); 
            border: 1px solid var(--border-color); 
            border-radius: 24px; 
            display: flex; 
            align-items: center; 
            padding: 4px;
        }

        .input-wrapper:focus-within {
            border-color: none;
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
        }
        
        .input-actions { 
            display: flex; 
            gap: 4px; 
            padding: 0 8px; 
        }
        
.input-action-btn {
  width: 36px; 
            height: 36px; 
            position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
background-color: transparent;
  border-radius: 50%; 
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;           
}
.input-action-btn svg {
            width: 20px;
            height: 20px;
        }

.input-action-btn.recording {
  
  color: #dc2626;
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.2);
}

.input-action-btn.recording::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #ef4444;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  70% {
    transform: scale(1.5);
    opacity: 0;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

        .chat-input { 
            flex: 1; 
            background: none; 
            border: none; 
            outline: none; 
            color: var(--text-primary); 
            font-size: 15px; 
            padding: 10px 12px; 
            font-family: inherit; 
            min-height: 36px; 
            max-height: 120px; 
            resize: none; 
        }

        .chat-input::placeholder { color: var(--text-secondary); }
        
        .input-btn { 
            width: 44px; 
            height: 44px; 
            background: var(--input-btn-bg); 
            border: none; 
            border-radius: 50%; 
            cursor: pointer; 
            display: flex; 
            align-items: center; 
            justify-content: center; 
            margin-left: 4px;
            position: relative;
        }
        
        .input-btn svg { 
            width: 18px; 
            height: 18px; 
            stroke: var(--input-btn-icon); 
            fill: none; 
            stroke-width: 2; 
        }

        .input-btn:hover:not(:disabled) {
            transform: scale(1.05);
        }
        
        .input-btn:disabled { opacity: 0.5; cursor: not-allowed; }

        .toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--bg-sidebar);
            border: 1px solid var(--border-color);
            padding: 12px 20px;
            border-radius: 8px;
            z-index: 1000;
            font-size: 14px;
        }

        .toast.success { border-left: 4px solid #10b981; }
        .toast.error { border-left: 4px solid #ef4444; }

        @media (max-width: 768px) {
            .sidebar { 
                position: fixed; 
                left: 0; 
                top: 0; 
                height: 100vh; 
                z-index: 102; 
                transform: translateX(-100%); 
            }
            .sidebar.open { transform: translateX(0); }
            .menu-toggle { display: flex; }
            .brand-text { display: none; }
            .message-bubble-wrapper { max-width: 90%; }
        }
    