/* ════ THEMES ════ */
:root {
  --bg: #f5f4f0; --surface: #ffffff; --surface2: #faf9f6;
  --border: #e4e2db; --border-strong: #ccc9bf;
  --text: #181714; --muted: #918f89; --muted2: #b8b5ae;
  --accent: #181714; --accent-hover: #333128;
  --danger: #b83232; --danger-hover: #991f1f;
  --user-bg: #181714; --user-text: #f5f4f0;
  --code-bg: #1e1e1e; --code-text: #d4d4d4;
  --sidebar-w: 256px; --radius: 6px;
}
[data-theme="dark"] {
  --bg: #111110; --surface: #1a1917; --surface2: #1f1e1c;
  --border: #2a2926; --border-strong: #3a3835;
  --text: #f0ede8; --muted: #7a7874; --muted2: #5a5855;
  --accent: #f0ede8; --accent-hover: #d4d0c8;
  --danger: #e05555; --danger-hover: #c43d3d;
  --user-bg: #2a2926; --user-text: #f0ede8;
  --code-bg: #0d0d0c; --code-text: #d4d4d4;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: 'Figtree', sans-serif; overflow: hidden; font-size: 14px; transition: background 0.2s, color 0.2s; }

/* ════ ICONS ════ */
.icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }

/* ════ AUTH ════ */
#auth-screen { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: flex-start; justify-content: center; z-index: 100; overflow-y: auto; }
.auth-wrap { width: 100%; max-width: 480px; padding: 0 24px 60px; display: flex; flex-direction: column; align-items: center; }

/* ── Navbar ── */
.landing-nav { position: sticky; top: 0; z-index: 50; width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 14px 0 20px; background: var(--bg); }
.nav-logo { display: flex; align-items: center; gap: 8px; }
.nav-logo img { width: 28px; height: 28px; object-fit: contain; }
.nav-logo span { font-size: 16px; font-weight: 600; letter-spacing: -0.3px; }
.nav-btns { display: flex; align-items: center; gap: 8px; }
.nav-btn { padding: 7px 14px; border-radius: 6px; font-family: 'Figtree', sans-serif; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.15s; border: none; }
.nav-btn.secondary { background: none; border: 1px solid var(--border); color: var(--muted); }
.nav-btn.secondary:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn.primary { background: var(--accent); color: var(--bg); }
.nav-btn.primary:hover { background: var(--accent-hover); }

/* ── Lang Dropdown ── */
.lang-dropdown-wrap { position: relative; }
.lang-dropdown-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px; background: none;
  border: 1px solid var(--border); border-radius: 6px;
  font-family: 'Figtree', sans-serif; font-size: 12px; font-weight: 500;
  color: var(--muted); cursor: pointer; transition: all 0.15s;
}
.lang-dropdown-btn:hover { border-color: var(--accent); color: var(--accent); }
.lang-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1); min-width: 120px; z-index: 999;
}
.lang-dropdown-menu.open { display: block; }
.lang-option {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background 0.1s; color: var(--muted);
}
.lang-option:hover { background: var(--bg); color: var(--text); }
.lang-option.active { color: var(--text); font-weight: 600; }
.lang-option .lang-flag { font-size: 14px; }

/* ── Hero ── */
.landing-hero { text-align: center; margin-bottom: 36px; width: 100%; }
.landing-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; font-size: 11px; color: var(--muted); margin-bottom: 20px; }
.landing-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
.landing-title { font-size: 40px; font-weight: 600; letter-spacing: -1.5px; line-height: 1.1; margin-bottom: 14px; }
.landing-subtitle { font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 24px; }
.trial-badge { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg,#22c55e15,#16a34a10); border: 1px solid #22c55e40; border-radius: 8px; padding: 10px 16px; font-size: 13px; font-weight: 500; color: #16a34a; }
[data-theme="dark"] .trial-badge { color: #4ade80; }

/* ── Features ── */
.landing-features { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }
.feature-item { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.feature-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--muted); }
.feature-text h4 { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.feature-text p { font-size: 11px; color: var(--muted); line-height: 1.5; }

/* ── Pricing ── */
.landing-pricing { width: 100%; margin-bottom: 28px; }
.pricing-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pricing-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.pricing-name { font-size: 13px; font-weight: 600; }
.pricing-price { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.pricing-price span { font-size: 13px; font-weight: 400; color: var(--muted); }
.pricing-features { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.pricing-feature { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.pricing-feature svg { color: #22c55e; flex-shrink: 0; }
.pricing-trial { margin: 0 20px 16px; background: #22c55e18; border: 1px solid #22c55e35; border-radius: 6px; padding: 10px 14px; font-size: 12px; color: #16a34a; text-align: center; font-weight: 500; }
[data-theme="dark"] .pricing-trial { color: #4ade80; }

/* ── Section Divider ── */
.section-divider { width: 100%; display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.section-divider-line { flex: 1; height: 1px; background: var(--border); }
.section-divider-text { font-size: 11px; color: var(--muted2); white-space: nowrap; }

/* ── Auth Card ── */
.landing-auth { width: 100%; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.auth-tabs { display: flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 22px; }
.auth-tab { flex: 1; padding: 9px; font-family: 'Figtree', sans-serif; font-size: 12px; font-weight: 500; background: none; border: none; cursor: pointer; color: var(--muted); transition: all 0.15s; }
.auth-tab.active { background: var(--accent); color: var(--bg); }
.form-row { display: flex; gap: 10px; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; flex: 1; }
.form-group label { font-size: 11px; color: var(--muted); font-weight: 500; }
.form-group input { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 9px 11px; font-family: 'Figtree', sans-serif; font-size: 16px; color: var(--text); outline: none; transition: border-color 0.15s; width: 100%; }
.form-group input:focus { border-color: var(--accent); }
.auth-btn { width: 100%; background: var(--accent); color: var(--bg); border: none; border-radius: 4px; padding: 11px; font-family: 'Figtree', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 6px; transition: background 0.15s; }
.auth-btn:hover { background: var(--accent-hover); }
.auth-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.auth-error { font-size: 11px; color: var(--danger); margin-top: 10px; min-height: 16px; text-align: center; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0 2px; font-size: 11px; color: var(--muted2); }
.auth-divider-line { flex: 1; height: 1px; background: var(--border); }
.google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 10px; margin-top: 12px; font-family: 'Figtree', sans-serif; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; transition: all 0.15s; }
.google-btn:hover { border-color: var(--border-strong); background: var(--bg); }
.forgot-link { font-size: 11px; color: var(--muted); display: block; cursor: pointer; background: none; border: none; font-family: 'Figtree', sans-serif; transition: color 0.15s; width: 100%; text-align: right; padding: 0; margin-top: 4px; }
.forgot-link:hover { color: var(--accent); }
.terms-check { display: flex; align-items: flex-start; gap: 9px; margin-top: 10px; margin-bottom: 4px; }
.terms-check input[type=checkbox] { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; cursor: pointer; }
.terms-check label { font-size: 11px; color: var(--muted); line-height: 1.5; cursor: pointer; }
.terms-check a { color: var(--text); text-decoration: underline; cursor: pointer; }

/* ── Landing Footer ── */
.landing-footer { width: 100%; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 24px 0 8px; flex-wrap: wrap; }
.landing-footer a { font-size: 11px; color: var(--muted2); text-decoration: none; transition: color 0.15s; cursor: pointer; }
.landing-footer a:hover { color: var(--text); }
.landing-footer-dot { font-size: 11px; color: var(--border-strong); }

/* ════ PAYWALL ════ */
#paywall-screen { display: none; position: fixed; inset: 0; background: var(--bg); z-index: 90; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
#paywall-screen.visible { display: flex; }
.paywall-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px 28px; max-width: 400px; width: 100%; text-align: center; }
.paywall-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; color: var(--muted); }
.paywall-title { font-size: 20px; font-weight: 600; letter-spacing: -0.5px; margin-bottom: 8px; }
.paywall-sub { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 24px; }
.paywall-price { font-size: 32px; font-weight: 700; letter-spacing: -1px; margin-bottom: 4px; }
.paywall-price span { font-size: 14px; font-weight: 400; color: var(--muted); }
.paywall-btn { width: 100%; background: var(--accent); color: var(--bg); border: none; border-radius: 6px; padding: 13px; font-family: 'Figtree', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 20px; margin-bottom: 12px; transition: background 0.15s; }
.paywall-btn:hover { background: var(--accent-hover); }
.paywall-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.paywall-logout { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--muted); font-family: 'Figtree', sans-serif; transition: color 0.15s; }
.paywall-logout:hover { color: var(--danger); }
.paywall-features { text-align: left; margin: 20px 0; display: flex; flex-direction: column; gap: 9px; }
.paywall-feature { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.paywall-feature svg { color: #22c55e; flex-shrink: 0; }

/* ════ APP ════ */
#app-screen { display: none; height: 100vh; position: relative; }
#app-screen.visible { display: flex; }

/* Mobile header */
#mobile-header { display: none; align-items: center; gap: 10px; padding: 11px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 20; flex-shrink: 0; }
.hamburger-btn { width: 34px; height: 34px; background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--text); transition: background 0.15s; flex-shrink: 0; }
.hamburger-btn:hover { background: var(--bg); }
.mobile-logo-wrap { display: flex; align-items: center; gap: 8px; flex: 1; }
.mobile-logo-img { width: 24px; height: 24px; object-fit: contain; }
.mobile-logo-text { font-size: 16px; font-weight: 600; letter-spacing: -0.3px; }
.mobile-new-chat { width: 32px; height: 32px; background: none; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; transition: all 0.15s; flex-shrink: 0; }
.mobile-new-chat:hover { border-color: var(--accent); color: var(--accent); }
#sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 29; }
#sidebar-overlay.visible { display: block; }

/* ── Sidebar ── */
#sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; transition: transform 0.25s ease; z-index: 30; }
.sidebar-top { padding: 15px 14px 13px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-logo-wrap { display: flex; align-items: center; gap: 8px; }
.sidebar-logo-img { width: 24px; height: 24px; object-fit: contain; }
.sidebar-logo-text { font-size: 16px; font-weight: 600; letter-spacing: -0.3px; }
.new-chat-btn { display: flex; align-items: center; gap: 5px; padding: 6px 10px; background: none; border: 1px solid var(--border); border-radius: 4px; font-family: 'Figtree', sans-serif; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.new-chat-btn:hover { border-color: var(--accent); color: var(--accent); }
.sidebar-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted2); padding: 13px 14px 5px; }
#chat-list { flex: 1; overflow-y: auto; padding: 0 6px 8px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.chat-item { display: flex; align-items: center; border-radius: 4px; cursor: pointer; transition: background 0.1s; position: relative; }
.chat-item:hover { background: var(--bg); }
.chat-item.active { background: var(--bg); }
.chat-item-title { flex: 1; padding: 8px 6px 8px 10px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.chat-item.active .chat-item-title { color: var(--text); font-weight: 500; }
.chat-item:hover .chat-item-title { color: var(--text); }
.chat-menu-btn { width: 26px; height: 26px; flex-shrink: 0; background: none; border: none; cursor: pointer; color: var(--muted2); border-radius: 3px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s, background 0.15s; margin-right: 4px; }
.chat-item:hover .chat-menu-btn { opacity: 1; }
.chat-menu-btn:hover { background: var(--border); color: var(--text); }
.chat-ctx-menu { position: absolute; right: 4px; top: calc(100% + 2px); background: var(--surface); border: 1px solid var(--border); border-radius: 5px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); z-index: 50; min-width: 130px; overflow: hidden; }
.chat-ctx-item { padding: 9px 13px; font-size: 12px; font-weight: 500; cursor: pointer; transition: background 0.1s; display: flex; align-items: center; gap: 8px; color: var(--danger); }
.chat-ctx-item:hover { background: var(--bg); }

/* Trial countdown */
.trial-countdown { margin: 0 6px 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 9px 12px; display: none; }
.trial-countdown.visible { display: block; }
.trial-countdown-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted2); margin-bottom: 4px; font-weight: 600; }
.trial-countdown-time { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; color: var(--text); }
.trial-countdown-time.urgent { color: var(--danger); }
.trial-countdown-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: 7px; overflow: hidden; }
.trial-countdown-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 1s linear; }
.trial-countdown-fill.urgent { background: var(--danger); }

/* Sidebar footer */
.sidebar-footer { border-top: 1px solid var(--border); padding: 11px 14px; }
.user-info { display: flex; align-items: center; gap: 9px; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.user-details { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.settings-btn { background: none; border: none; cursor: pointer; color: var(--muted2); padding: 4px; border-radius: 3px; transition: color 0.15s; line-height: 0; display: flex; align-items: center; }
.settings-btn:hover { color: var(--text); }

/* ── Main ── */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
#messages { flex: 1; overflow-y: auto; padding: 28px 0 16px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.msg-wrap { max-width: 700px; margin: 0 auto; padding: 0 24px; }
.welcome { text-align: center; padding: 64px 0 32px; }
.welcome h2 { font-size: 34px; font-weight: 600; letter-spacing: -1px; margin-bottom: 8px; }
.welcome p { font-size: 13px; color: var(--muted); line-height: 1.7; }
.suggestions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 22px; }
.suggestion-btn { background: var(--surface); border: 1px solid var(--border); color: var(--muted); padding: 7px 13px; border-radius: 20px; font-family: 'Figtree', sans-serif; font-size: 12px; cursor: pointer; transition: all 0.15s; }
.suggestion-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Messages */
.msg { display: flex; flex-direction: column; margin-bottom: 22px; animation: fadeUp 0.2s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.msg-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted2); margin-bottom: 6px; font-weight: 600; }
.msg.user { align-items: flex-end; }
.bubble { font-size: 13.5px; line-height: 1.8; word-break: break-word; }
.msg.user .bubble { background: var(--user-bg); color: var(--user-text); padding: 11px 15px; border-radius: 12px 12px 2px 12px; display: inline-block; max-width: 82%; }
.msg.ai .bubble { color: var(--text); max-width: 100%; }
.bubble p { margin-bottom: 10px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble strong { font-weight: 600; }
.bubble em { font-style: italic; }
.bubble h1, .bubble h2, .bubble h3 { font-weight: 600; margin: 16px 0 8px; }
.bubble h1 { font-size: 20px; } .bubble h2 { font-size: 17px; } .bubble h3 { font-size: 15px; }
.bubble ul, .bubble ol { padding-left: 20px; margin: 8px 0; }
.bubble li { margin-bottom: 4px; }
.bubble code { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: rgba(128,128,128,0.1); padding: 1px 5px; border-radius: 3px; }
.bubble pre { background: var(--code-bg); border-radius: 0 0 6px 6px; padding: 14px 16px; margin: 0 0 10px; overflow-x: auto; }
.bubble pre code { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--code-text); background: none; padding: 0; border-radius: 0; line-height: 1.6; }
.code-header { display: flex; align-items: center; justify-content: space-between; background: #2a2a2a; padding: 7px 14px; border-radius: 6px 6px 0 0; font-size: 10px; color: #888; letter-spacing: 0.04em; font-family: 'JetBrains Mono', monospace; }
.copy-btn { background: none; border: 1px solid #444; color: #888; font-family: 'Figtree', sans-serif; font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 3px; cursor: pointer; transition: all 0.15s; }
.copy-btn:hover { border-color: #888; color: #ccc; }
.bubble blockquote { border-left: 3px solid var(--border-strong); padding-left: 14px; color: var(--muted); margin: 8px 0; }
.bubble hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.file-preview-msg { display: inline-flex; align-items: center; gap: 7px; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 6px 11px; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.typing-dots { display: flex; gap: 4px; padding: 4px 0; align-items: center; }
.typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--muted2); animation: tdot 1.2s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tdot { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ── Input ── */
#input-area { padding: 10px 24px 18px; background: var(--bg); }
.input-inner { max-width: 700px; margin: 0 auto; }
#attachment-preview { display: none; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px 6px 0 0; padding: 7px 12px; font-size: 11px; color: var(--muted); border-bottom: none; }
#attachment-preview.visible { display: flex; }
.attachment-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.remove-attachment { background: none; border: none; cursor: pointer; color: var(--muted2); display: flex; align-items: center; transition: color 0.15s; }
.remove-attachment:hover { color: var(--danger); }
.input-wrapper { display: flex; gap: 8px; align-items: flex-end; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; transition: border-color 0.15s; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
#attachment-preview.visible + .input-wrapper { border-radius: 0 0 6px 6px; }
.input-wrapper:focus-within { border-color: var(--border-strong); }
.upload-btn { background: none; border: none; cursor: pointer; color: var(--muted2); padding: 2px; transition: color 0.15s; flex-shrink: 0; line-height: 0; display: flex; align-items: center; }
.upload-btn:hover { color: var(--accent); }
#user-input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-family: 'Figtree', sans-serif; font-size: 16px; line-height: 1.6; resize: none; max-height: 160px; min-height: 22px; }
#user-input::placeholder { color: var(--muted2); }
#send-btn { width: 32px; height: 32px; border-radius: 5px; background: var(--accent); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.15s; }
#send-btn:hover { background: var(--accent-hover); }
#send-btn:disabled { opacity: 0.3; cursor: not-allowed; }
#send-btn svg { width: 14px; height: 14px; fill: var(--bg); stroke: none; }
.footer-note { font-size: 10px; color: var(--muted2); text-align: center; margin-top: 8px; }
#file-input { display: none; }

/* ════ MODALS ════ */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.visible { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px; width: 100%; max-width: 380px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); animation: modalIn 0.18s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.modal p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-btn { padding: 8px 16px; border-radius: 4px; font-family: 'Figtree', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all 0.15s; }
.modal-btn.secondary { background: none; border: 1px solid var(--border); color: var(--muted); }
.modal-btn.secondary:hover { border-color: var(--border-strong); color: var(--text); }
.modal-btn.danger { background: var(--danger); color: #fff; }
.modal-btn.danger:hover { background: var(--danger-hover); }

/* ── Settings Modal ── */
.settings-modal { max-width: 340px; }
.settings-title { font-size: 15px; font-weight: 600; margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; }
.settings-close { background: none; border: none; cursor: pointer; color: var(--muted); display: flex; align-items: center; border-radius: 3px; padding: 2px; transition: color 0.15s; }
.settings-close:hover { color: var(--text); }
.settings-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer; transition: color 0.15s; }
.settings-item:last-child { border-bottom: none; }
.settings-item-icon { color: var(--muted); display: flex; align-items: center; flex-shrink: 0; }
.settings-item-label { flex: 1; font-size: 13px; font-weight: 500; }
.settings-item-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.settings-item.danger .settings-item-label { color: var(--danger); }
.settings-item.danger .settings-item-icon { color: var(--danger); }
.settings-item:hover .settings-item-label { color: var(--text); }
.settings-item.danger:hover .settings-item-label { color: var(--danger-hover); }
.toggle { position: relative; width: 36px; height: 20px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border-strong); border-radius: 20px; transition: background 0.2s; cursor: pointer; }
.toggle-slider::before { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }
.lang-switch { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 3px; }
.lang-btn { padding: 4px 10px; border-radius: 3px; border: none; font-family: 'Figtree', sans-serif; font-size: 11px; font-weight: 500; cursor: pointer; transition: all 0.15s; background: none; color: var(--muted); }
.lang-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.pw-form { padding: 12px 0 4px; }
.pw-form .form-group { margin-bottom: 10px; }
.pw-form .form-group input { font-size: 13px; padding: 8px 10px; }
.pw-save-btn { width: 100%; background: var(--accent); color: var(--bg); border: none; border-radius: 4px; padding: 9px; font-family: 'Figtree', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s; margin-top: 4px; }
.pw-save-btn:hover { background: var(--accent-hover); }
.pw-msg { font-size: 11px; margin-top: 8px; min-height: 16px; text-align: center; }

/* ════ LEGAL ════ */
.legal-page { display: none; position: fixed; inset: 0; background: var(--bg); z-index: 10000; overflow-y: auto; font-family: 'Figtree', sans-serif; }
.legal-inner { max-width: 720px; margin: 0 auto; padding: 40px 24px 80px; }
.legal-back { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; color: var(--muted); font-family: 'Figtree', sans-serif; font-size: 13px; margin-bottom: 32px; padding: 0; transition: color 0.15s; }
.legal-back:hover { color: var(--text); }
.legal-title { font-size: 28px; font-weight: 700; letter-spacing: -0.8px; margin-bottom: 6px; }
.legal-date { font-size: 12px; color: var(--muted); margin-bottom: 36px; }
.legal-inner h2 { font-size: 15px; font-weight: 600; margin: 28px 0 8px; padding-top: 20px; border-top: 1px solid var(--border); }
.legal-inner h2:first-of-type { border-top: none; padding-top: 0; }
.legal-inner p { font-size: 13px; color: var(--muted); line-height: 1.8; margin-bottom: 10px; }
.legal-inner ul { padding-left: 20px; margin-bottom: 10px; }
.legal-inner li { font-size: 13px; color: var(--muted); line-height: 1.8; margin-bottom: 4px; }
.legal-inner a { color: var(--text); }
.legal-inner strong { color: var(--text); font-weight: 600; }

/* ════ RESPONSIVE ════ */
@media (max-width: 640px) {
  #mobile-header { display: flex; }
  #app-screen.visible { flex-direction: column; }
  #sidebar { position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%); box-shadow: 4px 0 24px rgba(0,0,0,0.12); }
  #sidebar.open { transform: translateX(0); }
  .sidebar-top { padding-top: 20px; }
  #main { flex: 1; min-height: 0; }
  .msg-wrap { padding: 0 16px; }
  #input-area { padding: 8px 16px 16px; }
  .welcome { padding: 40px 0 24px; }
  .welcome h2 { font-size: 26px; }
  .landing-title { font-size: 30px; }
}