* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background-color: #111;
            color: #e0e0e0;
            height: 100vh;
            display: flex;
            flex-direction: column;
        }

        header {
            background-color: #1a1a1a;
            padding: 1rem 2rem;
            border-bottom: 1px solid #333;
        }

        h1 {
            font-size: 1.5rem;
            font-weight: 600;
            color: #fff;
        }

        .subtitle {
            font-size: 0.85rem;
            color: #888;
            margin-top: 0.25rem;
        }

        #messages {
            flex: 1;
            overflow-y: auto;
            padding: 2rem;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .message {
            display: flex;
            margin-bottom: 0.5rem;
        }

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

        .message.assistant {
            justify-content: flex-start;
        }

        .message.error {
            justify-content: center;
        }

        .message-content {
            max-width: 70%;
            padding: 0.75rem 1rem;
            border-radius: 1rem;
            line-height: 1.5;
        }

        .message.user .message-content {
            background-color: #1e4d2b;
            color: #a7f3d0;
            border-bottom-right-radius: 0.25rem;
        }

        .message.assistant .message-content {
            background-color: #1e293b;
            color: #93c5fd;
            border-bottom-left-radius: 0.25rem;
        }

        .message.error .message-content {
            background-color: #4c1d1d;
            color: #fca5a5;
            max-width: 90%;
        }

        .message-label {
            font-size: 0.75rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
            opacity: 0.7;
        }

        .input-container {
            background-color: #1a1a1a;
            border-top: 1px solid #333;
            padding: 1.5rem 2rem;
            display: flex;
            gap: 1rem;
            align-items: flex-end;
        }

        .input-stack {
            position: relative;
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .input-row {
            display: flex;
            gap: 0.5rem;
            align-items: stretch;
        }

        .voice-buttons {
            display: flex;
            gap: 0.35rem;
        }

        .icon-button {
            width: 42px;
            height: 42px;
            border-radius: 0.5rem;
            border: 1px solid #333;
            background: #1f2937;
            color: #e2e8f0;
            cursor: pointer;
            display: grid;
            place-items: center;
            font-size: 1rem;
            transition: all 0.15s ease;
        }

        .icon-button:hover {
            border-color: #4b5563;
            background: #111827;
        }

        .icon-button.active {
            background: #2563eb;
            border-color: #2563eb;
            color: #fff;
        }

        .transcription-actions {
            display: flex;
            gap: 0.5rem;
        }

        .pill-button {
            padding: 0.65rem 1rem;
            border-radius: 0.75rem;
            border: 1px solid #333;
            background: #111827;
            color: #e2e8f0;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .pill-button:hover {
            border-color: #4b5563;
            background: #0b1220;
        }

        .send-controls {
            display: flex;
            gap: 0.5rem;
        }

        #messageInput {
            flex: 1;
            padding: 0.75rem 1rem;
            background-color: #222;
            border: 1px solid #333;
            border-radius: 0.5rem;
            color: #e0e0e0;
            font-size: 1rem;
            font-family: inherit;
            outline: none;
            transition: border-color 0.2s;
            resize: vertical;
            min-height: 48px;
            max-height: 300px;
            line-height: 1.5;
        }

        #messageInput:focus {
            border-color: #555;
        }

        #sendButton, #stopButton {
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 0.5rem;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.2s, transform 0.1s;
        }

        #sendButton {
            background-color: #2563eb;
            color: white;
        }

        #sendButton:hover {
            background-color: #1d4ed8;
        }

        #sendButton:disabled {
            background-color: #444;
            cursor: not-allowed;
        }

        #sendButton:active {
            transform: scale(0.98);
        }

        #stopButton {
            background-color: #7f1d1d;
            color: #fca5a5;
        }

        #stopButton:hover:not(:disabled) {
            background-color: #991b1b;
        }

        #stopButton:disabled {
            background-color: #382020;
            color: #a77878;
            cursor: not-allowed;
        }

        .hidden {
            display: none !important;
        }

        /* Scrollbar styling */
        #messages::-webkit-scrollbar {
            width: 8px;
        }

        #messages::-webkit-scrollbar-track {
            background: #1a1a1a;
        }

        #messages::-webkit-scrollbar-thumb {
            background: #333;
            border-radius: 4px;
        }

        #messages::-webkit-scrollbar-thumb:hover {
            background: #444;
        }

        .loading {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background-color: #93c5fd;
            animation: pulse 1.5s ease-in-out infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 0.3; }
            50% { opacity: 1; }
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .header-left {
            flex: 1;
        }

        .tabs {
            display: flex;
            gap: 0.5rem;
        }

        .tab {
            padding: 0.5rem 1rem;
            background-color: transparent;
            color: #94a3b8;
            text-decoration: none;
            border-radius: 0.5rem;
            font-size: 0.9rem;
            font-weight: 500;
            transition: all 0.2s;
            display: inline-block;
            border: 1px solid transparent;
        }

        .tab:hover {
            background-color: #1e293b;
            color: #e2e8f0;
        }

        .tab.active {
            background-color: #2563eb;
            color: white;
            border-color: #2563eb;
        }

        .settings-button {
            padding: 0.5rem 1rem;
            background-color: #1e293b;
            color: #94a3b8;
            border: 1px solid #334155;
            border-radius: 0.5rem;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            margin-left: 1rem;
        }

        .settings-button:hover {
            background-color: #334155;
            color: #e2e8f0;
        }

        /* Modal styles */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal-overlay.show {
            display: flex;
        }

        .modal {
            background-color: #1a1a1a;
            border-radius: 0.75rem;
            border: 1px solid #333;
            width: 90%;
            max-width: 800px;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .modal-header {
            padding: 1.5rem;
            border-bottom: 1px solid #333;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-header h2 {
            font-size: 1.25rem;
            color: #fff;
        }

        .close-button {
            background: none;
            border: none;
            color: #888;
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 0.25rem;
            transition: all 0.2s;
        }

        .close-button:hover {
            background-color: #2a2a2a;
            color: #fff;
        }

        .modal-tabs {
            display: flex;
            gap: 0;
            border-bottom: 1px solid #333;
            padding: 0 1.5rem;
        }

        .modal-tab {
            padding: 1rem 1.5rem;
            background: none;
            border: none;
            color: #888;
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: all 0.2s;
        }

        .modal-tab:hover {
            color: #e2e8f0;
        }

        .modal-tab.active {
            color: #2563eb;
            border-bottom-color: #2563eb;
        }

        .modal-content {
            flex: 1;
            overflow-y: auto;
            padding: 1.5rem;
        }

        .tab-pane {
            display: none;
        }

        .tab-pane.active {
            display: block;
        }

        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            color: #e2e8f0;
            font-weight: 500;
            font-size: 0.9rem;
        }

        .form-group input,
        .form-group textarea {
            width: 100%;
            padding: 0.75rem;
            background-color: #222;
            border: 1px solid #333;
            border-radius: 0.5rem;
            color: #e0e0e0;
            font-size: 0.95rem;
            font-family: inherit;
        }

        .form-group textarea {
            min-height: 150px;
            resize: vertical;
            font-family: 'Monaco', 'Courier New', monospace;
        }

        .form-group input:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #2563eb;
        }

        .form-help {
            margin-top: 0.5rem;
            font-size: 0.85rem;
            color: #888;
        }

        .button {
            padding: 0.75rem 1.5rem;
            background-color: #2563eb;
            color: white;
            border: none;
            border-radius: 0.5rem;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .button:hover {
            background-color: #1d4ed8;
        }

        .button.secondary {
            background-color: #334155;
        }

        .button.secondary:hover {
            background-color: #475569;
        }

        .pinned-memories-list {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            margin-top: 1rem;
        }

        .pinned-memory-item {
            background-color: #222;
            border: 1px solid #333;
            border-radius: 0.5rem;
            padding: 1rem;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
        }

        .memory-info {
            flex: 1;
        }

        .memory-text {
            color: #e2e8f0;
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
            line-height: 1.5;
        }

        .memory-meta {
            font-size: 0.8rem;
            color: #888;
        }

        .unpin-button {
            background-color: #4c1d1d;
            color: #fca5a5;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 0.375rem;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .unpin-button:hover {
            background-color: #7f1d1d;
            color: #fff;
        }

        .search-memories {
            display: flex;
            gap: 0.75rem;
            margin-bottom: 1.5rem;
        }

        .search-memories input {
            flex: 1;
        }

        .empty-state {
            text-align: center;
            padding: 2rem;
            color: #888;
            font-size: 0.95rem;
        }

        details.tool-call {
            background: #0f172a;
            border: 1px solid #1f2937;
            border-radius: 0.5rem;
            padding: 0.5rem 0.75rem;
            margin-top: 0.5rem;
            color: #e2e8f0;
        }

        details.tool-call summary {
            cursor: pointer;
            font-weight: 600;
            color: #93c5fd;
            outline: none;
        }

        details.tool-call pre {
            white-space: pre-wrap;
            margin: 0.5rem 0 0;
            font-family: 'Menlo', 'Consolas', monospace;
            background: #111827;
            padding: 0.5rem;
            border-radius: 0.25rem;
            border: 1px solid #1f2937;
        }

        /* Session boundary styles */
        .message.session-boundary {
            justify-content: center;
            margin: 0.25rem 0;
        }

        .message.session-boundary .message-content {
            background: transparent;
            max-width: none;
        }

        details.session-boundary-details {
            background: #1f2937;
            border: 1px solid #374151;
            border-radius: 0.5rem;
            padding: 0.5rem 1rem;
            color: #9ca3af;
        }

        details.session-boundary-details summary {
            cursor: pointer;
            font-weight: 500;
            color: #6b7280;
            outline: none;
            font-size: 0.85rem;
        }

        details.session-boundary-details[open] summary {
            margin-bottom: 0.5rem;
        }

        .session-boundary-info {
            font-size: 0.8rem;
            color: #6b7280;
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem 1rem;
        }

        .session-boundary-info div {
            white-space: nowrap;
        }

        .session-boundary-info strong {
            color: #9ca3af;
        }

        .wake-word-toggle {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 0.75rem;
            background: #1f2937;
            border: 1px solid #333;
            border-radius: 0.5rem;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .wake-word-toggle:hover {
            border-color: #4b5563;
            background: #111827;
        }

        .wake-word-toggle.active {
            background: #1e4d2b;
            border-color: #22c55e;
        }

        .wake-word-toggle input[type="checkbox"] {
            display: none;
        }

        .wake-word-toggle .toggle-indicator {
            width: 36px;
            height: 20px;
            background: #4b5563;
            border-radius: 10px;
            position: relative;
            transition: background 0.2s;
        }

        .wake-word-toggle.active .toggle-indicator {
            background: #22c55e;
        }

        .wake-word-toggle .toggle-indicator::after {
            content: '';
            position: absolute;
            width: 16px;
            height: 16px;
            background: #fff;
            border-radius: 50%;
            top: 2px;
            left: 2px;
            transition: transform 0.2s;
        }

        .wake-word-toggle.active .toggle-indicator::after {
            transform: translateX(16px);
        }

        .wake-word-toggle .toggle-label {
            font-size: 0.8rem;
            color: #94a3b8;
            white-space: nowrap;
        }

        .wake-word-toggle.active .toggle-label {
            color: #a7f3d0;
        }

        .silence-timeout {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.4rem 0.6rem;
            background: #1f2937;
            border: 1px solid #333;
            border-radius: 0.5rem;
            color: #94a3b8;
            font-size: 0.8rem;
        }

        .silence-timeout input {
            width: 60px;
            background: #111827;
            border: 1px solid #334155;
            border-radius: 0.35rem;
            color: #e2e8f0;
            padding: 0.35rem 0.5rem;
            font-size: 0.85rem;
        }

        .audio-status {
            font-size: 0.8rem;
            padding: 0.35rem 0.75rem;
            border-radius: 1rem;
            white-space: nowrap;
            display: none;
            align-items: center;
            gap: 0.4rem;
        }

        .audio-status.visible {
            display: inline-flex;
        }

        .audio-status.waiting {
            background: #1e3a5f;
            color: #7dd3fc;
        }

        .audio-status.connecting {
            background: #3f3f00;
            color: #fef08a;
        }

        .audio-status.listening {
            background: #14532d;
            color: #86efac;
        }

        .audio-status.speaking {
            background: #581c87;
            color: #e9d5ff;
        }

        .audio-status.thinking {
            background: #78350f;
            color: #fcd34d;
        }

        .audio-status .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: currentColor;
            animation: pulse-dot 1.5s ease-in-out infinite;
        }

        .audio-status.speaking .status-dot {
            animation: pulse-dot 0.5s ease-in-out infinite;
        }

        .audio-status.thinking .status-dot {
            animation: pulse-dot 0.8s ease-in-out infinite;
        }

        @keyframes pulse-dot {
            0%, 100% { opacity: 0.4; }
            50% { opacity: 1; }
        }
