:root {
  color-scheme: dark;
  --bg: #09090f;
  --sidebar: #101018;
  --surface: #14141f;
  --surface-raised: #191925;
  --surface-soft: rgba(255,255,255,.035);
  --text: #f8fafc;
  --muted: #94a3b8;
  --faint: #667085;
  --border: rgba(191, 190, 225, .105);
  --border-strong: rgba(191, 190, 225, .17);
  --accent: #8b5cf6;
  --accent-strong: #9c75ff;
  --blue: #3b82f6;
  --shadow: 0 20px 70px rgba(0,0,0,.32);
  --radius: 16px;
  font-family: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); overflow: hidden; }
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid rgba(139,92,246,.85); outline-offset: 2px; }
::selection { background: rgba(139,92,246,.36); }
[hidden] { display: none !important; }

.app-shell { display: flex; width: 100%; height: 100dvh; overflow: hidden; background: var(--bg); }
.sidebar { position: relative; z-index: 20; display: flex; flex: 0 0 274px; flex-direction: column; width: 274px; padding: 22px 14px 14px; background: var(--sidebar); border-right: 1px solid var(--border); transition: width .25s ease, flex-basis .25s ease, transform .25s ease; }
.sidebar-top { display: flex; height: 38px; align-items: center; justify-content: space-between; padding: 0 5px 0 6px; margin-bottom: 27px; }
.brand { display: inline-flex; min-width: 0; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; box-shadow: 0 5px 18px rgba(139,92,246,.22); }
.brand-mark img { width: 34px; height: 34px; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-copy strong { font: 800 15px/1.1 'Manrope', sans-serif; letter-spacing: -.5px; }
.brand-copy small { color: #77778f; font: 700 8px/1.2 'DM Sans', sans-serif; letter-spacing: 1.65px; }
.icon-button, .tiny-icon-button { display: inline-grid; flex: 0 0 auto; place-items: center; padding: 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; transition: background .18s ease, color .18s ease, transform .18s ease; }
.icon-button { width: 34px; height: 34px; border-radius: 10px; }
.icon-button svg { width: 17px; height: 17px; stroke-width: 1.8; }
.tiny-icon-button { width: 25px; height: 25px; border-radius: 7px; }
.tiny-icon-button svg { width: 14px; height: 14px; }
.icon-button:hover, .tiny-icon-button:hover { color: var(--text); background: var(--surface-raised); }
.new-chat-button { display: flex; width: 100%; height: 42px; align-items: center; gap: 10px; padding: 0 11px; border: 1px solid rgba(169,143,255,.22); border-radius: 11px; color: #fff; background: linear-gradient(110deg, rgba(139,92,246,.19), rgba(59,130,246,.07)); cursor: pointer; font-size: 12.5px; font-weight: 600; transition: border-color .2s, background .2s, transform .2s; }
.new-chat-button:hover { transform: translateY(-1px); border-color: rgba(169,143,255,.46); background: linear-gradient(110deg, rgba(139,92,246,.27), rgba(59,130,246,.12)); }
.new-chat-button > svg { width: 16px; height: 16px; color: #b69bff; }
kbd { display: inline-grid; min-width: 19px; height: 19px; place-items: center; padding: 0 4px; border: 1px solid var(--border-strong); border-radius: 5px; color: var(--faint); background: rgba(255,255,255,.025); font: 500 10px/1 'DM Sans', sans-serif; }
.new-chat-button kbd { margin-left: auto; }
.search-box { display: flex; height: 37px; align-items: center; gap: 8px; padding: 0 9px; margin: 12px 0 24px; border: 1px solid transparent; border-radius: 9px; color: #76768c; background: rgba(255,255,255,.035); transition: border .2s; }
.search-box:focus-within { border-color: rgba(139,92,246,.38); }
.search-box svg { width: 15px; height: 15px; flex: 0 0 auto; }
.search-box input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 11.5px; }
.search-box input::placeholder { color: #78788c; }
.search-box kbd { width: 19px; min-width: 19px; height: 18px; font-size: 11px; }
.sidebar-nav { flex: 1; min-height: 0; overflow: hidden auto; scrollbar-width: thin; scrollbar-color: #292936 transparent; }
.nav-label, .section-heading { color: #717184; font-size: 9px; font-weight: 700; letter-spacing: 1.4px; }
.nav-label { padding: 0 9px 10px; }
.nav-link { display: flex; width: 100%; height: 34px; align-items: center; gap: 10px; padding: 0 9px; border: 0; border-radius: 8px; color: #a4a4b7; background: transparent; text-align: left; cursor: pointer; font-size: 11.5px; transition: color .18s, background .18s; }
.nav-link > svg { width: 15px; height: 15px; color: #8d8da2; stroke-width: 1.8; }
.nav-link:hover, .nav-link.selected { color: var(--text); background: rgba(255,255,255,.055); }
.nav-link:hover > svg, .nav-link.selected > svg { color: #ad91ff; }
.nav-count { margin-left: auto; color: #6f6f82; font-size: 10px; }
.section-heading { display: flex; height: 35px; align-items: center; justify-content: space-between; padding: 0 6px 0 9px; margin-top: 17px; }
.conversation-list, .project-list { display: flex; flex-direction: column; gap: 2px; }
.conversation-item { position: relative; display: flex; width: 100%; min-height: 34px; align-items: center; padding: 0 7px 0 9px; border-radius: 8px; color: #9e9eaf; cursor: pointer; transition: color .16s, background .16s; }
.conversation-item:hover { color: #eeeefa; background: rgba(255,255,255,.045); }
.conversation-item.active { color: #fff; background: rgba(139,92,246,.14); box-shadow: inset 2px 0 #9c75ff; }
.conversation-item .item-title { overflow: hidden; flex: 1; font-size: 11.5px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item .item-pin { width: 12px; height: 12px; margin-right: 6px; color: #a78bfa; }
.conversation-menu-button { display: none; width: 23px; height: 23px; margin-left: 4px; border: 0; border-radius: 6px; color: #aaaabc; background: transparent; cursor: pointer; }
.conversation-menu-button svg { width: 14px; height: 14px; }
.conversation-item:hover .conversation-menu-button, .conversation-item.active .conversation-menu-button { display: grid; place-items: center; }
.conversation-menu-button:hover { color: white; background: rgba(255,255,255,.1); }
.list-empty { padding: 12px 9px; color: #77778a; font-size: 11px; line-height: 1.5; }
.projects-heading { margin-top: 18px; }
.project-item { display: flex; height: 32px; align-items: center; gap: 9px; padding: 0 10px; border: 0; border-radius: 8px; color: #a3a3b3; background: transparent; text-align: left; font-size: 11.5px; cursor: pointer; transition: color .18s, background .18s; }
.project-item:hover { color: var(--text); background: rgba(255,255,255,.045); }
.project-item svg { width: 14px; height: 14px; color: #8f7ade; }
.project-item.selected { color: #e9e2ff; background: rgba(139,92,246,.13); }
.conversation-context-menu { position: fixed; z-index: 36; width: 174px; padding: 5px; border: 1px solid var(--border-strong); border-radius: 10px; background: #191923; box-shadow: var(--shadow); animation: menu-in .13s ease-out; }
.context-menu-item { display: flex; width: 100%; height: 33px; align-items: center; gap: 9px; padding: 0 9px; border: 0; border-radius: 7px; color: #bdbbca; background: transparent; text-align: left; cursor: pointer; font-size: 10.5px; }
.context-menu-item svg { width: 14px; height: 14px; color: #9291a4; }
.context-menu-item:hover { color: var(--text); background: rgba(255,255,255,.055); }
.context-menu-item.danger { color: #ef9b9b; }
.context-menu-item.danger svg { color: #df8d8d; }
.context-menu-item.danger:hover { background: rgba(225,85,85,.09); }
.sidebar-bottom { padding-top: 12px; border-top: 1px solid var(--border); }
.sidebar-bottom .nav-link { margin-bottom: 9px; }
.profile-card { display: flex; height: 48px; align-items: center; gap: 9px; padding: 0 6px; border-radius: 10px; transition: background .18s; }
.profile-card:hover { background: rgba(255,255,255,.035); }
.avatar { display: inline-grid; flex: 0 0 auto; place-items: center; width: 29px; height: 29px; border-radius: 10px; }
.user-avatar { color: #e2d7ff; background: linear-gradient(135deg,#5945a8,#342a5e); font: 700 12px 'Manrope', sans-serif; }
.profile-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.profile-copy strong { color: #e4e4ec; font-size: 11px; font-weight: 600; }
.profile-copy small { color: #79798d; font-size: 9.5px; }
.profile-card .tiny-icon-button { color: #77778a; }

.main-panel { position: relative; display: flex; min-width: 0; flex: 1; flex-direction: column; overflow: hidden; background: var(--bg); }
.main-panel::before { position: absolute; top: -260px; left: 50%; width: 680px; height: 430px; border-radius: 50%; background: radial-gradient(ellipse,rgba(102,68,186,.07),transparent 69%); content: ""; pointer-events: none; transform: translateX(-50%); }
.topbar { position: relative; z-index: 4; display: flex; height: 68px; flex: 0 0 68px; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid rgba(191,190,225,.065); }
.topbar-left, .topbar-actions { display: flex; min-width: 0; align-items: center; }
.topbar-left { gap: 12px; }
.topbar-actions { gap: 5px; }
.desktop-open-button, .mobile-menu-button { display: none; }
.conversation-heading { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.conversation-title { overflow: hidden; max-width: 380px; color: #edecf4; font: 600 13px/1.1 'Manrope', sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.title-meta { display: flex; align-items: center; gap: 6px; color: #77778c; font-size: 9.5px; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #49c997; box-shadow: 0 0 8px rgba(73,201,151,.55); }
.connection-dot.offline, .service-indicator.offline { background: #e87979; box-shadow: 0 0 8px rgba(232,121,121,.38); }
.connection-dot.connecting, .service-indicator.connecting { background: #d7ad62; box-shadow: 0 0 8px rgba(215,173,98,.32); }
.connection-dot.online { background: #49c997; box-shadow: 0 0 8px rgba(73,201,151,.55); }
.service-indicator.online { background: #49c997; box-shadow: 0 0 8px rgba(73,201,151,.45); }
.model-picker { position: relative; }
.model-trigger { display: flex; height: 34px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; color: #d6d3e2; background: transparent; cursor: pointer; font-size: 11px; font-weight: 500; transition: background .18s, border .18s; }
.model-trigger:hover, .model-trigger[aria-expanded="true"] { border-color: var(--border); background: rgba(255,255,255,.04); }
.model-trigger:disabled, .composer-model-trigger:disabled { cursor: default; opacity: .7; }
.model-sparkle { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 7px; color: #ba9eff; background: rgba(139,92,246,.13); }
.model-sparkle svg { width: 13px; height: 13px; }
.model-chevron { width: 13px; height: 13px; color: #77778c; transition: transform .18s; }
[aria-expanded="true"] .model-chevron { transform: rotate(180deg); }
.action-divider { width: 1px; height: 20px; margin: 0 6px; background: var(--border); }
.model-menu { position: absolute; z-index: 12; top: calc(100% + 9px); right: 0; display: none; width: 244px; padding: 6px; border: 1px solid var(--border-strong); border-radius: 13px; background: #171721; box-shadow: var(--shadow); }
.model-menu.open { display: block; animation: menu-in .15s ease-out; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.model-option { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px; border: 0; border-radius: 8px; color: #d1d1de; background: transparent; text-align: left; cursor: pointer; }
.model-option:hover, .model-option.selected { background: rgba(255,255,255,.055); }
.model-option-icon { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(166,138,255,.16); border-radius: 9px; color: #b99cff; background: rgba(139,92,246,.1); }
.model-option-icon svg { width: 14px; height: 14px; }
.model-option-copy { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.model-option-copy strong { font-size: 11px; font-weight: 600; }
.model-option-copy small { color: #858598; font-size: 9.5px; }
.model-option .check-icon { width: 14px; height: 14px; color: #a990ff; }
.model-menu-empty { padding: 11px 9px; color: #9291a3; font-size: 10px; line-height: 1.5; }

.chat-scroll { position: relative; z-index: 1; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #30303e transparent; scroll-behavior: smooth; }
.chat-content { display: flex; min-height: 100%; flex-direction: column; align-items: center; padding: 28px 28px 18px; }
.welcome-screen { display: flex; width: min(100%, 750px); flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 15px 0 5px; text-align: center; animation: welcome-in .55s ease both; }
@keyframes welcome-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.welcome-orbit { position: relative; display: grid; width: 104px; height: 104px; place-items: center; margin-bottom: 22px; }
.orbit-core { z-index: 2; display: grid; width: 54px; height: 54px; place-items: center; border: 1px solid rgba(194,174,255,.27); border-radius: 19px; background: linear-gradient(145deg,rgba(139,92,246,.24),rgba(59,130,246,.11)); box-shadow: 0 0 36px rgba(128,87,244,.23), inset 0 1px rgba(255,255,255,.12); }
.orbit-core img { width: 43px; height: 43px; }
.orbit-ring { position: absolute; border: 1px solid rgba(157,133,229,.13); border-radius: 50%; }
.ring-one { inset: 5px; }
.ring-two { inset: -7px; border-color: rgba(157,133,229,.07); }
.orbit-glow { position: absolute; z-index: -1; width: 80px; height: 80px; border-radius: 50%; background: rgba(126,82,224,.35); filter: blur(35px); }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 13px; color: #a38be4; font-size: 9px; font-weight: 700; letter-spacing: 2.2px; }
.eyebrow-line { width: 18px; height: 1px; background: linear-gradient(90deg,transparent,#8063c9); }
.eyebrow-line:last-child { transform: rotate(180deg); }
.welcome-screen h1 { margin: 0; color: #faf9ff; font: 600 clamp(28px,3.8vw,42px)/1.18 'Manrope',sans-serif; letter-spacing: -1.6px; }
.welcome-screen h1 span { color: #b4a0ed; }
.welcome-subtitle { margin: 11px 0 31px; color: #8e8d9f; font-size: 13px; letter-spacing: .05px; }
.suggestion-grid { display: grid; width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; text-align: left; }
.suggestion-card { display: flex; min-height: 73px; align-items: center; gap: 12px; padding: 12px 13px; border: 1px solid var(--border); border-radius: 13px; color: var(--text); background: linear-gradient(135deg,rgba(255,255,255,.035),rgba(255,255,255,.012)); cursor: pointer; text-align: left; transition: border-color .2s, background .2s, transform .2s, box-shadow .2s; }
.suggestion-card:hover { transform: translateY(-2px); border-color: rgba(161,134,242,.38); background: linear-gradient(135deg,rgba(139,92,246,.085),rgba(255,255,255,.02)); box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.suggestion-icon { display: grid; width: 37px; height: 37px; flex: 0 0 auto; place-items: center; border: 1px solid currentColor; border-radius: 11px; }
.suggestion-icon svg { width: 17px; height: 17px; stroke-width: 1.7; }
.suggestion-icon.violet { color: #bb9dff; background: rgba(139,92,246,.12); border-color: rgba(167,139,250,.17); }
.suggestion-icon.blue { color: #86b8ff; background: rgba(59,130,246,.11); border-color: rgba(96,165,250,.17); }
.suggestion-icon.amber { color: #edc17d; background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.16); }
.suggestion-icon.mint { color: #72d9c0; background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.16); }
.suggestion-card-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.suggestion-card-copy strong { color: #e8e7f0; font-size: 11.5px; font-weight: 600; }
.suggestion-card-copy small { overflow: hidden; color: #858598; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-arrow { width: 15px; height: 15px; color: #77768a; opacity: 0; transition: opacity .2s, transform .2s; }
.suggestion-card:hover .suggestion-arrow { opacity: 1; transform: translate(2px,-2px); }
.welcome-footnote { display: flex; align-items: center; gap: 6px; margin-top: 25px; color: #737386; font-size: 9.5px; }
.welcome-footnote svg { width: 13px; height: 13px; color: #7d72a9; }

.message-list { display: flex; width: min(100%, 760px); flex-direction: column; gap: 26px; padding: 28px 0 22px; }
.message { display: flex; align-items: flex-start; gap: 12px; animation: message-in .24s ease both; }
@keyframes message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.message .avatar { width: 30px; height: 30px; border-radius: 10px; }
.ai-avatar { border: 1px solid rgba(173,146,255,.24); background: linear-gradient(145deg,rgba(139,92,246,.17),rgba(59,130,246,.09)); }
.ai-avatar img { width: 25px; height: 25px; }
.message-body { min-width: 0; flex: 1; }
.message-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; }
.message-author { color: #d5d3e0; font: 600 11px 'Manrope',sans-serif; }
.message-time { color: #717184; font-size: 9px; }
.message-content { color: #cbcad5; font-size: 12.5px; line-height: 1.78; overflow-wrap: anywhere; }
.message-content p { margin: 0 0 11px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content h1, .message-content h2, .message-content h3 { margin: 20px 0 9px; color: #f0eef9; font-family: 'Manrope',sans-serif; line-height: 1.35; }
.message-content h1 { font-size: 20px; }
.message-content h2 { font-size: 17px; }
.message-content h3 { font-size: 14px; }
.message-content strong { color: #f2f0f8; font-weight: 600; }
.message-content a { color: #b39aff; text-decoration: underline; text-underline-offset: 2px; }
.message-content ul, .message-content ol { padding-left: 23px; margin: 7px 0 13px; }
.message-content li { padding-left: 3px; margin: 3px 0; }
.message-content blockquote { margin: 12px 0; padding: 7px 13px; border-left: 2px solid #9777e5; border-radius: 0 7px 7px 0; color: #b5b2c5; background: rgba(139,92,246,.065); }
.message-content code:not(pre code) { padding: 2px 5px; border: 1px solid rgba(255,255,255,.07); border-radius: 5px; color: #ccb7ff; background: rgba(139,92,246,.1); font: 11.5px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace; }
.code-block { overflow: hidden; margin: 12px 0 14px; border: 1px solid var(--border); border-radius: 10px; background: #0c0c13; }
.code-header { display: flex; height: 31px; align-items: center; justify-content: space-between; padding: 0 10px; border-bottom: 1px solid rgba(255,255,255,.06); color: #858598; background: rgba(255,255,255,.025); font-size: 9px; }
.code-copy { display: flex; align-items: center; gap: 5px; border: 0; color: #9898aa; background: transparent; cursor: pointer; font-size: 9px; }
.code-copy:hover { color: #eee; }
.code-copy svg { width: 12px; height: 12px; }
.code-block pre { overflow: auto; padding: 12px 14px; margin: 0; color: #d1d0dd; font: 11px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace; tab-size: 2; }
.token-keyword { color: #c792ea; }
.token-string { color: #c3e88d; }
.token-number { color: #f78c6c; }
.token-comment { color: #777f91; font-style: italic; }
.token-function { color: #82aaff; }
.message-content table { width: 100%; margin: 12px 0; border-collapse: collapse; font-size: 11.5px; }
.message-content th, .message-content td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; }
.message-content th { color: #e4dfff; background: rgba(139,92,246,.1); }
.message-content td { color: #bebdca; }
.user-message { justify-content: flex-end; gap: 11px; }
.user-message .avatar { order: 2; color: #e8e2ff; background: linear-gradient(135deg,#604bb2,#362b64); font-size: 11px; font-weight: 700; }
.user-message .message-body { display: flex; flex: 0 1 auto; max-width: min(80%, 620px); flex-direction: column; align-items: flex-end; }
.user-message .message-head { justify-content: flex-end; }
.user-message .message-content { padding: 10px 13px; border: 1px solid rgba(161,132,244,.18); border-radius: 13px 4px 13px 13px; color: #e8e5f1; background: linear-gradient(135deg,rgba(139,92,246,.14),rgba(59,130,246,.07)); }
.user-message .message-content p { margin: 0; }
.user-message .message-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.attachment-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; color: #b8b6c8; background: rgba(255,255,255,.035); font-size: 9px; }
.attachment-pill svg { width: 12px; height: 12px; }
.message-actions { display: flex; gap: 2px; margin-top: 7px; opacity: .76; }
.message-action { display: inline-grid; width: 26px; height: 25px; place-items: center; border: 0; border-radius: 6px; color: #77778c; background: transparent; cursor: pointer; transition: color .16s, background .16s; }
.message-action:hover, .message-action.selected { color: #c2aaff; background: rgba(139,92,246,.12); }
.message-action svg { width: 13px; height: 13px; }
.typing-indicator { display: flex; width: min(100%, 760px); align-items: flex-start; gap: 12px; margin: 0 0 20px; }
.typing-bubble { display: flex; height: 30px; align-items: center; gap: 4px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.025); }
.typing-bubble span { width: 4px; height: 4px; border-radius: 50%; background: #ae91ff; animation: dot-pulse 1.1s infinite ease-in-out; }
.typing-bubble span:nth-child(2) { animation-delay: .14s; }
.typing-bubble span:nth-child(3) { animation-delay: .28s; }
.typing-bubble em { margin-left: 5px; color: #89889b; font-size: 9px; font-style: normal; }
@keyframes dot-pulse { 0%,60%,100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.composer-area { position: relative; z-index: 3; width: min(100%, 820px); align-self: center; padding: 12px 30px 16px; }
.composer-shell { padding: 10px 11px 8px; border: 1px solid rgba(190,180,228,.19); border-radius: 15px; background: linear-gradient(145deg,rgba(25,25,37,.97),rgba(19,19,29,.97)); box-shadow: 0 10px 34px rgba(0,0,0,.26),inset 0 1px rgba(255,255,255,.035); transition: border-color .2s, box-shadow .2s; }
.composer-shell:focus-within { border-color: rgba(158,125,249,.45); box-shadow: 0 10px 34px rgba(0,0,0,.26),0 0 0 3px rgba(139,92,246,.055); }
.composer-shell textarea { display: block; width: 100%; max-height: 190px; min-height: 35px; resize: none; padding: 5px 7px 7px; border: 0; outline: none; color: #f0eef7; background: transparent; font-size: 12.5px; line-height: 1.5; }
.composer-shell textarea::placeholder { color: #77778b; }
.composer-toolbar { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.composer-tools, .composer-actions { display: flex; align-items: center; gap: 5px; }
.composer-tool { display: inline-grid; width: 29px; height: 29px; place-items: center; border: 0; border-radius: 8px; color: #8e8ea0; background: transparent; cursor: pointer; transition: color .18s, background .18s; }
.composer-tool:hover, .composer-tool.recording { color: #d2c2ff; background: rgba(139,92,246,.12); }
.composer-tool svg { width: 15px; height: 15px; }
.tool-divider { width: 1px; height: 16px; margin: 0 3px; background: var(--border); }
.composer-model-trigger { display: flex; height: 28px; align-items: center; gap: 6px; padding: 0 7px; border: 0; border-radius: 7px; color: #9291a3; background: transparent; cursor: pointer; font-size: 10px; transition: color .18s, background .18s; }
.composer-model-trigger:hover, .composer-model-trigger[aria-expanded="true"] { color: #d8d1ec; background: rgba(255,255,255,.045); }
.composer-model-trigger > svg:first-child { width: 13px; height: 13px; color: #aa8aff; }
.composer-model-trigger .model-chevron { width: 12px; height: 12px; }
.composer-model-menu { right: auto; bottom: calc(100% + 10px); top: auto; left: 0; }
.send-button { display: grid; width: 31px; height: 31px; place-items: center; border: 0; border-radius: 9px; color: white; background: linear-gradient(145deg,#9b72ff,#7448db); box-shadow: 0 3px 10px rgba(125,77,229,.25); cursor: pointer; transition: transform .18s, filter .18s, opacity .18s; }
.send-button:hover { transform: translateY(-1px); filter: brightness(1.13); }
.send-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.send-button svg { width: 17px; height: 17px; stroke-width: 2.1; }
.send-button.stop-button { color: #f0c4c4; background: rgba(209,91,91,.18); box-shadow: none; }
.send-button.stop-button:hover { background: rgba(209,91,91,.29); filter: none; }
.send-button.stop-button svg { width: 14px; height: 14px; fill: currentColor; }
.composer-disclaimer { margin: 8px 0 0; color: #666679; font-size: 9px; text-align: center; }
.service-indicator { display: inline-block; width: 5px; height: 5px; margin: 0 5px 1px 0; border-radius: 50%; background: #c09255; }
.disclaimer-separator { padding: 0 4px; color: #444454; }
.composer-disclaimer kbd { width: auto; min-width: 0; height: 15px; padding: 0 4px; border-color: rgba(255,255,255,.1); font-size: 8px; }
.attachment-preview { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px 8px; }
.attachment-chip { display: inline-flex; max-width: 180px; align-items: center; gap: 6px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; color: #bbb8c8; background: rgba(255,255,255,.035); font-size: 9px; }
.attachment-chip svg { width: 12px; height: 12px; color: #a58bef; }
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { display: grid; width: 15px; height: 15px; place-items: center; padding: 0; border: 0; color: #818194; background: transparent; cursor: pointer; }
.attachment-chip button svg { width: 11px; height: 11px; }

.toast-region { position: fixed; z-index: 50; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; min-width: 220px; align-items: center; gap: 8px; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 10px; color: #e8e6f0; background: #1b1b27; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .22s ease both; }
.toast svg { width: 15px; height: 15px; color: #91dbb6; }
.toast.error svg { color: #f39a9a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.modal-backdrop { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(3,3,8,.7); backdrop-filter: blur(7px); }
.modal-card { width: min(100%, 390px); padding: 20px; border: 1px solid var(--border-strong); border-radius: 17px; background: #171721; box-shadow: 0 24px 80px rgba(0,0,0,.45); animation: welcome-in .2s ease both; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; }
.modal-icon { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(166,138,255,.18); border-radius: 10px; color: #bb9dff; background: rgba(139,92,246,.12); }
.modal-icon svg { width: 16px; height: 16px; }
.modal-card h2 { margin: 15px 0 7px; font: 700 17px 'Manrope',sans-serif; }
.modal-card p { margin: 0 0 16px; color: #9796a8; font-size: 11px; line-height: 1.6; white-space: pre-line; }
.modal-input { width: 100%; height: 39px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 9px; color: var(--text); background: rgba(255,255,255,.035); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.secondary-button, .primary-button { height: 34px; padding: 0 12px; border-radius: 8px; cursor: pointer; font-size: 10.5px; font-weight: 600; }
.secondary-button { border: 1px solid var(--border); color: #b4b3c2; background: transparent; }
.secondary-button:hover { background: rgba(255,255,255,.05); }
.primary-button { border: 1px solid rgba(169,143,255,.3); color: white; background: #7956cf; }
.primary-button:hover { background: #8965df; }
.mobile-scrim { display: none; }

body.light-theme {
  color-scheme: light;
  --bg: #f5f5fa;
  --sidebar: #eeedf4;
  --surface: #fff;
  --surface-raised: #e9e8f0;
  --surface-soft: rgba(35,30,65,.04);
  --text: #181625;
  --muted: #6d6c7d;
  --faint: #858496;
  --border: rgba(44,40,74,.11);
  --border-strong: rgba(44,40,74,.19);
  --shadow: 0 20px 70px rgba(48,38,78,.17);
}
body.light-theme .main-panel { background: var(--bg); }
body.light-theme .main-panel::before { background: radial-gradient(ellipse,rgba(139,92,246,.1),transparent 69%); }
body.light-theme .topbar { border-bottom-color: var(--border); }
body.light-theme .conversation-title, body.light-theme .welcome-screen h1, body.light-theme .suggestion-card-copy strong { color: #242135; }
body.light-theme .welcome-screen h1 span { color: #7455bc; }
body.light-theme .welcome-subtitle, body.light-theme .suggestion-card-copy small { color: #757387; }
body.light-theme .suggestion-card { background: rgba(255,255,255,.68); }
body.light-theme .suggestion-card:hover { background: #fff; }
body.light-theme .composer-shell { border-color: rgba(74,61,120,.2); background: rgba(255,255,255,.94); }
body.light-theme .composer-shell textarea { color: #262337; }
body.light-theme .message-content { color: #3b3948; }
body.light-theme .message-content h1, body.light-theme .message-content h2, body.light-theme .message-content h3, body.light-theme .message-content strong { color: #211f2d; }
body.light-theme .user-message .message-content { color: #353044; background: rgba(139,92,246,.09); }
body.light-theme .model-menu, body.light-theme .modal-card { background: #fff; }
body.light-theme .conversation-context-menu { background: #fff; }
body.light-theme .context-menu-item { color: #4a4857; }
body.light-theme .context-menu-item:hover { color: #282536; background: rgba(44,40,74,.06); }
body.light-theme .model-option, body.light-theme .modal-card h2 { color: #242135; }
body.light-theme .model-option-copy small, body.light-theme .modal-card p { color: #717083; }
body.light-theme .code-block { background: #17151f; }
body.light-theme .conversation-item.active { color: #44326e; }
body.light-theme .sidebar-bottom .profile-copy strong { color: #292637; }
body.light-theme .profile-copy small { color: #777588; }
body.light-theme .chat-scroll { scrollbar-color: #c5c2d2 transparent; }

body.sidebar-collapsed .sidebar { flex-basis: 74px; width: 74px; padding-right: 10px; padding-left: 10px; }
body.sidebar-collapsed .brand-copy, body.sidebar-collapsed .sidebar .sidebar-collapse, body.sidebar-collapsed .new-chat-button span, body.sidebar-collapsed .new-chat-button kbd,
body.sidebar-collapsed .search-box input, body.sidebar-collapsed .search-box kbd, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .nav-link span,
body.sidebar-collapsed .section-heading, body.sidebar-collapsed .conversation-item .item-title, body.sidebar-collapsed .conversation-item .item-pin,
body.sidebar-collapsed .conversation-menu-button, body.sidebar-collapsed .project-item span, body.sidebar-collapsed .profile-copy, body.sidebar-collapsed .profile-card .tiny-icon-button { display: none !important; }
body.sidebar-collapsed .sidebar-top { justify-content: center; padding: 0; }
body.sidebar-collapsed .new-chat-button { justify-content: center; padding: 0; }
body.sidebar-collapsed .search-box { justify-content: center; padding: 0; }
body.sidebar-collapsed .conversation-item { justify-content: center; padding: 0; }
body.sidebar-collapsed .conversation-item::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
body.sidebar-collapsed .nav-link { justify-content: center; padding: 0; }
body.sidebar-collapsed .project-item { justify-content: center; padding: 0; }
body.sidebar-collapsed .sidebar-bottom .nav-link { margin-top: 0; }
body.sidebar-collapsed .sidebar-bottom .nav-link > svg { margin: auto; }
body.sidebar-collapsed .profile-card { justify-content: center; padding: 0; }
body.sidebar-collapsed .desktop-open-button { display: inline-grid; }

@media (max-width: 900px) {
  .sidebar { flex-basis: 246px; width: 246px; }
  .topbar { padding-right: 20px; padding-left: 20px; }
  .chat-content { padding-right: 22px; padding-left: 22px; }
  .composer-area { padding-right: 22px; padding-left: 22px; }
}
@media (max-width: 680px) {
  body { overflow: hidden; }
  .sidebar { position: fixed; z-index: 31; inset: 0 auto 0 0; width: min(290px,86vw); flex-basis: auto; transform: translateX(-102%); box-shadow: 16px 0 45px rgba(0,0,0,.28); }
  body.mobile-nav-open .sidebar { transform: translateX(0); }
  .mobile-scrim { position: fixed; z-index: 30; inset: 0; background: rgba(0,0,0,.48); backdrop-filter: blur(2px); }
  body.mobile-nav-open .mobile-scrim { display: block; }
  body.sidebar-collapsed .sidebar { width: min(290px,86vw); }
  body.sidebar-collapsed .brand-copy, body.sidebar-collapsed .new-chat-button span, body.sidebar-collapsed .new-chat-button kbd,
  body.sidebar-collapsed .search-box input, body.sidebar-collapsed .search-box kbd, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .nav-link span,
  body.sidebar-collapsed .section-heading, body.sidebar-collapsed .conversation-item .item-title, body.sidebar-collapsed .conversation-item .item-pin,
  body.sidebar-collapsed .conversation-menu-button, body.sidebar-collapsed .project-item span, body.sidebar-collapsed .profile-copy, body.sidebar-collapsed .profile-card .tiny-icon-button { display: initial !important; }
  body.sidebar-collapsed .sidebar .sidebar-collapse { display: inline-grid !important; }
  body.sidebar-collapsed .sidebar-top { justify-content: space-between; padding: 0 5px 0 6px; }
  body.sidebar-collapsed .new-chat-button { justify-content: flex-start; padding: 0 11px; }
  body.sidebar-collapsed .search-box { justify-content: flex-start; padding: 0 9px; }
  body.sidebar-collapsed .conversation-item { justify-content: flex-start; padding: 0 7px 0 9px; }
  body.sidebar-collapsed .conversation-item::before { display: none; }
  body.sidebar-collapsed .nav-link { justify-content: flex-start; padding: 0 9px; }
  body.sidebar-collapsed .project-item { justify-content: flex-start; padding: 0 10px; }
  body.sidebar-collapsed .profile-card { justify-content: flex-start; padding: 0 6px; }
  .topbar { height: 58px; flex-basis: 58px; padding: 0 12px; }
  .topbar-left { gap: 7px; }
  .mobile-menu-button { display: inline-grid; }
  .desktop-open-button { display: none !important; }
  .conversation-title { max-width: 150px; font-size: 11.5px; }
  .title-meta { font-size: 8.5px; }
  .topbar-actions { gap: 1px; }
  .topbar-actions > .icon-button { width: 30px; height: 30px; }
  .topbar-actions > .icon-button svg { width: 15px; height: 15px; }
  .model-trigger { width: 31px; height: 31px; justify-content: center; padding: 0; }
  .model-trigger #header-model-name, .model-trigger .model-chevron, .action-divider { display: none; }
  .model-sparkle { width: 23px; height: 23px; }
  .model-menu { right: -52px; }
  .chat-content { padding: 15px 15px 8px; }
  .welcome-screen { justify-content: center; padding-top: 0; }
  .welcome-orbit { width: 78px; height: 78px; margin-bottom: 18px; }
  .orbit-core { width: 46px; height: 46px; border-radius: 16px; }
  .orbit-core img { width: 37px; height: 37px; }
  .welcome-screen h1 { max-width: 350px; font-size: clamp(26px,8vw,34px); letter-spacing: -1.2px; }
  .welcome-subtitle { margin: 9px 0 22px; font-size: 12px; }
  .suggestion-grid { gap: 8px; }
  .suggestion-card { min-height: 69px; gap: 9px; padding: 9px; }
  .suggestion-icon { width: 32px; height: 32px; border-radius: 9px; }
  .suggestion-icon svg { width: 15px; height: 15px; }
  .suggestion-card-copy strong { font-size: 10px; }
  .suggestion-card-copy small { font-size: 9px; }
  .suggestion-arrow { display: none; }
  .welcome-footnote { margin-top: 18px; font-size: 8.5px; }
  .message-list { gap: 20px; padding-top: 18px; }
  .message { gap: 9px; }
  .message-content { font-size: 12px; }
  .user-message .message-body { max-width: 84%; }
  .composer-area { padding: 8px 10px calc(11px + env(safe-area-inset-bottom)); }
  .composer-shell { border-radius: 13px; padding: 8px 8px 6px; }
  .composer-shell textarea { font-size: 12px; }
  .composer-disclaimer { font-size: 8px; }
  .composer-model-trigger { max-width: 132px; }
  .composer-model-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .toast-region { right: 12px; bottom: 12px; left: 12px; }
  .toast { min-width: 0; width: fit-content; max-width: 100%; align-self: flex-end; }
}
@media (max-width: 380px) {
  .topbar { padding-right: 8px; padding-left: 8px; }
  .topbar-left { gap: 2px; }
  .conversation-title { max-width: 112px; }
  .topbar-actions > .icon-button { width: 27px; }
  .suggestion-card { gap: 7px; padding: 8px 7px; }
  .suggestion-icon { width: 29px; height: 29px; }
  .suggestion-card-copy small { max-width: 112px; }
}

.auth-screen { position: fixed; z-index: 60; inset: 0; display: grid; min-height: 100dvh; place-items: center; overflow: auto; padding: 28px 16px; background: radial-gradient(ellipse at 50% 24%,rgba(139,92,246,.13),transparent 54%),var(--bg); }
.auth-card { width: min(100%,420px); padding: 34px; border: 1px solid var(--border-strong); border-radius: 22px; background: rgba(20,20,31,.94); box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 30px; color: var(--text); text-decoration: none; }
.auth-brand img { width: 42px; height: 42px; }
.auth-brand span { display: flex; flex-direction: column; gap: 2px; }
.auth-brand strong { font: 800 17px/1.1 'Manrope',sans-serif; letter-spacing: -.5px; }
.auth-brand small { color: #77778f; font-size: 8px; font-weight: 700; letter-spacing: 1.65px; }
.auth-card .eyebrow { margin: 0 0 11px; font-size: 8px; }
.auth-card h1 { margin: 0 0 8px; text-align: center; font: 700 24px/1.25 'Manrope',sans-serif; letter-spacing: -.7px; }
.auth-description { min-height: 38px; margin: 0 0 22px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.6; }
.auth-card form { display: grid; gap: 14px; }
.auth-card label { display: grid; gap: 7px; color: #c6c3d4; font-size: 11px; font-weight: 600; }
.auth-card input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 9px; color: var(--text); background: rgba(255,255,255,.035); font-size: 13px; }
.auth-card input:focus { border-color: rgba(139,92,246,.65); outline: 2px solid rgba(139,92,246,.15); }
.auth-submit { width: 100%; height: 42px; margin-top: 3px; font-size: 12px; }
.auth-submit:disabled { opacity: .65; cursor: wait; }
.auth-text-button { display: block; width: 100%; padding: 9px 5px 0; border: 0; color: #b69bff; background: transparent; cursor: pointer; font-size: 11px; }
.auth-text-button:hover { color: #d3c4ff; }
.auth-footnote { margin: 22px 0 0; color: var(--faint); text-align: center; font-size: 10px; line-height: 1.6; }
.auth-notice { padding: 10px 12px; border: 1px solid rgba(111,203,159,.25); border-radius: 8px; color: #a9e3c2; background: rgba(69,171,111,.08); font-size: 11px; line-height: 1.5; }
.auth-notice.error { border-color: rgba(225,115,115,.28); color: #f0aaaa; background: rgba(225,85,85,.08); }
.profile-popover { position: fixed; z-index: 45; width: 190px; padding: 5px; border: 1px solid var(--border-strong); border-radius: 10px; background: #191923; box-shadow: var(--shadow); }
.profile-popover button { display: block; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 7px; color: #c3c1cf; background: transparent; text-align: left; cursor: pointer; font-size: 11px; }
.profile-popover button:hover { color: var(--text); background: rgba(255,255,255,.07); }
body.light-theme .auth-card { background: rgba(255,255,255,.94); }
body.light-theme .auth-card label { color: #4a4857; }
body.light-theme .auth-card input { color: #242135; background: rgba(44,40,74,.035); }
body.light-theme .profile-popover { background: #fff; }
body.light-theme .profile-popover button { color: #4a4857; }
body.light-theme .profile-popover button:hover { color: #282536; background: rgba(44,40,74,.06); }
@media (max-width: 480px) {
  .auth-card { padding: 26px 21px; border-radius: 17px; }
  .auth-brand { margin-bottom: 24px; }
}
