:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #0f1219;
  --panel-raised: #151923;
  --panel-soft: #11151e;
  --line: #232938;
  --line-strong: #30384a;
  --text: #f3f5fa;
  --muted: #8993a7;
  --subtle: #5f687b;
  --accent: #7792ff;
  --accent-strong: #647ff4;
  --accent-soft: rgba(119,146,255,.13);
  --success: #4ed4a3;
  --warning: #f5bc66;
  --danger: #ff707a;
  --shadow: 0 24px 70px rgba(0,0,0,.45);
  --code: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-raised: #ffffff;
  --panel-soft: #f0f3f8;
  --line: #dfe4ed;
  --line-strong: #cbd2df;
  --text: #171b26;
  --muted: #687287;
  --subtle: #929bad;
  --accent: #526fe4;
  --accent-strong: #405fd7;
  --accent-soft: rgba(82,111,228,.1);
  --shadow: 0 24px 70px rgba(40,50,75,.16);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button[hidden], [hidden] { display: none !important; }
kbd { border: 1px solid var(--line); border-bottom-color: var(--line-strong); border-radius: 5px; background: var(--panel-soft); color: var(--subtle); font: 10px/1 ui-monospace, monospace; padding: 4px 5px; }

#app { height: 100dvh; display: grid; grid-template-columns: 276px minmax(0,1fr) 0; transition: grid-template-columns .2s ease; }
body.workbench-open #app { grid-template-columns: 276px minmax(0,1fr) 348px; }

#sidebar { min-width: 0; border-right: 1px solid var(--line); background: var(--panel); padding: 16px 13px 12px; display: flex; flex-direction: column; overflow: hidden; }
.sidebar-head { height: 43px; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand > span:last-child { display: grid; line-height: 1.15; }
.brand strong { font-size: 16px; letter-spacing: -.2px; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; color: white; font-weight: 800; background: linear-gradient(145deg,#829aff,#5b74e9); box-shadow: inset 0 1px rgba(255,255,255,.22), 0 7px 20px rgba(84,108,225,.2); }
.brand-mark.large { width: 49px; height: 49px; border-radius: 15px; font-size: 20px; }
.online-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(78,212,163,.1); margin-right: 4px; }
.primary { background: var(--accent); color: white; font-weight: 700; border-radius: 9px; }
.primary:hover { background: var(--accent-strong); }
.new-chat { height: 42px; width: 100%; display: flex; align-items: center; gap: 8px; padding: 0 11px; }
.new-chat span { font-size: 18px; font-weight: 400; }
.new-chat kbd { margin-left: auto; border-color: rgba(255,255,255,.22); color: rgba(255,255,255,.75); background: rgba(0,0,0,.08); }
.search-shell { height: 40px; margin-top: 9px; width: 100%; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); color: var(--muted); text-align: left; }
.search-shell:hover { border-color: var(--line-strong); background: var(--panel-raised); }
.search-shell span:first-child { font-size: 18px; }
.search-shell kbd { margin-left: auto; }
.nav-label { display: flex; align-items: center; justify-content: space-between; padding: 19px 8px 7px; color: var(--subtle); font-size: 10px; letter-spacing: .1em; font-weight: 700; }
.nav-label button { color: var(--muted); padding: 2px 4px; background: transparent; }
#chatList { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.chat-row { min-height: 40px; display: grid; grid-template-columns: minmax(0,1fr) 29px; align-items: center; border-radius: 8px; margin: 2px 0; padding-left: 3px; }
.chat-row:hover { background: var(--panel-soft); }
.chat-row.active { background: var(--accent-soft); box-shadow: inset 2px 0 var(--accent); }
.chat-row > button { background: transparent; }
.chat-row > button:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); padding: 9px 7px; text-align: left; }
.chat-row.active > button:first-child { color: var(--text); font-weight: 600; }
.chat-row > button:last-child { color: var(--subtle); border-radius: 6px; padding: 5px; opacity: 0; }
.chat-row:hover > button:last-child { opacity: 1; }
.sidebar-tools { border-top: 1px solid var(--line); padding-top: 9px; display: grid; gap: 2px; }
.sidebar-tools button { height: 38px; border-radius: 8px; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 10px; padding: 0 9px; text-align: left; }
.sidebar-tools button:hover { color: var(--text); background: var(--panel-soft); }
.sidebar-tools button span { width: 19px; color: var(--subtle); font-size: 16px; text-align: center; }
.sidebar-tools button small { margin-left: auto; padding: 2px 6px; border-radius: 10px; background: rgba(78,212,163,.09); color: var(--success); font-size: 9px; text-transform: uppercase; }
#sidebar footer { padding-top: 9px; }
.account-card { min-height: 53px; display: grid; grid-template-columns: 34px minmax(0,1fr) 30px; gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 7px; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--panel-raised); border: 1px solid var(--line); font-weight: 700; color: var(--accent); }
.account-card > span:nth-child(2) { display: grid; min-width: 0; }
.account-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.account-card small { color: var(--muted); font-size: 10px; text-transform: capitalize; }
.icon-btn { border-radius: 7px; padding: 7px; color: var(--muted); background: transparent; }
.icon-btn:hover { color: var(--text); background: var(--panel-soft); }

#main { min-width: 0; height: 100dvh; display: grid; grid-template-rows: 68px minmax(0,1fr) auto; position: relative; background: var(--bg); }
.topbar { min-width: 0; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); padding: 0 18px; background: color-mix(in srgb,var(--bg) 92%,transparent); backdrop-filter: blur(16px); z-index: 4; }
.chat-heading { min-width: 0; }
.eyebrow { display: flex; gap: 5px; color: var(--subtle); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
.chat-heading h1 { max-width: 42vw; margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; letter-spacing: -.1px; }
.top-status { margin-left: auto; display: flex; gap: 7px; }
.model-pill, .agent-pill { max-width: 250px; height: 30px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 15px; padding: 0 10px; color: var(--muted); background: var(--panel); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-pill { color: var(--text); }
.agent-pill[aria-pressed="true"] { border-color: rgba(119,146,255,.45); background: var(--accent-soft); color: var(--accent); }
.top-actions { display: flex; align-items: center; border-left: 1px solid var(--line); padding-left: 8px; }
.text-btn { font-size: 11px; }
.danger-text { color: var(--danger) !important; }

#messages { min-width: 0; overflow: auto; padding: 34px max(24px,calc((100% - 850px)/2)) 60px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; scroll-behavior: smooth; }
.welcome { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 0 60px; }
.hero-orb { position: relative; margin-bottom: 20px; }
.hero-orb i { position: absolute; inset: -13px; border: 1px solid rgba(119,146,255,.14); border-radius: 22px; transform: rotate(12deg); }
.welcome-kicker { color: var(--accent) !important; font-size: 10px !important; letter-spacing: .15em; font-weight: 800; }
.welcome h2 { margin: 6px 0 12px; font-size: clamp(27px,4vw,42px); line-height: 1.1; letter-spacing: -1.4px; }
.welcome h2 span { color: var(--muted); font-weight: 550; }
.welcome > p { max-width: 610px; margin: 0; color: var(--muted); font-size: 14px; }
.suggestions { width: min(700px,100%); display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 31px 0 19px; }
.suggestions button { min-width: 0; min-height: 94px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); padding: 14px; display: grid; grid-template-columns: 29px 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left; }
.suggestions button:hover { border-color: var(--line-strong); background: var(--panel-raised); transform: translateY(-1px); }
.suggestions button > span { grid-row: 1/3; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: var(--accent-soft); }
.suggestions strong { font-size: 12px; }
.suggestions small { color: var(--muted); font-size: 10px; }
.capability-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; color: var(--subtle); font-size: 10px; }

.message { display: grid; grid-template-columns: 33px minmax(0,1fr); gap: 13px; margin-bottom: 30px; }
.message > div:last-child { min-width: 0; }
.avatar { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); font-size: 11px; font-weight: 800; color: var(--muted); }
.message.assistant .avatar { border-color: transparent; color: white; background: var(--accent); }
.message-head { height: 29px; display: flex; align-items: center; gap: 8px; }
.message-head strong { font-size: 12px; }
.message-head small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--subtle); font-size: 9px; }
.content { color: color-mix(in srgb,var(--text) 91%,var(--muted)); overflow-wrap: anywhere; font-size: 14px; }
.content > :first-child { margin-top: 0; }
.content > :last-child { margin-bottom: 0; }
.content p { margin: 0 0 13px; }
.content h1,.content h2,.content h3 { margin: 23px 0 10px; line-height: 1.25; }
.content a { color: var(--accent); }
.content blockquote { margin: 14px 0; padding: 4px 14px; border-left: 2px solid var(--accent); color: var(--muted); }
.content table { width: 100%; display: block; overflow: auto; border-collapse: collapse; }
.content th,.content td { padding: 8px 11px; border: 1px solid var(--line); }
.content :not(pre)>code { border: 1px solid var(--line); border-radius: 5px; background: var(--panel-soft); padding: 2px 5px; color: #d5a8ff; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: var(--code); }
.content pre { position: relative; margin: 15px 0; padding: 44px 15px 15px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: #090c12; box-shadow: inset 0 1px rgba(255,255,255,.02); }
.content pre::before { content: attr(data-language); position: absolute; left: 13px; top: 11px; color: #6f7a8c; font: 10px ui-monospace,monospace; text-transform: uppercase; }
.content pre code { font: var(--code)/1.62 ui-monospace,SFMono-Regular,Consolas,monospace; }
.code-actions { position: absolute; right: 7px; top: 6px; display: flex; gap: 4px; }
.code-actions button { border: 1px solid #29303d; border-radius: 6px; background: #141924; color: #a9b2c3; font-size: 10px; padding: 4px 7px; }
.code-actions .run-code { color: #b9c6ff; border-color: rgba(119,146,255,.35); background: rgba(119,146,255,.12); }
.message-actions { min-height: 27px; display: flex; gap: 3px; margin-top: 6px; opacity: 0; }
.message:hover .message-actions { opacity: 1; }
.message-actions button { border-radius: 6px; background: transparent; color: var(--subtle); padding: 4px 7px; font-size: 10px; }
.message-actions button:hover { color: var(--text); background: var(--panel-soft); }
.artifact-links { display: flex; gap: 6px; margin-top: 8px; }
.artifact-links a { border: 1px solid var(--line); border-radius: 7px; color: var(--accent); padding: 5px 8px; text-decoration: none; font-size: 10px; }

.scroll-bottom { position: absolute; right: 24px; bottom: 146px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-raised); color: var(--text); box-shadow: var(--shadow); z-index: 4; }
.composer-wrap { padding: 0 max(16px,calc((100% - 870px)/2)) 12px; background: linear-gradient(transparent,var(--bg) 20%); }
#composer { position: relative; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--panel); padding: 10px; box-shadow: 0 12px 35px rgba(0,0,0,.16); }
#composer:focus-within { border-color: rgba(119,146,255,.55); box-shadow: 0 0 0 3px rgba(119,146,255,.06),0 12px 35px rgba(0,0,0,.18); }
#prompt { width: 100%; min-height: 43px; max-height: 220px; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); padding: 6px 7px; }
#prompt::placeholder { color: var(--subtle); }
.composer-actions { min-height: 34px; display: flex; align-items: center; gap: 7px; }
.composer-tools { display: flex; gap: 4px; }
.tool-btn { border-radius: 7px; background: transparent; color: var(--muted); padding: 6px 8px; font-size: 10px; }
.tool-btn:hover { background: var(--panel-soft); color: var(--text); }
.tool-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
#streamState { margin-left: auto; color: var(--accent); font-size: 10px; }
#charCount { color: var(--subtle); font-size: 9px; }
#stopBtn { border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); padding: 6px 9px; color: var(--muted); }
.send-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: white; font-size: 18px; }
.send-btn:hover { background: var(--accent-strong); }
.composer-note { display: flex; justify-content: space-between; margin: 6px 4px 0; color: var(--subtle); font-size: 9px; }
.agent-banner { align-items: center; gap: 9px; margin: -2px -2px 7px; padding: 8px 9px; border: 1px solid rgba(119,146,255,.22); border-radius: 9px; background: var(--accent-soft); }
.agent-banner > span { color: var(--accent); }
.agent-banner div { display: grid; }
.agent-banner strong { color: var(--accent); font-size: 10px; }
.agent-banner small { color: var(--muted); font-size: 9px; }
.agent-banner button { margin-left: auto; background: transparent; color: var(--muted); }

#workbench { min-width: 0; overflow: hidden; border-left: 1px solid var(--line); background: var(--panel); display: grid; grid-template-rows: 67px 42px minmax(0,1fr) auto; opacity: 0; pointer-events: none; transition: opacity .15s; }
body.workbench-open #workbench { opacity: 1; pointer-events: auto; }
#workbench > header { display: flex; align-items: center; justify-content: space-between; padding: 0 13px; border-bottom: 1px solid var(--line); }
#workbench > header > div { display: flex; align-items: center; gap: 9px; }
#workbench > header > div > span:last-child { display: grid; line-height: 1.25; }
#workbench header strong { font-size: 12px; }
#workbench header small { color: var(--muted); font-size: 9px; }
.workbench-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.workbench-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); padding: 0 12px; }
.workbench-tabs button { position: relative; background: transparent; color: var(--muted); font-size: 10px; }
.workbench-tabs button.active { color: var(--text); }
.workbench-tabs button.active::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: -1px; height: 2px; background: var(--accent); }
.workbench-panel { min-height: 0; overflow: auto; padding: 10px; }
.panel-actions { min-height: 32px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; }
.panel-actions > button:first-child { border-radius: 7px; background: var(--panel-soft); color: var(--muted); padding: 6px 8px; font-size: 10px; }
.file-list,.run-list { display: grid; gap: 4px; }
.file-row,.run-row { min-width: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; padding: 8px; display: grid; grid-template-columns: 25px minmax(0,1fr) auto; gap: 7px; align-items: center; text-align: left; }
.file-row { grid-template-columns: minmax(0,1fr) auto; }
.file-row > button:first-child { min-width: 0; display: grid; grid-template-columns: 25px minmax(0,1fr); gap: 7px; align-items: center; background: transparent; text-align: left; }
.file-row > button:first-child > span:last-child { min-width: 0; display: grid; }
.file-row:hover,.run-row:hover { border-color: var(--line); background: var(--panel-soft); }
.file-icon { color: var(--accent); font: 10px ui-monospace,monospace; }
.file-row > span:nth-child(2),.run-row > span:nth-child(2) { min-width: 0; display: grid; }
.file-row strong,.run-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.file-row small,.run-row small { color: var(--subtle); font-size: 9px; }
.file-row .file-menu { opacity: 0; color: var(--subtle); background: transparent; }
.file-row:hover .file-menu { opacity: 1; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.status-dot.failed,.status-dot.timeout,.status-dot.output_limit { background: var(--danger); }
.panel-empty { padding: 34px 10px; color: var(--subtle); text-align: center; font-size: 10px; }
.sandbox-card { margin: 10px; padding: 10px; border: 1px solid rgba(78,212,163,.18); border-radius: 9px; background: rgba(78,212,163,.05); }
.sandbox-card div { display: flex; gap: 7px; align-items: center; color: var(--success); font-size: 10px; }
.sandbox-card p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }

dialog { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(2,4,8,.72); backdrop-filter: blur(4px); }
.modal { min-width: min(520px,calc(100vw - 24px)); padding: 19px; display: grid; gap: 13px; }
.modal > header,.lab-shell > header { display: flex; align-items: center; justify-content: space-between; }
.modal h2,.modal h3 { margin: 0; }
.modal header button,.lab-shell header button { background: transparent; color: var(--muted); }
.dialog-kicker { margin: 0 0 2px; color: var(--accent); font-size: 9px; letter-spacing: .13em; font-weight: 800; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.modal label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.modal input,.modal select,.modal textarea,#systemPrompt { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); color: var(--text); padding: 9px; outline: 0; }
.modal .check { display: flex; align-items: center; }
.modal .check input { width: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 7px; border-top: 1px solid var(--line); padding-top: 13px; }
.modal-actions button { border-radius: 8px; padding: 8px 11px; background: var(--panel-soft); }
.admin-modal { width: min(900px,calc(100vw - 24px)); max-height: 88dvh; overflow: auto; }
.health-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.health-grid div,.model-card { border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; }
.model-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; margin: 5px 0; }
.model-card small { display: block; color: var(--muted); }
#audit { max-height: 160px; overflow: auto; color: var(--muted); font: 10px ui-monospace,monospace; }
.small-dialog .modal > button { display: flex; justify-content: space-between; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); padding: 10px; text-align: left; }
.small-dialog .modal > button small { color: var(--muted); }

.python-dialog { width: min(920px,calc(100vw - 24px)); }
.lab-shell { display: grid; grid-template-rows: 62px auto minmax(270px,45vh) auto auto auto; }
.lab-shell > header { padding: 0 15px; border-bottom: 1px solid var(--line); }
.lab-shell > header > div { display: flex; align-items: center; gap: 9px; }
.lab-shell > header > div > span:last-child { display: grid; }
.lab-shell header small { color: var(--muted); font-size: 9px; }
.lab-toolbar { min-height: 47px; display: flex; align-items: center; gap: 12px; padding: 7px 13px; }
.lab-toolbar label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.lab-toolbar input { width: 230px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); padding: 6px 8px; }
.sandbox-badge { margin-left: auto; color: var(--success); font-size: 9px; }
.editor-shell { min-height: 270px; display: grid; grid-template-columns: 42px minmax(0,1fr); border-block: 1px solid var(--line); background: #090c12; }
.editor-gutter { overflow: hidden; padding: 13px 10px; border-right: 1px solid #1f2530; color: #4d5668; text-align: right; white-space: pre; font: 13px/1.55 ui-monospace,monospace; user-select: none; }
#pythonCode { width: 100%; resize: none; border: 0; outline: 0; padding: 13px; background: transparent; color: #dbe2f0; tab-size: 4; font: 13px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace; }
.run-consent { display: flex; align-items: center; gap: 8px; padding: 9px 13px; color: var(--muted); font-size: 10px; }
.lab-actions { display: flex; justify-content: flex-end; gap: 7px; padding: 0 13px 12px; }
.lab-actions button,#shareRunResult { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); padding: 8px 11px; }
.lab-actions .primary { border: 0; background: var(--accent); }
.run-result { margin: 0 13px 13px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.run-result > header { height: 37px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; background: var(--panel-soft); font-size: 10px; }
.run-result header span { color: var(--muted); }
.output-tabs { padding: 5px 7px 0; background: #090c12; }
.output-tabs button { border-radius: 5px; background: transparent; color: #677185; padding: 4px 7px; font-size: 9px; }
.output-tabs button.active { background: #161c27; color: #cbd5e8; }
#pythonOutput { min-height: 90px; max-height: 210px; margin: 0; overflow: auto; background: #090c12; color: #c8d1e2; padding: 10px; white-space: pre-wrap; font: 11px/1.5 ui-monospace,monospace; }
#shareRunResult { margin: 7px; font-size: 9px; }

.command-dialog { width: min(620px,calc(100vw - 24px)); align-self: start; margin-top: 12vh; }
.command-shell > header { height: 55px; display: grid; grid-template-columns: 25px 1fr auto; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line); }
#commandSearch { border: 0; outline: 0; background: transparent; font-size: 14px; }
#commandResults { max-height: 420px; overflow: auto; padding: 7px; }
.command-item { width: 100%; min-height: 43px; display: flex; align-items: center; gap: 10px; border-radius: 8px; background: transparent; color: var(--muted); padding: 7px 9px; text-align: left; }
.command-item:hover,.command-item.active { background: var(--panel-soft); color: var(--text); }
.command-item > span:first-child { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.command-item small { margin-left: auto; color: var(--subtle); }
.command-shell > footer { height: 32px; display: flex; gap: 14px; align-items: center; border-top: 1px solid var(--line); padding: 0 12px; color: var(--subtle); font-size: 8px; }

#toast { position: fixed; right: 17px; bottom: 17px; z-index: 100; max-width: 360px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel-raised); color: var(--text); padding: 10px 13px; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s; }
#toast.show { opacity: 1; transform: none; }
.muted { color: var(--muted); }
.mobile-only { display: none; }
body.compact .message { margin-bottom: 17px; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }

.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.login-card { width: min(390px,100%); border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { margin: 12px 0 0; }
.login-card small { color: var(--muted); }

@media (max-width: 1120px) {
  body.workbench-open #app { grid-template-columns: 276px minmax(0,1fr); }
  #workbench { position: fixed; top: 0; right: 0; bottom: 0; width: min(360px,92vw); z-index: 20; transform: translateX(105%); opacity: 1; box-shadow: var(--shadow); transition: transform .2s; }
  body.workbench-open #workbench { transform: none; }
}

@media (max-width: 760px) {
  #app,body.workbench-open #app { grid-template-columns: minmax(0,1fr); }
  #sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px,88vw); z-index: 30; transform: translateX(-105%); box-shadow: var(--shadow); transition: transform .2s; }
  #sidebar.open { transform: none; }
  .mobile-only { display: inline-grid; }
  .topbar { height: 61px; gap: 8px; padding: 0 8px; }
  #main { grid-template-rows: 61px minmax(0,1fr) auto; }
  .eyebrow,.model-pill,.top-actions .text-btn { display: none; }
  .chat-heading { flex: 1; }
  .chat-heading h1 { max-width: 42vw; font-size: 13px; }
  .top-status { margin-left: 0; }
  .agent-pill { padding: 0 8px; }
  .top-actions { padding-left: 4px; }
  #messages { padding: 24px 12px 45px; }
  .welcome { justify-content: flex-start; padding-top: 10vh; }
  .welcome h2 { font-size: 28px; }
  .suggestions { grid-template-columns: 1fr; margin-top: 22px; }
  .suggestions button { min-height: 69px; }
  .capability-row { gap: 8px; }
  .message { grid-template-columns: 27px minmax(0,1fr); gap: 8px; margin-bottom: 22px; }
  .avatar { width: 27px; height: 27px; }
  .message-actions { opacity: 1; }
  .composer-wrap { padding: 0 7px 6px; }
  .composer-tools .tool-btn { font-size: 0; }
  .composer-tools .tool-btn span { font-size: 15px; }
  .composer-note { display: none; }
  #charCount { display: none; }
  .python-dialog { width: calc(100vw - 12px); }
  .lab-shell { grid-template-rows: 55px auto minmax(250px,40vh) auto auto auto; }
  .lab-toolbar { align-items: stretch; flex-direction: column; gap: 5px; }
  .lab-toolbar input { flex: 1; width: auto; }
  .sandbox-badge { margin-left: 0; }
  .settings-grid,.health-grid { grid-template-columns: 1fr; }
  .modal { min-width: calc(100vw - 24px); }
}
