:root {
  color-scheme: dark;
  --bg: #080b15;
  --panel: rgba(18, 23, 40, 0.78);
  --panel-solid: #121728;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f6ff;
  --muted: #8f98b5;
  --faint: #5f6884;
  --violet: #9d8cff;
  --blue: #70b8ff;
  --green: #6fe2b4;
  --orange: #ffb676;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { overflow-x: hidden; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }

.ambient { position: fixed; pointer-events: none; border-radius: 999px; filter: blur(70px); opacity: .16; z-index: 0; }
.ambient-one { width: 420px; height: 420px; background: #5f42e8; top: -190px; left: -130px; }
.ambient-two { width: 380px; height: 380px; background: #0e9fba; right: -180px; bottom: -180px; }
.glass-card { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.hidden { display: none !important; }
.mobile-only { display: none; }
.eyebrow { color: var(--violet); font-size: 10px; font-weight: 800; letter-spacing: .19em; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.login-card { width: min(430px, 100%); border-radius: 28px; padding: 40px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, #a995ff, #6e5be9); color: white; font-size: 19px; box-shadow: 0 8px 24px rgba(125, 101, 255, .32); }
.brand-mark.large { width: 54px; height: 54px; border-radius: 18px; font-size: 28px; margin-bottom: 24px; }
.login-card h1 { font-size: clamp(34px, 8vw, 48px); line-height: 1.02; letter-spacing: -.055em; margin: 12px 0 16px; }
.login-card h1 span, .welcome-view h2 span { color: var(--muted); }
.login-card p, .welcome-copy, .modal-copy { color: var(--muted); line-height: 1.65; margin: 0; }
.stack-form { display: grid; gap: 10px; margin-top: 28px; }
.stack-form label { color: #c8cde0; font-size: 12px; font-weight: 700; }
.stack-form input { width: 100%; border: 1px solid var(--line-strong); background: rgba(5, 8, 18, .62); color: var(--text); border-radius: 13px; padding: 14px 15px; outline: none; }
.stack-form input:focus, textarea:focus { border-color: rgba(157, 140, 255, .75); box-shadow: 0 0 0 4px rgba(157, 140, 255, .1); }
.primary-button, .secondary-button { border-radius: 12px; padding: 12px 16px; font-weight: 800; transition: .2s ease; }
.primary-button { background: linear-gradient(135deg, #a796ff, #7060ed); color: white; box-shadow: 0 12px 28px rgba(113, 94, 238, .28); }
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.secondary-button { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: #d4d8e9; }
.secondary-button:hover { background: rgba(255, 255, 255, .1); }
.form-error { min-height: 18px; color: #ff8f9e; font-size: 12px; }

.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; padding: 16px; gap: 16px; }
.sidebar { width: 270px; min-height: calc(100vh - 32px); border-radius: 24px; display: flex; flex-direction: column; padding: 18px 14px; flex-shrink: 0; }
.sidebar-top { padding: 4px 4px 22px; }
.brand-row { display: flex; align-items: center; gap: 11px; padding: 0 3px 22px; }
.brand-name { font-weight: 900; letter-spacing: -.02em; }
.brand-subtitle { color: var(--faint); font-size: 10px; margin-top: 2px; }
.brand-row .brand-mark { flex-shrink: 0; }
.new-chat-button { width: 100%; text-align: left; padding: 12px 13px; border-radius: 12px; color: #e5e3ff; background: linear-gradient(135deg, rgba(139, 119, 255, .22), rgba(79, 78, 184, .13)); border: 1px solid rgba(157, 140, 255, .22); font-weight: 700; }
.new-chat-button span { color: var(--violet); margin-right: 6px; font-size: 18px; vertical-align: -1px; }
.sidebar-section-label { color: var(--faint); text-transform: uppercase; font-size: 9px; font-weight: 800; letter-spacing: .16em; padding: 0 10px 10px; }
.conversation-list { flex: 1; overflow-y: auto; min-height: 100px; }
.conversation-item { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 10px; color: #aeb6d0; font-size: 12px; margin-bottom: 3px; }
.conversation-item:hover, .conversation-item.active { background: rgba(255, 255, 255, .06); color: white; }
.conversation-item span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-bottom { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 3px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; color: #9ba5c1; text-align: left; font-size: 12px; padding: 10px; border-radius: 10px; }
.sidebar-link:hover { background: rgba(255, 255, 255, .05); color: white; }
.sidebar-link span { width: 16px; text-align: center; color: var(--violet); }
.sidebar-link b { margin-left: auto; font-weight: 500; color: var(--faint); }
.sidebar-link.muted { color: var(--faint); }

.main-panel { min-width: 0; flex: 1; min-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.topbar { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.topbar-title { display: flex; align-items: center; gap: 9px; color: #c9cee0; font-size: 13px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; background: var(--green); box-shadow: 0 0 12px var(--green); border-radius: 99px; }
.topbar-pill { font-size: 9px; font-weight: 600; color: var(--faint); border: 1px solid var(--line); border-radius: 99px; padding: 4px 8px; }
.model-select { max-width: 230px; margin-left: auto; margin-right: 8px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .055); color: #cbd2e8; padding: 8px 28px 8px 10px; outline: none; font-size: 11px; }
.model-select:focus { border-color: rgba(157, 140, 255, .65); }
.icon-button { background: transparent; color: #98a2bf; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-size: 17px; }
.icon-button:hover { background: rgba(255, 255, 255, .07); color: white; }
.chat-area { flex: 1; overflow-y: auto; padding: 10px max(12px, 4vw) 24px; display: flex; flex-direction: column; }
.welcome-view { max-width: 730px; width: 100%; margin: auto; text-align: center; padding: 30px 0 10px; }
.hero-orbit { width: 92px; height: 92px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(157, 140, 255, .3); box-shadow: 0 0 0 12px rgba(157, 140, 255, .04), 0 0 50px rgba(116, 93, 242, .18); }
.hero-core { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 20px; background: linear-gradient(135deg, #b3a6ff, #6355df); font-size: 27px; box-shadow: 0 9px 25px rgba(103, 83, 220, .42); }
.welcome-view h2 { font-size: clamp(30px, 5vw, 49px); line-height: 1.06; letter-spacing: -.06em; margin: 12px 0 14px; }
.welcome-copy { max-width: 470px; margin: 0 auto 28px; font-size: 14px; }
.suggestion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: left; }
.suggestion-card { display: grid; grid-template-columns: 38px 1fr 18px; gap: 10px; align-items: center; padding: 13px; border-radius: 15px; background: rgba(255, 255, 255, .045); border: 1px solid var(--line); color: #e0e4f4; text-align: left; transition: .2s ease; }
.suggestion-card:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .08); border-color: var(--line-strong); }
.suggestion-card b { display: block; font-size: 12px; margin-bottom: 4px; }
.suggestion-card small { display: block; color: var(--faint); font-size: 10px; }
.suggestion-card i { color: var(--faint); font-style: normal; }
.suggestion-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; font-size: 13px; font-weight: 900; }
.suggestion-icon.violet { color: #c4baff; background: rgba(157, 140, 255, .16); }.suggestion-icon.blue { color: #8bc9ff; background: rgba(112, 184, 255, .15); }.suggestion-icon.orange { color: #ffc18e; background: rgba(255, 182, 118, .15); }.suggestion-icon.green { color: #8af0ca; background: rgba(111, 226, 180, .15); }
.message-list { max-width: 780px; width: 100%; margin: 0 auto; display: grid; gap: 18px; }
.message { display: flex; gap: 11px; align-items: flex-start; animation: rise .2s ease; }
.message.user { justify-content: flex-end; }
.message-avatar { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(135deg, #a796ff, #6b5bdd); font-size: 14px; }
.message.user .message-avatar { order: 2; background: linear-gradient(135deg, #2a3551, #1b253c); color: #b4c3ec; }
.message-body { max-width: min(84%, 680px); color: #dce1f1; line-height: 1.65; font-size: 14px; }
.message.user .message-body { background: linear-gradient(135deg, rgba(93, 83, 178, .36), rgba(43, 52, 88, .55)); border: 1px solid rgba(157, 140, 255, .17); padding: 11px 14px; border-radius: 16px 4px 16px 16px; }
.message.assistant .message-body { padding: 3px 0; }
.message-body p { margin: 0 0 10px; }.message-body p:last-child { margin-bottom: 0; }
.message-body pre { margin: 10px 0; overflow-x: auto; background: #070a12; border: 1px solid var(--line); padding: 12px; border-radius: 11px; font-size: 12px; line-height: 1.5; }.message-body code { font-family: "SFMono-Regular", Consolas, monospace; }.message-body :not(pre) > code { color: #d4caff; background: rgba(157, 140, 255, .12); border-radius: 5px; padding: 2px 5px; }
.file-chip { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; padding: 6px 9px; color: #bac4e4; background: rgba(7, 10, 20, .35); border: 1px solid var(--line); border-radius: 8px; font-size: 11px; }
.typing { display: inline-flex; gap: 4px; padding: 11px 0; }.typing i { width: 5px; height: 5px; border-radius: 99px; background: var(--violet); animation: blink 1s infinite; }.typing i:nth-child(2) { animation-delay: .15s; }.typing i:nth-child(3) { animation-delay: .3s; }
.composer-wrap { width: min(780px, 100%); margin: auto; padding: 0 max(12px, 4vw) 13px; }
.composer { min-height: 60px; display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-radius: 18px; }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: white; line-height: 1.45; padding: 9px 3px; max-height: 140px; }
.composer textarea::placeholder { color: #68718d; }
.composer-icon { width: 36px; height: 36px; border-radius: 11px; background: rgba(255, 255, 255, .06); color: #9ba6c4; font-size: 22px; line-height: 1; }
.composer-icon:hover { background: rgba(255, 255, 255, .12); color: white; }
.send-button { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #a493ff, #6d5de6); color: white; font-size: 22px; font-weight: 800; box-shadow: 0 7px 18px rgba(110, 91, 227, .3); }
.send-button:disabled { opacity: .45; cursor: wait; }
.composer-meta { display: flex; justify-content: space-between; gap: 10px; color: #565f78; font-size: 10px; padding: 9px 4px 0; }.composer-meta span:first-child { color: #7781a0; }
.file-preview { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }.file-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px; background: rgba(18, 23, 40, .9); border: 1px solid var(--line-strong); border-radius: 9px; color: #c8d0e8; font-size: 11px; }.file-pill button { background: transparent; color: #74809c; padding: 0 2px; }.file-pill button:hover { color: #ff91a0; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; background: rgba(2, 4, 10, .72); backdrop-filter: blur(8px); }.modal-card { width: min(500px, 100%); border-radius: 22px; padding: 24px; }.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }.modal-header h3 { margin: 7px 0 0; font-size: 24px; letter-spacing: -.04em; }.modal-copy { font-size: 12px; margin-top: 12px; }.connection-box { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .035); border-radius: 13px; padding: 12px; margin-top: 18px; }.connection-box small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }.connection-box .text-link { margin-left: auto; color: var(--violet); font-size: 11px; }.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 3px; }.provider-note { margin-top: 18px; padding: 12px; border-radius: 12px; background: rgba(112, 184, 255, .07); border: 1px solid rgba(112, 184, 255, .14); color: #9db0d0; font-size: 11px; line-height: 1.55; }.provider-note b { display: block; color: #c8d8fa; margin-bottom: 3px; }.full-button { width: 100%; margin-top: 11px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 30; background: #202942; border: 1px solid var(--line-strong); color: #e9edfb; border-radius: 10px; padding: 10px 14px; font-size: 12px; box-shadow: var(--shadow); transition: .25s ease; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } } @keyframes blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 760px) { .model-select { max-width: 120px; margin-left: 6px; margin-right: 4px; padding: 8px 20px 8px 7px; font-size: 10px; } }

@media (max-width: 760px) {
  .app-shell { padding: 0; gap: 0; }.main-panel { min-height: 100vh; }.sidebar { position: fixed; inset: 10px auto 10px 10px; z-index: 10; width: min(290px, calc(100vw - 32px)); min-height: calc(100vh - 20px); transform: translateX(-120%); transition: transform .24s ease; }.sidebar.open { transform: translateX(0); }.mobile-only { display: grid; }.topbar { padding: 8px 12px 0; height: 58px; }.topbar-title { margin: auto; }.topbar-pill { display: none; }.chat-area { padding: 10px 14px 18px; }.welcome-view { padding: 20px 0 10px; }.welcome-view h2 { font-size: 35px; }.suggestion-grid { grid-template-columns: 1fr; gap: 8px; }.suggestion-card { padding: 11px; }.composer-wrap { padding: 0 12px 12px; }.composer-meta { padding-left: 2px; padding-right: 2px; }.composer-meta span:last-child { display: none; }.message-body { font-size: 13px; max-width: 87%; }.login-card { padding: 28px 23px; }.modal-card { padding: 20px; }.connection-box .text-link { font-size: 10px; }.brand-row .mobile-only { margin-left: auto; }
}
