        :root {
            --primary-color: #6366f1;
            --secondary-color: #8b5cf6;
            --success-color: #10b981;
            --bg-light: #f8f9fa;
            --chat-bg: #ffffff;
        }
        
        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }
        
        .app-container {
            max-width: 800px;
            height: 800px;
            max-height: 85vh;
            margin: 0 auto;
            padding: 20px;
            position: relative;
            overflow: auto;
            transition: height 1s ease;
        }
        .resize-handle {
            position: absolute;
            bottom: 0px;
            left: 50%;
            width: 34%;
            height: 8px;
            cursor: ns-resize;
            background: rgba(0, 0, 0, 0.1);
            transform: translateX(-50%);
        }

        .resize-handle:hover {
            background: rgba(0, 0, 0, 0.2);
        }
        .chat-card {
            background: white;
            border-radius: 20px;
            box-shadow: 1px 1px 11px 5px rgb(0 0 0 / 42%);
            overflow: hidden;
        }
        
        .chat-header {
            /*background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));*/
            background: #f8f9fa;
            color: black;
            padding: 20px;
            text-align: center;
        }
        
        .chat-header h1 {
            font-size: 1.5rem;
            margin: 0;
            font-weight: 600;
        }
        
        .chat-header p {
            margin: 5px 0 0 0;
            opacity: 0.9;
            font-size: 0.9rem;
        }
        
        .chat-messages {
            height: 500px;
            overflow-y: auto;
            padding: 20px;
            background: var(--bg-light);
        }
        
        .message {
            margin-bottom: 15px;
            display: flex;
            animation: slideIn 0.3s ease;
        }
        
        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .message.user {
            justify-content: flex-end;
        }
        
        .message-bubble {
            max-width: 75%;
            padding: 12px 16px;
            border-radius: 18px;
            position: relative;
        }
        
        .message.user .message-bubble {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            border-bottom-right-radius: 4px;
        }
        
        .message.assistant .message-bubble {
            background: white;
            color: #333;
            border-bottom-left-radius: 4px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }
        
        .message-badge {
            font-size: 0.7rem;
            margin-top: 5px;
            opacity: 0.7;
        }
        
        .message.assistant .message-badge {
            color: var(--success-color);
        }
        
        .input-area {
            padding: 20px;
            background: white;
            border-top: 1px solid #e9ecef;
        }
        
        .input-group {
            position: relative;
        }
        
        #messageInput {
            border-radius: 25px;
            border: 2px solid #e9ecef;
            padding: 12px 100px 12px 20px;
            font-size: 1rem;
        }
        
        #messageInput:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
        }
        
        .btn-send, .btn-voice {
            position: absolute;
            right: 5px;
            top: 50%;
            transform: translateY(-50%);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            transition: all 0.3s ease;
        }
        
        .btn-send {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            right: 5px;
        }
        
        .btn-voice {
            background: #f8f9fa;
            color: #6c757d;
            right: 50px;
        }
        
        .btn-send:hover, .btn-voice:hover {
            transform: translateY(-50%) scale(1.1);
        }
        
        .btn-voice.recording {
            background: #dc3545;
            color: white;
            animation: pulse 1.5s infinite;
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }
        
        .typing-indicator {
            display: none;
            padding: 10px;
            align-items: center;
        }
        
        .typing-indicator.show {
            display: flex;
        }
        
        .typing-dot {
            width: 8px;
            height: 8px;
            margin: 0 3px;
            background: #6c757d;
            border-radius: 50%;
            animation: typing 1.4s infinite;
        }
        
        .typing-dot:nth-child(2) { animation-delay: 0.2s; }
        .typing-dot:nth-child(3) { animation-delay: 0.4s; }
        
        @keyframes typing {
            0%, 60%, 100% { transform: translateY(0); }
            30% { transform: translateY(-10px); }
        }
        
        .tab-buttons {
            display: flex;
            justify-content: center;
            gap: 10px;
            padding: 15px;
            background: white;
            border-bottom: 1px solid #e9ecef;
        }
        
        .tab-btn {
            padding: 8px 20px;
            border: none;
            background: transparent;
            color: #6c757d;
            border-radius: 20px;
            transition: all 0.3s ease;
            font-weight: 500;
        }
        
        .tab-btn.active {
            background: var(--primary-color);
            color: white;
        }
        
        .reminders-list, .permissions-list {
            max-height: 100%;
            overflow-y: auto;
        }
        
        .reminder-item {
            background: white;
            padding: 15px;
            margin-bottom: 10px;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            transition: transform 0.2s ease;
        }
        
        .reminder-item:hover {
            transform: translateX(5px);
        }
        
        .empty-state {
            text-align: center;
            padding: 20px;
            color: #6c757d;
        }
        
        .empty-state i {
            font-size: 4rem;
            margin-bottom: 20px;
            opacity: 0.3;
        }
        
        @media (max-width: 576px) {
            .chat-messages {
                height: 400px;
            }
            
            .message-bubble {
                max-width: 85%;
            }
        }

        /* Memory Context Display */
        .memory-context {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 8px;
            padding: 12px;
            margin: 8px 0;
            font-size: 13px;
            max-width: 70%;
            animation: slideIn 0.3s ease-out;
        }

        .context-details {
            color: #495057;
            line-height: 1.6;
        }

        .context-details strong {
            color: #212529;
            margin-right: 4px;
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Update message badges for new types */
        .message-badge {
            display: inline-block;
            font-size: 11px;
            padding: 3px 8px;
            border-radius: 12px;
            margin-top: 6px;
            font-weight: 500;
        }

        /* Different badge colors */
        .message-bubble:has(.message-badge:contains("Saved")) .message-badge {
            background-color: rgba(40, 167, 69, 0.15);
            color: #28a745;
        }

        .message-bubble:has(.message-badge:contains("Memory")) .message-badge {
            background-color: rgba(123, 104, 238, 0.15);
            color: #7b68ee;
        }

        .message-bubble:has(.message-badge:contains("Filtered")) .message-badge {
            background-color: rgba(255, 193, 7, 0.15);
            color: #ffc107;
        }

        .message-bubble:has(.message-badge:contains("Tell me more")) .message-badge {
            background-color: rgba(23, 162, 184, 0.15);
            color: #17a2b8;
        }

        /* Enhanced reminder item for context display */
        .reminder-item .text-muted.small {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 6px;
        }

        /* Improved badge spacing */
        .reminder-item .badge {
            margin-top: 4px;
        }

        /* MISC */
        #chatTab {
            position: relative;
            height: 100%;
        }

        .chat-card {
            height: 100%;
        }
        #chatMessages {
            position: relative;
            height: calc(100% - 280px); 
            /* based on height of header and input area */
        }

