/* 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 { display: flex; flex-direction: column; }
.ag-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 { display: flex; align-items: baseline; min-width: 0; }
.ag-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; }
/* The Now tab is one scroller holding everything on it, the Steward's limits included (they sat outside it and pushed
   the last of it out of reach, 1 Dec 2026). Room at the end for a phone's home indicator. */
.ag-detail .tabbody.ag-now { padding-bottom: 0; overscroll-behavior: contain; } /* no padding at its end: a sticky Save sits on the edge */
.ag-detail .tabbody.ag-now::after { content: ""; display: block; height: calc(32px + env(safe-area-inset-bottom, 0px)); }
.agentpage[data-sub="now"] .ag-bar #agBtns { display: none; } /* Wake or Rest is on Its computer's line there */
.ag-sec { border-top: var(--hair, 1px solid var(--line)); margin-top: 18px; padding-top: 12px; }
.ag-sec > .ag-h:first-child, .ag-sec > div:first-child > .ag-h:first-child { margin-top: 0; }
.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 { 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); }
/* Its computer (Now tab): awake or resting with Wake or Rest on one line, its screen, then Set up and Start new
   computers from it. Flat: lines of state, no box. */
.ag-cs-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 36px; }
.ag-cs-line .ag-h { margin: 0; }
.ag-cs-line .grow { flex: 1; }
.ag-cs-now { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.ag-cs-now > i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.ag-cs-now.on > i { background: var(--ok); }
.ag-cs-now.on { color: var(--text); }
.ag-subh { display: flex; align-items: baseline; gap: 4px; margin: 10px 0 6px; font-size: 12.5px; color: var(--text-3); }
.ag-noscreen { margin: 0; font-size: 13px; }
.ag-cs-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ag-cs-note { margin: 8px 0 0; font-size: 12.5px; max-width: 60ch; }
.ag-cs-state { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 13px; color: var(--text-2); }
.ag-cs-state svg { width: 16px; height: 16px; flex: none; }
.ag-cs-state.ok svg { color: var(--ok); }
.ag-cs-state.warn { color: var(--warn); }
.ag-cs-tail { margin: 8px 0 0; } .ag-cs-tail summary { cursor: pointer; font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.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 { 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-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-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; }
  .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; }

/* The agent page's Watch live (docs/STREAMS.md), beside "Its screen". */
.ag-live { margin-left: 8px; font-weight: 400; font-size: 13px; }
