:root {
  --bg: #16181d;
  --panel: #1d2026;
  --panel-2: #252931;
  --line: #2f343d;
  --text: #eef0e8;
  --muted: #9aa0a6;
  --faint: #6b7178;
  --accent: #c8f07a;
  --ok: #7fd18b;
  --warn: #f0c66b;
  --bad: #ef7d6d;
  --radius: 14px;
  color-scheme: dark;
  /* og-design safe areas: the larger of what the browser reports and what the Android
     wrapper injects (--og-inset-*, OgEdgeToEdge INJECT mode). Nothing goes under the bars. */
  --og-safe-top: max(env(safe-area-inset-top, 0px), var(--og-inset-top, 0px));
  --og-safe-right: max(env(safe-area-inset-right, 0px), var(--og-inset-right, 0px));
  --og-safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--og-inset-bottom, 0px));
  --og-safe-left: max(env(safe-area-inset-left, 0px), var(--og-inset-left, 0px));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; }

#shell { display: flex; height: 100dvh; overflow: hidden; }

/* drawer */
#drawer { width: 280px; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: calc(14px + var(--og-safe-top)) 12px calc(14px + var(--og-safe-bottom)) calc(12px + var(--og-safe-left)); gap: 6px; overflow-y: auto; }
.spacer { flex: 1; }
.app-link { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; padding: 8px 0; font-size: 14px; }
.app-link small { color: var(--faint); }
/* task #537: new question is a round + beside the avatar */
.new-circle { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--text); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.new-circle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.new-circle:hover { opacity: .9; }
.new-circle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav { display: flex; flex-direction: column; margin: 8px 0 4px; }
.nav a, #conversations a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--text); text-decoration: none; }
.nav a:hover, #conversations a:hover, .nav a.on, #conversations a.on { background: var(--panel-2); }
.list-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); padding: 10px 10px 2px; }
#conversations { list-style: none; margin: 0; padding: 0; }
#conversations a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; color: #d6d9d0; }
#conversations .empty { color: var(--faint); font-size: 14px; padding: 6px 10px; }
.drawer-foot { margin-top: auto; font-size: 12px; color: var(--faint); padding: 10px 4px 2px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.avatar-btn { position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 700; font-size: 14px; letter-spacing: .02em; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.avatar-btn:hover, .avatar-btn.on, .avatar-btn[aria-expanded="true"] { border-color: var(--muted); }
.avatar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.avatar-btn.admin::after { content: ""; position: absolute; right: -1px; top: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--warn); border: 2px solid var(--panel); }
.avatar-pop .pop-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 6px; }
.avatar-pop .avatar-ini.big { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.avatar-pop .who { display: flex; flex-direction: column; min-width: 0; }
.avatar-pop .who b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-pop .who span { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.pop .pop-text { flex: 1; }
.pop .pop-sub { font-size: 12px; color: var(--faint); }
.pop .pop-sub.on { color: var(--warn); }
.pop button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pop:focus { outline: none; }
#scrim { display: none; transition: opacity .2s ease; }

/* main */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#top { display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--og-safe-top)) calc(16px + var(--og-safe-right)) 10px calc(16px + var(--og-safe-left)); border-bottom: 1px solid var(--line); background: var(--bg); }
#title { font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 9px; cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--panel-2); }
.status { display: inline-flex; gap: 5px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; cursor: pointer; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); } .dot.paused { background: var(--warn); } .dot.down, .dot.refused { background: var(--bad); } .dot.not_linked { background: transparent; border: 1.5px solid var(--faint); }
.status-rows .row { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; }
.status-rows .row b { min-width: 74px; }
.status-rows .row span { color: var(--muted); }

#view { flex: 1; overflow-y: auto; padding: 16px calc(16px + var(--og-safe-right)) 24px calc(16px + var(--og-safe-left)); scroll-behavior: smooth; }
body.no-composer #view { padding-bottom: calc(24px + var(--og-safe-bottom)); }
.inner { max-width: 760px; margin: 0 auto; }

/* welcome */
.welcome { padding: 6vh 0 10px; }
.welcome img { width: 64px; height: 64px; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
.welcome h1 { font-size: 26px; letter-spacing: -0.02em; margin: 14px 0 6px; }
.welcome p { color: var(--muted); margin: 0 0 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; font-size: 14px; cursor: pointer; color: #d6d9d0; text-align: left; }
.chip:hover { border-color: var(--muted); }
.privacy { margin-top: 22px; font-size: 13px; color: var(--faint); display: flex; gap: 8px; align-items: flex-start; }
.privacy svg { width: 16px; height: 16px; margin-top: 2px; }

/* turns */
.q { display: flex; justify-content: flex-end; margin: 18px 0 10px; }
.q div { background: var(--panel-2); border-radius: 16px 16px 4px 16px; padding: 10px 14px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.q.steer { margin-top: -4px; }
.q.steer > div { border: 1px dashed var(--line); background: none; font-size: 14px; }
.q.steer .tag { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 600; }
.a { margin: 0 0 8px; }
.a .body { overflow-wrap: anywhere; }
.a .body.draft:empty { display: none; }
.a .body.draft { margin-bottom: 8px; }
.a .body p { margin: 0 0 10px; }
.a .body ul, .a .body ol { margin: 0 0 10px; padding-left: 22px; }
.a .body pre.code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 0 0 12px; }
.a .body pre.code code { background: none; padding: 0; font-size: 13px; white-space: pre; }
.a .body code { background: var(--panel-2); padding: 1px 5px; border-radius: 5px; font-size: 14px; }
.cite { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 19px; padding: 0 5px; border-radius: 6px; background: #2b3424; color: var(--accent); font-size: 12px; font-weight: 700; text-decoration: none; vertical-align: 1px; margin: 0 1px; }
.steps { list-style: none; margin: 4px 0 10px; padding: 0; font-size: 14px; color: var(--muted); }
.steps li { display: flex; gap: 8px; align-items: center; padding: 2px 0; }
.steps li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.steps li.now::before { background: var(--accent); animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }
details.how { font-size: 13px; color: var(--faint); margin: 6px 0; }
details.how summary { cursor: pointer; }
.analyses { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 10px; }
.analyses figure { margin: 0; }
.analyses .chart img { display: block; width: 100%; max-width: 760px; height: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.a .body .table-wrap { margin: 0 0 10px; }
.table-fig figcaption { font-weight: 700; font-size: 14px; margin: 0 0 6px; }
.table-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); max-width: 760px; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 7px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { position: sticky; top: 0; background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 13px; }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; }
.table-note { color: var(--muted); font-size: 13px; margin-top: 4px; }
.how.code pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel-2); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; margin: 6px 0 0; }
.sources { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px; }
.src { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; text-decoration: none; color: var(--text); font-size: 14px; }
.src:hover { border-color: var(--muted); }
.src .id { color: var(--accent); font-weight: 700; min-width: 24px; }
.src .t { flex: 1; min-width: 0; }
.src .t div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src .urn { color: var(--faint); font-size: 12px; font-family: ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src.uncited { opacity: .6; }
.more-src { background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; padding: 2px 0; text-align: left; }

.banner { border-radius: var(--radius); padding: 12px 14px; margin: 6px 0 10px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.banner svg { margin-top: 1px; }
.banner.wait { background: #2d2717; border: 1px solid #4f4320; color: #f3dfa9; }
.banner.fail { background: #2e1c1a; border: 1px solid #573029; color: #f6c2b9; }
.banner .act { margin-top: 8px; display: flex; gap: 8px; }
.banner a.btn { text-decoration: none; color: inherit; display: inline-block; }
.setup-list { margin: 6px 0 0; padding-left: 18px; }
.setup-list li { margin: 3px 0; }
#setup { margin-top: 16px; }
.quick h4 { margin: 12px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.quick .snip { color: var(--muted); font-size: 13px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; }
.card .kind { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.card .kind svg { width: 15px; height: 15px; }
.card .msg { white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 15px; overflow-wrap: anywhere; }
.card .row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.card .state { margin-top: 10px; font-size: 14px; color: var(--muted); }
.btn { border: 1px solid var(--line); background: var(--panel-2); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 6px 11px; font-size: 14px; }

/* composer */
#composer { padding: 10px calc(16px + var(--og-safe-right)) calc(12px + var(--og-safe-bottom)) calc(16px + var(--og-safe-left)); border-top: 1px solid var(--line); background: var(--bg); }
.compose-box { max-width: 760px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 14px; }
.compose-box:focus-within { border-color: var(--muted); }
/* wraps (never one long line), grows to 3 lines, then scrolls inside the box */
#q { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: none; color: var(--text); font: inherit; line-height: 24px; padding: 8px 0; height: 40px; max-height: calc(3 * 24px + 16px); overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
#q::placeholder { color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#send { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--text); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
#send:disabled { opacity: .4; }
.talk-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; margin-left: -8px; }
.talk-btn[hidden], .nav a[hidden], .dictate-btn[hidden] { display: none; }
/* task #501: talk mode on = lit; dictation = a plain mic right of the box */
.talk-btn.on { background: var(--accent); color: var(--bg); border-color: var(--accent); box-shadow: 0 0 0 4px #c8f07a26; }
.talk-btn { position: relative; transition: transform .15s, background .15s, box-shadow .15s; }
.talk-btn.st-listening { animation: talk-listen 1.6s ease-in-out infinite; }
.talk-btn.st-hearing { transform: scale(1.08); box-shadow: 0 0 0 6px #c8f07a40, 0 0 0 12px #c8f07a1a; }
.talk-btn.st-thinking { animation: pulse .9s infinite alternate; }
.talk-btn.st-speaking { background: #9ec5ff; border-color: #9ec5ff; box-shadow: 0 0 0 4px #9ec5ff33; }
.talk-btn.st-paused { border-color: var(--accent); color: var(--accent); }
.talk-btn.unavailable { opacity: .45; }
@keyframes talk-listen { 0%, 100% { box-shadow: 0 0 0 3px #c8f07a33; } 50% { box-shadow: 0 0 0 8px #c8f07a14; } }
/* task #533: the speaker beside talk: replies and short progress read out */
.speak-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; transition: background .15s, box-shadow .15s; }
.speak-btn[hidden] { display: none; }
.speak-btn .sp-wave { display: none; }
.speak-btn.on { color: var(--accent); border-color: var(--accent); }
.speak-btn.on .sp-wave { display: inline; }
.speak-btn.on .sp-off { display: none; }
.speak-btn.speaking { background: #9ec5ff; border-color: #9ec5ff; color: var(--bg); box-shadow: 0 0 0 4px #9ec5ff33; }
.compose-tools .speak-btn { width: 32px; height: 32px; border-radius: 10px; margin: 0; }
body.talk-on .dictate-btn { display: none; }
.dictate-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.dictate-btn.on { color: var(--accent); animation: pulse .8s infinite alternate; }
/* task #500: the + menu on the question bar, its chips, and the popup */
#composer { position: relative; }
.menu-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; margin-left: -8px; transition: transform .15s; }
.menu-btn[aria-expanded=true] svg { transform: rotate(45deg); }
.menu-btn svg { transition: transform .15s; }
.menu-btn.on { border-color: var(--accent); color: var(--accent); }
.menu-btn + .talk-btn { margin-left: 0; }
.compose-top { max-width: 760px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.compose-top:has(.mode-chips:not(:empty)), body.typing .compose-top { margin-bottom: 8px; }
.mode-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
/* task #519: while typing on a phone, +, talk and mic leave the box for this slim row above it,
   so the text gets the full width and only Send stays in the box */
.compose-tools { display: none; gap: 6px; align-items: center; }
body.typing .compose-tools { display: flex; }
.compose-tools .menu-btn, .compose-tools .talk-btn, .compose-tools .dictate-btn { width: 32px; height: 32px; border-radius: 10px; margin: 0; }
.compose-tools .dictate-btn { border: 1px solid var(--line); background: var(--panel-2); }
.compose-tools .dictate-btn[hidden], .compose-tools .talk-btn[hidden] { display: none; }
.compose-tools svg { width: 18px; height: 18px; }
body.typing .compose-box { padding-left: 14px; }
.mchip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #3c4a2c; background: #222b1b; color: var(--accent); border-radius: 999px; padding: 3px 6px 3px 11px; font-size: 13px; font-weight: 600; cursor: pointer; }
.mchip svg { width: 14px; height: 14px; opacity: .8; }
.mchip.cloud { border-color: #5a4a22; background: #2d2717; color: var(--warn); }
/* task #548: the picked Claude account's model + Read OG Vault, nested under it; vault on is marked */
.msub { margin: 0 0 4px 30px; border-left: 2px solid var(--line); padding-left: 4px; }
.msub .mh { padding-top: 6px; }
.mi-wrap.vault-on .mi { background: #2d2717; }
.mi-wrap.vault-on .mi b, .mi-wrap.vault-on .mi small { color: var(--warn); }
.mi-wrap.vault-on .mi .box { background: var(--warn); border-color: var(--warn); }
/* task #551: per-model access boxes to the right of each model row */
.mrow { display: flex; align-items: flex-start; gap: 4px; }
.mrow > .mi { flex: 1; min-width: 0; }
.acc { display: flex; gap: 2px; flex: none; padding-top: 8px; }
.acc > * { width: 36px; display: inline-flex; justify-content: center; }
.acc-head { display: flex; align-items: flex-end; gap: 4px; padding-right: 0; }
.acc-head > span { flex: 1; }
.acc-head .acc { padding-top: 0; }
.acc-head .acc span { font-size: 10px; letter-spacing: .02em; }
.abox { height: 22px; border-radius: 6px; border: 1.5px solid var(--faint); background: none; color: var(--bg); cursor: pointer; align-items: center; padding: 0; width: 22px !important; margin: 0 7px; }
.abox.on { background: var(--accent); border-color: var(--accent); }
.abox.on.warn { background: var(--warn); border-color: var(--warn); }
.abox:disabled { opacity: .3; cursor: default; }
.abox svg { width: 14px; height: 14px; stroke-width: 3; }
.mchip.mcp { border-color: var(--line); background: var(--panel-2); color: var(--text); }
.menu { position: absolute; z-index: 25; left: calc(16px + var(--og-safe-left)); bottom: calc(100% - 4px); width: min(380px, calc(100% - 32px)); max-height: min(70vh, 560px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 40px #000a; padding: 8px; }
@media (min-width: 821px) { .menu { left: max(calc(16px + var(--og-safe-left)), calc(50% - 380px)); } }
.menu[hidden] { display: none; }
.mtitle { font-weight: 800; padding: 6px 8px 2px; }
.msec { padding: 4px 0; }
.msec + .msec { border-top: 1px solid var(--line); }
.mh { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 8px 8px 4px; }
.mi { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 8px; cursor: pointer; }
.mi:hover:not(:disabled) { background: var(--panel-2); }
.mi:disabled { opacity: .45; cursor: default; }
.mi .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--faint); display: inline-flex; align-items: center; justify-content: center; flex: none; margin-top: 1px; }
.mi.radio .box { border-radius: 50%; }
.mi.on .box { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.mi .box svg { width: 14px; height: 14px; stroke-width: 3; }
.mi .t { display: flex; flex-direction: column; min-width: 0; }
.mi .t b { font-weight: 600; font-size: 15px; }
.mi .t small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.mnote { color: var(--faint); font-size: 13px; padding: 6px 8px; }
.mlink { display: block; font-size: 14px; padding: 8px; border-radius: 10px; text-decoration: none; }
.mlink:hover { background: var(--panel-2); }
/* context ring (task #500) */
.ctx-ring { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px 4px 5px; cursor: pointer; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.ctx-ring[hidden] { display: none; }
.ctx-ring svg { width: 22px; height: 22px; stroke-width: 3; }
.ctx-ring .track { stroke: var(--panel-2); fill: none; }
.ctx-ring .fill { stroke: var(--accent); fill: none; stroke-linecap: round; transition: stroke-dasharray .4s; }
.ctx-ring.warn .fill { stroke: var(--warn); } .ctx-ring.bad .fill { stroke: var(--bad); }
.ctx-ring .long { font-weight: 600; color: var(--accent); text-transform: uppercase; font-size: 10px; letter-spacing: .04em; }
.ctx-note { font-size: 12.5px; color: var(--faint); border-top: 1px dashed var(--line); padding: 8px 2px 0; margin: 14px 0 0; text-align: center; }
/* the answer's footer (task #554): the Listen icon, then who answered */
.a .a-foot { display: flex; align-items: center; gap: 8px; margin: -4px 0 8px; min-height: 28px; }
.a .by { font-size: 12px; color: var(--faint); }
.a .by.cloud { color: var(--warn); }
/* listen to one answer (owner ask): a speaker icon; tapping the answer spells out "Listen" */
.listen-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; min-width: 28px; padding: 0 6px; margin-left: -6px;
  border: 1px solid transparent; border-radius: 8px; background: none; color: var(--faint); font: inherit; font-size: 12.5px; cursor: pointer; }
.listen-btn:hover { color: var(--text); background: var(--panel-2); }
.listen-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.listen-btn .lb { display: none; }
.a.listen-open .listen-btn, .listen-btn.on { color: var(--text); border-color: var(--line); }
.a.listen-open .listen-btn .lb, .listen-btn.on .lb { display: inline; }
.listen-btn.on { color: var(--accent); border-color: var(--accent); }
.listen-btn.on svg { fill: currentColor; stroke: none; }
/* Settings page */
.set-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 14px; scroll-margin-top: 10px; }
.set-card h3 { margin: 0 0 4px; font-size: 16px; }
.set-lead { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.set-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-top: 6px; }
.set-row select { flex: 1; min-width: 160px; }
.claude-code-row input { flex: 1; min-width: 160px; }
/* task #545: several Claude accounts, each with a name */
.claude-acct { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 8px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.claude-acct-top { display: flex; gap: 8px; align-items: center; min-width: 0; grid-column: 1 / -1; }
.claude-acct .claude-name { flex: 1; min-width: 0; font-weight: 600; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; margin-left: -6px; color: var(--text); font-size: 15px; }
.claude-acct .claude-name:hover, .claude-acct .claude-name:focus { border-color: var(--line); background: var(--panel-2); outline: none; }
.claude-acct-meta { display: flex; gap: 4px 10px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.claude-acct-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.claude-acct .claude-model { min-width: 0; max-width: 140px; }
@media (max-width: 560px) {
  .claude-acct { grid-template-columns: 1fr; }
  .claude-acct-actions { justify-content: flex-start; }
}
.claude-def { flex: none; color: var(--accent); }
.claude-limit { color: var(--bad); }
.claude-add { margin-top: 8px; }
.claude-new { margin-top: 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: ui-monospace, monospace; overflow-wrap: anywhere; } .bad { color: var(--bad); }
.set-card select, .set-card input[type=password], .set-card input[type=number], .set-card input[type=text], .set-card input[type=url] { min-width: 0; box-sizing: border-box; font: inherit; font-size: 15px;
  padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.set-card .grid { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: 8px 12px; align-items: center; font-size: 14px; margin-bottom: 6px; }
.set-card .switch { display: flex; gap: 8px; align-items: center; }
.set-card .switch input { accent-color: var(--accent); width: 18px; height: 18px; }
.prov { border-top: 1px solid var(--line); padding: 12px 0 4px; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.prov-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.keyrow { display: flex; gap: 8px; min-width: 0; }
.keyrow input { flex: 1; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; }
.tool { font-family: ui-monospace, monospace; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); }
.tool.off { opacity: .5; text-decoration: line-through; }
.add-mcp { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 12px; }
.add-mcp input[type=password] { grid-column: 1 / 2; }
.page .back { display: inline-block; font-size: 14px; text-decoration: none; margin-bottom: 4px; }
@media (max-width: 520px) { .set-card .grid { grid-template-columns: 1fr; } .add-mcp { grid-template-columns: 1fr; } .add-mcp input[type=password] { grid-column: auto; } }

/* talk mode */
.talk { display: flex; flex-direction: column; min-height: 100%; }
.talk-lines { flex: 1; display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; }
.tl { max-width: 88%; padding: 10px 14px; border-radius: 16px; overflow-wrap: anywhere; }
.tl.you { align-self: flex-end; background: var(--panel-2); border-radius: 16px 16px 4px 16px; }
.tl.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; }
.tl.task { align-self: stretch; background: #1f2a1b; border: 1px solid #34472b; color: #dfeccf; font-size: 15px; }
.tl.task::before { content: "Task done · "; color: var(--accent); font-weight: 700; }
.tl.partial { opacity: .6; font-style: italic; }
/* task #501: which way each of your lines came in, jobs started, a reply still coming */
.tl .via { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.tl .via svg { width: 13px; height: 13px; }
.tl.you.typed { background: #23292f; border: 1px solid #34404b; }
.tl.you.typed .via { color: #9ec5ff; }
.tl.you.spoken .via { color: var(--accent); }
.tl.job { align-self: stretch; font-size: 14px; color: var(--muted); border: 1px dashed var(--line); background: none; padding: 7px 12px; }
.tl.job::before { content: "▶ "; color: var(--accent); }
.tl.pending .tx { animation: pulse .9s infinite alternate; }
/* talk: tasks panel (swipe left across the talk screen, or the Tasks button) */
.tasks-btn { display: inline-flex; align-items: center; gap: 7px; flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 14px; cursor: pointer; }
.tasks-btn[hidden] { display: none; }
.tasks-btn svg { display: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (max-width: 480px) { .tasks-btn { padding: 5px 5px 5px 9px; gap: 5px; } .tasks-btn .lbl { display: none; } .tasks-btn svg { display: block; } }
.tasks-btn .n { background: var(--accent); color: var(--bg); border-radius: 999px; min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; padding: 0 6px; }
.tasks-btn .n.zero { background: var(--panel-2); color: var(--muted); }
#tasks-panel { position: fixed; z-index: 40; top: 0; bottom: 0; right: 0; width: min(360px, 88vw); background: var(--panel); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .2s ease; display: flex; flex-direction: column; padding: calc(14px + var(--og-safe-top)) calc(14px + var(--og-safe-right)) calc(14px + var(--og-safe-bottom)) 14px; }
body.tasks-open #tasks-panel { transform: none; }
#tasks-scrim { display: none; transition: opacity .2s ease; }
body.tasks-open #tasks-scrim, body.tasks-drag #tasks-scrim { display: block; position: fixed; inset: 0; background: #0009; z-index: 35; }
.tp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tp-head h3 { margin: 0; font-size: 18px; flex: 1; }
.tp-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tp-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); }
.tp-item .q { font-size: 15px; overflow-wrap: anywhere; margin: 0; display: block; }
.tp-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.chip-s { border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.chip-s.running { background: #2b3424; color: var(--accent); }
.chip-s.waiting { background: #3a3220; color: var(--warn); }
.chip-s.done { background: #20302a; color: var(--ok); }
.chip-s.failed { background: #3a2220; color: var(--bad); }
.chip-s.cancelled { background: var(--panel-2); color: var(--muted); }
.tp-item .row { display: flex; gap: 8px; margin-top: 8px; }
.tp-answer { margin-top: 8px; font-size: 14px; }
.note-item { display: flex; gap: 10px; align-items: flex-start; }
.note-item .t { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-item .when { color: var(--faint); font-size: 12px; margin-top: 4px; }
.cloud-notice { max-width: 760px; margin: 8px auto 0; font-size: 13px; line-height: 1.45; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--warn, #c98a1b); color: var(--text); background: color-mix(in srgb, var(--warn, #c98a1b) 10%, transparent); }
.cloud-notice[hidden] { display: none; }
.cloud-set { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 16px; }
.cloud-set h3 { margin: 0 0 4px; font-size: 15px; }
.cloud-set p { margin: 4px 0 10px; font-size: 13px; color: var(--muted); }
.cloud-set .grid { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 12px; align-items: center; font-size: 14px; }
.cloud-set input[type=password], .cloud-set input[type=number], .cloud-set select { width: 100%; min-width: 0; box-sizing: border-box; font: inherit;
  padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.cloud-set .keyrow { display: flex; gap: 8px; min-width: 0; }
.cloud-set .keyrow input { flex: 1; }
.cloud-set .usage { font-size: 13px; color: var(--muted); margin-top: 10px; }
.cloud-set .switch { display: flex; gap: 8px; align-items: center; }
.cloud-set .switch input { accent-color: var(--accent); width: 18px; height: 18px; }
.research-card .cloud-tag { font-size: 12px; color: var(--warn, #c98a1b); margin-top: 6px; }
@media (max-width: 520px) { .cloud-set .grid { grid-template-columns: 1fr; } }

/* research jobs (task #471) */
.research-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 6px 0 10px; }
.research-card .kind { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.research-card .kind svg { width: 15px; height: 15px; }
.research-card .rt { font-weight: 700; margin-bottom: 8px; overflow-wrap: anywhere; }
.bar { height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }
.bar.wait i { background: var(--warn); }
.research-card .meta { font-size: 13px; color: var(--muted); }
.research-card .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.report-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.report-link svg { width: 16px; height: 16px; }
.a > .report-link { margin: 2px 0 8px; }
.job-list { display: flex; flex-direction: column; gap: 10px; }
.job-list .research-card { margin: 0; }
.build-card .meta.last { color: var(--text); margin-top: 4px; overflow-wrap: anywhere; }
.build-card .meta.note { margin-top: 4px; overflow-wrap: anywhere; }
.job-list .q { font-weight: 700; margin-bottom: 4px; overflow-wrap: anywhere; display: block; color: var(--text); text-decoration: none; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.badge.running { color: var(--accent); } .badge.waiting { color: var(--warn); } .badge.failed { color: var(--bad); } .badge.done { color: var(--ok); }

/* pages */
.page h2 { font-size: 22px; letter-spacing: -0.01em; margin: 6px 0 4px; }
.page .lead { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.audit { width: 100%; border-collapse: collapse; font-size: 13px; }
.audit td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.audit .tool { font-family: ui-monospace, monospace; color: var(--text); white-space: nowrap; }
.audit .args { font-family: ui-monospace, monospace; color: var(--muted); overflow-wrap: anywhere; }
.audit .when { color: var(--faint); white-space: nowrap; }
.audit .q-text { font-family: Inter, system-ui, sans-serif; color: var(--faint); margin-top: 3px; }
.audit .no { color: var(--bad); }
.b-item { display: flex; gap: 12px; align-items: flex-start; }
.b-item .t { flex: 1; min-width: 0; }
.b-item .p { color: var(--muted); font-size: 14px; }
.empty-state { color: var(--muted); padding: 20px 0; }
.toast { position: fixed; left: 50%; bottom: calc(110px + var(--og-safe-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }

.only-phone { display: none; }
@media (max-width: 820px) {
  .only-phone { display: inline-flex; }
  #drawer { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .2s ease; width: min(300px, 86vw); }
  body.drawer-open #drawer { transform: none; }
  body.drawer-open #scrim, body.drawer-drag #scrim { display: block; position: fixed; inset: 0; background: #0009; z-index: 20; }
  #view { padding: 12px 16px 20px; }
  .audit .when { display: none; }
}

/* sign-in with the OG Vault account (task #439) */
#signin { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: calc(24px + var(--og-safe-top)) calc(20px + var(--og-safe-right)) calc(24px + var(--og-safe-bottom)) calc(20px + var(--og-safe-left)); overflow: auto; }
.signin-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.signin-card h1 { font-size: 22px; margin: 4px 0 0; }
.signin-card .muted { color: var(--muted); font-size: 14px; margin: 0 0 6px; line-height: 1.4; }
.signin-logo { width: 64px; height: 64px; }
.signin-card input { font: inherit; font-size: 16px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.signin-card input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.signin-card input[hidden] { display: none; }
.signin-card .err { color: var(--bad); font-size: 14px; min-height: 1em; }
.signin-card .primary { font-weight: 700; font-size: 16px; padding: 12px; border-radius: 12px; border: 0; background: var(--text); color: var(--bg); cursor: pointer; }
.signin-card .primary:disabled { opacity: .6; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 12px; }

/* history: chat menu, folders, thread tree (task #502) */
.icon-btn.small { padding: 5px; color: var(--muted); }
.icon-btn.small svg { width: 17px; height: 17px; }
.icon-btn.small.on { color: var(--accent); background: var(--panel-2); }
.icon-btn[hidden] { display: none; }
#conversations ul { list-style: none; margin: 0; padding: 0; }
#conversations .row { display: flex; align-items: center; border-radius: 9px; }
#conversations .row:hover, #conversations .row.on { background: var(--panel-2); }
#conversations .row a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; }
#conversations .row a .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* task #544: a chat's number in front of its title (list, header) and #N links to it */
.cnum { flex: none; color: var(--muted); font-weight: 600; font-size: .85em; font-variant-numeric: tabular-nums; margin-right: 6px; }
#conversations .row a .cnum { margin-right: 0; }
a.chatref { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
a.chatref:hover { text-decoration: underline; }
#conversations .row.on a { color: var(--text); }
.dots { flex: none; background: none; border: 0; color: var(--muted); padding: 6px; margin-right: 2px; border-radius: 8px; cursor: pointer; display: inline-flex; opacity: 0; }
.dots svg { width: 18px; height: 18px; stroke-width: 2.6; }
.dots:hover { background: var(--line); color: var(--text); }
#conversations .row:hover .dots, #conversations .row.on .dots, .dots:focus-visible { opacity: 1; }
@media (hover: none) { .dots { opacity: .75; } }
.folder-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: none; border: 0; color: #d6d9d0; font: inherit; font-size: 15px; padding: 9px 6px 9px 4px; cursor: pointer; text-align: left; }
.folder-toggle svg { width: 17px; height: 17px; color: var(--muted); }
.folder-toggle svg:first-child { width: 14px; height: 14px; transition: transform .15s; transform: rotate(90deg); }
.folder.collapsed .folder-toggle svg:first-child { transform: none; }
/* task #521: fold a chat with many threads */
#conversations .fold { flex: none; width: 22px; height: 30px; margin-right: -4px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
#conversations .fold svg { width: 13px; height: 13px; transition: transform .15s; transform: rotate(90deg); }
#conversations .fold.shut svg { transform: none; }
#conversations .fold-n { flex: none; margin-left: auto; font-size: 12px; color: var(--muted); background: var(--panel-2); border-radius: 999px; padding: 1px 7px; }
/* task #538: a pinned chat */
#conversations .pin-mark { flex: none; margin-left: auto; display: inline-flex; color: var(--muted); }
#conversations .pin-mark svg { width: 14px; height: 14px; }
#conversations .pin-mark + .fold-n { margin-left: 0; }
#conversations .fold-n.run { color: var(--text); box-shadow: inset 0 0 0 1px var(--ok, #6fcf8e); }
.folder-toggle .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.folder-toggle .count { color: var(--faint); font-size: 12px; margin-left: auto; }
#conversations .in-folder { margin-left: 11px; padding-left: 6px; border-left: 1px dashed var(--line); }
#conversations .in-folder .empty { font-size: 13px; }
/* the tree: parent on top, a line down to each forked thread */
#conversations ul.kids { margin-left: 16px; }
#conversations li.child { position: relative; padding-left: 14px; }
#conversations li.child::before { content: ''; position: absolute; left: 0; top: 0; height: 19px; width: 11px; border-left: 2px solid #4b525d; border-bottom: 2px solid #4b525d; border-bottom-left-radius: 8px; }
#conversations li.child:not(:last-child)::after { content: ''; position: absolute; left: 0; top: 17px; bottom: 0; border-left: 2px solid #4b525d; }
#conversations li.child .row a { font-size: 14px; padding-top: 8px; padding-bottom: 8px; }
.tdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); }
.tdot.run { background: var(--accent); box-shadow: 0 0 0 3px #c8f07a33; animation: tpulse 1.4s ease-in-out infinite; }
.tdot.bad { background: var(--bad); }
.tdot.off { background: var(--faint); }
@keyframes tpulse { 50% { box-shadow: 0 0 0 5px #c8f07a11; } }
/* popup menu and dialogs */
.pop { position: fixed; z-index: 60; min-width: 200px; max-width: 280px; max-height: 70vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 36px #000b; padding: 6px; }
.pop button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--text); font: inherit; font-size: 14px; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.pop button svg { width: 17px; height: 17px; color: var(--muted); }
.pop button:hover { background: var(--panel-2); }
.pop button.danger, .pop button.danger svg { color: var(--bad); }
.pop-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.pop-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 6px 10px 2px; }
.dlg-scrim { position: fixed; inset: 0; z-index: 70; background: #000a; display: flex; align-items: center; justify-content: center; padding: 20px; }
.dlg { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 50px #000c; }
.dlg h3 { margin: 0; font-size: 17px; }
.dlg p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.dlg-input { font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; min-height: 44px; }
.dlg-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.dlg-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.cnum.ini { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); }
.dlg-ini { width: 7em; }
.dlg-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.dlg-kinds .chip { padding: 6px 11px; font-size: 13px; }
.dlg-kinds .chip.on { border-color: var(--accent); color: var(--accent); }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; }
.btn.danger { color: var(--bad); }
.btn.primary.danger { background: var(--bad); border-color: var(--bad); color: var(--bg); }
/* a thread's way up, and a parent's threads */
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; text-decoration: none; margin: 2px 0 10px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 999px; max-width: 100%; }
.crumb svg { width: 15px; height: 15px; }
.crumb b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.threads-card { display: flex; flex-direction: column; gap: 14px; }
.tc-job { border-radius: 12px; transition: background .4s; }
.tc-job.flash { background: #c8f07a14; }
.tc-job-head { display: flex; align-items: baseline; gap: 8px; }
.tc-job-q { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-line { display: flex; align-items: center; gap: 8px; width: 100%; margin: 8px 0 2px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.job-line .jl-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-line .jl-meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.job-line .jl-open { color: var(--accent); font-weight: 600; font-size: 13px; }
.tc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tc-sub { color: var(--muted); font-size: 13px; }
.tc-list { list-style: none; margin: 10px 0 0 4px; padding: 0; border-left: 2px solid #4b525d; }
.tc-list li { position: relative; padding: 8px 0 10px 16px; }
.tc-list li::before { content: ''; position: absolute; left: 0; top: 17px; width: 11px; border-top: 2px solid #4b525d; }
.tc-list li + li { border-top: 1px solid var(--line); }
.tc-row { display: flex; align-items: center; gap: 8px; }
.tc-title { flex: 1; min-width: 0; color: var(--text); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-text { color: var(--muted); font-size: 14px; margin: 4px 0 0 16px; line-height: 1.4; }
.tc-btns { display: flex; gap: 6px; margin: 8px 0 0 16px; }
.tc-btns .btn { text-decoration: none; color: var(--text); }
.tc-btns .btn.danger { color: var(--bad); }

/* the Workspace panel (task #511): next to the chat on wide screens, a full sheet on phones */
.ws-btn { color: var(--muted); border: 1px solid var(--line); background: var(--panel); }
.ws-btn.on { color: var(--accent); border-color: #3c4a2c; background: #222b1b; }
.ws-btn[hidden] { display: none; }
.ws-open-btn { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 8px; color: var(--text); }
.ws-open-btn svg { width: 16px; height: 16px; }
#workspace { flex: none; width: clamp(400px, 46vw, 860px); border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-width: 0; padding-right: var(--og-safe-right); }
#workspace[hidden] { display: none; }
.ws-head { display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--og-safe-top)) 10px 10px 14px; border-bottom: 1px solid var(--line); }
.ws-head > svg { color: var(--accent); }
/* task #539: the job picker shows jobs as the Tasks tray does (dot, question, kind + state tags) */
.chip-k { border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); white-space: nowrap; }
.chip-s { white-space: nowrap; }
.tc-job-head .chip-k { align-self: center; }
.ws-top { position: relative; }
.ws-cur { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px 6px 10px; cursor: pointer; text-align: left; }
.ws-cur > svg { width: 16px; height: 16px; flex: none; color: var(--muted); transition: transform .15s; }
#workspace.picking .ws-cur > svg { transform: rotate(180deg); }
.ws-jobs { display: none; flex-direction: column; gap: 4px; max-height: min(60vh, 460px); overflow-y: auto; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
#workspace.picking .ws-jobs { display: flex; }
.ws-job { padding: 2px 4px; }
.ws-job.on { background: var(--panel-2); }
.ws-pick { width: 100%; align-items: center; font: inherit; color: var(--text); background: none; border: 0; padding: 8px 4px; cursor: pointer; text-align: left; }
.ws-job .tc-list { margin: 0 0 6px 8px; }
.ws-job .tc-list li { padding: 6px 0 6px 16px; }
.ws-job .tc-list li::before { top: 14px; }
#ws-scrim { display: none; }
.ws-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ws-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; color: var(--muted); }
.ws-meta code { font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ws-dev { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.ws-dev svg { width: 15px; height: 15px; }
.ws-eng { font-size: 12px; font-weight: 600; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.ws-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.ws-acts .btn { font-size: 13px; padding: 5px 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.faint { color: var(--faint); }
.pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.pill.running, .pill.waiting { background: #222b1b; color: var(--accent); }
.pill.done { color: var(--ok); }
.pill.failed { color: var(--bad); }
.ws-tabs { display: flex; gap: 4px; padding: 6px 10px 0; border-bottom: 1px solid var(--line); }
.ws-tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; padding: 7px 10px; cursor: pointer; }
.ws-tab.on { color: var(--text); border-bottom-color: var(--accent); }
.ws-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ws-empty { color: var(--muted); font-size: 14px; padding: 18px 16px; line-height: 1.45; }
.ws-cont { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.ws-cont textarea, .ws-msg, .ws-url, .ws-type { font: inherit; font-size: 14px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; min-width: 0; }
/* console */
.ws-console { flex: 1; overflow: auto; padding: 8px 10px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.ws-console details { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 8px; background: var(--bg); }
.ws-console summary { cursor: pointer; padding: 6px 10px; display: flex; gap: 10px; align-items: center; font-family: system-ui, sans-serif; font-size: 13px; }
.ws-console summary .st { font-weight: 700; color: var(--text); }
.ws-console summary .res { margin-left: auto; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.ws-console .res.ok { color: var(--ok); }
.ws-console .res.bad { color: var(--bad); }
.ws-console pre { margin: 0; padding: 4px 10px 10px; white-space: pre-wrap; overflow-wrap: anywhere; color: #c9ccc4; }
.ws-console .cmd { color: var(--accent); font-weight: 600; }
.ws-console .exit.ok { color: var(--ok); }
.ws-console .exit.bad { color: var(--bad); }
.ws-console .note { color: var(--warn); }
.ws-console .browse { color: #8ab4f8; }
/* files */
.ws-files { flex-direction: row; }
.ws-tree { width: 34%; min-width: 170px; max-width: 280px; border-right: 1px solid var(--line); overflow: auto; font-size: 13px; padding: 6px 4px 16px; }
.ws-tree ul { list-style: none; margin: 0; padding: 0 0 0 10px; }
.ws-tree > ul { padding-left: 0; }
.ws-tree button { background: none; border: 0; color: var(--text); font: inherit; width: 100%; text-align: left; display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.ws-tree button:hover, .ws-tree li.on > button { background: var(--panel-2); }
.ws-tree .dir > button { color: var(--muted); }
.ws-tree .dir > button svg { width: 13px; height: 13px; transition: transform .12s; }
.ws-tree .dir.open > button svg { transform: rotate(90deg); }
.ws-tree .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-tree .badge { font-size: 10px; font-weight: 800; border-radius: 4px; padding: 0 4px; }
.badge.A { color: var(--ok); background: #1f2d22; }
.badge.M { color: var(--warn); background: #2e2a1d; }
.badge.D { color: var(--bad); background: #2e1f1d; }
.ws-only { display: flex; align-items: center; gap: 4px; color: var(--muted); padding: 2px 6px 6px; font-size: 12px; }
.ws-file { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ws-ftools { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.ws-ftools .path { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; direction: rtl; text-align: left; }
.ws-ftools .ws-tab { font-size: 13px; padding: 4px 8px; }
.ws-save { display: flex; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: #1b2018; }
.ws-save .ws-msg { flex: 1; font-size: 13px; padding: 5px 8px; }
.ws-code { flex: 1; overflow: auto; margin: 0; background: var(--bg); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; }
.ws-editor { display: flex; align-items: flex-start; }
.ws-gut { margin: 0; padding: 8px 8px 24px 10px; color: var(--faint); text-align: right; user-select: none; position: sticky; left: 0; background: var(--bg); border-right: 1px solid var(--line); font: inherit; line-height: inherit; min-height: 100%; }
.ws-stack { position: relative; flex: 1; min-width: 0; }
.ws-hl { margin: 0; padding: 8px 12px 24px; white-space: pre; font: inherit; line-height: inherit; color: #d6d9d0; tab-size: 4; }
.ws-ta { position: absolute; inset: 0 auto auto 0; margin: 0; padding: 8px 12px 24px; border: 0; outline: 0; resize: none; overflow: hidden; white-space: pre; font: inherit; line-height: inherit; background: transparent; color: transparent; caret-color: var(--accent); tab-size: 4; }
.ws-editor.editing { box-shadow: inset 0 0 0 1px #3c4a2c; }
.ws-ta::selection { background: #c8f07a40; color: transparent; }
.hl-k { color: #c792ea; } .hl-s { color: #c3e88d; } .hl-c { color: #6b7178; font-style: italic; } .hl-n { color: #f78c6c; } .hl-t { color: #ffcb6b; } .hl-f { color: #82aaff; }
.ws-diff { padding: 8px 12px 24px; white-space: pre; }
.ws-diff > span { display: block; min-width: max-content; }
.ws-diff .da { color: var(--ok); background: #1a2a1d; }
.ws-diff .dd { color: var(--bad); background: #2c1c1a; }
.ws-diff .dh { color: var(--muted); font-weight: 700; }
.ws-diff .dh2 { color: #8ab4f8; }
/* browser */
.ws-browser { padding: 10px; gap: 8px; overflow: auto; }
.ws-browser.busy .ws-screen { opacity: .7; }
.ws-urlbar, .ws-keys { display: flex; gap: 6px; align-items: center; }
.ws-urlbar .ws-url, .ws-keys .ws-type { flex: 1; }
.ws-screen { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); aspect-ratio: 1280 / 800; display: flex; align-items: center; justify-content: center; }
.ws-shot { width: 100%; height: 100%; object-fit: contain; display: block; cursor: crosshair; }
.ws-shot[hidden] { display: none; }
.ws-who { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-note { font-size: 12px; }
/* task #556: an app build's record */
.ws-tabs { overflow-x: auto; scrollbar-width: none; }
.ws-tab { white-space: nowrap; }
.ws-prog { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.ws-steps, .ws-runs, .ws-apps { flex: 1; overflow: auto; margin: 0; padding: 8px 10px 16px; list-style: none; }
.ws-step { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 6px; background: var(--bg); }
.ws-step-row { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--text); font: inherit; font-size: 14px; text-align: left; padding: 9px 12px; cursor: pointer; min-height: 44px; }
.ws-step-i { width: 18px; text-align: center; font-weight: 800; color: var(--muted); }
.ws-step.done .ws-step-i { color: var(--ok); }
.ws-step.running .ws-step-i { color: var(--accent); }
.ws-step.failed .ws-step-i { color: var(--bad); }
.ws-step.skipped .ws-step-t { color: var(--faint); text-decoration: line-through; }
.ws-step-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ws-step-d { font-size: 12px; white-space: nowrap; }
.ws-step-more { padding: 0 12px 12px 40px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; }
.ws-step-more p { margin: 0; overflow-wrap: anywhere; }
.ws-step-more a, .ws-app-url { overflow-wrap: anywhere; font-size: 12.5px; }
.ws-step-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ws-step-files li { display: flex; align-items: center; gap: 6px; }
.ws-step-files .badge { font-size: 10px; font-weight: 800; border-radius: 4px; padding: 0 4px; }
.ws-step-shot { width: 100%; max-width: 420px; border: 1px solid var(--line); border-radius: 8px; display: block; }
.ws-run-log { margin: 0; padding: 8px 10px; background: var(--panel-2); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #c9ccc4; max-height: 260px; overflow: auto; }
.ws-runs h4 { margin: 10px 2px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ws-run, .ws-app { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 8px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.ws-run.bad { border-color: #4a2a26; }
.ws-run-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.ws-run summary { cursor: pointer; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.ws-app .btn { align-self: flex-start; }
.ws-scope { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 6px 2px; font-size: 13px; }
.ws-scope dt { color: var(--muted); font-weight: 600; }
.ws-scope dd { margin: 0; overflow-wrap: anywhere; }
body.ws-open #composer .compose-box { max-width: 680px; }
@media (max-width: 899px) {
  /* task #539: a side panel that slides in under the top bar (the Workspace button stays in reach) */
  #workspace, #workspace[hidden] { display: flex; position: fixed; z-index: 45; top: var(--ws-top, 56px); bottom: 0; right: 0; width: min(92vw, 640px); border-left: 1px solid var(--line); border-top: 1px solid var(--line); padding-bottom: var(--og-safe-bottom); transform: translateX(100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; box-shadow: -8px 0 24px #0006; }
  body.ws-open #workspace { transform: none; visibility: visible; transition: transform .2s ease; }
  body.ws-drag #workspace { visibility: visible; }
  body.ws-open #ws-scrim, body.ws-drag #ws-scrim { display: block; position: fixed; z-index: 44; top: var(--ws-top, 56px); left: 0; right: 0; bottom: 0; background: #0009; transition: opacity .2s ease; }
  .ws-head { padding-top: 10px; }
  .ws-tree { width: 100%; max-width: none; border-right: 0; }
  .ws-file { display: none; }
  .ws-files.show-file .ws-tree { display: none; }
  .ws-files.show-file .ws-file { display: flex; }
  .ws-back { display: inline-flex; margin-left: -6px; }
  .ws-meta { flex-basis: 100%; }
  .ws-save { flex-wrap: wrap; }
  .ws-save .ws-msg { flex-basis: 100%; }
  .ws-save .btn { flex: 1; }
}
@media (min-width: 900px) { .ws-back { display: none; } }
/* task #518: the agent team (Settings, + menu) and the design in the Workspace */
.team-form { display: flex; flex-direction: column; gap: 10px; }
.team-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { font: inherit; font-size: 13px; font-weight: 600; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.chip-btn.on { border-color: var(--accent); color: var(--accent); }
.team-grid select { min-width: 0; width: 100%; }
.msec .team-form { padding: 4px 8px 8px; }
.msec .team-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: 13.5px; }
.msec .team-grid .switch input { accent-color: var(--accent); width: 18px; height: 18px; }
.ws-design { overflow: auto; }
.ws-agents { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ws-agent { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text); text-decoration: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 4px 8px; max-width: 100%; }
.ws-agent:hover { border-color: var(--accent); }
.ws-agent code { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-design-bar { display: flex; gap: 8px; justify-content: flex-end; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.ws-doc { padding: 4px 16px 20px; overflow: auto; font-size: 14px; }
.ws-design-edit { flex: 1; margin: 10px 14px; font: 13px/1.45 ui-monospace, monospace; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px; resize: none; min-height: 300px; }

/* task #527: Admin mode */
.admin-banner { display: flex; align-items: center; gap: 8px; padding: 6px 14px; background: #3a1d1a; border-bottom: 1px solid #6b2f27; color: #ffd9d2; font-size: 13px; }
.admin-banner svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.admin-banner .left { opacity: .85; }
.admin-banner .spacer { flex: 1; }
.admin-banner .pill.wait { background: #f0c66b; color: #1b1b1b; }
body.admin-on #top { box-shadow: inset 0 -2px 0 #c0473a; }
.pill.admin { background: #c0473a; color: #fff; }
.admin-hosts { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; font-size: 13px; }
.admin-host { display: inline-flex; align-items: center; gap: 6px; }
.admin-unlock { flex-wrap: wrap; gap: 8px; }
.admin-unlock input { flex: 1 1 160px; min-width: 0; }
.admin-card .kind svg { stroke: currentColor; fill: none; stroke-width: 2; }
.admin-card.pending { border-color: #c0473a; box-shadow: 0 0 0 1px #c0473a55; }
.admin-card.never { border-color: #6b2f27; opacity: .9; }
.admin-cmd { background: #0f1115; border-radius: 8px; padding: 8px 10px; margin: 6px 0; white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.admin-why { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.admin-why .pill { background: #3a1d1a; color: #ffd9d2; }
.admin-why .pill.warn { background: #f0c66b; color: #1b1b1b; }
.admin-preview, .admin-out { background: #0f1115; border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; word-break: break-word; font-size: 12px; max-height: 320px; overflow: auto; margin: 6px 0; }
.admin-preview .add { color: #9fe39f; }
.admin-preview .del { color: #f6a69a; }
.admin-why .pill { text-transform: none; letter-spacing: 0; font-weight: 600; }
.admin-banner[hidden] { display: none; }

/* the chat list scrolls on its own; nav, Settings and sign-in stay in place */
#drawer { overflow: hidden; }
#drawer > * { flex: none; }
#drawer > #conversations { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px; }
.ctx-ring .ctx-model { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.ctx-ring .ctx-model + span { padding-left: 6px; border-left: 1px solid var(--line); }
@media (max-width: 480px) { .ctx-ring .ctx-model { max-width: 12ch; } .ctx-ring .ctx-model + span { display: none; } }
/* task #537: the context ring's stats panel */
.ctx-pop { min-width: 220px; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.ctx-pop .cp-row { display: flex; justify-content: space-between; gap: 14px; }
.ctx-pop .cp-k { color: var(--faint); }
.ctx-pop .cp-v { color: var(--text); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.ctx-pop .cp-bar { position: relative; height: 18px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.ctx-pop .cp-bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); opacity: .55; border-radius: 999px; }
.ctx-pop .cp-bar.warn i { background: var(--warn); } .ctx-pop .cp-bar.bad i { background: var(--bad); }
.ctx-pop .cp-bar span { position: relative; display: block; text-align: center; line-height: 18px; font-size: 11px; font-weight: 700; color: var(--text); }
.ctx-ring[aria-expanded="true"] { border-color: var(--muted); }
/* task #537/#541, owner ask 2026-11-13: only the desktop collapse button on the top row; the profile and the chat
   controls (sort, new folder, archived, +) in the bottom bar. Collapsed, the sidebar is a rail: the expand button
   stays in the same top-left spot; +, new folder, archived and the profile at the bottom */
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 6px; }
.mini-btn { color: var(--muted); padding: 8px; }
.mini-btn svg { width: 20px; height: 20px; }
.mini-btn .mini-arrow { transition: transform .15s; transform-origin: 14px 12px; }
.drawer-foot .icon-btn.small { padding: 8px; }
.drawer-foot .icon-btn.small svg { width: 20px; height: 20px; }
.drawer-foot { gap: 4px; padding: 10px 2px 2px; }
.drawer-foot .new-circle { margin-left: 4px; }
.list-head { padding: 4px 0 2px; }
#drawer { transition: width .18s ease, padding .18s ease; }
@media (max-width: 820px) { .only-desk { display: none !important; } .drawer-head { display: none; } }
@media (min-width: 821px) {
  body.drawer-mini #drawer { width: 64px; padding-left: calc(8px + var(--og-safe-left)); padding-right: 8px; align-items: center; gap: 8px; }
  body.drawer-mini .drawer-foot { display: contents; }
  body.drawer-mini .drawer-head { flex-direction: column; padding: 0 0 6px; }
  body.drawer-mini .mini-btn .mini-arrow { transform: scaleX(-1); }
  body.drawer-mini .nav { align-self: stretch; margin: 0; }
  body.drawer-mini .nav a { justify-content: center; padding: 10px 0; }
  body.drawer-mini .nav-text, body.drawer-mini #sort-btn, body.drawer-mini .list-head, body.drawer-mini .drawer-foot .spacer, body.drawer-mini #conversations { display: none; }
  body.drawer-mini .new-circle { order: 5; margin: auto 0 0; }
  body.drawer-mini #new-folder-btn { order: 6; }
  body.drawer-mini #archived-btn { order: 7; }
  body.drawer-mini #avatar-btn { order: 8; }
  /* task #543: the chats as small tiles on the rail, with a dot for what each waits on */
  body.drawer-mini #drawer { overflow: hidden; }
  body.drawer-mini #mini-chats { display: flex; }
}
#mini-chats { display: none; flex-direction: column; align-items: center; gap: 6px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  list-style: none; margin: 4px -8px 0; padding: 2px 8px; align-self: stretch; scrollbar-width: none; }
#mini-chats::-webkit-scrollbar { display: none; }
.mini-chat { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .02em; text-decoration: none; background: none; }
.mini-chat:hover { background: var(--panel-2); color: var(--text); }
.mini-chat.on { background: var(--panel-2); color: var(--text); border-color: var(--muted); }
.mini-chat .mini-num { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.mini-chat .mini-num.long { font-size: 11px; }
.mini-chat .attn { position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--panel); }
#mini-chats .mini-sep { width: 24px; flex: none; border-top: 1px solid var(--line); margin: 2px 0; }
.attn.approval { background: var(--bad); }
.attn.decision { background: var(--warn); }
.attn.new { background: var(--ok); }
#sort-btn.on { color: var(--accent); }
#sort-menu button[aria-checked="true"] { color: var(--accent); font-weight: 600; }
#sort-menu button[aria-checked="true"]::after { content: ""; width: 6px; height: 11px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin: -3px 4px 0 auto; }

/* task #547: a tighter top bar on the phone. The bar is as tall as one 44px tap target (no padding
   above or below beyond the status bar inset); the model pill and Tasks pill are slimmer but keep a
   44px tall tap area through ::after; less space down to the first message. */
@media (max-width: 820px) {
  #top { gap: 6px; min-height: 44px; padding: var(--og-safe-top) calc(10px + var(--og-safe-right)) 0 calc(4px + var(--og-safe-left)); }
  #top .icon-btn { padding: 12px; }
  #title { line-height: 1.25; }
  #top .ctx-ring, #top .tasks-btn { position: relative; }
  #top .ctx-ring { padding: 2px 8px 2px 3px; gap: 5px; }
  #top .ctx-ring svg { width: 20px; height: 20px; }
  #top .tasks-btn { padding-top: 2px; padding-bottom: 2px; }
  #top .ctx-ring::after, #top .tasks-btn::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
  #view { padding-top: 4px; }
  #view > :first-child > .q:first-child, #view > .q:first-child { margin-top: 8px; }
}

/* task #560 (B7): the live build card in the chat */
.build-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 10px 12px; margin: 6px 0 10px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.build-card.waiting { border-color: #4f4320; }
.build-card.failed { border-color: #573029; }
.bc-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-round, .bc-prog { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bc-scope { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); }
.bc-sum { margin-bottom: 2px; }
.bc-row { display: grid; grid-template-columns: 78px 1fr; gap: 8px; font-size: 13px; }
.bc-k { color: var(--muted); }
.bc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.bc-s { display: flex; gap: 8px; align-items: baseline; color: var(--muted); font-size: 13px; min-width: 0; }
.bc-s .bc-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-s .bc-m { width: 12px; flex: none; text-align: center; }
.bc-s.done .bc-m { color: var(--ok); }
.bc-s.failed .bc-m { color: var(--bad); }
.bc-s.running { color: var(--text); }
.bc-s.running .bc-m { color: var(--accent); animation: tpulse 1.4s ease-in-out infinite; }
.bc-s.skipped { opacity: .55; }
.build-card .act { display: flex; gap: 8px; flex-wrap: wrap; }
.bc-open { align-self: flex-start; text-decoration: none; }

/* task #563: a file pack in the Workspace */
.ws-pack { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.ws-pack .ws-run-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ws-pack .ws-run-h svg { width: 18px; height: 18px; flex: none; }
.ws-pack .ws-run-h b { overflow-wrap: anywhere; }
.ws-pack-acts { display: flex; gap: 8px; }
.ws-pack-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ws-pack-files li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 8px; border-radius: 6px; background: var(--panel-2); }
.ws-pack-files code { overflow-wrap: anywhere; }
.ws-pack-files .faint { flex: none; }
