:root {
  color-scheme: dark;
  --bg: #0b0b0d;
  --sidebar: #101014;
  --panel: #151519;
  --panel-2: #19191e;
  --ink: #f2f0e9;
  --muted: #929197;
  --dim: #64636a;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .14);
  --lime: #b6ff6a;
  --violet: #a994ff;
  --orange: #ff976d;
  --sidebar-width: 274px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; overflow: hidden; color: var(--ink); background: var(--bg); }
button, textarea { color: inherit; font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); height: 100dvh; }
.sidebar { display: flex; min-height: 0; flex-direction: column; padding: 22px 17px 17px; border-right: 1px solid var(--line); background: var(--sidebar); }
.brand-row { display: flex; align-items: center; justify-content: space-between; padding: 0 5px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 12px; font-weight: 750; letter-spacing: .18em; text-decoration: none; }
.brand-glyph { display: flex; align-items: end; gap: 2px; width: 22px; height: 22px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 7px; }
.brand-glyph i { display: block; width: 3px; border-radius: 3px; background: var(--ink); }
.brand-glyph i:nth-child(1) { height: 6px; opacity: .45; }
.brand-glyph i:nth-child(2) { height: 12px; }
.brand-glyph i:nth-child(3) { height: 8px; opacity: .7; }
.sidebar-close { display: none; border: 0; color: var(--muted); background: transparent; font-size: 25px; font-weight: 300; }

.new-session { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 44px; margin-top: 27px; padding: 0 13px 0 15px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; background: rgba(255,255,255,.035); font-size: 11px; font-weight: 620; transition: border-color .18s, background .18s; }
.new-session:hover { border-color: rgba(182,255,106,.34); background: rgba(182,255,106,.055); }
.new-session b { color: var(--lime); font-size: 17px; font-weight: 350; }
.session-nav { margin-top: 26px; }
.session-nav > p { margin: 0 10px 9px; color: var(--dim); font-size: 8px; font-weight: 650; letter-spacing: .13em; }
.session-item { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; text-align: left; background: transparent; }
.session-item.active { background: rgba(255,255,255,.048); }
.session-icon { display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--lime); font-size: 11px; }
.session-item strong, .session-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-item strong { font-size: 10px; font-weight: 560; }
.session-item small { margin-top: 3px; color: var(--dim); font-size: 8px; }
.sidebar-spacer { flex: 1; min-height: 24px; }

.compute-card { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, rgba(169,148,255,.055), rgba(255,255,255,.018)); }
.compute-heading { display: grid; grid-template-columns: 9px 1fr; gap: 9px; align-items: center; }
.provider-dot { width: 7px; height: 7px; border-radius: 50%; background: #777; box-shadow: 0 0 0 4px rgba(255,255,255,.035); }
.provider-dot.online { background: var(--lime); box-shadow: 0 0 11px rgba(182,255,106,.65); }
.provider-dot.offline { background: var(--orange); }
.compute-heading small, .compute-heading strong { display: block; }
.compute-heading small { color: var(--dim); font-size: 7px; font-weight: 700; letter-spacing: .11em; }
.compute-heading strong { margin-top: 3px; color: #c8c6c0; font-size: 9px; font-weight: 540; }
.compute-card dl { margin: 13px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.compute-card dl div { display: flex; justify-content: space-between; margin-top: 6px; font-size: 8px; }
.compute-card dt { color: var(--dim); }
.compute-card dd { margin: 0; color: #a6a5a9; }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; padding: 0 3px; color: #54535a; font: 650 6px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .09em; }
.sidebar-footer a { color: #6c6b72; text-decoration: none; }

.workspace { display: grid; grid-template-rows: 68px minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: radial-gradient(circle at 64% 8%, rgba(169,148,255,.035), transparent 32%), var(--bg); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-left > div strong, .topbar-left > div span { display: block; }
.topbar-left > div strong { font-size: 12px; font-weight: 620; }
.topbar-left > div span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.topbar-left > div span i { display: inline-block; width: 5px; height: 5px; margin-right: 3px; border-radius: 50%; background: var(--lime); vertical-align: 1px; }
.menu-button { display: none; width: 32px; height: 32px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: transparent; }
.menu-button i { display: block; height: 1px; margin: 4px 0; background: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.privacy-label { color: var(--dim); font-size: 8px; }
.wallet-button { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; cursor: pointer; background: rgba(255,255,255,.035); font-size: 9px; }
.wallet-button:hover { background: rgba(255,255,255,.06); }
.wallet-button b { font-weight: 590; }
.wallet-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #65646a; }
.wallet-button.connected .wallet-status-dot { background: var(--lime); box-shadow: 0 0 8px rgba(182,255,106,.5); }

.conversation { min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #343339 transparent; }
.welcome { width: min(700px, calc(100% - 42px)); margin: max(68px, 10vh) auto 70px; text-align: center; }
.agent-orb { position: relative; width: 58px; height: 58px; margin: 0 auto 20px; border: 1px solid rgba(182,255,106,.25); border-radius: 18px; background: radial-gradient(circle at 35% 30%, rgba(182,255,106,.28), transparent 42%), linear-gradient(145deg, #202027, #111115); box-shadow: inset 0 0 28px rgba(182,255,106,.04), 0 16px 50px rgba(0,0,0,.25); transform: rotate(5deg); }
.agent-orb::before, .agent-orb::after { content: ""; position: absolute; width: 5px; height: 5px; top: 25px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 8px rgba(255,255,255,.6); }
.agent-orb::before { left: 19px; }.agent-orb::after { right: 19px; }
.agent-orb span { position: absolute; inset: 8px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; }
.agent-orb i { position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border: 2px solid var(--bg); border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px rgba(182,255,106,.6); }
.eyebrow { margin: 0 0 10px; color: var(--lime); font: 700 8px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .2em; }
.welcome h1 { margin: 0; font-size: clamp(29px, 4vw, 42px); line-height: 1.08; letter-spacing: -.045em; font-weight: 570; }
.welcome-copy { max-width: 520px; margin: 16px auto 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.suggestions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 35px; text-align: left; }
.suggestions button { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 74px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: rgba(255,255,255,.025); transition: transform .18s, border-color .18s, background .18s; }
.suggestions button:hover { transform: translateY(-2px); border-color: var(--line-strong); background: rgba(255,255,255,.045); }
.suggestion-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: #17171a; font-size: 13px; }
.suggestion-icon.plan { background: var(--lime); }.suggestion-icon.review { background: var(--violet); }.suggestion-icon.research { background: var(--orange); }
.suggestions strong, .suggestions small { display: block; }
.suggestions strong { font-size: 9px; font-weight: 610; }
.suggestions small { margin-top: 4px; color: var(--dim); font-size: 7px; }
.suggestions button > b { color: var(--dim); font-size: 12px; font-weight: 350; }

.messages { width: min(790px, calc(100% - 40px)); margin: 36px auto 12px; }
.message { display: grid; grid-template-columns: 31px minmax(0, 1fr); gap: 13px; margin: 0 0 28px; }
.message.user { grid-template-columns: minmax(0,1fr); justify-items: end; }
.message-avatar { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--lime); background: var(--panel); font: 700 8px/1 ui-monospace, monospace; }
.message-content { min-width: 0; padding-top: 4px; }
.message-name { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 9px; font-weight: 630; }
.message-name span { color: var(--dim); font-size: 7px; font-weight: 450; }
.message-copy { color: #d7d5cf; font-size: 12px; line-height: 1.78; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user .message-content { max-width: min(620px, 88%); padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px 14px 3px 14px; background: var(--panel-2); }
.message.user .message-copy { font-size: 11px; line-height: 1.65; }
.message pre { position: relative; margin: 13px 0; padding: 15px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #08080a; color: #deddd7; font: 10px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.message pre button { position: sticky; left: 100%; top: 0; float: right; margin: -8px -7px 4px 10px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: #151519; cursor: pointer; font-size: 7px; }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 11px; color: var(--dim); font-size: 7px; }
.message-meta i { width: 3px; height: 3px; border-radius: 50%; background: #4d4c52; }
.message-meta a { color: var(--lime); text-decoration: none; }
.typing { display: inline-flex; gap: 4px; padding: 5px 0; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: pulse 1.25s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .14s; }.typing i:nth-child(3) { animation-delay: .28s; }
@keyframes pulse { 0%,70%,100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
.message.error .message-copy { color: #ffb29a; }
.scroll-anchor { height: 20px; }

.composer-wrap { width: min(820px, calc(100% - 40px)); margin: 0 auto; padding: 8px 0 17px; }
.composer { padding: 11px 11px 9px 15px; border: 1px solid var(--line-strong); border-radius: 15px; background: rgba(24,24,29,.96); box-shadow: 0 14px 60px rgba(0,0,0,.34); transition: border-color .18s, box-shadow .18s; }
.composer:focus-within { border-color: rgba(169,148,255,.38); box-shadow: 0 14px 60px rgba(0,0,0,.34), 0 0 0 3px rgba(169,148,255,.05); }
.composer textarea { display: block; width: 100%; max-height: 180px; min-height: 31px; padding: 4px 2px; resize: none; overflow-y: auto; border: 0; outline: 0; background: transparent; font-size: 12px; line-height: 1.6; }
.composer textarea::placeholder { color: #68676d; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.composer-tools { display: flex; align-items: center; gap: 10px; }
.model-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; color: #a3a2a7; background: rgba(255,255,255,.025); font-size: 7px; }
.model-chip i { width: 4px; height: 4px; border-radius: 50%; background: var(--lime); }
.token-hint { color: #5c5b61; font-size: 7px; }
.send-button, .stop-button { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 9px; cursor: pointer; background: var(--ink); }
.send-button svg { width: 18px; fill: none; stroke: #121215; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.send-button:disabled { cursor: default; opacity: .2; }
.stop-button { background: var(--ink); }
.stop-button i { width: 8px; height: 8px; border-radius: 2px; background: #17171a; }
.composer-note { margin: 8px 0 0; color: #56555b; font-size: 7px; text-align: center; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: 24px; max-width: min(420px, calc(100% - 32px)); padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 10px; color: #d8d6d0; background: rgba(24,24,29,.96); box-shadow: 0 14px 40px rgba(0,0,0,.4); font-size: 9px; transform: translateX(-50%); }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-101%); transition: transform .22s ease; box-shadow: 22px 0 70px rgba(0,0,0,.45); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-button { display: block; }
  .sidebar-scrim { position: fixed; z-index: 19; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
  .topbar { padding: 0 18px; }
  .privacy-label { display: none; }
  .welcome { margin-top: 55px; }
}

@media (max-width: 580px) {
  .workspace { grid-template-rows: 60px minmax(0,1fr) auto; }
  .topbar { padding: 0 12px; }
  .topbar-left { gap: 10px; }
  .wallet-button { padding: 0 9px; }
  .welcome { width: calc(100% - 28px); margin-top: 37px; }
  .welcome h1 { font-size: 30px; }
  .welcome-copy { font-size: 10px; }
  .suggestions { grid-template-columns: 1fr; margin-top: 27px; }
  .suggestions button { min-height: 62px; }
  .messages { width: calc(100% - 26px); margin-top: 25px; }
  .message { gap: 9px; grid-template-columns: 28px minmax(0,1fr); }
  .message.user .message-content { max-width: 94%; }
  .composer-wrap { width: calc(100% - 20px); padding-bottom: 10px; }
  .token-hint { display: none; }
  .composer-note { max-width: 90%; margin-right: auto; margin-left: auto; line-height: 1.45; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
