
/* ==================== RESET & VARIABLES ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-1: #0a0a0f;
    --bg-2: #12121a;
    --bg-3: #1a1a25;
    --bg-4: #252535;
    --text-1: #f1f5f9;
    --text-2: #cbd5e1;
    --text-3: #64748b;
    --border: #2a2a3a;
    --primary: #6366f1;
    --primary-2: #8b5cf6;
    --primary-3: #a855f7;
    --gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7, #ec4899);
    --gradient-btn: linear-gradient(135deg, #6366f1, #8b5cf6);
    --shadow-1: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-2: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-3: 0 8px 24px rgba(0,0,0,0.5);
    --radius-1: 8px;
    --radius-2: 12px;
    --radius-3: 16px;
    --radius-4: 20px;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

[data-theme="light"] {
    --bg-1: #ffffff;
    --bg-2: #f8fafc;
    --bg-3: #f1f5f9;
    --bg-4: #e2e8f0;
    --text-1: #0f172a;
    --text-2: #475569;
    --text-3: #94a3b8;
    --border: #e2e8f0;
    --shadow-1: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-2: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-3: 0 8px 24px rgba(0,0,0,0.12);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-1);
    color: var(--text-1);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-3); border-radius: 10px; }

.app {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    width: 280px;
    min-width: 280px;
    height: 100%;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 100;
}

.sidebar.hide {
    margin-left: -280px;
}

.sidebar-top {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.btn-new-chat {
    width: 100%;
    padding: 14px;
    background: var(--gradient-btn);
    border: none;
    border-radius: var(--radius-2);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

.btn-new-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
}

.sidebar-search {
    padding: 12px 16px;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    font-size: 13px;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-2);
    color: var(--text-1);
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.search-box input::placeholder {
    color: var(--text-3);
}

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

.chat-list-title {
    padding: 10px 12px 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-bottom: 2px;
    border-radius: var(--radius-2);
    cursor: pointer;
    transition: all 0.2s;
}

.chat-item:hover {
    background: var(--bg-4);
}

.chat-item.active {
    background: var(--gradient-btn);
    color: white;
}

.chat-item i {
    font-size: 14px;
    opacity: 0.7;
}

.chat-item span {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item button {
    opacity: 0;
    padding: 5px;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    border-radius: var(--radius-1);
    transition: all 0.2s;
}

.chat-item:hover button {
    opacity: 0.7;
}

.chat-item button:hover {
    opacity: 1;
    background: rgba(239,68,68,0.2);
    color: var(--error);
}

.empty-list {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-3);
}

.empty-list i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-list p {
    font-size: 13px;
}

.sidebar-contact {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.contact-dev-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #0088cc, #00aaff);
    border-radius: var(--radius-2);
    text-decoration: none;
    color: white;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.contact-dev-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,136,204,0.4);
}

.contact-dev-btn i:first-child {
    font-size: 18px;
}

.contact-dev-btn span {
    flex: 1;
}

.contact-dev-btn i:last-child {
    font-size: 11px;
    opacity: 0.7;
}

.sidebar-bottom {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.owner-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-3);
    border-radius: var(--radius-2);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.owner-profile:hover {
    background: var(--bg-4);
    transform: translateY(-1px);
}

.owner-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-2);
    background: var(--gradient-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.owner-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.owner-avatar span {
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.owner-details {
    flex: 1;
    min-width: 0;
}

.owner-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.owner-role {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-3);
}

.owner-role i {
    color: #fbbf24;
    font-size: 10px;
}

.owner-profile > i {
    color: var(--text-3);
    font-size: 12px;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    min-height: 64px;
    gap: 12px;
    flex-shrink: 0;
}

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

.btn-menu {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-1);
    cursor: pointer;
    border-radius: var(--radius-2);
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-menu:hover {
    background: var(--bg-3);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-2);
    object-fit: cover;
    box-shadow: var(--shadow-1);
    flex-shrink: 0;
}

.brand-logo-fallback {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-2);
    background: var(--gradient-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.brand-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-size: 16px;
    font-weight: 800;
    background: var(--gradient);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientMove 4s linear infinite;
    white-space: nowrap;
    line-height: 1.2;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.brand-tagline {
    font-size: 10px;
    color: var(--text-3);
    font-weight: 500;
    white-space: nowrap;
}

.header-center {
    display: flex;
    justify-content: center;
}

.model-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
}

.model-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-2);
    cursor: pointer;
    border-radius: var(--radius-2);
    font-size: 15px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-3);
    color: var(--primary);
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
}

.chat-content {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

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

.welcome-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-3);
    animation: float 3s ease-in-out infinite;
}

.welcome-logo-fb {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--gradient-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.welcome-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    background: var(--gradient);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientMove 4s linear infinite;
}

.welcome-text {
    font-size: 14px;
    color: var(--text-2);
    max-width: 400px;
    margin-bottom: 30px;
}

.suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 550px;
}

.suggestion {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-3);
    cursor: pointer;
    text-align: left;
    transition: all 0.3s;
}

.suggestion:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

.suggestion i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-btn);
    border-radius: var(--radius-2);
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.suggestion div {
    flex: 1;
    min-width: 0;
}

.suggestion strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-1);
}

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

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: msgIn 0.3s ease;
}

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

.message-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}

.message.user .message-avatar {
    background: var(--gradient-btn);
    color: white;
}

.message.ai .message-avatar {
    background: var(--bg-3);
}

.message.ai .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.message-name {
    font-size: 13px;
    font-weight: 600;
}

.message-time {
    font-size: 11px;
    color: var(--text-3);
}

.message-text {
    padding: 12px 16px;
    border-radius: var(--radius-3);
    font-size: 14px;
    line-height: 1.7;
    word-wrap: break-word;
}

.message.user .message-text {
    background: var(--gradient-btn);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.ai .message-text {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.message-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

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

.msg-btn {
    padding: 5px 10px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-1);
    color: var(--text-2);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.msg-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.message-text pre {
    margin: 10px 0;
    border-radius: var(--radius-2);
    overflow: hidden;
    background: #1e1e2e;
}

.code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #2d2d40;
}

.code-head span {
    font-size: 11px;
    color: #a0a0b5;
    text-transform: uppercase;
}

.code-head button {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid #4d4d65;
    border-radius: var(--radius-1);
    color: #a0a0b5;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.code-head button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.message-text pre code {
    display: block;
    padding: 12px;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.message-text code:not(pre code) {
    background: rgba(99,102,241,0.15);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
}

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

.message-text h1, .message-text h2, .message-text h3 {
    margin: 14px 0 6px;
    font-weight: 700;
}
.message-text h1 { font-size: 1.3em; }
.message-text h2 { font-size: 1.2em; }
.message-text h3 { font-size: 1.1em; }
.message-text p { margin: 6px 0; }
.message-text ul, .message-text ol { margin: 8px 0; padding-left: 20px; }
.message-text li { margin: 4px 0; }
.message-text blockquote {
    margin: 10px 0;
    padding: 10px 14px;
    background: rgba(99,102,241,0.1);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-1) var(--radius-1) 0;
}
.message-text table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.message-text th, .message-text td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; }
.message-text th { background: var(--bg-3); font-weight: 600; }
.message-text a { color: var(--primary); text-decoration: none; }
.message-text a:hover { text-decoration: underline; }
.message-text hr { border: none; height: 1px; background: var(--border); margin: 14px 0; }

.typing {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: msgIn 0.3s ease;
}

.typing-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-3);
}

.typing-brain {
    font-size: 20px;
    animation: brainPulse 1.5s ease-in-out infinite;
}

@keyframes brainPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: dotBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.typing-label {
    font-size: 12px;
    color: var(--text-2);
}

.error-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius-2);
    color: var(--error);
    font-size: 13px;
}

.error-box i { font-size: 16px; }
.error-box span { flex: 1; }

.error-box button {
    padding: 6px 12px;
    background: var(--error);
    border: none;
    border-radius: var(--radius-1);
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-area {
    padding: 14px 20px 18px;
    background: var(--bg-1);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-box {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-2);
    border: 2px solid var(--border);
    border-radius: var(--radius-4);
    transition: all 0.3s;
}

.input-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.btn-voice {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    border-radius: var(--radius-2);
    font-size: 15px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-voice:hover {
    background: var(--bg-3);
    color: var(--primary);
}

.btn-voice.recording {
    color: var(--error);
    animation: recordPulse 1s infinite;
}

@keyframes recordPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#inputText {
    flex: 1;
    max-height: 130px;
    padding: 8px 4px;
    background: transparent;
    border: none;
    color: var(--text-1);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    outline: none;
}

#inputText::placeholder {
    color: var(--text-3);
}

.btn-send {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-btn);
    border: none;
    border-radius: var(--radius-2);
    color: white;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-3);
}

.input-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.input-footer a:hover {
    text-decoration: underline;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal.open {
    display: flex;
}

.modal-box {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-4);
    max-width: 420px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-3);
    animation: modalIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-2);
    cursor: pointer;
    border-radius: var(--radius-1);
    font-size: 15px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-3);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

.setting {
    margin-bottom: 18px;
}

.setting:last-child {
    margin-bottom: 0;
}

.setting label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.setting p {
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 8px;
}

.slider-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-wrap input {
    flex: 1;
    -webkit-appearance: none;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    cursor: pointer;
}

.slider-wrap input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.slider-wrap span {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    min-width: 30px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-2);
    border-radius: var(--radius-2);
    cursor: pointer;
}

.setting-row:hover {
    background: var(--bg-3);
}

.setting-row div:first-child {
    flex: 1;
}

.setting-row strong {
    display: block;
    font-size: 13px;
    font-weight: 500;
}

.setting-row span {
    font-size: 11px;
    color: var(--text-3);
}

.toggle {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s;
}

.toggle.on {
    background: var(--primary);
}

.toggle::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle.on::after {
    left: 23px;
}

.btn-danger {
    width: 100%;
    padding: 12px;
    background: var(--error);
    border: none;
    border-radius: var(--radius-2);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-danger:hover {
    filter: brightness(1.1);
}

.export-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.export-btn {
    padding: 16px;
    background: var(--bg-2);
    border: 2px solid var(--border);
    border-radius: var(--radius-2);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    color: var(--text-1);
}

.export-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.export-btn i {
    font-size: 22px;
    color: var(--primary);
    margin-bottom: 6px;
}

.export-btn span {
    display: block;
    font-size: 12px;
    font-weight: 500;
}

.toasts {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-2);
    box-shadow: var(--shadow-3);
    animation: toastIn 0.3s ease;
    min-width: 240px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast.warning { border-left: 4px solid var(--warning); }

.toast i {
    font-size: 16px;
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--error); }
.toast.warning i { color: var(--warning); }

.toast span {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

@media (max-width: 900px) {
    .header-center { display: none; }
    .brand-tagline { display: none; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 100;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar.hide {
        transform: translateX(-100%);
        margin-left: 0;
    }
    
    .header { padding: 10px 14px; min-height: 56px; }
    .brand-name { font-size: 14px; }
    .brand-logo, .brand-logo-fallback { width: 32px; height: 32px; }
    .btn-icon, .btn-menu { width: 36px; height: 36px; }
    
    .chat-area { padding: 14px; }
    .welcome { padding: 30px 16px; }
    .welcome-logo, .welcome-logo-fb { width: 60px; height: 60px; }
    .welcome-title { font-size: 22px; }
    .suggestions { grid-template-columns: 1fr; }
    .suggestion { padding: 14px; }
    
    .message { gap: 10px; margin-bottom: 16px; }
    .message-avatar { width: 30px; height: 30px; font-size: 12px; }
    .message-text { padding: 10px 14px; font-size: 13px; }
    
    .input-area { padding: 12px 14px 14px; }
    .input-box { padding: 6px 10px; }
    
    .toasts { left: 14px; right: 14px; bottom: 80px; }
    .toast { min-width: auto; }
}

@media (max-width: 400px) {
    .brand-name { font-size: 12px; }
    .brand-logo, .brand-logo-fallback { width: 28px; height: 28px; }
    .welcome-title { font-size: 18px; }
}