*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body, #root { height: 100%; width: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; -webkit-font-smoothing: antialiased; background: #fff; color: #1a1a1a; line-height: 1.5; }
a { color: #0ea5e9; text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Layout */
.app-layout { display: flex; height: 100vh; background: #fff; }
.sidebar { width: 288px; height: 100%; display: flex; flex-direction: column; background: #fff; border-right: 1px solid #f1f5f9; flex-shrink: 0; transition: width 0.3s, transform 0.3s; overflow: hidden; }
.sidebar.collapsed { width: 0; border: none; }
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100%; }

/* Sidebar */
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; height: 56px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.sidebar-logo-icon { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, #2563eb); display: flex; align-items: center; justify-content: center; }
.sidebar-logo-icon svg { width: 20px; height: 20px; color: #fff; }
.sidebar-logo-text { font-weight: 600; font-size: 15px; color: #111827; }
.sidebar-close { display: none; padding: 6px; border-radius: 6px; border: none; background: none; color: #6b7280; }
.sidebar-close:hover { background: #f3f4f6; }

.new-chat-btn { margin: 12px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; color: #374151; font-size: 14px; font-weight: 500; transition: background 0.15s; }
.new-chat-btn:hover { background: #f9fafb; }

.search-box { padding: 0 12px 8px; }
.search-input { width: 100%; padding: 8px 10px 8px 34px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 13px; outline: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") no-repeat 10px center; background-size: 16px; }
.search-input:focus { border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1); }

.conv-list { flex: 1; overflow-y: auto; padding: 0 8px; }
.conv-group-label { padding: 8px 8px 4px; font-size: 11px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; }
.conv-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background 0.12s; position: relative; }
.conv-item:hover { background: #f9fafb; }
.conv-item.active { background: #f3f4f6; }
.conv-item .fav-icon { color: #fbbf24; font-size: 12px; flex-shrink: 0; }
.conv-item-text { flex: 1; min-width: 0; }
.conv-item-title { font-size: 13px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item-sub { font-size: 11px; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.conv-item-more { padding: 4px; border: none; background: none; color: #9ca3af; border-radius: 4px; opacity: 0; transition: opacity 0.15s; flex-shrink: 0; }
.conv-item:hover .conv-item-more { opacity: 1; }
.conv-item-more:hover { background: #e5e7eb; color: #374151; }

.conv-menu { position: absolute; right: 8px; top: 100%; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); padding: 4px; z-index: 100; min-width: 140px; }
.conv-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; background: none; font-size: 13px; color: #374151; border-radius: 6px; text-align: left; }
.conv-menu-item:hover { background: #f3f4f6; }
.conv-menu-item.danger { color: #ef4444; }
.conv-menu-item.danger:hover { background: #fef2f2; }

.conv-empty { padding: 32px 16px; text-align: center; font-size: 13px; color: #9ca3af; }

/* Sidebar footer */
.sidebar-footer { border-top: 1px solid #f1f5f9; padding: 12px; }
.usage-bar { margin-bottom: 10px; padding: 0 4px; }
.usage-bar-header { display: flex; justify-content: space-between; font-size: 11px; color: #9ca3af; margin-bottom: 4px; }
.usage-bar-track { width: 100%; height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden; }
.usage-bar-fill { height: 100%; background: #3b82f6; border-radius: 3px; transition: width 0.3s; }

.user-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: none; background: none; border-radius: 8px; text-align: left; }
.user-btn:hover { background: #f9fafb; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #60a5fa, #2563eb); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; color: #111827; }
.user-plan { font-size: 11px; color: #9ca3af; }
.user-chevron { width: 16px; height: 16px; color: #9ca3af; transition: transform 0.2s; }
.user-chevron.open { transform: rotate(180deg); }

.user-dropdown { position: absolute; bottom: 60px; left: 12px; right: 12px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); padding: 4px; z-index: 100; }
.user-dropdown-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; background: none; font-size: 13px; color: #374151; border-radius: 6px; text-align: left; }
.user-dropdown-item:hover { background: #f3f4f6; }
.user-dropdown-item.danger { color: #ef4444; }
.user-dropdown-divider { height: 1px; background: #f1f5f9; margin: 4px 0; }

/* Header */
.header { height: 56px; border-bottom: 1px solid #f1f5f9; background: #fff; display: flex; align-items: center; padding: 0 16px; gap: 12px; flex-shrink: 0; }
.sidebar-toggle { padding: 8px; border: none; background: none; color: #6b7280; border-radius: 8px; }
.sidebar-toggle:hover { background: #f3f4f6; }
.header-title { flex: 1; font-size: 14px; font-weight: 500; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Model Selector */
.model-selector { position: relative; }
.model-trigger { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; font-size: 13px; font-weight: 500; color: #374151; transition: border-color 0.15s; }
.model-trigger:hover { border-color: #d1d5db; }
.model-trigger .tag { padding: 2px 8px; font-size: 11px; border-radius: 4px; font-weight: 400; }
.model-trigger .tag.reasoning { background: #f3e8ff; color: #7c3aed; }
.model-trigger .tag.general { background: #dbeafe; color: #2563eb; }
.model-trigger .tag.fast { background: #dcfce7; color: #16a34a; }
.model-trigger svg { width: 16px; height: 16px; color: #9ca3af; transition: transform 0.2s; }
.model-trigger svg.open { transform: rotate(180deg); }

.model-dropdown { position: absolute; top: calc(100% + 8px); right: 0; width: 320px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.1); padding: 8px; z-index: 200; }
.model-option { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px; border: none; background: none; border-radius: 8px; text-align: left; transition: background 0.12s; }
.model-option:hover { background: #f9fafb; }
.model-option.selected { background: #eff6ff; }
.model-option-info { flex: 1; }
.model-option-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: #111827; }
.model-option-name .tag { padding: 2px 8px; font-size: 11px; border-radius: 4px; font-weight: 400; }
.model-option-desc { font-size: 12px; color: #9ca3af; margin-top: 4px; line-height: 1.4; }
.model-option-check { width: 20px; height: 20px; color: #3b82f6; flex-shrink: 0; margin-top: 2px; }

/* Chat Area */
.chat-area { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #fff; }

/* Welcome */
.welcome { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px; }
.welcome-inner { max-width: 560px; text-align: center; }
.welcome-icon { width: 64px; height: 64px; margin: 0 auto 24px; border-radius: 16px; background: linear-gradient(135deg, #3b82f6, #2563eb); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3); }
.welcome-icon svg { width: 40px; height: 40px; color: #fff; }
.welcome h2 { font-size: 28px; font-weight: 700; color: #111827; margin-bottom: 8px; }
.welcome p { font-size: 15px; color: #9ca3af; margin-bottom: 32px; }
.quick-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.quick-action { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; font-size: 13px; color: #374151; transition: all 0.15s; }
.quick-action:hover { border-color: #93c5fd; background: #eff6ff; }

/* Messages */
.messages { flex: 1; overflow-y: auto; }
.messages-inner { max-width: 768px; margin: 0 auto; padding: 24px 16px; }
.message { display: flex; gap: 16px; padding: 24px 0; }
.message.user { flex-direction: row-reverse; }
.message-avatar { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.message-avatar.user { background: linear-gradient(135deg, #4b5563, #374151); }
.message-avatar.assistant { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.message-avatar svg { width: 20px; height: 20px; color: #fff; }
.message-body { flex: 1; min-width: 0; }
.message-body.user { display: flex; flex-direction: column; align-items: flex-end; }
.message-content { border-radius: 12px; padding: 12px 16px; max-width: 100%; overflow: hidden; font-size: 14px; line-height: 1.7; }
.message-content.user { background: #111827; color: #fff; }
.message-content.assistant { background: #f9fafb; color: #111827; }
.message-actions { display: flex; gap: 4px; margin-top: 8px; }
.msg-action-btn { padding: 6px; border: none; background: none; color: #9ca3af; border-radius: 6px; transition: all 0.15s; }
.msg-action-btn:hover { background: #f3f4f6; color: #6b7280; }
.msg-action-btn.copied { color: #22c55e; }

/* Attachments */
.msg-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.msg-attachment { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(255,255,255,0.1); border-radius: 8px; font-size: 12px; }
.message.user .msg-attachment { background: rgba(255,255,255,0.1); color: #e5e7eb; }
.message.assistant .msg-attachment { background: #f1f5f9; color: #6b7280; border: 1px solid #e5e7eb; }

/* Markdown */
.md-content h1, .md-content h2, .md-content h3 { font-weight: 600; margin: 16px 0 8px; }
.md-content h1 { font-size: 1.4em; }
.md-content h2 { font-size: 1.2em; }
.md-content h3 { font-size: 1.05em; }
.md-content p { margin-bottom: 12px; }
.md-content ul, .md-content ol { padding-left: 1.5em; margin-bottom: 12px; }
.md-content li { margin-bottom: 4px; }
.md-content pre { background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: 8px; overflow-x: auto; margin: 12px 0; font-size: 13px; line-height: 1.5; }
.md-content code { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 0.9em; }
.md-content :not(pre) > code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }
.md-content blockquote { border-left: 3px solid #e5e7eb; padding-left: 12px; color: #6b7280; margin: 12px 0; }
.md-content table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; }
.md-content th, .md-content td { border: 1px solid #e5e7eb; padding: 8px 12px; text-align: left; }
.md-content th { background: #f9fafb; font-weight: 600; }
.md-content a { color: #0ea5e9; }
.md-content strong { font-weight: 600; }
.md-content hr { border: none; border-top: 1px solid #e5e7eb; margin: 16px 0; }

/* Typing indicator */
.typing-indicator { display: flex; gap: 4px; padding: 4px 0; }
.typing-dot { width: 6px; height: 6px; background: #9ca3af; border-radius: 50%; animation: dotPulse 1.4s infinite ease-in-out; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

/* Composer */
.composer { border-top: 1px solid #f1f5f9; background: #fff; padding: 16px; }
.composer-inner { max-width: 768px; margin: 0 auto; }
.composer-files { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 13px; }
.file-chip-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #374151; }
.file-chip-size { color: #9ca3af; font-size: 11px; }
.file-chip-remove { padding: 2px; border: none; background: none; color: #9ca3af; border-radius: 4px; opacity: 0; transition: opacity 0.15s; }
.file-chip:hover .file-chip-remove { opacity: 1; }
.file-chip-remove:hover { color: #ef4444; }

.composer-box { display: flex; align-items: flex-end; gap: 8px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; padding: 4px; transition: border-color 0.15s, box-shadow 0.15s; }
.composer-box:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.composer-attach { padding: 10px; border: none; background: none; color: #9ca3af; border-radius: 8px; transition: color 0.15s; }
.composer-attach:hover { color: #6b7280; }
.composer-textarea { flex: 1; padding: 10px 4px; border: none; background: none; resize: none; outline: none; font-size: 14px; line-height: 1.5; min-height: 24px; max-height: 200px; color: #111827; }
.composer-textarea::placeholder { color: #9ca3af; }
.composer-voice { padding: 10px; border: none; background: none; color: #9ca3af; border-radius: 8px; transition: color 0.15s; }
.composer-voice:hover { color: #6b7280; }
.composer-send { padding: 10px; border: none; border-radius: 8px; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.composer-send.active { background: #3b82f6; color: #fff; }
.composer-send.active:hover { background: #2563eb; }
.composer-send.disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
.composer-send.stop { background: #ef4444; color: #fff; }
.composer-send.stop:hover { background: #dc2626; }
.composer-hint { text-align: center; font-size: 11px; color: #9ca3af; margin-top: 8px; }

/* File input hidden */
.hidden-input { display: none; }

/* Pages */
.page { min-height: 100vh; background: #f9fafb; display: flex; flex-direction: column; }
.page-header { height: 56px; background: #fff; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; padding: 0 16px; gap: 12px; }
.page-back { padding: 8px; border: none; background: none; color: #6b7280; border-radius: 8px; }
.page-back:hover { background: #f3f4f6; }
.page-title { font-size: 16px; font-weight: 600; color: #111827; }
.page-body { flex: 1; padding: 32px 16px; max-width: 960px; margin: 0 auto; width: 100%; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f9fafb; padding: 16px; }
.login-card { width: 100%; max-width: 400px; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-icon { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 14px; background: linear-gradient(135deg, #3b82f6, #2563eb); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3); }
.login-logo-icon svg { width: 32px; height: 32px; color: #fff; }
.login-logo h1 { font-size: 24px; font-weight: 700; color: #111827; }
.login-logo p { color: #9ca3af; margin-top: 4px; }
.login-form-card { background: #fff; border-radius: 16px; border: 1px solid #f1f5f9; padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.login-form-card h2 { font-size: 18px; font-weight: 600; color: #111827; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 14px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.form-input:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.form-btn { width: 100%; padding: 10px; border: none; border-radius: 8px; background: #3b82f6; color: #fff; font-size: 14px; font-weight: 500; transition: background 0.15s; }
.form-btn:hover { background: #2563eb; }
.form-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.form-link { text-align: center; margin-top: 16px; font-size: 13px; color: #9ca3af; }
.form-link button { border: none; background: none; color: #3b82f6; font-size: 13px; font-weight: 500; }
.form-link button:hover { text-decoration: underline; }
.form-error { padding: 10px 14px; border-radius: 8px; background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; font-size: 13px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.form-error-close { border: none; background: none; color: #f87171; font-size: 16px; }
.skip-login { text-align: center; margin-top: 16px; }
.skip-login button { border: none; background: none; color: #9ca3af; font-size: 13px; }
.skip-login button:hover { color: #374151; }

/* Settings */
.settings-layout { display: flex; flex: 1; }
.settings-nav { width: 240px; border-right: 1px solid #f1f5f9; background: #fff; padding: 24px 16px; flex-shrink: 0; }
.settings-nav h3 { font-size: 18px; font-weight: 600; color: #111827; margin-bottom: 16px; }
.settings-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: none; background: none; font-size: 13px; color: #6b7280; border-radius: 8px; text-align: left; transition: all 0.12s; }
.settings-nav-item:hover { background: #f9fafb; }
.settings-nav-item.active { background: #f3f4f6; color: #111827; font-weight: 500; }
.settings-content { flex: 1; padding: 32px; max-width: 600px; }
.settings-content h3 { font-size: 18px; font-weight: 600; color: #111827; margin-bottom: 24px; }

/* Usage */
.usage-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 24px; }
.usage-card { background: #fff; border-radius: 16px; border: 1px solid #f1f5f9; padding: 24px; }
.usage-card-label { font-size: 13px; color: #9ca3af; margin-bottom: 8px; }
.usage-card-value { display: flex; align-items: baseline; gap: 8px; }
.usage-card-number { font-size: 32px; font-weight: 700; color: #111827; }
.usage-card-total { color: #9ca3af; font-size: 14px; }
.usage-card-bar { margin-top: 12px; height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.usage-card-fill { height: 100%; background: #3b82f6; border-radius: 4px; transition: width 0.3s; }
.plan-badge { display: inline-flex; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 500; background: #dbeafe; color: #2563eb; }

/* Billing */
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.plan-card { background: #fff; border-radius: 16px; border: 1px solid #f1f5f9; padding: 28px; display: flex; flex-direction: column; position: relative; }
.plan-card.popular { border-color: #3b82f6; box-shadow: 0 0 0 1px #3b82f6; }
.plan-popular-badge { position: absolute; top: -10px; left: 24px; padding: 3px 12px; background: #3b82f6; color: #fff; font-size: 11px; font-weight: 600; border-radius: 20px; }
.plan-card h3 { font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 8px; }
.plan-price { margin-bottom: 20px; }
.plan-price .amount { font-size: 36px; font-weight: 700; color: #111827; }
.plan-price .period { color: #9ca3af; font-size: 14px; }
.plan-features { list-style: none; padding: 0; margin-bottom: 24px; flex: 1; }
.plan-features li { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; font-size: 13px; color: #6b7280; }
.plan-features li::before { content: ''; display: block; width: 16px; height: 16px; margin-top: 2px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2322c55e'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 13l4 4L19 7'/%3E%3C/svg%3E") no-repeat center; background-size: contain; flex-shrink: 0; }
.plan-btn { width: 100%; padding: 10px; border: none; border-radius: 10px; font-size: 14px; font-weight: 500; transition: all 0.15s; }
.plan-btn.primary { background: #3b82f6; color: #fff; }
.plan-btn.primary:hover { background: #2563eb; }
.plan-btn.secondary { background: #f3f4f6; color: #374151; }
.plan-btn.secondary:hover { background: #e5e7eb; }
.plan-btn.current { background: #f3f4f6; color: #9ca3af; cursor: not-allowed; }

/* Shortcuts */
.shortcut-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.shortcut-desc { font-size: 14px; color: #374151; }
.shortcut-key { padding: 4px 10px; background: #f3f4f6; border-radius: 6px; font-size: 12px; font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; color: #6b7280; }

/* Overlay */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.2); z-index: 40; }

/* Responsive */
@media (max-width: 1024px) {
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .sidebar-overlay.visible { display: block; }
  .settings-nav { display: none; }
}
@media (max-width: 640px) {
  .header-title { font-size: 13px; }
  .model-trigger .tag { display: none; }
  .model-dropdown { width: calc(100vw - 32px); right: -60px; }
  .welcome h2 { font-size: 22px; }
  .quick-actions { gap: 6px; }
  .quick-action { padding: 8px 12px; font-size: 12px; }
}

/* Toggle switch */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.toggle-label { font-size: 14px; color: #374151; }
.toggle-desc { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #d1d5db; border-radius: 12px; cursor: pointer; transition: background 0.2s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.toggle input:checked + .toggle-slider { background: #3b82f6; }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Section card */
.section-card { background: #fff; border-radius: 16px; border: 1px solid #f1f5f9; padding: 24px; margin-bottom: 20px; }
.section-card h4 { font-size: 15px; font-weight: 600; color: #111827; margin-bottom: 16px; }
.section-card p { font-size: 13px; color: #6b7280; line-height: 1.6; }
.section-card .tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.section-card .tag-chip { padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.section-card .tag-chip.purple { background: #f3e8ff; color: #7c3aed; }
.section-card .tag-chip.blue { background: #dbeafe; color: #2563eb; }
.section-card .tag-chip.green { background: #dcfce7; color: #16a34a; }

/* Data list */
.data-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.data-row:last-child { border-bottom: none; }
.data-label { font-size: 14px; color: #374151; }
.data-value { font-size: 13px; color: #6b7280; }

/* API Key */
.api-key-box { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; font-family: monospace; font-size: 13px; color: #6b7280; }
.api-key-box .key-mask { flex: 1; }

/* Agent card */
.agent-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.agent-card { background: #fff; border-radius: 16px; border: 1px solid #f1f5f9; padding: 24px; cursor: pointer; transition: all 0.15s; }
.agent-card:hover { border-color: #93c5fd; box-shadow: 0 2px 12px rgba(59, 130, 246, 0.08); }
.agent-card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 20px; }
.agent-card h4 { font-size: 15px; font-weight: 600; color: #111827; margin-bottom: 6px; }
.agent-card p { font-size: 13px; color: #9ca3af; line-height: 1.4; }
.agent-card .agent-badge { display: inline-block; margin-top: 12px; padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 500; }
.agent-card .agent-badge.active { background: #dcfce7; color: #16a34a; }
.agent-card .agent-badge.beta { background: #fef3c7; color: #d97706; }

/* Transactions */
.tx-table { width: 100%; border-collapse: collapse; }
.tx-table th, .tx-table td { padding: 12px 16px; text-align: left; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
.tx-table th { color: #9ca3af; font-weight: 500; background: #f9fafb; }
.tx-table td { color: #374151; }
.tx-status { display: inline-flex; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.tx-status.paid { background: #dcfce7; color: #16a34a; }
.tx-status.pending { background: #fef3c7; color: #d97706; }
.tx-status.cancelled { background: #f3f4f6; color: #9ca3af; }

/* Animations */
.fade-in { animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
