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

:root {
    --blue: #2563eb;
    --blue-light: #3b82f6;
    --blue-dark: #1d4ed8;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-600: #d97706;
    --amber-700: #b45309;
    --red-500: #ef4444;
    --red-600: #dc2626;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 24px 16px 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 12px;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 2px;
}

.description {
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-600);
    text-align: center;
    margin-bottom: 12px;
}

.disclaimer {
    background: var(--amber-50);
    border: 1px solid var(--amber-100);
    border-left: 4px solid var(--amber-600);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--amber-700);
    margin-bottom: 16px;
}

/* Chat container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    background: white;
    margin-bottom: 12px;
}

.welcome-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2;
}

.welcome-overlay.hidden {
    display: none;
}

.welcome-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 24px;
}

.starter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-width: 480px;
}

.starter-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    color: var(--gray-700);
    transition: all 0.15s ease;
    line-height: 1.4;
}

.starter-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.starter-icon {
    font-size: 20px;
}

/* Messages */
.messages {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100%;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-bubble {
    padding: 10px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: var(--blue);
    color: white;
    border-bottom-right-radius: 6px;
}

.message.assistant .message-bubble {
    background: var(--gray-100);
    color: var(--gray-800);
    border-bottom-left-radius: 6px;
}

.message-label {
    font-size: 11px;
    color: var(--gray-400);
    margin-bottom: 4px;
    padding: 0 4px;
}

.message.user .message-label {
    text-align: right;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--gray-400);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Input bar */
.input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0 24px;
}

.input-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    background: white;
    transition: border-color 0.15s;
}

.input-bar input:focus {
    border-color: var(--blue);
}

.send-btn, .mic-btn, .voice-mode-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.send-btn {
    background: var(--blue);
    color: white;
}

.send-btn:hover {
    background: var(--blue-dark);
}

.send-btn:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.mic-btn {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

.mic-btn:hover {
    background: var(--gray-200);
}

.mic-btn.recording {
    background: var(--red-500);
    color: white;
    border-color: var(--red-500);
    animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.voice-mode-btn {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

.voice-mode-btn:hover {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

.voice-mode-btn.in-call {
    background: var(--red-500);
    color: white;
    border-color: var(--red-500);
}

/* Inline call bar */
.call-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--gray-800);
    border-radius: 12px;
    margin-bottom: 8px;
    animation: fadeIn 0.2s ease;
}

.call-bar.active {
    display: flex;
}

.call-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.call-dot.listening {
    background: #22c55e;
    animation: dot-pulse 1.5s infinite;
}

.call-dot.processing {
    background: var(--amber-600);
    animation: dot-pulse 0.8s infinite;
}

.call-dot.speaking {
    background: var(--blue-light);
    animation: dot-pulse 1s infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
    50% { opacity: 0.6; box-shadow: 0 0 8px 2px currentColor; }
}

.call-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.call-status {
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.call-transcript {
    font-size: 12px;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.end-call-btn {
    padding: 6px 16px;
    background: var(--red-500);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.end-call-btn:hover {
    background: var(--red-600);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .container {
        padding: 16px 12px 0;
    }

    header h1 {
        font-size: 24px;
    }

    .starter-grid {
        grid-template-columns: 1fr;
    }

    .message {
        max-width: 90%;
    }

    .description {
        font-size: 13px;
    }
}

/* Scrollbar */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}
