/* Agents and Machines on the panels (console.js areaPanels, mountAgentsArea, mountMachinesArea; docs/CONSOLE-REDESIGN.md
   §1.1, §3.3; tt-fix-areas): the list pane holds the area's heading and tabs, an item opens in the detail pane. Built on
   the panels (panels.css) and the Tasks list's rows (templates.css .tl-row). Flat: hairlines, no boxed cards. Theme
   tokens only (docs/THEMES.md). Classes start with ap-, ag- and mch-. */

/* a tab's page drawn inside the list pane (Devices, Jobs, Public agents): no second title, the pane's own padding */
.pn-b > .page.ap-page, .pn-b > .page.pa-embed { padding: 14px 16px 32px; max-width: none; margin: 0; }
.ap-page > .page-head { margin: 0 0 10px; }
.ap-lede, .pa-lede { margin: 0 0 14px; font-size: 13px; max-width: 760px; }
.pn-b > .ac-page.ac-embed .ac-head { margin-bottom: 10px; }
.ap-acts { display: inline-flex; gap: 6px; align-items: center; }
.ap-acts a.btn { text-decoration: none; }

/* the list: a mark with the state dot, the name, what it does, then the asks, the holder and the last turn */
.ag-sum { margin: 0; padding: 10px 16px; font-size: 12.5px; color: var(--text-3); border-bottom: 1px solid var(--line); }
.ag-sum .warn { color: var(--warn); font-weight: 600; }
.ag-sum a { color: var(--text-2); }
.ag-rows, .mch-rows { display: flex; flex-direction: column; }
.ag-row, .mch-row { align-items: center; }
.ag-av { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; position: relative;
  background: var(--ink-3); color: var(--text-2); font: 600 12px/1 var(--sans); letter-spacing: .02em; }
.ag-av svg { width: 17px; height: 17px; }
.ag-av.st { background: color-mix(in srgb, var(--canopy) 18%, var(--ink-2)); color: var(--canopy-2); }
.ag-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--content-bg); background: var(--idle); }
.ag-dot.working { background: var(--ok); }
.ag-dot.needs { background: var(--warn); }
.ag-dot.idle { background: var(--sky); }
.ag-dot.asleep { background: var(--text-3); }
.ag-row.working .ag-dot { animation: ag-pulse 1.6s ease-in-out infinite; }
@keyframes ag-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 0%, transparent); } }
:root[data-motion="reduced"] .ag-row.working .ag-dot { animation: none; }
@media (prefers-reduced-motion: reduce) { .ag-row.working .ag-dot { animation: none; } }
.ag-first { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin-left: 8px; }
.ag-row .t1, .mch-row .t1 { display: flex; align-items: baseline; min-width: 0; }
.ag-row .t3 .tag + .tag::before, .mch-row .t3 .tag + .tag::before { content: "· "; color: var(--text-3); }
.ag-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; max-width: 40%; }
.ag-state { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.ag-row.needs .ag-state { color: var(--warn); }
.ag-row.working .ag-state { color: var(--ok); }
.ag-side .when { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* one agent in the detail pane: the conversation scrolls, the composer stays at the bottom */
.pn-b.ag-detail { overflow: hidden; display: flex; flex-direction: column; }
.ag-detail > .agentpage { flex: 1; min-height: 0; }
.ag-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 16px 4px; min-width: 0; }
.ag-bar .grow { flex: 1; }
.ag-detail .ag-sub { color: var(--text-3); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.ag-detail .ag-sub span + span::before { content: "·"; margin-right: 10px; color: var(--text-3); }
.ag-detail .ag-tabs { margin-top: 4px; }
.ag-detail .tabbody { flex: 1; min-height: 0; padding: 14px 16px 24px; }
.ag-note { margin: 10px 16px 0; font-size: 12.5px; }
.ag-h { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin: 16px 0 6px; }
.tabbody > div:first-child > .ag-h:first-child, .ag-wk-h .ag-h, .mch-add .ag-h { margin-top: 0; }
.ag-task { margin: 0 0 4px; overflow-wrap: anywhere; }
.ag-held { margin: 8px 0 0; padding-left: 10px; border-left: 2px solid var(--warn); font-size: 13px; color: var(--text-2); }
.ag-lines { margin: 0; padding: 10px 12px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius-s); font: 12px/1.5 var(--mono); color: var(--code-text); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
.ag-still img { border: 1px solid var(--line); border-radius: var(--radius-s); }
.ag-hold { display: inline-flex; gap: 8px; align-items: center; }
.ag-holder { font-size: 12px; color: var(--warn); white-space: nowrap; }
.ag-wk-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.ag-wk-h .grow { flex: 1; }
.ag-wk-h a.btn { text-decoration: none; }
.ag-bar #agBtns, .ag-bar .ag-pin, .mch-acts { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ap-acts a.btn { color: var(--text); }

/* one machine in the detail pane */
.mch-one { min-width: 0; }
.mch-acts { margin: 0 0 12px; }
.mch-acts:empty { display: none; }
.mch-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: 13.5px; }
.mch-kv dt { color: var(--text-3); font-size: 12.5px; }
.mch-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mch-kv .bad-t { color: var(--bad-2); }
.mch-code { align-items: flex-end; padding: 4px 0 12px; }
.mch-tabs { margin: 0 -16px 12px; }
.mch-one #mchDetail > .panel { border: 0; padding: 0; background: none; }
.mch-add { border-top: 1px solid var(--line); }
.mch-add > p { margin: 0 0 10px; font-size: 13px; }
.mch-add .vault-form { margin: 14px 0 0; }

/* a project's Settings: Outside work, Keys, Asking the team, People as a second strip under its tabs */
.prj-set { margin: -6px 0 18px; }

@media (max-width: 780px) {
  .ag-sum { padding: 10px 14px; }
  .pn-b > .page.ap-page, .pn-b > .page.pa-embed { padding: 12px 14px 28px; }
  .ag-detail .tabbody { padding: 12px 14px 24px; }
  .mch-tabs { margin: 0 -14px 12px; }
  .ag-side { max-width: 34%; }
  .ag-bar { padding: 10px 14px 4px; }
}
.ag-still .gl-still-words { font-size: 13px; color: var(--text-3); display: block; }
