/* The agent workspace (issue #23): conversation | divider | result panel, the composer, cards, questionnaire, bell list.
   Loaded by public/agents/workspace.js on first use. Tokens of app/base.css only (both themes follow). Ported from the reference
   admin's .jdws / .jdchat / .jdsplit / .jddoc and PLAT common/agents/ui/agents.css. */
.agw-host { min-height: 420px; }
.agw { --chatw: 44%; display: grid; grid-template-columns: minmax(0, 1fr) 0 0; height: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 0; overflow: hidden; } /* a full-height panel: square corners (owner 2026-12-01) */
.agw.open { grid-template-columns: minmax(300px, var(--chatw)) 6px minmax(340px, 1fr); }
.agw-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.agw-msgs { flex: 1; overflow-y: auto; padding: 20px 24px 8px; }
.agw:not(.open) .agw-msgs > *, .agw:not(.open) .agw-cmp { max-width: 780px; margin-left: auto; margin-right: auto; width: 100%; }
.agw-cmp { padding: 8px 24px 12px; }
.agw-split { cursor: col-resize; background: var(--line-2); border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); display: none; }
.agw.open .agw-split { display: block; }
.agw-split:hover, body.agw-drag .agw-split { background: var(--accent); }
body.agw-drag { user-select: none; cursor: col-resize; }
.agw-panel { display: none; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface-2); }
.agw.open .agw-panel { display: flex; }
/* empty state: greeting + prompt in the middle */
.agw.solo .agw-chat { justify-content: center; }
.agw.solo .agw-msgs { flex: 0 0 auto; overflow: visible; }
.greet { text-align: center; padding: 8px 0 4px; }
.greet h2 { font-size: 30px; margin: 10px 0 6px; font-weight: 700; }
.greet p { color: var(--muted); margin: 0 auto; max-width: 560px; }
.greet-mark { display: inline-block; width: 56px; height: 56px; border-radius: var(--radius); background: url(/assets/app-icon-192.png) center / contain no-repeat; }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 13px; border: 0; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.chip:hover { background: var(--hover); box-shadow: inset 0 0 0 1.5px var(--ctl-line); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.chip.rec::after { content: '★'; font-size: 10px; color: var(--accent-ink); }
.chip.rec[aria-pressed="true"]::after { color: var(--yellow); }
/* messages */
.msg { margin: 0 0 16px; }
.msg .bub p { margin: 0 0 8px; } .msg .bub p:last-child { margin-bottom: 0; } .msg .bub ul { margin: 4px 0 8px 18px; padding: 0; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bub { background: var(--accent-soft); padding: 10px 15px; border-radius: 18px 18px 4px 18px; max-width: 85%; overflow-wrap: anywhere; }
.msg.user .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.msg.ai .bub { overflow-wrap: anywhere; line-height: 1.55; }
.msg.sys p { margin: 0; padding: 8px 12px; border-left: 3px solid var(--line); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; color: var(--muted); }
.msg.sys.err p { border-color: var(--yellow); background: var(--danger-solid); color: var(--on-danger); }
.writing { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.plan { display: inline-flex; gap: 4px; margin-left: 4px; } .plan i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); } .plan i.ok { background: var(--accent-ink); } .plan i.on { background: var(--accent); }
.info { margin-top: 6px; font: 12px var(--mono); color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.info .pill.src { font-family: var(--sans); cursor: help; }
.warns { margin: 8px 0 0; font-size: 13px; } .warns summary { cursor: pointer; color: var(--warn); } .warns ul { margin: 4px 0 0 18px; padding: 0; color: var(--ink-2); }
.pd-note { margin: 8px 0 0; padding: 8px 12px; border-left: 4px solid var(--yellow); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; background: var(--surface-2); font-size: 13px; color: var(--ink-2); } .pd-note p { margin: 2px 0; } .pd-note .warn { color: var(--warn); }
/* document cards */
.docs { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; }
.doc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); }
.doc-ic { flex: 0 0 auto; width: 38px; height: 44px; border: 1px solid var(--line-2); border-radius: 6px; position: relative; background: var(--white); }
.doc-ic i { position: absolute; left: -5px; bottom: 6px; border-radius: 4px; background: var(--blue); color: var(--white); font: 800 9px var(--display); font-style: normal; padding: 1px 4px; }
.doc-tx { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; } .doc-tx b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .doc-tx span { font-size: 12px; color: var(--muted); }
.doc-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.doc-acts svg, .dl-all svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.dl-all { align-self: flex-start; }
/* questionnaire, learning card, memory */
.qn, .learn { margin: 10px 0 0; padding: 14px 16px; border: 1px solid var(--line-2); border-left: 5px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface-2); }
.qn-h, .learn-h { font: 800 12px var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--accent-ink); margin-bottom: 8px; }
.qn-q { border: 0; padding: 0; margin: 0 0 12px; } .qn-q legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.qn-o { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.qn-free { width: 100%; }
.qn-f, .learn-f { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .qn-sp { flex: 1; }
.learn p { margin: 0 0 8px; font-style: italic; }
.mem { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; } .mem.undone { text-decoration: line-through; }
/* composer */
.cmp { margin: 0; }
/* the kiosk's list style (owner 2026-12-01): a pale grey-blue box (--surface-2, like the kiosk lists), a thin hairline (--line-2), no shadow;
   a slightly stronger line while typing (--line) — never the blue frame */
.cmp-box { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface-2); box-shadow: none; padding: 8px 12px 6px; }
.cmp-box:focus-within { border-color: var(--line); }
.cmp textarea { width: 100%; border: 0; resize: none; background: transparent; color: var(--ink); font: inherit; outline: none; padding: 4px 2px; min-height: 44px; box-shadow: none; }
.cmp textarea::placeholder, .ff-grid input::placeholder { color: var(--muted); }
.cmp-atts { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 6px; }
.att { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--radius-xs); background: var(--surface); position: relative; }
.att.err { border-color: var(--danger-solid); } .att-ic svg { width: 18px; height: 18px; color: var(--muted); display: block; }
.att-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; } .att-tx b { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .att-tx i { font: 600 10px var(--display); font-style: normal; color: var(--muted); }
.att-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 12px; }
.cmp-bar { display: flex; align-items: center; gap: 4px; }
.cmp-sp { flex: 1; }
.cmp-plus, .cmp-mini { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--pill); background: none; color: var(--ink-2); cursor: pointer; font: inherit; font-size: 13px; }
.cmp-plus { font-size: 18px; } .cmp-plus:hover, .cmp-mini:hover { background: var(--hover); }
.cmp-mini svg { width: 15px; height: 15px; }
.cmp-send { width: 36px; height: 36px; border-radius: var(--radius-btn); border: 0; background: var(--accent); color: var(--on-accent); display: inline-grid; place-items: center; cursor: pointer; }
.cmp-send svg { width: 17px; height: 17px; } .cmp-send.stop { background: var(--danger-solid); color: var(--on-danger); } .cmp-send:disabled { opacity: .4; cursor: default; }
.cmp-note { font-size: 11px; color: var(--muted); text-align: center; margin: 6px 0 0; }
.pop-mode .mm, .pop-mode .mm-deep { display: flex; } .mm { display: flex; flex-direction: column; text-align: left; } .mm span { font-size: 12px; color: var(--muted); }
.pop-mode .pop-item[aria-pressed="true"] { background: var(--accent-soft); }
.mm-deep { gap: 8px; align-items: flex-start; cursor: pointer; }
/* result panel */
.pnl-top { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); background: var(--surface); flex-wrap: wrap; }
.pnl-sp { flex: 1; } .pnl-doc { max-width: 240px; }
.pnl-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pnl-form { flex: 1; overflow-y: auto; padding: 14px 16px 30px; }
.pnl-prev { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pnl-prev > .vw { flex: 1; min-height: 0; }
.pnl-none { padding: 40px 20px; text-align: center; }
.agw-panel.full { position: fixed; inset: 0; z-index: 60; }
.agw-panel.busy .pnl-st:empty::before { content: '…'; }
.ff { margin: 0 0 14px; } .ff-l { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }
.ff-sec { font: 800 12px var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--accent-ink); margin: 18px 0 8px; border-bottom: 1px solid var(--line-2); padding-bottom: 4px; }
.ff input[type=text], .ff textarea { width: 100%; }
.ff textarea { resize: vertical; min-height: 54px; }
.ff.miss input, .ff.miss textarea { border-color: var(--yellow); border-width: 2px; background: var(--field-mark); }
.ff.chg .ff-l::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.ff-item { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px 30px 10px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--surface); }
.ff-del { position: absolute; top: 6px; right: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.ff-grid { overflow-x: auto; } .ff-grid table { border-collapse: collapse; font-size: 13px; } .ff-grid th, .ff-grid td { border: 1px solid var(--line-2); padding: 2px; text-align: left; } .ff-grid td .ff-del { position: static; }
.ff-grid input { min-width: 120px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); } .ff-grid input:focus { background: var(--field); color: var(--field-ink); } .ff-n { color: var(--muted); font: 11px var(--mono); padding: 0 4px; }
.ff-add { margin-top: 2px; }
.ro-box { white-space: pre-wrap; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-xs); background: var(--surface-2); max-height: 200px; overflow: auto; font-size: 13px; }
.pop-ver .ver-row { gap: 12px; }
/* the bell: public/app/shell.css (2026-11-30, drawn on every page) */
@media (max-width: 782px) {
  .agw.open { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .agw.open .agw-split { display: none; }
  .agw-msgs, .agw-cmp { padding-left: 12px; padding-right: 12px; }
}
/* the Test area (issue #55, test-tab.js): version picker, compare columns, drawer (test cases, inspector), compare summary */
.agt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.agt-bar .sp, .tc-bar .sp, .tc-h .sp { flex: 1; }
.agt-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; } .agt-pick > span { color: var(--muted); font-weight: 700; }
.agt-pick select { padding: 4px 10px; border-radius: var(--pill); }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.agt-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.agt-body.drawer { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); }
.agt-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.agt-main.cmp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.agt-col { min-width: 0; display: flex; flex-direction: column; }
.agt-col-h { font-size: 13px; padding: 0 2px 6px; }
.agt-drawer { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; min-height: 420px; max-height: calc(100dvh / var(--zf, 1) - 160px); overflow: hidden; }
.agt-dh { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line-2); } .agt-dh h3 { margin: 0; font-size: 14px; }
.agt-db { flex: 1; overflow: auto; padding: 12px; font-size: 13px; }
.agt-db h4, .agt-diff h4 { margin: 14px 0 6px; font: 800 11.5px var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.agt-diff { margin: 14px 0 0; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.agt-diff h3 { margin: 0 0 8px; font-size: 15px; }
.agt-tbl { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.agt-tbl th, .agt-tbl td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.agt-tbl tr > th:first-child { width: 22%; color: var(--muted); font-weight: 600; }
.agt-fields tr.same td { color: var(--muted); }
mark.del { background: var(--danger-soft); color: var(--ink); text-decoration: line-through; } mark.ins { background: var(--ok-soft); color: var(--ink); }
.agt-acts { display: flex; gap: 12px; margin-top: 4px; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; color: var(--accent-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn.danger { color: var(--danger); font-weight: 700; }
/* inspector */
.ins + .ins { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 4px; }
.ins-head { margin: 0 0 8px; } .ins-head.err b { color: var(--danger); }
.ins-tree, .ins-tree ul { list-style: none; margin: 0; padding: 0; } .ins-tree ul { padding-left: 16px; border-left: 1px solid var(--line-2); margin-left: 4px; }
.ins-n { margin: 0 0 6px; }
.ins-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.ins-k { font: 700 10.5px var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ins-bits { font: 11.5px var(--mono); color: var(--muted); margin-left: auto; }
.ins-bar { height: 4px; background: var(--accent); border-radius: var(--pill); margin-top: 2px; width: 0; }
.ins-model > .ins-bar { background: var(--yellow); }
.ins-warn { margin: 0; padding-left: 18px; }
.ins-fields dt { font-weight: 600; margin-top: 6px; } .ins-fields dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
.ins-call summary { cursor: pointer; font: 12px var(--mono); }
.ins-call pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 11.5px var(--mono); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-xs); padding: 6px 8px; max-height: 280px; overflow: auto; }
.ins-role { margin: 6px 0 2px; font: 800 11px var(--display); text-transform: uppercase; color: var(--muted); }
.pill.warn { background: var(--yellow); color: var(--navy); } .pill.err { background: var(--danger-solid); color: var(--on-danger); }
/* test cases */
.tc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.tc-cases, .tc-results, .tc-reports { list-style: none; margin: 0; padding: 0; }
.tc-cases > li, .tc-results > li { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 6px; background: var(--surface-2); }
.tc-cases p, .tc-results p { margin: 4px 0 0; }
.tc-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tc-checks { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12.5px; } .tc-checks .ok { color: var(--ok); } .tc-checks .ko { color: var(--danger); font-weight: 700; }
.pill.tc-pass { background: var(--accent); color: var(--on-accent); } .pill.tc-fail { background: var(--danger-solid); color: var(--on-danger); } .pill.tc-review { background: var(--accent-soft); color: var(--ink); }
.tc-reports li { margin: 0 0 4px; font-size: 12.5px; }
.tc-fields { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; } .tc-fields legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.tc-flags { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; }
.tc-run .spin { display: inline-block; vertical-align: -3px; border-color: var(--line); border-top-color: var(--accent); }
@media (max-width: 1100px) { .agt-body.drawer { grid-template-columns: minmax(0, 1fr); } .agt-drawer { max-height: none; } }
@media (max-width: 900px) { .agt-main.cmp { grid-template-columns: minmax(0, 1fr); } }
/* the positions map of a Locate answer (issue #52, public/agents/map.js): an SVG drawn here, no map tiles */
.mp { margin: 8px 0 0; max-width: 680px; }
.mp-svg { width: 100%; height: auto; display: block; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); }
.mp-acc { fill: currentColor; fill-opacity: .08; stroke: currentColor; stroke-opacity: .25; stroke-width: 1; }
.mp-route { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-opacity: .8; }
.mp-pt { fill: currentColor; stroke: var(--surface); stroke-width: 1; }
.mp-pt.mv { stroke: currentColor; stroke-width: 2; fill: var(--surface); }
.mp-pt.end { stroke: var(--ink); stroke-width: 1.5; }
.mp-scale line, .mp-north line { stroke: var(--ink); stroke-width: 2; }
.mp-scale text, .mp-north text { fill: var(--ink); font: 500 11px var(--mono); }
.mp-legend { list-style: none; margin: 6px 0 2px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font: 500 12px var(--mono); }
.mp-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: -1px; }
/* the series: the five colours and their mixes, ≥ 3:1 against the surface for the marks (the legend names each one) */
.mp { --mp0: var(--blue); --mp1: var(--navy); --mp2: color-mix(in srgb, var(--yellow) 55%, var(--navy)); --mp3: color-mix(in srgb, var(--sky) 60%, var(--navy)); --mp4: color-mix(in srgb, var(--blue) 50%, var(--navy)); --mp5: color-mix(in srgb, var(--yellow) 30%, var(--blue)); }
:root[data-theme="dark"] .mp { --mp0: var(--sky); --mp1: var(--white); --mp2: var(--yellow); --mp3: color-mix(in srgb, var(--sky) 50%, var(--white)); --mp4: color-mix(in srgb, var(--yellow) 50%, var(--white)); --mp5: color-mix(in srgb, var(--blue) 50%, var(--white)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="dark"]):not([data-theme="light"]) .mp { --mp0: var(--sky); --mp1: var(--white); --mp2: var(--yellow); --mp3: color-mix(in srgb, var(--sky) 50%, var(--white)); --mp4: color-mix(in srgb, var(--yellow) 50%, var(--white)); --mp5: color-mix(in srgb, var(--blue) 50%, var(--white)); } }
.mp-c0 { color: var(--mp0); } .mp-c1 { color: var(--mp1); } .mp-c2 { color: var(--mp2); } .mp-c3 { color: var(--mp3); } .mp-c4 { color: var(--mp4); } .mp-c5 { color: var(--mp5); }
/* the proposal / e-mail draft cards of the Draft agents (issue #50, draft-cards.js) */
.dcard { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); margin: 8px 0 0; display: grid; gap: 8px; }
.dcard-h { font-weight: 600; font-size: 13px; }
.dcard-item { border-top: 1px solid var(--line-2); padding-top: 6px; } .dcard-item:first-of-type { border-top: 0; padding-top: 0; }
.dcard-text { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.dcard label { display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); }
.dcard input, .dcard textarea { font: inherit; color: var(--field-ink); width: 100%; box-sizing: border-box; }
.dcard-f { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
/* an agent's tool calls and sources (issue #64, public/agents/tool-cards.js) */
.msg .tool-l { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.tool-src { margin: 6px 0 0; font-size: 12.5px; }
.tool-src summary { cursor: pointer; color: var(--muted); }
.tool-src ol { margin: 4px 0 0; padding-left: 20px; }
/* a voice note kept with its transcript (#87): played back in the person's own bubble */
.voice-play { display: block; width: 100%; max-width: 300px; height: 40px; margin: 4px 0 6px; }
