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

:root {
    --bg-primary: #0f0f12;
    --bg-secondary: #18181b;
    --bg-tertiary: #1f1f23;
    --bg-elevated: #27272a;
    
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --border-primary: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.12);
    
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.12);
    
    --warning: #f59e0b;
    --error: #ef4444;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f4f4f5;
    --bg-tertiary: #e4e4e7;
    --bg-elevated: #d4d4d8;
    
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    
    --border-primary: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    line-height: 1.5;
}

.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.sidebar-overlay.open {
    display: block;
}

.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 999;
    border-right: 1px solid var(--border-primary);
}

.sidebar-header {
    padding: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    margin-bottom: 12px;
}

.brand-logo {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo svg {
    width: 16px;
    height: 16px;
    color: white;
}

.brand-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.new-chat-btn {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.new-chat-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
}

.new-chat-btn svg {
    width: 14px;
    height: 14px;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
}

.history-section {
    margin-bottom: 8px;
}

.history-section-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 8px 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-section-title svg {
    width: 12px;
    height: 12px;
}

.history-item {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1px;
    transition: background 0.15s ease;
    position: relative;
}

.history-item:hover {
    background: var(--bg-tertiary);
}

.history-item.active {
    background: var(--bg-elevated);
}

.history-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 14px;
    background: var(--accent);
    border-radius: 2px;
}

.history-item svg.chat-icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.history-item:hover svg.chat-icon,
.history-item.active svg.chat-icon {
    color: var(--text-secondary);
}

.history-item-text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.history-item:hover .history-item-text,
.history-item.active .history-item-text {
    color: var(--text-primary);
}

.pin-indicator {
    width: 14px;
    height: 14px;
    color: var(--warning);
    flex-shrink: 0;
}

.history-menu-btn {
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.history-item:hover .history-menu-btn {
    opacity: 1;
}

.history-menu-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.history-menu-btn svg {
    width: 14px;
    height: 14px;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 10001;
    display: none;
    animation: menuFadeIn 0.15s ease;
}

.context-menu.show {
    display: block;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.12s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.context-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.context-menu-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.context-menu-item.danger {
    color: var(--error);
}

.context-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.context-menu-divider {
    height: 1px;
    background: var(--border-primary);
    margin: 4px 0;
}

/* Rename Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    backdrop-filter: blur(4px);
}

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

.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    width: 90%;
    max-width: 360px;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.modal-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease;
}

.modal-input:focus {
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
}

.modal-btn-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-btn-primary {
    background: var(--accent);
    border: none;
    color: white;
}

.modal-btn-primary:hover {
    background: var(--accent-light);
}

.sidebar-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border-primary);
}

.sidebar-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    padding: 3px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.sidebar-tab {
    flex: 1;
    padding: 6px 8px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-tab.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.sidebar-tab:hover:not(.active) {
    color: var(--text-secondary);
}

/* ============================================
   GOOGLE AUTH SECTION STYLES
   Where: Sidebar footer auth area
   ============================================ */
.auth-section {
    margin-bottom: 10px;
}

/* Google Sign-In Container */
.google-signin-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
}

.google-signin-container.hidden {
    display: none;
}

.signin-hint {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: center;
}

/* Google Profile (when signed in) */
.user-profile-google {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.user-profile-google.hidden {
    display: none;
}

/* Google Profile Avatar Image */
.user-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

/* Sign-Out Button */
.signout-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.signout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.signout-btn svg {
    width: 14px;
    height: 14px;
}

/* Anonymous user profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease;
}

.user-profile.hidden {
    display: none;
}

.user-profile:hover {
    background: var(--bg-tertiary);
}

.user-avatar {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: white;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 10px;
    color: var(--text-muted);
}

/* ============================================
   END GOOGLE AUTH STYLES
   ============================================ */

.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-primary);
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-btn {
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.menu-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-title h1 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    color: #10b981;
}

.status-dot {
    width: 5px;
    height: 5px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.theme-toggle {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

.theme-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.theme-btn.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.theme-btn svg {
    width: 14px;
    height: 14px;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.messages-wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 20px 0;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    min-height: 60vh;
}

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

.welcome-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.welcome-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.welcome-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.welcome-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.6;
}

.suggestion-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 520px;
    margin-top: 28px;
    width: 100%;
}

.suggestion-card {
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.suggestion-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.suggestion-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.suggestion-desc {
    font-size: 11px;
    color: var(--text-muted);
}

#messages-list {
    display: none;
}

#messages-list.visible {
    display: block;
}

.message {
    padding: 8px 0;
    animation: fadeIn 0.2s ease;
}

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

.message-inner {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    gap: 12px;
}

.message.user .message-inner {
    flex-direction: row-reverse;
}

.message.user .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.message.user .message-bubble {
    background: var(--accent);
    border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
    padding: 10px 14px;
    max-width: 75%;
}

.message.user .message-text {
    color: white;
}

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

.message.assistant .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.message.assistant .message-bubble {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md);
    padding: 12px 16px;
    max-width: 85%;
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
}

.message-avatar svg {
    width: 16px;
    height: 16px;
    color: white;
}

/* ============================================
   AVATAR IMAGE STYLES (Google profile picture in chat)
   Where: Message bubbles for signed-in users
   ============================================ */
.message-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* Override background when using image avatar */
.message.user .message-avatar:has(.avatar-img) {
    background: none;
}
/* ============================================
   END AVATAR IMAGE STYLES
   ============================================ */

.message-content {
    flex: 1;
    min-width: 0;
}

.message-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

.message-text h1, .message-text h2, .message-text h3, .message-text h4 {
    margin: 14px 0 8px 0;
    font-weight: 600;
    color: var(--text-primary);
}

.message-text h1 { font-size: 1.3em; }
.message-text h2 { font-size: 1.15em; }
.message-text h3 { font-size: 1.05em; color: var(--accent-light); }
.message-text h4 { font-size: 1em; color: var(--accent-light); }

.message-text hr {
    border: none;
    border-top: 1px solid var(--border-primary);
    margin: 14px 0;
}

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

.message-text li {
    margin: 4px 0;
    line-height: 1.5;
}

.message-text table.md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 12px;
}

.message-text table.md-table th,
.message-text table.md-table td {
    padding: 8px 12px;
    border: 1px solid var(--border-primary);
    text-align: left;
}

.message-text table.md-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.message-text p {
    margin-bottom: 8px;
}

.message-text p:last-child {
    margin-bottom: 0;
}

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

.message-text code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
}

.message.user .message-text code {
    background: rgba(255, 255, 255, 0.2);
}

.message-text pre {
    background: #1a1b26;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 10px 0;
    overflow-x: auto;
}

[data-theme="light"] .message-text pre {
    background: #f1f5f9;
}

.message-text pre code {
    background: none;
    padding: 0;
    font-size: 12px;
    line-height: 1.5;
}

.message-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

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

.message:hover .message-actions {
    opacity: 1;
}

.action-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

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

.typing-indicator {
    display: none;
    padding: 8px 0;
}

.typing-indicator.visible {
    display: block;
}

.typing-inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.typing-indicator .message-avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
}

.typing-bubble {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md);
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingPulse 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingPulse {
    0%, 60%, 100% { opacity: 0.3; transform: scale(1); }
    30% { opacity: 1; transform: scale(1.1); }
}

.input-area {
    padding: 12px 20px 20px;
    background: var(--bg-primary);
}

.input-wrapper {
    max-width: 680px;
    margin: 0 auto;
}

.input-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    transition: all 0.15s ease;
}

.input-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 14px;
    min-height: 44px;
}

#message-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    min-height: 20px;
    max-height: 120px;
    padding: 6px 0;
}

#message-input::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    gap: 4px;
}

.send-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: not-allowed;
    transition: all 0.15s ease;
}

.send-btn.active {
    background: var(--accent);
    color: white;
    cursor: pointer;
}

.send-btn.active:hover {
    background: var(--accent-light);
}

.send-btn svg {
    width: 15px;
    height: 15px;
}

.mic-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.mic-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.mic-btn svg {
    width: 14px;
    height: 14px;
}

.mic-btn.recording {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.mic-btn.recording::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    animation: micPulse 1.5s ease-in-out infinite;
}

@keyframes micPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 0; }
}

.input-disclaimer {
    text-align: center;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.25s ease;
    z-index: 10000;
    font-size: 13px;
    color: var(--text-primary);
}

.toast.show {
    bottom: 80px;
    opacity: 1;
}

.toast svg {
    width: 14px;
    height: 14px;
    color: #10b981;
}

/* ============================================
   HIDDEN UTILITY CLASS
   ============================================ */
.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        height: 100%;
        z-index: 999;
        transition: left 0.25s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .menu-btn {
        display: flex;
    }

    .messages-wrapper {
        padding: 16px;
    }

    .input-area {
        padding: 10px 16px 16px;
    }

    .input-wrapper {
        max-width: 100%;
    }

    .welcome-title {
        font-size: 20px;
    }

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

    .history-menu-btn {
        opacity: 1;
    }

    .status-badge {
        display: none;
    }
}

@media (max-width: 480px) {
    .welcome-screen {
        padding: 30px 16px;
    }

    .welcome-icon {
        width: 48px;
        height: 48px;
    }

    .welcome-icon svg {
        width: 24px;
        height: 24px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .message-actions {
        opacity: 1;
    }
}