:root {
  /* wizxrd brand (from wizxrd.com): near-black, off-white, no accent colour; mono wordmark and labels */
  --bg: #08090b; --bg2: #0b0c0f; --panel: #0e1013; --panel2: #14161a; --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.17);
  --fg: #eceef1; --fg2: #b4bac4; --dim: #8b919c;
  --acid: #eceef1; --acid2: #ffffff; --violet: #b4bac4; --rose: #ff6b6b; --cyan: #eceef1;
  --user: #14161a; --radius: 10px;
  --sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.55 var(--sans); display: grid; grid-template-columns: 272px 1fr; overflow: hidden; }
.mono { font-family: var(--mono); font-size: 12px; }
.dim { color: var(--dim); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(236,238,241,.22); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.btn.primary:focus-visible { outline-color: var(--fg); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }  /* fields show focus with their violet border */

/* ---------- buttons ---------- */
.btn { background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 14px; cursor: pointer; transition: .15s; }
.btn:hover { border-color: var(--fg2); }
.btn.primary { background: var(--acid); color: #0a0c10; border-color: var(--acid); font-weight: 600; }
.btn.primary:hover { background: var(--acid2); border-color: var(--acid2); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: rgba(255,107,107,.38); color: var(--rose); }
.btn.wide { width: 100%; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.btn.danger:hover { border-color: var(--rose); background: rgba(255,107,107,.08); }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { background: transparent; border: 1px solid var(--line2); border-radius: 10px; width: 36px; height: 36px; cursor: pointer; font-size: 17px; line-height: 1; }
.icon-btn:hover { border-color: var(--fg2); }
select, input[type=text], input[type=number], input[type=search], input[type=password], input:not([type]), textarea {
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 7px 10px; outline: none; }
select:focus, input:focus, textarea:focus { border-color: var(--violet); }
input[type=range] { accent-color: var(--acid); width: 100%; }
input[type=checkbox] { accent-color: var(--acid); width: 16px; height: 16px; }

/* ---------- sidebar ---------- */
#sidebar { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; padding: 16px 12px; min-width: 0; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: .02em; padding: 2px 6px 6px; }
.brand .mark { color: var(--acid); }
.brand .dim { font-weight: 400; font-size: 13px; }
#search { width: 100%; }
#conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 0 -4px; padding: 0 4px; }
.conv { display: block; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.conv:hover { background: var(--panel); }
.conv.on { background: var(--panel); border-color: var(--line2); }
.conv .t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.conv .s { display: flex; gap: 6px; margin-top: 3px; font-family: var(--mono); font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; }
.conv .s b { color: var(--violet); font-weight: 500; }
.conv .del { float: right; opacity: 0; border: 0; background: transparent; color: var(--dim); cursor: pointer; padding: 0 2px; }
.conv:hover .del { opacity: 1; }
.conv .del:hover { color: var(--rose); }
.side-foot { padding: 6px; border-top: 1px solid var(--line); }

/* ---------- main ---------- */
#main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
#topbar { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.title-wrap { flex: 1; min-width: 0; }
#conv-title { width: 100%; background: transparent; border: 1px solid transparent; font-weight: 600; font-size: 16px; padding: 6px 8px; }
#conv-title:hover, #conv-title:focus { border-color: var(--line2); background: var(--bg); }
.top-controls { display: flex; align-items: center; gap: 10px; }
.ctl { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); }
.ctl select { max-width: 230px; padding: 6px 8px; font-size: 13px; }
.pill { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line2); border-radius: 999px; padding: 5px 11px 5px 9px; font-family: var(--mono); font-size: 12px; color: var(--fg2); max-width: 280px; white-space: nowrap; overflow: hidden; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.pill.ready .dot { background: var(--acid); box-shadow: 0 0 10px var(--acid); }
.pill.loading .dot { background: var(--violet); animation: pulse 1s infinite; }
.pill.working .dot { background: var(--cyan); animation: pulse .6s infinite; }
.pill.error .dot { background: var(--rose); }
@keyframes pulse { 50% { opacity: .3; } }

#log { flex: 1; overflow-y: auto; padding: 28px 0 20px; }
.msgs { max-width: 860px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; gap: 18px; }
.empty { max-width: 460px; margin: 18vh auto 0; text-align: center; padding: 0 24px; }
.empty .big { font-size: 42px; color: var(--acid); }
.empty.small { margin: 12vh auto 0; }
.empty p { margin: 0 0 .6em; }
.msg { display: flex; flex-direction: column; gap: 6px; max-width: 100%; }
.msg.user { align-self: flex-end; max-width: 78%; }
/* per-message delete (plan 0018): a small chip on the bubble's outer top corner; hover / focus on
   pointer devices, always visible (dimmed) on touch */
.msg { position: relative; }
.msg .del { position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  padding: 0; font-size: 11px; line-height: 1; background: var(--panel2); border: 1px solid var(--line2); color: var(--dim); cursor: pointer;
  opacity: 0; transition: opacity .15s, color .15s, border-color .15s; }
.msg.user .del { right: auto; left: -9px; }
.msg:hover .del, .msg:focus-within .del, .msg .del:focus-visible { opacity: 1; }
.msg .del:hover { color: var(--rose); border-color: var(--rose); }
.msg .del:disabled, .msg:hover .del:disabled { opacity: 0; pointer-events: none; }
@media (hover: none) { .msg .del { opacity: .6; } .msg .del:disabled { opacity: 0; } }
.msg.user .bubble { background: var(--user); border: 1px solid var(--line2); border-radius: var(--radius) var(--radius) 4px var(--radius); padding: 11px 15px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user.imgreq .bubble { border-color: var(--line2); }
.msg.user.imgreq .bubble::before { content: "image · "; color: var(--violet); font-family: var(--mono); font-size: 12px; }
.msg.assistant .bubble { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) var(--radius) 4px; padding: 13px 17px; min-width: 0; overflow-wrap: anywhere; }
.msg.assistant .bubble.streaming::after { content: "▍"; color: var(--acid); animation: pulse .9s infinite; }
.bubble p { margin: 0 0 .7em; } .bubble p:last-child { margin-bottom: 0; }
.bubble h1, .bubble h2, .bubble h3 { margin: .6em 0 .35em; line-height: 1.25; } .bubble h1 { font-size: 1.3em; } .bubble h2 { font-size: 1.15em; } .bubble h3 { font-size: 1.05em; }
.bubble ul, .bubble ol { margin: .3em 0 .7em; padding-left: 1.4em; } .bubble li { margin: .15em 0; }
.bubble pre { background: #050607; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.5; margin: .6em 0; }
.bubble code { font-family: var(--mono); font-size: 13px; background: #050607; border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.bubble pre code { background: none; border: 0; padding: 0; }
.bubble a { color: var(--cyan); }
.bubble blockquote { border-left: 3px solid var(--violet); margin: .5em 0; padding: 2px 12px; color: var(--fg2); }
.bubble table { border-collapse: collapse; margin: .5em 0; font-size: 14px; } .bubble td, .bubble th { border: 1px solid var(--line2); padding: 4px 9px; }
details.think { border: 1px dashed var(--line2); border-radius: 10px; padding: 6px 12px; margin-bottom: 10px; color: var(--fg2); font-size: 13.5px; }
details.think summary { cursor: pointer; color: var(--violet); font-family: var(--mono); font-size: 12px; }
details.think pre.raw { white-space: pre-wrap; font-family: inherit; background: none; border: 0; padding: 6px 0 0; margin: 0; }
.meta { font-family: var(--mono); font-size: 11.5px; color: var(--dim); padding-left: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.meta .hit { color: var(--acid); }
.msg.assistant.image .bubble { padding: 10px; }
.msg.assistant.image img { display: block; max-width: 100%; border-radius: 10px; cursor: zoom-in; }
.msg.assistant.image .cap { font-size: 13px; color: var(--fg2); padding: 8px 6px 2px; }
.msg.assistant.video .bubble { padding: 10px; }
.msg.assistant.video video { display: block; max-width: 100%; border-radius: 10px; background: #000; }
.msg.assistant.video .cap { font-size: 13px; color: var(--fg2); padding: 8px 6px 2px; }
#video-seed { width: 96px; }
.msg .actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 0 0 2px; }
.msg .actions .btn { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.sys { align-self: center; font-family: var(--mono); font-size: 12px; color: var(--dim); background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.sys.err { color: var(--rose); border-color: rgba(255,107,107,.38); }
.msg.assistant .bubble.pending { color: var(--dim); font-family: var(--mono); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.msg.assistant .bubble.pending::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--violet); animation: pulse 1s infinite; flex: none; }
.msg.assistant .bubble.pending::after { content: none; }
.progress-msg .bubble { display: flex; flex-direction: column; gap: 9px; padding: 12px 16px; }
.progress-msg .prow { display: flex; align-items: baseline; gap: 10px; font-family: var(--mono); font-size: 12.5px; }
.progress-msg .plabel { color: var(--fg2); }
.progress-msg .pinfo { color: var(--acid); white-space: nowrap; }
.pbar { height: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; position: relative; }
.pfill { height: 100%; width: 0; background: var(--acid); border-radius: 6px; transition: width .4s ease-out; }
.pbar.indeterminate .pfill { position: absolute; width: 30% !important; background: var(--violet); animation: sweep 1.4s ease-in-out infinite; }
@keyframes sweep { from { left: -30%; } to { left: 100%; } }

#composer { padding: 10px 20px 18px; border-top: 1px solid var(--line); background: var(--bg2); }
.mode-row { max-width: 860px; margin: 0 auto 8px; display: flex; align-items: center; gap: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 6px 13px; cursor: pointer; color: var(--fg2); font-size: 13px; }
.seg button.on { background: var(--panel2); color: var(--acid); }
.img-opts { display: flex; gap: 8px; align-items: center; }
.img-opts select, .img-opts input { padding: 5px 8px; font-size: 13px; }
.mini { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--dim); }
.mini input { width: 70px; }
#seed { width: 96px; }
.spacer { flex: 1; }
.input-row { max-width: 860px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; }
#input { flex: 1; resize: none; min-height: 48px; max-height: 240px; padding: 12px 14px; border-radius: 12px; line-height: 1.45; }
#send-btn, #stop-btn { height: 48px; padding: 0 20px; border-radius: 12px; min-width: 92px; }

/* ---------- settings blade ---------- */
#blade-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); z-index: 20; }
#blade { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--bg2); border-left: 1px solid var(--line2); z-index: 21; display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(0,0,0,.5); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
#blade > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 10px; }
#blade h2 { margin: 0; font-size: 18px; }
.tabs { display: flex; gap: 0; padding: 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 8px 7px; cursor: pointer; color: var(--dim); font-size: 13px; white-space: nowrap; flex: none; }
.tabs button:hover { color: var(--fg2); }
.tabs button.on { color: var(--acid); border-bottom-color: var(--acid); }
.tab { display: none; padding: 16px 20px 30px; overflow-y: auto; flex: 1; flex-direction: column; gap: 12px; }
.tab.on { display: flex; }
.tab label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--fg2); }
.tab label.row { flex-direction: row; align-items: center; gap: 8px; }
.tab .row { display: flex; gap: 8px; align-items: center; }
.tab .val { font-family: var(--mono); color: var(--acid); margin-left: 6px; }
.tab label:has(> .val) { display: grid; grid-template-columns: auto 1fr; align-items: baseline; row-gap: 5px; }
.tab label:has(> .val) > input { grid-column: 1 / -1; }
.hint { margin: 0 0 4px; font-size: 13px; color: var(--dim); }
.hint.warn { color: var(--rose); }
.list { display: flex; flex-direction: column; gap: 6px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.item:hover { border-color: var(--line2); }
.item .name { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .tag { font-family: var(--mono); font-size: 11px; color: var(--dim); border: 1px solid var(--line2); border-radius: 6px; padding: 1px 6px; }
.item .tag.def { color: var(--acid); border-color: var(--line2); }
.item .tag.unc { color: var(--rose); border-color: rgba(255,107,107,.38); }
.item .tag.res { color: var(--acid); }
#family-form { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 14px; }
#family-form textarea { font-size: 13.5px; line-height: 1.45; }

/* ---------- lightbox ---------- */
#lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 30; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
#lightbox img { max-width: 96vw; max-height: 96vh; border-radius: 6px; }

#menu-btn { display: none; flex: none; }
#side-backdrop { display: none; }
@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  #menu-btn { display: inline-block; }
  #sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); z-index: 19; transform: translateX(-100%); transition: transform .18s ease-out; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  body.side-open #sidebar { transform: none; }
  body.side-open #side-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 18; }
  .ctl span { display: none; }
  #topbar { gap: 8px; padding: 10px 12px; }
  .top-controls { gap: 6px; }
  .ctl select { max-width: 150px; }
  .pill { max-width: 150px; }
  .msgs { padding: 0 14px; }
  .msg.user { max-width: 90%; }
  #composer { padding: 8px 12px 12px; }
  .mode-row { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 760px) {
  .ctl select { max-width: 118px; }
  .pill { max-width: 110px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- incognito ---------- */
.incog-btn { border-style: dashed; color: var(--fg2); }
.conv.incog { border-style: dashed; }
.conv.incog .t::before { content: "🕶 "; }
#incog-banner { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 7px 16px; font-family: var(--mono); font-size: 12px; color: var(--fg2); background: repeating-linear-gradient(135deg, #12151c 0 10px, #0f1218 10px 20px); border-bottom: 1px dashed var(--line2); }
#incog-banner .btn { padding: 3px 10px; font-size: 12px; }
#main.incog #log { background: radial-gradient(ellipse at top, #0e1013, var(--bg) 60%); }

/* ---------- downloads (plan 0007) ---------- */
.tab h3.sub { margin: 14px 0 0; font-size: 14px; color: var(--fg); }
.dl-job { display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 12px; }
.dl-job .tag, #t-status { font-family: var(--mono); font-size: 11px; color: var(--dim); border: 1px solid var(--line2); border-radius: 6px; padding: 1px 6px; }
.dl-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dl-bar { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
#d-fill { height: 100%; width: 0; background: var(--acid); transition: width .4s; }
.dl-job.done #d-fill { background: var(--acid2); }
.dl-job.failed #d-fill, .dl-job.cancelled #d-fill { background: var(--rose); }
.tag.ok { color: var(--acid) !important; border-color: var(--line2) !important; }
.tag.bad { color: var(--rose) !important; border-color: rgba(255,107,107,.38) !important; }
.dl-msg.err { color: var(--rose); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }

/* ==== plan 0035: wizxrd brand, black and white, conversation-first layout ======================== */
body { font: 15px/1.6 var(--sans); grid-template-columns: 264px 1fr; -webkit-font-smoothing: antialiased; }
.wordmark { font-family: var(--mono); font-weight: 700; letter-spacing: -0.045em; color: var(--fg); }
.label, .ctl > span, .mini { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .135em; text-transform: uppercase; color: var(--dim); }

/* buttons: the one solid white control is Send */
.btn { border-radius: 6px; background: transparent; border-color: var(--line2); }
.btn:hover { border-color: var(--fg2); background: rgba(255,255,255,.04); }
.btn.primary { background: var(--fg); color: #08090b; border-color: var(--fg); }
.btn.primary:hover { background: #fff; border-color: #fff; }
.icon-btn { border-radius: 6px; border-color: transparent; color: var(--fg2); }
.icon-btn:hover { border-color: var(--line2); color: var(--fg); }
select, input[type=text], input[type=number], input[type=search], input[type=password], input:not([type]), textarea { border-radius: 6px; background: var(--panel); border-color: var(--line2); }
select:focus, input:focus, textarea:focus { border-color: var(--fg2); }
input[type=range], input[type=checkbox] { accent-color: var(--fg); }

/* sidebar: wordmark, two quiet actions, then your conversations */
#sidebar { background: var(--bg2); gap: 8px; padding: 18px 12px 12px; }
.brand { display: flex; align-items: baseline; gap: .45em; padding: 2px 8px 14px; font-size: 24px; letter-spacing: 0; }   /* owner: the wordmark a little bigger */
.brand .prod { font-family: var(--mono); font-size: 13px; color: var(--dim); letter-spacing: 0; }
.side-action { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; border-color: transparent; color: var(--fg); font-size: 14px; }
.side-action:hover { background: var(--panel2); border-color: transparent; }
.side-action span { width: 16px; text-align: center; color: var(--fg2); }
.incog-btn { border-style: solid; color: var(--fg2); }
#search { margin: 4px 0 6px; background: transparent; }
.conv { border-radius: 6px; padding: 7px 10px; }
.conv:hover { background: var(--panel2); }
.conv.on { background: var(--panel2); border-color: transparent; }
.conv .t { font-weight: 450; font-size: 14px; }
.conv .s { font-size: 10.5px; }
.conv .s b { color: var(--fg2); }
.conv.incog { border-style: solid; }
.conv.incog .t::before { content: "◐ "; color: var(--dim); }
.side-foot { border-top-color: var(--line); padding: 10px 8px 2px; }

/* top bar: just the title and what is running */
#topbar { background: transparent; border-bottom-color: var(--line); padding: 10px 18px; }
#conv-title { font-size: 15px; font-weight: 600; border-radius: 6px; }
#conv-title:hover, #conv-title:focus { background: var(--panel); }
.ctl select { border-color: transparent; background: transparent; color: var(--fg); font-size: 13px; }
.ctl select:hover { border-color: var(--line2); }
.pill { border-color: var(--line); color: var(--dim); }
.pill.ready .dot { background: var(--fg); box-shadow: none; }
.pill.loading .dot, .pill.working .dot { background: var(--fg2); }

/* conversation: one centred column; your words in a soft block, the answer as plain text */
#log { padding: 32px 0 24px; }
.msgs, .mode-row, .input-row { max-width: 780px; }
.msgs { gap: 22px; }
.msg.user .bubble { background: var(--panel2); border: 0; border-radius: 14px; padding: 10px 16px; }
.msg.user.imgreq .bubble::before { content: "IMAGE  "; color: var(--dim); font-size: 10.5px; font-weight: 600; letter-spacing: .135em; }
.msg.assistant .bubble { background: transparent; border: 0; border-radius: 0; padding: 0 2px; }
.msg.assistant.image .bubble, .msg.assistant.video .bubble, .progress-msg .bubble { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.progress-msg .bubble { padding: 12px 16px; }
.msg.assistant .bubble.pending { padding: 0 2px; }
.msg.assistant .bubble.streaming::after { color: var(--fg); }
.msg.assistant.image img, .msg.assistant.video video { border-radius: 6px; }
.bubble a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.bubble blockquote { border-left-color: var(--line2); }
.bubble pre, .bubble code { border-radius: 5px; }
details.think { border-style: solid; border-color: var(--line); border-radius: 6px; }
details.think summary { color: var(--dim); }
.meta { font-size: 11px; color: var(--dim); }
.meta .hit, .progress-msg .pinfo, .tab .val { color: var(--fg); }
.msg .actions .btn { border-radius: 5px; color: var(--fg2); }
.sys { background: transparent; border-color: var(--line); border-radius: 6px; }
.pfill, #d-fill { background: var(--fg); }
.pbar.indeterminate .pfill { background: var(--fg2); }
.empty { margin-top: 22vh; }
.empty .big { display: flex; align-items: center; justify-content: center; gap: .18em; font-size: 44px; color: var(--fg); margin-bottom: 14px; }
.empty p { color: var(--fg2); }

/* composer: one box, the text on top, the tools and Send beneath */
#composer { border-top: 0; background: transparent; padding: 0 20px 20px; }
.composer-box { max-width: 780px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 6px 8px 8px; transition: border-color .15s; }
.composer-box:focus-within { border-color: var(--fg2); }
.input-row { margin: 0; }
#input { border: 0; background: transparent; min-height: 44px; padding: 10px 10px 6px; border-radius: 10px; }
#input:focus { border: 0; }
.mode-row { margin: 0; padding: 0 2px; gap: 10px; flex-wrap: wrap; }
.seg { border: 0; border-radius: 8px; background: transparent; gap: 2px; }
.seg button { border-radius: 7px; padding: 5px 11px; color: var(--dim); font-size: 13px; }
.seg button:hover { color: var(--fg); }
.seg button.on { background: var(--fg); color: #08090b; font-weight: 600; }
.img-opts select, .img-opts input { background: transparent; border-color: var(--line); }
#send-btn, #stop-btn { height: 34px; min-width: 76px; padding: 0 16px; border-radius: 999px; }
.intent { max-width: 780px; margin: 0 auto 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--panel); font-size: 13.5px; }
.intent span { flex: 1; min-width: 200px; color: var(--fg2); }
.intent .btn { padding: 5px 12px; font-size: 13px; }

/* ---- second pass: a night sky, a start screen with somewhere to begin, a little more depth ---- */
#main { position: relative; isolation: isolate; }
#sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
#log { background: transparent; }
#main.incog #log { background: transparent; }
#topbar { background: rgba(8,9,11,.72); }
#sidebar { background: linear-gradient(180deg, #0c0d11, #090a0d); border-right-color: var(--line); }

/* who is speaking: small mono labels, as on the wizxrd site */
.msg::before { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .135em; text-transform: uppercase; color: var(--dim); }
.msg.user::before { content: "You"; align-self: flex-end; padding-right: 4px; }
/* owner: the wordmark above each reply about the size it has in the sidebar */
.msg.assistant::before { content: "wizxrd"; text-transform: none; letter-spacing: -0.045em; font-size: 22px; line-height: 1.1; font-weight: 700; color: var(--fg); padding-left: 2px; margin-bottom: 2px; }
.msg.user .bubble { background: rgba(236,238,241,.07); border: 1px solid var(--line); }
.msg.assistant .bubble { font-size: 15.5px; line-height: 1.68; }
.msg.assistant.image .bubble, .msg.assistant.video .bubble, .progress-msg .bubble { background: rgba(14,16,19,.82); border-color: var(--line2); box-shadow: 0 18px 50px -24px #000; }

/* start screen */
.empty { max-width: 720px; margin: 15vh auto 0; }
.empty .big { font-size: 84px; margin-bottom: 10px; }   /* owner: the wordmark a little bigger */
.empty .lead { font-size: 17px; color: var(--fg2); margin: 0 0 30px; }
.empty .fine { margin: 26px 0 0; font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .135em; text-transform: uppercase; color: var(--dim); }
.starts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: left; }
.start { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 5px; padding: 14px 16px; border: 1px solid var(--line2); border-radius: 8px;
  background: rgba(14,16,19,.7); transition: border-color .15s, background .15s, transform .15s; }
.start:hover { border-color: var(--fg2); background: rgba(20,22,26,.9); transform: translateY(-1px); }
.start:focus-visible { outline: 2px solid var(--fg2); outline-offset: 2px; }
.start .k { font-family: var(--mono); font-size: 12.5px; font-weight: 700; letter-spacing: -0.01em; color: var(--fg); }
.start .d { font-size: 13.5px; line-height: 1.45; color: var(--fg2); }
@media (max-width: 700px) { .starts { grid-template-columns: 1fr; } }

/* composer: lifted off the sky */
.composer-box { background: rgba(14,16,19,.88); box-shadow: 0 24px 60px -28px #000, 0 0 0 1px rgba(255,255,255,.02) inset; }
#composer { padding-top: 6px; background: linear-gradient(180deg, rgba(8,9,11,0), rgba(8,9,11,.85) 55%); }
.intent { background: rgba(14,16,19,.92); }

/* sidebar details */
.side-label { padding: 10px 10px 2px; font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .135em; text-transform: uppercase; color: var(--dim); }
.side-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.side-foot .mono { font-size: 10.5px; }
.local { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--fg2); }
.local i { width: 7px; height: 7px; border-radius: 50%; background: var(--fg); box-shadow: 0 0 8px rgba(236,238,241,.6); }
.conv { position: relative; }
.conv.on::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--fg); }

/* ---- the brain (plan 0036): dropped files, and what was read ---- */
.icon-btn.attach { width: 34px; height: 34px; display: grid; place-items: center; color: var(--fg2); }
.icon-btn.attach svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.attach-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 6px 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 6px 4px 10px; border: 1px solid var(--line2); border-radius: 6px; background: rgba(255,255,255,.04); font-size: 12.5px; }
.chip .n { font-family: var(--mono); font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .s { color: var(--dim); white-space: nowrap; }
.chip button { border: 0; background: transparent; color: var(--dim); cursor: pointer; padding: 0 4px; font-size: 11px; }
.chip button:hover { color: var(--fg); }
.refs { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.msg.user .refs { justify-content: flex-end; }
.refs .lbl { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .135em; text-transform: uppercase; color: var(--dim); margin-right: 2px; }
.ref { font-family: var(--mono); font-size: 11px; color: var(--fg2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 7px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref.file { border-color: var(--line2); color: var(--fg); }
#main.dropping::after { content: "Drop to attach"; position: absolute; inset: 12px; z-index: 5; display: grid; place-items: center; border: 1px dashed var(--fg2); border-radius: 12px;
  background: rgba(8,9,11,.82); font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .135em; text-transform: uppercase; color: var(--fg); pointer-events: none; }
#brain-note { font-size: 10.5px; }

/* settings blade and small parts */
#blade { background: var(--bg2); }
.tabs button.on { color: var(--fg); border-bottom-color: var(--fg); }
.item, .dl-job, #family-form { border-radius: 8px; }
.item .tag.def, .item .tag.res, .tag.ok { color: var(--fg) !important; }
#incog-banner { background: var(--panel); }

/* settings: every tab reachable, and a model's whole name readable (owner, 0037) */
.tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; }
#model-list .item { flex-wrap: wrap; row-gap: 6px; }
#model-list .item .name { flex: 1 1 100%; white-space: normal; overflow: visible; overflow-wrap: anywhere; font-family: var(--mono); font-size: 13px; }
#model-list .item .btn.load, #model-list .item .tag.res { margin-left: auto; }
#model-list .item .btn.load { padding: 5px 14px; font-size: 12.5px; }

/* Composer actions (plan 0042): with the image or video controls showing, the row is wider than the box
   and wraps. Send then sits at the right of its own line, under the paperclip, instead of dropping to the left. */
.mode-row #send-btn, .mode-row #stop-btn { margin-left: auto; }
