/* PixelStaff — Grok Bot look-alike */
* { box-sizing: border-box; }
/* Silkscreen (SIL OFL 1.1, fonts/OFL.txt): the PixelStaff wordmark + the optional Pixel face */
@font-face { font-family:"Silkscreen"; src:url("/static/fonts/silkscreen-400.woff2") format("woff2");
  font-weight:400; font-style:normal; font-display:swap; }
:root, :root[data-theme="dark"] {
  --bg:#0d0d0f; --sidebar:#121214; --panel:#161619; --bubble:#1c1c20; --bubble2:#232329;
  --line:#26262c; --text:#ececf1; --muted:#96969f; --faint:#83838d;   /* muted ≥4.5:1 on --me too (r11220804 B5a) */
  --green:#5cd08a; --green2:#3bb673; --blue:#3b82f6; --accent:#5cd08a; --accent2:#3b82f6;
  --warn:#ffb648; --onwarn:#1a1206; --err:#ff6b6b; --ok:#5cd08a;
  --av1:#5cd08a; --av2:#2f9e63;
  /* surfaces (promoted from hardcoded hexes so themes can flip) */
  --input:#15151a; --hover:#1a1a1e; --sel:#202026; --div:#1e1e23; --elev:#1b1b20;
  --card2:#16161a; --deep:#101014; --iconbtn:#2a2a31; --send:#2e2e36;
  --scroll:#2b2b33; --scroll2:#3a3a44; --swoff:#68686d; --bd-ctl:#68686d;   /* form-control borders: ≥3:1 (--line stays for dividers) */
  --me:#2b2b31; --redbg:#3a2020; --warnbd:#4a3a1c; --ongreen:#07130c; --okbg:#13261c;
  --shadow:rgba(0,0,0,.4); --overlay:rgba(0,0,0,.6); --eye:#10261a;
}
:root[data-theme="light"] {
  --bg:#ffffff; --sidebar:#f4f4f6; --panel:#ffffff; --bubble:#f0f0f3; --bubble2:#e3e3e9;
  --line:#e3e3e8; --text:#1a1a1f; --muted:#62626c; --faint:#6e6e78;   /* muted ≥4.5:1 on --sel/--bubble2 too */
  --green:#12703f; --green2:#0e5c33; --blue:#2563eb; --accent:#12703f; --accent2:#2563eb;
  --warn:#8f5a00; --onwarn:#ffffff; --err:#b43a3a; --ok:#12703f;   /* ≥4.5:1 on every light surface */
  --av1:#5cd08a; --av2:#2f9e63;
  --input:#f1f1f4; --hover:#ececef; --sel:#e4e4ea; --div:#ececef; --elev:#ffffff;
  --card2:#fafafb; --deep:#f4f4f6; --iconbtn:#e6e6eb; --send:#e0e0e6;
  --scroll:#cfcfd6; --scroll2:#b4b4bd; --swoff:#89898f; --bd-ctl:#89898f;
  --me:#e7e7ec; --redbg:#fbe3e3; --warnbd:#e8d3a8; --ongreen:#ffffff; --okbg:#d9f0e3;
  --shadow:rgba(17,24,39,.13); --overlay:rgba(17,24,39,.32); --eye:#ffffff;
}
html,body { margin:0; height:100%; }
body { height:100vh; height:100dvh; height:var(--app-h, 100dvh); display:flex; flex-direction:column; background:var(--bg);
  color:var(--text); font:calc(14px * var(--ui-fs, 1))/1.55 var(--ui-font, -apple-system,"SF Pro Text",Segoe UI,Roboto,sans-serif); overflow:hidden; }
button { font:inherit; cursor:pointer; border:none; background:none; color:inherit; }
.hidden { display:none !important; }
html { scroll-behavior:smooth; }
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--scroll); border-radius:4px; border:2px solid transparent; background-clip:content-box; }
::-webkit-scrollbar-thumb:hover { background:var(--scroll2); background-clip:content-box; }
* { scrollbar-width:thin; scrollbar-color:var(--scroll) transparent; }

/* smooth interactions everywhere */
.row-agent, .fbtn, .dt-tabs button, .gtabs button, .sw, .chip, .btn,
.filerow, .connect, .icon, .composer .ic, .opt, .agent, button, select, input, textarea,
.av, .tab, .modal-box, #sidebar, main { transition: background .15s ease, color .15s ease,
  border-color .15s ease, transform .15s ease, opacity .15s ease, box-shadow .15s ease; }
main { transition: grid-template-columns .22s cubic-bezier(.4,0,.2,1); }

/* interactive avatars (blink on inner eyes; outer .eyes tracks the mouse via JS) */
.av .eyes-inner { transform-box:fill-box; transform-origin:center; }
.av .eye { fill:var(--eye); }
/* only the selected agent's avatar blinks; cadence randomized per-avatar via inline style */
.row-agent.sel .av .eyes-inner, .pin-cell.sel .av .eyes-inner,
.chat-head .av .eyes-inner, .dt-head .av .eyes-inner {
  animation-name:blink; animation-iteration-count:infinite; animation-timing-function:ease; }
@keyframes blink { 0%,92%,100%{ transform:scaleY(1); } 96%{ transform:scaleY(.08); } }
.av .eyes { transition: transform .08s ease-out; }
.row-agent:hover .av, .chat-head:hover .av { transform:scale(1.1) rotate(-3deg); }
.dt-head .av:hover { transform:scale(1.04) rotate(3deg); }

main { flex:1; display:grid; grid-template-columns:var(--sb-w,320px) 1fr var(--dt-w,360px); min-height:0; }
/* programmatic focus target (_ofcFocusBack): no ring on <main> itself; every control keeps its own focus ring */
main[tabindex="-1"]:focus { outline:none; }
main.sb-collapsed { grid-template-columns:68px 1fr var(--dt-w,360px); }
main.dt-wide { grid-template-columns:var(--sb-w,320px) 1fr var(--dt-w2,620px); }
/* Rail-collapse is a DESKTOP concept only — on mobile the right panel is a
   slide-over drawer (main.dt-open, below), so dt-rail must not hide its content
   there. Scope all dt-rail content rules to desktop width. */
@media (min-width:821px) and (min-height:501px), (min-width:821px) and (pointer:fine){
  /* The rail must win over every other right-panel width: a collapsed left sidebar
     (main.sb-collapsed, 360px / a dragged --dt-w) used to keep the full width, so the
     icons floated in empty space. Higher specificity, so rule order can't undo it. */
  main.dt-rail, main.dt-rail.dt-wide { grid-template-columns:var(--sb-w,320px) minmax(0,1fr) 56px; }
  main.dt-rail.sb-collapsed { grid-template-columns:68px minmax(0,1fr) 56px; }
  main.dt-rail #detail { overflow:hidden; }
  /* collapsed right panel → narrow icon rail (toggle + avatar stay visible to reopen) */
  main.dt-rail #detail .dt-head .nmrow, main.dt-rail #detail .dt-head .sub,
  main.dt-rail #detail .dt-tabs, main.dt-rail #detail .dt-body, main.dt-rail #detail .resizer { display:none; }
  main.dt-rail #detail .dt-top { justify-content:center; }
  main.dt-rail #detail .dt-head { padding:6px 0; }
  main.dt-rail #detail .dt-head .av { width:36px; height:36px; cursor:pointer; }
  /* Dress up: icon-only like the other rail items (its label wrapped and overflowed); tooltip via data-tip */
  main.dt-rail #detail .dt-head .wd-open { width:40px; height:40px; padding:0; margin-top:6px; justify-content:center; gap:0; background:transparent; border-color:transparent; color:var(--muted); }
  main.dt-rail #detail .dt-head .wd-open:hover { background:var(--hover); color:var(--text); }
  main.dt-rail #detail .dt-head .wd-open span { display:none; }
  main.dt-rail #detail .dt-head .wd-open svg { width:20px; height:20px; }
  main.dt-rail #detail .dt-rail-nav { display:flex; flex-direction:column; align-items:center; gap:7px; margin-top:12px; }
}
.dt-rail-nav { display:none; }
.dt-rail-nav button { width:40px; height:40px; border-radius:4px; color:var(--muted); display:flex; align-items:center; justify-content:center; }
.dt-rail-nav button:hover { background:var(--hover); color:var(--text); }
#sidebar, #detail { position:relative; }
.resizer { position:absolute; top:0; height:100%; width:7px; cursor:col-resize; z-index:30; }
.resizer:hover, .resizer.active { background:rgba(90,156,255,.25); }
#rz-left { right:-3px; } #rz-right { left:-3px; }

/* pinned pin-grid (drag agents here, 3×2, up to 6) */
.pin-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; padding:6px 2px 12px; border-bottom:1px solid var(--line); margin-bottom:8px; }
.pin-grid.drag-over { outline:1px dashed var(--accent2); outline-offset:3px; border-radius:4px; }
.pin-cell { position:relative; display:flex; flex-direction:column; align-items:center; gap:4px; padding:8px 3px; border-radius:4px; cursor:pointer; }
.pin-cell:hover { background:var(--hover); }
.pin-cell .av { width:44px; height:44px; }
.pin-grid[data-count="1"] { grid-template-columns:1fr !important; justify-items:center; padding:14px 0 16px; }
.pin-grid[data-count="1"] .av { width:76px; height:76px; }
.pin-grid[data-count="1"] .pin-nm { font-size:calc(13px * var(--ui-fs, 1)); color:var(--text); font-weight:600; }
.pin-grid[data-count="2"] .av, .pin-grid[data-count="3"] .av { width:54px; height:54px; }
/* HR: a smaller seat under the Chief of Staff, same hero (owner, Nov 19) */
.pin-grid .pin-cell.pin-hr { grid-column:1/-1; justify-self:center; flex-direction:row; gap:6px; padding:4px 8px; margin-top:2px; }
.pin-grid .pin-cell.pin-hr .av { width:42px; height:42px; }
.pin-grid .pin-cell.pin-hr .pin-nm { font-size:calc(10px * var(--ui-fs, 1)); color:var(--muted); font-weight:400; }
/* only the Chief of Staff pinned: CoS and HR share one row, 50/50, same seat (owner, Nov 21) */
.pin-grid[data-duo="1"] { grid-template-columns:repeat(2, minmax(0, 1fr)) !important; justify-items:stretch; }
.pin-grid[data-duo="1"] .pin-cell { min-width:0; }
.pin-grid[data-duo="1"] .pin-cell.pin-hr { grid-column:auto; justify-self:stretch; flex-direction:column; gap:4px; padding:8px 3px; margin-top:0; }
.pin-grid[data-duo="1"] .av, .pin-grid[data-duo="1"] .pin-cell.pin-hr .av { width:64px; height:64px; }
.pin-grid[data-duo="1"] .pin-nm, .pin-grid[data-duo="1"] .pin-cell.pin-hr .pin-nm { font-size:calc(12px * var(--ui-fs, 1)); color:var(--text); font-weight:600; }
.pin-grid[data-duo="1"] .pin-cell.pin-hr .dot { position:absolute; top:6px; right:6px; }
.pin-cell.pin-hr .dot { display:none; width:8px; height:8px; border-radius:2px; background:var(--blue); flex:none; }
.pin-cell.pin-hr.unread .dot { display:block; }
.pin-hint { grid-column:1/-1; text-align:center; font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); border:1px dashed var(--line); border-radius:4px; padding:14px; }
.pin-cell .pin-nm { font-size:calc(10px * var(--ui-fs, 1)); color:var(--muted); max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pin-cell.empty { border:1px dashed var(--line); color:var(--muted); align-items:center; justify-content:center; font-size:calc(18px * var(--ui-fs, 1)); min-height:66px; }
.pin-cell.empty:hover { border-color:var(--accent2); color:var(--accent2); }
.pin-cell .pin-x { position:absolute; top:1px; right:3px; opacity:0; background:none; border:none; color:var(--err); font-size:calc(11px * var(--ui-fs, 1)); cursor:pointer; }
.pin-cell:hover .pin-x { opacity:1; }
.pin-cell .star { position:absolute; top:4px; right:50%; margin-right:-22px; width:15px; height:15px; font-size:calc(8px * var(--ui-fs, 1)); }
.row-agent[draggable="true"] { cursor:grab; } .row-agent.dragging { opacity:.4; }

/* rendered markdown spacing — tight, consistent block margins (override browser defaults) */
.msg-body > :first-child { margin-top:0; }
.msg-body > :last-child { margin-bottom:0; }
.msg-body div { margin:2px 0; }
.msg-body .mdgap { height:8px; margin:0; }
/* big section header — a clear line-break of space above each header, tight below.
   The FIRST element in a bubble (header or not) stays flush (margin-top:0 below). */
.msg-body h3, .msg-body h4, .msg-body h5, .msg-body h6 { margin:24px 0 5px; font-weight:700; line-height:1.25; }
.msg-body h3 { font-size:1.32em; } .msg-body h4 { font-size:1.2em; } .msg-body h5 { font-size:1.1em; } .msg-body h6 { font-size:1.02em; }
.msg-body > :first-child { margin-top:0; }
.msg-body ul, .msg-body ol { margin:4px 0; padding-left:20px; }
.msg-body li { margin:2px 0; }
.msg-body li > ul, .msg-body li > ol { margin:2px 0 4px; }
.msg-body hr { margin:12px 0; border:0; border-top:1px solid var(--line); }
.msg-body .md-tbl { border-collapse:collapse; margin:8px 0; font-size:calc(12.5px * var(--ui-fs, 1)); width:auto; max-width:100%; display:block; overflow-x:auto; }
.msg-body .md-tbl th, .msg-body .md-tbl td { border:1px solid var(--line); padding:5px 10px; text-align:left; vertical-align:top;
  overflow-wrap:normal; word-break:normal; min-width:4.5em; max-width:22em; }
.msg-body .md-tbl th { white-space:nowrap; }
.msg-body .md-tbl th { background:var(--bubble2); font-weight:700; }

/* message hover tools: react · reply · more */
.msg { position:relative; min-width:0; max-width:100%; }
/* Long unbroken text (URLs, ids, hashes) must wrap inside the bubble, never run past it. */
.msg-body { overflow-wrap:anywhere; word-break:break-word; min-width:0; }
.msg-body a { overflow-wrap:anywhere; word-break:break-all; }
.msg-body pre { max-width:100%; overflow-x:auto; white-space:pre; }
.msg-body pre code { white-space:pre; }
.msg-body code { overflow-wrap:anywhere; word-break:break-word; }
.msg-body img { max-width:100%; height:auto; }
.msg-actions { display:flex; gap:2px; margin-top:6px; margin-left:-6px; }
.msg-actions .ma { width:24px; height:22px; border-radius:4px; color:var(--muted); display:flex; align-items:center; justify-content:center; }
.msg-actions .ma svg { width:15px; height:15px; }   /* ~25% smaller than the 20px icon set (owner, Oct 28) */
.msg-actions .ma:hover, .msg-actions .ma:focus-visible { background:var(--hover); color:var(--text); }
.msg-actions .ma.ma-ok { color:var(--green); }
/* date + time beside the action icons (owner, Oct 30) */
.msg-stamp { font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); white-space:nowrap; }
.msg-actions .msg-stamp { align-self:center; margin-left:6px; }
.card > .msg-stamp { display:block; margin-top:6px; }
.th-note > .msg-stamp, .delegate-pill > .msg-stamp { margin-left:6px; opacity:.85; }
.evt-line > .msg-stamp { font-size:inherit; }
.toast { pointer-events:none; position:fixed; bottom:96px; left:50%; transform:translateX(-50%); z-index:600; padding:9px 16px; border-radius:4px;
  background:var(--bubble); border:1px solid var(--line); color:var(--text); font-size:calc(13px * var(--ui-fs, 1)); box-shadow:0 6px 24px rgba(0,0,0,.35); }
.toast.toast-up { bottom:auto; top:calc(12px + env(safe-area-inset-top)); }
.toast.has-act { pointer-events:auto; display:flex; align-items:center; gap:12px; }
.toast-act { background:none; border:0; padding:0; color:var(--accent); font:inherit; font-weight:600; cursor:pointer; }
.msg-pop { position:fixed; z-index:450; background:var(--elev); border:1px solid var(--line); border-radius:4px; padding:4px; box-shadow:0 8px 22px var(--shadow); display:flex; gap:2px; flex-direction:column; }
.msg-pop .mm { display:block; width:100%; text-align:left; padding:8px 14px; border-radius:4px; font-size:calc(13px * var(--ui-fs, 1)); white-space:nowrap; } .msg-pop .mm:hover { background:var(--hover); }
.msg.flash, .oi-card.oi-sel { outline:2px solid var(--accent2); outline-offset:2px; border-radius:4px; }   /* inbox: the selected card */
.oi-card { cursor:default; } .oi-card:focus-visible { outline:2px solid var(--accent2); outline-offset:2px; }
.oi-link-chip { display:none; margin-left:auto; align-self:center; max-width:60%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:2px 8px; border:1px solid var(--line); border-radius:4px; background:none; color:var(--muted); font:calc(11.5px * var(--ui-fs, 1)) ui-monospace, monospace; cursor:pointer; }
.oi-card.oi-sel .oi-link-chip { display:inline-block; }
.oi-link-chip:hover, .oi-link-chip:focus-visible { color:var(--text); background:var(--hover); }
@media (hover:none) { .oi-link-chip { min-height:32px; } }
/* deep links (Nov 10): the message / card a link opened, lit for a moment; the small "Copy link" icon */
.dl-hl { outline:2px solid var(--accent2); outline-offset:3px; border-radius:4px; animation:dlHl 2.5s ease-out; }
@keyframes dlHl { 0%,40% { background:color-mix(in srgb, var(--accent2) 16%, transparent); } 100% { background:transparent; } }
.dl-copy { display:inline-flex; align-items:center; justify-content:center; width:24px; height:22px; margin-left:4px; padding:0; vertical-align:middle;
  background:none; border:0; border-radius:4px; color:var(--muted); cursor:pointer; flex:none; }
.dl-copy svg { width:14px; height:14px; } .dl-copy:hover { color:var(--fg, inherit); background:var(--hover); }
@media (hover:none) { .dl-copy { width:36px; height:32px; } }   /* phones: the tap target stays big */
.msg-foot { display:flex; align-items:center; gap:6px; margin-top:8px; padding-top:7px; border-top:1px solid var(--div); font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); }
.msg-foot .av { width:17px; height:17px; }
/* model-used footer under each reply — lighter than the a2a footer */
.msg-foot.msg-model { margin-top:6px; padding-top:4px; border-top-color:transparent; opacity:.9; }
.reply-bar { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:7px 12px; margin-bottom:6px; background:var(--bubble); border:1px solid var(--line); border-left:3px solid var(--accent2); border-radius:4px; }
.reply-bar .rb-q { font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.reply-bar .rb-x { color:var(--muted); } .reply-bar .rb-x:hover { color:var(--err); }

/* chat file attachment cards */
.attach-bar { display:flex; flex-wrap:wrap; gap:8px; padding:8px 4px 2px; }
.filecard { display:inline-flex; align-items:center; gap:10px; background:var(--bubble); border:1px solid var(--line); border-radius:4px; padding:8px 12px; max-width:320px; }
.filecard .fc-ic { color:var(--muted); display:flex; }
.filecard .fc-thumb { width:34px; height:34px; border-radius:3px; object-fit:cover; }
.filecard .fc-meta { min-width:0; }
.filecard .fc-name { font-size:calc(13px * var(--ui-fs, 1)); font-weight:560; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.filecard .fc-sz { font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); }
.filecard .fc-dl { color:var(--muted); display:flex; } .filecard .fc-dl:hover { color:var(--text); }
.filecard .fc-x { background:none; border:none; color:var(--muted); cursor:pointer; font-size:calc(12px * var(--ui-fs, 1)); } .filecard .fc-x:hover { color:var(--err); }
.msg-files { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.msg.me .filecard { background:var(--me); }
.msg-img { display:block; line-height:0; border-radius:4px; overflow:hidden; border:1px solid var(--line); cursor:zoom-in; }
.msg-img img { display:block; max-width:min(320px, 100%); max-height:260px; object-fit:contain; }
.img-view { position:fixed; inset:0; z-index:10000; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(0,0,0,.85); cursor:zoom-out; }
.img-view img { max-width:100%; max-height:100%; border-radius:4px; }
.msg.bot.ack { opacity:.72; font-size:calc(13px * var(--chat-fs, 1) * var(--ui-fs, 1)); padding:9px 14px; } .msg.bot.ack .meta { opacity:.8; }
/* live-streaming bubble: blinking caret after the last token */
.msg.bot.streaming .msg-body::after { content:"▌"; display:inline-block; margin-left:1px; animation:caret 1s steps(1) infinite; opacity:.7; }
@keyframes caret { 50% { opacity:0; } }

/* detail head subname + pencil */
.dt-head .sub { font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--muted); }
.dt-head .pencil { background:none; border:none; color:var(--muted); cursor:pointer; font-size:calc(13px * var(--ui-fs, 1)); }
.dt-head .pencil:hover { color:var(--text); }
.dt-head .nmrow { display:flex; align-items:center; gap:7px; }
.dt-head input.ed { background:var(--input); border:1px solid var(--bd-ctl); color:var(--text); border-radius:4px; padding:6px 9px; font:inherit; text-align:center; }

/* ---------- Sidebar ---------- */
#sidebar { background:var(--sidebar); border-right:1px solid var(--line); display:flex; flex-direction:column; min-height:0; }
.sb-top { display:flex; align-items:center; flex-wrap:wrap; gap:8px clamp(6px,1.2vw,14px); padding:14px 16px 8px; color:var(--muted); min-width:0; }
.sb-top > * { flex:none; }   /* never squash an icon; wrap to a 2nd row on a narrow sidebar instead of clipping */
.sb-top .icon { font-size:calc(17px * var(--ui-fs, 1)); opacity:.8; } .sb-top .icon:hover { opacity:1; color:var(--text); }
.sb-top .sp { flex:1; }
.sb-list { flex:1; display:flex; flex-direction:column; min-height:0; overflow:hidden; padding:6px 10px 10px; }
#rows { flex:1; min-height:0; overflow-y:auto; }
/* the Library's sidebar search bar (frontend/dash.js, app.js findBarHtml), here so the agents list can use it */
.ds-find { position:relative; flex:none; margin:2px 0 4px; }
.ds-find svg { position:absolute; left:9px; top:50%; transform:translateY(-50%); width:14px; height:14px; color:var(--muted); pointer-events:none; }
.ds-find input { width:100%; box-sizing:border-box; min-height:34px; padding:6px 10px 6px 30px; border:1px solid var(--bd-ctl); border-radius:4px;
  background:var(--input); color:var(--text); font:inherit; font-size:calc(13px * var(--ui-fs, 1)); outline:none; }
.ds-find input:focus { border-color:var(--accent2); }
@media (max-width:820px), (pointer:coarse){ .ds-find input { min-height:42px; font-size:calc(16px * var(--ui-fs, 1)); } }
/* agents sidebar: that search bar + a filter button to its right (owner, Nov 21) */
.ag-find { display:flex; align-items:center; gap:4px; flex:none; margin:4px 0 2px; }
.ag-find .ds-find { flex:1; min-width:0; margin:0; }
.ag-filter { position:relative; flex:none; }
.ag-filter.on { color:var(--accent2); }
.ag-fbadge { position:absolute; top:2px; right:2px; min-width:14px; height:14px; padding:0 3px; border-radius:7px; box-sizing:border-box;
  background:var(--accent2); color:#fff; font-size:calc(9px * var(--ui-fs, 1)); line-height:14px; text-align:center; }
.ag-fmenu { max-height:min(420px, 70vh); overflow-y:auto; }
.ag-fi { display:flex; align-items:center; gap:8px; padding:7px 11px; border-radius:4px; cursor:pointer;
  font-size:calc(13px * var(--ui-fs, 1)); color:var(--text); white-space:nowrap; }
.ag-fi:hover, .ag-fi:focus-within { background:var(--hover); }
.ag-fi input { margin:0; accent-color:var(--accent2); }
.rows-empty #ag-reset { margin:8px auto 0; display:block; }
/* the top row's global search (owner, Nov 9): a search icon the size of the Library's, pushed right
   with the inbox and office beside it; it opens the search modal (80vw x 80vh) */
.sb-top > .sb-gsearch { margin-left:auto; width:32px; height:32px; border-radius:4px; display:flex; align-items:center; justify-content:center; }
.sb-top > .sb-gsearch:hover { background:var(--hover); }
#sidebar.collapsed .sb-top > .sb-gsearch { margin-left:0; }
@media (max-width:820px), (pointer:coarse){ .sb-top > .sb-gsearch { width:40px; height:40px; } }
.sr-row.sr-ask .sr-ic { color:var(--accent2); }
/* Library header (owner, Nov 9): title, then a search icon and a + of the same size side by side;
   the search bar, inbox and office stay on the Agents screen */
.sb-top > .lib-only { display:none; }
#sidebar.lib-mode .sb-top > .lib-only { display:flex; align-items:center; justify-content:center; }
#sidebar.lib-mode .sb-top > .sb-gsearch, #sidebar.lib-mode .sb-top > #needs-you-btn, #sidebar.lib-mode .sb-top > #office-btn { display:none; }
#sidebar.lib-mode .sb-top > .sb-lib-h { flex:1 1 auto; justify-content:flex-start; min-width:0; font-size:calc(14px * var(--ui-fs, 1)); font-weight:600; color:var(--text); }
#sidebar.lib-mode .sb-top > #lib-search, #sidebar.lib-mode .sb-top > #lib-new { width:32px; height:32px; border-radius:4px; }
#sidebar.lib-mode .sb-top > #lib-search:hover, #sidebar.lib-mode .sb-top > #lib-new:hover { background:var(--hover); }
#sidebar.collapsed.lib-mode .sb-top > .sb-lib-h { display:none; }
/* ---------- Pages: Settings and Jobs (owner, Nov 10; app.js pageOpen) ----------
   The sidebar shows the page's sections in place of the agent list; the page takes the chat's
   column and the detail panel's. Header: the page's name (+ Settings' pause icon). */
#sidebar:not(.pg-mode) .sb-top > .pg-only { display:none; }
#sidebar.pg-mode > .sb-list:not(.pg-side) { display:none !important; }
#sidebar.pg-mode .sb-top > :not(#sb-toggle):not(.pg-only) { display:none; }
#sidebar.pg-mode .sb-top > .pg-only { display:flex; align-items:center; justify-content:center; }
#sidebar.pg-mode .sb-top > .sb-lib-h { flex:1 1 auto; justify-content:flex-start; min-width:0; margin:0; outline:none;
  font-size:calc(14px * var(--ui-fs, 1)); font-weight:600; color:var(--text); }
#sidebar.pg-mode:not([data-page="settings"]) .sb-top > #st-pause { display:none; }
#sidebar.pg-mode .sb-top > #st-pause { width:32px; height:32px; border-radius:4px; }
#sidebar.pg-mode .sb-top > #st-pause:hover { background:var(--hover); }
#sidebar.collapsed.pg-mode .sb-top > .sb-lib-h { display:none; }
.pg-side { padding-top:2px; }
.jb-item { min-height:40px; padding:5px 10px 5px 12px; }
.jb-item .st-ico { width:28px; height:28px; border-width:1px; }
.jb-item .st-ico svg { width:16px; height:16px; }
.jb-item .jobs-n { flex:none; }
#sidebar.collapsed .pg-side .st-it, #sidebar.collapsed .pg-side .st-find, #sidebar.collapsed .pg-side .st-grp-h,
#sidebar.collapsed .pg-side .jobs-n, #sidebar.collapsed .pg-side .st-chev { display:none; }
#sidebar.collapsed .pg-side .st-item { justify-content:center; padding:6px 0; min-height:44px; }
.pg-view { display:none; }
.pg-back { display:none; }
main.pg-on #chatgrid, main.pg-on #detail, main.pg-on #dashview { display:none !important; }
main.pg-on .pg-view:not(.hidden) { display:flex; flex-direction:column; min-width:0; min-height:0; background:var(--sidebar); }
#st-page > .st-main { flex:1; }
main.pg-on, main.pg-on.dt-rail, main.pg-on.dt-wide { grid-template-columns:var(--sb-w,320px) minmax(0,1fr) !important; }
main.pg-on.sb-collapsed { grid-template-columns:68px minmax(0,1fr) !important; }
@media (max-width:820px), (max-height:500px) and (pointer:coarse){
  main.pg-on, main.pg-on.sb-collapsed, main.pg-on.dt-rail, main.pg-on.dt-wide { grid-template-columns:minmax(0,1fr) !important; }
  main.pg-on:not(.pg-show) .pg-view:not(.hidden) { display:none; }
  /* the open section stops above the footer nav (owner, Nov 12: Active jobs hid Jobs · Agents · Settings);
     --sbf-h is the footer's measured height (app.js _footH), the fallback its phone size */
  main.pg-on.pg-show .pg-view:not(.hidden) { position:fixed; inset:0; bottom:var(--sbf-h, calc(57px + env(safe-area-inset-bottom))); z-index:110; padding-top:env(safe-area-inset-top); }
  #jobs-page .search-head { padding:6px 12px 8px 4px; }
  .jb-item { min-height:52px; }
  .pg-side .st-chev { display:block; }
}
/* paused: the gear (Settings › Pause) carries the warning colour the old pause button had */
body.swarm-paused #settings-btn, body.routines-paused #settings-btn { color:var(--warn); opacity:1; }
.sb-filters { display:flex; align-items:center; gap:0; flex:none; background:var(--hover); border:1px solid var(--line); border-radius:4px; overflow:hidden; }
.fbtn { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); background:none; border:none; padding:6px 11px; cursor:pointer; }
.sb-filters .fbtn + .fbtn { border-left:1px solid var(--line); }
.fbtn.active { background:var(--bubble2); color:var(--text); }

/* ---------- sidebar sections ---------- */
.sec { margin-bottom:6px; }
.sec-h { display:flex; align-items:center; gap:6px; padding:8px 8px 4px; border-radius:4px; }
.sec-h[data-secdrag] { cursor:pointer; }
.sec-h[data-secdrag]:hover { background:var(--hover); }
.sec-h.sec-dragging { opacity:.4; }
.sec-h.sec-drop { outline:1.5px dashed var(--accent2); outline-offset:-1px; }
.sec-caret { color:var(--faint); flex:none; transition:transform .15s ease; }
.sec.collapsed .sec-caret { transform:rotate(-90deg); }
.sec.collapsed .sec-body { display:none; }
.sec-nm { font-size:calc(11px * var(--ui-fs, 1)); text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:600; cursor:default; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sec-h[data-secdrag] .sec-nm { cursor:text; }
.sec-ct { font-size:calc(10px * var(--ui-fs, 1)); color:var(--muted); flex:none; }   /* --faint failed AA on the sidebar (frontend r1 B6-r1-1) */
.sec-x { opacity:0; background:none; border:none; color:var(--muted); cursor:pointer; font-size:calc(11px * var(--ui-fs, 1)); flex:none; }
.sec-h:hover .sec-x, .sec-x:focus-visible { opacity:1; } .sec-x:hover { color:var(--err); }
.sec-body { border-radius:4px; min-height:2px; }
.sec-body.drop-to { outline:1.5px dashed var(--accent2); outline-offset:-1px; background:var(--hover); }
.sec-empty { font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); padding:8px 12px; }
.rows-empty { display:flex; flex-direction:column; align-items:center; text-align:center; gap:7px; padding:48px 24px; color:var(--muted); }
.rows-empty .re-mark { width:40px; height:40px; border-radius:2px; display:flex; align-items:center; justify-content:center; background:var(--okbg); color:var(--green); font-size:calc(20px * var(--ui-fs, 1)); }
.rows-empty .re-msg { font-size:calc(13px * var(--ui-fs, 1)); color:var(--text); max-width:220px; }
.rows-empty .re-sub { font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); max-width:220px; }
.inline-edit { width:100%; font:inherit; font-size:calc(13px * var(--ui-fs, 1)); padding:4px 7px; border-radius:3px; background:var(--input); border:1px solid var(--accent); color:var(--text); outline:none; }
/* Agents org tree */
.agent-row .org-tw { flex:none; width:24px; height:24px; display:inline-flex; align-items:center; justify-content:center; color:var(--muted); border-radius:3px; margin-right:2px; }
.agent-row .org-tw:hover { background:var(--hover); color:var(--text); }
.agent-row .org-tw.col svg { transform:rotate(-90deg); }
.agent-row .org-tw.ghost { visibility:hidden; }
/* Settings › Agents (owner, Nov 8): CoS on top, a collapsible section per business, leads with members beneath */
.org-top { display:flex; justify-content:flex-end; gap:8px; margin:0 0 8px; }
/* business header + its ⋯ menu (Businesses folded into Agents, owner Nov 11) */
.org-biz-hd { display:flex; align-items:center; gap:4px; }
.org-biz-hd .org-biz-h { flex:1; min-width:0; }
.org-biz-more { flex:none; width:32px; height:32px; border-radius:4px; background:none; border:0; color:var(--muted); font-size:18px; line-height:1; cursor:pointer; }
.org-biz-more:hover { background:var(--hover); color:var(--text); }
.org-biz-h .biz-code { font-weight:400; }
.org-empty { padding:8px 10px 8px 34px; }
.org-biz-apps { padding:6px 10px 8px 34px; line-height:1.5; }
.org-biz-apps:empty { display:none; }
.org-apps-l { font-weight:600; font-size:calc(12.5px * var(--ui-fs, 1)); }
.org-apps-all { color:var(--muted); }
.org-add { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; font-size:calc(12.5px * var(--ui-fs, 1)); }
.org-add svg { width:14px; height:14px; }
.org-core { margin-bottom:6px; }
.org-core-h { padding:10px 8px; font-weight:600; font-size:calc(13px * var(--ui-fs, 1)); color:var(--text); }
.org-biz { margin-top:6px; }
.org-biz-h { display:flex; align-items:center; gap:8px; width:100%; padding:10px 8px; border-radius:4px; background:none; border:0;
  color:var(--text); font:inherit; font-weight:600; font-size:calc(13px * var(--ui-fs, 1)); cursor:pointer; text-align:left; }
.org-biz-h:hover { background:var(--hover); }
.org-biz-h svg { color:var(--muted); transition:transform .12s ease; }
.org-biz.col .org-biz-h svg { transform:rotate(-90deg); }
.org-biz.col .org-biz-body { display:none; }
.org-biz-nm { flex:1; min-width:0; }
.org-ct, .agent-row .org-n { flex:none; min-width:24px; padding:1px 7px; border-radius:10px; background:var(--hover); color:var(--muted);
  font-size:calc(11.5px * var(--ui-fs, 1)); font-weight:400; text-align:center; font-variant-numeric:tabular-nums; }
.org-list .agent-row { justify-content:flex-start; padding:8px 10px 8px calc(10px + var(--org-d, 0) * 22px); }
.org-list .agent-row .av { width:32px; height:32px; flex:none; }
.agent-row .ar-nm { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.agent-row .ar-role { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* a row expands in place (owner, Nov 11): the chevron on the right is the row's own toggle,
   the caret on the left (.org-tw) shows / hides its direct reports */
.agent-row .ar-chev { flex:none; display:inline-flex; color:var(--faint); margin-left:auto; transform:rotate(-90deg); transition:transform .12s ease; }
.agent-row button.ar-chev { min-width:24px; min-height:24px; align-items:center; justify-content:center; padding:0; border:0; border-radius:3px; background:none; cursor:pointer; }
.agent-row.ar-exp .ar-chev { transform:rotate(90deg); color:var(--text); }
.org-list .agent-row.ar-exp { background:var(--hover); border-radius:4px 4px 0 0; }
.org-x { margin:0 0 8px calc(10px + var(--org-d, 0) * 22px); padding:10px 12px 12px 30px; background:var(--input); border:1px solid var(--line);
  border-top:0; border-radius:0 0 4px 4px; }
/* rename in place (regular agents only; the Chief of Staff and Human AI Resources keep their names) */
.agent-row .ar-nm { display:flex; align-items:center; gap:6px; min-width:0; }
.agent-row .ar-nmt { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.agent-row .ar-ren { flex:none; display:inline-flex; align-items:center; justify-content:center; min-width:24px; min-height:24px; padding:3px; border:0; border-radius:3px; background:none; color:var(--muted); cursor:pointer; opacity:0; }
.agent-row:hover .ar-ren, .agent-row:focus-within .ar-ren, .agent-row .ar-ren:focus-visible { opacity:1; }
.agent-row .ar-ren:hover { color:var(--green); background:var(--sel); }
@media (hover:none){ .agent-row .ar-ren { opacity:.7; } }
.ar-ren-in { width:min(260px,100%); padding:3px 6px; border-radius:3px; background:var(--input); border:1px solid var(--green);
  color:var(--text); font:inherit; font-weight:600; outline:none; }
/* the expanded row: Skills | Routines tabs, search + "+", a fixed-height scroll list, pages (Nov 11) */
.ax-tabs { display:flex; gap:2px; border-bottom:1px solid var(--line); margin-bottom:8px; }
.ax-tab { padding:6px 12px 7px; border:0; border-bottom:2px solid transparent; background:none; color:var(--muted); cursor:pointer;
  font:400 calc(11.5px * var(--ui-fs, 1))/1.2 var(--px-font); letter-spacing:.05em; text-transform:uppercase; }
.ax-tab:hover { color:var(--text); }
.ax-tab[aria-selected="true"] { color:var(--green); border-bottom-color:var(--green); }
.ax-tab:focus-visible { outline:2px solid var(--green); outline-offset:-2px; }
.ax-n { display:inline-block; min-width:18px; padding:0 5px; margin-left:3px; border-radius:8px; background:var(--hover); color:var(--muted);
  font:400 calc(10.5px * var(--ui-fs, 1))/1.6 ui-sans-serif, system-ui, sans-serif; text-align:center; letter-spacing:0; }
.ax-n:empty { display:none; }
.ax-bar { display:flex; gap:6px; margin-bottom:8px; }
.ax-q { flex:1; min-width:0; padding:7px 10px; border-radius:4px; background:var(--bg); border:1px solid var(--line); color:var(--text);
  font-size:calc(13px * var(--ui-fs, 1)); outline:none; }
.ax-q:focus { border-color:var(--green); }
.ax-plus { flex:none; display:inline-flex; align-items:center; justify-content:center; width:34px; border-radius:4px; cursor:pointer;
  background:var(--okbg); border:1px solid var(--green2); color:var(--green); }
.ax-plus:hover { background:var(--green2); color:var(--ongreen); }
.ax-plus svg { width:14px; height:14px; }
.ax-panel { height:260px; overflow-y:auto; overscroll-behavior:contain; border:1px solid var(--line); border-radius:4px; background:var(--bg); }
.ax-hd, .ax-row { display:grid; align-items:center; gap:10px; padding:7px 10px; }
.ax-sk { grid-template-columns:minmax(120px, 34%) 1fr; }
.ax-rt { grid-template-columns:minmax(120px, 1fr) minmax(90px, 38%) 44px; }
.ax-hd { position:sticky; top:0; z-index:1; background:var(--sidebar); border-bottom:1px solid var(--line); color:var(--muted);
  font:400 calc(10.5px * var(--ui-fs, 1))/1.2 var(--px-font); letter-spacing:.05em; text-transform:uppercase; }
.ax-row { width:100%; border:0; border-bottom:1px solid var(--div); background:none; color:var(--text); font:inherit; text-align:left; }
.ax-row:last-child { border-bottom:0; }
button.ax-row { cursor:pointer; }
button.ax-row:hover { background:var(--hover); }
.ax-row .n { font-size:calc(13px * var(--ui-fs, 1)); min-width:0; overflow-wrap:anywhere; }
.ax-row .s { font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); min-width:0; }
.ax-row .sw { display:inline-block; vertical-align:middle; cursor:pointer; }
.ax-empty { padding:14px 10px; }
.ax-pg { display:flex; align-items:center; justify-content:flex-end; gap:8px; margin-top:6px; }
.ax-pg:empty { display:none; }
/* Apps / Access tabs: one flat list each; Access has a small type label where the type changes */
.ax-ac { grid-template-columns:minmax(120px, 1fr) minmax(90px, 44%) 44px; }
.ax-ac > :last-child, .ax-rt > :last-child { justify-self:end; }
.ax-ac.locked .n { color:var(--muted); }
.ax-row .n.mono { font-family:var(--mono, ui-monospace, Menlo, monospace); font-size:calc(12px * var(--ui-fs, 1)); }
.ax-grp { padding:8px 10px 3px; color:var(--muted); font:400 calc(10px * var(--ui-fs, 1))/1.2 var(--px-font); letter-spacing:.06em; text-transform:uppercase;
  border-bottom:1px solid var(--div); }
.ax-lock { display:inline-flex; color:var(--muted); }
.ax-core { padding:1px 5px; border:1px solid var(--green); border-radius:3px; color:var(--green); font:400 calc(9.5px * var(--ui-fs, 1))/1.4 var(--px-font); text-transform:uppercase; }
.ax-x { width:26px; height:26px; border:1px solid var(--line); border-radius:4px; background:none; color:var(--muted); cursor:pointer; font-size:15px; line-height:1; }
.ax-x:hover { color:var(--err); border-color:var(--err); }
.ax-ro { font-size:calc(11px * var(--ui-fs, 1)); }
@media (max-width:560px){
  .ax-sk { grid-template-columns:1fr; gap:2px; }
  .ax-rt, .ax-ac { grid-template-columns:1fr 44px; }
  .ax-rt > :nth-child(2), .ax-ac > :nth-child(2) { grid-column:1; grid-row:2; }
  .ax-rt > :nth-child(3), .ax-ac > :nth-child(3) { grid-column:2; grid-row:1 / span 2; }
  .ax-hd.ax-sk > :nth-child(2), .ax-hd.ax-rt > :nth-child(2), .ax-hd.ax-ac > :nth-child(2) { display:none; }
  .ax-tabs { overflow-x:auto; scrollbar-width:none; }
  .ax-tab { padding:6px 6px 7px; white-space:nowrap; flex:none; letter-spacing:0; }
  .ax-n { margin-left:2px; }
  .ax-hd.ax-rt > :nth-child(3), .ax-hd.ax-ac > :nth-child(3) { grid-row:1; }
  .ax-panel { height:300px; }
}
/* Add agent: the character-select picker (Nov 11) */
.pk-dlg { z-index:530; }
.pk-box { width:min(1080px,100%); height:min(780px,100%); display:flex; flex-direction:column; background:var(--sidebar);
  border:2px solid var(--line); border-radius:4px; box-shadow:0 20px 50px var(--shadow); overflow:hidden; }
.pk-top { display:flex; align-items:center; gap:12px; padding:14px 18px; border-bottom:1px solid var(--line);
  background:repeating-linear-gradient(0deg, transparent 0 3px, rgba(92,208,138,.03) 3px 4px); }
.pk-title { font:400 calc(18px * var(--ui-fs, 1))/1.2 var(--px-font); letter-spacing:.04em; color:var(--green); }
.pk-biz { margin-left:auto; display:flex; align-items:center; gap:6px; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); }
.pk-biz select { padding:5px 8px; border-radius:4px; background:var(--input); border:1px solid var(--bd-ctl); color:var(--text); max-width:40vw; }
.pk-x { border:0; background:none; color:var(--muted); font-size:22px; line-height:1; cursor:pointer; padding:2px 6px; }
.pk-x:hover { color:var(--text); }
.pk-bar { display:flex; align-items:flex-end; gap:12px; padding:10px 18px 0; }
.pk-tabs { margin-bottom:0; border-bottom:0; }
.pk-tabs .mcp-tab { font:400 calc(12px * var(--ui-fs, 1))/1.2 var(--px-font); letter-spacing:.05em; text-transform:uppercase; }
.pk-tabs .mcp-tab[aria-selected="true"] { color:var(--green); border-bottom-color:var(--green); font-weight:400; }
.pk-q { margin:0 0 6px auto; width:min(280px,45%); padding:7px 10px; border-radius:4px; background:var(--input); border:1px solid var(--line);
  color:var(--text); font-size:calc(13px * var(--ui-fs, 1)); outline:none; }
.pk-q:focus { border-color:var(--green); }
.pk-main { flex:1; min-height:0; display:grid; grid-template-columns:1fr 340px; border-top:1px solid var(--line); }
.pk-grid { overflow-y:auto; overscroll-behavior:contain; padding:6px 16px 18px; }
.pk-sec { position:sticky; top:-6px; z-index:1; padding:14px 0 0; background:var(--sidebar); color:var(--muted);
  font:400 calc(11px * var(--ui-fs, 1))/1.2 var(--px-font); letter-spacing:.06em; text-transform:uppercase; }
.pk-row { display:grid; grid-template-columns:repeat(auto-fill, minmax(124px, 1fr)); gap:10px; padding-top:10px; }
.pk-row.pk-teams { grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); }
.pk-tile { display:flex; flex-direction:column; align-items:center; gap:4px; padding:10px 8px 10px; border-radius:4px; cursor:pointer;
  background:var(--input); border:2px solid var(--line); color:var(--text); font:inherit; text-align:center; transition:transform .08s ease, border-color .08s ease; }
.pk-tile:hover { border-color:var(--green2); transform:translateY(-2px); }
.pk-tile.on { border-color:var(--green); background:var(--okbg); box-shadow:0 0 0 2px rgba(92,208,138,.18); }
.pk-tile:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
.pk-stage { position:relative; display:flex; align-items:flex-end; justify-content:center; height:76px; width:100%;
  background:radial-gradient(ellipse 40% 10% at 50% 92%, rgba(0,0,0,.35), transparent 70%); }
.pk-stage .pk-av { width:auto; height:70px; image-rendering:pixelated; }
.pk-stage.big { height:120px; width:110px; flex:none; }
.pk-stage.big .pk-av { height:112px; }
.pk-plus { position:absolute; top:4px; right:8px; font:400 18px/1 var(--px-font); color:var(--green); }
.pk-badge { position:absolute; top:2px; left:4px; padding:1px 5px; border-radius:2px; background:var(--green); color:var(--ongreen);
  font:400 calc(9px * var(--ui-fs, 1))/1.4 var(--px-font); letter-spacing:.05em; text-transform:uppercase; }
.pk-crew { gap:4px; }
.pk-crew .pk-lead { height:72px; }
.pk-mini { display:flex; align-items:flex-end; }
.pk-mini .pk-sm { height:44px; width:auto; margin-left:-6px; }
.pk-nm { font-size:calc(12.5px * var(--ui-fs, 1)); font-weight:600; line-height:1.25; }
.pk-ln { font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pk-none { padding:20px 4px; }
.pk-detail { overflow-y:auto; overscroll-behavior:contain; padding:16px 18px; border-left:1px solid var(--line); background:var(--panel);
  display:flex; flex-direction:column; gap:10px; }
.pk-detail:empty { display:none; }
.pk-hero { display:flex; align-items:flex-end; gap:12px; }
.pk-dn { font:400 calc(15px * var(--ui-fs, 1))/1.3 var(--px-font); letter-spacing:.03em; color:var(--text); margin-bottom:4px; }
.pk-pills { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:4px; }
.pk-pill { padding:1px 7px; border-radius:2px; border:1px solid var(--green2); color:var(--green); font-size:calc(11px * var(--ui-fs, 1)); }
.pk-desc { font-size:calc(13px * var(--ui-fs, 1)); line-height:1.45; }
.pk-h { margin-top:4px; color:var(--muted); font:400 calc(10.5px * var(--ui-fs, 1))/1.2 var(--px-font); letter-spacing:.06em; text-transform:uppercase; }
.pk-ul { margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:5px; font-size:calc(12.5px * var(--ui-fs, 1)); }
.pk-ul li { padding-left:12px; position:relative; line-height:1.35; }
.pk-ul li::before { content:""; position:absolute; left:0; top:6px; width:5px; height:5px; background:var(--green); }
.pk-ul li.s::before { display:none; }
.pk-ul .s { color:var(--muted); font-size:calc(11.5px * var(--ui-fs, 1)); }
.pk-apps { display:flex; flex-wrap:wrap; gap:5px; }
.pk-app { padding:2px 8px; border-radius:3px; background:var(--input); border:1px solid var(--line); font-size:calc(11.5px * var(--ui-fs, 1)); }
.pk-app.req { border-color:var(--green2); }
.pk-note { font-size:calc(11.5px * var(--ui-fs, 1)); }
.pk-app em { font-style:normal; color:var(--muted); font-size:calc(10.5px * var(--ui-fs, 1)); }
.pk-perms { display:flex; flex-direction:column; gap:6px; }
.pk-perm { padding:6px 8px 6px 10px; border-left:3px solid var(--line); background:var(--input); border-radius:0 3px 3px 0; }
.pk-perm.ok { border-left-color:var(--green); }
.pk-perm.ask { border-left-color:var(--warn); }
.pk-perm.no { border-left-color:var(--err); }
.pk-perm-l { display:block; margin-bottom:3px; color:var(--muted); font:400 calc(10px * var(--ui-fs, 1))/1.2 var(--px-font); letter-spacing:.05em; text-transform:uppercase; }
.pk-perm ul { margin:0; padding-left:16px; font-size:calc(12px * var(--ui-fs, 1)); line-height:1.4; }
.pk-go { display:flex; gap:8px; margin-top:auto; padding-top:10px; position:sticky; bottom:-16px; background:var(--panel); padding-bottom:4px; }
.pk-go .btn { flex:none; }
.pk-go .btn:only-child { flex:1; }
.pk-nmin { flex:1; min-width:0; padding:8px 10px; border-radius:4px; background:var(--input); border:1px solid var(--line); color:var(--text); font:inherit; outline:none; }
.pk-nmin:focus { border-color:var(--green); }
.pk-org { display:flex; flex-direction:column; gap:4px; }
.pk-org-l { padding:4px 0 2px; }
.pk-mem { border:1px solid var(--line); border-radius:4px; background:var(--input); }
.pk-mem.sub { margin-left:18px; }
.pk-mem summary { display:flex; align-items:center; gap:8px; padding:6px 8px; cursor:pointer; list-style:none; }
.pk-mem summary::-webkit-details-marker { display:none; }
.pk-mem[open] summary { border-bottom:1px solid var(--line); }
.pk-mem .pk-sm2 { height:40px; width:auto; flex:none; }
.pk-mm { display:flex; flex-direction:column; min-width:0; font-size:calc(12.5px * var(--ui-fs, 1)); }
.pk-mm .s { font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); }
.pk-mem-x { padding:8px 10px 10px; display:flex; flex-direction:column; gap:6px; }
@media (max-width:820px){
  .pk-dlg { padding:0; }
  .pk-box { height:100%; border-radius:0; border:0; }
  .pk-top { padding:12px 16px; flex-wrap:wrap; }
  .pk-bar { flex-wrap:wrap; padding:8px 16px 0; }
  .pk-q { width:100%; margin:0 0 8px; order:-1; }
  .pk-main { display:block; overflow-y:auto; }
  .pk-grid { overflow:visible; padding:4px 16px 12px; }
  .pk-sec { position:static; }
  .pk-row { grid-template-columns:repeat(auto-fill, minmax(104px, 1fr)); gap:8px; }
  .pk-detail { border-left:0; border-top:1px solid var(--line); padding:14px 16px 20px; overflow:visible; }
  .pk-go { bottom:0; }
}
.sk-read { margin:8px 0 0; padding:10px; background:var(--input); border:1px solid var(--line); border-radius:4px; white-space:pre-wrap; word-break:break-word;
  font-family:ui-monospace, monospace; font-size:calc(12px * var(--ui-fs, 1)); color:var(--text); max-height:60vh; overflow:auto; }
.dt-change { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:4px 0 10px; }
@media (max-width:820px){ .org-x { margin-left:10px; padding-left:12px; } }
.dt-arch-t { margin-bottom:8px; }
.dt-arch { margin-bottom:12px; }

/* ---------- right-click context menu ---------- */
.ctx-menu { position:fixed; z-index:300; min-width:210px; background:var(--elev); border:1px solid var(--line);
  border-radius:4px; padding:5px; box-shadow:0 12px 34px var(--shadow); }
.ctx-menu button { display:flex; align-items:center; justify-content:space-between; width:100%; text-align:left;
  padding:8px 11px; border-radius:4px; font-size:calc(13px * var(--ui-fs, 1)); color:var(--text); background:none; border:none; cursor:pointer; white-space:nowrap; }
.ctx-menu button:hover { background:var(--hover); }
.ctx-menu button.danger { color:var(--err); }
.ctx-div { height:1px; background:var(--line); margin:4px 6px; }
.ctx-sub { position:relative; }
.ctx-sub .ctx-submenu { display:none; position:absolute; left:100%; top:0; min-width:180px; max-height:260px; overflow-y:auto;
  background:var(--elev); border:1px solid var(--line); border-radius:4px; padding:5px; box-shadow:0 12px 34px var(--shadow); }
.ctx-sub:hover .ctx-submenu, .ctx-sub.open .ctx-submenu { display:block; }
.ctx-menu { max-width:calc(100vw - 16px); }
.ctx-menu.sub-left .ctx-submenu { left:auto; right:100%; }
/* phones: no hover — the parent toggles .open and the submenu opens inline (it sat off-screen) */
@media (max-width:820px), (pointer:coarse){
  .ctx-sub .ctx-submenu, .ctx-menu.sub-left .ctx-submenu { position:static; box-shadow:none; border:0; padding:0 0 0 10px; min-width:0; }
  .ctx-menu button { white-space:normal; overflow-wrap:anywhere; }
  .ctx-sub:hover .ctx-submenu { display:none; }
  .ctx-sub.open .ctx-submenu { display:block; } }
.ctx-parent span { color:var(--muted); }


.row-agent { display:flex; align-items:center; gap:11px; padding:9px 10px; border-radius:4px; cursor:pointer; position:relative; }
.row-agent:hover { background:var(--hover); }
.row-agent.sel { background:var(--sel); }
.row-agent .av { width:40px; height:40px; flex:none; }
.row-agent .mid { min-width:0; flex:1; }
.row-agent .nm { font-size:calc(13.5px * var(--ui-fs, 1)); font-weight:560; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.row-agent .pv { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.row-agent.off .nm { color:var(--faint); }
.row-agent .dot { width:8px; height:8px; border-radius:2px; background:var(--blue); flex:none; }

.sb-bottom { padding:10px; border-top:1px solid var(--line); display:flex; align-items:center; gap:10px; }
.sb-bottom .me { width:30px; height:30px; border-radius:2px; background:linear-gradient(135deg,#777,#444); flex:none; }
.connect { flex:1; display:flex; align-items:center; justify-content:center; gap:8px; padding:9px; border-radius:4px;
  background:var(--bubble); color:var(--text); font-size:calc(13px * var(--ui-fs, 1)); font-weight:560; border:1px solid var(--line); }
.connect:hover { background:var(--bubble2); }
.connect svg { color:var(--muted); }
.connect:hover svg { color:var(--text); }

/* ---------- Avatars (green blob — inline SVG) ---------- */
.av { border-radius:50%; flex:none; display:block; }
svg.av { overflow:hidden; border-radius:0; }   /* pixel sprite: no circle clip */
/* dark: the sprite's near-black outline (ink O #1b1b20) is 1.09:1 on the dark surfaces, so a dark skin / hair /
   outfit lost its silhouette (mobile-a11y LZ-U13); a crisp 1px light ring (~4:1 on --sidebar) keeps the edge */
:root:not([data-theme="light"]) svg.av { --av-ring:rgba(236,236,241,.45);
  filter:drop-shadow(1px 0 0 var(--av-ring)) drop-shadow(-1px 0 0 var(--av-ring))
         drop-shadow(0 1px 0 var(--av-ring)) drop-shadow(0 -1px 0 var(--av-ring)); }

/* ---------- Chat ---------- */
#chat { display:flex; flex-direction:column; min-height:0; min-width:0; position:relative; }
/* the chat header is a fixed bar above the feed, not a pill floating over it (owner, Nov 8:
   messages scrolled under it); the feed scrolls below it */
.chat-head { position:relative; flex:none; z-index:5; min-height:52px; box-sizing:border-box;
  display:flex; align-items:center; gap:9px; background:var(--bg); border-bottom:1px solid var(--line);
  padding:8px 16px; cursor:pointer; }
.chat-head .nm { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat-head .nm + * { margin-left:auto; }
.chat-head .av { width:26px; height:26px; }
.chat-head .nm { font-size:calc(13.5px * var(--ui-fs, 1)); font-weight:600; }

#feed { flex:1; overflow-y:auto; padding:16px 0 16px; display:flex; flex-direction:column; align-items:center; }
/* The chat list is laid out on its own: typing in the composer reflowed all ~14k message
   nodes on every keystroke (43 ms a key, Oct 29). Its size comes from the flex column,
   never its content; every popover is appended to <body>, outside it. */
#feed { contain:strict; }
/* while a side panel is being dragged (app.js _rzFreeze): skip off-screen messages */
body.rz-drag .feed-wrap > * { content-visibility:auto; }
.feed-wrap { width:100%; max-width:1100px; padding:0 40px; display:flex; flex-direction:column; gap:14px; }
/* chat reads at 125% on desktop (owner preference) — only the feed scales; sidebar/composer stay 100% */
@media (min-width:821px) and (min-height:501px), (min-width:821px) and (pointer:fine){ .feed-wrap { zoom:1.25; } }

.msg { max-width:88%; padding:13px 16px; border-radius:4px; font-size:calc(14px * var(--chat-fs, 1) * var(--ui-fs, 1)); }
.a2a-group { max-width:88%; }   /* agent→agent rows: the same cap as a reply bubble */
.msg.bot { align-self:flex-start; background:var(--bubble); border-top-left-radius:6px; }
.msg.me  { align-self:flex-end; background:var(--me); border-top-right-radius:6px; }
.msg h3 { margin:6px 0 8px; font-size:calc(16px * var(--chat-fs, 1) * var(--ui-fs, 1)); font-weight:700; }
.msg h4 { margin:2px 0 8px; font-size:calc(14.5px * var(--chat-fs, 1) * var(--ui-fs, 1)); }
/* Section headers inside a reply get breathing room above them — except the reply's
   first header, and the subtitle stacked right under that first title. Higher
   specificity than the generic .msg h3/h4 margins above, which squeezed them to 2-6px. */
.msg .msg-body :is(h3,h4,h5,h6) { margin:18px 0 6px; line-height:1.25; }
/* Header sizes in reply bubbles — a chat reply, not a document: the title is a touch
   above body text and section headers read as small labels, so the content leads. */
.msg .msg-body h3 { font-size:1.18em; }    /* # */
.msg .msg-body h4 { font-size:1.06em; }    /* ## and bold-only section lines */
.msg:is(.oc-ok,.oc-bad,.oc-warn) .msg-body > :is(h3,h4):first-child { display:inline-flex; align-items:center; gap:7px; margin:0 0 6px; padding:3px 10px; border-radius:4px; border:1px solid; font-size:1em; }
.msg.oc-ok .msg-body > :is(h3,h4):first-child { color:var(--ok); border-color:color-mix(in srgb, var(--ok) 45%, transparent); background:color-mix(in srgb, var(--ok) 10%, transparent); }
.msg.oc-ok .msg-body > :is(h3,h4):first-child::before { content:"✓"; }
.msg.oc-bad .msg-body > :is(h3,h4):first-child { color:var(--err); border-color:color-mix(in srgb, var(--err) 45%, transparent); background:color-mix(in srgb, var(--err) 10%, transparent); }
.msg.oc-bad .msg-body > :is(h3,h4):first-child::before { content:"✗"; }
.msg.oc-warn .msg-body > :is(h3,h4):first-child { color:var(--warn); border-color:var(--warnbd); background:color-mix(in srgb, var(--warn) 10%, transparent); }
.msg.oc-warn .msg-body > :is(h3,h4):first-child::before { content:"!"; }
.msg .msg-body :is(h5,h6) { font-size:.78em; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.msg .msg-body :is(h4,h5,h6) { margin-top:14px; }
/* Comfortable line length for reading (~75 characters) */
.msg.bot .msg-body { max-width:75ch; }
.msg .msg-body > :is(h3,h4,h5,h6):first-child { margin-top:0; }
.msg .msg-body .meta + :is(h3,h4,h5,h6) { margin-top:0; }
.msg .msg-body > :is(h3,h4,h5,h6):first-child + :is(h3,h4,h5,h6) { margin-top:6px; }   /* title + subtitle */
.msg h5, .msg h6 { margin:6px 0 6px; font-size:calc(13px * var(--chat-fs, 1) * var(--ui-fs, 1)); font-weight:600; color:var(--muted); text-transform:none; letter-spacing:0; }
.msg ul, .msg ol { margin:6px 0; padding-left:20px; } .msg li { margin:3px 0; }
.msg ol { list-style:decimal; }
.msg pre { white-space:pre-wrap; word-break:break-word; margin:0; font:inherit; }
.msg code { background:var(--deep); border:1px solid var(--line); border-radius:3px; padding:1px 5px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:calc(12.5px * var(--ui-fs, 1)); }
.msg a { color:var(--accent2); text-decoration:underline; }
.msg i { font-style:italic; }
.msg hr { border:none; border-top:1px solid var(--line); margin:10px 0; }
.msg .meta { font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); margin-bottom:6px; }
/* Model badge — which Claude model produced the message. Opus (flagship) stands out. */
.model-badge { display:inline-block; font-size:calc(9.5px * var(--ui-fs, 1)); font-weight:600; letter-spacing:.02em;
  padding:1px 6px; border-radius:4px; vertical-align:middle; margin-left:2px;
  border:1px solid var(--line); color:var(--muted); }
.model-badge.mb-opus { color:#0b5; border-color:rgba(0,187,85,.45); background:rgba(0,187,85,.10); }
.model-badge.mb-sonnet { color:#7a8; }
.model-badge.mb-haiku { color:var(--muted); }
/* light theme: #0b5 / #7a8 are ~2:1 on the light bubbles; --green2 clears 4.5:1 on --bubble2 too (i11221145 B5a) */
:root[data-theme="light"] .model-badge.mb-opus, :root[data-theme="light"] .model-badge.mb-sonnet { color:var(--green2); }
.daydiv { align-self:center; font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); margin:4px 0; }

.evt-line { align-self:center; font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); display:flex; gap:7px; align-items:center; }
.evt-line.tool { color:var(--muted); } .evt-line .k { color:var(--green); }
/* approval executed: green pill like the Opus model badge; failed red, unconfirmed amber */
.evt-line.ok, .evt-line.bad, .evt-line.maybe { padding:2px 10px; border-radius:4px; border:1px solid; font-weight:600; }
.evt-line.ok { color:var(--ok); border-color:color-mix(in srgb, var(--ok) 45%, transparent); background:color-mix(in srgb, var(--ok) 10%, transparent); }
.evt-line.bad { color:var(--err); border-color:color-mix(in srgb, var(--err) 45%, transparent); background:color-mix(in srgb, var(--err) 10%, transparent); }
.evt-line.maybe { color:var(--warn); border-color:var(--warnbd); background:color-mix(in srgb, var(--warn) 10%, transparent); }
.evt-line.warnline { color:var(--warn); background:color-mix(in srgb, var(--warn) 9%, transparent); border:1px solid var(--warnbd);
  padding:5px 12px; border-radius:4px; font-size:calc(12.5px * var(--ui-fs, 1)); max-width:90%; text-align:center; }
.dc-q { font-size:calc(15px * var(--ui-fs, 1)); line-height:1.5; color:var(--text); margin-bottom:2px; }
.dc-q + .ap { margin:8px 0 0; }                 /* a decision card's WHY block */
.sec-row input { font-size:calc(14px * var(--ui-fs, 1)); }

/* cards */
.card { align-self:stretch; max-width:720px; width:100%; background:var(--bubble); border:1px solid var(--line); border-radius:4px; padding:15px 16px; }
.card.warn { border-color:var(--warnbd); }
.card h4 { margin:0 0 10px; font-size:calc(14px * var(--ui-fs, 1)); }
.card pre { white-space:pre-wrap; word-break:break-word; background:var(--input); padding:9px; border-radius:4px; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); }
.ap { display:flex; flex-direction:column; gap:6px; margin:2px 0 12px; }
.ap-head { margin-bottom:10px; }
.ap-eyebrow { font-size:calc(11px * var(--ui-fs, 1)); font-weight:650; letter-spacing:.06em; text-transform:uppercase; color:var(--warn); }
.ap-title { font-size:calc(17px * var(--ui-fs, 1)); font-weight:700; color:var(--text); margin-top:3px; }
.ap { display:flex; flex-direction:column; gap:10px; }
.ap-what { font-size:calc(15px * var(--ui-fs, 1)); font-weight:600; color:var(--text); line-height:1.4; }
.ap-why { padding:10px 13px; border-left:3px solid var(--warn); background:var(--input); border-radius:0 4px 4px 0; font-size:calc(14px * var(--ui-fs, 1)); line-height:1.5; }
.ap-why-l { display:block; font-size:calc(11px * var(--ui-fs, 1)); font-weight:650; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); margin-bottom:2px; }
.ap-warn { padding:9px 12px; border:1px solid var(--warnbd); border-radius:4px; color:var(--warn); font-size:calc(13px * var(--ui-fs, 1)); line-height:1.45; }
.ap-group { background:var(--card2); border:1px solid var(--line); border-radius:4px; padding:4px 13px; }
.ap-gh { font-size:calc(11px * var(--ui-fs, 1)); font-weight:650; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); padding:9px 0 3px; }
.ap-row { display:flex; gap:14px; font-size:calc(14px * var(--ui-fs, 1)); line-height:1.5; padding:8px 0; border-top:1px solid var(--div); }
.ap-gh + .ap-row, .ap-group > .ap-row:first-child { border-top:none; }
.ap-l { flex:none; width:130px; color:var(--muted); }
.ap-v { flex:1; min-width:0; word-break:break-word; white-space:pre-wrap; color:var(--text); }
.ap-v code, .ap-tech code { font-size:calc(12px * var(--ui-fs, 1)); }
.ap-sep { height:1px; background:var(--line); margin:4px 0; }
.ap-hole { color:var(--warn); background:color-mix(in srgb, var(--warn) 14%, transparent); border-radius:3px; padding:0 4px; }
.ap-dim { color:var(--muted); }
.ap-tech { font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); word-break:break-word; }
.ap-raw summary { cursor:pointer; font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); }
.ap-raw pre { margin:6px 0 0; }
.ap-codeblk { min-width:0; }
.ap-codeblk > .ap-gh { padding-top:0; }
.ap-code-list { display:flex; flex-direction:column; gap:6px; max-height:280px; overflow-y:auto; }
.ap pre.ap-code { margin:0; white-space:pre; word-break:normal; overflow-x:auto; overflow-y:auto; max-height:280px; flex:none;
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:calc(12px * var(--ui-fs, 1)); line-height:1.45;
  background:var(--input); border:1px solid var(--line); border-radius:4px; padding:8px 10px; color:var(--text); tab-size:2; }
.ap-code-list pre.ap-code { max-height:none; overflow-y:visible; }
.ap-raw pre.ap-code { margin:6px 0 0; }
@media (max-width:520px){ .ap-row { flex-direction:column; gap:2px; } .ap-l { width:auto; font-size:calc(12px * var(--ui-fs, 1)); } }
.opt { display:flex; align-items:center; gap:11px; padding:11px 12px; border-radius:4px; cursor:pointer; }
.opt:hover { background:var(--bubble2); }
.opt .lt { width:26px; height:26px; border-radius:2px; background:var(--iconbtn); display:flex; align-items:center; justify-content:center; font-size:calc(12px * var(--ui-fs, 1)); font-weight:600; flex:none; }
.card .btns { display:flex; flex-wrap:wrap; gap:9px; margin-top:12px; }
.dc-opts { display:flex; flex-direction:column; gap:4px; margin-top:10px; }
.dc-opt { border:1px solid var(--line); align-items:flex-start; }
.dc-opt input { flex:none; width:auto; margin:3px 0 0; }   /* radio/checkbox must NOT inherit .card input width:100% */
.dc-opt span { flex:1; min-width:0; }
.dc-opt span.primary { font-weight:640; }
.dc-custom { margin-top:8px; width:100%; }
textarea.dc-custom { resize:none; overflow:hidden; min-height:38px; line-height:1.45; font:inherit; box-sizing:border-box; }
.dc-custom { padding:9px 14px; border-radius:4px; background:var(--input); border:1px solid var(--line); color:var(--text); outline:none; }
.dc-custom::placeholder { color:var(--muted); }
.dc-custom:focus { border-color:var(--accent2); }
.fs-row { display:flex; gap:8px; flex-wrap:wrap; }
.fs-opt { padding:7px 14px; border-radius:4px; border:1px solid var(--line); background:var(--bubble2); font-size:calc(13px * var(--ui-fs, 1)); }
.fs-opt.active { border-color:var(--green); color:var(--green); font-weight:600; }
.tk-f-row { display:flex; gap:12px; margin-top:4px; }
.tk-f-row > div { flex:1; }
.tk-f-row input[type=date], .tk-f-row select { width:100%; }
.tk-row { cursor:pointer; }
.tk-done-h { cursor:pointer; user-select:none; }
.tk-done-h .tk-caret { color:var(--muted); font-size:calc(11px * var(--ui-fs, 1)); }
.btn { padding:8px 16px; border-radius:4px; font-size:calc(13px * var(--ui-fs, 1)); font-weight:560; background:var(--bubble2); }
.btn.green { background:var(--green); color:var(--ongreen); } .btn.red { background:var(--redbg); color:var(--err); }
.card input { width:100%; padding:9px 11px; border-radius:4px; background:var(--input); border:1px solid var(--bd-ctl); color:var(--text); }
.card input[type=radio], .card input[type=checkbox] { width:auto; padding:0; border-radius:0; }   /* never full-width */

/* composer */
.composer { padding:8px 20px 18px; display:flex; flex-direction:column; }
.composer form { width:100%; max-width:none; margin:0; display:flex; flex-direction:column; gap:6px;
  background:var(--elev); border:1px solid var(--line); border-radius:4px; padding:7px 9px; }
.composer .composer-row { display:flex; align-items:flex-end; gap:6px; }
/* composer attachment thumbnails (inside the input box, grokbot-style) */
.attach-bar { display:flex; flex-wrap:wrap; gap:8px; padding:5px 4px 2px; }
.pending-thumb { position:relative; display:flex; align-items:center; gap:7px; max-width:190px; height:54px; padding-right:24px;
  border-radius:4px; overflow:hidden; flex:none; border:1px solid var(--line); background:var(--bubble2); }
.pending-thumb .pt-pic { width:52px; height:52px; flex:none; }
.pending-thumb .pt-meta { min-width:0; line-height:1.3; }
.pending-thumb .pt-n { font-size:calc(12px * var(--ui-fs, 1)); color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pending-thumb .pt-s { font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); }
.pending-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.pending-thumb .pt-file { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; color:var(--muted); gap:2px; }
.pending-thumb .pt-file span { font-size:calc(8px * var(--ui-fs, 1)); font-weight:700; letter-spacing:.03em; }
.pending-thumb.up { opacity:.6; }
.pt-x { position:absolute; top:3px; right:3px; width:17px; height:17px; border-radius:2px; background:rgba(0,0,0,.55);
  color:#fff; font-size:calc(10px * var(--ui-fs, 1)); line-height:1; display:flex; align-items:center; justify-content:center; border:none; cursor:pointer; }
.pt-x:hover { background:var(--err); }
.composer textarea { flex:1; background:none; border:none; outline:none; color:var(--text); font:inherit; font-size:calc(15px * var(--chat-fs, 1) * var(--ui-fs, 1));
  resize:none; line-height:1.45; padding:8px 6px; max-height:220px; overflow-y:auto; }
.composer textarea::placeholder { color:var(--muted); }
.composer .ic { width:34px; height:34px; border-radius:2px; display:flex; align-items:center; justify-content:center;
  color:var(--muted); flex:none; background:none; }
.composer .ic:hover { background:var(--iconbtn); color:var(--text); }
.composer .ic.live { color:var(--green); }
/* send: a small round icon, muted until there's something to send (text or an attachment) */
.composer .ic.send { width:32px; height:32px; border-radius:50%; margin:0 0 2px; color:var(--muted); background:transparent;
  transition:background .15s, color .15s; }
.composer .ic.send svg { width:16px; height:16px; }
.composer .ic.send:hover { background:var(--iconbtn); color:var(--muted); }
.composer form:has(textarea:not(:placeholder-shown)) .ic.send,
.composer form:has(.attach-bar:not(.hidden)) .ic.send { color:var(--ongreen); background:var(--accent); }
.composer form:has(textarea:not(:placeholder-shown)) .ic.send:hover,
.composer form:has(.attach-bar:not(.hidden)) .ic.send:hover { background:var(--green2); color:var(--ongreen); }

/* ---------- Chat area (#chatgrid wraps the single #chat view) ---------- */
#chatgrid { position:relative; display:grid; min-height:0; min-width:0; background:var(--line);
  grid-template-columns:1fr; grid-template-rows:1fr; grid-template-areas:"p0"; }
#chat { grid-area:p0; background:var(--bg); }
@media (max-width:820px), (max-height:500px) and (pointer:coarse){ #chatgrid { display:contents; } }   /* contents: no empty grid row under the sidebar */

/* ---------- Detail panel ---------- */
#detail { background:var(--sidebar); border-left:1px solid var(--line); display:flex; flex-direction:column; min-height:0; }
.dt-top { display:flex; align-items:center; justify-content:flex-end; gap:16px; padding:14px 16px; color:var(--muted); }
.dt-top .icon:hover { color:var(--text); }
.dt-back { display:none; }   /* phone only (the full-screen agent panel, below) */
.dt-head { display:flex; flex-direction:column; align-items:center; gap:5px; padding:0 16px 10px; }
.dt-head .av { width:92px; height:92px; }
.dt-head .nm { font-weight:600; font-size:calc(18px * var(--ui-fs, 1)); margin-top:4px; }
.dt-head .dt { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); }
.dt-tabs { display:flex; justify-content:center; gap:26px; border-bottom:1px solid var(--line); padding:12px 0; }
.dt-tabs button { color:var(--muted); font-size:calc(14px * var(--ui-fs, 1)); padding-bottom:10px; margin-bottom:-13px; border-bottom:2px solid transparent; }
.dt-tabs button.active { color:var(--text); border-color:var(--text); }
.dt-body { flex:1; overflow-y:auto; padding:14px 16px 24px; }
.dt-body h5 { font-size:calc(12px * var(--ui-fs, 1)); text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin:16px 0 8px; }
.dt-body h5:first-child { margin-top:2px; }

.rline { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 0; border-bottom:1px solid var(--div); }
.rline .l { min-width:0; }
.rline .l .n { font-size:calc(13.5px * var(--ui-fs, 1)); } .rline .l .s { font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); }
.pillx { font-size:calc(10px * var(--ui-fs, 1)); color:var(--warn); margin-left:6px; }

/* toggle switch */
.sw { width:40px; height:23px; border-radius:4px; background:var(--swoff); position:relative; transition:.15s; flex:none; }
.sw.on { background:var(--green); }
.sw::after { content:""; position:absolute; top:2px; left:2px; width:19px; height:19px; border-radius:2px; background:#fff; transition:.15s; }
.sw.on::after { transform:translateX(17px); }

.item { padding:10px 0; border-bottom:1px solid var(--div); font-size:calc(13px * var(--ui-fs, 1)); }
.item .s { font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); }
.item .del { float:right; color:var(--err); }
.item .go { float:right; color:var(--green); font-size:calc(12px * var(--ui-fs, 1)); }
/* empty-state next step (app.js emptyCta): a token colour, never the UA link blue (#0000ee is 2.2:1 on dark) */
.empty-cta { display:inline-block; color:var(--accent2); text-decoration:underline; }   /* one box: a wrapped label left its centre on the gap between its lines (b54 B1-1d) */
.instr { background:var(--input); border:1px solid var(--line); border-radius:4px; padding:10px; font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--muted); white-space:pre-wrap; max-height:220px; overflow-y:auto; }
.taglist span { display:inline-block; font-size:calc(10.5px * var(--ui-fs, 1)); background:var(--input); border:1px solid var(--line); border-radius:4px; padding:2px 8px; margin:0 4px 5px 0; color:var(--muted); }

.badge { position:fixed; bottom:12px; left:50%; transform:translateX(-50%); font-size:calc(11px * var(--ui-fs, 1)); padding:3px 10px; border-radius:4px; background:var(--bubble); border:1px solid var(--line); color:var(--muted); z-index:40; }
.badge.mock { color:var(--warn); }

/* global modal */
#modal { position:fixed; inset:0; background:var(--overlay); display:flex; align-items:center; justify-content:center; z-index:250; }   /* above the phone chat layer (100) + detail drawer (220) */
#modal.hidden { display:none; }
.modal-box { background:var(--sidebar); border:1px solid var(--line); border-radius:4px; width:80vw; height:80vh; overflow:hidden; padding:22px 26px; position:relative; display:flex; flex-direction:column; }
.modal-box > #modal-body { flex:1; min-height:0; display:flex; flex-direction:column; overflow-y:auto; -webkit-overflow-scrolling:touch; }
#modal-body > h3, #modal-body > .gtabs { flex:none; }
#modal-body > :not(#gbody) { flex-shrink:0; }   /* pages without their own scroller (agent editor) scroll the body, not squash */
#gbody { flex:1; min-height:0; overflow-y:auto; }
.modal-box input, .modal-box textarea, .modal-box select, #st-page input, #st-page textarea, #st-page select {
  width:100%; background:var(--input); color:var(--text); border:1px solid var(--line);
  border-radius:4px; padding:9px 11px; font:inherit; font-size:calc(13.5px * var(--ui-fs, 1)); outline:none; }
.modal-box textarea, #st-page textarea { resize:vertical; line-height:1.5; }
.modal-box select, #st-page select { appearance:none; cursor:pointer; }
.modal-box input:focus, .modal-box textarea:focus, .modal-box select:focus, #st-page input:focus, #st-page textarea:focus, #st-page select:focus { border-color:var(--accent2); }
.modal-box .btns input, #st-page .btns input { width:auto; }
#modal-x { position:absolute; top:12px; right:14px; color:var(--muted); font-size:calc(16px * var(--ui-fs, 1));
  min-width:40px; min-height:40px; display:flex; align-items:center; justify-content:center; }
.modal-box h3, #st-page h3, #st-page #st-title { margin:0 0 6px; }
/* Connections (grouped cards) */
.conn-search { width:100%; margin-bottom:10px; padding:10px 14px; border-radius:4px; background:var(--input); border:1px solid var(--line); color:var(--text); font-size:calc(14px * var(--ui-fs, 1)); outline:none; }
/* keep search + category tabs pinned while the grid scrolls */
.conn-sticky { position:sticky; top:0; z-index:12; background:var(--sidebar); padding-top:4px; padding-bottom:2px;
  box-shadow:0 8px 10px -8px var(--shadow); }
/* minmax(0,…): a long one-line status must ellipsize, not widen the column past the screen */
.conn-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
@media (max-width:760px){ .conn-grid { grid-template-columns:minmax(0,1fr); } }
/* AI models: a provider tile and its account cards are wide (effort pickers) — one per row */
.conn-grid.one-col { grid-template-columns:minmax(0,1fr); }
/* an expanded app card (account rows, Details) spans both columns so its rows stay readable */
.conn-grid > .conn-card.open { grid-column:1 / -1; }
.add-row { display:flex; gap:6px; margin-top:9px; padding-top:9px; border-top:1px dashed var(--div); }
.add-row input { flex:1; min-width:0; padding:6px 9px; border-radius:4px; background:var(--deep); border:1px solid var(--bd-ctl); color:var(--text); font-size:calc(12px * var(--ui-fs, 1)); }
.cc-open { cursor:pointer; } .cc-open:hover .cc-t { color:var(--accent2); }

#cd-back { color:var(--accent2); background:none; border:none; cursor:pointer; font-size:calc(12.5px * var(--ui-fs, 1)); margin-bottom:6px; }
.cd-head { display:flex; align-items:baseline; gap:12px; margin:6px 0 4px; }
.cd-title { font-size:calc(20px * var(--ui-fs, 1)); font-weight:650; }
.cd-head a { color:var(--accent2); text-decoration:none; }
/* Grok-style Skills cards + Information block */

/* running-tasks strip (non-blocking, stoppable) */
.task-strip { display:flex; flex-wrap:wrap; gap:8px; padding:8px 20px; border-bottom:1px solid var(--line); }
.task-chip { display:inline-flex; align-items:center; gap:8px; max-width:360px; background:var(--card2); border:1px solid var(--line); border-radius:4px; padding:6px 10px; font-size:calc(12px * var(--ui-fs, 1)); }
.task-chip .tc-dot { width:7px; height:7px; border-radius:2px; background:var(--green); animation:workpulse 1.3s ease-in-out infinite; flex:none; }
.task-chip .tc-t { color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.task-chip .tc-stop { color:var(--muted); background:none; border:none; cursor:pointer; font-size:calc(12px * var(--ui-fs, 1)); } .task-chip .tc-stop:hover { color:var(--err); }

/* "Working on it" busy status line (animated avatar) */
.working { display:flex; align-items:center; gap:10px; padding:4px 2px; color:var(--muted); font-size:calc(13px * var(--ui-fs, 1)); align-self:flex-start; }
.working .av { width:26px; height:26px; animation: workpulse 1.4s ease-in-out infinite; }
@keyframes workpulse { 0%,100%{ transform:scale(1); opacity:.85; } 50%{ transform:scale(1.12); opacity:1; } }
.working .wdots::after { content:""; animation: wdots 1.4s steps(4,end) infinite; }
@keyframes wdots { 0%{content:"";} 25%{content:"·";} 50%{content:"··";} 75%{content:"···";} }
.conn-card { background:var(--card2); border:1px solid var(--line); border-radius:4px; padding:14px 16px; }
.conn-card.cc-open { cursor:pointer; }
.conn-card.cc-open:hover { border-color:var(--scroll2); background:var(--hover); }
.conn-card .cc-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:0; gap:10px; }
.conn-card .cc-left { display:flex; align-items:center; gap:11px; min-width:0; }
.conn-card .cc-meta { min-width:0; }
.conn-card .cc-t { font-weight:600; font-size:calc(14.5px * var(--ui-fs, 1)); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.conn-card .cc-btn { flex:none; padding:7px 16px; text-decoration:none; }
.conn-card .cc-left { flex:1; }
.conn-card .cc-meta { flex:1; overflow:hidden; }
.conn-card .cc-meta .s { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.conn-card .cc-acts { flex:none; display:flex; align-items:center; gap:8px; }
.conn-card .ca-rm { background:none; border:none; color:var(--muted); cursor:pointer; font-size:calc(12px * var(--ui-fs, 1)); padding:4px; }
.conn-card .ca-rm:hover { color:var(--err); }
.conn-card .cc-client { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); background:none; border:none; padding:0 4px; cursor:pointer; white-space:nowrap; }
.conn-card .cc-client:hover { color:var(--accent2); }
/* category tabs + headers (original Apps layout) */
.conn-cats { display:flex; gap:7px; margin-bottom:10px; flex-wrap:wrap; align-items:center; }
.conn-cats .fbtn { border:1px solid var(--line); border-radius:4px; }
.conn-cat-h .conn-refresh { margin-left:auto; color:var(--muted); }
.conn-note { margin:10px 2px 14px; }
.conn-cat-sec { margin-bottom:18px; }
.conn-cat-h { font-size:calc(12px * var(--ui-fs, 1)); text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:600;
  margin:4px 2px 10px; display:flex; align-items:center; gap:10px; }
.conn-cat-h .conn-h-act { text-transform:none; letter-spacing:0; font-weight:500; font-size:calc(12px * var(--ui-fs, 1)); color:var(--accent2);
  text-decoration:none; background:none; border:none; padding:0; cursor:pointer; }
.conn-cat-h .conn-h-act:hover { text-decoration:underline; }
.conn-cat-sec .cx-form { margin-bottom:12px; }
.set-label .set-link { margin-left:8px; text-transform:none; letter-spacing:0; color:var(--accent2);
  text-decoration:none; font-size:calc(12px * var(--ui-fs, 1)); }
.set-label .set-link:hover { text-decoration:underline; }
.cc-ico { width:30px; height:30px; border-radius:4px; flex:none; background:#fff; border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center; overflow:hidden; }
.cc-ico img { width:19px; height:19px; object-fit:contain; display:block; }
.cc-ico.letter { background:var(--iconbtn); border-color:transparent; }
/* HR's Connect card rows (cardConnectApps) */
.ca-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-top:1px solid var(--line); }
.ca-row .cc-meta { flex:1; min-width:0; }
.ca-ok { color:var(--ok, #2e7d32); font-weight:600; white-space:nowrap; }
.cc-ico.letter::after { content:attr(data-l); font-size:calc(13px * var(--ui-fs, 1)); font-weight:700; color:var(--muted); }
.cdot { width:8px; height:8px; border-radius:2px; background:var(--scroll2); flex:none; }
.cdot.on { background:var(--green); box-shadow:0 0 6px var(--green); }

.gtabs { display:flex; gap:8px; margin:10px 0; flex-wrap:wrap; }
.gtabs button { font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--muted); background:var(--hover); border:1px solid var(--line); border-radius:4px; padding:5px 11px; }
.gtabs button.active { background:var(--bubble2); color:var(--text); }

/* ---------- Settings screen (app.js openSettings): section list + one section ----------
   A page (Nov 10): the list is the sidebar (#st-side), the section the middle (#st-page).
   Phone: the list is the screen; a section slides over it (main.pg-show).
   Each group has a tone: its icon tiles and the current-section marker use it. */
:root, :root[data-theme="dark"] { --ok-ink:#5cd08a; }
:root[data-theme="light"] { --ok-ink:#12703f; }   /* --green is 3.5:1 on light grey; chips need 4.5:1 */
[data-tone="team"] { --tone:var(--green); } [data-tone="conn"] { --tone:var(--accent2); } [data-tone="ws"] { --tone:var(--warn); }
.st-nav { flex:1; display:flex; flex-direction:column; min-height:0; }
.st-back { display:none; }
.st-find { position:relative; margin:2px 0 6px; }
.st-find .st-find-ic { position:absolute; left:11px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--muted); pointer-events:none; }
.st-search { width:100%; background:var(--input); color:var(--text); border:1px solid var(--line); padding:9px 11px 9px 35px; font:inherit;
  font-size:calc(13.5px * var(--ui-fs, 1)); outline:none; min-height:40px; border-radius:2px; }
.st-search:focus { border-color:var(--accent2); }
.st-list { flex:1; min-height:0; overflow-y:auto; padding:0 0 18px; }
.st-grp { margin-top:12px; }
.st-grp-h { font:400 calc(11.5px * var(--ui-fs, 1))/1.2 var(--px-font); letter-spacing:.05em; color:var(--muted); padding:8px 12px 6px; }
.st-item { display:flex; align-items:center; gap:12px; width:100%; min-height:54px; padding:8px 10px 8px 12px; text-align:left;
  border-radius:2px; position:relative; color:var(--text); }
.st-item:hover { background:var(--hover); }
.st-item[aria-current="page"] { background:var(--sel); }
.st-item[aria-current="page"]::before { content:""; position:absolute; left:0; top:9px; bottom:9px; width:3px; background:var(--tone); }
.st-ico, .st-head-ico { flex:none; display:grid; place-items:center; width:36px; height:36px; color:var(--tone);
  background:color-mix(in srgb, var(--tone) 13%, transparent); border:2px solid color-mix(in srgb, var(--tone) 50%, transparent); }
.st-item[aria-current="page"] .st-ico, .st-head-ico { background:var(--tone); border-color:var(--tone); color:var(--bg);
  box-shadow:2px 2px 0 color-mix(in srgb, var(--tone) 45%, #000); }
.st-ico svg { width:20px; height:20px; }
.st-it { display:flex; flex-direction:column; gap:1px; min-width:0; flex:1; }
.st-nm { font-weight:600; font-size:calc(14px * var(--ui-fs, 1)); line-height:1.3; }
.st-dc { font-size:calc(12px * var(--ui-fs, 1)); line-height:1.4; color:var(--muted); }
.st-in { white-space:nowrap; }
.st-chev { display:none; flex:none; color:var(--muted); transform:scaleX(-1); }
.st-item-q .st-ico { --tone:var(--muted); }
.st-main { display:flex; flex-direction:column; min-width:0; min-height:0; background:var(--sidebar); }
.st-head { display:flex; align-items:center; gap:14px; padding:20px 26px 16px; border-bottom:1px solid var(--line); flex:none; }
.st-head-ico { width:44px; height:44px; }
.st-head-ico svg { width:20px; height:20px; }
.st-head-t { flex:1; min-width:0; }
#st-title { margin:0; font:400 calc(19px * var(--ui-fs, 1))/1.25 var(--px-font); letter-spacing:.03em; outline:none; }
.st-act { flex:none; white-space:nowrap; min-height:40px; }
#st-page #gbody { padding:8px 26px 28px; }
#st-page #gbody > .conn-sticky:first-child { margin-top:-8px; padding-top:12px; }
/* pin flush under the header: top:0 sticks inside #gbody's top padding, and rows scrolled through that gap */
#st-page #gbody .conn-sticky { top:-8px; }
/* the header's primary action replaces the in-list "+" / bottom buttons */
#st-page #ppl-add { display:none; }   /* Agents keeps its compact Add agent button on the page (Nov 8) */
#st-page .skill-searchrow .conn-search { margin-right:0; }
.st-item:focus-visible, .st-back:focus-visible, .pg-back:focus-visible, .st-act:focus-visible { outline:2px solid var(--accent2); outline-offset:-2px; }
/* empty states: say what to do next */
.st-empty { margin:10px 0; padding:16px 16px; border:2px dashed var(--line); color:var(--muted); font-size:calc(13px * var(--ui-fs, 1)); line-height:1.5; max-width:62ch; }
.st-empty b { color:var(--text); font-weight:600; }
/* a search result's setting, marked for a moment */
.st-flash { outline:2px solid var(--warn); outline-offset:4px; animation:st-flash 1.6s steps(4) forwards; }
@keyframes st-flash { 0%, 75% { outline-color:var(--warn); } 100% { outline-color:transparent; } }
/* status chips — one look for Connected / Ready (ok), Needs setup / Limit (warn), Not signed in (bad),
   Coming soon (soon), in every section */
.st-chip, #st-page .acc-ok, #st-page .acc-warn, #st-page .acc-bad, #st-page .tpl-soon, #st-page .acc-pill {
  display:inline-block; padding:1px 7px; border:1px solid currentColor; border-radius:0; font-size:calc(11px * var(--ui-fs, 1));
  font-weight:600; line-height:1.5; white-space:nowrap; vertical-align:1px; background:transparent; }
.st-chip.ok, #st-page .acc-ok { color:var(--ok-ink); }
.st-chip.warn, #st-page .acc-warn { color:var(--warn); }
/* a warning sentence, not a chip: wrap it (nowrap ran it off the screen) */
#st-page .acc-note.acc-warn { display:block; white-space:normal; overflow-wrap:anywhere; padding:8px 10px; line-height:1.45; font-weight:400; }
.st-chip.bad, #st-page .acc-bad { color:var(--err); }
.st-chip.soon, #st-page .tpl-soon { color:var(--muted); border-style:dashed; }
#st-page .acc-pill { color:var(--accent2); }
@media (max-width:820px), (max-height:500px) and (pointer:coarse){
  .st-back, .pg-back { display:grid; place-items:center; flex:none; width:44px; height:44px; color:var(--text); }
  .st-find { margin:2px 6px 4px; }
  .st-search { min-height:46px; font-size:calc(16px * var(--ui-fs, 1)); }
  .st-list { padding:0 8px calc(24px + env(safe-area-inset-bottom)); }
  .st-item { min-height:66px; padding:10px 8px 10px 12px; }
  .st-chev { display:block; }
  .st-main { height:100%; }
  /* back · title · action on one row */
  .st-head { display:grid; grid-template-columns:44px minmax(0,1fr) auto; align-items:center; column-gap:6px; padding:6px 16px 12px 4px; }
  .st-head-ico { display:none; }
  .st-head-t { display:contents; }
  #st-title { grid-column:2; grid-row:1; }
  .st-act { grid-column:3; grid-row:1; }
  #st-title { font-size:calc(18px * var(--ui-fs, 1)); }
  .st-act { min-height:44px; padding:8px 12px; }
  #st-page #gbody { padding:6px 15px calc(24px + env(safe-area-inset-bottom)); }
  #st-page #gbody .conn-sticky { top:-6px; }
}
@media (prefers-reduced-motion: reduce){
  .st-nav, .st-nav *, #st-page, #st-page * { transition:none !important; animation:none !important; scroll-behavior:auto !important; }
}
/* chips */
.chip { display:inline-flex; align-items:center; gap:6px; font-size:calc(11px * var(--ui-fs, 1)); background:var(--input); border:1px solid var(--line);
  border-radius:4px; padding:3px 8px; margin:0 5px 6px 0; color:var(--text); }
.chip button { background:none; border:none; color:var(--err); cursor:pointer; font-size:calc(12px * var(--ui-fs, 1)); padding:0; line-height:1; }
.chip.add { cursor:pointer; color:var(--green); border-color:var(--line); } .chip.add:hover { background:var(--green); color:var(--ongreen); }
.ed-label { display:block; font-size:calc(12px * var(--ui-fs, 1)); text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin:16px 0 6px; }

/* collapsed = narrow avatar rail (Grok-style), toggle stays visible to expand */
main.sb-collapsed { grid-template-columns:68px 1fr var(--dt-w,360px); }
#sidebar.collapsed .sb-top { flex-direction:column; align-items:center; gap:10px; }
#sidebar.collapsed .sb-top .sp { display:none; }
#sidebar.collapsed #sb-search, #sidebar.collapsed .sp, #sidebar.collapsed #new-chat,
#sidebar.collapsed .pinned .nm, #sidebar.collapsed .pinned .dt,
#sidebar.collapsed .row-agent .mid, #sidebar.collapsed .row-agent .dot,
#sidebar.collapsed .pinned .star, #sidebar.collapsed .connect span, #sidebar.collapsed .me { display:none; }
#sidebar.collapsed .row-agent, #sidebar.collapsed .pinned { justify-content:center; padding-left:0; padding-right:0; }
#sidebar.collapsed .pinned { border-bottom:none; padding:8px 0; margin-bottom:2px; }
#sidebar.collapsed .pinned .av { width:40px; height:40px; }
#sidebar.collapsed .pinned > div[style] { position:static !important; transform:none !important; }
#sidebar.collapsed .connect { justify-content:center; padding:9px 0; }
#sidebar.collapsed .sb-list { padding:6px 6px 10px; }
#sidebar.collapsed #rows, #sidebar.collapsed .ag-find { display:none; }   /* rail shows only the pinned agent */
/* collapsed rail: pinned CoS shrinks to row-avatar size, no name/overflow */
#sidebar.collapsed .pin-grid, #sidebar.collapsed .pin-grid[data-count="1"] { grid-template-columns:1fr !important; padding:8px 0; justify-items:center; }
#sidebar.collapsed .pin-grid .av, #sidebar.collapsed .pin-grid[data-count="1"] .av { width:40px !important; height:40px !important; }
#sidebar.collapsed .pin-grid .pin-cell.pin-hr { padding:2px; }
#sidebar.collapsed .pin-grid .pin-cell.pin-hr .av { width:24px !important; height:24px !important; }
#sidebar.collapsed .pin-cell.pin-hr.unread .dot { position:absolute; top:0; right:0; width:6px; height:6px; }
#sidebar.collapsed .pin-nm, #sidebar.collapsed .pin-x, #sidebar.collapsed .pin-hint { display:none !important; }

.tree ul { list-style:none; margin:0; padding-left:14px; border-left:1px solid var(--line); }
.tree li { padding:2px 0; font-size:calc(12.5px * var(--ui-fs, 1)); } .tree .lead{color:var(--green);font-weight:600} .tree .cos{color:var(--warn);font-weight:700}

/* ---------- Settings ---------- */
.set-section { margin-top:16px; max-width:460px; }
/* General on the Settings page: one section per row across the full width (owner, Nov 11: "1 column
   per section", not 3 columns), theme cards in a row */
#st-page #gbody[data-st="general"] { display:grid; grid-template-columns:minmax(0, 1fr); gap:4px; align-content:start; }
#st-page #gbody[data-st="general"] > * { min-width:0; }
#st-page #gbody[data-st="general"] .set-section { max-width:none; }
#st-page #gbody[data-st="general"] .set-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); }
#st-page #gbody[data-st="general"] .set-select { max-width:none; }
/* every Settings section uses the page's width (owner, Nov 10); long help text stays readable */
#st-page .set-section, #st-page .set-select { max-width:none; }
#st-page .biz-intro { max-width:100ch; }
/* Billing (folded into General, owner Nov 10) */
#st-page .gen-billing { min-width:0; }
.acct-switch { margin:4px 0 14px; max-width:none; }
.acct-switch-row { display:flex; gap:8px; align-items:center; margin-bottom:6px; }
.acct-switch-row select { flex:1; min-width:0; }
.acct-switch-row .btn { flex:none; white-space:nowrap; }
.one-cmd { background:var(--deep); border:1px solid var(--line); border-radius:4px; padding:14px 16px; margin-top:6px; display:flex; align-items:flex-start; gap:10px; }
.one-cmd code { flex:1; white-space:pre-wrap; word-break:break-all; font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--text); line-height:1.6; }
.verdict { display:flex; gap:11px; align-items:flex-start; border-radius:4px; padding:13px 15px; margin-bottom:4px; font-size:calc(13px * var(--ui-fs, 1)); line-height:1.5; }
.verdict.ok   { background:var(--okbg); border:1px solid var(--green); }
.verdict.warn { background:var(--hover); border:1px solid var(--line); }
.verdict .v-ic { flex:none; width:22px; height:22px; border-radius:2px; display:flex; align-items:center; justify-content:center; font-size:calc(13px * var(--ui-fs, 1)); font-weight:700; }
.verdict.ok   .v-ic { background:var(--green); color:var(--ongreen); }
.verdict.warn .v-ic { background:var(--line); color:var(--text); }
.verdict .v-list { margin:6px 0 0; padding-left:18px; }
.verdict .v-list li { margin:2px 0; color:var(--muted); }
.verdict code { background:var(--deep); border:1px solid var(--line); border-radius:3px; padding:0 4px; font-size:calc(11px * var(--ui-fs, 1)); }
.set-label { font-size:calc(12px * var(--ui-fs, 1)); text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin-bottom:10px; }
.set-select { width:100%; max-width:320px; background:var(--bubble); color:var(--text); border:1px solid var(--bd-ctl);
  border-radius:4px; padding:9px 11px; font:inherit; font-size:calc(14px * var(--ui-fs, 1)); outline:none; cursor:pointer; }
.set-grid { display:flex; flex-direction:column; gap:8px; }
.set-opt { display:flex; align-items:center; gap:13px; padding:12px 14px; border-radius:4px;
  border:1px solid var(--line); background:var(--input); cursor:pointer; }
.set-opt:hover { background:var(--hover); }
.set-opt.active { border-color:var(--accent); background:var(--hover); }
.set-swatch { width:38px; height:38px; border-radius:4px; flex:none; border:1px solid var(--line); }
.set-swatch.sw-dark { background:linear-gradient(135deg,#1c1c20 50%,#0d0d0f 50%); }
.set-swatch.sw-light { background:linear-gradient(135deg,#ffffff 50%,#e3e3e9 50%); }
.set-swatch.sw-system { background:linear-gradient(135deg,#ffffff 50%,#0d0d0f 50%); }
.set-meta { flex:1; min-width:0; }
.set-nm { font-size:calc(14px * var(--ui-fs, 1)); font-weight:560; }
.set-dc { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); margin-top:1px; }
.set-tick { color:var(--accent); font-size:calc(15px * var(--ui-fs, 1)); width:16px; text-align:center; flex:none; }

/* help / onboarding box */
.help-box { background:var(--input); border:1px solid var(--line); border-radius:4px; padding:14px 16px; margin-top:4px; }
.help-t { font-size:calc(13px * var(--ui-fs, 1)); font-weight:600; margin-bottom:10px; }
.help-step { display:flex; gap:11px; align-items:flex-start; font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--muted); line-height:1.5; margin-bottom:9px; }
.help-step:last-child { margin-bottom:0; }
.help-n { flex:none; width:20px; height:20px; border-radius:2px; background:var(--bubble2); color:var(--text);
  font-size:calc(11px * var(--ui-fs, 1)); font-weight:700; display:flex; align-items:center; justify-content:center; margin-top:1px; }
.help-box code { background:var(--deep); border:1px solid var(--line); border-radius:3px; padding:1px 5px; font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--text); }
.cmd { display:inline-flex; align-items:center; gap:5px; }
.copy-btn { background:var(--bubble2); border:1px solid var(--line); border-radius:3px; color:var(--muted);
  font-size:calc(12px * var(--ui-fs, 1)); line-height:1; padding:3px 6px; cursor:pointer; }
.copy-btn:hover { color:var(--text); background:var(--iconbtn); }
.copy-btn.ok { color:var(--green); border-color:var(--green); }

/* skills: search row with + create button */
.skill-searchrow { display:flex; gap:8px; align-items:stretch; margin-bottom:10px; }
.skill-searchrow .conn-search { margin-bottom:0; }
.skill-add { flex:none; width:42px; border-radius:4px; background:var(--green); color:var(--ongreen);
  display:flex; align-items:center; justify-content:center; border:none; cursor:pointer; }
.skill-add:hover { background:var(--green2); }
/* searchable list rows (agents, accounts) */
.agent-row, .acct-row { display:flex; align-items:center; justify-content:space-between; gap:10px; cursor:pointer;
  padding:11px 10px; border-radius:4px; border-bottom:1px solid var(--div); }
.agent-row:hover, .acct-row:hover { background:var(--hover); }
.agent-row.arch { opacity:.6; }
.agent-row .ar-main, .acct-row .ar-main { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.agent-row .go, .acct-row .go { flex:none; }
.skill-add.alt { width:auto; padding:0 14px; background:var(--bubble2); color:var(--text); font-size:calc(13px * var(--ui-fs, 1)); font-weight:560; }
.skill-add.alt:hover { background:var(--iconbtn); }

/* ---------- custom themed select (searchable dropdown) ---------- */
.cs { position:relative; flex:0 0 auto; width:100%; min-width:0; }
.cs-trigger { width:100%; display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:9px 11px; border-radius:4px; background:var(--input); border:1px solid var(--line);
  color:var(--text); font:inherit; font-size:calc(13.5px * var(--ui-fs, 1)); cursor:pointer; text-align:left; }
.cs-trigger:hover { border-color:var(--scroll2); }
.cs.open .cs-trigger { border-color:var(--accent); }
.cs-val { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cs-val.ph { color:var(--muted); }
.cs-car { color:var(--muted); flex:none; transition:transform .15s ease; }
.cs.open .cs-car { transform:rotate(180deg); }
.cs-pop { position:absolute; top:calc(100% + 5px); left:0; right:0; z-index:70;
  background:var(--panel); border:1px solid var(--line); border-radius:4px; padding:6px;
  box-shadow:0 10px 30px var(--shadow); max-height:280px; display:flex; flex-direction:column; }
.cs-search { width:100%; padding:8px 10px; margin-bottom:6px; border-radius:4px; flex:none;
  background:var(--deep); border:1px solid var(--line); color:var(--text); font:inherit; font-size:calc(13px * var(--ui-fs, 1)); outline:none; }
.cs-search:focus { border-color:var(--accent); }
.cs-list { overflow-y:auto; min-height:0; display:flex; flex-direction:column; gap:1px; }
.cs-row { flex:none; padding:8px 10px; border-radius:3px; font-size:calc(13px * var(--ui-fs, 1)); line-height:1.3; cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cs-row:hover { background:var(--hover); }
.cs-row.sel { background:var(--sel); color:var(--text); font-weight:560; }
.cs-empty { padding:10px; font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--muted); text-align:center; }

/* ======================= Mobile (end-to-end) ======================= */
.m-back { display:none; }
@media (max-width:820px), (max-height:500px) and (pointer:coarse){
  main, main.sb-collapsed, main.dt-wide, main.dt-rail, main.dt-hidden { grid-template-columns:minmax(0,1fr) !important; }
  #sidebar, #sidebar.collapsed { width:100% !important; border-right:none; }
  .resizer, #sb-toggle, .dt-rail-nav { display:none !important; }
  .sb-top { padding:12px 14px 6px; }

  /* list is the home view; chat slides over it, detail slides over chat */
  /* off screen = out of the Tab order too (mobile-a11y C5c): hidden once the slide-out ends, shown at once on open */
  #chat { position:fixed; inset:0; z-index:100; background:var(--bg); visibility:hidden;
    transform:translateX(100%); transition:transform .25s ease, visibility 0s linear .25s; will-change:transform; }
  main.show-chat #chat { transform:translateX(0); visibility:visible; transition:transform .25s ease, visibility 0s; }
  .m-back { display:flex; position:absolute; top:12px; left:12px; z-index:8;
    width:40px; height:40px; border-radius:2px; align-items:center; justify-content:center;
    color:var(--text); background:var(--elev); border:1px solid var(--line); box-shadow:0 2px 10px var(--shadow); }
  .chat-head { padding-left:60px; }          /* clears the back button (.m-back) */
  /* tap targets >= 40x40 on a phone: Send (32), the Jobs kind tabs (29 tall) (frontend full7 FE7-B3d) */
  .composer .ic.send, .jobs-chip { min-width:40px; min-height:40px; }
  .m-back { top:7px; }
  .feed-wrap { padding:0 16px; }
  .composer form { margin:0 12px; }

  /* agent panel (owner, Nov 8): full screen on a phone, one scroll for the whole panel, a sticky
     Back bar on top; desktop keeps the right-side panel */
  #detail { position:fixed; inset:0; width:100vw; max-width:none; height:100dvh; z-index:220;
    transform:translateX(100%); transition:transform .25s ease; border-left:none;
    display:block; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
  main.dt-open #detail { transform:translateX(0); }
  #detail .dt-top { position:sticky; top:0; z-index:3; background:var(--sidebar); border-bottom:1px solid var(--line);
    justify-content:flex-start; padding:8px 12px; padding-top:calc(8px + env(safe-area-inset-top)); margin-bottom:10px; }
  #detail #dt-expand { display:none; }
  .dt-back { display:inline-flex; align-items:center; gap:6px; min-height:40px; padding:0 12px 0 6px; border-radius:2px;
    background:transparent; border:1px solid transparent; color:var(--text); font:inherit; font-size:calc(14px * var(--ui-fs, 1)); cursor:pointer; }
  .dt-back:active, .dt-back:hover { background:var(--hover); }
  #detail .dt-body { overflow:visible; padding-bottom:calc(24px + env(safe-area-inset-bottom)); }
  /* the work room's Goal / Done / Now line (owner, Nov 8: "leaves very little room") — off on a phone */
  .th-room { display:none !important; }
  #scrim { position:fixed; inset:0; background:var(--overlay); z-index:200; }

  /* Settings modal → fullscreen sheet */
  #modal { padding:0; }
  .modal-box { width:100vw; height:100dvh; max-width:none; border-radius:0; padding:18px 15px;
    padding-top:calc(18px + env(safe-area-inset-top)); padding-bottom:calc(18px + env(safe-area-inset-bottom)); }
  #modal-x { top:calc(6px + env(safe-area-inset-top)); right:6px; }
  .conn-grid { grid-template-columns:minmax(0,1fr); }
  .gtabs { overflow-x:auto; flex-wrap:nowrap; -webkit-overflow-scrolling:touch; padding-bottom:2px; }
  .gtabs button { flex:none; }
  .instr { max-height:none; }
}
@media (max-width:420px){
  .pin-grid[data-count="1"] .av { width:64px; height:64px; }
  .skill-add.alt { padding:0 10px; }
}

/* ======================= Universal search ======================= */
#search-modal { position:fixed; inset:0; z-index:400; background:var(--overlay); display:flex; align-items:flex-start; justify-content:center; padding:7vh 0; }
.search-box { width:80vw; height:80vh; max-width:none; background:var(--sidebar); border:1px solid var(--line);
  border-radius:4px; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 20px 60px var(--shadow); }
.search-head { display:flex; align-items:center; gap:10px; padding:16px 18px; border-bottom:1px solid var(--line); color:var(--muted); }
#search-input { flex:1; min-width:0; background:none; border:none; outline:none; color:var(--text); font:inherit; font-size:calc(17px * var(--ui-fs, 1)); }
#search-input::placeholder { color:var(--muted); }
#search-x { color:var(--muted); font-size:calc(15px * var(--ui-fs, 1)); } #search-x:hover { color:var(--text); }
.search-results { flex:1; min-height:0; overflow-y:auto; padding:8px; }
.sr-cat { font-size:calc(11px * var(--ui-fs, 1)); text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:700; padding:12px 10px 6px; }
.sr-row { display:flex; align-items:center; gap:12px; padding:9px 11px; border-radius:4px; cursor:pointer; }
.sr-row:hover, .sr-row.sr-active { background:var(--hover); }
.sr-row .av { width:34px; height:34px; flex:none; }
.sr-ic { width:34px; height:34px; flex:none; display:flex; align-items:center; justify-content:center; font-size:calc(16px * var(--ui-fs, 1)); border-radius:4px; background:var(--bubble2); }
.sr-ic .cc-ico { width:34px; height:34px; }
.sr-main { min-width:0; flex:1; }
.sr-t { font-size:calc(14px * var(--ui-fs, 1)); font-weight:560; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sr-d { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sr-empty { padding:22px; text-align:center; color:var(--muted); font-size:calc(13px * var(--ui-fs, 1)); }
.empty-cta { color:var(--accent2); }   /* the empty-state ask link: the default link blue fails AA on dark (b6a) */
@media (max-width:820px), (max-height:500px) and (pointer:coarse){ .search-box { width:100vw; height:100dvh; border-radius:0; } #search-modal { padding:0; } }
.search-tabs { display:flex; gap:7px; padding:11px 16px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.search-tabs .fbtn { border:1px solid var(--line); border-radius:4px; }
.search-tabs .fbtn.active { background:var(--bubble2); color:var(--text); }

/* themed confirm dialog */
.confirm-scrim { position:fixed; inset:0; z-index:500; background:var(--overlay); display:flex; align-items:center; justify-content:center; }
.confirm-box { background:var(--elev); border:1px solid var(--line); border-radius:4px; padding:20px; max-width:360px; width:90%; box-shadow:0 20px 50px var(--shadow); }
.confirm-msg { font-size:calc(14px * var(--ui-fs, 1)); line-height:1.5; margin-bottom:16px; }
.confirm-btns { display:flex; justify-content:flex-end; gap:9px; }
.confirm-btns .btn { background:var(--bubble2); }

/* Manages grouped by section */
.mg-sec { margin-bottom:10px; }
.mg-h { font-size:calc(10.5px * var(--ui-fs, 1)); text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:600; margin:4px 0 6px; }
.dt-scroll { max-height:200px; overflow-y:auto; border:1px solid var(--line); border-radius:4px; padding:10px; background:var(--input); }
/* collapsible Skills/Memory sections in Details */
.dt-h { cursor:pointer; display:flex; align-items:center; gap:6px; }
.dt-h .dt-caret { color:var(--muted); font-size:calc(11px * var(--ui-fs, 1)); transition:transform .12s; }
.dt-h.dd-collapsed .dt-caret { transform:rotate(-90deg); }
.dt-h .go { margin-left:auto; }
.dt-ddbody.collapsed { display:none; }
/* change log data table */
.cl-tbl { border-collapse:collapse; width:100%; font-size:calc(12.5px * var(--ui-fs, 1)); }
.cl-tbl th, .cl-tbl td { border-bottom:1px solid var(--div); padding:8px 10px; text-align:left; vertical-align:top; }
.cl-tbl thead th { position:sticky; top:0; z-index:1; background:var(--elev); color:var(--muted); font-weight:600; font-size:calc(11px * var(--ui-fs, 1)); text-transform:uppercase; letter-spacing:.3px; }
.cl-tbl tbody tr:hover { background:var(--bubble2); }
.cl-tbl td { overflow-wrap:anywhere; }
.cl-tbl .cl-nowrap { white-space:nowrap; color:var(--muted); }
.dt-scroll .mg-sec:last-child { margin-bottom:0; }
.cd-head { display:flex; align-items:center; gap:11px; }

/* ---- Per-agent task lists + change log (native) ---- */
.sb-bottom-split { gap:6px; }
.sb-bottom-split .connect { flex:1; min-width:0; justify-content:center; }
.sb-bottom-split .connect span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* footer nav (Nov 8): Agents · Library · Jobs · Settings; plain text buttons, one size of icon
   and label, the current screen gets a subtle fill. Settings is icon only */
.sb-foot { gap:2px; padding:6px 8px; align-items:stretch; }
/* Agents / Library / Jobs: three equal-width buttons (flex-basis 0), full labels never cut (owner, Nov 9) */
.sbf-btn { flex:1 1 0; min-width:max-content; min-height:40px; display:flex; align-items:center; justify-content:center; gap:6px;
  padding:0 6px; border-radius:4px; color:var(--muted); font-size:calc(13px * var(--ui-fs, 1)); font-weight:500; white-space:nowrap; }
.sbf-btn svg { flex:none; }
.sbf-btn:hover { color:var(--text); background:var(--hover); }
.sbf-btn.active { color:var(--text); background:var(--bubble2); }
.sbf-btn.sbf-icon { flex:0 0 40px; padding:0; }
#sidebar.collapsed .sb-foot { flex-direction:column; padding:6px; }
#sidebar.collapsed .sbf-btn > span { display:none; }
/* Settings › pause: a quiet icon at the right of the header line (owner only) */
#st-pause { margin-left:auto; flex:none; display:grid; place-items:center; width:40px; height:40px; padding:0;
  background:none; border:0; border-radius:2px; color:var(--muted); opacity:.8; cursor:pointer; }
#st-pause:hover, #st-pause:focus-visible { color:var(--text); opacity:1; }
#st-pause:focus-visible { outline:2px solid var(--accent2); outline-offset:1px; }
.st-pause .sp-play { display:none; }
body.swarm-paused .st-pause, body.routines-paused .st-pause { color:var(--warn); opacity:1; }
body.swarm-paused .st-pause .sp-pause, body.routines-paused .st-pause .sp-pause { display:none; }
body.swarm-paused .st-pause .sp-play, body.routines-paused .st-pause .sp-play { display:inline; }
body.member .st-pause, body.customer .st-pause { display:none !important; }

.tk-add { display:flex; gap:7px; margin-bottom:12px; }
.tk-add input { flex:1; background:var(--input); border:1px solid var(--bd-ctl); border-radius:4px; padding:7px 10px; color:var(--text); font-size:calc(13px * var(--ui-fs, 1)); }
/* under 16px iOS zooms the page on focus (frontend r1 B3-r1-1) */
@media (max-width:820px), (pointer:coarse){ .tk-add input { font-size:max(16px, calc(13px * var(--ui-fs, 1))); }
  .conn-search { font-size:max(16px, calc(14px * var(--ui-fs, 1))); } }   /* change log, Jobs, Settings searches (frontend full7 FE7-B3e) */
.tk-row { display:flex; align-items:flex-start; gap:10px; padding:9px 0; border-bottom:1px solid var(--div); }
.tk-chk { width:18px; height:18px; flex:none; margin-top:1px; border:1.6px solid var(--muted); border-radius:3px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:calc(12px * var(--ui-fs, 1)); color:var(--green); line-height:1; transition:background .12s,border-color .12s; }
.tk-chk:hover { border-color:var(--green); }
.tk-done .tk-chk { background:var(--green); border-color:var(--green); color:var(--ongreen); }
.tk-main { min-width:0; } .tk-t { font-size:calc(13.5px * var(--ui-fs, 1)); } .tk-s { font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); margin-top:2px; }
.tk-verifying { color:var(--accent, #2f7de1); font-weight:600; }
.tk-done .tk-t { text-decoration:line-through; color:var(--muted); }
.tk-overdue { color:var(--err); font-weight:600; }
#sprint-view { position:absolute; inset:0; z-index:300; background:var(--bg); display:none; flex-direction:column;
  padding:calc(10px + env(safe-area-inset-top)) 16px calc(14px + env(safe-area-inset-bottom)); }
#sprint-view.on { display:flex; }
body.sv-lock { overflow:hidden; }
.sv-top { display:flex; align-items:flex-start; gap:12px; flex:none; padding:6px 0 12px; }
.sv-prog { flex:1; font-size:calc(12px * var(--ui-fs, 1)); font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.sv-bar { height:4px; border-radius:4px; background:var(--line); margin-top:8px; overflow:hidden; }
.sv-bar i { display:block; height:100%; background:var(--green); border-radius:4px; transition:width .3s; }
.sv-x { width:36px; height:36px; border-radius:4px; color:var(--muted); font-size:calc(17px * var(--ui-fs, 1)); flex:none; }
.sv-x:hover { background:var(--hover); color:var(--text); }
.sv-body { flex:1; overflow-y:auto; display:flex; flex-direction:column; -webkit-overflow-scrolling:touch; }
.sv-card { max-width:720px; width:100%; margin:0 auto; padding:20px 18px; }
.sv-card h4 { font-size:calc(21px * var(--ui-fs, 1)); line-height:1.3; margin:4px 0 8px; }
.sv-card .dc-detail { font-size:calc(14.5px * var(--ui-fs, 1)); }
.sv-card .opt { padding:15px 14px; font-size:calc(15.5px * var(--ui-fs, 1)); }
.sv-card .dc-kicker .dc-full, .dc-card .dc-full { float:right; text-transform:none; letter-spacing:0; font-weight:500; color:var(--accent2); cursor:pointer; }
.sv-card.dc-collapsed { opacity:.6; }
.sv-done { margin:auto; text-align:center; display:flex; flex-direction:column; gap:10px; align-items:center; }
.sv-parked { width:100%; max-width:560px; text-align:left; display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.sv-done-ic { width:56px; height:56px; border-radius:2px; background:var(--okbg); color:var(--green); font-size:calc(28px * var(--ui-fs, 1)); display:flex; align-items:center; justify-content:center; }
.msg-pop .mm-sub { font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); margin-top:2px; }
.msg-pop .mm-sep { height:1px; background:var(--line); margin:6px 8px; }
.msg-pop .mm-h { font-size:calc(11px * var(--ui-fs, 1)); letter-spacing:.06em; text-transform:uppercase; color:var(--muted); padding:4px 14px 2px; }
.tk-tags { display:inline-flex; flex-wrap:wrap; gap:4px; vertical-align:middle; }
.tk-tag { font-size:calc(11px * var(--ui-fs, 1)); line-height:1.5; padding:0 7px; border-radius:3px; border:1px solid var(--line);
  color:var(--muted); cursor:pointer; white-space:nowrap; }
.tk-tag:hover { color:inherit; border-color:currentColor; }
.tk-tag-static, .tk-tag-static:hover { cursor:default; color:var(--muted); border-color:var(--line); }

#mem-modal { position:fixed; inset:0; z-index:400; background:var(--overlay); display:flex; align-items:flex-start; justify-content:center; padding:7vh 0; }
/* search bar (change log, jobs): sits above the scrolling list, so it stays at the top on a phone */
.cl-search { flex:none; padding:8px 14px 0; position:sticky; top:0; z-index:2; background:var(--sidebar); }
.cl-search .conn-search { margin-bottom:8px; }
.changelog-list { flex:1; min-height:0; overflow-y:auto; padding:0 14px 8px; }
.cl-row { padding:11px 4px; border-bottom:1px solid var(--div); }
.cl-s { font-size:calc(13.5px * var(--ui-fs, 1)); } .cl-m { font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); margin-top:3px; }

/* ---- Task priority + snooze ---- */
.tk-row { position:relative; }
.tk-acts { display:flex; gap:2px; opacity:0; align-items:center; }
.tk-row:hover .tk-acts { opacity:1; }
.tk-ic { width:26px; height:24px; border-radius:3px; color:var(--muted); font-size:calc(13px * var(--ui-fs, 1)); display:flex; align-items:center; justify-content:center; }
.tk-ic:hover { background:var(--hover); color:var(--text); }
.tk-snoozed { opacity:.6; }
.tk-priosel { background:var(--input); border:1px solid var(--line); border-radius:4px; color:var(--text); font-size:calc(12.5px * var(--ui-fs, 1)); padding:0 6px; }
.pr-pill { font-size:calc(9.5px * var(--ui-fs, 1)); font-weight:700; letter-spacing:.02em; padding:1px 6px; border-radius:4px; vertical-align:middle; }
.pr-high { color:#ff6b6b; background:rgba(255,107,107,.13); border:1px solid rgba(255,107,107,.4); }
.pr-med  { color:var(--muted); background:var(--bubble2); border:1px solid var(--line); }
.pr-low  { color:var(--muted); background:transparent; border:1px solid var(--line); }

/* ---- Password gate ---- */
#login-overlay { position:fixed; inset:0; z-index:9999; display:flex; align-items:center; justify-content:center;
  background:var(--bg,#0d0d0f); }
#login-card { width:320px; max-width:86vw; display:flex; flex-direction:column; align-items:center; gap:12px;
  padding:34px 30px; background:var(--sidebar,#15151a); border:1px solid var(--line,#26262e); border-radius:4px;
  box-shadow:0 18px 60px rgba(0,0,0,.5); }
#login-card .login-logo { opacity:.95; }
#login-card h2 { margin:2px 0 0; font:400 calc(20px * var(--ui-fs, 1))/1.3 "Silkscreen",ui-monospace,monospace;
  letter-spacing:.02em; color:var(--text,#ececf1); }
#login-card .login-logo img { image-rendering:pixelated; }
#login-card .login-sub { margin:0 0 6px; font-size:calc(13px * var(--ui-fs, 1)); color:var(--muted,#8a8a93); }
#login-pass, #login-name { width:100%; box-sizing:border-box; padding:11px 13px; border-radius:4px; font-size:calc(14px * var(--ui-fs, 1));
  background:var(--input,#1d1d24); border:1px solid var(--line,#2a2a33); color:var(--text,#ececf1); outline:none; }
#login-pass:focus, #login-name:focus { border-color:var(--teal,#2dd4bf); box-shadow:0 0 0 3px rgba(45,212,191,.18); }
#login-btn { width:100%; padding:11px; font-size:calc(14px * var(--ui-fs, 1)); font-weight:600; border-radius:4px; cursor:pointer; }
.login-err { width:100%; text-align:center; font-size:calc(12.5px * var(--ui-fs, 1)); color:#ff6b6b; }
#login-sb { width:100%; display:flex; flex-direction:column; gap:10px; }
#login-sb input { width:100%; box-sizing:border-box; padding:11px 13px; border-radius:4px; font-size:calc(14px * var(--ui-fs, 1));
  background:var(--input,#1d1d24); border:1px solid var(--line,#2a2a33); color:var(--text,#ececf1); outline:none; }
#login-sb input:focus { border-color:var(--teal,#2dd4bf); box-shadow:0 0 0 3px rgba(45,212,191,.18); }
#login-sb .btn { width:100%; padding:11px; font-size:calc(14px * var(--ui-fs, 1)); font-weight:600; border-radius:4px; cursor:pointer; }
#login-gg { width:100%; display:flex; flex-direction:column; gap:10px; }
#login-gg .login-google { display:flex; align-items:center; justify-content:center; gap:9px; }
#login-gg .login-google svg { flex:none; }
.login-or { display:flex; align-items:center; gap:10px; margin:6px 0 2px; color:var(--muted,#8a8a93);
  font-size:calc(12px * var(--ui-fs, 1)); }
.login-or::before, .login-or::after { content:""; flex:1; border-top:1px solid var(--line,#2a2a33); }
.login-sb-msg { text-align:center; font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--muted,#8a8a93); }
.login-sb-msg.bad { color:#ff6b6b; }
.login-terms { margin:2px 0 0; text-align:center; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted,#8a8a93); }
.login-terms a { color:inherit; text-decoration:underline; }
/* hosted sign-in on: Google + email/username only, no owner password box */
#login-pw { display:contents; }
#login-card.hosted #login-pw, #login-card.hosted #login-gg > .login-or { display:none; }
#login-out { width:100%; padding:11px; font-size:calc(14px * var(--ui-fs, 1)); font-weight:600; border-radius:4px; cursor:pointer; }

/* decision-sprint custom-instruction row (last option) */
.dc-customrow { display:flex; gap:8px; align-items:center; margin-top:10px; }
.dc-customrow .dc-custom { margin-top:0; flex:1; min-width:0; }
.dc-customrow .btn { flex:none; }

/* routing hand-off pill (delegate event): a quiet label, not a green banner (Anthony, Oct 29) */
.delegate-pill-wrap { display:flex; flex-direction:column; align-items:center; margin:6px 0; }
.delegate-pill { display:inline-flex; align-items:center; gap:5px; padding:1px 8px; border-radius:3px;
  background:transparent; color:var(--muted); border:1px solid var(--line);
  font-size:calc(11.5px * var(--ui-fs, 1)); font-weight:500; line-height:1.5; letter-spacing:.01em; }
.delegate-pill .dp-arrow { opacity:.6; font-weight:400; }

/* decision-sprint card — richer context */
.dc-card .dc-kicker { font-size:calc(10.5px * var(--ui-fs, 1)); text-transform:uppercase; letter-spacing:.07em; color:var(--green); font-weight:700; margin-bottom:3px; }
.dc-card .dc-meta { color:var(--muted); font-size:calc(12px * var(--ui-fs, 1)); margin-bottom:8px; }
.dc-card .dc-owner { color:var(--green); cursor:pointer; text-decoration:none; }
.dc-card .dc-owner:hover { text-decoration:underline; }
.dc-card .dc-chosen { margin-top:10px; font-size:calc(13px * var(--ui-fs, 1)); font-weight:600; color:var(--green); }
.dc-card .dc-chosen.err { color:var(--err); }
.dc-card .dc-detail { font-size:calc(13px * var(--ui-fs, 1)); color:var(--text); background:var(--bubble2); border-radius:4px; padding:9px 11px; margin:6px 0 10px; line-height:1.45; }
.dc-card .dc-link { display:inline-block; font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--accent2); margin:0 0 10px; }
.dc-card .dc-help { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); margin:4px 0 6px; }
.dc-card .opt-txt { display:flex; flex-direction:column; gap:1px; }
.dc-card .opt-sub { font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); }

/* ========================= Mobile / touch polish ========================= */
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
* { -webkit-tap-highlight-color:transparent; }
#feed, #rows, .dt-body, .modal-box, .search-results, .cd-tlist { -webkit-overflow-scrolling:touch; }
/* stop the browser's own pull-to-refresh/overscroll so ours + the layout stay put */
body, #feed { overscroll-behavior:contain; }

@media (max-width:820px), (max-height:500px) and (pointer:coarse){
  /* safe-area insets for notch / home indicator */
  .sb-top { padding-top:calc(12px + env(safe-area-inset-top)); }
  /* keep a real gap above Android's nav bar / iOS home indicator — env() alone is 0 when
     the browser reports no inset, which left the composer flush against the system bar */
  .composer { padding-bottom:calc(24px + env(safe-area-inset-bottom)); }
  /* keyboard up: it covers the home-indicator area — no inset gap between the box and the keys */
  html.kb-open .composer { padding-bottom:10px; }
  html.kb-open .thread-view .th-comp.composer { padding-bottom:8px; }
  .sb-bottom { padding-bottom:calc(10px + env(safe-area-inset-bottom)); }  .m-back { top:calc(12px + env(safe-area-inset-top)) !important; }
  .chat-head { padding-top:calc(8px + env(safe-area-inset-top)); min-height:calc(52px + env(safe-area-inset-top)); }
  #detail { padding-top:0; }   /* the sticky Back bar carries the notch inset */

  /* messages: let the browser scroll vertically; we own horizontal (swipe-to-reply) */
  .msg, #feed .card { touch-action:pan-y pinch-zoom; position:relative; transition:transform .22s cubic-bezier(.3,0,.2,1); }
  .msg.swiping, #feed .card.swiping { transition:none; }
  /* reply affordance revealed as you swipe a bubble right */
  .msg .swipe-reply, #feed .card .swipe-reply { position:absolute; left:-42px; top:50%; transform:translateY(-50%) scale(.6);
    width:30px; height:30px; border-radius:2px; background:var(--okbg); color:var(--green);
    display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity .15s, transform .15s; font-size:calc(15px * var(--ui-fs, 1)); }
  .msg.swipe-armed .swipe-reply, #feed .card.swipe-armed .swipe-reply { opacity:1; transform:translateY(-50%) scale(1); }
  /* thread affordance revealed as you swipe a message left */
  .msg .swipe-thread { position:absolute; right:-42px; top:50%; transform:translateY(-50%) scale(.6);
    width:30px; height:30px; border-radius:2px; background:var(--card2); color:var(--accent);
    display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity .15s, transform .15s; }
  .msg .swipe-thread svg { width:18px; height:18px; }
  .msg.swipe-left .swipe-reply { display:none; }
  .msg:not(.swipe-left) .swipe-thread { display:none; }
  .msg.swipe-left.swipe-armed .swipe-thread { opacity:1; transform:translateY(-50%) scale(1); }
  /* bigger tap targets on touch */
  .msg-actions .ma { width:36px; height:32px; }   /* icon shrinks, the tap target doesn't */
  /* folded agent-message row: the tools drop under the summary line when the screen is narrow */
  .a2a-group > summary { flex-wrap:wrap; }
  .a2a-sum { min-width:60%; }
}

/* pull-to-refresh spinner */
#ptr { position:absolute; left:50%; top:8px; transform:translateX(-50%) translateY(-44px); z-index:30;
  width:30px; height:30px; border-radius:2px; background:var(--elev); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center; color:var(--muted); box-shadow:0 2px 10px var(--shadow);
  transition:transform .18s ease, opacity .18s; opacity:0; pointer-events:none; }
#ptr.show { opacity:1; }
#ptr svg { width:17px; height:17px; }
#ptr.spin svg { animation:ptrspin .7s linear infinite; }
@keyframes ptrspin { to { transform:rotate(360deg); } }
@media (max-width:820px), (max-height:500px) and (pointer:coarse){ .msg { -webkit-touch-callout:none; } }

/* collapsed (answered) decision card — compact one-liner */
.card.dc-collapsed { padding:11px 14px; opacity:.9; }
.dc-c-row { display:flex; align-items:center; gap:11px; }
.dc-c-ic { width:24px; height:24px; border-radius:2px; flex:none; display:flex; align-items:center; justify-content:center; font-size:calc(13px * var(--ui-fs, 1)); font-weight:700; }
.dc-c-ic.ok { background:var(--okbg); color:var(--green); }
.dc-c-ic.err { background:rgba(255,107,107,.15); color:#ff6b6b; }
.dc-c-ic.warn { background:color-mix(in srgb, var(--warn) 15%, transparent); color:var(--warn); font-size:calc(12px * var(--ui-fs, 1)); }
.stall-card[data-aid] { cursor:pointer; }
.stall-go { flex:none; font-size:calc(12px * var(--ui-fs, 1)); color:var(--accent2); white-space:nowrap; }
.stall-card[data-aid]:hover .stall-go { text-decoration:underline; }
.dc-c-main { min-width:0; flex:1; }
.dc-c-t { font-size:calc(13.5px * var(--ui-fs, 1)); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dc-c-a { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); margin-top:1px; }
/* a sent / decided approval card: read-only view of what went out (task c908862a) */
.dc-c-more { margin-left:auto; flex:none; font-size:calc(12px * var(--ui-fs, 1)); white-space:nowrap; }
.ap-ro { margin-top:9px; padding-top:8px; border-top:1px solid var(--line, rgba(127,127,127,.2)); display:grid; gap:5px; }
.ap-ro-row { display:flex; gap:10px; align-items:baseline; font-size:calc(13px * var(--ui-fs, 1)); }
.ap-ro-row .eml-l { flex:none; width:64px; color:var(--muted); }
.ap-ro-v { min-width:0; white-space:pre-wrap; overflow-wrap:anywhere; user-select:text; }
.ap-ro-body .ap-ro-v { max-height:320px; overflow:auto; }


/* voice-to-text mic button */


/* clickable agent names in an a2a message footer */
.foot-agent { color:var(--accent2); cursor:pointer; }
.foot-agent:hover { text-decoration:underline; }

/* inline editable email/draft approval card (grokbot-style) */
.eml { display:flex; flex-direction:column; gap:7px; margin:6px 0 12px; }
.eml-row { display:flex; align-items:flex-start; gap:9px; }
.eml-l { flex:none; width:54px; padding-top:9px; font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); text-align:right; }
.eml-f { flex:1; min-width:0; box-sizing:border-box; padding:8px 11px; border-radius:4px; background:var(--input); border:1px solid var(--line); color:var(--text); font:inherit; font-size:calc(13.5px * var(--ui-fs, 1)); outline:none; }
.eml-f:focus { border-color:var(--teal,#2dd4bf); }
.eml-bodyrow .eml-l { padding-top:9px; }
textarea.eml-body { resize:vertical; min-height:120px; line-height:1.5; white-space:pre-wrap; }

/* reply quote header inside a sent bubble (click → jump to original) */
.reply-quote { display:flex; flex-direction:column; gap:1px; padding:5px 9px; margin-bottom:6px; border-left:3px solid var(--accent2); border-radius:3px; background:var(--bubble2); cursor:pointer; }
.reply-quote:hover { background:var(--hover); }
.reply-quote .rq-who { font-size:calc(11px * var(--ui-fs, 1)); font-weight:600; color:var(--accent2); }
.reply-quote .rq-t { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:320px; }
/* Global search scope switch: Everywhere | In: <agent> */
.search-scope { display:flex; gap:6px; padding:0 18px 10px; }
.search-scope .sc-btn { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); background:none; border:1px solid var(--line); border-radius:3px; padding:4px 11px; cursor:pointer; max-width:60vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.search-scope .sc-btn.active { background:var(--bubble2); color:var(--text); border-color:var(--accent2, var(--line)); }
.card .btns .dc-close { color:var(--muted); margin-left:auto; }
/* Apps: custom connector form + per-agent toggles */
.cx-form { display:flex; flex-direction:column; gap:10px; margin:10px 0 14px; }
.cx-form .set-select { max-width:none; width:100%; }
.cx-form .cx-lbl { width:100%; }
.cx-form.hidden, #cx-token.hidden { display:none; }
.cx-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.cc-acts { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.app-grp { font-size:calc(11px * var(--ui-fs, 1)); text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:700; margin:10px 0 4px; }
.app-tog { position:relative; display:flex; align-items:center; gap:10px; padding:6px 4px; min-height:42px; cursor:pointer; }
.app-tog.locked { opacity:.45; cursor:not-allowed; }
/* one fixed tile per app, even inner padding, logo centered + scaled to fit (tiny favicons like Notion scale up) */
.app-tog .app-ic { width:30px; height:30px; flex:none; display:inline-flex; align-items:center; justify-content:center; }
.app-tog .app-ic .cc-ico { width:30px; height:30px; padding:5px; box-sizing:border-box; }
.app-tog .app-ic .cc-ico img { width:100%; height:100%; object-fit:contain; }
.app-tog .app-nm { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.app-tog input { position:absolute; opacity:0; width:0; height:0; }
.app-tog .sw { width:32px; height:18px; border-radius:3px; background:var(--line); position:relative; flex:none; transition:background .15s; }
.app-tog .sw::after { content:""; position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:2px; background:#fff; transition:transform .15s; }
.app-tog input:checked + .sw { background:var(--green, #3fb27f); }
.app-tog input:checked + .sw::after { transform:translateX(14px); }

/* Apps: one card per app, its accounts as rows inside */
.app-card .cc-toggle { cursor:pointer; }
.app-card .cc-chev { color:var(--faint); font-size:calc(12px * var(--ui-fs, 1)); width:12px; text-align:center; flex:none; }
.conn-grid { align-items:start; }        /* an open card grows alone; its neighbour keeps its height */
.acct-list { margin-top:12px; border-top:1px solid var(--line); padding-top:6px; }
.acct-row { display:flex; align-items:center; gap:10px; padding:8px 2px; border-bottom:1px dashed var(--div); }
.acct-row .acc-meta { flex:1; min-width:0; }
.acct-row .acc-n { font-weight:600; font-size:calc(13.5px * var(--ui-fs, 1)); padding:0; background:none; border:0; color:inherit; text-align:left; cursor:pointer; }
.acct-row .acc-st { line-height:1.45; }
.acc-bizchips { display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin:5px 0 4px; padding:0; background:none; border:0; cursor:pointer; text-align:left; }
.biz-chip { font-size:calc(12px * var(--ui-fs, 1)); line-height:1; padding:5px 8px; border-radius:3px; background:var(--hover); border:1px solid var(--line); color:var(--text); white-space:nowrap; }
.biz-edit { font-size:calc(12px * var(--ui-fs, 1)); color:var(--accent2); padding:0 2px; }
.acc-allbiz { display:block; margin:3px 0 2px; color:var(--muted); text-decoration:none; }
.acc-allbiz:hover { color:var(--accent2); text-decoration:underline; }
.acct-row .cc-btn.sm { padding:5px 12px; font-size:calc(12.5px * var(--ui-fs, 1)); }
.acct-add { margin-top:8px; font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--accent2); background:none; border:none; cursor:pointer; padding:2px; }
.conn-cat-h.conn-top { margin-bottom:4px; }
.conn-card { min-width:0; }
@media (max-width:760px){
  .conn-card { padding:12px; }
  .acct-row { flex-wrap:wrap; }
  /* may shrink to the row and wrap: `.conn-card .cc-acts {flex:none}` pushed Disconnect off a 390 px screen */
  .acct-row .cc-acts { margin-left:auto; flex:0 1 auto; min-width:0; justify-content:flex-end; }
  .acct-row .acc-meta { flex-basis:calc(100% - 24px); }   /* name, chips, status get the full width; buttons wrap below */
}

/* in-app dialog (uiDialog) — sits above the Settings modal */
.ui-dlg { position:fixed; inset:0; z-index:520; background:var(--overlay); display:flex; align-items:center; justify-content:center; padding:16px; }
.ui-dlg-box { width:min(440px,100%); background:var(--sidebar); border:1px solid var(--line); border-radius:4px;
  padding:20px 22px; box-shadow:0 20px 50px var(--shadow); display:flex; flex-direction:column; gap:14px;
  max-height:100%; overflow-y:auto; overscroll-behavior:contain; }   /* a long form scrolls on a phone */
.ui-dlg-box > * { flex-shrink:0; }
.ui-dlg-t { font-size:calc(16px * var(--ui-fs, 1)); font-weight:650; }
.ui-dlg-x { font-size:calc(13px * var(--ui-fs, 1)); color:var(--muted); line-height:1.5; }
.ui-dlg-x code { display:block; margin-top:6px; padding:7px 10px; border-radius:4px; background:var(--input); border:1px solid var(--line);
  color:var(--text); font-size:calc(12px * var(--ui-fs, 1)); word-break:break-all; user-select:all; }
.ui-dlg-f { display:flex; flex-direction:column; gap:6px; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); }
.ui-dlg-f input, .ui-dlg-f select { width:100%; padding:10px 12px; border-radius:4px; background:var(--input); border:1px solid var(--bd-ctl);
  color:var(--text); font-size:calc(14px * var(--ui-fs, 1)); outline:none; }
.ui-dlg-f input:focus, .ui-dlg-f select:focus, .ui-dlg-f textarea:focus { border-color:var(--accent2); }
.ui-dlg-f textarea { width:100%; padding:10px 12px; border-radius:4px; background:var(--input); border:1px solid var(--bd-ctl);
  color:var(--text); font:inherit; line-height:1.45; resize:vertical; outline:none; }
.ui-dlg-box.big .ui-dlg-f.grow { flex:1 1 auto; display:flex; flex-direction:column; min-height:0; }
.ui-dlg-box.big .ui-dlg-f.grow textarea { flex:1; resize:none; }
.ui-dlg-f em { font-style:normal; color:var(--muted); font-size:calc(11.5px * var(--ui-fs, 1)); }
.ui-dlg-b { display:flex; justify-content:flex-end; gap:8px; margin-top:2px; }
.eff-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:8px; }
@media (max-width:760px){ .eff-grid { grid-template-columns:minmax(0,1fr); } }
.eff-f { display:flex; flex-direction:column; gap:6px; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); }
.eff-f select { padding:9px 11px; border-radius:4px; background:var(--input); border:1px solid var(--bd-ctl); color:var(--text); font-size:calc(13.5px * var(--ui-fs, 1)); }
.eff-auto { grid-column:1 / -1; }
/* Settings › Accounts */
.acc-note { margin:0 2px 12px; }
.conn-grid + .acc-note { margin:16px 2px 0; color:var(--muted); font-size:calc(12.5px * var(--ui-fs, 1)); line-height:1.5; }
.acc-card.active { border-color:var(--green); }
.acc-eff { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }
.acc-eff .eff-f { gap:5px; }
.acc-eff .eff-f select { padding:7px 9px; font-size:calc(13px * var(--ui-fs, 1)); }
@media (max-width:520px){ .acc-eff { grid-template-columns:minmax(0,1fr); } }
.acc-av { width:30px; height:30px; border-radius:2px; flex:none; display:flex; align-items:center; justify-content:center;
  background:var(--iconbtn); color:var(--text); font-weight:700; font-size:calc(13px * var(--ui-fs, 1)); }
.acc-pill { font-size:calc(10px * var(--ui-fs, 1)); padding:1px 7px; border-radius:4px; background:var(--okbg); color:var(--green); margin-left:6px; }
.acc-ok { color:var(--green); } .acc-warn { color:var(--warn); } .acc-bad { color:var(--err); }
.acc-steps { margin:0; padding-left:20px; display:flex; flex-direction:column; gap:10px; font-size:calc(13px * var(--ui-fs, 1)); color:var(--muted); line-height:1.5; }
.acc-steps a.btn { display:inline-block; text-decoration:none; }

/* Change log on phones: full screen like Settings, entries as cards (no sideways table) */
@media (max-width:820px), (max-height:500px) and (pointer:coarse){
  .cl-tbl, .cl-tbl tbody { display:block; width:100%; }
  .cl-tbl thead { display:none; }
  .cl-tbl tr { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:3px 8px;
    padding:12px 4px; border-bottom:1px solid var(--div); }
  .cl-tbl td { border:none; padding:0; min-width:0; }
  .cl-tbl td:nth-child(1) { font-weight:600; font-size:calc(13px * var(--ui-fs, 1)); }
  .cl-tbl td:nth-child(2) { grid-column:1 / -1; grid-row:2; font-size:calc(13.5px * var(--ui-fs, 1)); line-height:1.45; overflow-wrap:anywhere; }
  .cl-tbl td:nth-child(3), .cl-tbl td:nth-child(4) { font-size:calc(11.5px * var(--ui-fs, 1)); align-self:center; }
}

/* ---- connection state · failed sends · time chips ---- */
.conn-banner { position:fixed; top:calc(10px + env(safe-area-inset-top)); left:50%; transform:translateX(-50%); z-index:650;
  font-size:calc(12px * var(--ui-fs, 1)); padding:5px 12px; border-radius:4px; background:var(--elev); border:1px solid var(--warnbd);
  color:var(--warn); box-shadow:0 4px 14px var(--shadow); cursor:pointer; }
.daydiv.timediv { margin:2px 0; font-size:calc(10.5px * var(--ui-fs, 1)); }
.msg.me.failed { opacity:.85; border:1px solid var(--err); }
.msg-fail { display:flex; align-items:center; gap:10px; margin-top:6px; font-size:calc(12px * var(--ui-fs, 1)); color:var(--err); }
.msg-fail .msg-retry { padding:3px 10px; border-radius:4px; background:var(--redbg); color:var(--err); font-weight:600; font-size:calc(12px * var(--ui-fs, 1)); }

/* ---- Needs-you inbox ---- */
.ny-btn { position:relative; }
.ny-badge { position:absolute; top:-6px; right:-8px; min-width:16px; height:16px; padding:0 4px; border-radius:4px;
  background:var(--err); color:#fff; font-size:calc(10px * var(--ui-fs, 1)); font-weight:700; line-height:16px; text-align:center; }
.m-back[data-count]::after { content:attr(data-count); position:absolute; top:-4px; right:-6px; min-width:15px; height:15px;
  padding:0 3px; border-radius:4px; background:var(--warn); color:var(--onwarn); font-size:calc(9.5px * var(--ui-fs, 1)); font-weight:700; line-height:15px; text-align:center; }
.ny-from { font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); margin:10px 2px 6px; line-height:1.3; }
.ny-from:empty { display:none; }
.ny-from a { color:var(--accent2); cursor:pointer; }
.ny-detail { font-size:calc(13px * var(--ui-fs, 1)); color:var(--muted); margin-bottom:10px; }
.ny-detail ol, .ny-detail ul { margin:6px 0; padding-left:22px; }
.ny-detail li { margin:4px 0; color:var(--text); line-height:1.45; }

/* ---- Settings › Usage ---- */
.us-top { display:flex; align-items:center; gap:12px; margin:4px 0 10px; }
.us-top .conn-h-act { margin-left:auto; color:var(--accent2); font-size:calc(12.5px * var(--ui-fs, 1)); }
.us-kpis { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin:6px 0 18px; }
.us-kpi { background:var(--card2); border:1px solid var(--line); border-radius:4px; padding:10px 12px; }
.us-v { font-size:calc(19px * var(--ui-fs, 1)); font-weight:650; font-variant-numeric:tabular-nums; }
.us-l { font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); }
.us-more { text-transform:none; letter-spacing:0; font-weight:500; color:var(--muted); margin-left:6px; }
.us-tbl-wrap { overflow-x:auto; }
.us-tbl { width:100%; border-collapse:collapse; font-size:calc(13px * var(--ui-fs, 1)); font-variant-numeric:tabular-nums; }
.us-tbl th { font-size:calc(11px * var(--ui-fs, 1)); font-weight:600; color:var(--muted); text-align:right; padding:4px 8px; border-bottom:1px solid var(--line); }
.us-tbl td { text-align:right; padding:6px 8px; border-bottom:1px solid var(--div); white-space:nowrap; }
.us-tbl th:first-child, .us-tbl td.us-k { text-align:left; }
.us-tbl td.us-k { white-space:normal; overflow-wrap:anywhere; min-width:120px; }
.us-sub { display:block; font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); }
.us-run { display:flex; flex-direction:column; gap:6px; }
.us-run-row { display:flex; align-items:center; gap:10px; background:var(--card2); border:1px solid var(--line); border-radius:4px; padding:9px 12px; }
.us-run-main { flex:1; min-width:0; }
.us-run-a { font-weight:600; font-size:calc(13.5px * var(--ui-fs, 1)); }
.us-run-t { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.us-el { flex:none; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); font-variant-numeric:tabular-nums; }
.us-run-row .btn.sm { padding:5px 12px; font-size:calc(12.5px * var(--ui-fs, 1)); flex:none; }
.us-pause { display:flex; align-items:center; gap:14px; margin-top:12px; background:var(--card2); border:1px solid var(--line);
  border-radius:4px; padding:11px 14px; cursor:pointer; }
.us-pause > div:first-child { flex:1; }
.us-pause .sw { cursor:pointer; }
.us-msg { white-space:normal !important; color:var(--muted); }
.us-alert { margin:0 2px 10px; }
@media (max-width:760px){
  .us-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .us-tbl th:nth-child(5), .us-tbl td:nth-child(5) { display:none; }   /* drop Output on phones */
}

/* phone: header icon buttons + close buttons get a ≥40px tap target */
@media (max-width:820px), (max-height:500px) and (pointer:coarse){ #sidebar .icon, #changelog-x { min-width:40px; min-height:40px; } }

/* Settings › Businesses */
.biz-intro { margin:2px 0 12px; line-height:1.5; max-width:640px; }
.biz-list { display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.biz-row { display:flex; align-items:center; gap:12px; padding:10px 12px; border:1px solid var(--line); border-radius:4px; }
.biz-dot { width:10px; height:10px; border-radius:2px; flex:none; }
.biz-meta { flex:1; min-width:0; }
.biz-n { font-weight:600; }
.biz-code { font-size:calc(11px * var(--ui-fs, 1)); font-weight:500; color:var(--muted); border:1px solid var(--line); border-radius:3px; padding:1px 6px; margin-left:6px; }
.biz-acts { display:flex; align-items:center; gap:10px; }
.biz-add .set-select { flex:1; min-width:140px; }
.biz-add .biz-code-in { flex:0 0 140px; min-width:0; }
/* Apps › which businesses an account serves */
.acc-biz { font-size:inherit; color:var(--accent2); padding:0; }
.cx-checks, .ui-dlg-checks { display:flex; flex-wrap:wrap; gap:6px 14px; align-items:center; }
.cx-checks label, .ui-dlg-checks label { white-space:normal; min-width:0; overflow-wrap:anywhere; display:flex; align-items:center; gap:6px; color:var(--text); font-size:calc(13px * var(--ui-fs, 1)); cursor:pointer; }
.ui-dlg-f .ui-dlg-checks input { width:auto; padding:0; }

.tc-filters { display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.tc-filters .conn-search { margin-bottom:0; flex:1; min-width:0; }
.tc-filters .cs, .tc-filters select { flex:none; max-width:45%; }
.tc-list { list-style:none; margin:0; padding:0; }
.tc-row { width:100%; text-align:left; display:grid; grid-template-columns:auto auto minmax(0,1fr); gap:2px 10px; align-items:baseline;
  padding:8px 6px; border-bottom:1px solid var(--div); font-size:calc(13px * var(--ui-fs, 1)); border-radius:0; }
.tc-row:hover { background:var(--hover); }
.tc-when { color:var(--muted); font-size:calc(12px * var(--ui-fs, 1)); white-space:nowrap; font-variant-numeric:tabular-nums; }
.tc-agent { color:var(--muted); white-space:nowrap; }
.tc-tool { font-weight:560; overflow-wrap:anywhere; }
.tc-w { display:inline-block; margin-left:6px; font-size:calc(10.5px * var(--ui-fs, 1)); font-weight:600; padding:0 6px; border-radius:4px; vertical-align:1px;
  color:var(--warn); background:color-mix(in srgb, var(--warn) 12%, transparent); border:1px solid var(--warnbd); }
.tc-args { grid-column:1 / -1; font:calc(12px * var(--ui-fs, 1))/1.45 ui-monospace,SFMono-Regular,Menlo,monospace; color:var(--muted);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tc-row.open .tc-args { white-space:pre-wrap; overflow-wrap:anywhere; color:var(--text); }
@media (max-width:820px), (max-height:500px) and (pointer:coarse){ .tc-row { grid-template-columns:auto minmax(0,1fr); } .tc-tool { grid-column:1 / -1; }
  .tc-row { min-height:44px; } }
/* "## Routed to X" relays → a small label above the answer */
.routed-chip { display:inline-block; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); border:1px solid var(--line);
  border-radius:3px; padding:2px 10px; margin:0 0 8px; }
/* the Chief of Staff's routing ack, folded into the hand-off label: "…" toggles a muted line */
.ra-tog { margin-left:6px; padding:0 3px; background:none; border:0; color:inherit; font:inherit; line-height:1;
  opacity:.55; cursor:pointer; }
.ra-tog:hover, .ra-tog[aria-expanded="true"] { opacity:1; }
.routed-ack { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); margin:-2px 0 10px; padding-left:10px;
  border-left:2px solid var(--line); max-width:680px; }
.routed-ack p, .routed-ack ul { margin:2px 0; }
.delegate-pill-wrap .routed-ack { margin:6px 0 0; text-align:left; }
/* > quoted copy: template / draft text with copy + character count */
.md-quote { margin:8px 0; padding:10px 12px; border-left:3px solid var(--accent2); background:var(--input);
  border-radius:4px; }
.md-quote .mq-text { white-space:pre-wrap; }
.md-quote .mq-foot { display:flex; justify-content:space-between; align-items:center; margin-top:8px;
  font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); }
.md-quote .mq-copy { font-size:calc(12px * var(--ui-fs, 1)); color:var(--accent2); }

/* lazy history: "Show earlier messages" + the fresh-chat divider (task c0f27ef0) */
.hist-older { display:flex; flex-direction:column; align-items:center; gap:6px; margin:10px 0 14px; }
.hist-older-t { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); }
.hist-older-b { font-size:calc(13px * var(--ui-fs, 1)); }
@keyframes ch-spin { to { transform:rotate(360deg); } }

/* a message sent mid-reply: read in one follow-up turn afterwards */
.msg.me .msg-queued { margin-top:6px; font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); }

/* phone tap targets ≥40px: compact controls get an invisible hit area (pseudo-element);
   tabs/buttons in scrollers or cards grow for real (a pseudo would be clipped there) */
@media (max-width:820px), (max-height:500px) and (pointer:coarse){
  .ca-rm, .fc-x, .rb-x, .sw, .go { position:relative; }
  .ca-rm::before, .fc-x::before, .rb-x::before, .pt-x::before, .sw::before, .go::before {
    content:""; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
    width:max(100%,44px); height:max(100%,44px); }
  .gtabs button, .card .btns .btn, .card .btns .go, .app-tog { min-height:40px; }
  /* card actions wrap into rows of one-line buttons — they ran off the right edge
     (Reject unreachable) with each label squeezed to three lines */
  .card .btns .btn { flex:1 1 calc(50% - 9px); min-width:0; white-space:nowrap; padding-left:10px; padding-right:10px; }
}

.dev-row { display:flex; align-items:center; justify-content:space-between; gap:10px; }
/* ---------- Phone pass (portrait + landscape): readable, tappable, nothing under the bars ---------- */
@media (max-width:820px), (max-height:500px) and (pointer:coarse) {
  /* iOS zooms the page when a focused field is under 16px */
  input, select, textarea, .set-select, .composer textarea,
  .modal-box input, .modal-box textarea, .modal-box select, #st-page input, #st-page textarea, #st-page select, .sec-val { font-size:max(16px, calc(16px * var(--ui-fs, 1))); }
  /* messages scroll under a soft fade, not straight under the floating pills */
  #chat::before { content:""; position:absolute; left:0; right:0; top:0; z-index:4; pointer-events:none;
    height:calc(64px + env(safe-area-inset-top)); background:linear-gradient(var(--bg) 55%, transparent); }
  /* composer: full width inside its margins; cap its height so the chat stays visible */
  .composer form { width:auto; }
  .composer textarea { max-height:30vh; }
  .composer textarea::placeholder { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  /* tap targets ≥ 40px */
  .composer .ic { width:42px; height:42px; }
  /* the send circle stays small; an invisible ring keeps the tap target at 44px */
  .composer .ic.send { width:34px; height:34px; position:relative; }
  .composer .ic.send::after { content:""; position:absolute; inset:-5px; }
  .pt-x, .rb-x, .reply-x { min-width:32px; min-height:32px; }
  #dt-expand, .dt-head .pencil { min-width:40px; min-height:40px; }
  .tk-chk { width:24px; height:24px; }
  .go { display:inline-flex; align-items:center; min-height:36px; }
  .gtabs { display:none; }   /* phone: no section tabs, more room for the content */
  .sw { width:46px; height:28px; }
  /* bubbles use the width a phone has */
  .msg, .a2a-group { max-width:96%; }
  .set-select { max-width:none; }
  /* hover-only controls are always visible on touch */
  .sec-x, .sec-del { opacity:1 !important; }
  /* account cards: the action wraps under the header instead of truncating it */
  .conn-card .cc-head { flex-wrap:wrap; }
  /* details drawer: compact header so the tabs show without scrolling */
  .dt-head .av { width:56px; height:56px; }
  .dt-head { padding-bottom:6px; }
  /* small text */
  .model-badge, .prio, .sec-ct { font-size:calc(11px * var(--ui-fs, 1)); }
  .tk-acts { opacity:1; }
  /* long-press menus on rows: no iOS callout / text selection */
  .row-agent, .pin-cell, .tk-row { -webkit-touch-callout:none; -webkit-user-select:none; user-select:none; }
}

/* agent→agent messages in the sender's chat: one collapsed row per run */
/* same width as a reply bubble: sized to its text, capped by the .msg max-width rules */
.a2a-group { align-self:flex-start; min-width:min(260px, 88%); border:1px solid var(--line); border-radius:4px;
  background:transparent; font-size:calc(13px * var(--ui-fs, 1)); }
.a2a-group > summary { cursor:pointer; padding:6px 10px 6px 14px; color:var(--muted); list-style:none;
  display:flex; align-items:center; gap:6px; min-width:0; }
.a2a-group > summary::-webkit-details-marker { display:none; }
/* folded: one line — icon, who, count, first line (ellipsis), then the tools inline on the right */
.a2a-sum { display:flex; align-items:center; gap:6px; flex:1; min-width:0; }
.a2a-sum .a2a-who { color:var(--text); white-space:nowrap; flex:none; max-width:45%; overflow:hidden; text-overflow:ellipsis; }
.a2a-sum .a2a-n { flex:none; min-width:18px; padding:0 5px; border-radius:9px; background:var(--bubble2); color:var(--muted);
  font-size:calc(11px * var(--ui-fs, 1)); line-height:18px; text-align:center; }
.a2a-sum .a2a-snip { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--muted); }
.a2a-group[open] .a2a-sum .a2a-snip { display:none; }
.a2a-ic-wrap { display:inline-flex; flex:none; }
.a2a-ic { color:var(--faint); flex:none; }
.a2a-ic.a2a-pri { color:var(--amber, #e0a030); }
.a2a-to { display:flex; align-items:center; gap:5px; }
/* reports in / system notes (Nov 3): labelled first, so neither reads as this agent's own orders */
.a2a-sum .a2a-lbl, .a2a-to .a2a-dir { flex:none; color:var(--muted); font-size:calc(11px * var(--ui-fs, 1));
  text-transform:uppercase; letter-spacing:.04em; white-space:nowrap; }
.a2a-group.a2a-g-in { border-style:dashed; }
.a2a-group.a2a-g-sys { opacity:.85; }
.card-upd { color:var(--muted); font-size:calc(11px * var(--ui-fs, 1)); }
.a2a-group > summary > .a2a-tools { margin:0 0 0 auto; flex:none; }
.a2a-group[open] > summary > .a2a-tools { display:none; }   /* folded only: open, each item has its own */
.a2a-group > summary::before { content:"▸"; color:var(--faint); flex:none; }
.a2a-group[open] > summary::before { content:"▾"; }
.a2a-items { padding:0 16px 10px; display:flex; flex-direction:column; gap:10px; }
.a2a-item { border-top:1px solid var(--div); padding-top:8px; }
.a2a-to { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); margin-bottom:4px; }
.a2a-item .msg-body { max-width:calc(75ch * 14 / 13); }   /* = a reply's 75ch at its 14px */

/* Needs-you task cards: every action on the card */
.ny-reply { margin-top:12px; }
.ny-reply textarea { width:100%; background:var(--input); border:1px solid var(--bd-ctl); border-radius:4px;
  color:var(--text); font:inherit; padding:9px 11px; resize:vertical; }
.ny-reply.hidden { display:none; }

/* long replies fold to a readable height */
.msg-body.clamped { max-height:26em; overflow:hidden;
  -webkit-mask-image:linear-gradient(#000 80%, transparent); mask-image:linear-gradient(#000 80%, transparent); }
.msg-more { margin-top:6px; color:var(--accent); font-weight:600; font-size:13px; padding:4px 10px; }
.msg-more:hover, .msg-more:focus-visible { color:var(--green2); }


/* Needs-you: filter tasks by business; "asked" note under a card */
.ny-asked { margin-top:10px; }
.ny-asked a { color:var(--accent2); cursor:pointer; }

/* Needs-you: cards saved for later (collapsed by default) */

/* Needs-you: email drafts collapse to one row until opened */
.card.eml-closed .eml, .card.eml-closed > .btns { display:none; }
.eml-sum { display:flex; align-items:center; gap:10px; margin:6px 0 2px; cursor:pointer; }
.eml-sum-t { flex:1; min-width:0; font-size:calc(13px * var(--ui-fs, 1)); color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.eml-tog { flex:none; white-space:nowrap; }
.card:not(.eml-closed) .eml-sum-t { display:none; }
/* email draft: the original Gmail thread it answers, opened on demand */
.card.eml-closed .eml-thr { display:none; }
.eml-thr { margin:8px 0 4px; }
.eml-thr-body { margin-top:6px; max-height:420px; overflow:auto; border:1px solid var(--line); border-radius:4px; }
.eml-thr-body.hidden { display:none; }
.eml-thr-note { padding:10px 12px; color:var(--muted); font-size:13px; }
.eml-msg { padding:10px 12px; border-bottom:1px solid var(--line); }
.eml-msg:last-of-type { border-bottom:0; }
.eml-msg-h { display:flex; gap:10px; justify-content:space-between; font-size:13px; }
.eml-msg-h span { color:var(--muted); white-space:nowrap; }
.eml-msg-to { color:var(--muted); font-size:12px; margin-top:2px; overflow-wrap:anywhere; }
.eml-msg-b { margin-top:6px; white-space:pre-wrap; overflow-wrap:anywhere; font-size:13px; line-height:1.45; }
.eml-thr-link { display:block; padding:8px 12px; border-top:1px solid var(--line); color:var(--accent2); font-size:13px; }
/* reply card: the client's questions (card_questions.py), above the draft */
.card.eml-closed .ql { display:none; }
.ql { margin:8px 0 6px; border:1px solid var(--line); border-radius:4px; }
.ql-h { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:8px 12px; border-bottom:1px solid var(--line); font-size:calc(13px * var(--ui-fs, 1)); }
.ql-t { font-weight:600; flex:1; min-width:0; }
.ql-n { color:var(--muted); white-space:nowrap; }
.ql-warn, .ql-send-warn { color:var(--warn); white-space:nowrap; font-weight:600; }
.ql-send-warn { align-self:center; font-size:calc(13px * var(--ui-fs, 1)); }
.ql-list { margin:0; padding:4px 12px 6px 34px; }
.ql-i { padding:5px 0; font-size:calc(13px * var(--ui-fs, 1)); line-height:1.45; }
.ql-row { display:flex; gap:10px; align-items:baseline; justify-content:space-between; }
.ql-q { min-width:0; overflow-wrap:anywhere; }
.ql-st { flex:none; font-size:12px; padding:1px 7px; border-radius:10px; border:1px solid var(--line); color:var(--muted); }
.ql-open .ql-st { color:var(--warn); border-color:var(--warnbd); }
.ql-answered .ql-st, .ql-fixed .ql-st, .ql-verified .ql-st { color:var(--ok); }
.ql-a { color:var(--muted); margin-top:2px; overflow-wrap:anywhere; }

/* Settings › Accounts: GitHub read-only tokens */
.gh-ro-have { margin:4px 2px 10px; display:flex; flex-wrap:wrap; gap:6px; }
.gh-ro-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr) auto; gap:8px; }
.gh-ro-row input { padding:9px 11px; border-radius:4px; background:var(--input); border:1px solid var(--bd-ctl); color:var(--text); }
@media (max-width:620px){ .gh-ro-row { grid-template-columns:minmax(0,1fr); } }
/* Settings › Apps › GitHub card: code access for agents (collapsed section under the accounts) */
.gh-code { margin-top:10px; border-top:1px solid var(--div); padding-top:8px; }
.gh-code > summary { cursor:pointer; padding:6px 2px; }
.gh-blk { padding:10px 2px 12px; }
.gh-blk + .gh-blk { border-top:1px dashed var(--div); }
.gh-blk-h { margin-bottom:6px; }
.gh-how { margin:0 2px 10px; font-size:calc(12.5px * var(--ui-fs, 1)); }
.gh-how summary { cursor:pointer; color:var(--accent2); width:max-content; }
.gh-how[open] summary { margin-bottom:6px; }
.gh-how .s { line-height:1.5; }

/* master pause */
#swarm-pause-btn .sp-play { display:none; }
body.swarm-paused #swarm-pause-btn { color:var(--warn); opacity:1; }
body.swarm-paused #swarm-pause-btn .sp-pause { display:none; }
body.swarm-paused #swarm-pause-btn .sp-play { display:inline; }
.pause-banner { display:flex; align-items:center; gap:10px; margin:0 0 8px; padding:8px 12px; border-radius:4px;
  background:var(--elev); border:1px solid var(--warnbd); color:var(--warn); font-size:calc(13px * var(--ui-fs, 1)); }
.pause-banner.hidden { display:none; }
.pause-banner span { flex:1; }
#bill-banner-t a { color:inherit; text-decoration:underline; overflow-wrap:anywhere; }
.pause-banner button { border:0; border-radius:4px; padding:5px 12px; background:var(--warn); color:var(--onwarn); font-weight:600; cursor:pointer; }
body.routines-paused #swarm-pause-btn { color:var(--warn); opacity:1; }
.spend-chip { border:1px solid var(--line); background:transparent; color:var(--muted); border-radius:3px;
  padding:2px 8px; font-size:calc(11.5px * var(--ui-fs, 1)); font-variant-numeric:tabular-nums; cursor:pointer; }
.spend-chip:hover { color:var(--text); background:var(--hover); }
.spend-chip.warn { color:var(--warn); border-color:var(--warnbd); }
.spend-chip.hidden, #sidebar.collapsed .spend-chip { display:none; }
.pause-menu { position:fixed; z-index:1000; width:290px; max-width:calc(100vw - 16px); padding:6px; border-radius:4px;
  background:var(--elev); border:1px solid var(--line); box-shadow:0 10px 30px var(--shadow); }
.pause-menu { overflow-y:auto; overscroll-behavior:contain; }
.pause-menu .pm-spend { padding:4px 10px 6px; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); font-variant-numeric:tabular-nums; }
.pause-menu .pm-mode { display:block; width:100%; text-align:left; border:0; background:transparent; color:var(--text);
  padding:8px 10px; border-radius:4px; cursor:pointer; }
.pause-menu .pm-mode:hover { background:var(--hover); }
.pause-menu .pm-mode.on { background:var(--sel); }
.pause-menu .pm-mode b { display:block; font-size:calc(13px * var(--ui-fs, 1)); font-weight:600; }
.pause-menu .pm-mode span { display:block; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); }
.pause-menu .pm-for { padding:8px 10px 4px; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); border-top:1px solid var(--line); margin-top:4px; }
.pause-menu .pm-for .sb-filters { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.pause-menu .pm-note { padding:4px 10px 6px; font-size:calc(12px * var(--ui-fs, 1)); color:var(--warn); }
/* one-click master pause: a touch long-press opens the options, never a text callout */
#swarm-pause-btn { -webkit-touch-callout:none; user-select:none; -webkit-user-select:none; touch-action:manipulation; }
/* weekly usage rows in the pause menu and Settings › Usage (no header meter since Oct 31) */
.um-bar { display:inline-block; position:relative; width:34px; height:8px; border:1px solid var(--line); border-radius:2px; overflow:hidden; flex:none; }
.um-bar i { position:absolute; left:0; top:0; bottom:0; width:0; background:var(--green); transition:width .3s steps(4); }
.um-bar.warn i { background:var(--warn); }
.um-bar.bad i { background:var(--err); }
.pause-menu .pm-usage-box:not(:empty) { border-top:1px solid var(--line); margin-top:4px; padding-top:4px; }
.pause-menu .pm-usage { padding:6px 10px 4px; }
.pause-menu .pm-usage-h { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); margin-bottom:4px; }
.pause-menu .pm-acct { display:flex; align-items:center; gap:8px; padding:3px 0; font-size:calc(12px * var(--ui-fs, 1)); }
.pause-menu .pm-an { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pause-menu .pm-acct .um-bar { width:70px; }
.pause-menu .pm-ap { min-width:52px; text-align:right; color:var(--muted); font-variant-numeric:tabular-nums; }
.us-week { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:8px 0 2px; }
.us-week .um-bar { width:120px; height:10px; }
.us-cap { display:flex; align-items:center; gap:4px; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); margin-left:auto; }
.us-cap input { width:72px; padding:4px 6px; border-radius:4px; background:var(--input); border:1px solid var(--bd-ctl); color:var(--text); }
.ua-list { display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.ua-row { display:flex; align-items:center; gap:10px; padding:8px 10px; border:1px solid var(--line); border-radius:4px; }
.ua-row .ua-main { flex:1; min-width:0; font-size:calc(13px * var(--ui-fs, 1)); }
.ua-row.done { opacity:.55; }

/* decision card: files attached to the typed answer */
.dc-att { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin-top:6px; }
.dc-att .dc-clip { font-size:calc(12.5px * var(--ui-fs, 1)); }
.dc-files { display:flex; flex-wrap:wrap; gap:6px; }
.dc-file { display:inline-flex; align-items:center; gap:6px; max-width:240px; font-size:calc(12px * var(--ui-fs, 1)); padding:3px 6px 3px 9px;
  border:1px solid var(--line); border-radius:3px; background:var(--input); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dc-file.up { opacity:.6; }
.dc-file button { background:none; border:none; color:var(--muted); cursor:pointer; font-size:calc(11px * var(--ui-fs, 1)); padding:0; }
.dc-file button:hover { color:var(--err); }

/* secret card: multi-line paste (.env, JSON, PEM) kept intact, still masked on screen */
.sec-val { width:100%; resize:vertical; font-family:ui-monospace, Menlo, monospace; font-size:calc(12.5px * var(--ui-fs, 1));
  background:var(--input); color:var(--text); border:1px solid var(--line); border-radius:4px; padding:10px 12px; outline:none;
  -webkit-text-security:disc; text-security:disc; }
.sec-val:focus { border-color:var(--accent2); }
.ui-dlg-b .btn svg { width:14px; height:14px; vertical-align:-2px; }
.ui-dlg-b .btn:disabled { opacity:.45; cursor:not-allowed; }

/* keyboard access: visible focus ring on clickable rows + switches */
.row-agent:focus-visible, .agent-row:focus-visible, .tk-row[data-task]:focus-visible,
.sr-row:focus-visible, .sw[role=switch]:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.sw[role=switch]:focus-visible { outline-offset:2px; }
.row-agent:focus:not(:focus-visible), .agent-row:focus:not(:focus-visible), .tk-row:focus:not(:focus-visible),
.sr-row:focus:not(:focus-visible), .sw:focus:not(:focus-visible) { outline:none; }
/* Settings › General › Font: typeface picker */
.face-row { display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:8px; }
.face-opt { display:flex; flex-direction:column; align-items:flex-start; gap:2px; padding:10px 12px; border-radius:4px;
  border:1px solid var(--line); background:var(--elev); color:var(--text); text-align:left; }
.face-opt span { font-size:calc(18px * var(--ui-fs, 1)); color:var(--muted); }
.face-opt.active { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent) inset; }
/* Action Center: the sprints ⋯ beside the search box, same height as it */
/* Inbox deck (full-screen sprint): header buttons, bottom nav, slide-in, find sheet */
#sprint-view .sv-top { align-items:center; }
.sv-ic { width:36px; height:36px; border-radius:4px; color:var(--muted); display:inline-flex; align-items:center; justify-content:center; flex:none;
  font-size:calc(18px * var(--ui-fs, 1)); }
.sv-ic:hover { background:var(--hover); color:var(--text); }
#sprint-view { overflow:hidden; }
/* one card, full height: what it asks and its thread scroll in the middle, its buttons and box stay at the bottom (owner, Nov 7) */
.sv-stack { flex:1; min-height:0; display:flex; position:relative; max-width:720px; width:100%; margin:0 auto; padding-bottom:8px; box-sizing:border-box; }
.sv-stack.more::before { content:attr(data-next); position:absolute; left:10px; right:10px; top:6px; bottom:0; padding:14px; box-sizing:border-box; overflow:hidden; background:var(--bubble); border:1px solid var(--line); border-radius:4px; color:var(--muted); font-weight:600; opacity:.7; }
.sv-frame { flex:1; min-width:0; min-height:0; display:flex; flex-direction:column; position:relative; z-index:1; background:var(--bubble); border:1px solid var(--line); border-radius:4px; padding:0 14px 10px; box-sizing:border-box; transition:transform .14s ease-in; will-change:transform; }
.sv-frame .sv-item > .card:first-child:not(:has(~ .card)) { background:transparent; border:0; padding:14px 0 10px; }
.sv-frame .sv-convo .th-list:not(:empty) { border-top:1px solid var(--line); padding-top:10px; }
.sv-item { max-width:720px; width:100%; margin:0 auto; padding:0 0 12px; }
.sv-item > .card:not(.sv-card) { padding:18px; }
.sv-in-r { animation:svInR .22s ease; } .sv-in-l { animation:svInL .22s ease; }
@keyframes svInR { from { transform:translateX(40px); opacity:.3; } to { transform:none; opacity:1; } }
@keyframes svInL { from { transform:translateX(-40px); opacity:.3; } to { transform:none; opacity:1; } }
.sv-extra { margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
.sv-extra .go.red { color:var(--err); }
.sv-nav { display:flex; align-items:center; gap:10px; flex:none; padding:8px 0 calc(8px + env(safe-area-inset-bottom)); max-width:720px; width:100%; margin:0 auto; }
.sv-nb { width:48px; height:40px; border-radius:4px; border:1px solid var(--line); background:var(--elev); color:var(--text); font-size:calc(22px * var(--ui-fs, 1)); line-height:1; }
.sv-nb:disabled { opacity:.35; }
.sv-hint { flex:1; text-align:center; color:var(--muted); font-size:calc(12px * var(--ui-fs, 1)); }
.sv-find { position:absolute; inset:0; background:var(--bg); display:flex; flex-direction:column; padding:inherit; z-index:2; }
.sv-find-top { display:flex; gap:10px; align-items:center; padding:6px 0 10px; }
.sv-find-top input { flex:1; min-width:0; }
.sv-find-modes { display:flex; gap:6px; padding:0 0 10px; }
.sv-find-list { flex:1; overflow-y:auto; }
.sv-fr { display:flex; gap:10px; align-items:flex-start; padding:10px 8px; border-radius:4px; cursor:pointer; }
.sv-fr:hover, .sv-fr.cur { background:var(--hover); }
.sv-fr.done { opacity:.55; }
.sv-fk { flex:none; min-width:62px; font-size:calc(11px * var(--ui-fs, 1)); font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); padding-top:2px; }
.sv-fm { min-width:0; } .sv-ft { overflow-wrap:anywhere; }
.sv-fr:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
/* Undo bar: shown for 5 s after an answer, above everything (the inbox deck included) */
.undo-bar { position:fixed; left:50%; transform:translateX(-50%); bottom:calc(76px + env(safe-area-inset-bottom)); z-index:400;
  display:flex; align-items:center; gap:14px; max-width:calc(100vw - 32px); padding:10px 10px 10px 16px; border-radius:4px;
  background:var(--elev); border:1px solid var(--line); box-shadow:0 12px 34px var(--shadow); }
.ub-t { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ub-b { flex:none; padding:7px 12px; border-radius:4px; background:var(--accent); color:var(--ongreen); font-weight:700; }
.ub-n { opacity:.7; font-weight:600; margin-left:2px; }
/* Change log: heading + bullets + link chips */
.cl-h { font-weight:600; }
.cl-ul { margin:4px 0 0; padding-left:18px; color:var(--muted); }
.cl-ul li { margin:2px 0; }
.cl-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.cl-chip { font-size:calc(12px * var(--ui-fs, 1)); padding:2px 8px; border-radius:3px; border:1px solid var(--line); color:var(--accent2); text-decoration:none; }
/* card details: nothing runs off the card (long links, ids) */
.dc-detail, .dc-q, .ny-detail { overflow-wrap:anywhere; }
.dc-detail a { word-break:break-all; }
.dc-detail ul { margin:2px 0 8px; padding-left:20px; }
.dc-detail p { margin:6px 0 2px; }
.dc-detail h1, .dc-detail h2, .dc-detail h3, .dc-detail h4, .dc-detail h5, .dc-detail h6 {
  font-size:calc(11.5px * var(--ui-fs, 1)); font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  color:var(--muted); margin:12px 0 3px; }
.dc-detail > :first-child { margin-top:0; }
/* card details: readable links on dark cards; paused-routine card like the others */
.dc-detail a, .ny-detail a, .dc-q a { color:var(--accent2); }
.sv-item .ny-report { margin-top:8px; padding:8px 10px; border-radius:4px; background:var(--bubble2); font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--muted); }
.sv-item .ny-report span { font-weight:600; color:var(--text); }
.sv-item .card.warn .dc-kicker { color:var(--warn); font-size:calc(11px * var(--ui-fs, 1)); font-weight:700; letter-spacing:.06em; text-transform:uppercase; }

/* inbox deck: copyable card ID (paste to Claude → /api/lookup) */
.sv-id-row { display:flex; justify-content:flex-start; margin:6px 0 0 4px; }
.sv-id { opacity:.6; }
.sv-id-row { gap:6px; align-items:center; }
.sv-ask { width:auto !important; padding:0 12px 0 8px; gap:6px; display:inline-flex; align-items:center;
  border:1px solid var(--line); border-radius:3px; color:var(--text); }
.sv-ask span { font-size:calc(13px * var(--ui-fs, 1)); font-weight:600; }
.sv-id:hover, .sv-id:focus { opacity:1; }

/* code blocks: Copy button; the owner's own bubble wraps long lines (a long JSON line
   showed only its tail in the narrow bubble) */
.code-wrap { position:relative; }
.code-wrap .code-copy { position:absolute; top:4px; right:4px; z-index:1; font-size:12px; padding:2px 8px; opacity:.85; }
.msg.me .msg-body pre, .msg.me .msg-body pre code { white-space:pre-wrap; word-break:break-word; overflow-x:visible; }

/* thread view: one topic of a chat, full screen, its own composer */
.thread-view { position:fixed; inset:0; z-index:350; display:flex; flex-direction:column; background:var(--bg); color:var(--text); }
.th-head { display:flex; align-items:center; gap:6px; padding:6px 8px; min-height:48px; border-bottom:1px solid var(--line, rgba(127,127,127,.25)); }
.th-x { border:0; background:transparent; color:inherit; font-size:20px; padding:4px 8px; cursor:pointer; }
.th-t { font-weight:600; display:flex; align-items:center; min-width:0; flex:1; }
.th-t .th-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.th-list { flex:1; overflow-y:auto; padding:14px 16px; display:flex; flex-direction:column; gap:12px; }
.th-msg { max-width:100%; padding:10px 12px; border-radius:4px; background:var(--bubble); overflow-wrap:anywhere; }
.th-msg.me { align-self:flex-end; max-width:88%; background:var(--me); }
.th-msg.me pre { white-space:pre-wrap; margin:0; font:inherit; }
.th-msg.pending { opacity:.6; }
.th-from { font-size:12px; opacity:.6; margin-bottom:4px; }
.th-note { align-self:center; font-size:12px; color:var(--muted); padding:2px 10px; border-radius:10px; background:var(--line, rgba(127,127,127,.12)); }
.msg.bot .meta .av.th-av, .msg.bot .meta .th-av { width:18px; height:18px; vertical-align:-4px; margin-right:6px; display:inline-block; }
.wk-stop { margin-left:6px; font-size:12px; padding:2px 10px; border-radius:10px; border:1px solid var(--line, rgba(127,127,127,.35)); background:transparent; color:var(--muted); cursor:pointer; }
.wk-stop:hover { color:#d9534f; border-color:#d9534f; } .wk-stop:disabled { opacity:.6; cursor:default; }
details.steps { margin-top:6px; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); }
details.steps > summary { cursor:pointer; list-style:none; user-select:none; opacity:.8; }
details.steps > summary::before { content:"▸ "; } details.steps[open] > summary::before { content:"▾ "; }
details.steps > summary::-webkit-details-marker { display:none; }
.working { flex-wrap:wrap; } .working > details.steps { flex-basis:100%; margin:0 0 0 36px; }
.steps-list { display:flex; flex-direction:column; gap:3px; margin-top:4px; max-height:320px; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; }
.step { display:flex; flex-wrap:wrap; gap:6px; align-items:baseline; padding:2px 6px; border-left:2px solid var(--line, rgba(127,127,127,.3)); }
.step.error { border-left-color:#d9534f; } .step.running { opacity:.75; }
.step .st-t { font-weight:600; color:var(--fg, inherit); } .step .st-in { font-family:ui-monospace,monospace; white-space:normal; overflow-wrap:anywhere; flex:1 1 140px; min-width:0; }
.step .st-ms { margin-left:auto; opacity:.7; } .step .st-res { flex-basis:100%; opacity:.75; overflow-wrap:anywhere; }
.step.error .st-ic, .step.error .st-res { color:#d9534f; }
.th-sep { text-align:center; font-size:12px; color:var(--muted); padding:2px 0; border-bottom:1px solid var(--line, rgba(127,127,127,.2)); }
.th-empty { opacity:.6; text-align:center; padding:24px 0; }

@media (max-width:820px), (max-height:500px) and (pointer:coarse) {
  .chat-head .nm { min-width:0; flex:1 1 auto; }
}
/* the header's ⋯ (app.js _thMore): copy thread id, ask for status, dev actions, the room */
.th-more { margin-left:auto; flex:none; width:40px; height:40px; border:0; border-radius:4px; background:transparent;
  color:var(--muted); font-size:20px; line-height:1; cursor:pointer; }
.th-more { display:grid; place-items:center; }
.th-more svg { width:20px; height:20px; }
.th-more:hover, .th-more:focus-visible { color:var(--text); background:var(--hover); }
.th-list .msg.pending { opacity:.6; }
#sprint-view .sv-item .card.dc-collapsed { cursor:pointer; }
/* inbox: one place, two views */
.ppl-row { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.ppl-row .btns { display:flex; gap:6px; flex-wrap:wrap; }
/* partner login: owner-only controls hidden (the server refuses them anyway) */
body.member #settings-btn, body.member #jobs-btn, body.member #pause-banner { display:none !important; }
/* a customer workspace: controls whose routes 403 it (POST /pause, /changelog, /system_health,
   /away*) hidden (r15) */
body.customer #pause-banner, body.customer #jobs-tab-changelog,
body.customer #jobs-tab-health, body.customer #sprint-view .sv-pause,
body.customer #away-banner { display:none !important; }
.msg.me .me-by { font-size:12px; opacity:.7; margin-bottom:4px; }
/* agent names inside a reply open that agent's chat */
.ag-link { background:none; border:0; padding:0; font:inherit; color:var(--accent, #6ea8fe); cursor:pointer;
  text-decoration:underline; text-decoration-style:dotted; text-underline-offset:3px; }
.ag-link:hover { text-decoration-style:solid; }
/* an in-app link in a message ([Inbox](#/inbox)): looks like the agent links beside it */
.msg-body a.app-link { color:var(--accent, #6ea8fe); text-decoration:underline dotted; text-underline-offset:2px; word-break:normal; }
.msg-body a.app-link:hover { text-decoration-style:solid; }
/* inbox deck: the conversation under a card; the box sticks to the bottom while it scrolls */
.sv-convo { display:flex; flex-direction:column; margin-top:6px; }
.sv-convo .th-list { flex:none; overflow:visible; padding:6px 0 4px; }
.sv-convo .th-list:empty { display:none; }
.sv-askbar { max-width:720px; width:100%; margin:0 auto; padding:0; box-sizing:border-box; }
.sv-askbar.hidden { display:none; }
.sv-dock { flex:none; display:flex; flex-wrap:wrap; gap:8px; max-width:720px; width:100%; margin:0 auto; padding:8px 0 2px; box-sizing:border-box; }
.sv-dock.hidden { display:none; }
.sv-dock .btn { flex:1; margin:0; }
.sv-dock .btn.red { flex:none; padding-left:14px; padding-right:14px; background:transparent; }   /* two big answers; Discard stays one tap, smaller */
.sv-dock .ql-send-warn { flex:1 0 100%; text-align:center; white-space:normal; }
.sv-item.sv-docked .btns:not(.sv-convo .btns) { display:none; }
.sv-item.sv-opts-docked .sv-card .dc-actions { display:none; }
/* an agent's restated instruction in a thread: Confirm / Change it */
.th-confirm { align-self:flex-start; max-width:720px; width:100%; border:1px solid var(--accent); border-radius:4px; padding:10px 12px; }
.th-confirm .th-cf-t { font-weight:600; margin-bottom:8px; }
.th-confirm .btns { display:flex; gap:8px; }
.th-card { align-self:flex-start; max-width:720px; width:100%; }
/* a settled card (main chat or thread): its outcome line as the green / red / amber pill (PR #150) */
.card.card-settled .dc-c-t { display:inline-flex; align-items:center; padding:2px 10px; border-radius:4px; border:1px solid var(--line, transparent); }
.card.card-settled.oc-ok .dc-c-t { color:var(--ok); border-color:color-mix(in srgb, var(--ok) 45%, transparent); background:color-mix(in srgb, var(--ok) 10%, transparent); }
.card.card-settled.oc-bad .dc-c-t { color:var(--err); border-color:color-mix(in srgb, var(--err) 45%, transparent); background:color-mix(in srgb, var(--err) 10%, transparent); }
.card.card-settled.oc-warn .dc-c-t { color:var(--warn); border-color:var(--warnbd); background:color-mix(in srgb, var(--warn) 10%, transparent); }
.card.card-settled.oc-muted { opacity:.55; }   /* superseded by a newer card: settled, greyed */
#sprint-view .card .msg-actions [data-reply] { display:none; }   /* the deck has its own box under each card */
/* inbox deck: swipe moves between cards; the ‹ Swipe to skip › bar is gone (owner, Oct 24) */
#sprint-view .sv-nav { display:none !important; }
/* a card's small actions (snooze, save for later, open chat, copy ID) — like a message's */
.card-mini { display:flex; gap:6px; margin:8px 0 0 2px; }
.ap-why.muted { opacity:.7; }
/* snooze length picker */
.snz-pick { display:flex; flex-direction:column; gap:6px; padding:8px; min-width:150px; }
.snz-pick .snz-t { font-size:12px; opacity:.6; padding:0 2px 2px; }
.snz-pick .btn { width:100%; }
.th-held { align-self:stretch; border:1px dashed var(--warn); color:var(--warn); border-radius:4px; padding:8px 12px; font-size:13px; display:flex; gap:10px; align-items:center; justify-content:space-between; }
.th-confirm .th-cf-ed { width:100%; box-sizing:border-box; resize:none; border-radius:4px; padding:8px 10px; background:var(--input); color:inherit; border:1px solid var(--line); font:inherit; font-weight:600; margin-bottom:8px; }
.th-confirm.old { opacity:.55; border-style:dashed; } .th-confirm .th-cf-note { font-size:12px; margin-top:4px; }
.th-confirm .th-cf-h { font-size:11px; letter-spacing:.06em; text-transform:uppercase; opacity:.6; margin-bottom:4px; } .th-confirm .th-cf-t ul { margin:0; padding-left:18px; }
/* thread + inbox-card boxes: the main chat's composer (same pill, + and send), minus its page padding */
.thread-view .th-comp.composer { padding:8px 12px calc(10px + env(safe-area-inset-bottom)); }
.sv-askbar .th-comp.composer { padding:6px 0 0; }
.sv-askbar .th-comp.composer form { margin:0; }   /* full card width, like the cards above */
.th-comp .ic.send:disabled { opacity:.5; }
/* menus never run off a phone screen: long items wrap */
.msg-pop { max-width:calc(100vw - 16px); }
.msg-pop .mm { white-space:normal; overflow-wrap:anywhere; }
.msg-pop .mm.on { font-weight:700; background:var(--bubble2); }   /* the inbox view that is open (⋯ menu) */
/* inbox header: one line, ellipsis if still long */
#sprint-view .sv-prog { min-width:0; }
/* inbox header: "Waiting on you" + "X of Y" — one line on desktop; two lines on a phone (no "·"), so it fits beside pause/search/⋯/✕ at 360px */
.sv-prog .sv-cnt { white-space:nowrap; }
@media (max-width:820px), (max-height:500px) and (pointer:coarse) {
  #sprint-view .sv-top { gap:6px; }
  .sv-prog .sv-sep { display:none; }
  .sv-prog .sv-lbl { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .sv-prog .sv-cnt { display:block; margin-top:2px; }
}
.sec-existing { margin:8px 0; padding:10px 12px; border:1px solid var(--accent); border-radius:4px; display:flex; flex-wrap:wrap; gap:8px; align-items:center; } .sec-existing .btn { margin-left:auto; }

/* owner messages sent through Claude: a small label instead of the raw "[sent from Claude]" tag */
.msg.me .via-claude{font-size:11px;font-weight:600;letter-spacing:.02em;opacity:.65;margin:0 0 6px}

/* a sideways swipe in the inbox deck changes cards — never the browser's back/forward */
html, body, #sprint-view, #sprint-view .sv-body { overscroll-behavior-x:none; }

/* a task card that came back after the owner answered it */
.dc-prior { margin:8px 0 10px; padding:8px 12px; border-left:3px solid var(--accent); border-radius:4px; background:var(--elev); font-size:14px; }
.dc-prior .s { opacity:.7; font-size:12.5px; }

/* a task-card choice that was sent as a reply (the card stays open) */
.opt.picked { outline:2px solid var(--accent, #4f8cff); }
/* a choice was sent: the set is locked until the agent offers new options (owner, Oct 27) */
.opt.locked { cursor:default; opacity:.45; pointer-events:none; }
.opt.locked.picked { opacity:1; }
.opt.locked.picked .opt-lbl::after { content:" · Sent"; color:var(--green); font-weight:600; }
.sv-dock .btn.picked::after { content:" · Sent"; font-weight:600; }   /* the pinned copy of a picked option */

/* the run state in the inbox header: pause bars while running, a play arrow (warn colour) when paused */
#sprint-view .sv-pause .sp-play { display:none; }
body.swarm-paused #sprint-view .sv-pause, body.routines-paused #sprint-view .sv-pause { color:var(--warn); opacity:1; }
body.swarm-paused #sprint-view .sv-pause .sp-pause { display:none; }
body.swarm-paused #sprint-view .sv-pause .sp-play { display:inline; }
body.member #sprint-view .sv-pause { display:none !important; }
body.member .sv-card [data-del] { display:none !important; }   /* DELETE /api/tasklist is owner-only */
body.member #tk-addbtn { display:none !important; }   /* POST /api/agents/{id}/tasks is owner-only (review r3) */

/* more of the card / its thread below what you're reading */
.sv-tobottom { position:absolute; right:16px; bottom:90px; z-index:6; padding:8px 14px; border-radius:3px;
  background:var(--elev); color:var(--text); border:1px solid var(--line); box-shadow:0 4px 14px var(--shadow); font-weight:600; font-size:13px; }
.sv-tobottom.hidden { display:none; }
.sv-tobottom.new { border-color:var(--accent, #4f8cff); color:var(--accent, #4f8cff); font-weight:600; }
/* a task waiting on an agent, not on you: muted kicker (Oct 26) */
.dc-kicker.dc-k-team, .dc-card .dc-kicker.dc-k-team { color:var(--muted); }
/* outside-message mark as a chip, not raw "[outside message · …]" text (Oct 26) */
.out-chip { display:inline-block; font-size:calc(10.5px * var(--ui-fs, 1)); font-weight:600; padding:1px 7px; border-radius:3px;
  color:var(--warn); border:1px solid color-mix(in srgb, var(--warn) 45%, transparent); background:color-mix(in srgb, var(--warn) 10%, transparent);
  vertical-align:middle; white-space:nowrap; }
.ap-why a, .dc-detail a { color:var(--accent2); }
.out-line { margin:0 0 4px; }
/* source-app logo (srcicons.js): where a card / task / message came from; tooltip names the app */
.src-ico { display:inline-flex; vertical-align:-3px; width:16px; height:16px; margin-right:6px; flex:none; }
.src-ico img { width:16px; height:16px; border-radius:3px; display:block; }
.ap-eyebrow .src-ico { vertical-align:-4px; }
.out-line .src-ico { vertical-align:-4px; }
/* "From an outside message": the same pill, muted — a provenance note, not an alarm (owner, Oct 27) */
.out-chip.out-muted { color:var(--muted); font-weight:500; border-color:var(--line); background:transparent; }

/* ---- PixelStaff pixel accents: names, headings and chrome go 8-bit; body text stays a
   normal face so long messages read easily ---- */
:root, :root[data-theme="dark"] { --px-font:"Silkscreen",ui-monospace,SFMono-Regular,Menlo,monospace; --grid:rgba(255,255,255,.035); }
:root[data-theme="light"] { --grid:rgba(17,24,39,.055); }
.row-agent .nm, .chat-head .nm, .dt-head .nm, .modal-box h3, .sec-nm, .pin-cell .pin-nm {
  font-family:var(--px-font); font-weight:400; letter-spacing:.02em; }
.sec-nm { letter-spacing:.06em; }
/* a faint pixel grid behind the conversation */
#chat { background-image:linear-gradient(var(--grid) 1px, transparent 1px),
                         linear-gradient(90deg, var(--grid) 1px, transparent 1px);
        background-size:16px 16px; }
/* chunky "pressable" primary buttons: a hard offset shadow, no blur */
.btn.green { box-shadow:0 3px 0 var(--green2); }
.btn.green:active { transform:translateY(2px); box-shadow:0 1px 0 var(--green2); }
/* spinners tick round in 8 steps, like an 8-bit loader */
#ptr svg { width:20px; height:20px; }
#ptr.spin svg { animation-timing-function:steps(8); }
/* pixel icons: no sub-pixel rotation blur on the collapsible carets */
.sec-caret, .cs-car { shape-rendering:crispEdges; }
/* pixel characters: dark eyes on skin in both themes; hover is a 2px hop, never a rotate
   (rotating pixel art blurs it) */
.av .eye { fill:#1b1b20; }
.row-agent:hover .av, .chat-head:hover .av, .dt-head .av:hover { transform:translateY(-2px); }
/* Dress up (agent wardrobe) */
.wd-open { display:inline-flex; align-items:center; gap:6px; margin-top:10px; padding:5px 12px; }
.wd-open svg { width:14px; height:14px; }
/* 80% x 80% (owner, Nov 3 2026); the options scroll and Random / Reset / Save sit under them */
.modal-box:has(.wd) { width:80vw; max-width:none; height:80vh; max-height:80vh; padding:16px 20px; }
.modal-box:has(.wd) > #modal-body { overflow:hidden; }
.modal-box:has(.wd) .cd-head { margin-bottom:8px; }
.wd { display:flex; gap:16px; align-items:stretch; flex:1; min-height:0; }
.wd > .wd-preview { align-self:flex-start; }
.wd-preview { flex:none; position:sticky; top:0; width:156px; height:156px; display:flex; align-items:center;
  justify-content:center; background:var(--deep); border:1px solid var(--line); border-radius:4px;
  background-image:linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size:12px 12px; }
.wd-big { width:140px; height:140px; }
.wd-opts { flex:1; min-width:0; min-height:0; overflow-y:auto; padding-right:4px; }
.wd-sec { margin-bottom:8px; }
.wd-sec .ed-label { margin-bottom:3px; }
.wd-row { display:flex; flex-wrap:wrap; gap:4px; }
.wd-opt { display:flex; flex-direction:column; align-items:center; gap:2px; width:64px; padding:5px 2px 4px;
  border:1px solid var(--line); border-radius:4px; background:var(--card2); color:var(--muted);
  font-size:calc(10px * var(--ui-fs, 1)); line-height:1.2; }
.wd-opt:hover { border-color:var(--faint); color:var(--text); }
.wd-opt.on { border-color:var(--accent); color:var(--text); box-shadow:0 2px 0 var(--accent); }
.wd-mini { width:40px; height:40px; }
.wd-sw { width:26px; height:26px; border-radius:2px; border:2px solid var(--line); }
.wd-sw.auto { width:auto; padding:0 8px; font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); background:var(--card2); }
.wd-sw.on { border-color:var(--text); box-shadow:0 2px 0 var(--accent); }
.wd-actions { flex:none; display:flex; gap:8px; align-items:center; margin-top:8px; padding-top:8px; border-top:1px solid var(--line); }
.wd-actions .sp { flex:1; }
/* Dress Up overhaul (owner, Oct 31): tabs over the options (only the open tab scrolls), a
   clickable preview that waves, toggle tiles for extras, a custom colour swatch per row */
.wd-side { flex:1; min-width:0; min-height:0; display:flex; flex-direction:column; }
.wd-tabs { flex:none; display:flex; gap:2px; border-bottom:1px solid var(--line); margin-bottom:8px; overflow-x:auto; scrollbar-width:none; }
.wd-tabs::-webkit-scrollbar { display:none; }
.wd-tab { flex:none; padding:6px 12px; font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--muted); background:none; border:0;
  border-bottom:2px solid transparent; margin-bottom:-1px; cursor:pointer; }
.wd-tab:hover { color:var(--text); }
.wd-tab[aria-selected="true"] { color:var(--text); border-bottom-color:var(--accent); font-weight:600; }
.wd-tab:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
button.wd-preview { padding:0; cursor:pointer; color:inherit; font:inherit; }
button.wd-preview:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.wd-opt[aria-pressed="true"] { border-color:var(--accent); color:var(--text); box-shadow:0 2px 0 var(--accent); }
.wd-look { width:76px; }
.wd-custom { position:relative; display:inline-flex; align-items:center; justify-content:center; cursor:pointer;
  background:var(--card2); color:var(--muted); font-size:calc(14px * var(--ui-fs, 1)); line-height:1; }
.wd-custom input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; border:0; padding:0; }
@media (max-width:600px) { .modal-box:has(.wd) { width:100vw; height:100dvh; max-height:100dvh; border-radius:0; border:0; padding:12px; }
  .wd { flex-direction:column; align-items:stretch; } .wd-preview { position:static; align-self:center; width:100% !important; height:168px !important; }
  .wd-big.full { height:156px !important; } .wd-opts { max-height:none; flex:1; min-height:0; } }
/* round-head characters (pxicons.js pxAgent): small avatars are a square head-and-shoulders
   crop; .full is the whole body (44×76 cells) — the detail header, the wardrobe, the site */
svg.av.full { aspect-ratio:44 / 76; }
.dt-head .av.full { width:auto; height:152px; }          /* 2px per cell */
main.dt-rail #detail .dt-head .av.full { width:auto; height:56px; }
.wd-preview { height:244px; }
.wd-big.full { width:auto; height:228px; }          /* 3px per cell */
.wd-mini.full { width:44px; height:76px; }          /* 1px per cell */
.wd-opt { width:68px; }
@media (max-width:820px), (max-height:500px) and (pointer:coarse) { .dt-head .av.full { width:auto; height:76px; } }
/* Dress up overhaul (owner, Nov 3 2026, frontend/dressup.js): the character on a scene (a wider
   64x76 stage) with effects; idle bob, blink, flapping wings, a hopping pet and flickering
   flames, all still for prefers-reduced-motion; a colour per part and saved looks; tap targets
   of at least 40px on phones and touch screens */
svg.av.pxa { aspect-ratio:64 / 76; }
.wd-preview { width:208px; }
.wd-big.full.pxa { width:auto; height:228px; }
.wd-mini.full.pxa { width:64px; height:76px; }
.wd-scene { width:72px; }
.wd-chip { width:auto; padding:0 10px; display:inline-flex; align-items:center; gap:6px; font-size:calc(11.5px * var(--ui-fs, 1));
  color:var(--muted); background:var(--card2); cursor:pointer; }
.wd-chip i { flex:none; width:12px; height:12px; border:1px solid var(--line); border-radius:2px; }
/* Colours › Part (owner, Nov 7 2026): full names on phones too (Outfit, Accessory, Facial hair, Back item…);
   the swatch only shows once the part has a colour, so an unset part has no stray "|" */
.wd-row.wd-parts { display:grid; grid-template-columns:repeat(auto-fill, minmax(96px, 1fr)); }
.wd-row.wd-parts .wd-chip { width:auto; min-height:32px; justify-content:center; white-space:normal; text-align:center; overflow:visible; text-overflow:clip; }
/* Dress up 2.0 (Nov 8 2026): section locks, rare items, search, theme picker, palettes */
.wd-sec-h { display:flex; align-items:center; gap:8px; margin-bottom:3px; }
.wd-sec-h .ed-label { margin-bottom:0; }
.wd-lock { margin-left:auto; border:1px solid var(--line); background:none; color:var(--muted); border-radius:4px; padding:1px 8px; font:inherit; font-size:calc(11px * var(--ui-fs, 1)); cursor:pointer; }
.wd-lock.on { border-color:var(--accent); color:var(--text); background:var(--panel2, transparent); }
.wd-opt { position:relative; }
.wd-opt .wd-rare { position:absolute; top:2px; right:3px; color:#f5c542; font-size:11px; line-height:1; text-shadow:0 1px 0 #0006; }
.wd-opt.rare { background-image:linear-gradient(160deg, #f5c54222, transparent 45%); }
.wd-search { flex:none; margin-bottom:6px; }
.wd-search input { width:100%; }
.wd-theme { width:auto; max-width:46%; min-width:0; }
.wd-pal i { width:8px; height:12px; margin-right:-4px; }
.wd-pal i:last-of-type { margin-right:2px; }
.wd-hexrow { align-items:center; gap:8px; }
.wd-hexrow input { width:120px; font-family:var(--mono, monospace); }
.wd-err { color:#ef4444; font-size:calc(12px * var(--ui-fs, 1)); margin-top:4px; }
.wd-saved { display:flex; flex-direction:column; align-items:center; gap:3px; }
.wd-saved-b { display:flex; gap:3px; }
.wd-ic { width:34px; height:28px; border:1px solid var(--line); border-radius:4px; background:var(--card2); color:var(--muted); cursor:pointer; }
.wd-ic:hover { color:var(--text); }
.wd-ic.on { color:#f5c542; border-color:#f5c542; }
.pxa .pxa-body { animation:pxa-bob 2.4s steps(1) infinite; }
.pxa .eyes-inner { animation:blink 4.6s ease infinite; }
.pxa .pxa-wings { transform-box:view-box; transform-origin:22px 46px; animation:pxa-flap 1.1s ease-in-out infinite; }
.pxa .pxa-pet { animation:pxa-hop 1.8s steps(1) infinite; }
.pxa .pxa-flame, .pxs .pxs-flk { animation:pxa-flk .4s steps(1) infinite; }
.pxs .pxs-tw, .pxf .pxf-tw { animation:pxa-tw 1.6s steps(1) infinite; }
.pxs .pxs-wave { animation:pxa-wave 3s steps(3) infinite; }
.pxf .pxf-fl { transform-box:fill-box; transform-origin:50% 100%; animation:pxa-fire .5s steps(2) infinite alternate; }
.pxf .pxf-fall { animation:pxa-fall 3s linear infinite; }
.pxf .pxf-rise { animation:pxa-rise 3.2s ease-in infinite; }
.pxa .pxs-d1 { animation-delay:-.5s; } .pxa .pxs-d2 { animation-delay:-1.1s; } .pxa .pxs-d3 { animation-delay:-1.7s; }
@keyframes pxa-bob { 0%{ transform:none; } 50%{ transform:translateY(1px); } }
@keyframes pxa-flap { 0%,100%{ transform:scaleX(1); } 50%{ transform:scaleX(.86); } }
@keyframes pxa-hop { 0%,100%{ transform:none; } 50%{ transform:translateY(-1px); } }
@keyframes pxa-flk { 0%{ opacity:1; } 50%{ opacity:.55; } }
@keyframes pxa-tw { 0%,100%{ opacity:1; } 50%{ opacity:.15; } }
@keyframes pxa-wave { 0%,100%{ transform:none; } 50%{ transform:translateX(3px); } }
@keyframes pxa-fire { from{ transform:scaleY(1); } to{ transform:scaleY(.72); } }
@keyframes pxa-fall { 0%{ transform:translateY(-30px); opacity:0; } 10%,90%{ opacity:1; } 100%{ transform:translateY(30px); opacity:0; } }
@keyframes pxa-rise { 0%{ transform:translateY(8px); opacity:0; } 20%{ opacity:1; } 100%{ transform:translateY(-14px); opacity:0; } }
@media (prefers-reduced-motion:reduce) {
  .pxa .pxa-body, .pxa .eyes-inner, .pxa .pxa-wings, .pxa .pxa-pet, .pxa .pxa-flame, .pxs *, .pxf * { animation:none !important; } }
@media (max-width:600px), (pointer:coarse) {
  .wd-sw { width:40px; height:40px; } .wd-sw.auto, .wd-chip { min-height:40px; }
  .wd-tab { min-height:40px; padding:8px 14px; } .wd-opt { min-height:40px; } .wd-ic { width:40px; height:40px; }
  .wd-actions .btn, .wd-hexrow .btn, .wd-hexrow input { min-height:40px; }
  .wd-row.wd-parts .wd-chip { width:auto; min-height:40px; }
  .wd-lock { min-height:32px; padding:4px 12px; } .wd-theme { min-height:40px; } .wd-actions { flex-wrap:wrap; row-gap:6px; } }
/* phones: the last row (Hex colour + Apply) scrolls clear of Random / Reset / Save and the home bar */
@media (max-width:600px) { .wd-opts { padding-bottom:calc(72px + env(safe-area-inset-bottom, 0px)); }
  .wd-actions { padding-bottom:env(safe-area-inset-bottom, 0px); } }
/* Dress up grids (owner, Nov 8 2026): no squished tiles on phones. Option tiles and text chips sit in an
   even grid (2-3 columns at 360-420px, more on desktop) with full labels; theme filters are content-sized
   pills with a small count; Lock sits right in the section header; the footer stays on one row
   (two clean rows under 380px). Comes after the phone rules above so it wins over .wd-sw 40x40. */
.wd [hidden] { display:none !important; }
.wd-sec-h { justify-content:space-between; margin:12px 0 6px; min-height:28px; }
.wd-sec:first-child .wd-sec-h { margin-top:2px; }
.wd-sec-h .ed-label { margin:0; flex:1; min-width:0; }
.wd-lock { margin-left:0; flex:none; display:inline-flex; align-items:center; justify-content:center; }
.wd-row.wd-pills { display:flex; flex-wrap:wrap; gap:6px; }
.wd-sw.wd-chip.wd-pill { width:auto; height:auto; min-height:32px; padding:4px 12px; border-radius:999px; border-width:1px;
  white-space:nowrap; font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--text); }
.wd-pill .wd-n { color:var(--muted); font-size:calc(11px * var(--ui-fs, 1)); font-variant-numeric:tabular-nums; }
.wd-pill.on { border-color:var(--accent); }
.wd-pill.on .wd-n { color:var(--muted); }
.wd-row.wd-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(96px, 1fr)); gap:6px; align-items:stretch; }
.wd-row.wd-grid.wd-txt { grid-auto-rows:minmax(44px, auto); }
.wd-grid > .wd-opt, .wd-grid > .wd-saved, .wd-grid > .wd-sw.wd-chip { width:auto; height:auto; min-width:0; }
.wd-grid > .wd-opt { justify-content:flex-start; padding:8px 6px 6px; gap:4px; font-size:calc(12px * var(--ui-fs, 1)); }
.wd-grid > .wd-saved > .wd-opt { width:100%; flex:1; padding:8px 6px 6px; font-size:calc(12px * var(--ui-fs, 1)); }
.wd-grid .wd-opt > span, .wd-grid > .wd-sw.wd-chip { text-align:center; white-space:normal; overflow-wrap:anywhere; line-height:1.25; }
.wd-grid > .wd-sw.wd-chip { position:relative; justify-content:center; padding:6px 18px; border-width:1px;
  font-size:calc(12.5px * var(--ui-fs, 1)); }
.wd-grid .wd-rare, .wd-sw.wd-chip .wd-rare { position:absolute; top:3px; right:4px; font-size:11px; font-weight:400; line-height:1; color:#f5c542;
  text-shadow:0 1px 0 #0006; pointer-events:none; }
.wd-actions { flex-wrap:nowrap; gap:8px; }
.wd-actions .wd-theme { flex:1 1 120px; max-width:260px; min-width:0; }
.wd-actions .btn { flex:none; }
.wd-actions #wd-save { margin-left:auto; padding-left:18px; padding-right:18px; }
.wd-actions .sp { display:none; }
@media (max-width:600px) {
  .wd-actions .wd-theme { max-width:none; }
  .wd-actions .btn { padding-left:12px; padding-right:12px; } }
@media (max-width:379px) {
  .wd-actions { flex-wrap:wrap; }
  .wd-actions .wd-theme { flex:1 1 100%; }
  .wd-actions .btn { flex:1 1 0; }
  .wd-actions #wd-save { margin-left:0; } }

/* ---- Team templates (Settings › Templates): pixel cards, the team as characters ---- */
.tpl-searchrow { display:flex; gap:10px; align-items:center; margin-bottom:10px; }
.tpl-searchrow .conn-search { flex:1; margin-bottom:0; }
.tpl-cats { margin-top:8px; flex-wrap:wrap; width:max-content; max-width:100%; }
.tpl-intro { margin:10px 2px 14px; line-height:1.5; }
.tpl-card { display:flex; flex-direction:column; gap:9px; box-shadow:0 3px 0 var(--line); transition:transform .06s steps(2); }
.tpl-card:hover { transform:translateY(-2px); box-shadow:0 5px 0 var(--scroll2); }
/* first-run empty state: a new customer's Chief of Staff chat (app.js _firstRunPaint) */
.first-run { margin:24px auto; width:100%; max-width:760px; display:flex; flex-direction:column; gap:12px; text-align:center; }
.first-run .fr-h { font-size:20px; font-weight:600; }
.first-run .fr-ai { border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin:10px 0; display:flex; flex-direction:column; gap:6px; }
.first-run .fr-ai-t { font-weight:600; }
.first-run .fr-ai-go { align-self:center; font-weight:600; }
.fr-tpls { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:10px; text-align:left; }
.fr-tpl { cursor:pointer; }
.fr-tpl.fr-sel { outline:2px solid var(--accent); outline-offset:-2px; }
.fr-sug { font-size:12px; font-weight:600; color:var(--accent); }
.first-run .fr-go { align-self:center; }
.fr-prompts { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.fr-prompt { border:1px solid var(--line); background:transparent; color:inherit; border-radius:16px; padding:7px 13px; cursor:pointer; font:inherit; }
.fr-prompt:hover { background:var(--line); }
.tpl-top { display:flex; align-items:center; gap:11px; min-width:0; }
.tpl-ico { flex:none; width:38px; height:38px; display:flex; align-items:center; justify-content:center; border-radius:2px;
  color:var(--accent); background:var(--deep); border:1px solid var(--line); box-shadow:inset 0 -3px 0 var(--line); }
.tpl-ico.big { width:58px; height:58px; }
.tpl-nm, .tpl-hero-nm, .tpl-agent-nm { font-family:var(--px-font); font-weight:400; letter-spacing:.02em; }
.tpl-tag { color:var(--text); font-size:calc(13px * var(--ui-fs, 1)); line-height:1.45; }
.tpl-team { display:flex; gap:4px; min-height:36px; align-items:flex-end; }
.tpl-av { width:34px; height:34px; background:var(--deep); border:1px solid var(--line); border-radius:2px; }
.tpl-av-big { width:56px; height:56px; background:var(--deep); border:1px solid var(--line); border-radius:2px; }
.tpl-apps { display:flex; flex-wrap:wrap; gap:5px; }
.tpl-app { font-size:calc(11px * var(--ui-fs, 1)); padding:3px 7px; border-radius:2px; border:1px solid var(--line); color:var(--muted); background:var(--hover); }
.tpl-app.req { color:var(--text); border-color:var(--scroll2); }
.tpl-app.soon { border-style:dashed; }
.tpl-upd { font-size:calc(10.5px * var(--ui-fs, 1)); padding:2px 6px; border:1px solid var(--warnbd); color:var(--warn); border-radius:2px; }
.tpl-inst-row .biz-acts { gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.tpl-inst-row .btn.sm { padding:5px 12px; font-size:calc(12.5px * var(--ui-fs, 1)); }
/* detail */
.tpl-hero { display:flex; align-items:center; gap:14px; margin:12px 0 6px; }
.tpl-hero-meta { flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
.tpl-hero-nm { font-size:calc(19px * var(--ui-fs, 1)); }
.tpl-dljson { flex:none; color:var(--muted); }
.tpl-desc { color:var(--muted); line-height:1.55; margin:4px 0 6px; font-size:calc(13px * var(--ui-fs, 1)); }
.tpl-agents { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
@media (max-width:760px){ .tpl-agents { grid-template-columns:minmax(0,1fr); } }
.tpl-agent { display:flex; gap:12px; padding:12px; background:var(--card2); border:1px solid var(--line); border-radius:4px; box-shadow:0 3px 0 var(--line); }
.tpl-agent-av { flex:none; }
.tpl-agent-meta { min-width:0; display:flex; flex-direction:column; gap:4px; }
.tpl-agent-nm { font-size:calc(13px * var(--ui-fs, 1)); }
.tpl-agent-d { font-size:calc(12.5px * var(--ui-fs, 1)); line-height:1.45; }
.tpl-skills { display:flex; flex-wrap:wrap; gap:4px; margin-top:2px; }
.tpl-skill { font-size:calc(10.5px * var(--ui-fs, 1)); padding:2px 6px; border-radius:2px; background:var(--hover); color:var(--muted); font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.tpl-badge { font-size:calc(10px * var(--ui-fs, 1)); padding:2px 6px; border-radius:2px; border:1px solid var(--line); color:var(--muted); vertical-align:2px; margin-left:4px; font-weight:500; }
.tpl-badge.req { color:var(--warn); border-color:var(--warnbd); }
.tpl-soon { font-size:calc(10.5px * var(--ui-fs, 1)); padding:3px 8px; border:1px dashed var(--scroll2); color:var(--muted); border-radius:2px; flex:none; }
.tpl-appcard .cc-meta .s { white-space:normal; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.tpl-note { color:var(--muted); font-size:calc(11px * var(--ui-fs, 1)); }
.tpl-acct { background:var(--input); color:var(--text); border:1px solid var(--line); border-radius:2px; padding:3px 6px; font:inherit; max-width:100%; }
.tpl-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 14px; }
@media (max-width:760px){ .tpl-form { grid-template-columns:minmax(0,1fr); } }
.tpl-q { display:flex; flex-direction:column; gap:5px; font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--muted); min-width:0; }
.tpl-q:has(textarea) { grid-column:1/-1; }
.tpl-q input, .tpl-q select, .tpl-q textarea { background:var(--input); border:1px solid var(--bd-ctl); color:var(--text); border-radius:2px;
  padding:8px 10px; font:inherit; font-size:calc(13px * var(--ui-fs, 1)); outline:none; width:100%; resize:vertical; }
.tpl-q input:focus, .tpl-q select:focus, .tpl-q textarea:focus { border-color:var(--accent2); }
.tpl-q em { font-style:normal; color:var(--muted); font-size:calc(11px * var(--ui-fs, 1)); }
.tpl-req { color:var(--warn); font-weight:600; }
.tpl-made { margin:0; padding-left:18px; line-height:1.7; font-size:calc(13px * var(--ui-fs, 1)); }
.tpl-install { position:sticky; bottom:-1px; display:flex; align-items:center; gap:14px; justify-content:flex-end; margin-top:18px; padding:12px 0 4px;
  background:linear-gradient(transparent, var(--panel) 30%); }
.tpl-status { flex:1; font-size:calc(12.5px * var(--ui-fs, 1)); line-height:1.5; }
.tpl-bad { color:var(--warn); }
.tpl-install .btn:disabled { opacity:.45; cursor:not-allowed; box-shadow:none; }
.tpl-errs { margin:8px 0; padding-left:18px; font-size:calc(12.5px * var(--ui-fs, 1)); line-height:1.5; color:var(--muted); text-align:left; }
.tpl-done { display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center; padding:26px 8px; }
.tpl-done-team { display:flex; gap:6px; }
.tpl-done-team .av { animation:tplHop .6s steps(2) 3; }
@keyframes tplHop { 50% { transform:translateY(-4px); } }
.tpl-done-acts { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; }
/* team data */
.td-grid { margin:12px 0 4px; }
.td-desc { margin-top:6px; white-space:normal; }
.td-tbl th, .td-tbl td { text-align:left; max-width:260px; overflow:hidden; text-overflow:ellipsis; }
.td-tbl td.td-acts { text-align:right; white-space:nowrap; }
.td-tbl td.td-acts .go { margin-right:6px; }
.tpl-warn { color:var(--warn); font-size:calc(11.5px * var(--ui-fs, 1)); line-height:1.4; }
.tpl-review .s { margin-bottom:8px; line-height:1.5; }
.tpl-rv { border:1px solid var(--line); border-radius:2px; background:var(--card2); margin:6px 0; }
.tpl-rv summary { cursor:pointer; padding:8px 10px; font-size:calc(12.5px * var(--ui-fs, 1)); }
.tpl-rv pre { margin:0; padding:10px 12px; border-top:1px solid var(--line); white-space:pre-wrap; word-break:break-word;
  max-height:340px; overflow:auto; font-size:calc(12px * var(--ui-fs, 1)); font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.tpl-ack { display:flex; gap:8px; align-items:center; margin-top:10px; font-size:calc(13px * var(--ui-fs, 1)); }
/* template roles: the install picker and Team tools (one card per role) */
.tpl-roles { margin-top:8px; }
.tpl-role { display:flex; flex-direction:column; gap:8px; min-width:0; }
.tpl-role-h .s { white-space:normal; line-height:1.45; margin-top:3px; }
.tpl-role-who { color:var(--muted); }
.tpl-rsel { background:var(--input); color:var(--text); border:1px solid var(--line); border-radius:2px; padding:8px 10px;
  font:inherit; font-size:calc(13px * var(--ui-fs, 1)); width:100%; min-height:40px; }
.tpl-rsel:focus { border-color:var(--accent2); outline:none; }
.tpl-role-note { font-size:calc(12px * var(--ui-fs, 1)); line-height:1.45; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.tpl-role-note:empty { display:none; }
.tpl-role-idle, .tpl-connect { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.tpl-connect { padding-top:8px; border-top:1px dashed var(--line); }
.tpl-connect.hidden { display:none; }
.tpl-ctx textarea { min-height:84px; }
.tpl-opt { font-style:normal; color:var(--muted); font-size:calc(11px * var(--ui-fs, 1)); }

/* a held app call on an approval card: the full arguments, never truncated */
.ap-held .ap-args{white-space:pre-wrap;word-break:break-word;font-size:12px;margin:4px 0 0;padding:6px 8px;background:var(--bg2,rgba(0,0,0,.06));border-radius:6px}
/* commerce approval cards: before → after diff */
.ap-diff { margin:6px 0; overflow-x:auto; }
.ap-diff table { width:100%; border-collapse:collapse; font-size:calc(13px * var(--ui-fs, 1)); }
.ap-diff th, .ap-diff td { text-align:left; padding:4px 6px; border-top:1px solid var(--line); vertical-align:top; word-break:break-word; }
.ap-diff td.ap-diff-b, .ap-diff td.ap-diff-a { white-space:pre-wrap; font-family:ui-monospace, monospace; font-size:12px; max-width:40ch; }
.ap-diff td > .ap-diff-scroll { max-height:16em; overflow:auto; }
.ap-diff th { color:var(--muted, #999); font-weight:500; border-top:none; }
.ap-diff-b { color:var(--muted, #999); }
.ap-diff-a { color:var(--text); font-weight:600; }

/* chat + thread content use up to 80% of the pane on desktop (owner, Oct 28); phones keep 96% */
@media (min-width:821px) and (min-height:501px), (min-width:821px) and (pointer:fine){
  .msg, .th-msg.me, .a2a-group { max-width:80%; }
  .msg.bot .msg-body, .a2a-item .msg-body { max-width:none; }
  #feed .card, .thread-view .card, .th-confirm { max-width:80%; }
}
/* fast custom tooltip ([data-tip], app.js) — replaces the slow native title on icon buttons */
.ui-tip { position:fixed; z-index:11000; pointer-events:none; padding:4px 8px; border-radius:4px; background:var(--card2, #222); color:var(--text);
  border:1px solid var(--line); font-size:12px; line-height:1.3; white-space:nowrap; box-shadow:0 2px 8px rgba(0,0,0,.35);
  opacity:0; visibility:hidden; transition:opacity .08s; }
.ui-tip.on { opacity:1; visibility:visible; }
/* Settings › AI models › Use PixelStaff from your AI apps: URL, one tab per app, setup steps */
.mcp-steps { margin:2px 0 10px; padding-left:22px; line-height:1.6; font-size:calc(13px * var(--ui-fs, 1)); }
.mcp-steps li { margin:0 0 4px; }
.mcp-count { margin:6px 2px 12px; }
.mcp-tabs { display:flex; flex-wrap:wrap; gap:4px; border-bottom:1px solid var(--line); margin-bottom:12px; }
.mcp-tab { padding:7px 12px; font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--muted); background:none; border:0;
  border-bottom:2px solid transparent; margin-bottom:-1px; cursor:pointer; }
.mcp-tab:hover { color:var(--text); }
.mcp-tab[aria-selected="true"] { color:var(--text); border-bottom-color:var(--accent2); font-weight:600; }
.mcp-tab:focus-visible { outline:2px solid var(--accent2); outline-offset:-2px; }
.mcp-panel { min-height:84px; display:flex; flex-direction:column; gap:8px; }
.mcp-panel pre { margin:0; }
.mcp-out { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
@media (max-width:520px){ .mcp-out { flex-direction:column; align-items:flex-start; } }

/* Settings › AI models › Accounts agents run on: one compact row per Claude login */
.acc-list { border:1px solid var(--line); border-radius:4px; }
.acc-row + .acc-row { border-top:1px solid var(--line); }
.acc-row-h { display:flex; align-items:center; gap:10px; padding:9px 10px; cursor:pointer; }
.acc-row-h:hover { background:var(--hover); }
.acc-row-h:focus-visible { outline:2px solid var(--accent2); outline-offset:-2px; }
.acc-row .acc-meta { flex:1; min-width:0; }
.acc-row .acc-n { font-weight:600; font-size:calc(13.5px * var(--ui-fs, 1)); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.acc-row .acc-sum { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.acc-row .acc-edit { flex:none; font-size:calc(12.5px * var(--ui-fs, 1)); }
.acc-row .acc-more { width:30px; height:30px; }
.acc-x { padding:0 10px 12px 50px; }
.acc-x .acc-eff { margin-top:0; padding-top:12px; }
.acc-info { background:none; border:0; padding:0 2px; margin-left:4px; color:var(--muted); cursor:pointer; font-size:calc(13px * var(--ui-fs, 1));
  text-transform:none; letter-spacing:0; vertical-align:0; }
.acc-info:hover { color:var(--text); }
.acc-pop { max-width:min(360px, calc(100vw - 32px)); padding:8px 12px; font-size:calc(12.5px * var(--ui-fs, 1)); line-height:1.5; color:var(--muted); white-space:normal; }
.acc-pop b { color:var(--text); }
.msg-pop .mm.mm-danger { color:var(--err); }
#ai-accts .acct-add { margin-top:8px; }
@media (max-width:620px){
  .acc-row-h { flex-wrap:wrap; }
  .acc-row .acc-meta { flex-basis:calc(100% - 40px); }
  .acc-x { padding-left:10px; }
  .acc-row .acc-more { width:44px; height:44px; }
}
/* the inbox showing the last-known cards while the live ones load (app.js _svStale) */
#sprint-view.sv-stale .sv-body, #sprint-view.sv-stale .sv-askbar, #sprint-view.sv-stale .sv-dock { opacity:.55; transition:opacity .15s; }
#sprint-view .sv-upd { color:var(--muted); }

/* "↓" jump-to-latest button over the bottom-right of a chat feed, just above the composer */
.jump-anchor { position:relative; height:0; flex:none; z-index:5; }
.jump-bottom { position:absolute; bottom:12px; right:max(16px, env(safe-area-inset-right)); width:42px; height:42px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; padding:0; cursor:pointer; background:var(--panel); color:var(--text);
  border:1px solid var(--line); box-shadow:0 4px 14px rgba(0,0,0,.28); transition:opacity .15s, transform .15s; -webkit-tap-highlight-color:transparent; }
.jump-bottom:hover { background:var(--bubble2); }
.jump-bottom:focus-visible { outline:2px solid var(--accent2); outline-offset:2px; }
.jump-bottom.hidden { opacity:0; transform:translateY(6px); pointer-events:none; visibility:hidden; }
@media (pointer:coarse){ .jump-bottom { width:44px; height:44px; } }

/* Inbox + count on the Chief of Staff's pill: the sidebar Inbox look (.icon.ny-btn + .ny-badge) */
.head-ny { flex:none; margin:0 6px 0 2px; opacity:.85; } .head-ny:hover { opacity:1; }
/* ⋯ on the Chief of Staff's chat head: Work rooms (app.js _headRooms); no count pill (owner, Nov 8) */
.head-more { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; padding:0;
  border:0; border-radius:3px; background:transparent; color:var(--muted); cursor:pointer; margin-left:6px; }
.head-more:hover { background:var(--bubble2); color:var(--text); }
@media (pointer:coarse){ .head-more { width:40px; height:40px; } }
.rooms-pop { min-width:260px; max-width:min(420px, calc(100vw - 32px)); }
.rooms-pop .rm-row { display:flex; flex-direction:column; align-items:flex-start; gap:2px; width:100%; text-align:left; }
.rm-row .rm-t { font-weight:600; color:var(--text); overflow-wrap:anywhere; }
.rm-row .rm-n { color:var(--muted); font-size:calc(12px * var(--ui-fs, 1)); overflow-wrap:anywhere; }
.rm-row .rm-n b { color:var(--warn); font-weight:600; }
.rm-row .rm-l { color:var(--muted); font-size:calc(11px * var(--ui-fs, 1)); }
/* the Threads list's "This chat" / "All threads" tabs (app.js _threadsSheet) */
.thl-tabs { display:flex; gap:4px; padding:4px 4px 8px; border-bottom:1px solid var(--line); margin-bottom:6px; }
.thl-tab { border:1px solid var(--line); border-radius:3px; background:transparent; color:var(--muted); padding:4px 10px;
  font-size:calc(12.5px * var(--ui-fs, 1)); cursor:pointer; min-height:32px; }
.thl-panel { display:flex; flex-direction:column; gap:2px; }
.thl-tab.on { background:var(--bubble2); color:var(--text); font-weight:600; }
/* a work room's header: where it's at + who's in it (app.js _roomPaint) */
/* a work room's "where it's at", pinned atop the chat: one line, tap to open (app.js _roomPaint) */
.th-room { margin:8px 12px 0; padding:7px 12px; border:1px solid var(--line); border-radius:4px; background:var(--bubble);
  font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--muted); cursor:pointer; }
.th-room:hover { background:var(--bubble2); }
.th-room.rm-wait { border-color:var(--warnbd); }
.rm-one { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rm-one .rm-k { color:var(--text); font-weight:600; }
.th-room.rm-wait .rm-one .rm-k { color:var(--warn); }
.rm-where { display:flex; flex-direction:column; gap:2px; line-height:1.45; overflow-wrap:anywhere; }
.rm-where .rm-k { display:inline-block; min-width:4.6em; color:var(--text); font-weight:600; }
.th-room.rm-wait .rm-where > div:last-child .rm-k { color:var(--warn); }
/* the composer's "Reply to <lead> ▾" (a work room only) */
.th-to { display:block; max-width:100%; margin:0 0 6px; padding:2px 4px; border:0; background:transparent; color:var(--muted);
  font-size:calc(12.5px * var(--ui-fs, 1)); text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; }
.th-to b { color:var(--text); font-weight:600; }
.th-to svg { width:12px; height:12px; vertical-align:-1px; }
.th-to.hidden { display:none; }
/* in-app sheet (app.js _thSheet): bottom sheet on a phone, 80% × 80% modal on a desktop */
.th-sheet .ths-box { width:80vw; height:80vh; display:flex; flex-direction:column; background:var(--sidebar);
  border:1px solid var(--line); border-radius:4px; overflow:hidden; }
.ths-t { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 14px; border-bottom:1px solid var(--line); font-weight:650; }
.ths-x { border:0; background:transparent; color:var(--muted); font-size:16px; width:36px; height:36px; cursor:pointer; }
.ths-b { flex:1; overflow-y:auto; padding:8px 8px 12px; display:flex; flex-direction:column; gap:2px; }
/* the body scrolls, its rows never shrink: a full list squeezed each row to its min-height and the
   meta line (agents · age) was drawn under the next row's title (threads e2e-visual B3-UNC) */
.ths-b > * { flex-shrink:0; }
.ths-k { padding:8px 10px 4px; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); font-weight:600; }
.ths-row { display:flex; flex-direction:column; align-items:flex-start; gap:2px; width:100%; min-height:44px; padding:10px 12px;
  border:0; border-radius:4px; background:transparent; color:var(--text); text-align:left; cursor:pointer; overflow-wrap:anywhere; }
.ths-row:hover, .ths-row:focus-visible { background:var(--hover); }
.ths-row.on { font-weight:600; }
.ths-note { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); font-weight:400; }
.ths-hint { padding:4px 12px 10px; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); border-bottom:1px solid var(--line); margin-bottom:6px; }
@media (max-width:820px) {
  .ui-dlg.th-sheet { align-items:flex-end; padding:0; }
  .th-sheet .ths-box { width:100%; height:auto; max-height:75vh; border-radius:12px 12px 0 0; border-bottom:0;
    padding-bottom:env(safe-area-inset-bottom); }
}
/* the live working line, like Claude Code's: a pulsing glyph, elapsed time + tokens */
.wk-glyph { display:inline-block; margin-right:6px; color:var(--accent); animation:wk-pulse 1.4s ease-in-out infinite; }
@keyframes wk-pulse { 0%, 100% { opacity:1; transform:scale(1); } 50% { opacity:.3; transform:scale(.82); } }
.wk-meta { color:var(--muted); font-variant-numeric:tabular-nums; white-space:nowrap; }
@media (prefers-reduced-motion:reduce) { .wk-glyph { animation:none; } }
/* pasted IDs as chips (app.js linkRefIds) */
.ref-chip { display:inline; padding:0 5px; border-radius:3px; border:1px solid var(--line); background:var(--bubble2);
  color:var(--accent2); font:0.92em/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; cursor:pointer; }
.ref-chip:hover { border-color:var(--accent2); }
.ref-chip.lib { color:var(--green); }
/* @ in the composer → Library picker (app.js _AT) */
.composer { position:relative; }
.at-pop { position:absolute; left:20px; right:20px; bottom:calc(100% - 6px); max-width:460px; z-index:30; display:flex; flex-direction:column;
  padding:4px; border:1px solid var(--line); border-radius:6px; background:var(--card2); box-shadow:0 8px 24px rgba(0,0,0,.35); }
.at-h { padding:4px 8px; font:400 calc(10px * var(--ui-fs, 1))/1.2 var(--px-font); letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
.at-it { display:flex; align-items:center; gap:8px; padding:7px 8px; border-radius:4px; color:var(--text); text-align:left; background:none; border:0; cursor:pointer; min-width:0; }
.at-it.on, .at-it:hover { background:var(--hover); }
.at-it svg { flex:none; color:var(--green); }
.at-nm { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.at-sub { flex:none; font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); }
@media (max-width:820px){ .at-pop { left:12px; right:12px; } }
.ref-rows { display:grid; gap:3px; margin-bottom:8px; }
.ref-rows span { display:inline-block; min-width:76px; color:var(--muted); }
.ref-pre { white-space:pre-wrap; overflow-wrap:anywhere; max-height:240px; overflow:auto; background:var(--deep);
  border:1px solid var(--line); border-radius:3px; padding:8px; font:12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ref-run { font-size:12px; color:var(--muted); }
/* the agents' cloud Chrome, live (login / owner-step cards + the Browser sheet) */
.lb { display:flex; flex-direction:column; gap:8px; margin:10px 0; }
.lb-bar, .lb-type, .lb-keys { display:flex; gap:6px; align-items:center; }
.lb-url, .lb-txt { flex:1; min-width:0; padding:9px 12px; border-radius:4px; border:1px solid var(--line); background:var(--input); color:inherit; font:inherit; font-size:14px; }
.lb-b { padding:8px 12px; border-radius:4px; border:1px solid var(--line); background:var(--elev); color:var(--text); font:inherit; font-size:14px; }
.lb-keys .lb-b { flex:1; white-space:nowrap; padding:8px 4px; min-width:0; }
.lb-view { position:relative; border:1px solid var(--line); border-radius:4px; overflow:hidden; background:#000; min-height:220px; touch-action:none; }
.lb-img { display:block; width:100%; height:auto; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; -webkit-user-drag:none; }
.lb-img:not([src]) { display:none; }
/* desktop: frames are 1280px (the box Chrome's window), so never stretch past it */
.lb > .lb-view { width:100%; max-width:1280px; margin:0 auto; }
/* instant feedback while the real frame is on its way (a tap ring, a local scroll shift) */
.lb-img { will-change:transform; }
.lb-ring { position:absolute; width:28px; height:28px; margin:-14px 0 0 -14px; border-radius:50%; border:2px solid var(--accent, #3b82f6); pointer-events:none; opacity:0; }
.lb-ring.go { animation:lb-ring .35s ease-out; }
@keyframes lb-ring { from { opacity:.9; transform:scale(.4); } to { opacity:0; transform:scale(1.4); } }
/* on the black browser screen in both themes: light text (the light theme's --text was 1.2:1, axe AA) */
.lb-msg { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; padding:16px; text-align:center; color:#e6e6e9; }
.lb-msg.hidden { display:none; }
.lb-sheet { position:fixed; inset:0; z-index:2000; background:var(--bg); display:flex; flex-direction:column; padding:12px 16px calc(12px + env(safe-area-inset-bottom)); overflow-y:auto; }
.lb-head { display:flex; align-items:center; gap:10px; } .lb-head .s { flex:1; font-size:12px; opacity:.7; }
.lb-tab { position:relative; padding-right:36px !important; max-width:320px; } .lb-tab-t { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lb-tab-x { position:absolute; right:6px; top:50%; transform:translateY(-50%); background:none; border:0; color:var(--muted, #999); font-size:15px; padding:6px; }
/* owner-step card: the exact clicks */
.os-steps { margin:8px 0 8px 20px; padding:0; } .os-steps li { margin:4px 0; }
/* browser check banner: the business's check-before-a-fix-email rule on a card */
.bc-banner { margin:8px 0; padding:8px 10px; border-radius:4px; font-size:13px; border:1px solid var(--line); }
.bc-banner.warn { border-color:#c9a227; background:rgba(201,162,39,.10); }
.bc-banner.ok { border-color:#3a9a5b; background:rgba(58,154,91,.10); }
.bc-shot { display:inline-block; height:56px; margin:6px 6px 0 0; border-radius:3px; border:1px solid var(--line); vertical-align:top; }

/* Settings › Accounts: Claude in Chrome per account */
.acc-chrome { margin-top:2px; font-size:12px; }
.cic-dot { font-size:11px; margin-right:2px; } .cic-dot.on { color:#3a9a5b; } .cic-dot.bad { color:#c94a3a; } .cic-dot.off { color:var(--muted, #999); }

/* Settings › Apps: names, descriptions and status wrap (never cut off); category chips;
   Connected first, then Available to connect; the 80% × 80% details panel */
#gbody[data-st="apps"] .conn-card .cc-head { align-items:flex-start; }
#gbody[data-st="apps"] .conn-card .cc-t,
#gbody[data-st="apps"] .conn-card .cc-meta .s { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
#gbody[data-st="apps"] .conn-card .cc-meta { overflow:visible; }
#gbody[data-st="apps"] .conn-card .cc-desc { color:var(--text); opacity:.82; line-height:1.45; margin-top:2px; }
#gbody[data-st="apps"] .conn-card .cc-st { margin-top:3px; line-height:1.45; }
#gbody[data-st="apps"] .conn-card .cc-head > .cdot, #gbody[data-st="apps"] .conn-card .cc-head > .cc-chev { margin-top:8px; }
#gbody[data-st="apps"] .conn-card .cc-about { flex:none; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); background:none; border:none; padding:2px 4px; cursor:pointer; }
#gbody[data-st="apps"] .conn-card .cc-about:hover { color:var(--accent2); }
#gbody[data-st="apps"] .conn-cats { margin-bottom:8px; }
#gbody[data-st="apps"] .conn-cats .fbtn { display:inline-flex; align-items:center; gap:6px; }
.conn-n { font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); font-weight:500; letter-spacing:0; }
.conn-sub-h { font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--muted); font-weight:600; margin:14px 2px 8px; }
.conn-cat-h + .conn-sub-h { margin-top:0; }
.conn-tag { font-size:calc(11px * var(--ui-fs, 1)); font-weight:500; color:var(--muted); border:1px solid var(--line); border-radius:3px; padding:1px 6px; margin-left:6px; white-space:nowrap; vertical-align:1px; }
.ui-dlg-box.app-detail { width:80vw; height:80vh; max-width:none; max-height:none; padding:24px 28px; gap:18px; }
.app-detail .ad-head { display:flex; align-items:center; gap:14px; }
.app-detail .ad-head .cc-ico { width:40px; height:40px; }
.app-detail .ad-head .cc-ico img { width:26px; height:26px; }
.app-detail .ad-hm { min-width:0; }
.app-detail .ad-hm .s { margin-top:3px; }
.app-detail .ad-body { flex:1 1 auto; flex-shrink:1; overflow-y:auto; display:grid; gap:16px; align-content:start; min-height:0; }
.app-detail .ad-l { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); font-weight:600; margin-bottom:4px; }
.app-detail .ad-v { font-size:calc(14px * var(--ui-fs, 1)); line-height:1.55; overflow-wrap:anywhere; }
.app-detail .ad-ul { margin:2px 0 0 18px; padding:0; }
@media (max-width:760px){ .ui-dlg-box.app-detail { width:100%; height:100%; padding:18px 16px; } }

/* Settings › Computer: status rows, the terminal and the browser live view */
.cmp-stat { display:flex; gap:12px; align-items:baseline; padding:6px 0; border-bottom:1px solid var(--line); font-size:calc(13px * var(--ui-fs, 1)); }
.cmp-k { min-width:110px; opacity:.75; }
.cmp-v { font-weight:560; } .cmp-v[data-tone="ok"] { color:var(--ok); } .cmp-v[data-tone="warn"] { color:var(--warn); }
.cmp-acts { display:flex; flex-wrap:wrap; gap:8px; margin:4px 0 10px; }
.cmp-pane { margin-bottom:18px; }
.cmp-pane-h { display:flex; align-items:center; gap:8px; margin-bottom:6px; } .cmp-pane-t { flex:1; font-weight:600; }
.cmp-term { height:min(420px, 60vh); padding:6px; border:1px solid var(--line); border-radius:4px; background:#0b0f14; overflow:hidden; }
.cmp-term .xterm { height:100%; }
.cmp-vnc { display:flex; flex-direction:column; gap:8px; }
.cmp-screen { height:min(520px, 62vh); touch-action:none; }
.cmp-screen > div:not(.lb-msg) { width:100%; height:100%; }

/* "Connect your AI" (app.js renderAiWizard): API key (recommended) or a developer terminal */
.aiw-opts { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:10px; margin:6px 0 4px; }
.aiw-opt { display:flex; flex-direction:column; gap:6px; align-items:flex-start; padding:12px; border:1px solid var(--line); border-radius:4px; }
.aiw-h { font-weight:600; font-size:calc(13.5px * var(--ui-fs, 1)); display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.aiw-hint code { padding:1px 5px; border-radius:3px; background:var(--bubble2); }
.aiw .cmp-term { margin:8px 0; }
.aiw-foot { display:flex; align-items:center; gap:10px; } .aiw-foot .aiw-wait { flex:1; }
.aiw-ok { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; margin:4px 0 6px; } .aiw-ok b { color:var(--ok); }
.aiw-err { margin-top:6px; }
.login-ai { margin-top:14px; text-align:left; width:100%; }
/* setup screen (app.js showSetup): Start trial → Connect your AI → Open your team */
#login-card.setup { width:460px; }
.setup-steps { width:100%; text-align:left; }
/* the Onboarding agent's setup conversation, at the end of its chat (app.js showSetup) */
.setup-convo { display:flex; flex-direction:column; gap:14px; }
.setup-convo .msg.bot.wide { align-self:stretch; }
.setup-convo .msg.bot.wide .msg-body { max-width:none; }
.setup-convo .msg-body p { margin:0 0 6px; } .setup-convo .msg-body p:last-child { margin-bottom:0; }
.setup-convo .setup-names { border-bottom:0; margin:8px 0 4px; padding:0; }
.setup-convo .setup-go { margin-top:8px; }
/* the composer banners repeat what the conversation already asks */
body.setup-on #chat:has(.setup-convo) .ai-banner { display:none; }
.setup-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:12px; }
.setup-step { display:flex; gap:10px; align-items:flex-start; }
.setup-mark { flex:0 0 24px; height:24px; border-radius:50%; border:1px solid var(--line); display:flex; align-items:center; justify-content:center; font-size:12px; }
.setup-step.done .setup-mark { background:var(--green, #2e9d5b); border-color:transparent; color:var(--ongreen); }
.setup-step.pending:not(.next) { opacity:.7; }
.setup-body { flex:1; display:flex; flex-direction:column; gap:4px; min-width:0; }
.setup-t { font-weight:600; display:flex; gap:8px; align-items:center; }
.setup-go { align-self:flex-start; margin-top:4px; }
.setup-foot { margin-top:12px; text-align:center; }
.setup-names { width:100%; text-align:left; display:flex; flex-direction:column; gap:6px; margin-bottom:14px; padding-bottom:12px; border-bottom:1px solid var(--line); }
.setup-names-row { display:flex; gap:10px; flex-wrap:wrap; }
.setup-names-row label { flex:1 1 160px; display:flex; flex-direction:column; gap:4px; font-size:12px; }
.setup-names-b { display:flex; gap:8px; align-items:center; }
.ai-banner button { background:var(--accent2, var(--warn)); color:var(--onwarn); }
#bill-banner.invite { border-color:var(--line); color:var(--text); }
#bill-banner.invite button { background:var(--green); color:var(--ongreen); box-shadow:0 3px 0 var(--green2); }
#bill-banner.invite button:active { transform:translateY(2px); box-shadow:0 1px 0 var(--green2); }
.ai-note .ai-note-b { margin-left:6px; }
body.ai-needed #chat-form .ic.send { opacity:.5; }

/* Inbox deck: the business sidebar and phone business button are gone (owner, Oct 31); never shown */
.sv-side, .sv-bizbtn { display:none !important; }
.sv-bizbtn { display:none; align-items:center; gap:6px; max-width:40vw; height:32px; padding:0 10px; border-radius:4px; flex:none;
  border:1px solid var(--line); background:var(--input); color:var(--text); font:inherit; font-size:calc(12.5px * var(--ui-fs, 1)); font-weight:600; cursor:pointer; }
.sv-bizbtn span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sv-bizbtn b { font-weight:700; color:var(--muted); }
.sv-biz { display:flex; align-items:center; gap:8px; width:100%; padding:8px 10px; border:0; border-radius:4px; background:transparent;
  color:var(--text); font:inherit; font-size:calc(13.5px * var(--ui-fs, 1)); text-align:left; cursor:pointer; }
.sv-biz:hover { background:var(--hover); }
.sv-biz.on { background:var(--bubble2); font-weight:700; }
.sv-biz-n { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sv-biz-c { min-width:22px; padding:1px 6px; border-radius:3px; background:var(--green); color:var(--ongreen); font-size:calc(11.5px * var(--ui-fs, 1)); font-weight:700; text-align:center; }
.sv-biz-c.zero { background:var(--input); color:var(--muted); }
.sv-biz-note { padding:6px 10px; font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); }
.sv-wait:empty { display:none; }
.sv-wait { margin-top:12px; border-top:1px solid var(--line); padding-top:8px; }
.sv-fu-h b { font-weight:700; color:var(--muted); margin-left:6px; }
.sv-fu { display:grid; grid-template-columns:1fr auto; gap:0 6px; align-items:center; padding:6px 10px; border-radius:4px; }
.sv-fu:hover { background:var(--hover); }
.sv-fu.held { opacity:.6; }
.sv-fu-n { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:calc(12.5px * var(--ui-fs, 1)); font-weight:600; }
.sv-fu-s { grid-column:1; font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); }
.sv-fu-b { grid-column:2; grid-row:1 / span 2; padding:3px 8px; border:1px solid var(--line); border-radius:4px; background:var(--input);
  color:var(--text); font:inherit; font-size:calc(11px * var(--ui-fs, 1)); cursor:pointer; }
.sv-pop-list { min-width:220px; max-height:60vh; overflow-y:auto; padding:4px; }
/* ---- Cases (backend/cases.py): one card per situation in the inbox deck ---- */
.case-head { margin:0 0 8px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:var(--card2); }
.case-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; min-width:0; }
.case-l { font-size:calc(11px * var(--ui-fs, 1)); font-weight:650; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); }
.case-t { font-weight:600; min-width:0; overflow-wrap:anywhere; }
.case-n { color:var(--muted); font-size:calc(12px * var(--ui-fs, 1)); }
.case-badge { font-size:calc(11px * var(--ui-fs, 1)); font-weight:600; padding:1px 7px; border-radius:999px; background:var(--warn); color:var(--onwarn); }
.case-head { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; }
.case-head .case-row { flex:1 1 auto; }
.case-acts { display:flex; align-items:center; gap:8px; margin-left:auto; }
.case-do { font-size:calc(11px * var(--ui-fs, 1)); font-weight:650; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); }
.case-head .case-close { font-size:calc(12px * var(--ui-fs, 1)); }
.case-head .case-stale { flex-basis:100%; }
.case-gate { margin:8px 0; padding:8px 10px; border:1px solid var(--warnbd); border-radius:10px; }
.case-gate-t { font-weight:600; font-size:calc(13px * var(--ui-fs, 1)); }
.case-gate .case-reraise { margin-top:6px; }
.case-chip { font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); margin:0 0 4px; }
.case-older { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); margin:0 0 4px; }
.card.case-older-card { opacity:.7; }
@media (max-width:820px) {
  /* mobile: Close case leaves the title row — its own row under the title, full width */
  .case-acts { flex-basis:100%; margin-left:0; justify-content:space-between; }
}
.case-stale { margin-top:6px; padding:6px 8px; border-radius:8px; border:1px solid var(--warnbd); font-size:calc(13px * var(--ui-fs, 1)); }
/* a case's other live cards, as steps on its one deck page */
.case-steps { margin:10px 0 0; display:flex; flex-direction:column; gap:8px; }
.case-steps-t { color:var(--muted); font-size:calc(13px * var(--ui-fs, 1)); font-weight:600; }
.case-step > .card { margin:0; }
.case-hist { margin:8px 0 0; border:1px solid var(--line); border-radius:10px; padding:6px 10px; background:var(--card2); }
.case-hist > summary { cursor:pointer; color:var(--muted); font-size:calc(13px * var(--ui-fs, 1)); }
.case-items { display:flex; flex-direction:column; gap:6px; margin:8px 0 4px; }
.case-item { padding:6px 8px; border-radius:8px; background:var(--bubble); }
.case-item.old { opacity:.55; }
.case-it { overflow-wrap:anywhere; }
.case-k { font-size:calc(11px * var(--ui-fs, 1)); font-weight:650; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); margin-right:4px; }
.case-st { color:var(--muted); font-size:calc(12px * var(--ui-fs, 1)); margin-left:4px; }
.case-why { color:var(--muted); font-size:calc(12px * var(--ui-fs, 1)); margin-top:2px; }
.case-item .case-drop { margin-top:4px; font-size:calc(12px * var(--ui-fs, 1)); }
.case-ev { margin:6px 0 2px; padding-left:18px; font-size:calc(13px * var(--ui-fs, 1)); }
.case-ev li { margin:2px 0; color:var(--muted); overflow-wrap:anywhere; }
.case-ev li.mat { color:var(--text); }
.case-when { color:var(--muted); font-variant-numeric:tabular-nums; margin-right:4px; }

/* Jobs page (#/jobs): active background jobs across every agent */
#jobs-box { flex:1; min-height:0; display:flex; flex-direction:column; overflow:hidden; background:var(--sidebar); }
.jobs-meta { font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); margin-right:8px; white-space:nowrap; }
.jobs-tbl { border-collapse:collapse; width:100%; font-size:calc(12.5px * var(--ui-fs, 1)); }
.jobs-tbl th, .jobs-tbl td { border-bottom:1px solid var(--div); padding:8px 10px; text-align:left; vertical-align:top; }
.jobs-tbl thead th { position:sticky; top:0; z-index:1; background:var(--elev); color:var(--muted); font-weight:600; font-size:calc(11px * var(--ui-fs, 1)); letter-spacing:.3px; }
.jobs-tbl th.num, .jobs-tbl td.num { text-align:center; white-space:nowrap; }
.jobs-tbl tbody tr { cursor:pointer; }
.jobs-tbl tbody tr:hover, .jobs-tbl tbody tr:focus { background:var(--bubble2); outline:none; }
.jobs-tbl td.jobs-title { overflow-wrap:anywhere; }
.jobs-st { display:inline-block; padding:1px 8px; border-radius:10px; font-size:calc(11.5px * var(--ui-fs, 1)); background:var(--div); }
.jobs-st.running { background:rgba(46,160,67,.2); }
.jobs-st.queued { background:rgba(210,153,34,.2); }
.jobs-st.interrupted { background:rgba(219,109,40,.22); white-space:nowrap; }
.jobs-st.open { background:rgba(210,153,34,.2); white-space:nowrap; }
.jobs-note { margin-top:2px; color:var(--muted); font-size:calc(11.5px * var(--ui-fs, 1)); }
.jobs-next { color:var(--accent, var(--muted)); }
.jobs-close { padding:2px 8px; border-radius:6px; border:1px solid var(--div); background:transparent; color:inherit; font-size:calc(11.5px * var(--ui-fs, 1)); cursor:pointer; white-space:nowrap; }
.jobs-filters { display:flex; flex-wrap:wrap; gap:6px; margin:2px 4px 8px; }
.jobs-chip { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:14px; border:1px solid var(--div); background:transparent; color:inherit; font-size:calc(12.5px * var(--ui-fs, 1)); cursor:pointer; }
.jobs-chip.on { background:var(--div); font-weight:600; }
.jobs-sec { margin:14px 4px 6px; font-size:calc(13px * var(--ui-fs, 1)); font-weight:600; display:flex; align-items:center; gap:6px; }
.jobs-sec:first-child { margin-top:2px; }
.jobs-n { min-width:20px; padding:0 6px; border-radius:10px; background:var(--div); color:var(--muted); font-size:calc(11.5px * var(--ui-fs, 1)); text-align:center; font-variant-numeric:tabular-nums; }
.jobs-kind { display:inline-block; margin-left:6px; color:var(--muted); font-size:calc(11px * var(--ui-fs, 1)); }
.jobs-lanes { margin:0 4px 8px; color:var(--muted); font-size:calc(11.5px * var(--ui-fs, 1)); overflow-wrap:anywhere; }
.jobs-place { display:inline-block; min-width:22px; text-align:center; font-variant-numeric:tabular-nums; }
.jobs-costhint { color:var(--muted); font-size:12px; white-space:nowrap; font-variant-numeric:tabular-nums; }
/* Done archive (#/jobs/done, Oct 31): tasks + jobs finished in the last 7-30 days */
.jobs-tabs { display:flex; gap:6px; margin-left:12px; }
.jobs-tabs .mem-chip { white-space:nowrap; }   /* "Change log" stays on one line on a phone */
/* search row (Nov 2): search · Jobs/Tasks/All · Filter button; the Done tab's dropdowns sit in its popover */
.jobs-search { display:flex; align-items:center; gap:8px; padding-bottom:8px; position:relative; }
.jobs-search .conn-search { flex:1; min-width:0; margin-bottom:0; }
.jobs-kind-sw .jobs-filters { margin:0; flex-wrap:nowrap; }
.jobs-fbtn { white-space:nowrap; }
.jobs-fbtn .jobs-n { margin-left:4px; }
.jobs-fpanel { position:absolute; right:14px; top:calc(100% - 2px); z-index:5; width:min(300px, calc(100vw - 32px));
  background:var(--elev); border:1px solid var(--line); border-radius:4px; padding:10px; box-shadow:0 6px 20px rgba(0,0,0,.35); }
.dn-tools { display:flex; flex-direction:column; gap:8px; }
.dn-tools select { max-width:none; width:100%; }
.dn-tools .dn-reset { align-self:flex-end; }
@media (max-width:640px){ .jobs-search { flex-wrap:wrap; } .jobs-search .conn-search { flex-basis:100%; } }
.dn-chart { display:flex; align-items:flex-end; gap:4px; height:96px; margin:4px 4px 14px; padding-bottom:18px; position:relative; }
.dn-bar { flex:1 1 0; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%;
  cursor:pointer; background:none; border:0; padding:0; color:var(--muted); font:inherit; position:relative; }
.dn-bar i { display:block; width:100%; max-width:34px; border-radius:3px 3px 0 0; background:var(--accent, #2ea043); opacity:.75; min-height:2px; }
.dn-bar:hover i, .dn-bar:focus i { opacity:1; }
.dn-bar b { font-size:calc(10.5px * var(--ui-fs, 1)); font-weight:600; font-variant-numeric:tabular-nums; margin-bottom:2px; color:var(--text); }
.dn-bar span { position:absolute; bottom:-17px; font-size:calc(10px * var(--ui-fs, 1)); white-space:nowrap; }
.dn-chart.many .dn-bar span { display:none; }
.dn-chart.many .dn-bar:nth-child(7n+1) span { display:inline; }
.dn-sum { display:flex; flex-wrap:wrap; gap:6px; margin:0 4px 12px; }
.dn-sum .mem-chip { cursor:pointer; }
.dn-day { scroll-margin-top:8px; }
.jobs-st.failed { background:rgba(248,81,73,.2); }
.jobs-st.done { background:rgba(46,160,67,.2); }
.jobs-bulkbar { display:flex; justify-content:flex-end; margin:2px 4px 4px; }
.jobs-bulkbar select, .jobs-prio { background:var(--input); color:var(--text); border:1px solid var(--bd-ctl); border-radius:4px;
  padding:3px 6px; font-size:calc(12px * var(--ui-fs, 1)); }
.jobs-tbl td.jobs-ck, .jobs-tbl th.jobs-ck { width:28px; padding-right:0; }
.jobs-tbl td.jobs-act { width:1%; }
.jobs-cancel { padding:2px 10px; font-size:calc(11.5px * var(--ui-fs, 1)); }
.jobs-p { display:inline-block; min-width:56px; padding:1px 8px; border-radius:10px; background:var(--div); font-size:calc(11.5px * var(--ui-fs, 1)); }
.jobs-p.high { background:rgba(218,54,51,.2); }
.jobs-p.low { color:var(--muted); }
.ui-dlg-box.big { width:80vw; height:80vh; max-width:none; max-height:none; }
.jobs-confirm-list { margin:12px 0 0; padding-left:18px; color:var(--text); }
.jobs-confirm-list li { margin:4px 0; overflow-wrap:anywhere; }
@media (max-width:820px), (max-height:500px) and (pointer:coarse){
  .jobs-tbl, .jobs-tbl tbody { display:block; width:100%; }
  .jobs-tbl thead { display:none; }
  .jobs-tbl tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:3px 8px; padding:12px 4px; border-bottom:1px solid var(--div); }
  .jobs-tbl td { border:none; padding:0; min-width:0; }
  .jobs-tbl td.jobs-agent { font-weight:600; }
  .jobs-tbl td.jobs-title { grid-column:1 / -1; font-size:calc(13.5px * var(--ui-fs, 1)); }
  .jobs-tbl td.num { text-align:left; font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--muted); }
  .jobs-tbl td.num[data-l]::before { content:attr(data-l) " "; }
  .jobs-tbl td.jobs-ck:empty, .jobs-tbl td.jobs-cost:empty { display:none; }
  .jobs-tbl td.jobs-act { width:auto; }
  .ui-dlg-box.big { width:100vw; height:100dvh; border-radius:0; }
}

/* Jobs › Health (#/jobs/health, Nov 6): alert strip, KPI row (.us-kpis), then a card grid */
.hl-alert { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; margin:0 4px 8px; padding:9px 12px;
  border:1px solid var(--warnbd); border-left:3px solid var(--warn); border-radius:4px; background:var(--card2); overflow-wrap:anywhere; }
.hl-alert b { color:var(--warn); }
.hl-alert span { color:var(--text); font-size:calc(12.5px * var(--ui-fs, 1)); }
.hl-alert .hl-since { color:var(--muted); margin-left:auto; font-size:calc(11.5px * var(--ui-fs, 1)); }
.hl-kpis { margin:4px 4px 12px; }
.hl-of { font-size:calc(13px * var(--ui-fs, 1)); color:var(--muted); font-weight:500; }
.hl-owner { display:flex; align-items:center; gap:10px; margin:0 4px 6px; padding:9px 12px; background:var(--card2);
  border:1px solid var(--line); border-radius:4px; }
.hl-owner-t { flex:1; min-width:0; overflow-wrap:anywhere; }
.hl-owner-t .jobs-kind { margin-left:0; }
.hl-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:10px; margin:4px 4px 6px; }
.hl-card { background:var(--card2); border:1px solid var(--line); border-radius:4px; padding:10px 12px; min-width:0; }
.hl-card.hl-wide { grid-column:1 / -1; }
.hl-h { font-size:calc(12.5px * var(--ui-fs, 1)); font-weight:600; margin-bottom:6px; }
.hl-row { display:flex; align-items:center; gap:8px; justify-content:space-between; padding:2px 0;
  font-size:calc(12px * var(--ui-fs, 1)); font-variant-numeric:tabular-nums; min-width:0; }
.hl-row > span:first-child { color:var(--muted); flex:none; }
.hl-ell { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:right; }
.hl-warn { color:var(--warn); font-weight:600; }
.hl-spark { display:block; width:100%; height:44px; }
.hl-spark rect { fill:var(--accent); opacity:.8; }
.hl-bar { flex:1; height:6px; background:var(--div); border-radius:3px; overflow:hidden; }
.hl-bar i { display:block; height:100%; background:var(--accent2); }
.hl-bar i.over { background:var(--err); }
#jobs-btn { position:relative; }
#jobs-btn.hl-dot::after { content:""; position:absolute; top:6px; right:8px; width:8px; height:8px; border-radius:50%;
  background:var(--warn); box-shadow:0 0 0 2px var(--sidebar); }
@media (max-width:760px){
  .hl-grid { grid-template-columns:minmax(0,1fr); }
  .hl-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .hl-owner { flex-wrap:wrap; }
  .hl-owner .btn { min-height:40px; }
}

/* Agent memory and rules (#/a/<id>/memory): read-only list, Edit → select → Bulk actions */
#mem-box { width:80vw; height:80vh; max-width:none; background:var(--sidebar); border:1px solid var(--line);
  border-radius:4px; display:flex; flex-direction:column; overflow:hidden; }
.mem-tools { display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:8px 14px; border-bottom:1px solid var(--div); }
.mem-tools .conn-search { flex:1 1 220px; margin:0; }
.mem-chips { display:flex; flex-wrap:wrap; gap:6px; }
.mem-chip { border:1px solid var(--line); background:var(--input); color:var(--text); border-radius:12px; padding:3px 10px; cursor:pointer; font-size:calc(12px * var(--ui-fs, 1)); }
.mem-chip.on { background:var(--bubble2); border-color:var(--muted); }
.mem-chip b, .mem-n { font-weight:600; font-variant-numeric:tabular-nums; margin-left:4px; }
.mem-acts { display:flex; gap:6px; margin-left:auto; }
.mem-g { margin-bottom:14px; }
.mem-help { margin:-2px 0 6px; }
.mem-it { display:flex; gap:8px; align-items:flex-start; overflow-wrap:anywhere; }
.mem-tx { flex:1; min-width:0; }
.mem-edit1 { flex:none; align-self:center; }
.mem-ck { margin-top:3px; flex:none; }
.mem-more { margin:2px 0 0; }
.mem-counts { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:6px; margin-bottom:10px; }
.mem-count { text-align:center; border:1px solid var(--div); border-radius:4px; padding:6px 4px; }
.mem-count b { display:block; font-size:calc(16px * var(--ui-fs, 1)); font-variant-numeric:tabular-nums; }
.mem-count span { color:var(--muted); font-size:calc(11px * var(--ui-fs, 1)); }
@media (max-width:820px), (max-height:500px) and (pointer:coarse){
  #mem-modal { padding:0; align-items:stretch; }
  #mem-box { width:100vw; height:100dvh; border-radius:0;
    padding-top:env(safe-area-inset-top); padding-bottom:env(safe-area-inset-bottom); }
  .mem-counts { grid-template-columns:repeat(2, minmax(0,1fr)); }
  .mem-acts { margin-left:0; width:100%; }
  .mem-acts select { flex:1; }
  .mem-chip, .mem-acts .btn, .mem-acts select { min-height:36px; }
}

/* time-limited cards (card_meta.deadline): a live countdown; red within the hour; past it the
   approve button goes and a plain note says why (task ed763b50, Oct 31) */
.exp-chip { font-variant-numeric:tabular-nums; text-align:center; min-width:9ch; }
.exp-chip.exp-soon, .exp-chip.exp-gone { color:var(--bad, #c0392b); border-color:color-mix(in srgb, var(--bad, #c0392b) 45%, transparent);
  background:color-mix(in srgb, var(--bad, #c0392b) 10%, transparent); }
.exp-note { margin:6px 0; font-size:calc(12.5px * var(--ui-fs, 1)); color:var(--muted); }
.sv-exp { margin-left:6px; }

/* Sidebar Agents | Dashboards switch: always visible, while dash.css loads on first use */

/* "While you were away" (Nov 4): banner in the chat column + the 80x80 modal panel */
.away-banner { border-color:var(--accent2); color:var(--text); }
.away-banner { cursor:pointer; }
.away-banner:hover { background:var(--hover); }
.away-banner:focus-visible { outline:2px solid var(--accent2); outline-offset:2px; }
.away-banner #away-banner-t { flex:1; min-width:0; }
.away-banner button.away-x { flex:none; background:transparent; color:var(--muted); padding:5px 8px; margin-left:auto; }
.away-banner button.away-x:hover { color:var(--text); }
.away h2 { margin:0 0 4px; }
.away .s { color:var(--muted); font-size:calc(12px * var(--ui-fs, 1)); }
.away-stats { display:grid; grid-template-columns:repeat(auto-fit, minmax(120px, 1fr)); gap:8px; margin:14px 0 6px; }
.away-stat { display:flex; flex-direction:column; align-items:center; text-align:center; gap:2px; padding:10px 6px;
  border:1px solid var(--line); border-radius:4px; color:var(--text); text-decoration:none; }
.away-stat b { font-size:calc(22px * var(--ui-fs, 1)); font-variant-numeric:tabular-nums; }
.away-stat span { color:var(--muted); font-size:calc(12px * var(--ui-fs, 1)); }
.away-stat.zero b { color:var(--muted); }   /* muted, not faded: opacity took the label under 4.5:1 (i11221145 B5a) */
.away-sec { margin-top:16px; }
.away-sec h3 { display:flex; align-items:center; gap:8px; margin:0 0 6px; font-size:calc(14px * var(--ui-fs, 1)); }
.away-n { min-width:22px; text-align:center; padding:0 6px; border-radius:10px; background:var(--line); font-size:calc(12px * var(--ui-fs, 1)); }
.away-sec ul { list-style:none; margin:0; padding:0; }
.away-row { padding:7px 0; border-bottom:1px solid var(--line); }
.away-row.bad .away-link { color:var(--err); }
.away-link { color:var(--text); font-weight:600; text-decoration:none; }
.away-link:hover { text-decoration:underline; }
.away-note { margin-top:3px; color:var(--muted); font-size:calc(12px * var(--ui-fs, 1)); }
.away-empty { margin:24px 0; text-align:center; }
.away-brief { margin:12px 0 4px; padding:12px 14px; border:1px solid var(--line); border-left:3px solid var(--accent2); border-radius:6px; }
.away-brief h3 { display:flex; align-items:center; gap:8px; margin:0 0 6px; font-size:calc(14px * var(--ui-fs, 1)); }
.away-regen { margin-left:auto; border:0; background:transparent; color:var(--muted); cursor:pointer; font-size:calc(14px * var(--ui-fs, 1)); }
.away-head { margin:0 0 10px; }
.away-divs { display:grid; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); gap:4px 18px; }
.away-div h4 { display:flex; align-items:center; gap:8px; margin:8px 0 4px; font-size:calc(13px * var(--ui-fs, 1)); }
.away-div ul { margin:0; padding-left:18px; }
.away-div li { margin:2px 0; font-size:calc(13px * var(--ui-fs, 1)); line-height:1.4; }
.away-foot { display:flex; justify-content:flex-end; margin-top:16px; }
/* white on the light theme's blue in both themes: 5.2:1 (the dark --accent2 #3b82f6 was 3.7:1, axe AA) */
.away-foot button { border:0; border-radius:4px; padding:7px 16px; background:#2563eb; color:#fff; font-weight:600; cursor:pointer; }
body.member #away-banner { display:none !important; }
/* "What you missed" (owner, Nov 5): the AI brief on demand, a Jobs view in the page (#/jobs/missed, Nov 11) */
body.member .jb-item[data-jv="missed"] { display:none !important; }   /* the brief is the owner's view */
.missed-view { display:flex; flex-direction:column; gap:12px; min-height:100%; padding-top:14px; }
/* Jobs header on phones (owner, Nov 5, Android ~390px): the row wraps instead of pushing the button off
   the right edge. Jobs + tabs + close stay on row 1, the counts take row 2 (ellipsis if too long) and
   "What you missed" gets its own full-width row with a 44px tap target. */
#jobs-box .search-head { flex-wrap:wrap; row-gap:8px; }
#jobs-box .search-head .jobs-tabs { min-width:0; }
@media (max-width:640px){
  #jobs-box .search-head { padding:12px 14px; }
  #jobs-box .jobs-meta { order:2; flex:1 1 100%; min-width:0; margin-right:0; overflow:hidden; text-overflow:ellipsis; }
}
.missed-body { flex:1 1 auto; display:flex; flex-direction:column; }
.missed-body > .missed-wait, .missed-body > .missed-err { flex:1; }
.missed-wait { display:flex; align-items:center; justify-content:center; gap:10px; height:100%; color:var(--muted); }
.missed-spin { width:16px; height:16px; border:2px solid var(--line); border-top-color:var(--accent2); border-radius:50%; animation:missed-spin .8s linear infinite; }
@keyframes missed-spin { to { transform:rotate(360deg); } }
.missed-err { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; height:100%; color:var(--muted); text-align:center; }
.missed-foot { display:flex; justify-content:flex-end; margin-top:14px; }
/* a shared business's agent (another workspace's): who shares it */
.row-agent .sh-by { font-size:calc(10px * var(--ui-fs, 1)); color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sh-link { display:flex; align-items:center; gap:6px; margin-top:10px; }
.sh-link code { flex:1; min-width:0; overflow-wrap:anywhere; font-size:12px; }

/* ---- inbox deck as a Slack-style catch-up card (owner, Nov 7) ----
   top bar: ✕ · "N left" · Undo; the card is one rounded, raised panel (who it's from, what it asks
   and its thread scrolling, the box to ask that agent at its bottom); its buttons sit below it */
#sprint-view { background:var(--sidebar); }
#sprint-view .sv-top { gap:8px; padding:4px 0 12px; max-width:720px; width:100%; margin:0 auto; box-sizing:border-box; }
#sprint-view .sv-x { order:-1; width:40px; height:40px; border-radius:20px; color:var(--text); }
#sprint-view .sv-prog { text-transform:none; letter-spacing:0; font-weight:500; color:var(--muted); text-align:center; }
#sprint-view .sv-prog .sv-left { display:block; margin:0; font-size:calc(16px * var(--ui-fs, 1)); font-weight:700; color:var(--text); }
#sprint-view .sv-prog .sv-lbl { display:inline-block; max-width:60%; vertical-align:bottom; margin-top:1px; font-size:calc(12px * var(--ui-fs, 1)); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#sprint-view .sv-prog .sv-sep, #sprint-view .sv-prog .sv-cnt { display:inline; margin:0; font-size:calc(12px * var(--ui-fs, 1)); }
#sprint-view .sv-prog .sv-bar { height:3px; margin:6px auto 0; max-width:160px; }
.sv-undo { flex:none; height:36px; padding:0 12px; border-radius:18px; border:1px solid var(--line); background:var(--panel); color:var(--text);
  font-weight:600; font-size:calc(14px * var(--ui-fs, 1)); font-variant-numeric:tabular-nums; }
.sv-undo.hidden { display:none; }
body.sv-lock .undo-bar { display:none; }            /* the top bar's Undo carries it while the deck is open */
.sv-stack { padding-bottom:0; }
.sv-stack.more::before { top:-4px; left:14px; right:14px; bottom:96px; border-radius:16px; }
.sv-frame { background:var(--sidebar); border:0; border-radius:16px; padding:0; gap:12px; }
.sv-panel { flex:1; min-height:0; display:flex; flex-direction:column; background:var(--panel); border:1px solid var(--line); border-radius:16px;
  box-shadow:0 6px 24px var(--shadow), 0 1px 3px var(--shadow); overflow:hidden; }
.sv-head { flex:none; display:flex; align-items:center; gap:10px; padding:12px 16px; border-bottom:1px solid var(--line); }
.sv-head.hidden { display:none; }
.sv-av { flex:none; width:36px; height:36px; border-radius:10px; overflow:hidden; background:var(--bubble); display:inline-flex; align-items:center; justify-content:center; }
.sv-av > * { width:100%; height:100%; }
.sv-who { min-width:0; display:flex; flex-direction:column; line-height:1.25; }
.sv-who b { font-size:calc(15px * var(--ui-fs, 1)); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sv-who b.sv-who-link { cursor:pointer; }
.sv-who b.sv-who-link:hover { text-decoration:underline; }
.sv-who span { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sv-panel .sv-body { padding:0 16px; }
.sv-panel .sv-askbar { flex:none; padding:8px 12px 12px; border-top:1px solid var(--line); background:var(--panel); }
.sv-panel .sv-askbar .th-comp.composer { padding:0; }
/* the card's answers: below the card, a full-width pair (first filled, the rest outlined); a third wraps to its own row */
.sv-dock { gap:10px; padding:0; }
.sv-dock .btn { flex:1 1 calc(50% - 5px); min-width:0; min-height:48px; margin:0; border-radius:12px; font-size:calc(15px * var(--ui-fs, 1)); font-weight:600; }
.sv-dock .btn:not(.green) { background:transparent; border:1.5px solid var(--line); color:var(--text); box-shadow:none; }
.sv-dock .btn.red { flex:1 1 calc(50% - 5px); padding-left:14px; padding-right:14px; color:var(--err); border-color:var(--line); background:transparent; }
.sv-dock .btn.green { border:1.5px solid var(--green); }
@media (max-width:820px), (max-height:500px) and (pointer:coarse) {
  #sprint-view { padding-left:12px; padding-right:12px; }
  .sv-panel .sv-body { padding:0 14px; }
}
/* sentence case inside the deck: the cards' small labels aren't shouted in capitals */
#sprint-view :is(.ap-eyebrow, .ap-why-l, .ap-gh, .dc-kicker, .sv-fk, .case-l, .case-do, .case-k, .th-cf-h) { text-transform:none; letter-spacing:.01em; }
/* desktop: the Needs-you deck uses ~90% of the width (owner, Nov 8); phones keep the full-width column */
@media (min-width:821px) and (min-height:501px), (min-width:821px) and (pointer:fine){
  #sprint-view { padding-left:5%; padding-right:5%; }
  #sprint-view .sv-stack, #sprint-view .sv-nav, #sprint-view .sv-askbar, #sprint-view .sv-item,
  #sprint-view .sv-stack .card, #sprint-view .sv-dock { max-width:none; }
}

/* Owner Inbox v2 (docs/owner-inbox-v2.md): the deck's shell, the three lanes as tabs, a list of cards */
#owner-inbox { position:absolute; inset:0; z-index:300; background:var(--sidebar); display:none; flex-direction:column;
  padding:calc(10px + env(safe-area-inset-top)) 16px calc(14px + env(safe-area-inset-bottom)); overflow:hidden; }
#owner-inbox.on { display:flex; }
#owner-inbox .sv-top { gap:8px; padding:4px 0 12px; max-width:720px; width:100%; margin:0 auto; box-sizing:border-box; align-items:center; }
#owner-inbox .sv-x { width:44px; height:44px; border-radius:22px; color:var(--text); }
#owner-inbox :is(.ap-eyebrow, .ap-why-l, .ap-gh, .dc-kicker) { text-transform:none; letter-spacing:.01em; }
.oi-tabs { flex:1; min-width:0; display:flex; gap:6px; }
.oi-tabs button { flex:1; min-width:0; min-height:44px; border-radius:22px; border:1px solid var(--line); color:var(--muted);
  font-weight:600; font-size:calc(14px * var(--ui-fs, 1)); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; padding:0 8px; }
@media (max-width:420px){ .oi-tabs { gap:4px; } .oi-tabs button { font-size:calc(13px * var(--ui-fs, 1)); padding:0 4px; } }
/* In Progress / Done (owner, Nov 22: the Jobs page in the inbox): the Library's search bar, job cards, Load more */
.oi-find { max-width:720px; width:100%; margin:0 auto 10px; } .oi-find[hidden] { display:none; }
.oi-step { font-size:calc(13px * var(--ui-fs, 1)); color:var(--muted); margin:0 0 8px; overflow-wrap:anywhere; }
.oi-jd summary { cursor:pointer; min-height:32px; display:flex; align-items:center; color:var(--muted); font-size:calc(13px * var(--ui-fs, 1)); }
.oi-jd-r { display:flex; justify-content:space-between; gap:12px; padding:4px 0; border-top:1px solid var(--line); font-size:calc(13px * var(--ui-fs, 1)); }
.oi-jd-r > span:first-child { color:var(--muted); flex:none; } .oi-jd-r select { min-height:36px; }
.oi-more { align-self:center; min-height:44px; }
.oi-tabs button[aria-selected="true"] { color:var(--text); border-color:var(--text); background:var(--panel); }
.oi-n { font-variant-numeric:tabular-nums; }
/* the inbox board (owner, Nov 22): a column per sidebar group, scrolling sideways; a phone stacks them as sections */
.oi-chips { display:flex; flex-wrap:wrap; gap:6px; max-width:720px; width:100%; margin:0 auto; }
.oi-chip { min-height:36px; padding:0 12px; border-radius:18px; border:1px solid var(--line); color:var(--muted); background:none; font-weight:600; }
.oi-chip[aria-pressed="true"] { color:var(--text); border-color:var(--text); background:var(--panel); }
.oi-chip-sep { width:1px; align-self:stretch; background:var(--line); margin:0 4px; }   /* type chips | business chips */
.oi-who { display:flex; align-items:center; gap:8px; min-width:0; margin-bottom:4px; }
.oi-avs { display:inline-flex; flex:none; } .oi-avs svg { width:32px; height:32px; }
.oi-avs svg + svg { margin-left:-12px; }
.oi-av-nm { font-weight:600; font-size:calc(13px * var(--ui-fs, 1)); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.oi-what { margin:0 0 6px; }
.oi-state { font-weight:600; font-size:calc(14px * var(--ui-fs, 1)); margin:0 0 6px; overflow-wrap:anywhere; }
.oi-s-working { color:var(--ok); } .oi-s-blocked { color:var(--err); } .oi-s-restarting, .oi-s-waiting { color:var(--warn); }
.oi-jd-sec { padding:6px 0; border-top:1px solid var(--line); } .oi-jd-h { font-weight:600; font-size:calc(13px * var(--ui-fs, 1)); margin-bottom:4px; }
.oi-jd-sub { color:var(--muted); font-weight:400; font-family:ui-monospace, monospace; }
.oi-feed { margin:0; padding-left:18px; font-size:calc(12.5px * var(--ui-fs, 1)); } .oi-feed li { margin:2px 0; } .oi-feed li.bad { color:var(--err); }
.oi-feed-t, .oi-feed-r { color:var(--muted); } .oi-feed-r { overflow-wrap:anywhere; }
.oi-pre { white-space:pre-wrap; max-height:240px; overflow:auto; margin:0; font-size:calc(12px * var(--ui-fs, 1)); }
.oi-msg { max-height:240px; overflow:auto; font-size:calc(13px * var(--ui-fs, 1)); }
.oi-list { max-width:720px; width:100%; margin:0 auto; display:flex; flex-direction:column; gap:12px; padding-bottom:24px; min-width:0; }
.oi-card { min-width:0; overflow-wrap:anywhere; }
.oi-card .btns .btn, .oi-card .dc-opt { min-height:44px; }
.oi-card .dc-opt { width:100%; text-align:left; }
.oi-card .dc-custom { width:100%; margin-top:10px; box-sizing:border-box; }
.oi-meta { font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); margin:2px 0 8px; }
.oi-err { color:var(--err); font-size:calc(13px * var(--ui-fs, 1)); margin-top:8px; }
.oi-err[hidden] { display:none; }
.oi-card.oi-folded > :not(.oi-fold):not(.card-tools) { display:none; }   /* optimistic fold: body kept for a rollback */
.oi-row { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; padding:6px 0; border-top:1px solid var(--line); }
.oi-row-l { flex:1; min-width:0; display:flex; align-items:center; gap:10px; min-height:44px; cursor:pointer; }
.oi-row-l input { flex:none; width:20px; height:20px; }
.oi-row-t { min-width:0; overflow-wrap:anywhere; }
.oi-row-r { font-size:calc(12px * var(--ui-fs, 1)); color:var(--green); }
.oi-row-r.bad { color:var(--err); }
.oi-row-link { width:32px; height:32px; border-radius:4px; color:var(--muted); display:flex; align-items:center; justify-content:center; }
.oi-row-link svg { width:15px; height:15px; }
.oi-row-link:hover, .oi-row-link:focus-visible { background:var(--hover); color:var(--text); }
.oi-row-link.ma-ok { color:var(--green); }
.oi-row-d { flex-basis:100%; min-width:0; }
.oi-row-d summary { cursor:pointer; color:var(--muted); font-size:calc(12px * var(--ui-fs, 1)); min-height:32px; display:flex; align-items:center; }
@media (max-width:820px), (max-height:500px) and (pointer:coarse) { #owner-inbox { padding-left:12px; padding-right:12px; } }

/* the open cards a card's thread is about, pinned above its talk (owner, Nov 8) */
.th-pins { display:flex; flex-direction:column; gap:8px; padding:10px 12px; border-bottom:1px solid var(--line); max-height:55vh; overflow-y:auto; flex:none; }
.th-pins-t { font-size:calc(11px * var(--ui-fs, 1)); font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--warn); }
.th-pins .th-card > .card { max-width:none; }
/* deck: "2 of 9 ▾" opens the list of every open card */
.sv-prog .sv-cnt { background:none; border:0; padding:0 2px; font:inherit; color:inherit; letter-spacing:inherit; text-transform:inherit; cursor:pointer; text-decoration:underline dotted; text-underline-offset:3px; }
.sv-prog .sv-cnt:hover { color:var(--text); }
/* Dress up 2.0 (Nov 8 2026): motion for the extra scenes, effects and auras (frontend/_stage_more.js).
   Scoped like the existing .pxf rules; auras carry "pxa-aura pxs pxf" so the old pxs-/pxf- rules apply to them too. */
.pxf .pxf-flash { animation:pxf-flash 3.2s steps(1) infinite; }
.pxf .pxf-jit { animation:pxf-jit .9s steps(1) infinite; }
.pxf .pxf-sway { animation:pxf-sway 1.6s steps(2) infinite alternate; }
.pxf .pxf-meteor { animation:pxf-meteor 2.6s linear infinite; }
.pxf .pxf-glow { animation:pxf-glow 2.4s steps(3) infinite alternate; }
@keyframes pxf-flash { 0%,100%{ opacity:0; } 4%{ opacity:1; } 7%{ opacity:.2; } 10%{ opacity:1; } 14%{ opacity:0; } }
@keyframes pxf-jit { 0%{ transform:none; } 20%{ transform:translateX(-2px); } 40%{ transform:translateX(1px); } 60%{ transform:none; } 80%{ transform:translateX(2px); } }
@keyframes pxf-sway { from{ transform:translateX(-1px); } to{ transform:translateX(2px); } }
@keyframes pxf-meteor { 0%{ transform:translate(12px,-12px); opacity:0; } 10%{ opacity:1; } 55%,100%{ transform:translate(-18px,18px); opacity:0; } }
@keyframes pxf-glow { from{ opacity:1; } to{ opacity:.45; } }
@media (prefers-reduced-motion: reduce) {
  .pxf .pxf-flash, .pxf .pxf-jit, .pxf .pxf-sway, .pxf .pxf-meteor, .pxf .pxf-glow, .pxa-aura * { animation:none !important; } }
/* Dress up 2.0 stage 2 (Nov 8 2026): moves. Idle loops (.mv-*) and pet moves (.pm-* first pet,
   .pm2-* second pet) are whole-pixel steps() loops on the dress-up stage; emotes (.em-on) are
   frames drawn by frontend/dressup.js, so the idle loop pauses while one plays. */
.pxa .pxa-body { transform-box:view-box; transform-origin:22px 70px; }
.pxa .pxa-pet { transform-box:fill-box; transform-origin:50% 100%; }
.pxa.mv-still .pxa-body { animation:none; }
.pxa.mv-bounce .pxa-body { animation:mv-bounce .8s steps(1) infinite; }
.pxa.mv-sway .pxa-body { animation:mv-sway 1.6s steps(1) infinite; }
.pxa.mv-breathe .pxa-body { animation:mv-breathe 3s steps(1) infinite; }
.pxa.mv-hop .pxa-body { animation:mv-hop 1.4s steps(1) infinite; }
.pxa.mv-spin .pxa-body { animation:mv-spin 2.4s steps(1) infinite; }
.pxa.mv-float .pxa-body { animation:mv-float 3s steps(1) infinite; }
.pxa.mv-shuffle .pxa-body { animation:mv-shuffle 2s steps(1) infinite; }
.pxa.mv-dance .pxa-body { animation:mv-dance 1.2s steps(1) infinite; }
.pxa.mv-nod .pxa-body { animation:mv-nod 2s steps(1) infinite; }
.pxa.mv-wiggle .pxa-body { animation:mv-wiggle .4s steps(1) infinite; }
.pxa.mv-jog .pxa-body { animation:mv-jog .5s steps(1) infinite; }
.pxa.mv-tiptoe .pxa-body { animation:mv-tiptoe 2.4s steps(1) infinite; }
.pxa.mv-headbob .pxa-body { animation:mv-headbob .5s steps(1) infinite; }
.pxa.pm-still .pxa-pet:not(.pxa-pet2), .pxa.pm2-still .pxa-pet2 { animation:none; }
.pxa.pm-wag .pxa-pet:not(.pxa-pet2), .pxa.pm2-wag .pxa-pet2 { animation:pm-wag .5s steps(1) infinite; }
.pxa.pm-follow .pxa-pet:not(.pxa-pet2), .pxa.pm2-follow .pxa-pet2 { animation:pm-follow 3s steps(1) infinite; }
.pxa.pm-spin .pxa-pet:not(.pxa-pet2), .pxa.pm2-spin .pxa-pet2 { animation:pm-spin 1.6s steps(1) infinite; }
.pxa.pm-bounce .pxa-pet:not(.pxa-pet2), .pxa.pm2-bounce .pxa-pet2 { animation:pm-bounce .6s steps(1) infinite; }
.pxa.pm-zoomies .pxa-pet:not(.pxa-pet2), .pxa.pm2-zoomies .pxa-pet2 { animation:pm-zoomies 1.2s steps(1) infinite; }
.pxa.pm-nap .pxa-pet:not(.pxa-pet2), .pxa.pm2-nap .pxa-pet2 { animation:pm-nap 3.2s steps(1) infinite; }
.pxa.em-on .pxa-body, .pxa.em-on .pxa-pet { animation:none; }
@keyframes mv-bounce { 0%{ transform:none; } 50%{ transform:translateY(-2px); } }
@keyframes mv-sway { 0%,50%{ transform:none; } 25%{ transform:translateX(1px); } 75%{ transform:translateX(-1px); } }
@keyframes mv-breathe { 0%{ transform:none; } 50%{ transform:scaleY(1.03); } }
@keyframes mv-hop { 0%,60%{ transform:none; } 70%{ transform:translateY(-3px); } 80%{ transform:translateY(-4px); } 90%{ transform:translateY(-2px); } }
@keyframes mv-spin { 0%,60%{ transform:none; } 70%{ transform:scaleX(.5); } 80%{ transform:scaleX(-1); } 90%{ transform:scaleX(-.5); } }
@keyframes mv-float { 0%{ transform:none; } 17%,83%{ transform:translateY(-1px); } 33%,67%{ transform:translateY(-2px); } 50%{ transform:translateY(-3px); } }
@keyframes mv-shuffle { 0%{ transform:none; } 16%{ transform:translateX(-1px); } 33%{ transform:translateX(-2px); } 50%{ transform:translateX(-3px); } 66%{ transform:translateX(-2px) scaleX(-1); } 83%{ transform:translateX(-1px) scaleX(-1); } }
@keyframes mv-dance { 0%{ transform:none; } 25%{ transform:translate(-1px,-1px); } 50%{ transform:scaleX(-1); } 75%{ transform:translate(1px,-1px) scaleX(-1); } }
@keyframes mv-nod { 0%,20%,40%{ transform:none; } 10%,30%{ transform:translateY(1px); } }
@keyframes mv-wiggle { 0%{ transform:translateX(-1px); } 50%{ transform:translateX(1px); } }
@keyframes mv-jog { 0%{ transform:none; } 50%{ transform:translateY(-1px); } }
@keyframes mv-tiptoe { 0%{ transform:none; } 25%{ transform:translate(1px,-1px); } 50%{ transform:translateX(2px); } 75%{ transform:translate(1px,-1px); } }
@keyframes mv-headbob { 0%{ transform:none; } 50%{ transform:translateY(1px); } }
@keyframes pm-wag { 0%{ transform:translateX(-1px); } 50%{ transform:translateX(1px); } }
@keyframes pm-follow { 0%,100%{ transform:none; } 25%{ transform:translateX(-2px); } 50%{ transform:translateX(-4px) scaleX(-1); } 75%{ transform:translateX(-2px) scaleX(-1); } }
@keyframes pm-spin { 0%,50%{ transform:none; } 62%{ transform:scaleX(.5); } 75%{ transform:scaleX(-1); } 87%{ transform:scaleX(-.5); } }
@keyframes pm-bounce { 0%{ transform:none; } 50%{ transform:translateY(-2px); } }
@keyframes pm-zoomies { 0%{ transform:none; } 20%{ transform:translateX(-3px); } 40%{ transform:translateX(-6px) scaleX(-1); } 60%{ transform:translateX(-3px) scaleX(-1); } 80%{ transform:translateX(2px); } }
@keyframes pm-nap { 0%{ transform:none; } 50%{ transform:scaleY(.9); } }
.wd-note { color:var(--muted); font-size:calc(12px * var(--ui-fs, 1)); padding:4px 0; }
.wd-row.wd-reacts { display:flex; flex-direction:column; gap:6px; }
.wd-react { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.wd-react span { flex:1 1 160px; min-width:0; }
.wd-react select { flex:1 1 140px; min-width:0; min-height:36px; }
@media (prefers-reduced-motion:reduce) {
  .pxa[class*="mv-"] .pxa-body, .pxa[class*="pm-"] .pxa-pet, .pxa[class*="pm2-"] .pxa-pet, .pxa .pxa-pet:not(.pxa-pet2), .pxa .pxa-pet2,
  .pxa.em-on .pxa-body, .wd-emo * { animation:none !important; } }

/* Office view (#/office): the pixel office, one person per agent (PixelStaff HQ, frontend/hq/hq.js) */
/* in the main container (owner, Nov 11: not a modal): it takes the chat's place, both sidebars folded to rails */
#office-view { display:none; }
main.ofc-on #chatgrid, main.ofc-on #dashview, main.ofc-on .pg-view { display:none !important; }
main.ofc-on #office-view:not(.hidden) { display:flex; flex-direction:column; min-width:0; min-height:0; }
#office-box { flex:1; min-height:0; }
/* opening / closing the office folds the sidebars at once (app.js _ofcSnap): no grid animation for the engine to relayout through */
main.ofc-snap { transition:none !important; }
/* nor while it's open: a sidebar toggle snaps (the grid columns animated through the canvas, a relayout a frame) */
main.ofc-on { transition:none; }
#office-box .search-head h3 { margin:0; }
/* someone's card + chat: a drawer that slides out from the office's right side (like the shop), not a second modal */
#office-who-modal { position:absolute; top:0; right:0; bottom:0; width:min(1000px, 100%); z-index:4; display:flex; line-height:1.4;
  box-shadow:-8px 0 24px rgba(0,0,0,.35); animation:ofc-drawer .18s ease-out; }
@keyframes ofc-drawer { from { transform:translateX(40px); opacity:0; } to { transform:none; opacity:1; } }
@media (prefers-reduced-motion:reduce){ #office-who-modal { animation:none; } }
#office-who-box { flex:1; min-width:0; display:flex; flex-direction:row; background:var(--sidebar); border-left:1px solid var(--line); overflow:hidden; outline:none; }
.ofc-who-body a { color:var(--accent); }
.ofc-who-foot a.btn, .ofc-who-foot a.btn:visited { color:var(--text); }
.ofc-who-card { flex:0 0 min(440px, 44%); display:flex; flex-direction:column; min-height:0; border-right:1px solid var(--line); }
.ofc-chat { flex:1; min-width:0; display:flex; flex-direction:column; min-height:0; }
/* collapsed (the default): a slim strip with the avatar, name and state; the drawer is narrower too, so more of the office shows */
.ofc-who-tog { font-size:calc(16px * var(--ui-fs, 1)); }
#office-who-modal.ofc-who-mini { width:min(740px, 100%); }
.ofc-who-mini .ofc-who-card { flex:0 0 132px; }
.ofc-who-mini .ofc-who-head { flex-direction:column; align-items:center; text-align:center; gap:6px; padding:12px 8px; border-bottom:0; position:relative; }
.ofc-who-mini .ofc-who-av svg { width:48px; height:83px; }
.ofc-who-mini .ofc-who-id { width:100%; } .ofc-who-mini .ofc-who-id h3 { font-size:calc(13px * var(--ui-fs, 1)); overflow-wrap:anywhere; }
.ofc-who-mini .ofc-who-id p:nth-of-type(1) { font-size:calc(11px * var(--ui-fs, 1)); }
.ofc-who-mini .ofc-who-body { display:none; }
.ofc-who-mini .ofc-who-foot { margin-top:auto; flex-direction:column; padding:10px 8px; }
.ofc-who-mini .ofc-who-foot .btn { text-align:center; padding-left:6px; padding-right:6px; }
.ofc-who-mini #office-who-close { display:none; }
.ofc-who-mini #office-who-x { position:absolute; top:4px; right:4px; }
.ofc-chat-log { flex:1; overflow:auto; padding:14px 16px; display:flex; flex-direction:column; gap:8px; }
.ofc-msg { max-width:86%; align-self:flex-start; }
.ofc-msg.me { align-self:flex-end; }
.ofc-msg-b { background:var(--bg, #15161c); border:1px solid var(--line); border-radius:6px; padding:8px 11px; overflow-wrap:anywhere; }
.ofc-msg-b > :first-child { margin-top:0; } .ofc-msg-b > :last-child { margin-bottom:0; }
.ofc-msg.me .ofc-msg-b { background:rgba(92,208,138,.12); border-color:rgba(92,208,138,.35); }
.ofc-msg.pending { opacity:.7; } .ofc-msg.failed .ofc-msg-b { border-color:#ef4444; }
.ofc-msg-t { display:block; font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); margin-top:3px; }
.ofc-msg.me .ofc-msg-t { text-align:right; }
.ofc-chat-form { display:flex; gap:8px; align-items:flex-end; padding:10px 12px; border-top:1px solid var(--line); }
.ofc-chat-form textarea { flex:1; resize:none; background:var(--bg, #15161c); color:var(--text); border:1px solid var(--bd-ctl); border-radius:6px; padding:8px 10px; font:inherit; max-height:120px; }
/* a card raised in this chat: a one-line chip (its title, a link to the inbox) */
.ofc-card-chip .ofc-msg-b { padding:5px 10px; font-size:calc(12.5px * var(--ui-fs, 1)); border-style:dashed; }
.ofc-card-chip a { color:var(--accent); }
#office-box { max-width:none; background:var(--sidebar); display:flex; flex-direction:column; overflow:hidden; outline:none; }
/* the header's counts: one line that gives way to the buttons (820-1100px was crowded) */
.office-meta { flex:1; min-width:0; text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* getting around: a timeline under the canvas, its own row so it hides nothing (the whole office, a tick per place, a window for what's on screen) */
.ofc-tl { position:relative; flex:none; padding:6px 20px 4px; background:#0b0d17; border-top:1px solid rgba(255,255,255,.12);
  line-height:normal; touch-action:none; cursor:grab; user-select:none; -webkit-user-select:none; }
.ofc-tl.on { cursor:grabbing; } .ofc-tl:focus-visible { outline:2px solid #5cd08a; outline-offset:-2px; }
.ofc-tl-track { position:relative; height:34px; }
.ofc-tl-track::before { content:""; position:absolute; left:0; right:0; top:9px; height:2px; background:rgba(255,255,255,.18); }
/* the window rides a full-width layer moved by transform (app.js _ofcSync): no layout a frame while the camera moves */
.ofc-tl-pos { position:absolute; left:0; right:0; top:0; height:20px; pointer-events:none; will-change:transform; }
.ofc-tl-pos .ofc-tl-win { left:0; pointer-events:auto; }
.ofc-tl-win { position:absolute; top:0; height:20px; min-width:28px; border:2px solid #ffcf4a; border-radius:3px; background:rgba(255,207,74,.12); box-sizing:border-box; display:flex; align-items:center; justify-content:center; overflow:visible; }
.ofc-tl-win b { display:none; position:absolute; bottom:-15px; left:50%; transform:translateX(-50%); color:#ffcf4a; font-size:calc(11px * var(--ui-fs, 1)); white-space:nowrap; pointer-events:none; }
.ofc-tl-win.at-l b { left:0; transform:none; } .ofc-tl-win.at-r b { left:auto; right:0; transform:none; }
.ofc-tl-ticks .ofc-tk { position:absolute; top:3px; transform:translateX(-50%); background:none; border:0; padding:0 2px; color:#c9c7d4; font:inherit; font-size:calc(10.5px * var(--ui-fs, 1)); cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:3px; }
.ofc-tl-ticks i { display:block; width:8px; height:14px; background:#8a93ad; border-radius:1px; }
.ofc-tl-ticks span { white-space:nowrap; max-width:110px; overflow:hidden; text-overflow:ellipsis; }
.ofc-tl-ticks .ofc-tk:hover span { color:#fff; }
/* phone: no room for every name, so the window says where you are */
@media (max-width:820px){ .ofc-tl-ticks span { display:none; } .ofc-tl-win b { display:block; } .ofc-tl-ticks .ofc-tk { padding:0 6px; } }
.office-floor-app { flex:1; min-height:0; overflow:hidden; background:#0b0d17; line-height:0; position:relative; display:flex; flex-direction:column; }
.ofc-stage { flex:1; min-height:0; position:relative; overflow:hidden; }
/* before the office draws: opening, or why it didn't with a retry; a refresh that failed, over the top */
.ofc-stmsg { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:16px; color:#c9c7d4; line-height:1.4; text-align:center; }
.ofc-stmsg p { margin:0; }
.ofc-stnote { position:absolute; top:8px; left:50%; transform:translateX(-50%); z-index:2; margin:0; padding:4px 10px; border-radius:4px; background:rgba(11,13,23,.8); border:1px solid #ffb648; color:#ffdca0; line-height:1.4; font-size:calc(12px * var(--ui-fs, 1)); white-space:nowrap; pointer-events:none; }
.ofc-spin { width:18px; height:18px; border:3px solid rgba(255,255,255,.18); border-top-color:#ffcf4a; border-radius:50%; animation:ofc-spin .8s linear infinite; }
@keyframes ofc-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce){ .ofc-spin { animation:none; } }
/* the same people as a list, for keyboards and screen readers (the canvas is a picture) */
.office-list { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); margin:0; padding:0; }
.office-list:focus-within { position:static; width:auto; height:auto; clip:auto; max-height:30%; overflow:auto; padding:8px 14px; list-style:none; border-top:1px solid var(--line); }
.office-list button { background:none; border:0; color:var(--text); padding:4px 0; text-align:left; font:inherit; cursor:pointer; }
.ofc-who-head { display:flex; gap:14px; align-items:flex-start; padding:16px; border-bottom:1px solid var(--line); }
.ofc-who-av svg { width:72px; height:124px; image-rendering:pixelated; }
.ofc-who-id { flex:1; min-width:0; }
.ofc-who-id h3 { margin:0 0 4px; font-size:calc(18px * var(--ui-fs, 1)); }
.ofc-who-id p { margin:2px 0; color:var(--muted); }
.ofc-who-body { flex:1; overflow:auto; padding:6px 16px 16px; }
.ofc-who-body h4 { margin:14px 0 6px; font-size:calc(12px * var(--ui-fs, 1)); color:var(--muted); font-weight:600; }
.ofc-who-body p { margin:4px 0; }
.ofc-dim { color:var(--muted); }
.ofc-pill { display:inline-block; padding:1px 8px; border:1px solid var(--line); border-radius:3px; font-size:calc(11.5px * var(--ui-fs, 1)); color:var(--text); }
.ofc-pill.ofc-work { border-color:#5cd08a; } .ofc-pill.ofc-wait { border-color:#ffb648; } .ofc-pill.ofc-error { border-color:#ef4444; color:#ef4444; }
.ofc-who-foot a.btn { text-decoration:none; }
.ofc-who-foot { display:flex; gap:8px; justify-content:flex-end; padding:12px 16px; border-top:1px solid var(--line); }
/* Office game (Nov 10 2026): coins, the shop drawer over the office, decorate mode, morale (frontend/hq/shop.js) */
.ofc-coin { display:inline-block; width:12px; height:12px; border-radius:50%; background:radial-gradient(circle at 35% 35%, #fff2b0 0 22%, #ffcf4a 23% 62%, #c99a2a 63%); box-shadow:0 0 0 1px #8a6a1a; vertical-align:-1px; margin-right:4px; }
.ofc-coins, .ofc-decor-btn, .ofc-hbtn { background:none; border:1px solid var(--line); color:var(--text); font:inherit; font-size:calc(12px * var(--ui-fs, 1)); padding:2px 9px; border-radius:3px; cursor:pointer; margin-left:8px; white-space:nowrap; }
.ofc-coins b { font-weight:700; }
.ofc-coins:hover, .ofc-decor-btn:hover, .ofc-hbtn:hover { border-color:#ffcf4a; }
.ofc-hbtn + .ofc-hbtn { margin-left:4px; }
@media (max-width:480px){ .ofc-hbtn { display:none; } }      /* a phone: the elevator and the arcade cabinet on the canvas */
.ofc-decor-btn.on { border-color:#ffcf4a; color:#ffcf4a; }
/* the shop's two tabs (Shop / My items) and an owned item dragged out of My items onto the office */
.ofc-mode { display:flex; gap:6px; padding:0 14px 8px; }
.ofc-mode button { flex:1; background:none; border:1px solid var(--line); color:var(--muted); font:inherit; font-size:calc(12.5px * var(--ui-fs, 1)); padding:4px 8px; border-radius:3px; cursor:pointer; }
.ofc-mode button.on { color:var(--text); border-color:#ffcf4a; background:rgba(255,207,74,.08); }
.ofc-mine-h { display:flex; align-items:center; gap:10px; padding:0 14px 8px; }
.ofc-mine-h p { margin:0; flex:1; }
/* a member / customer login browses only (owner, Nov 12): no buy, place, crate or edit buttons */
.ofc-ro [data-act="buy"], .ofc-ro [data-act="place"], .ofc-ro [data-act="placeall"], .ofc-ro [data-act="remove"],
.ofc-ro [data-act="crate"], .ofc-ro [data-act="edit"], .ofc-ro .ofc-sw { display:none; }
.ofc-ronote { margin:0 14px 8px; padding:6px 10px; border:1px solid var(--line); border-radius:3px; color:var(--muted); font-size:calc(12.5px * var(--ui-fs, 1)); }
.ofc-shop.ofc-mine .ofc-tile { cursor:grab; touch-action:pan-y; }
.ofc-ghost { position:fixed; z-index:9999; pointer-events:none; transform:translate(-50%,-60%); filter:drop-shadow(0 4px 6px rgba(0,0,0,.5)); image-rendering:pixelated; }
.ofc-shop.ofc-dragging { opacity:.25; pointer-events:none; }
.ofc-shop { position:absolute; top:0; right:0; bottom:0; width:min(460px, 100%); z-index:3; background:var(--sidebar); border-left:1px solid var(--line); display:flex; flex-direction:column; line-height:1.4; box-shadow:-8px 0 24px rgba(0,0,0,.35); }
.ofc-shop.hidden { display:none; }
.ofc-shop-h { display:flex; align-items:center; gap:10px; padding:12px 14px 6px; }
.ofc-shop-h h3 { margin:0; font-size:calc(16px * var(--ui-fs, 1)); }
.ofc-wallet { flex:1; color:var(--muted); } .ofc-wallet b { color:var(--text); }
.ofc-earn { margin:0 14px 8px; color:var(--muted); font-size:calc(12px * var(--ui-fs, 1)); }
.ofc-tgt { margin:0 14px 8px; padding:8px 10px; border:1px dashed #ffcf4a; border-radius:4px; display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center; }
.ofc-tgt > span:first-child { flex:1 1 100%; }
.ofc-link { background:none; border:0; color:var(--accent2); padding:0; font:inherit; cursor:pointer; }
.ofc-tabs { max-height:156px; overflow:auto; padding:0 14px 6px; border-bottom:1px solid var(--line); }
.ofc-grp { display:flex; flex-wrap:wrap; gap:4px; align-items:center; margin:3px 0; }
.ofc-grp > span { color:var(--muted); font-size:calc(11px * var(--ui-fs, 1)); width:62px; flex:0 0 62px; }
.ofc-tabs button, .ofc-chips button { background:none; border:1px solid var(--line); color:var(--muted); font:inherit; font-size:calc(11.5px * var(--ui-fs, 1)); padding:1px 8px; border-radius:3px; cursor:pointer; }
.ofc-tabs button.on, .ofc-chips button.on { color:var(--text); border-color:#ffcf4a; }
.ofc-chips { display:flex; flex-wrap:wrap; gap:4px; }
.ofc-filter { display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center; padding:8px 14px; }
.ofc-filter select { background:var(--bg); border:1px solid var(--bd-ctl); color:var(--text); padding:3px 6px; border-radius:3px; font:inherit; font-size:calc(12px * var(--ui-fs, 1)); }
.ofc-tabs button small { color:var(--muted); font-size:.85em; }      /* full strength: AA contrast on the rail (C8d) */
.ofc-tabs button.on small:not(.full) { color:inherit; }               /* the picked department's tint is darker: its own text colour */
.ofc-tabs button small.full { color:var(--ok-ink, #5cd08a); }
.ofc-more { grid-column:1 / -1; text-align:center; padding:8px; }
/* a game covers the office: the header's game buttons wait until it ends */
#office-box.ofc-playing .search-head .ofc-coins, #office-box.ofc-playing .search-head .ofc-decor-btn, #office-box.ofc-playing .search-head .ofc-hbtn { pointer-events:none; opacity:.45; }
.ofc-filter input[type=search] { flex:1 1 100%; min-width:0; background:var(--bg); border:1px solid var(--bd-ctl); color:var(--text); padding:5px 8px; border-radius:3px; font:inherit; }
.ofc-filter label { color:var(--muted); white-space:nowrap; font-size:calc(12px * var(--ui-fs, 1)); }
.ofc-grid { flex:1; min-height:120px; overflow:auto; padding:4px 14px 10px; display:grid; grid-template-columns:repeat(auto-fill, minmax(92px, 1fr)); gap:8px; align-content:start; }
.ofc-grid > p { grid-column:1 / -1; margin:0; }   /* a note ("Nothing bought yet", "Showing the first 240") spans the row, not one tile's cell */
.ofc-tile { position:relative; display:flex; flex-direction:column; align-items:center; gap:2px; padding:6px 4px; background:var(--bg); border:1px solid var(--line); border-top:3px solid var(--rar, #9aa7c4); border-radius:4px; color:var(--text); font:inherit; cursor:pointer; text-align:center; }
.ofc-tile:hover, .ofc-tile.on { border-color:#ffcf4a; border-top-color:var(--rar, #9aa7c4); }
.ofc-tile.placed { box-shadow:inset 0 0 0 1px #5cd08a; }
.ofc-ribbon { position:absolute; top:4px; right:-2px; background:#e5534b; color:#fff; font-size:10px; font-weight:700; padding:1px 5px; border-radius:2px 0 0 2px; }
.ofc-pr s, .ofc-info s { opacity:.6; font-size:.9em; }
.ofc-deal { color:#e5534b; font-weight:600; font-size:.9em; }
.ofc-small { font-size:calc(11px * var(--ui-fs, 1)); }
.ofc-banner { grid-column:1 / -1; display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; padding:8px 10px; border:1px dashed var(--line); border-radius:4px; }
.ofc-banner .btn { margin-left:auto; }
.ofc-feat > span { color:#ffcf4a; }
:root[data-theme="light"] .ofc-feat > span { color:#8a5d00; }
:root[data-theme="light"] .ofc-tabs button small.full { color:#1f7a45; }
/* supply crate */
.ofc-crate { grid-column:1 / -1; display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px; padding:12px 8px; }
.ofc-crate h4 { margin:0; }
.ofc-crate-art { width:72px; height:60px; position:relative; image-rendering:pixelated; }
.ofc-crate-art i { position:absolute; inset:10px 6px 0; background:#a0662e; border:3px solid #2b1b10; box-shadow:inset 0 -10px 0 #7c4a1e, inset 0 6px 0 #c58a4a; }
.ofc-crate-art i::before { content:""; position:absolute; left:-3px; right:-3px; top:12px; height:6px; background:#ffcf4a; border-top:2px solid #2b1b10; border-bottom:2px solid #2b1b10; }
.ofc-crate-art i::after { content:"?"; position:absolute; left:0; right:0; top:-2px; color:#fff6d0; font:700 14px monospace; text-shadow:1px 1px 0 #2b1b10; }
.ofc-crate:hover .ofc-crate-art i { animation:ofc-wobble .5s ease-in-out infinite alternate; }
@keyframes ofc-wobble { from { transform:rotate(-3deg); } to { transform:rotate(3deg); } }
.ofc-odds { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; justify-content:center; gap:4px 12px; }
.ofc-odds li { display:flex; gap:6px; align-items:center; font-size:calc(12px * var(--ui-fs, 1)); }
.ofc-reveal { grid-column:1 / -1; display:flex; flex-direction:column; align-items:center; gap:4px; padding:12px; border:2px solid var(--rar); border-radius:6px; box-shadow:0 0 18px color-mix(in srgb, var(--rar) 45%, transparent); animation:ofc-pop .35s ease-out; }
.ofc-reveal canvas { image-rendering:pixelated; }
@keyframes ofc-pop { from { transform:scale(.6); opacity:0; } 70% { transform:scale(1.06); } to { transform:none; opacity:1; } }
@media (prefers-reduced-motion:reduce){ .ofc-reveal, .ofc-crate:hover .ofc-crate-art i { animation:none; } }
/* sets */
.ofc-sets { grid-column:1 / -1; display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:8px; }
.ofc-set { display:flex; flex-direction:column; gap:4px; align-items:flex-start; text-align:left; padding:8px; background:var(--bg); border:1px solid var(--line); border-radius:4px; color:var(--text); font:inherit; cursor:pointer; }
.ofc-set:hover { border-color:#ffcf4a; }
.ofc-set.done { border-color:#5cd08a; }
.ofc-set .ofc-qbar { width:100%; height:5px; margin:2px 0; } .ofc-set .ofc-qbar i { background:#ffcf4a !important; }
.ofc-set-pv { display:flex; gap:2px; min-height:28px; }
.ofc-set-pv canvas { image-rendering:pixelated; }
.ofc-set-pv canvas.ofc-not { opacity:.4; filter:saturate(.35) brightness(.8); }
.ofc-acts .ofc-link { margin-left:10px; }
@media (max-width:440px){ .ofc-coins .ofc-dim { display:none; } }
.ofc-pv { width:56px; height:56px; display:flex; align-items:center; justify-content:center; background:#0b0d17; border-radius:3px; }
.ofc-pv canvas, .ofc-big canvas { image-rendering:pixelated; display:block; }
.ofc-nm { font-size:calc(11px * var(--ui-fs, 1)); line-height:1.25; max-height:2.6em; overflow:hidden; }
.ofc-pr { font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); }
.ofc-detail { border-top:1px solid var(--line); padding:10px 14px 14px; display:flex; gap:12px; min-height:150px; }
.ofc-big { flex:0 0 128px; height:128px; background:#0b0d17; border-radius:4px; display:flex; align-items:center; justify-content:center; }
.ofc-info { flex:1; min-width:0; }
.ofc-info h4 { margin:0 0 4px; font-size:calc(14px * var(--ui-fs, 1)); }
.ofc-info p { margin:2px 0; }
.ofc-rar { color:var(--rar); font-weight:600; }
:root[data-theme="light"] .ofc-rar { color:var(--text); border:1px solid var(--rar); border-left-width:4px; padding:0 5px; border-radius:3px; }
:root[data-theme="light"] .ofc-decor-btn.on { color:#8a5d00; }
:root[data-theme="light"] .ofc-decor-btn.on, :root[data-theme="light"] .ofc-coins:hover, :root[data-theme="light"] .ofc-decor-btn:hover { border-color:#b8860b; }
/* fingers: bigger targets on touch screens */
@media (pointer:coarse){ .ofc-sw button { width:30px; height:30px; } .ofc-tabs button, .ofc-chips button { padding:6px 10px; min-height:32px; }
  .ofc-coins, .ofc-decor-btn, .ofc-hbtn { padding:6px 10px; min-height:34px; } .ofc-filter select, .ofc-filter input[type=search] { min-height:34px; } }
.ofc-sw { display:flex; flex-wrap:wrap; gap:4px; margin:8px 0; }
.ofc-sw button { width:18px; height:18px; border-radius:3px; border:1px solid rgba(0,0,0,.4); cursor:pointer; padding:0; }
.ofc-sw button.on { outline:2px solid #ffcf4a; outline-offset:1px; }
.ofc-acts { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; align-items:center; }
.ofc-acts select { background:var(--bg); border:1px solid var(--bd-ctl); color:var(--text); padding:4px 6px; border-radius:3px; font:inherit; max-width:100%; }
.ofc-mood { height:8px; border-radius:4px; background:var(--line); overflow:hidden; margin:2px 0 6px; }
.ofc-mood i { display:block; height:100%; width:var(--m); background:#5cd08a; }
.ofc-mood[data-l="Good"] i { background:#9bd35c; } .ofc-mood[data-l="Tired"] i { background:#ffb648; } .ofc-mood[data-l="Overworked"] i { background:#ef4444; }
.ofc-why { margin:4px 0 0; padding-left:18px; color:var(--muted); }
.ofc-lbwrap { flex:1; overflow:auto; padding:0 14px 14px; }
.ofc-lb { list-style:none; margin:0; padding:0; }
.ofc-lb li { display:flex; align-items:center; gap:8px; padding:6px 0; border-bottom:1px solid var(--line); }
.ofc-lb li > b { margin-left:auto; font-variant-numeric:tabular-nums; }
.ofc-lb-n { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ofc-lb li > .ofc-dim { font-size:calc(11.5px * var(--ui-fs, 1)); white-space:nowrap; }
.ofc-rank, .ofc-medal { flex:0 0 22px; height:22px; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; font-size:calc(11px * var(--ui-fs, 1)); color:var(--muted); }
.ofc-medal { color:#1b1203; font-weight:700; } .ofc-medal.m0 { background:#ffcf4a; } .ofc-medal.m1 { background:#c9d1e0; } .ofc-medal.m2 { background:#d08a4a; }
.ofc-game { border:1px solid var(--line); border-radius:4px; padding:10px; margin:0 0 10px; }
.ofc-game > header { display:flex; gap:10px; align-items:flex-start; margin-bottom:6px; }
.ofc-game > header > div { flex:1; min-width:0; } .ofc-game h4 { margin:0; font-size:calc(14px * var(--ui-fs, 1)); } .ofc-game p { margin:2px 0 0; }
.ofc-floor-n { flex:0 0 26px; height:26px; display:inline-flex; align-items:center; justify-content:center; border:2px solid #8a93ad; border-radius:3px; font-weight:700; font-size:calc(12px * var(--ui-fs, 1)); background:#0b0d17; color:#ffcf4a; }
.ofc-floors li > .btn { margin-left:auto; } .ofc-floors li > b { margin-left:auto; }
.ofc-floors li > .btn + .btn, .ofc-floors li > .btn + b { margin-left:6px; }
.ofc-floors li.ofc-fl-x { padding-left:22px; } .ofc-floors li.ofc-fl-x .ofc-floor-n { flex-basis:22px; height:22px; color:#9fd8ff; }
.ofc-floors li.ofc-fl-buy .ofc-floor-n { color:#5cd08a; border-style:dashed; }
.ofc-floors li.ofc-fl-teams { padding-left:52px; flex-wrap:wrap; gap:6px 14px; }
.ofc-floors li.ofc-fl-teams label { display:inline-flex; gap:6px; align-items:center; cursor:pointer; }
.ofc-floors li.ofc-fl-teams p { flex-basis:100%; margin:0; white-space:normal; }
@media (max-width:820px){ #office-box .search-head { flex-wrap:nowrap; gap:8px; }
  #office-box .search-head h3 { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } }
@media (max-width:820px){ .ofc-shop { width:100%; } .ofc-decor-btn { padding:2px 6px; } .ofc-detail { min-height:0; } .ofc-big { flex-basis:88px; height:88px; } }
@media (max-width:820px), (max-height:500px) and (pointer:coarse){
  /* phone: the office is the screen, over the chat list (like a page) */
  main.ofc-on #office-view:not(.hidden) { position:fixed; inset:0; z-index:110; background:var(--sidebar); padding-top:env(safe-area-inset-top); padding-bottom:env(safe-area-inset-bottom); }
  #office-who-modal { width:100%; }
  #office-who-box { flex-direction:column; border-left:0; }
  .ofc-who-card { flex:0 0 auto; max-height:42%; overflow:auto; border-right:0; border-bottom:1px solid var(--line); }
  /* phone, collapsed: one row (small avatar, name, state, the buttons) above the chat */
  #office-who-modal.ofc-who-mini { width:100%; }
  .ofc-who-mini .ofc-who-card { flex:0 0 auto; }
  .ofc-who-mini .ofc-who-head { flex-direction:row; text-align:left; padding:8px 10px; }
  .ofc-who-mini .ofc-who-av svg { width:28px; height:48px; }
  .ofc-who-mini #office-who-x { position:static; }
  /* one row: the strip, then a compact "Open chat" (Close is the ✕); no » « (the card and chat are stacked, not side by side) */
  .ofc-who-mini .ofc-who-card { flex-direction:row; align-items:center; }
  .ofc-who-mini .ofc-who-head { flex:1; min-width:0; }
  .ofc-who-mini .ofc-who-foot { margin:0; padding:0 10px 0 0; border-top:0; flex-direction:row; }
  .ofc-who-mini .ofc-who-foot .btn { padding:4px 10px; min-height:0; }
  .ofc-who-mini .ofc-full { display:none; }
  #office-who-modal .ofc-who-tog { display:none; }
  /* iOS zooms into a field under 16px: the general phone rule above loses to font:inherit here */
  .ofc-chat-form textarea { font-size:max(16px, calc(16px * var(--ui-fs, 1))); }
  .office-meta { display:none; }
}
/* a touch phone (office C8c): every control in the office, its shop, someone's card, the arcade / elevator board and
   Dress up is at least 40 x 40 px to tap; the timeline's ticks are its labels there (the whole track, 40 px high, is the
   target: a tap centres the view on that spot) */
@media (max-width:820px) and (pointer:coarse){
  #office-box .search-head button, #ofc-shop button, #ofc-shop select, #ofc-shop input[type=search], #ofc-board button,
  #office-who-modal button, #office-who-modal a.btn, #modal .wd button, #modal .wd select, #modal .wd-actions .btn,
  #modal .wd .wd-custom { min-width:40px; min-height:40px; }
  #modal .wd .wd-custom input { min-width:40px; min-height:40px; }
  .ofc-sw button { width:40px; height:40px; }
  .ofc-who-mini .ofc-who-foot .btn { min-height:40px; }
  .ofc-tl-track { height:40px; }
  .ofc-tl [data-go] { pointer-events:none; }
}
/* the cards a reply names by id, under that reply (card_refs.py, Nov 9) */
.msg-cards { display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.msg-cards .th-card > .card { max-width:none; margin:0; }
.setup-convo .setup-of { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin-bottom:4px; }
.setup-convo .setup-picks { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.setup-convo .aiw-key { display:flex; flex-direction:column; gap:10px; max-width:440px; margin-top:4px; }
.setup-convo .aiw-get a, .setup-convo .aiw-mcp a { color:var(--accent); text-decoration:underline dotted; text-underline-offset:3px; }

/* ---- the office shop as a storefront (Nov 11): an awning, a department rail, product cards, a product panel on pick ---- */
#ofc-shop { width:min(820px, 100%); }
#ofc-shop .ofc-awning { position:relative; padding:20px 14px 10px; background:linear-gradient(#2b2440, var(--sidebar)); border-bottom:1px solid var(--line); }
#ofc-shop .ofc-awning::before { content:""; position:absolute; left:0; right:0; top:0; height:12px;
  background:repeating-linear-gradient(90deg, #e5534b 0 22px, #fff4e0 22px 44px);
  -webkit-mask:radial-gradient(circle at 11px 0, #000 11px, transparent 11.5px) 0 0/22px 12px repeat-x, linear-gradient(#000, #000) 0 0/100% 6px no-repeat;
          mask:radial-gradient(circle at 11px 0, #000 11px, transparent 11.5px) 0 0/22px 12px repeat-x, linear-gradient(#000, #000) 0 0/100% 6px no-repeat; }
#ofc-shop .ofc-sign { display:inline-block; padding:3px 12px; border:2px solid #ffcf4a; border-radius:4px; color:#ffcf4a; background:#1a1526; letter-spacing:.04em; font-size:calc(15px * var(--ui-fs, 1)); box-shadow:0 0 12px rgba(255,207,74,.18); }
#ofc-shop .ofc-wallet { flex:0 1 auto; min-width:0; margin-left:auto; display:flex; align-items:center; gap:6px; padding:4px 12px 4px 8px; border-radius:999px; background:var(--bg); border:1px solid var(--line); }
#ofc-shop .ofc-wallet b { font-size:calc(14px * var(--ui-fs, 1)); }
#ofc-shop .ofc-tgt { margin:10px 14px 0; }
#ofc-shop .ofc-store { flex:1; min-height:0; display:flex; }
#ofc-shop .ofc-rail { flex:0 0 172px; max-height:none; overflow:auto; padding:10px 8px 12px; border-bottom:0; border-right:1px solid var(--line); background:rgba(0,0,0,.12); }
#ofc-shop .ofc-rail .ofc-grp { display:block; margin:0 0 10px; }
#ofc-shop .ofc-rail .ofc-grp > span { display:block; width:auto; padding:0 8px 3px; text-transform:uppercase; letter-spacing:.06em; font-size:calc(10px * var(--ui-fs, 1)); font-weight:700; }
#ofc-shop .ofc-rail button { display:flex; width:100%; align-items:center; gap:6px; border:0; border-left:3px solid transparent; border-radius:0 4px 4px 0; padding:5px 8px; text-align:left; color:var(--text); font-size:calc(12.5px * var(--ui-fs, 1)); }
#ofc-shop .ofc-rail button:hover { background:rgba(255,255,255,.05); }
#ofc-shop .ofc-rail button.on { background:rgba(255,207,74,.12); border-left-color:#ffcf4a; color:var(--text); }
#ofc-shop .ofc-rail button i { font-style:normal; width:18px; text-align:center; }
#ofc-shop .ofc-rail button small { margin-left:auto; }
#ofc-shop .ofc-rail .ofc-earn { margin:12px 8px 0; font-size:calc(11px * var(--ui-fs, 1)); line-height:1.45; }
#ofc-shop .ofc-aisle { flex:1; min-width:0; min-height:0; display:flex; flex-direction:column; }
#ofc-shop .ofc-filter { padding:10px 14px 8px; border-bottom:1px solid var(--line); }
#ofc-shop .ofc-grid { padding:12px 14px; grid-template-columns:repeat(auto-fill, minmax(118px, 1fr)); grid-auto-rows:max-content; gap:10px; }
#ofc-shop .ofc-tile { padding:8px 8px 10px; gap:5px; border:1px solid var(--line); border-radius:8px; background:linear-gradient(var(--bg), rgba(0,0,0,.18)); transition:transform .12s, border-color .12s, box-shadow .12s; overflow:hidden; }
#ofc-shop .ofc-tile::before { content:""; position:absolute; left:0; right:0; top:0; height:3px; background:var(--rar, #9aa7c4); }
#ofc-shop .ofc-tile:hover { transform:translateY(-2px); box-shadow:0 6px 14px rgba(0,0,0,.35); }
#ofc-shop .ofc-tile.on { border-color:#ffcf4a; box-shadow:0 0 0 1px #ffcf4a; }
#ofc-shop .ofc-pv { width:100%; height:84px; border-radius:6px; background:radial-gradient(circle at 50% 70%, #1b1f33, #0b0d17 70%); }
#ofc-shop .ofc-nm { width:100%; text-align:center; font-size:calc(12px * var(--ui-fs, 1)); font-weight:600; min-height:2.5em; display:flex; align-items:center; justify-content:center; }
#ofc-shop .ofc-pr { display:inline-flex; align-items:center; gap:3px; padding:2px 9px; border-radius:999px; background:#2a2312; color:#ffdf7a; font-weight:700; font-size:calc(11.5px * var(--ui-fs, 1)); }
#ofc-shop .ofc-pr s { color:#c9b98a; font-weight:400; }
#ofc-shop .ofc-pr.own { background:rgba(92,208,138,.14); color:#7fe0a6; }
#ofc-shop .ofc-ribbon { top:10px; right:0; padding:2px 7px; border-radius:3px 0 0 3px; box-shadow:0 2px 4px rgba(0,0,0,.3); }
#ofc-shop .ofc-detail { position:relative; flex:0 0 auto; max-height:50%; overflow:auto; padding:12px 14px; gap:14px; min-height:0; background:linear-gradient(rgba(255,207,74,.06), transparent); border-top:1px solid #ffcf4a55; }
#ofc-shop .ofc-detail.hidden { display:none; }
#ofc-shop .ofc-dx { position:absolute; top:6px; right:8px; }
#ofc-shop .ofc-big { flex-basis:128px; height:128px; border-radius:8px; background:radial-gradient(circle at 50% 70%, #1b1f33, #0b0d17 70%); }
#ofc-shop .ofc-info h4 { font-size:calc(16px * var(--ui-fs, 1)); padding-right:24px; }
#ofc-shop .ofc-acts { margin-top:8px; }
:root[data-theme="light"] #ofc-shop .ofc-awning { background:linear-gradient(#fff3d6, var(--sidebar)); }
:root[data-theme="light"] #ofc-shop .ofc-sign { background:#fffaf0; color:#8a5d00; border-color:#d9a520; }
:root[data-theme="light"] #ofc-shop .ofc-pr { background:#fff1c7; color:#6b4a00; }
:root[data-theme="light"] #ofc-shop .ofc-pr s { color:#8a7a50; }
:root[data-theme="light"] #ofc-shop .ofc-pr.own { background:#dff5e8; color:#1f7a45; }
:root[data-theme="light"] #ofc-shop .ofc-rail { background:rgba(0,0,0,.03); }
@media (max-width:640px){
  #ofc-shop .ofc-store { flex-direction:column; }
  #ofc-shop .ofc-rail { flex:0 0 auto; display:flex; gap:4px; overflow-x:auto; overflow-y:hidden; padding:8px; border-right:0; border-bottom:1px solid var(--line); white-space:nowrap; }
  #ofc-shop .ofc-rail .ofc-grp { display:flex; flex-wrap:nowrap; flex:0 0 auto; gap:4px; margin:0; align-items:center; }
  #ofc-shop .ofc-rail button { flex:0 0 auto; }
  #ofc-shop .ofc-rail .ofc-grp > span, #ofc-shop .ofc-rail .ofc-earn { display:none; }
  #ofc-shop .ofc-rail button { width:auto; border:1px solid var(--line); border-radius:999px; padding:4px 10px; }
  #ofc-shop .ofc-rail button.on { border-color:#ffcf4a; }
  #ofc-shop .ofc-grid { grid-template-columns:repeat(auto-fill, minmax(104px, 1fr)); }
  #ofc-shop .ofc-pv { height:70px; }
  #ofc-shop .ofc-sign { font-size:calc(13px * var(--ui-fs, 1)); }
  #ofc-shop .ofc-big { flex-basis:88px; height:88px; }
}
#ofc-shop .ofc-crate-art { transform:scale(1.6); margin:18px 0 14px; }
#ofc-shop .ofc-crate { padding-top:20px; }
#ofc-shop.ofc-front .ofc-filter > :not(#ofc-q) { display:none; }      /* crates + sets: only the search applies */
/* sort / rarity / owned / can afford: in the row on a wide shop, behind a Filters button on a phone (the grid keeps the room) */
.ofc-fx { display:contents; }
#ofc-shop .ofc-ftog { display:none; }
@media (max-width:640px){
  #ofc-shop .ofc-filter input[type=search] { flex:1 1 0; }
  #ofc-shop .ofc-ftog { display:inline-block; flex:none; padding:4px 10px; }
  #ofc-shop .ofc-fx { display:none; }
  #ofc-shop.ofc-fopen .ofc-fx { display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center; flex:1 1 100%; }
}
/* the shop before its data is in, or when it couldn't load */
.ofc-stub { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:24px; text-align:center; }
.ofc-stub p { margin:0; }
#ofc-board.ofc-arc .ofc-shop-h { background:linear-gradient(#1d1030, var(--sidebar)); padding-top:16px; }
#ofc-board.ofc-arc .ofc-shop-h h3 { color:#ff7ad9; letter-spacing:.12em; text-transform:uppercase; text-shadow:0 0 6px rgba(255,122,217,.7), 0 0 14px rgba(255,122,217,.35); }
#ofc-board.ofc-arc .ofc-game { border-left:3px solid var(--neon, #7fe6ff); border-radius:6px; }
#ofc-board.ofc-arc .ofc-game:nth-child(4n+1) { --neon:#7fe6ff; } #ofc-board.ofc-arc .ofc-game:nth-child(4n+2) { --neon:#ff7ad9; }
#ofc-board.ofc-arc .ofc-game:nth-child(4n+3) { --neon:#ffcf4a; } #ofc-board.ofc-arc .ofc-game:nth-child(4n+4) { --neon:#5cd08a; }
:root[data-theme="light"] #ofc-board.ofc-arc .ofc-shop-h { background:linear-gradient(#fbe8ff, var(--sidebar)); }
:root[data-theme="light"] #ofc-board.ofc-arc .ofc-shop-h h3 { color:#b0218a; text-shadow:none; }
#ofc-shop.ofc-tg { width:min(540px, 100%); }      /* opened on a spot: narrow, so the office stays in view while it changes */
#ofc-shop .ofc-earn-alt { display:none; margin:0 14px 8px; }
#ofc-shop.ofc-tg .ofc-earn-alt { display:block; }
@media (max-width:640px){ #ofc-shop .ofc-earn-alt { display:block; } }
:root[data-theme="light"] #ofc-shop .ofc-rail button:hover { background:rgba(0,0,0,.05); }
@media (prefers-reduced-motion:reduce){ #ofc-shop .ofc-tile, #ofc-shop .ofc-tile:hover { transition:none; transform:none; } }
:root[data-theme="light"] #ofc-shop .ofc-tile { background:linear-gradient(#ffffff, #f1efe9); }
:root[data-theme="light"] #ofc-shop .ofc-tile:hover { box-shadow:0 6px 14px rgba(0,0,0,.12); }
#ofc-shop .ofc-wallet .ofc-dim { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
@media (max-width:640px){ #ofc-shop .ofc-wallet .ofc-dim { display:none; } }
:root[data-theme="light"] #ofc-shop .ofc-awning::before { background:repeating-linear-gradient(90deg, #e5534b 0 22px, #f5dcc0 22px 44px); filter:drop-shadow(0 1px 0 rgba(0,0,0,.15)); }
:root[data-theme="light"] #ofc-shop .ofc-pr s { color:#6b5a30; opacity:1; }
:root[data-theme="light"] #ofc-shop .ofc-rail button.on { border-left-color:#b8860b; }
:root[data-theme="light"] #ofc-shop .ofc-tile.on { border-color:#b8860b; box-shadow:0 0 0 1px #b8860b; }
@media (max-width:640px){ :root[data-theme="light"] #ofc-shop .ofc-rail button.on { border-color:#b8860b; } }
#ofc-shop .ofc-big canvas { max-width:100%; max-height:100%; }
.ofc-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.setup-convo .aiw-mcp { display:flex; flex-direction:column; gap:8px; margin-top:4px; }

/* Computer page (#/computer, footer button / agent row monitor icon): the workspace's computer, live,
   filling the page like Jobs (pageOpen sizes #desk-page; the live view takes the rest of its height) */
#desk-page .search-head { padding:6px 12px 8px 4px; }
#desk-body { flex:1; min-height:0; padding:10px 14px 14px; display:flex; flex-direction:column; }
#desk-body.cmp-vnc .cmp-screen { flex:1; height:auto; }
#desk-body.cmp-term { margin:10px 14px 14px; padding:6px; height:auto; }
/* monitor icon on an agent row: only while that agent's turn runs on the workspace's computer */
.row-desk { display:none; flex:none; width:28px; height:28px; align-items:center; justify-content:center; padding:0;
  border:1px solid var(--line); border-radius:4px; background:var(--elev); color:var(--text); cursor:pointer; }
.row-desk:hover { border-color:currentColor; }
.row-agent.on-pc .row-desk { display:flex; }
#sidebar.collapsed .row-agent .row-desk { display:none; }

/* app-wide reduced motion (frontend r1 B6-r1-2): every animation and transition settles at once
   (its end state shows), whatever rule set it; the per-component rules above stay as they are */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important;
    transition-duration:.01ms !important; scroll-behavior:auto !important; }
}

/* screen-reader-only text (the toast live regions, frontend r2 B5-r2-2) */
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; margin:-1px; padding:0; border:0; }

/* FE-F1 (B4b): every outline:none field/box gets a keyboard focus ring on the same selector */
.composer textarea:focus-visible, #search-input:focus-visible { outline:none; }
.composer form:focus-within, .search-head:focus-within { outline:2px solid var(--accent); outline-offset:-2px; }
.conn-search:focus-visible, .set-select:focus-visible, .ar-ren-in:focus-visible, .inline-edit:focus-visible,
#st-title:focus-visible, #office-box:focus-visible, #office-who-box:focus-visible,
#sidebar.pg-mode .sb-top > .sb-lib-h:focus-visible,
.modal-box :is(input, textarea, select):focus-visible, #st-page :is(input, textarea, select):focus-visible,
.ds-find input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
/* the office canvas: hq.js sets outline:none inline and its port clips: the ring is an overlay on the port */
.hq-port:has(> .hq-canvas:focus-visible)::after { content:""; position:absolute; inset:0; pointer-events:none;
  outline:2px solid var(--accent); outline-offset:-2px; }

.oi-also{margin:8px 0;font-size:13px;color:var(--muted)}
.oi-also summary{cursor:pointer}
.oi-also-r{margin:6px 0 0 12px}

/* mobile-a11y C2c: forced colors (Windows High Contrast) repaints every background to Canvas and drops
   box-shadow, so switches (drawn only by background) vanished and showed no state. One block: switches
   draw with system colours, and every keyboard focus gets a real outline. */
.app-tog input:focus-visible + .sw { outline:2px solid var(--accent); outline-offset:2px; }
@media (forced-colors: active) {
  .sw, .app-tog .sw { forced-color-adjust:none; background:Canvas; border:1px solid CanvasText; }
  .sw::after, .app-tog .sw::after { background:CanvasText; }
  .sw.on, .app-tog input:checked + .sw { background:Highlight; border-color:Highlight; }
  .sw.on::after, .app-tog input:checked + .sw::after { background:HighlightText; }
  :focus-visible, .app-tog input:focus-visible + .sw { outline:2px solid Highlight !important; outline-offset:2px; }
}
/* Settings › Logins (settings.js renderLoginsTab) */
#gbody .lg-row { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end; margin:0 0 8px; }
#gbody .lg-form { display:grid; gap:8px; max-width:520px; margin:0 0 12px; }
#gbody .lg-row label, #gbody .lg-form label { display:flex; flex-direction:column; gap:4px; min-width:0; }
#gbody .lg-row input, #gbody .lg-form input, #gbody .lg-row select, #gbody .lg-form select { max-width:100%; }
#gbody .lg-item { display:flex; gap:8px; align-items:center; justify-content:space-between; }
#gbody .lg-t { min-width:0; overflow-wrap:anywhere; }
#gbody .lg-acts { display:flex; gap:6px; flex-shrink:0; }
#gbody .lg-biz { margin:8px 0 2px; font-weight:600; }
#gbody [role=status].bad { color:var(--red,#c33); }
