:root {
  --bg: #0e0c13;
  --bg2: #120f18;
  --panel: #16121d;
  --panel2: #1d1826;
  --panel3: #251f30;
  --border: #2b2436;
  --text: #ece8f1;
  --muted: #9b93a9;
  --pink: #ff4fa3;
  --purple: #9b5cff;
  --grad: linear-gradient(135deg, #ff4fa3, #9b5cff);
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 14px;
  --side: 272px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); }
body { overflow: hidden; }
[hidden] { display: none !important; }
a { color: #f7a8d3; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.err { color: var(--err); }
.spacer { flex: 1; }

/* buttons */
.btn { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; }
.btn:hover { background: var(--panel3); }
.btn.primary { background: var(--grad); border: 0; color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { border-color: #5b2330; color: #fca5b5; }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { background: transparent; border: 0; border-radius: 8px; padding: 6px 9px; font-size: 16px; line-height: 1; color: var(--muted); }
.icon-btn:hover { background: var(--panel2); color: var(--text); }

/* auth */
.auth { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1000px 600px at 20% 0%, #2a1030 0%, transparent 60%), radial-gradient(900px 600px at 100% 100%, #1b1238 0%, transparent 60%), var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 28px; display: grid; gap: 12px; box-shadow: 0 30px 80px #0008; }
.auth-card h1 { margin: 0; font-size: 24px; text-align: center; }
.auth-card p { margin: 0; text-align: center; }
.auth-logo { width: 64px; height: 64px; margin: 0 auto; }
.auth-card label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input[type=text], input:not([type]), input[type=password], input[type=search], select, textarea.field {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #6d3f9e; }

/* layout */
.app { display: flex; height: 100dvh; }
.sidebar { width: var(--side); flex-shrink: 0; background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 12px 10px; gap: 10px; min-height: 0; }
.side-head { display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 650; font-size: 16px; padding: 4px 6px; }
.brand img { width: 30px; height: 30px; }
.new-chat { display: flex; align-items: center; gap: 8px; justify-content: flex-start; font-weight: 550; }
.new-chat .plus { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.search { width: 100%; padding: 7px 10px !important; font-size: 13.5px; }
.chat-list { flex: 1; overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.chat-group { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 8px 4px; }
.chat-item { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 9px; cursor: pointer; color: #d9d3e2; font-size: 14px; position: relative; }
.chat-item:hover { background: var(--panel2); }
.chat-item.active { background: var(--panel3); color: #fff; }
.chat-item .title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .tag { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: #2b1a33; color: #f3a6d2; white-space: nowrap; }
.chat-item .busy { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); animation: pulse 1.2s infinite; }
.chat-item .acts { display: none; gap: 2px; }
.chat-item:hover .acts, .chat-item.active .acts { display: flex; }
.chat-item .acts button { background: none; border: 0; color: var(--muted); padding: 2px 4px; border-radius: 6px; font-size: 13px; }
.chat-item .acts button:hover { color: var(--text); background: var(--panel3); }
.chat-item input { flex: 1; padding: 3px 6px !important; font-size: 13.5px; }
.side-foot { border-top: 1px solid var(--border); padding-top: 8px; display: grid; gap: 2px; }
.side-link { background: none; border: 0; text-align: left; padding: 7px 8px; border-radius: 8px; color: #d0c9da; font-size: 14px; }
.side-link:hover { background: var(--panel2); }
.version { font-size: 11.5px; padding: 4px 8px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #1d1826; min-height: 54px; }
.selectors { display: flex; gap: 8px; min-width: 0; flex-wrap: wrap; }
.sel { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 0 4px 0 10px; min-width: 0; }
.sel select { background: transparent; border: 0; padding: 7px 6px; max-width: 290px; outline: none; cursor: pointer; text-overflow: ellipsis; }
.sel select option { background: var(--panel); }
.sel-icon { color: var(--purple); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #555; flex-shrink: 0; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px #4ade8077; }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--err); }
.dot.sim { background: #60a5fa; }

.scroller { flex: 1; overflow-y: auto; min-height: 0; scroll-behavior: auto; }
.thread { max-width: 820px; margin: 0 auto; padding: 24px 18px 40px; }

/* empty state */
.empty { text-align: center; padding: 9vh 10px 20px; }
.empty img { width: 76px; height: 76px; filter: drop-shadow(0 8px 30px #ff4fa355); }
.empty h2 { font-size: 27px; margin: 14px 0 6px; font-weight: 650; }
.empty p { margin: 0 0 22px; }
.suggests { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 640px; margin: 0 auto; }
.suggest { text-align: left; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; color: #d8d1e2; font-size: 14px; }
.suggest:hover { background: var(--panel2); border-color: #45325a; }
.suggest b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

/* messages */
.msg-user { display: flex; justify-content: flex-end; margin: 18px 0; }
.bubble { background: var(--panel3); border: 1px solid #332a40; border-radius: 18px 18px 4px 18px; padding: 10px 15px; max-width: min(85%, 640px); white-space: pre-wrap; word-wrap: break-word; }
.bubble .att-row { margin-top: 8px; }
.turn { display: flex; gap: 14px; margin: 18px 0; }
.avatar { width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; background: #1f1828; border: 1px solid var(--border); }
.avatar img { width: 22px; height: 22px; }
.turn-body { flex: 1; min-width: 0; }
.model-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.status-line { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #3b2d4a; border-top-color: var(--pink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
.cursor::after { content: ""; display: inline-block; width: 8px; height: 15px; background: var(--pink); margin-left: 2px; vertical-align: -2px; animation: pulse 1s infinite; border-radius: 2px; }
.thinking { border-left: 2px solid #3d2f4d; margin: 4px 0 8px; padding: 0 0 0 12px; color: var(--muted); font-size: 13.5px; }
.thinking summary { cursor: pointer; user-select: none; list-style: none; }
.thinking summary::before { content: "▸ "; }
.thinking[open] summary::before { content: "▾ "; }
.thinking .think-text { white-space: pre-wrap; max-height: 320px; overflow-y: auto; margin-top: 4px; }
.msg-error { background: #2a1418; border: 1px solid #5b2330; color: #fecaca; border-radius: 10px; padding: 9px 12px; margin: 8px 0; font-size: 14px; }
.msg-note { color: var(--muted); font-size: 12.5px; font-style: italic; margin-top: 4px; }
.actions { display: flex; gap: 2px; margin-top: 6px; opacity: .75; }
.actions:hover { opacity: 1; }
.actions button { background: none; border: 0; color: var(--muted); padding: 4px 8px; border-radius: 7px; font-size: 13px; }
.actions button:hover { background: var(--panel2); color: var(--text); }

/* markdown */
.md { word-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .8em; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.1em 0 .5em; line-height: 1.3; }
.md h1 { font-size: 1.45em; } .md h2 { font-size: 1.25em; } .md h3 { font-size: 1.1em; }
.md ul, .md ol { padding-left: 1.5em; margin: 0 0 .8em; }
.md li { margin: .2em 0; }
.md blockquote { border-left: 3px solid #5a3b6e; margin: 0 0 .8em; padding: 2px 14px; color: #cfc6da; }
.md code { font-family: var(--mono); font-size: .88em; background: #241d2e; padding: .12em .38em; border-radius: 5px; }
.md table { border-collapse: collapse; margin: 0 0 1em; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.md th { background: var(--panel2); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }
.md img { max-width: 100%; border-radius: 8px; }
.code-block { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin: 0 0 1em; background: #0b0910; }
.code-head { display: flex; align-items: center; justify-content: space-between; background: #19141f; padding: 4px 6px 4px 12px; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.code-head button { background: none; border: 0; color: var(--muted); font-size: 12px; padding: 3px 8px; border-radius: 6px; }
.code-head button:hover { background: var(--panel3); color: var(--text); }
.code-block pre { margin: 0; padding: 12px 14px; overflow-x: auto; }
.code-block pre code { background: none; padding: 0; font-size: 13px; line-height: 1.55; }
.hljs { background: transparent !important; }

/* tool chips */
.tools { display: flex; flex-direction: column; gap: 5px; margin: 8px 0; }
.chip { border: 1px solid var(--border); background: var(--panel); border-radius: 10px; font-size: 13px; overflow: hidden; }
.chip-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; user-select: none; }
.chip-head .name { font-family: var(--mono); color: #e9b6ff; font-size: 12.5px; }
.chip-head .sum { color: var(--muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .ok { color: var(--ok); } .chip .bad { color: var(--err); }
.chip-body { border-top: 1px solid var(--border); padding: 8px 10px; display: grid; gap: 6px; }
.chip-body pre { margin: 0; max-height: 280px; overflow: auto; font: 12px/1.5 var(--mono); white-space: pre-wrap; color: #cfc6da; }
.file-links { display: flex; flex-wrap: wrap; gap: 6px; }
.file-link { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 3px 9px; text-decoration: none; color: #e7d9f2; font-size: 12.5px; }
.file-link:hover { border-color: #5a3b6e; }

/* attachments */
.att-row { display: flex; flex-wrap: wrap; gap: 6px; }
.att { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 4px 8px; font-size: 12.5px; max-width: 240px; text-decoration: none; color: var(--text); }
.att span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att img { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; }
.att.img-only { padding: 3px; }
.att.img-only img { width: 120px; height: 90px; }
.att .x { background: none; border: 0; color: var(--muted); padding: 0 2px; }
.att.uploading { opacity: .6; }

/* composer */
.composer-wrap { padding: 0 14px calc(10px + env(safe-area-inset-bottom)); position: relative; }
.composer { max-width: 820px; margin: 0 auto; background: var(--panel); border: 1px solid var(--border); border-radius: 22px; padding: 10px 10px 8px 14px; box-shadow: 0 -10px 40px #0e0c13; }
.composer:focus-within { border-color: #4e3566; }
.composer textarea { width: 100%; background: transparent; border: 0; outline: none; resize: none; max-height: 40vh; padding: 4px 2px; line-height: 1.5; font-size: 15px; }
.composer-row { display: flex; align-items: center; gap: 6px; }
.pending { display: flex; flex-wrap: wrap; gap: 6px; }
.pending:not(:empty) { margin-bottom: 8px; }
.send { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; font-size: 15px; display: grid; place-items: center; }
.send:disabled { background: #3a3245; color: #8d849a; cursor: default; }
.send.stop { background: #ece8f1; color: #16121d; font-size: 12px; }
.foot-note { text-align: center; margin-top: 6px; }
.drop-hint { position: absolute; inset: -8px 14px 26px; border: 2px dashed var(--pink); border-radius: 22px; display: grid; place-items: center; background: #1a0f1fcc; z-index: 5; font-weight: 600; }

/* asset card */
.asset-card { border: 1px solid #3a2a4c; background: linear-gradient(180deg, #1a1422, #141019); border-radius: 16px; margin: 10px 0; overflow: hidden; }
.asset-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #2a2135; flex-wrap: wrap; }
.asset-head .t { font-weight: 650; }
.asset-head select { padding: 3px 8px; font-size: 12.5px; border-radius: 8px; max-width: 100%; min-width: 0; }
.badge { font-size: 11.5px; padding: 2px 8px; border-radius: 20px; background: #2b2136; color: #d8c7ea; }
.badge.done { background: #143322; color: #86efac; }
.badge.failed { background: #3a1419; color: #fca5a5; }
.badge.running, .badge.queued { background: #33203f; color: #f5b8e0; }
.progress { padding: 12px 14px; display: grid; gap: 8px; }
.bar { height: 6px; background: #2a2135; border-radius: 6px; overflow: hidden; }
.bar > div { height: 100%; background: var(--grad); transition: width .6s; }
.overview { display: block; width: 100%; max-height: 440px; object-fit: cover; cursor: zoom-in; background: #1d1824; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 12px 14px; }
.asset-tile { background: #120e17; border: 1px solid #2a2135; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.asset-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: zoom-in; display: block; }
.asset-tile .meta { padding: 7px 9px; font-size: 12px; display: grid; gap: 2px; }
.asset-tile .meta b { font-size: 12.5px; word-break: break-all; }
.asset-tile .row { display: flex; gap: 4px; padding: 0 8px 8px; }
.asset-tile .row .btn { flex: 1; text-align: center; text-decoration: none; padding: 4px 6px; font-size: 12px; }
.asset-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 14px 12px; }
.asset-foot a.btn { text-decoration: none; }
.asset-details { padding: 0 14px 12px; font-size: 13px; }
.asset-details summary { cursor: pointer; color: var(--muted); }
.asset-details table { border-collapse: collapse; width: 100%; margin-top: 8px; font-size: 12.5px; }
.asset-details td, .asset-details th { border-bottom: 1px solid #2a2135; padding: 4px 6px; text-align: left; }
.warnings { color: var(--warn); font-size: 12.5px; margin: 6px 0 0; padding-left: 18px; }

/* modals */
.modal-back { position: fixed; inset: 0; background: #07050bcc; backdrop-filter: blur(3px); z-index: 50; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; width: min(980px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 90px #000a; }
.modal.small { width: min(440px, 100%); }
.modal-head { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; flex: 1; }
.modal-body { padding: 16px; overflow-y: auto; min-height: 0; }
.modal-foot { flex-shrink: 0; padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 120px); display: block; margin: 0 auto; border-radius: 10px; }
.viewer-wrap { position: relative; height: min(70dvh, 640px); background: #15111c; }
.viewer-wrap canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.viewer-ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; }
.viewer-ctrl select { padding: 4px 8px; }
.viewer-ctrl label { display: flex; align-items: center; gap: 5px; }

/* settings */
.tabs { flex-shrink: 0; display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { background: none; border: 0; padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--muted); white-space: nowrap; }
.tab.active { color: var(--text); border-bottom-color: var(--pink); }
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.form textarea, textarea.field { width: 100%; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; outline: none; resize: vertical; min-height: 64px; font-size: 14px; }
.form textarea.code, textarea.code { font-family: var(--mono); font-size: 12.5px; }
.row-flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mem-list { display: grid; gap: 6px; margin-top: 12px; }
.mem { border: 1px solid var(--border); background: var(--bg2); border-radius: 10px; padding: 8px 10px; display: grid; gap: 6px; }
.mem.off { opacity: .55; }
.mem .top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.mem .content { white-space: pre-wrap; font-size: 14px; }
.mem textarea { min-height: 60px; }
.pill { font-size: 11px; padding: 1px 8px; border-radius: 20px; background: #2b2136; color: #d8c7ea; }
.pill.proj { background: #2b1a33; color: #f3a6d2; }
.pill.pin { background: #3a2a10; color: #fcd34d; }
.model-row { border: 1px solid var(--border); background: var(--bg2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; margin-bottom: 8px; }
.model-row .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.kv div:nth-child(odd) { color: var(--muted); }
.ref-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* files panel */
.files-panel { width: 320px; border-left: 1px solid var(--border); background: var(--bg2); display: flex; flex-direction: column; min-height: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.panel-body { padding: 12px 14px; overflow-y: auto; font-size: 13px; display: grid; gap: 14px; align-content: start; }
.panel-body h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.panel-body ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.panel-body li a { color: #e7d9f2; text-decoration: none; word-break: break-all; }
.panel-body li a:hover { text-decoration: underline; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--panel3); border: 1px solid var(--border); padding: 9px 16px; border-radius: 10px; z-index: 99; box-shadow: 0 10px 30px #0008; font-size: 14px; }

/* queue & comparisons */
.q-badge { background: var(--grad); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 7px; margin-left: 4px; }
.q-sys { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 13px; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.modal-body h4 { margin: 16px 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.q-list { display: grid; gap: 6px; }
.q-item { display: flex; gap: 10px; align-items: center; border: 1px solid var(--border); background: var(--bg2); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; }
.q-item.running { border-color: #4e3566; }
.q-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.q-main a { color: #f1e4fa; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-pos { color: var(--muted); font-size: 12px; min-width: 24px; }
.q-ctrl { display: flex; gap: 2px; }
.q-ctrl button { background: var(--panel2); border: 1px solid var(--border); border-radius: 7px; padding: 2px 7px; font-size: 12px; color: var(--muted); }
.q-ctrl button:hover { color: var(--text); }
.q-ctrl button.on { color: #fcd34d; }
.q-ctrl button.danger:hover { color: var(--err); }
.q-table { border-collapse: collapse; width: 100%; font-size: 12.5px; display: block; overflow-x: auto; }
.q-table th, .q-table td { border-bottom: 1px solid var(--border); padding: 5px 8px; text-align: left; white-space: nowrap; }
.q-table th { color: var(--muted); font-weight: 500; }
.q-table a { color: #f1e4fa; }
.msg-stats { color: #7d748b; font-size: 11.5px; margin-top: 4px; }
.small-text { font-size: 13px !important; }
.cmp-models { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; }
.cmp-model { display: flex !important; gap: 8px; align-items: center; color: var(--text) !important; font-size: 13.5px !important; }
.cmp-prompt { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin: 10px 0; white-space: pre-wrap; font-size: 13.5px; }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.cmp-card { border: 1px solid var(--border); background: var(--bg2); border-radius: 12px; padding: 10px; display: grid; gap: 8px; align-content: start; font-size: 13px; }
.cmp-card img { width: 100%; border-radius: 8px; }
.cmp-card a { color: #f7a8d3; }
.cmp-answer { max-height: 120px; overflow: hidden; }

.monitor { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 11px; color: var(--muted); padding: 4px 8px; }
.monitor .gen { color: #f5b8e0; }
.chat-item .tag.mode { background: #1f2140; color: #b9c3ff; }
.stor-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 13px; }

.only-mobile { display: none; }
.scrim { display: none; }
@media (max-width: 860px) {
  .only-mobile { display: inline-block; }
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .2s; width: min(86vw, 320px); }
  .app.side-open .sidebar { transform: none; }
  .app.side-open .scrim { display: block; position: fixed; inset: 0; background: #0009; z-index: 30; }
  .files-panel { position: fixed; inset: 0 0 0 auto; width: min(92vw, 360px); z-index: 40; }
  .topbar { padding: 8px 10px; }
  .topbar .spacer { display: none; }
  .selectors { flex-wrap: nowrap; flex: 1 1 auto; min-width: 0; }
  .sel { flex: 1 1 0; min-width: 0; }
  .sel select { max-width: none; width: 100%; }
  .thread { padding: 16px 12px 30px; }
  .turn { gap: 10px; }
  .avatar { width: 26px; height: 26px; }
  .suggests { grid-template-columns: 1fr; }
  .bubble { max-width: 92%; }
}
@media (max-width: 420px) { .sel select { font-size: 13px; padding: 7px 2px; } .sel { padding-left: 7px; } }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c2536; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
