@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&family=Manrope:wght@400;500;600;650;700;750;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #101014;
  --sidebar: #141419;
  --panel: #17171e;
  --panel-2: #1c1c24;
  --panel-3: #22222b;
  --field: #1b1b23;
  --text: #f4f3f8;
  --text-2: #c4c1cc;
  --muted: #85818f;
  --muted-2: #686572;
  --line: rgba(255,255,255,.075);
  --line-strong: rgba(255,255,255,.12);
  --accent: #a68bff;
  --accent-2: #8b6cf0;
  --accent-soft: rgba(151,120,247,.13);
  --teal: #69dfd2;
  --green: #7bd6ad;
  --red: #ed8d9c;
  --shadow: 0 24px 80px rgba(0,0,0,.38);
  --sidebar-width: 278px;
  --radius-lg: 19px;
  --radius-md: 13px;
  font-family: "DM Sans", Inter, ui-sans-serif, system-ui, sans-serif;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7fa;
  --sidebar: #f0eff4;
  --panel: #fff;
  --panel-2: #f5f4f9;
  --panel-3: #eeedf4;
  --field: #f7f6fb;
  --text: #24222d;
  --text-2: #565261;
  --muted: #777382;
  --muted-2: #9692a0;
  --line: rgba(30,25,50,.09);
  --line-strong: rgba(30,25,50,.15);
  --accent: #7556d5;
  --accent-2: #6848cc;
  --accent-soft: rgba(117,86,213,.1);
  --teal: #238e84;
  --green: #237f5a;
  --red: #bf4f64;
  --shadow: 0 24px 80px rgba(35,25,65,.13);
}
* { box-sizing: border-box; }
html, body { width:100%; min-width:320px; min-height:100%; margin:0; background:var(--bg); color:var(--text); }
body { min-height:100dvh; overflow:hidden; font-size:14px; }
button, input, textarea { font:inherit; }
button { color:inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
button:disabled { cursor:not-allowed !important; opacity:.45; }
a { color:inherit; }
svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.hidden { display:none !important; }
.app-frame { display:flex; width:100%; height:100dvh; min-height:0; background:var(--bg); }

/* SIDEBAR */
.sidebar {
  position:relative; z-index:30; display:flex; flex:0 0 var(--sidebar-width); flex-direction:column;
  height:100%; padding:22px 15px 13px; background:var(--sidebar); border-right:1px solid var(--line);
  transition:transform .25s ease, background .2s ease;
}
.sidebar-top { display:flex; align-items:center; justify-content:space-between; padding:0 8px 22px; }
.brand { display:flex; align-items:center; gap:11px; min-width:0; text-decoration:none; }
.brand-mark { width:43px; height:43px; flex:0 0 43px; filter:drop-shadow(0 3px 15px rgba(145,112,244,.2)); }
.brand-copy { display:flex; flex-direction:column; gap:3px; line-height:1; }
.brand-copy strong { font-family:Manrope,sans-serif; font-size:17px; letter-spacing:-.65px; font-weight:800; white-space:nowrap; }
.brand-copy strong span { color:var(--accent); }
.brand-copy small { color:var(--muted); font-size:8px; letter-spacing:1.55px; font-weight:700; white-space:nowrap; }
.icon-button,.tiny-icon-button { display:grid; place-items:center; border:0; background:transparent; color:var(--muted); cursor:pointer; border-radius:10px; transition:background .18s,color .18s; }
.icon-button { width:38px; height:38px; }
.icon-button svg { width:19px; height:19px; }
.icon-button:hover,.tiny-icon-button:hover { color:var(--text); background:var(--panel-3); }
.sidebar-close,.mobile-menu-button { display:none; }
.new-chat-button,.search-button {
  display:flex; align-items:center; gap:11px; width:100%; height:45px; border-radius:12px; padding:0 13px;
  cursor:pointer; text-align:left; transition:all .18s ease;
}
.new-chat-button { background:linear-gradient(110deg,rgba(145,116,241,.2),rgba(102,214,205,.075)); border:1px solid rgba(159,131,250,.27); color:var(--text); font-weight:650; }
.new-chat-button:hover { border-color:rgba(159,131,250,.55); background:linear-gradient(110deg,rgba(145,116,241,.27),rgba(102,214,205,.11)); transform:translateY(-1px); }
.new-chat-button svg { color:var(--accent); }
.new-chat-button kbd,.search-button kbd { margin-left:auto; color:var(--muted-2); background:rgba(255,255,255,.035); border:1px solid var(--line); border-radius:5px; padding:2px 5px; font-size:10px; }
.search-button { margin-top:7px; background:transparent; border:1px solid transparent; color:var(--text-2); }
.search-button:hover { background:var(--panel-2); border-color:var(--line); }
.search-button svg { color:var(--muted); }
.sidebar-section { margin-top:28px; }
.section-label,.history-heading { display:flex; align-items:center; justify-content:space-between; padding:0 10px 9px; color:var(--muted-2); font-size:9px; letter-spacing:1.45px; font-weight:750; }
.side-nav { display:grid; gap:3px; }
.side-nav-item { display:flex; align-items:center; gap:12px; height:39px; width:100%; padding:0 11px; border:1px solid transparent; border-radius:10px; color:var(--text-2); background:transparent; text-align:left; cursor:pointer; }
.side-nav-item svg { width:17px; height:17px; color:var(--muted); }
.side-nav-item:hover { color:var(--text); background:var(--panel-2); }
.side-nav-item.active { background:var(--accent-soft); border-color:rgba(151,120,247,.12); color:var(--text); }
.side-nav-item.active svg { color:var(--accent); }
.history-heading { margin-top:26px; padding-bottom:7px; }
.tiny-icon-button { width:25px; height:25px; }
.tiny-icon-button svg { width:14px; height:14px; }
.chat-history { flex:1; min-height:70px; overflow-y:auto; padding:0 1px 10px; scrollbar-width:thin; scrollbar-color:var(--line-strong) transparent; }
.history-group-label { padding:13px 10px 6px; font-size:10px; color:var(--muted-2); font-weight:650; }
.history-item { display:flex; align-items:center; width:100%; gap:7px; min-height:37px; padding:0 8px 0 11px; border-radius:9px; border:1px solid transparent; background:transparent; text-align:left; cursor:pointer; color:var(--text-2); }
.history-item:hover { background:var(--panel-2); color:var(--text); }
.history-item.active { background:var(--panel-3); color:var(--text); border-color:var(--line); }
.history-item-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; font-size:12px; }
.history-item-icon { width:14px; height:14px; color:var(--muted-2); flex:0 0 14px; }
.history-item-menu { width:26px; height:26px; display:none; align-items:center; justify-content:center; border:0; border-radius:7px; background:transparent; color:var(--muted); cursor:pointer; flex:0 0 26px; }
.history-item:hover .history-item-menu,.history-item.active .history-item-menu { display:flex; }
.history-item-menu:hover { background:var(--panel); color:var(--text); }
.history-item-menu svg { width:15px; height:15px; }
.history-loading { display:flex; gap:9px; align-items:center; padding:15px 11px; color:var(--muted); font-size:11px; }
.mini-loader { width:13px; height:13px; border:1.5px solid var(--line-strong); border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; }
.sidebar-bottom { border-top:1px solid var(--line); padding-top:13px; }
.sidebar-plan { display:flex; align-items:center; gap:10px; padding:10px 10px 14px; }
.plan-icon { display:grid; place-items:center; width:31px; height:31px; border-radius:10px; background:var(--accent-soft); color:var(--accent); }
.plan-icon svg { width:17px; height:17px; }
.plan-copy,.profile-copy { min-width:0; display:flex; flex-direction:column; gap:4px; flex:1; }
.plan-copy strong,.profile-copy strong { font-size:11px; font-weight:650; }
.plan-copy span,.profile-copy small { color:var(--muted); font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.online-dot,.status-dot { width:7px; height:7px; border-radius:50%; background:var(--green); box-shadow:0 0 11px rgba(123,214,173,.45); }
.profile-button { display:flex; width:100%; align-items:center; gap:10px; padding:9px; border:1px solid transparent; border-radius:11px; background:transparent; text-align:left; cursor:pointer; }
.profile-button:hover { background:var(--panel-2); border-color:var(--line); }
.avatar { width:33px; height:33px; display:grid; place-items:center; flex:0 0 33px; border-radius:50%; background:linear-gradient(135deg,#8f72eb,#49bfb5); color:#fff; font-size:12px; font-weight:800; }
.profile-more { width:15px; height:15px; color:var(--muted); }

/* MAIN */
.main-panel { display:flex; flex:1; min-width:0; height:100%; flex-direction:column; position:relative; background:var(--bg); }
.topbar { display:flex; align-items:center; justify-content:space-between; height:65px; flex:0 0 65px; padding:0 32px; border-bottom:1px solid var(--line); }
.topbar-left,.topbar-right { display:flex; align-items:center; gap:13px; min-width:0; }
.topbar-context { display:flex; align-items:center; gap:9px; color:var(--muted); font-size:12px; }
.context-name { color:var(--text); font-weight:700; font-family:Manrope,sans-serif; letter-spacing:-.2px; }
.context-divider { color:var(--muted-2); }
.context-subtitle { color:var(--muted); }
.model-pill { display:flex; align-items:center; gap:8px; height:31px; padding:0 10px; border:1px solid var(--line-strong); border-radius:9px; background:var(--panel); color:var(--text-2); font-size:10px; font-weight:650; }
.model-pill svg { width:12px; height:12px; color:var(--muted); }
.model-spark { width:6px; height:6px; border-radius:50%; background:var(--teal); box-shadow:0 0 9px var(--teal); }
.topbar-settings { width:34px; height:34px; }

/* WELCOME */
.workspace { position:relative; flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:var(--line-strong) transparent; }
.welcome-view { display:flex; min-height:100%; flex-direction:column; align-items:center; justify-content:center; padding:34px 22px 24px; }
.welcome-center { display:flex; flex-direction:column; align-items:center; width:min(100%,720px); margin:auto; padding:10px 0 20px; }
.welcome-emblem-wrap { position:relative; width:104px; height:104px; display:grid; place-items:center; margin-bottom:29px; }
.welcome-emblem { position:relative; z-index:3; width:91px; height:91px; filter:drop-shadow(0 10px 22px rgba(135,104,239,.23)); }
.emblem-halo { position:absolute; inset:7px; border-radius:50%; background:radial-gradient(circle,rgba(147,116,246,.25),rgba(61,205,192,.05) 63%,transparent 72%); filter:blur(12px); }
.orbit { position:absolute; border:1px solid rgba(157,135,242,.25); border-radius:50%; transform:rotate(-30deg); }
.orbit-one { width:132px; height:51px; }
.orbit-two { width:131px; height:66px; transform:rotate(62deg); border-color:rgba(85,214,204,.16); }
.eyebrow { display:flex; align-items:center; gap:10px; margin-bottom:15px; color:var(--accent); font-size:9px; letter-spacing:2.1px; font-weight:750; }
.eyebrow-line { width:25px; height:1px; background:linear-gradient(90deg,transparent,var(--accent)); opacity:.7; }
.eyebrow-line:last-child { transform:rotate(180deg); }
.welcome-view h1 { margin:0; text-align:center; font-family:Manrope,sans-serif; font-weight:750; letter-spacing:-1.65px; font-size:clamp(31px,4vw,43px); line-height:1.17; }
.welcome-subtitle { margin:12px 0 32px; text-align:center; color:var(--muted); font-size:14px; line-height:1.6; }
.suggestion-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; width:min(100%,660px); }
.suggestion-card { position:relative; display:flex; align-items:center; gap:12px; min-height:77px; padding:13px 14px; background:var(--panel); border:1px solid var(--line); border-radius:14px; text-align:left; cursor:pointer; transition:transform .18s,border-color .18s,background .18s; }
.suggestion-card:hover { transform:translateY(-2px); border-color:rgba(157,130,244,.35); background:var(--panel-2); }
.suggestion-card > span:nth-child(2) { display:flex; min-width:0; flex-direction:column; gap:5px; }
.suggestion-card strong { font-size:12px; font-weight:650; }
.suggestion-card small { color:var(--muted); font-size:10px; line-height:1.4; }
.suggestion-icon { display:grid; place-items:center; width:35px; height:35px; flex:0 0 35px; border-radius:11px; }
.suggestion-icon svg { width:18px; height:18px; }
.suggestion-icon.purple { color:#b7a0ff; background:rgba(149,119,242,.13); }
.suggestion-icon.blue { color:#8fb9f8; background:rgba(91,148,232,.13); }
.suggestion-icon.amber { color:#e9be78; background:rgba(226,168,82,.12); }
.suggestion-icon.green { color:#7bd9b5; background:rgba(79,194,144,.12); }
.card-arrow { width:14px; height:14px; color:var(--muted-2); margin-left:auto; flex:0 0 14px; }
.welcome-footnote { display:flex; align-items:center; gap:9px; margin-top:26px; color:var(--muted-2); font-size:10px; }
.welcome-footnote .status-dot { width:6px; height:6px; }
.footnote-separator { opacity:.5; }

/* CHAT */
.chat-view { min-height:100%; padding:34px 24px 180px; }
.messages { width:min(100%,790px); margin:0 auto; display:flex; flex-direction:column; gap:29px; }
.message-row { display:flex; gap:13px; align-items:flex-start; width:100%; animation:messageIn .22s ease both; }
.message-row.user { justify-content:flex-end; }
.message-avatar { width:29px; height:29px; flex:0 0 29px; display:grid; place-items:center; border-radius:50%; }
.message-avatar.assistant { background:var(--accent-soft); border:1px solid rgba(153,129,238,.2); }
.message-avatar.assistant img { width:25px; height:25px; }
.message-avatar.user { background:linear-gradient(135deg,#8c70e9,#43afa6); color:white; font-size:10px; font-weight:800; }
.message-body { min-width:0; max-width:calc(100% - 43px); }
.message-row.user .message-body { max-width:min(80%,660px); }
.message-meta { display:flex; align-items:center; gap:8px; margin:1px 0 8px; font-size:11px; color:var(--muted); }
.message-meta strong { color:var(--text-2); font-weight:700; }
.message-content { color:var(--text); font-size:14px; line-height:1.77; overflow-wrap:anywhere; }
.message-row.user .message-content { background:var(--panel-3); border:1px solid var(--line); padding:12px 16px; border-radius:18px 18px 5px 18px; line-height:1.65; }
.message-content p { margin:0 0 12px; }
.message-content p:last-child { margin-bottom:0; }
.message-content h1,.message-content h2,.message-content h3 { font-family:Manrope,sans-serif; line-height:1.3; margin:21px 0 10px; letter-spacing:-.4px; }
.message-content h1 { font-size:21px; }.message-content h2 { font-size:18px; }.message-content h3 { font-size:15px; }
.message-content ul,.message-content ol { padding-left:22px; margin:9px 0 14px; }
.message-content li { padding-left:4px; margin:5px 0; }
.message-content blockquote { border-left:2px solid var(--accent); padding:5px 0 5px 13px; color:var(--text-2); margin:12px 0; }
.message-content a { color:var(--accent); text-decoration:underline; text-underline-offset:3px; }
.message-content code { font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:.88em; background:var(--panel-3); border:1px solid var(--line); border-radius:5px; padding:2px 5px; }
.code-block { position:relative; margin:14px 0; background:#111117; color:#e6e2f2; border:1px solid rgba(255,255,255,.1); border-radius:12px; overflow:hidden; }
html[data-theme="light"] .code-block { background:#24212e; color:#f1edf8; }
.code-block-header { display:flex; justify-content:space-between; align-items:center; padding:8px 12px; background:rgba(255,255,255,.04); border-bottom:1px solid rgba(255,255,255,.08); color:#aaa4bb; font-size:10px; }
.code-copy { background:transparent; border:0; color:#c9c4d6; cursor:pointer; display:flex; gap:6px; align-items:center; font-size:10px; }
.code-copy svg { width:13px; height:13px; }
.code-block pre { margin:0; padding:15px; overflow:auto; font-size:12px; line-height:1.65; white-space:pre; }
.code-block code { background:transparent; border:0; padding:0; color:inherit; }
.message-content table { width:100%; border-collapse:collapse; margin:13px 0; font-size:12px; overflow:hidden; border-radius:9px; }
.message-content th,.message-content td { padding:9px 11px; text-align:left; border:1px solid var(--line-strong); }
.message-content th { background:var(--panel-2); font-weight:700; }
.message-content hr { border:0; border-top:1px solid var(--line); margin:20px 0; }
.message-actions { display:flex; align-items:center; gap:5px; margin:10px 0 0; opacity:.65; }
.message-actions button { display:flex; align-items:center; gap:5px; min-height:28px; padding:0 8px; border:1px solid transparent; border-radius:7px; background:transparent; color:var(--muted); cursor:pointer; font-size:10px; }
.message-actions button:hover { color:var(--text); background:var(--panel-2); border-color:var(--line); }
.message-actions svg { width:14px; height:14px; }
.message-pending { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:12px; }
.thinking-pulse { display:flex; gap:4px; align-items:center; height:17px; }
.thinking-pulse i { display:block; width:5px; height:5px; border-radius:50%; background:var(--accent); animation:pulse 1.1s ease-in-out infinite; }
.thinking-pulse i:nth-child(2) { animation-delay:.15s; }.thinking-pulse i:nth-child(3) { animation-delay:.3s; }
.stream-cursor { display:inline-block; width:2px; height:15px; margin-left:2px; vertical-align:-2px; background:var(--accent); animation:blink .8s steps(2,start) infinite; }
.message-error { color:var(--red); font-size:12px; margin-top:9px; }

/* COMPOSER */
.composer-area { position:relative; z-index:5; width:100%; padding:16px 24px max(16px,env(safe-area-inset-bottom)); background:linear-gradient(180deg,rgba(16,16,20,0),var(--bg) 18%,var(--bg)); }
html[data-theme="light"] .composer-area { background:linear-gradient(180deg,rgba(247,247,250,0),var(--bg) 18%,var(--bg)); }
.composer { width:min(100%,790px); margin:0 auto; padding:12px 13px 10px 17px; background:var(--panel); border:1px solid var(--line-strong); border-radius:19px; box-shadow:0 11px 35px rgba(0,0,0,.11); transition:border-color .18s,box-shadow .18s; }
.composer:focus-within { border-color:rgba(156,130,246,.47); box-shadow:0 0 0 3px rgba(145,117,238,.08),0 15px 40px rgba(0,0,0,.13); }
.composer textarea { display:block; resize:none; width:100%; max-height:180px; min-height:34px; outline:0; border:0; background:transparent; color:var(--text); padding:5px 0 7px; font-size:14px; line-height:1.55; scrollbar-width:thin; }
.composer textarea::placeholder { color:var(--muted); }
.composer textarea:focus-visible { outline:0; }
.composer-bottom { display:flex; justify-content:space-between; align-items:center; min-height:34px; gap:12px; }
.composer-tools,.composer-actions { display:flex; align-items:center; gap:10px; }
.composer-mode,.composer-free { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:10px; }
.composer-mode svg { width:14px; height:14px; color:var(--accent); }
.composer-free { color:var(--teal); font-weight:650; }
.composer-free span { width:5px; height:5px; border-radius:50%; background:var(--teal); }
.composer-separator { height:13px; width:1px; background:var(--line-strong); }
.char-count { color:var(--muted-2); font-size:9px; }
.send-button { width:33px; height:33px; display:grid; place-items:center; border:0; border-radius:10px; background:linear-gradient(135deg,#9c83f3,#7e64de); color:#fff; cursor:pointer; transition:transform .18s,filter .18s; }
.send-button:hover:not(:disabled) { transform:translateY(-1px); filter:brightness(1.1); }
.send-button svg { width:17px; height:17px; stroke-width:2; }
.composer-disclaimer { text-align:center; color:var(--muted-2); font-size:9px; margin:9px auto 0; width:min(100%,790px); }
.composer-disclaimer button { background:transparent; border:0; color:var(--muted); cursor:pointer; padding:0; text-decoration:underline; text-underline-offset:2px; font-size:inherit; }

/* UTILITY VIEWS */
.utility-view { width:min(100%,840px); margin:0 auto; padding:38px 28px 170px; }
.utility-heading { margin-bottom:25px; }
.utility-kicker { color:var(--accent); font-size:9px; font-weight:750; letter-spacing:1.7px; }
.utility-heading h1 { font-family:Manrope,sans-serif; font-size:29px; letter-spacing:-1px; margin:8px 0; }
.utility-heading p { margin:0; color:var(--muted); font-size:12px; }
.panel-card { background:var(--panel); border:1px solid var(--line); border-radius:15px; padding:18px; margin-bottom:13px; }
.panel-card h3 { font-family:Manrope,sans-serif; font-size:13px; margin:0 0 6px; }
.panel-card p { font-size:11px; color:var(--muted); margin:0; line-height:1.55; }
.usage-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:18px 0; }
.usage-stat { background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:16px; }
.usage-stat span { color:var(--muted); font-size:10px; }
.usage-stat strong { display:block; margin-top:7px; font-family:Manrope,sans-serif; font-size:25px; letter-spacing:-1px; }
.usage-bar { height:7px; border-radius:8px; overflow:hidden; background:var(--panel-3); margin:15px 0 8px; }
.usage-bar span { display:block; height:100%; width:0; border-radius:8px; background:linear-gradient(90deg,var(--accent-2),var(--teal)); transition:width .3s; }

/* AUTH */
.auth-screen { position:fixed; z-index:80; inset:0; overflow:auto; background:var(--bg); padding:26px clamp(18px,5vw,64px) 18px; }
.auth-backdrop-glow { position:fixed; pointer-events:none; width:650px; height:650px; top:-300px; left:50%; transform:translateX(-50%); border-radius:50%; background:radial-gradient(circle,rgba(135,102,238,.17),rgba(64,180,168,.045) 47%,transparent 70%); filter:blur(20px); }
.auth-top { position:relative; z-index:1; display:flex; justify-content:space-between; align-items:center; width:min(100%,1120px); margin:0 auto; }
.theme-toggle { display:grid; place-items:center; width:38px; height:38px; border:1px solid var(--line); background:var(--panel); border-radius:11px; color:var(--muted); cursor:pointer; }
.theme-toggle:hover { color:var(--text); border-color:var(--line-strong); }
.auth-content { position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; width:100%; min-height:calc(100dvh - 96px); padding:38px 0 12px; }
.auth-card { width:min(100%,430px); padding:34px 35px 27px; background:var(--panel); border:1px solid var(--line-strong); border-radius:22px; box-shadow:var(--shadow); margin:auto 0; }
.auth-card-mark { width:62px; height:62px; margin:0 auto 16px; }
.auth-card-mark img { width:100%; height:100%; }
.auth-kicker { text-align:center; color:var(--accent); font-size:8px; letter-spacing:2px; font-weight:750; }
.auth-card h1 { text-align:center; margin:11px 0 7px; font-family:Manrope,sans-serif; font-size:27px; letter-spacing:-1px; }
.auth-lead { text-align:center; color:var(--muted); font-size:11px; margin:0 0 25px; }
.auth-alert { margin:0 0 17px; border-radius:10px; border:1px solid rgba(133,208,174,.2); background:rgba(82,185,135,.08); color:var(--green); padding:11px 12px; font-size:11px; line-height:1.5; }
.auth-alert.error { border-color:rgba(237,141,156,.22); background:rgba(237,90,120,.08); color:var(--red); }
.field-group { margin:0 0 16px; }
.field-group label { display:block; color:var(--text-2); font-size:10px; font-weight:650; margin:0 0 7px; }
.field-label-row { display:flex; align-items:center; justify-content:space-between; }
.input-wrap { position:relative; display:flex; align-items:center; height:46px; border:1px solid var(--line-strong); border-radius:10px; background:var(--field); transition:border-color .18s,box-shadow .18s; }
.input-wrap:focus-within { border-color:rgba(156,130,246,.55); box-shadow:0 0 0 3px rgba(145,117,238,.08); }
.input-wrap > svg { width:16px; height:16px; color:var(--muted); margin-left:13px; flex:0 0 16px; }
.input-wrap input { width:100%; min-width:0; border:0; outline:0; background:transparent; color:var(--text); padding:0 13px; font-size:12px; }
.input-wrap input:focus-visible { outline:0; }
.input-wrap input::placeholder { color:var(--muted-2); }
.password-toggle { width:37px; height:38px; display:grid; place-items:center; border:0; color:var(--muted); background:transparent; cursor:pointer; flex:0 0 37px; }
.password-toggle svg { width:17px; height:17px; }
.text-button { border:0; background:transparent; color:var(--accent); font-size:10px; cursor:pointer; padding:0 0 7px; }
.text-button:hover { text-decoration:underline; }
.field-hint { color:var(--muted); font-size:9px; display:block; margin-top:6px; }
.auth-submit { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; height:46px; margin-top:6px; border:1px solid rgba(183,160,255,.25); border-radius:11px; background:linear-gradient(105deg,#8c70e9,#7154d0); color:#fff; font-weight:700; font-size:12px; cursor:pointer; box-shadow:0 7px 18px rgba(113,84,208,.17); transition:filter .2s,transform .2s; }
.auth-submit:hover { filter:brightness(1.08); transform:translateY(-1px); }
.auth-submit svg { width:16px; height:16px; }
.auth-submit:disabled { filter:grayscale(.3); }
.auth-switch { text-align:center; color:var(--muted); font-size:10px; margin:19px 0 20px; }
.auth-switch button { color:var(--accent); border:0; background:transparent; font-weight:700; cursor:pointer; padding:0 0 0 3px; font-size:10px; }
.auth-switch button:hover { text-decoration:underline; }
.auth-legal { border-top:1px solid var(--line); padding-top:16px; text-align:center; color:var(--muted-2); font-size:9px; line-height:1.6; }
.auth-bottom { display:flex; justify-content:space-between; width:min(100%,760px); margin-top:25px; color:var(--muted-2); font-size:9px; }
.auth-bottom span:first-child { display:flex; align-items:center; gap:7px; }
.auth-bottom i { width:6px; height:6px; border-radius:50%; background:var(--green); }

/* SETTINGS */
.modal-backdrop { position:fixed; z-index:60; inset:0; display:grid; place-items:center; padding:22px; background:rgba(0,0,0,.55); backdrop-filter:blur(9px); }
.settings-modal { width:min(100%,840px); max-height:min(760px,calc(100dvh - 44px)); display:flex; flex-direction:column; overflow:hidden; background:var(--panel); border:1px solid var(--line-strong); border-radius:19px; box-shadow:var(--shadow); }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:19px 22px; border-bottom:1px solid var(--line); }
.modal-eyebrow { color:var(--accent); font-size:8px; letter-spacing:1.7px; font-weight:750; }
.modal-header h2 { margin:4px 0 0; font-family:Manrope,sans-serif; font-size:19px; letter-spacing:-.5px; }
.settings-layout { display:grid; grid-template-columns:205px minmax(0,1fr); min-height:0; overflow:hidden; }
.settings-nav { display:flex; flex-direction:column; gap:4px; padding:17px 12px; border-right:1px solid var(--line); background:var(--panel-2); }
.settings-tab { display:flex; align-items:center; gap:10px; width:100%; padding:10px 11px; border:1px solid transparent; border-radius:9px; background:transparent; text-align:left; color:var(--text-2); font-size:11px; cursor:pointer; }
.settings-tab svg { width:16px; height:16px; color:var(--muted); }
.settings-tab:hover { background:var(--panel); }
.settings-tab.active { background:var(--panel); border-color:var(--line); color:var(--text); }
.settings-tab.active svg { color:var(--accent); }
.settings-content { overflow:auto; padding:22px; }
.settings-section + .settings-section { margin-top:25px; padding-top:22px; border-top:1px solid var(--line); }
.settings-section h3 { margin:0 0 6px; font-family:Manrope,sans-serif; font-size:14px; }
.settings-section > p { margin:0 0 16px; color:var(--muted); font-size:10px; line-height:1.6; }
.setting-row { display:flex; justify-content:space-between; align-items:center; gap:18px; padding:13px 0; border-bottom:1px solid var(--line); }
.setting-row:last-child { border-bottom:0; }
.setting-row-copy { min-width:0; }
.setting-row-copy strong { display:block; font-size:11px; font-weight:650; }
.setting-row-copy small { display:block; color:var(--muted); font-size:9px; margin-top:5px; line-height:1.5; }
.setting-select,.setting-input,.setting-textarea { width:min(100%,250px); border:1px solid var(--line-strong); border-radius:8px; background:var(--field); color:var(--text); outline:0; padding:9px 10px; font-size:10px; }
.setting-textarea { width:100%; min-height:105px; resize:vertical; line-height:1.55; }
.setting-save { margin-top:11px; padding:9px 13px; border:1px solid rgba(158,132,248,.3); border-radius:8px; background:var(--accent-soft); color:var(--accent); font-size:10px; font-weight:700; cursor:pointer; }
.setting-save:hover { background:rgba(151,120,247,.2); }
.memory-form { display:flex; gap:8px; margin:14px 0; }
.memory-form input { flex:1; min-width:0; }
.memory-list { display:grid; gap:8px; }
.memory-item { display:flex; align-items:flex-start; gap:10px; padding:12px; border:1px solid var(--line); border-radius:10px; background:var(--panel-2); }
.memory-item span { flex:1; min-width:0; font-size:10px; line-height:1.5; }
.memory-item small { display:block; color:var(--muted); margin-top:4px; font-size:8px; }
.memory-item button { width:25px; height:25px; display:grid; place-items:center; border:0; border-radius:7px; background:transparent; color:var(--muted); cursor:pointer; }
.memory-item button:hover { background:var(--panel-3); color:var(--red); }
.memory-item button svg { width:14px; height:14px; }
.settings-stat-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin:14px 0; }
.settings-stat { padding:13px; border:1px solid var(--line); border-radius:10px; background:var(--panel-2); }
.settings-stat small { display:block; color:var(--muted); font-size:9px; }
.settings-stat strong { display:block; margin-top:7px; font:750 19px Manrope,sans-serif; }
.danger-button { border:1px solid rgba(237,141,156,.25); background:rgba(237,141,156,.08); color:var(--red); padding:9px 12px; border-radius:8px; font-size:10px; font-weight:650; cursor:pointer; }
.settings-note { font-size:9px; color:var(--muted-2); line-height:1.6; }

/* TOAST AND MENUS */
.toast-region { position:fixed; z-index:120; right:22px; bottom:22px; display:grid; gap:8px; pointer-events:none; }
.toast { display:flex; align-items:center; gap:9px; max-width:min(380px,calc(100vw - 32px)); padding:12px 15px; border:1px solid var(--line-strong); border-radius:11px; background:var(--panel-3); box-shadow:var(--shadow); color:var(--text); font-size:11px; animation:toastIn .2s ease both; }
.toast svg { width:15px; height:15px; color:var(--green); flex:0 0 15px; }
.toast.error svg { color:var(--red); }
.context-menu { position:fixed; z-index:100; width:155px; padding:5px; background:var(--panel-3); border:1px solid var(--line-strong); box-shadow:var(--shadow); border-radius:10px; }
.context-menu button { display:flex; align-items:center; gap:9px; width:100%; padding:9px 10px; border:0; border-radius:7px; background:transparent; color:var(--text-2); text-align:left; font-size:10px; cursor:pointer; }
.context-menu button:hover { background:var(--panel); color:var(--text); }
.context-menu button.danger { color:var(--red); }
.context-menu svg { width:14px; height:14px; }

/* MOTION */
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes pulse { 0%,80%,100% { transform:scale(.7); opacity:.5; } 40% { transform:scale(1.15); opacity:1; } }
@keyframes blink { to { visibility:hidden; } }
@keyframes messageIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

@media (min-width:1500px) {
  :root { --sidebar-width:296px; }
  .topbar { padding:0 42px; }
  .chat-view { padding-top:42px; }
}
@media (max-width:900px) {
  :root { --sidebar-width:270px; }
  .topbar { padding:0 21px; }
  .welcome-center { padding-top:0; }
}
@media (max-width:700px) {
  body { font-size:13px; }
  .sidebar { position:fixed; inset:0 auto 0 0; width:min(310px,86vw); height:100dvh; transform:translateX(-102%); box-shadow:none; }
  .sidebar.open { transform:translateX(0); box-shadow:20px 0 55px rgba(0,0,0,.32); }
  .sidebar-close,.mobile-menu-button { display:grid; }
  .sidebar-backdrop { position:fixed; z-index:25; inset:0; background:rgba(0,0,0,.48); backdrop-filter:blur(2px); opacity:0; pointer-events:none; transition:opacity .2s; }
  .sidebar-backdrop.visible { opacity:1; pointer-events:auto; }
  .main-panel { width:100%; }
  .topbar { height:57px; flex-basis:57px; padding:0 13px; }
  .topbar-left { gap:8px; }
  .topbar-context { font-size:11px; }
  .topbar-right { gap:5px; }
  .model-pill { height:29px; padding:0 8px; gap:6px; font-size:9px; }
  .topbar-settings { width:32px; height:32px; }
  .welcome-view { min-height:100%; padding:26px 18px 16px; }
  .welcome-emblem-wrap { width:85px; height:85px; margin-bottom:24px; }
  .welcome-emblem { width:76px; height:76px; }
  .orbit-one,.orbit-two { transform:scale(.83) rotate(-30deg); }
  .orbit-two { transform:scale(.83) rotate(62deg); }
  .eyebrow { font-size:8px; letter-spacing:1.4px; margin-bottom:12px; }
  .eyebrow-line { width:16px; }
  .welcome-view h1 { font-size:30px; letter-spacing:-1.2px; }
  .welcome-subtitle { margin:9px 0 23px; font-size:12px; }
  .suggestion-grid { gap:8px; }
  .suggestion-card { min-height:83px; padding:10px; gap:9px; border-radius:12px; }
  .suggestion-icon { width:30px; height:30px; flex-basis:30px; border-radius:9px; }
  .suggestion-icon svg { width:16px; height:16px; }
  .suggestion-card strong { font-size:10px; line-height:1.3; }
  .suggestion-card small { font-size:9px; }
  .card-arrow { display:none; }
  .welcome-footnote { margin-top:20px; font-size:9px; }
  .composer-area { padding:9px 10px max(10px,env(safe-area-inset-bottom)); }
  .composer { border-radius:16px; padding:10px 10px 8px 13px; }
  .composer textarea { min-height:35px; font-size:13px; }
  .composer-bottom { min-height:31px; }
  .composer-disclaimer { font-size:8px; margin-top:6px; }
  .chat-view { padding:24px 14px 160px; }
  .messages { gap:24px; }
  .message-row { gap:9px; }
  .message-avatar { width:26px; height:26px; flex-basis:26px; }
  .message-avatar.assistant img { width:23px; height:23px; }
  .message-body { max-width:calc(100% - 35px); }
  .message-row.user .message-body { max-width:86%; }
  .message-content { font-size:13px; line-height:1.7; }
  .message-row.user .message-content { padding:10px 13px; }
  .utility-view { padding:27px 17px 150px; }
  .utility-heading h1 { font-size:25px; }
  .usage-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .usage-stat { padding:13px; }
  .usage-stat strong { font-size:22px; }
  .auth-screen { padding:20px 16px 14px; }
  .auth-content { min-height:calc(100dvh - 80px); padding:24px 0 8px; }
  .auth-card { padding:27px 22px 23px; border-radius:18px; }
  .auth-card h1 { font-size:25px; }
  .auth-bottom { margin-top:18px; font-size:8px; }
  .modal-backdrop { padding:0; place-items:stretch; }
  .settings-modal { width:100%; max-height:100dvh; height:100dvh; border-radius:0; border:0; }
  .modal-header { padding:14px 16px; }
  .settings-layout { display:block; overflow:auto; }
  .settings-nav { position:sticky; top:0; z-index:2; flex-direction:row; overflow-x:auto; padding:9px 11px; border-right:0; border-bottom:1px solid var(--line); }
  .settings-tab { flex:0 0 auto; width:auto; padding:9px; font-size:10px; }
  .settings-tab svg { width:14px; height:14px; }
  .settings-content { padding:18px 16px 35px; overflow:visible; }
  .toast-region { right:12px; bottom:calc(12px + env(safe-area-inset-bottom)); }
}
@media (max-width:390px) {
  .brand-copy strong { font-size:15px; }
  .brand-mark { width:39px; height:39px; flex-basis:39px; }
  .model-pill { font-size:8px; }
  .suggestion-grid { grid-template-columns:1fr; }
  .suggestion-card { min-height:65px; }
  .suggestion-card small { font-size:9px; }
  .welcome-footnote { font-size:8px; gap:6px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}
