:root {
  color-scheme: dark;
  --bg: #090b0a;
  --panel: #131715;
  --panel-soft: #191e1b;
  --line: rgba(228, 241, 232, .09);
  --text: #eef3ef;
  --muted: #9aa8a0;
  --green: #a8e5c2;
  --green-strong: #74c99b;
  --blue: #6c91ff;
  --danger: #ff9a9a;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  background: radial-gradient(ellipse at 50% 0%, rgba(54, 103, 73, .11), transparent 43%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .01em;
}
button, textarea { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.topbar { height: 82px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand-lockup, .header-actions { display: flex; align-items: center; gap: 14px; }
.brand-mark { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #0a0c0b; background: #f5f8f5; overflow: hidden; font-family: Georgia, serif; font-size: 35px; font-weight: 700; font-style: italic; }
.brand-mark span { transform: translate(-1px, -1px); }
.brand-mark i { position: absolute; width: 40px; height: 13px; border: 2px solid #111; border-radius: 50%; transform: rotate(-32deg); }
.brand-mark.large { width: 66px; height: 66px; border-radius: 20px; font-size: 53px; }
.brand-lockup h1 { margin: 0; font-size: 19px; font-weight: 680; letter-spacing: -.03em; }
.brand-lockup p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.model-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; color: #cbd7cf; font-size: 12px; background: rgba(255,255,255,.025); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-strong); box-shadow: 0 0 12px rgba(116,201,155,.6); }
.icon-button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-soft); border: 1px solid var(--line); cursor: pointer; transition: transform .18s ease, background .18s ease; }
.icon-button:hover { transform: rotate(90deg); background: #222a25; }
.icon-button svg, .tool-button svg, .send-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.messages { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; width: 100%; padding: 28px 0 22px; }
.welcome-card { width: min(100%, 650px); margin: auto; text-align: center; padding: 42px 20px 52px; animation: rise .45s ease both; }
.welcome-mark { display: flex; justify-content: center; margin-bottom: 23px; }
.eyebrow { color: var(--green); text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: .2em; }
.welcome-card h2 { margin: 9px 0 10px; font-size: clamp(27px, 5vw, 38px); letter-spacing: -.045em; font-weight: 650; }
.welcome-copy { max-width: 480px; margin: 0 auto; color: var(--muted); line-height: 1.7; font-size: 14px; }
.suggestions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.suggestions button { padding: 9px 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #c8d3cc; font-size: 12px; cursor: pointer; transition: border .18s ease, color .18s ease, background .18s ease; }
.suggestions button:hover { border-color: rgba(168,229,194,.38); color: var(--green); background: rgba(116,201,155,.07); }
.message-list { width: min(100%, 780px); margin: 0 auto; display: flex; flex-direction: column; gap: 25px; }
.message { display: flex; gap: 13px; align-items: flex-start; animation: rise .24s ease both; }
.message.user { justify-content: flex-end; }
.message.user .message-body { max-width: min(78%, 610px); padding: 14px 18px; border-radius: 21px 21px 6px 21px; background: #202923; border: 1px solid rgba(168,229,194,.08); color: #eff5f0; white-space: pre-wrap; line-height: 1.58; overflow-wrap: anywhere; }
.message.assistant .message-body { flex: 1; min-width: 0; padding-top: 7px; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; color: #e5ebe6; }
.assistant-avatar { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--green); color: #102017; font-family: Georgia, serif; font-weight: 700; font-size: 20px; font-style: italic; }
.message.error .message-body { color: var(--danger); }
.sources { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; }
.sources-label { width: 100%; color: var(--muted); font-size: 11px; }
.source-link { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: #b7d9c4; text-decoration: none; font-size: 11px; }
.source-link:hover { border-color: rgba(168,229,194,.38); background: rgba(116,201,155,.07); }
.source-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-link svg { flex: 0 0 13px; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.typing-row { width: min(100%, 780px); margin: 0 auto; display: flex; align-items: center; gap: 13px; padding-top: 25px; animation: rise .2s ease both; }
.typing-card { display: flex; align-items: center; gap: 5px; min-height: 34px; color: var(--muted); font-size: 12px; }
.typing-card b { width: 4px; height: 4px; border-radius: 50%; background: var(--green); animation: pulse 1s ease-in-out infinite; }
.typing-card b:nth-last-child(2) { animation-delay: .15s; }
.typing-card b:nth-last-child(1) { animation-delay: .3s; }
.typing-orbit { width: 23px; height: 23px; position: relative; display: inline-grid; place-items: center; border: 1px solid rgba(168,229,194,.28); border-radius: 50%; margin-right: 4px; animation: spin 1.3s linear infinite; }
.typing-orbit i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.setup-warning { width: min(100%, 780px); margin: 0 auto 12px; padding: 11px 14px; border-radius: 13px; background: rgba(255, 196, 97, .08); border: 1px solid rgba(255,196,97,.18); color: #f0d5a4; font-size: 12px; }
.setup-warning code { color: #fff0cf; }
.composer-wrap { flex: 0 0 auto; width: min(100%, 780px); margin: 0 auto; padding: 10px 0 max(14px, env(safe-area-inset-bottom)); }
.composer { min-height: 60px; display: flex; align-items: flex-end; gap: 9px; padding: 8px 9px 8px 12px; border: 1px solid rgba(223,239,227,.12); border-radius: 21px; background: linear-gradient(135deg, #151a17, #111412); box-shadow: 0 14px 35px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.025); }
.composer:focus-within { border-color: rgba(168,229,194,.35); box-shadow: 0 0 0 3px rgba(116,201,155,.07), 0 14px 35px rgba(0,0,0,.22); }
.tool-button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); cursor: pointer; transition: color .18s ease, background .18s ease; }
.tool-button svg { width: 18px; height: 18px; }
.tool-button span { font-size: 12px; }
.tool-button:hover, .tool-button[aria-pressed="true"] { color: var(--green); background: rgba(116,201,155,.1); }
.composer textarea { flex: 1; min-width: 0; max-height: 180px; resize: none; border: 0; outline: 0; padding: 10px 2px 8px; background: transparent; color: var(--text); line-height: 1.45; font-size: 15px; }
.composer textarea::placeholder { color: #829087; }
.send-button { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #101718; background: var(--green); cursor: pointer; transition: transform .16s ease, background .16s ease, opacity .16s ease; }
.send-button:hover:not(:disabled) { transform: translateY(-2px); background: #c1f2d4; }
.send-button:disabled { cursor: default; opacity: .4; }
.send-button svg { width: 21px; height: 21px; stroke-width: 2.2; }
.privacy-note { text-align: center; margin: 9px 0 0; color: #77837b; font-size: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-3px); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  .app-shell { padding: 0 14px; }
  .topbar { height: 70px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .brand-lockup h1 { font-size: 17px; }
  .brand-lockup p { font-size: 10px; }
  .model-pill { padding: 8px 10px; font-size: 0; gap: 0; }
  .status-dot { width: 8px; height: 8px; }
  .header-actions { gap: 8px; }
  .messages { padding-top: 10px; }
  .welcome-card { padding: 24px 4px 38px; }
  .welcome-copy { font-size: 13px; }
  .suggestions { gap: 7px; margin-top: 20px; }
  .suggestions button { font-size: 11px; padding: 8px 10px; }
  .message-list, .typing-row { gap: 10px; }
  .message { gap: 9px; }
  .message.user .message-body { max-width: 88%; padding: 12px 15px; border-radius: 19px 19px 5px 19px; font-size: 14px; }
  .message.assistant .message-body { font-size: 14px; line-height: 1.66; }
  .assistant-avatar { width: 26px; height: 26px; flex-basis: 26px; }
  .composer { min-height: 56px; border-radius: 19px; gap: 4px; padding: 7px; }
  .tool-button { min-height: 40px; padding: 0 8px; }
  .composer textarea { font-size: 14px; }
  .send-button { width: 40px; height: 40px; flex-basis: 40px; }
  .privacy-note { font-size: 9px; }
}
