/* HerdR Collaboration: page styles on top of the shared design tokens (theme.css/base.css).
 * Same look as the dashboard: white cards on a light grey ground, green accent, Inter. */
.cx-page { color-scheme: light dark; }
.cx-agentcard[hidden] { display: none; }
/* WCAG 1.4.3 (T16 UI gate): the shared light tokens in theme.css give 3.2:1 for muted text and for white-on-accent
 * (below 4.5:1). Darker values for this page only; the dashboard theme is untouched. Dark mode sets its own below. */
.cx-page, .cx-embed {
  --accent: #0a7358; --accent-hover: #085f49;
  --text-secondary: #55556a; --text-muted: #686880;
  --status-attention: #b45309; --status-blocked: #c2410c;
}
/* Embedded collaboration follows the dashboard's chosen theme, including forced dark on a light OS. */
:root[data-theme="dark"] .cx-embed {
  --accent: inherit; --accent-hover: inherit;
  --text-secondary: inherit; --text-muted: inherit;
  --status-attention: inherit; --status-blocked: inherit;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cx-embed {
    --accent: inherit; --accent-hover: inherit;
    --text-secondary: inherit; --text-muted: inherit;
    --status-attention: inherit; --status-blocked: inherit;
  }
}
@media (prefers-color-scheme: dark) {
  .cx-page {
    --background: #14161a; --surface: #1c1f26; --surface-2: #272b34; --surface-hover: #232730;
    --border: #363b47; --border-subtle: #2b303a;
    --text: #e6e8ee; --text-secondary: #aab0bf; --text-muted: #8a91a3;
    --accent: #19c39b; --accent-hover: #14a883; --accent-weak: #16322c; --text-on-accent: #07140f;
    --violet-weak: #2a2447; --status-ok: #34d399; --status-failed: #f87171; --status-attention: #fbbf24;
    --status-blocked: #fb923c;   /* the light #c2410c is ~3.2:1 here; this is >= 6.2:1 on every dark surface */
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
  .cx-page .hd-error { background: #3a1d1d; }
}

/* ---- shell (mirrors <herdr-app-shell>) ---- */
.hd-shell { display: flex; min-height: 100vh; }
.hd-shell__sidebar { width: var(--sidebar-width); background: var(--surface); flex-shrink: 0;
  border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; }
.hd-shell__brand { display: flex; align-items: center; gap: 10px; padding: 16px; font-weight: 600;
  font-size: .95rem; border-bottom: 1px solid var(--border-subtle); }
.cx-logo { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--text-on-accent);
  display: grid; place-items: center; font-size: .9rem; }
.hd-shell__nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.hd-shell__link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-secondary); text-decoration: none; font-size: .875rem; }
.hd-shell__link:hover { background: var(--surface-hover); text-decoration: none; }
.hd-shell__link.active { background: var(--accent-weak); color: var(--accent); font-weight: 500; }
.cx-user { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--border-subtle); font-size: .8125rem;
  color: var(--text-secondary); display: flex; flex-direction: column; gap: 8px; overflow-wrap: anywhere; }
.hd-shell__main { flex: 1; min-width: 0; }
.hd-shell__content { max-width: var(--content-max); margin: 0 auto; padding: 24px; }
@media (max-width: 720px) {
  .hd-shell { flex-direction: column; }
  .hd-shell__sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--border-subtle); }
  .hd-shell__nav { flex-direction: row; overflow-x: auto; }
  .cx-user { margin-top: 0; flex-direction: row; align-items: center; justify-content: space-between; border-top: 0; }
  .hd-shell__content { padding: 16px; }
}

/* ---- page header ---- */
.cx-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.cx-head h1 { margin: 0; }
.cx-sub { color: var(--text-muted); font-size: .875rem; margin: 2px 0 0; }
.cx-section { margin-top: 28px; }
.cx-section > h2 { font-size: 1rem; text-transform: none; margin-bottom: 10px; }

/* ---- cards and grid ---- */
.hd-card { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); }
.hd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.hd-card__title { font-weight: 600; margin-bottom: 4px; overflow-wrap: anywhere; }
.hd-card__sub { color: var(--text-muted); font-size: .8125rem; }
.cx-room { display: flex; flex-direction: column; gap: 10px; text-align: left; cursor: pointer; font: inherit; color: inherit;
  width: 100%; transition: border-color var(--motion-fast), box-shadow var(--motion-fast); }
.cx-room:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.cx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cx-row--between { justify-content: space-between; }
.cx-stack { display: flex; flex-direction: column; gap: 10px; }
.cx-agent-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:12px 16px; margin:0 0 12px; border:1px solid var(--border-subtle); border-radius:var(--radius); background:var(--surface-2); }
.cx-agent-toolbar strong { font-size:.9rem; }
.cx-agent-toolbar select { min-width:150px; }
.cx-agent-card--selected { border-color:var(--accent); box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 20%,transparent); }
.cx-agent-select { position:absolute; top:14px; right:14px; width:18px; height:18px; accent-color:var(--accent); }
.cx-agentcard { position:relative; }
.cx-fleet-details > summary { cursor:pointer; list-style:none; font-weight:650; }
.cx-fleet-details > summary::-webkit-details-marker { display:none; }
.cx-fleet-details > summary::before { content:'▸'; display:inline-block; margin-right:8px; transition:transform .15s; }
.cx-fleet-details[open] > summary::before { transform:rotate(90deg); }

/* ---- pills (status is always text + colour) ---- */
.hd-status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--border-subtle); background: var(--surface-2); font-size: .75rem; font-weight: 500; white-space: nowrap; }
.hd-status__dot { color: var(--sc, var(--text-muted)); font-weight: 700; }
.hd-status__label { color: var(--text-secondary); }
.hd-ident { font-family: var(--font-mono); font-size: .75rem; background: var(--surface-2); color: var(--text-secondary);
  padding: 1px 6px; border-radius: var(--radius-sm); overflow-wrap: anywhere; }

/* ---- buttons and inputs ---- */
/* the page itself and the dashboard-embedded view; never the rest of the dashboard */
.cx-page button, .cx-embed button { font-family: var(--font-sans); font-size: .875rem; }
/* .hd-btn and its variants live in herdr-design-system/base.css */
.cx-input, .cx-page input, .cx-embed input, .cx-page select, .cx-embed select { font: inherit; padding: 8px 10px; background: var(--surface);
  color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0; }
.cx-field { display: flex; flex-direction: column; gap: 4px; font-size: .8125rem; color: var(--text-secondary); flex: 1 1 200px; }
.cx-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.cx-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }   /* a heading for the outline, not for the eye */
.cx-msg { font-size: .8125rem; color: var(--text-secondary); }
.cx-msg[role=alert] { color: var(--status-failed); }

/* ---- empty / error ---- */
.hd-empty, .hd-error { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px;
  border-radius: var(--radius); border: 1px dashed var(--border); color: var(--text-muted); text-align: center; }
.hd-error { border-color: var(--status-failed); color: var(--status-failed); background: var(--error-bg); }

/* ---- sign-in ---- */
.cx-center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.cx-signin { width: 100%; max-width: 420px; text-align: center; padding: 32px 28px; }
.cx-signin .cx-logo { width: 44px; height: 44px; border-radius: 12px; font-size: 1.3rem; margin: 0 auto 14px; }
.cx-signin h1 { margin-bottom: 6px; }
.cx-signin p { color: var(--text-secondary); }

/* ---- connect guide ---- */
.cx-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: 8px; color: var(--text-secondary); font-size: .9rem; }
.cx-steps b { color: var(--text); font-weight: 600; }
.cx-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 12px; }
.cx-tab { border: 0; background: transparent; padding: 8px 12px; color: var(--text-secondary); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.cx-tab[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.cx-code { position: relative; }
.cx-code pre { margin: 0; padding: 14px 84px 14px 14px; background: var(--surface-2); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); white-space: pre-wrap; word-break: break-all; font-size: .8125rem; max-height: 280px; overflow: auto; }
.cx-code .hd-btn { position: absolute; top: 8px; right: 8px; }
.cx-warn { border-left: 3px solid var(--status-attention); padding: 8px 12px; background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .875rem; color: var(--text-secondary); }

/* ---- room tabs: one tab per room, then sub-tabs inside a room ---- */
.cx-rtabs { display: flex; align-items: flex-end; gap: 4px; overflow-x: auto; overflow-y: hidden; margin: 0 0 18px; padding: 4px 2px 0;
  border-bottom: 1px solid var(--border-subtle); scrollbar-width: thin; }
.cx-rtabs .grow { flex: 1 1 auto; }
.cx-rtab { flex: 0 0 auto; border: 1px solid transparent; border-bottom: 0; background: transparent; color: var(--text-secondary);
  padding: 8px 14px; border-radius: 9px 9px 0 0; cursor: pointer; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: -1px; transition: background var(--motion-fast), color var(--motion-fast); }
.cx-rtab:hover { background: var(--surface-hover); color: var(--text); }
.cx-rtab[aria-selected=true] { background: var(--surface); color: var(--text); font-weight: 600; border-color: var(--border-subtle);
  box-shadow: inset 0 2px 0 var(--accent); }
.cx-rtab--new { color: var(--accent); }
.cx-roomhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cx-roomhead h1 { margin: 0; font-size: 1.35rem; }
.cx-stabs { margin-bottom: 14px; }
.cx-badge { display: inline-block; margin-left: 6px; vertical-align: middle; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--text-on-accent);
  font-size: .6875rem; font-weight: 700; line-height: 18px; text-align: center; }
.cx-badge[hidden], .cx-panel[hidden] { display: none; }
.cx-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }

/* ---- room: chat ---- */
.cx-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; position: relative; }
.cx-log { height: clamp(320px, calc(100vh - 330px), 720px); overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 3px;
  background: var(--background); scroll-behavior: smooth; }
.cx-m { display: flex; gap: 10px; align-items: flex-end; max-width: min(78%, 680px); margin-top: 10px; }
.cx-m--cont { margin-top: 0; }
.cx-m--cont .cx-av { visibility: hidden; height: 0; }
.cx-m--cont .cx-meta { display: none; }
.cx-m--mine { align-self: flex-end; flex-direction: row-reverse; }
.cx-av { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700;
  color: #fff; background: hsl(var(--h, 200) 48% 42%); }
.cx-mbody { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cx-m--mine .cx-mbody { align-items: flex-end; }
.cx-meta { display: flex; gap: 8px; align-items: baseline; font-size: .75rem; color: var(--text-muted); }
.cx-meta b { color: var(--text-secondary); font-weight: 600; }
.cx-bubble { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 14px 14px 14px 4px;
  padding: 8px 13px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; box-shadow: var(--shadow); }
.cx-m--mine .cx-bubble { background: var(--accent); color: var(--text-on-accent); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.cx-m--agent .cx-bubble { background: var(--violet-weak, var(--surface-2)); border-color: var(--border-subtle); }
.cx-taskcard { align-self: center; width: min(88%, 620px); margin: 8px 0; padding: 8px 12px; background: var(--surface);
  border: 1px solid var(--border-subtle); border-left: 4px solid var(--tc, var(--border)); border-radius: 8px; font-size: .8125rem;
  color: var(--text-secondary); overflow-wrap: anywhere; white-space: pre-wrap; }
.cx-taskcard__head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.cx-taskcard__head b { color: var(--text); }
.cx-taskcard__head span { color: var(--tc); font-weight: 600; text-transform: uppercase; font-size: .6875rem; letter-spacing: .04em; }
.cx-taskcard__head time { margin-left: auto; color: var(--text-muted); font-size: .75rem; }
.cx-event { align-self: center; margin: 6px 0; font-size: .75rem; color: var(--text-muted); background: var(--surface-2); padding: 2px 10px; border-radius: 999px; }
.cx-jump { position: absolute; right: 18px; bottom: 96px; box-shadow: var(--shadow-lg, 0 4px 12px rgba(0,0,0,.2)); z-index: 10; }
.cx-jump[hidden] { display: none; }
.cx-compose { display: flex; gap: 10px; align-items: flex-end; padding: 12px 14px 4px; border-top: 1px solid var(--border-subtle); background: var(--surface); }
.cx-compose-msg { padding: 2px 16px 10px; background: var(--surface); }
.cx-ac-wrap { position: relative; flex: 1; min-width: 0; }
.cx-ac-wrap textarea { width: 100%; box-sizing: border-box; resize: none; max-height: 180px; line-height: 1.4; border-radius: 12px; }
.cx-ac { position: absolute; left: 0; bottom: calc(100% + 6px); min-width: min(320px, 100%); max-width: 100%; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.25));
  max-height: 240px; overflow-y: auto; z-index: 10; }
.cx-ac[hidden] { display: none; }
.cx-ac li { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.cx-ac li span { color: var(--text-muted); font-size: .75rem; }
.cx-ac li[aria-selected=true] { background: var(--accent-weak); color: var(--accent); }
.cx-ac li[aria-selected=true] span { color: inherit; opacity: .8; }
.cx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cx-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; justify-content: space-between;
  padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface); font-size: .875rem; overflow-wrap: anywhere; }
.cx-list .grow { flex: 1 1 140px; min-width: 0; }
.cx-back { background: transparent; border: 0; color: var(--text-secondary); cursor: pointer; padding: 0; margin-bottom: 6px; }
.cx-back:hover { color: var(--accent); }

.cx-embed .cx-tabs { margin-bottom: 16px; }

.cx-checks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cx-check { display: inline-flex; align-items: center; gap: 4px; font-size: .8125rem; color: var(--text-secondary); }
.cx-check input:disabled + * , .cx-check:has(input:disabled) { opacity: .5; }
textarea.cx-input { resize: vertical; font: inherit; }
.cx-stack > .cx-field { flex: 0 0 auto; }          /* the row-wise 200px basis is a height inside a column */

/* ---- flow of work */
.cx-flow-scroll { overflow-x: auto; padding: 4px 0; }
.cx-flow-box { fill: var(--surface-raised, var(--surface, #fff)); stroke: var(--border, #d0d4da); stroke-width: 1; }
.cx-flow-node { cursor: pointer; }
.cx-flow-node:hover .cx-flow-box, .cx-flow-node:focus .cx-flow-box { stroke: var(--accent, #1f7ae0); stroke-width: 2; outline: none; }
.cx-flow-node--gone { opacity: 0.45; }
.cx-flow-name { font: 600 11px var(--font-sans, system-ui, sans-serif); fill: var(--text, #1b1f24); }
.cx-flow-sub { font: 10px var(--font-sans, system-ui, sans-serif); fill: var(--text-muted, #666); }
.cx-flow-edge { cursor: pointer; opacity: 0.85; transition: stroke-width 0.3s; }
.cx-flow-edge--live { stroke-dasharray: 7 6; animation: cx-flow-move 0.9s linear infinite; }
.cx-flow-pulse { animation: cx-flow-pulse 1.2s ease-out 1; }
.cx-still .cx-flow-edge--live, .cx-still .cx-flow-pulse { animation: none; }
@keyframes cx-flow-move { to { stroke-dashoffset: -26; } }
@keyframes cx-flow-pulse { 0% { opacity: 1; filter: drop-shadow(0 0 6px currentColor); } 100% { opacity: 0.85; } }
/* A live task card that slides in and glows runs both animations together (the attribute rule
 * alone would replace one with the other). */
.cx-flow-pulse[data-entering] { animation: hd-enter var(--motion-normal, 200ms) ease-out, cx-flow-pulse 1.2s ease-out 1; }
/* OS reduced motion stops these unless the viewer explicitly chose calm "off"; calm "on" is
 * handled for every element by motion.css. */
@media (prefers-reduced-motion: reduce) {
  html:not([data-calm="off"]) .cx-flow-edge--live, html:not([data-calm="off"]) .cx-flow-pulse { animation: none; }
  html:not([data-calm="off"]) .cx-log { scroll-behavior: auto; }
}

/* ---- public guide page */
.cx-guide { max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; line-height: 1.55; }
.cx-guide h1 { font-size: 1.7rem; margin: 8px 0 12px; }
.cx-guide h2 { font-size: 1.3rem; margin: 32px 0 8px; padding-top: 8px; border-top: 1px solid var(--border, #d0d4da); }
.cx-guide h3 { font-size: 1.05rem; margin: 22px 0 6px; }
.cx-guide pre { overflow-x: auto; padding: 12px; border-radius: 8px; background: var(--surface-sunken, rgba(127,127,127,.12)); }
.cx-guide code { font-family: var(--font-mono, ui-monospace, monospace); font-size: .85em; }
.cx-guide :not(pre) > code { padding: 1px 5px; border-radius: 4px; background: var(--surface-sunken, rgba(127,127,127,.12)); }
.cx-guide-table { overflow-x: auto; margin: 10px 0; }
.cx-guide table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.cx-guide th, .cx-guide td { text-align: left; vertical-align: top; padding: 6px 10px; border-bottom: 1px solid var(--border, #d0d4da); }

#hcn-roomagents, #hcn-grant, #hcn-requests, #hcn-tasks { max-height: 560px; overflow-y: auto; }

/* People: who asked to join, and what the operator did about it */
.cx-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.cx-chip { border: 1px solid var(--border-subtle); background: var(--surface); color: var(--text-secondary);
  padding: 5px 12px; border-radius: 999px; cursor: pointer; font: inherit; }
.cx-chip:hover { background: var(--surface-hover); color: var(--text); }
.cx-chip[aria-selected=true] { background: var(--accent-weak); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.cx-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .875rem; }
.cx-table th, .cx-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.cx-table th { color: var(--text-secondary); font-weight: 600; }

/* ---- polish: agent names, rows, cards ---- */
.cx-page, .cx-embed { --cx-ring: 0 0 0 3px var(--accent); }      /* a focus ring needs 3:1 against the page (1.4.11); the old 28% tint measured 1.5:1 */
.cx-embed h1, .cx-page h1 { letter-spacing: -.01em; }
.cx-head h1 { font-size: 1.6rem; }
.cx-section > h2 { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.hd-card { border-radius: 12px; transition: border-color var(--motion-fast, .15s), box-shadow var(--motion-fast, .15s), transform var(--motion-fast, .15s); }
.hd-grid > .hd-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle)); box-shadow: 0 6px 18px rgba(0, 0, 0, .08); transform: translateY(-1px); }
.hd-card__title { font-size: .95rem; }
.cx-cols > .hd-card > .hd-card__title { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.hd-btn { transition: background var(--motion-fast, .15s), box-shadow var(--motion-fast, .15s); }
.hd-btn:focus-visible, .cx-input:focus-visible, .cx-page input:focus-visible, .cx-embed input:focus-visible, .cx-page select:focus-visible, .cx-embed select:focus-visible,
.cx-rtab:focus-visible, .cx-stab:focus-visible, .cx-edit:focus-visible { outline: none; box-shadow: var(--cx-ring); }
.hd-status { background: color-mix(in srgb, var(--sc, var(--text-muted)) 10%, var(--surface)); border-color: color-mix(in srgb, var(--sc, var(--text-muted)) 28%, var(--border-subtle)); }
.cx-av--sm { width: 26px; height: 26px; flex-basis: 26px; font-size: .6875rem; }
.cx-ntitle { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; flex-wrap: wrap; }
.cx-nname { font-weight: 650; overflow-wrap: anywhere; }
.cx-edit { border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; padding: 2px 6px; border-radius: 6px; font-size: .9rem; line-height: 1; opacity: 1; }
.cx-edit:hover, .cx-ntitle:hover .cx-edit { opacity: 1; background: var(--surface-hover); color: var(--accent); }
.cx-rename { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cx-rename .cx-input { width: 11rem; padding: 4px 8px; }
.cx-at { color: var(--text-muted); font-weight: 600; margin-right: -2px; }
.cx-agentrow { align-items: center !important; gap: 8px 12px !important; }
.cx-agentrow .grow { display: flex; flex-direction: column; gap: 3px; }
.cx-sub1 { color: var(--text-muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cx-pills { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.cx-list li { overflow-wrap: break-word; transition: background var(--motion-fast, .15s); }
.cx-list li:hover { background: var(--surface-hover); }
.cx-agentcard .cx-row--between { align-items: flex-start; }
.cx-agentcard .hd-card__sub { line-height: 1.35; }
.cx-event { background: var(--surface-2); border: 1px solid var(--border-subtle); }
@media (prefers-reduced-motion: reduce) { .hd-card, .hd-btn, .cx-list li { transition: none; } .hd-grid > .hd-card:hover { transform: none; } }

/* the dashboard stacks every adjacent card with a top margin; inside a grid or column set the grid's gap does that */
.cx-cols > .hd-card, .hd-grid > .hd-card, .cx-stack > .hd-card { margin: 0; }
.cx-ntitle { flex-wrap: nowrap; }
.cx-ntitle .cx-nname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cx-agentrow { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; }
.cx-agentrow .cx-pills { grid-column: 1; }
.cx-agentrow > button { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.cx-agentrow .grow { grid-column: 1; }
.cx-section h3, .cx-section h4 { margin: 18px 0 8px; }

.cx-flow-edge--spawn { stroke-dasharray: 3 5; opacity: .6; cursor: default; }

/* ---- lineage graph, Gantt, replay (T09). Nothing is encoded by colour alone: shapes, dashes, glyphs, fill patterns and words. */
.cx-scroll { overflow: auto; max-width: 100%; }
.cx-scroll:focus-visible, .lin-svg g[role=button]:focus-visible { outline: 2px solid var(--accent, #1f7ae0); outline-offset: 2px; }
.lin-scroll { max-height: 70vh; border: 1px solid var(--border-subtle, #d0d4da); border-radius: 8px; }
.lin-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); gap: 16px; align-items: start; }
@media (max-width: 760px) { .lin-grid2 { grid-template-columns: minmax(0, 1fr); } }
.lin-svg { display: block; background: var(--surface, #fff); }
.lin-svg:focus { outline: none; }
.lin-box { fill: var(--surface-raised, var(--surface, #fff)); stroke: var(--text-secondary, #555); stroke-width: 1.5; }
.lin-node { cursor: pointer; }
.lin-node:hover .lin-box, .lin-node:focus .lin-box { stroke: var(--accent, #1f7ae0); stroke-width: 3; }
.lin-node:focus { outline: none; }
.lin-node--sel .lin-box { stroke: var(--accent, #1f7ae0); stroke-width: 3.5; stroke-dasharray: none; }
.lin-node--hit .lin-box { stroke-width: 3; stroke: var(--text, #1b1f24); }
.lin-node--active .lin-box { fill: color-mix(in srgb, var(--status-active, #1f7ae0) 10%, var(--surface, #fff)); }
.lin-node--waiting .lin-box { fill: color-mix(in srgb, var(--status-attention, #d89b1d) 12%, var(--surface, #fff)); }
.lin-node--finished .lin-box { fill: color-mix(in srgb, var(--status-ok, #1a9b6c) 10%, var(--surface, #fff)); }
.lin-node--failed .lin-box { fill: color-mix(in srgb, var(--status-danger, #c0392b) 10%, var(--surface, #fff)); }
/* Unrelated nodes recede by fading their shapes, not their words: 35% text opacity measured 1.7:1 (1.4.3). */
.lin-dim .lin-box, .lin-dim .lin-edge-line, .lin-dim .lin-arrowhead { opacity: .35; }
.lin-name { font: 600 11px var(--font-sans, system-ui, sans-serif); fill: var(--text, #1b1f24); }
.lin-sub, .lin-edge-tag { font: 10px var(--font-sans, system-ui, sans-serif); fill: var(--text-secondary, #555); }
.lin-edge-line { stroke: var(--text-secondary, #555); stroke-width: 1.6; }
.lin-edge--stale .lin-edge-line { stroke-width: 1; opacity: .7; }
.lin-edge--stale .lin-edge-tag { text-decoration: line-through; }
.lin-arrowhead { fill: var(--text-secondary, #555); }
.lin-grid { stroke: var(--border-subtle, #d0d4da); stroke-dasharray: 2 4; }
.lin-bar { stroke: var(--text-secondary, #555); stroke-width: 1; }
.lin-bar-text, .lin-mark-text { font: 600 10px var(--font-sans, system-ui, sans-serif); fill: var(--text, #1b1f24); paint-order: stroke; stroke: var(--surface, #fff); stroke-width: 3px; }
.lin-fill-active { fill: color-mix(in srgb, var(--status-active, #1f7ae0) 45%, var(--surface, #fff)); }
.lin-fill-waiting { fill: color-mix(in srgb, var(--status-attention, #d89b1d) 30%, var(--surface, #fff)); }
.lin-fill-finished { fill: color-mix(in srgb, var(--status-ok, #1a9b6c) 35%, var(--surface, #fff)); }
.lin-fill-failed { fill: color-mix(in srgb, var(--status-danger, #c0392b) 30%, var(--surface, #fff)); }
.lin-fill-stopped, .lin-fill-other { fill: color-mix(in srgb, var(--text-muted, #888) 25%, var(--surface, #fff)); }
.lin-hatch { stroke: var(--text-secondary, #555); }
.lin-hatch-fill, .lin-dot { fill: var(--text-secondary, #555); }
.lin-diamond { fill: var(--surface-raised, #fff); stroke: var(--text, #1b1f24); stroke-width: 1.5; }
.lin-mark--stale .lin-diamond { stroke-dasharray: 3 2; }
.lin-legend { font-size: .8125rem; }
.lin-legend__cols { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.lin-legend ul { list-style: none; margin: 4px 0; padding: 0; }
.lin-sw { display: inline-block; width: 22px; height: 10px; border: 1px solid var(--text-secondary, #555); vertical-align: middle; }
.lin-sw--waiting { background: repeating-linear-gradient(45deg, transparent 0 3px, var(--text-secondary, #555) 3px 4px); }
.lin-sw--finished { background: radial-gradient(var(--text-secondary, #555) 1px, transparent 1.5px) 0 0 / 5px 5px; }
.lin-sw--failed { background: linear-gradient(45deg, transparent 45%, var(--text-secondary, #555) 45% 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, var(--text-secondary, #555) 45% 55%, transparent 55%); }
.lin-sw--stopped { background: linear-gradient(transparent 40%, var(--text-secondary, #555) 40% 60%, transparent 60%); }
.lin-replay { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle, #d0d4da); }
.lin-slider { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; font-size: .8125rem; }
.lin-slider input { flex: 1; min-width: 120px; }
.lin-replay__status { flex: 1 0 100%; font-size: .8125rem; color: var(--text-secondary, #555); }
.lin-table { border-collapse: collapse; width: 100%; font-size: .8125rem; }
.lin-table caption { text-align: left; font-weight: 600; padding: 4px 0; }
.lin-table th, .lin-table td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border-subtle, #d0d4da); vertical-align: top; overflow-wrap: anywhere; }
.lin-tables { display: grid; gap: 12px; }
.lin-dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; font-size: .8125rem; }
.lin-dl dt { color: var(--text-secondary, #555); }
.lin-dl dd { margin: 0; overflow-wrap: anywhere; }
.lin-inspector h4 { margin: 12px 0 4px; font-size: .8125rem; text-transform: none; }
@media (forced-colors: active) { .lin-box, .lin-bar, .lin-edge-line { stroke: CanvasText; } .lin-node--sel .lin-box { stroke: Highlight; } }
@media (prefers-reduced-motion: reduce) { .lin-svg * { transition: none; animation: none; } }

/* T12: comments and steering beside the lineage inspector. Text from people is data: keep its line breaks, wrap it. */
.wb { display: grid; gap: 12px; }
.wb-section { border-top: 1px solid var(--hd-border, currentColor); padding-top: 8px; }
.wb-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.wb-comment, .wb-steer { padding: 6px 0; }
.wb-comment + .wb-comment, .wb-steer + .wb-steer { border-top: 1px dotted var(--hd-border, currentColor); }
.wb-fieldset { border: 1px solid var(--hd-border, currentColor); padding: 8px; }
.wb-radio { display: block; padding: 2px 0; }
.wb-confirm { border: 2px solid currentColor; padding: 8px; }
@media (forced-colors: active) { .wb-confirm, .wb-fieldset { border-color: CanvasText; } }

/* T14: context references, questions and cross-workspace links. A state is a glyph plus a word, never colour alone. */
.ctx-ref { margin-top: 4px; }
.ctx-chip { display: inline-flex; gap: 6px; align-items: center; max-width: 100%; padding: 2px 10px; border: 1px solid var(--hd-border, currentColor);
  border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 0.85em; overflow-wrap: anywhere; cursor: default; }
button.ctx-chip { cursor: pointer; }
button.ctx-chip:focus-visible, .ctx-chip:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.ctx-chip--hidden { border-style: dashed; }
.ctx-attached { padding: 4px 0; }
.ctx-consult, .ctx-link { border-top: 1px solid var(--hd-border, currentColor); padding-top: 8px; }
.ctx-inbox { border: 1px solid var(--hd-border, currentColor); border-radius: 8px; padding: 8px; }
@media (prefers-reduced-motion: reduce) { .ctx-chip { transition: none; } }
/* agent helpers */
.cx-panic { justify-content: space-between; }
.cx-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm, 13px); }
.cx-table th, .cx-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border, rgba(128,128,128,.25)); overflow-wrap: anywhere; }
.cx-tree { list-style: none; margin: 4px 0 0; padding-left: 16px; border-left: 1px solid var(--border, rgba(128,128,128,.35)); }
.cx-helpers { margin-top: 8px; }
.cx-helpers-panel { margin-top: 18px; }
.cx-helpers-panel .cx-sub1 { display: block; }
.cx-internal { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; font-size: 0.8em; font-weight: 600; color: var(--status-failed, #b00020); border: 1px solid currentColor; }
.cx-fix-results .cx-pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 24rem; overflow: auto; margin: .25rem 0 0; font-size: .85em; }

/* Long unbroken labels (ids, URLs) must wrap inside inspector link lists instead of widening the page at 320px. */
.cx-list li .hd-btn { white-space: normal; overflow-wrap: anywhere; text-align: left; max-width: 100%; height: auto; }
.cx-list li code { overflow-wrap: anywhere; }

/* The browser's default placeholder grey (#757575) is 3.6:1 on the dark surface; use the muted text token (>= 4.5:1 in both themes). */
.cx-page ::placeholder, .cx-embed ::placeholder { color: var(--text-muted); opacity: 1; }

/* A 300-character unbroken string (a URL, a hash, a path) in a node label, an instruction or an evidence title must wrap inside its
   row instead of pushing the page sideways (1.4.10 at 320px). Found by the real-server reflow gate on Attention and Progress. */
.cx-page .grow, .cx-embed .grow, .cx-attn-item, .cx-attn-item *, .cx-list li, .cx-list li *, .cx-page .cx-msg, .cx-embed .cx-msg { overflow-wrap: anywhere; min-width: 0; }
.cx-attn-item .hd-btn, .cx-attn-item select { max-width: 100%; }

/* @mentions in sent messages: chips that keep the literal text (copying a message copies "@gert.pi") */
/* Inline (not inline-flex, no nowrap) so a 48-character address wraps inside a 320px bubble instead of overflowing (1.4.10). */
.cx-mention { display: inline; padding: 0 4px; border-radius: 999px; font-weight: 600; overflow-wrap: anywhere; word-break: break-word;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: var(--accent-weak, var(--surface-2)); color: var(--accent-strong, var(--text)); border: 1px solid var(--border-subtle); }
.cx-mention--agent { background: var(--violet-weak, var(--surface-2)); }
.cx-mention--group { background: var(--surface-2); }
/* generated text: shown and announced, but not copied, so a copied message keeps its literal "@ext-..." */
.cx-mention--external { border-style: dashed; }
.cx-mention--external::after { content: " · external"; font-weight: 400; font-size: .85em; color: var(--text-muted); }
.cx-m--mine .cx-mention--external::after { color: inherit; }
.cx-mention__icon { font-size: .8em; margin-right: 2px; }
.cx-m--mine .cx-mention { background: color-mix(in srgb, var(--text-on-accent) 18%, transparent); color: inherit; border-color: transparent; }

/* ---- Mission Workbench: graph viewport, toolbar, status strip, inspector facts (S5) ---- */
#hcn-lineage { container-type: inline-size; }
@container (max-width: 760px) { .lin-grid2 { grid-template-columns: minmax(0, 1fr); } }
.lin-viewport { overflow: hidden; position: relative; max-width: 100%; touch-action: pan-y; cursor: grab; }
.lin-viewport--drag { cursor: grabbing; user-select: none; }
.lin-viewport .lin-svg { max-width: 100%; height: auto; }
.lin-viewport:focus-visible { outline: 2px solid var(--accent, #1f7ae0); outline-offset: 2px; }
.lin-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lin-tool { min-width: 44px; min-height: 44px; }
.lin-zoom { min-width: 48px; text-align: center; font-size: .8125rem; color: var(--text-secondary, #555); }
.lin-hint { margin: 4px 0 0; }
.lin-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border: 2px solid var(--text-secondary, #555); border-radius: 999px; font-size: .8125rem; font-weight: 600; color: var(--text, #1b1f24); background: var(--surface, #fff); }
.lin-badge--live { border-style: solid; border-color: var(--status-ok, #1a9b6c); }
.lin-badge--replay { border-style: dashed; border-color: var(--status-attention, #d89b1d); }
.lin-status { display: grid; grid-template-columns: auto repeat(2, minmax(0, 1fr)); gap: 12px 24px; align-items: start; padding: 8px 0 12px; border-bottom: 1px solid var(--border-subtle, #d0d4da); }
.lin-status ul { list-style: none; margin: 0; padding: 0; }
.lin-status__counts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8125rem; font-weight: 600; }
.lin-status__h { margin: 0 0 4px; font-size: .8125rem; font-weight: 600; }
.lin-status__list { display: grid; gap: 4px; }
.lin-status p { margin: 0; }
.lin-status > p { grid-column: 1 / -1; }
.lin-facts { margin-bottom: 8px; }
.lin-facts__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lin-nr { color: var(--text-secondary, #555); font-style: italic; }
.lin-terminal { display: grid; gap: 4px; }
.lin-chip rect { fill: var(--text-secondary, #555); }
.lin-chip text { font: 700 9px var(--font-sans, system-ui, sans-serif); fill: var(--surface, #fff); }
.lin-k-agent .lin-box { stroke-width: 3; }
.lin-k-session .lin-box { stroke-dasharray: 6 2; }
.lin-lane-hl { fill: color-mix(in srgb, var(--accent, #1f7ae0) 14%, transparent); }
@media (max-width: 640px) {
  .lin-status { grid-template-columns: minmax(0, 1fr); }
  .lin-toolbar .lin-tool { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .lin-viewport { scroll-behavior: auto; } }
.lin-status > div { min-width: 0; }
.lin-status .hd-btn { max-width: 100%; height: auto; white-space: normal; text-align: left; overflow-wrap: anywhere; }
/* filters disclosure + minimap (S5): the summary is a full-size target; nothing here animates */
.lin-filterbox > summary, .lin-legend > summary { cursor: pointer; display: flex; align-items: center; min-height: 44px; font-weight: 600; }
.lin-filterbox > summary:focus-visible, .lin-legend > summary:focus-visible { outline: 2px solid var(--accent, #1f7ae0); outline-offset: 2px; }
.lin-minimap { margin: 8px 0 0; display: inline-block; }
.lin-mm { display: block; max-width: 100%; height: auto; border: 1px solid var(--border, #8886); border-radius: 4px; background: var(--surface, transparent); cursor: crosshair; touch-action: manipulation; }
.lin-mm-bar { fill: currentColor; opacity: .28; }
.lin-mm-view { fill: color-mix(in srgb, var(--accent, #1f7ae0) 18%, transparent); stroke: var(--accent, #1f7ae0); stroke-width: 1.5; }
.lin-minimap, .lin-mm, .lin-mm-view { transition: none; animation: none; }
.lin-termauth .lin-tool { min-height: 44px; }
/* display:flex drops the browser's disclosure marker: draw one (no animation) */
.lin-filterbox > summary, .lin-legend > summary { list-style: none; gap: 8px; }
.lin-filterbox > summary::-webkit-details-marker, .lin-legend > summary::-webkit-details-marker { display: none; }
.lin-filterbox > summary::before, .lin-legend > summary::before { content: '▸'; display: inline-block; }
.lin-filterbox[open] > summary::before, .lin-legend[open] > summary::before { content: '▾'; }

/* Supporting room views sit after the four that carry the work, set quieter and divided from them. */
.cx-stabs .cx-stab--minor { font-size: 12px; }
.cx-stab:not(.cx-stab--minor) + .cx-stab--minor { margin-left: 8px; }
.cx-newroom > summary { cursor: pointer; font-weight: 600; font-size: 1rem; margin-bottom: 8px; }
.cx-helpers-idle h2 { margin-bottom: 2px; }

/* Handoffs: workspace overview and click-through detail */
.hd-ws__head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; width: 100%; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.hd-ws__chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.hd-ws__body { margin-top: 8px; }
.hd-chip { font-size: .75rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border-subtle); color: var(--text-muted); }
.hd-chip--failed, .hd-chip--expired, .hd-chip--rejected { color: var(--status-failed, #c0392b); border-color: currentColor; }
.hd-badge { font-size: .75rem; padding: 1px 8px; border-radius: 6px; background: var(--surface-raised, var(--surface)); border: 1px solid var(--border-subtle); }
.hd-badge--attention { color: var(--status-failed, #c0392b); border-color: currentColor; }
.hd-rows { display: grid; gap: 8px; margin-top: 8px; }
.hd-row { display: block; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.hd-row--attention { border-left: 3px solid var(--status-failed, #c0392b); }
.hd-row:hover, .hd-row:focus-visible { border-color: var(--accent, #1f7ae0); }
.hd-layout { display: grid; gap: 16px; margin-top: 12px; }
.hd-side { order: -1; }
@media (min-width: 1100px) { .hd-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); align-items: start; } .hd-side { order: 0; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; } }
.hd-detail { margin-top: 0; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.hd-detail h2 { margin: 0 0 4px; font-size: 1.1rem; overflow-wrap: anywhere; }
.hd-detail h3 { margin: 16px 0 4px; font-size: .8125rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.hd-goal { white-space: pre-wrap; overflow-wrap: anywhere; }
.hd-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.hd-chain { list-style: none; margin: 0 0 12px; padding: 0 0 0 16px; border-left: 2px solid var(--border); display: grid; gap: 8px; }
.hd-chain li { position: relative; }
.hd-chain li::before { content: ""; position: absolute; left: -20px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.hd-chain li[aria-current] ::before, .hd-chain li[aria-current]::before { background: var(--accent, #1f7ae0); }
.hd-hop { display: grid; gap: 2px; width: 100%; text-align: left; padding: 8px 8px; border-radius: 8px; border: 1px solid var(--border-subtle); background: none; color: inherit; font: inherit; cursor: pointer; }
.hd-hop__who { font-weight: 600; overflow-wrap: anywhere; }
.hd-hop__state { font-size: .75rem; color: var(--text-muted); }
.hd-hop small { color: var(--text-muted); overflow-wrap: anywhere; }
.hd-hop--here { border-color: var(--accent, #1f7ae0); border-width: 2px; }
.hd-hop-more { font-size: .8125rem; }
.hd-routes { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 8px; }
.hd-routes__title { margin: 8px 0 0; font-size: .8125rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.hd-routes__title small { text-transform: none; letter-spacing: 0; }
.hd-route { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; width: 100%; text-align: left; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-subtle); background: none; color: inherit; font: inherit; cursor: pointer; }
.hd-route:hover, .hd-route:focus-visible, .hd-route--on { border-color: var(--accent, #1f7ae0); }
.hd-route__who { font-weight: 600; overflow-wrap: anywhere; }
.hd-route__n { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.hd-route__states { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.hd-filter { margin: 4px 0 8px; font-size: .875rem; }
.hd-history { padding-left: 16px; margin: 0; }
.hd-row > span { margin-left: 8px; color: var(--text-muted); font-size: .8125rem; }
.hd-row p { margin: 4px 0; }
.hd-full { margin-top: 16px; }
.hd-full summary { cursor: pointer; font-weight: 600; }
.hd-pre { white-space: pre-wrap; overflow-wrap: anywhere; font: .8125rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 12px; border-radius: 8px; border: 1px solid var(--border-subtle); background: var(--surface-raised, var(--surface)); max-height: 60vh; overflow: auto; }
.hd-goal { padding: 8px 12px; border-left: 3px solid var(--accent, #1f7ae0); background: var(--surface-raised, var(--surface)); border-radius: 0 8px 8px 0; }

/* Master-detail: on wide screens the list and the detail scroll on their own, so the page itself does not */
.hd-intro { margin: 4px 0; }
.hd-ws { border: 1px solid var(--border-subtle); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.hd-ws__head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 8px 12px; }
.hd-ws__n { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.hd-ws__chips { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.hd-ws__body { padding: 0 8px 8px; }
.hd-rows { gap: 2px; margin-top: 4px; }
.hd-row { display: grid; grid-template-columns: 8.5rem minmax(9rem, 16rem) minmax(0, 1fr) auto; gap: 4px 8px; align-items: baseline; padding: 8px 8px; border: 1px solid transparent; border-radius: 6px; background: none; }
.hd-row:hover, .hd-row:focus-visible { background: var(--surface-raised, var(--surface)); border-color: var(--accent, #1f7ae0); outline: none; }
.hd-row__state { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.hd-row__state--failed, .hd-row__state--rejected, .hd-row__state--expired { color: var(--status-failed, #c0392b); font-weight: 600; }
.hd-row__who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-row__goal { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary, inherit); }
.hd-row__meta { color: var(--text-muted); white-space: nowrap; }
.hd-linkish { background: none; border: 0; padding: 2px 0; color: var(--accent, #1f7ae0); cursor: pointer; font: inherit; }
@media (max-width: 760px) { .hd-row { grid-template-columns: 1fr auto; } .hd-row__who { grid-column: 1; } .hd-row__goal { grid-column: 1 / -1; } .hd-row__state { grid-column: 2; grid-row: 1; } .hd-row__meta { grid-column: 1 / -1; } }
@media (min-width: 1100px) {
  .hd-layout { height: calc(100vh - 215px); min-height: 420px; align-items: stretch; }
  .hd-main { overflow: auto; padding-right: 4px; min-height: 0; }
  .hd-side { position: static; max-height: none; overflow: auto; min-height: 0; }
}
.hd-route { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; padding: 4px 8px; }
.hd-route__states { grid-column: auto; grid-row: 1; grid-column: 2; justify-content: flex-end; }
.hd-route__n { grid-column: 3; grid-row: 1; min-width: 1.5rem; text-align: right; }
.hd-hop { grid-template-columns: minmax(0, 1fr) auto; padding: 4px 8px; }
.hd-hop small { grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-hop__state { grid-column: 2; grid-row: 1; }
.hd-chain { gap: 4px; }

/* Team rooms (collab-team-rooms.js): tokens only, spacing on the 4px grid. A guest's words and a task's text are quoted, inert text. */
.cx-list li.trr-card { display: block; }
.cx-list li.trr-card > * + * { margin-top: 8px; }
.trr-cards { gap: 12px; }
.trr-quote { margin: 0; padding: 8px 12px; border-left: 4px solid var(--status-attention); background: var(--surface-2); border-radius: var(--radius-sm); }
.trr-quote > .cx-msg { margin: 0 0 4px; }
.trr-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: .8125rem; color: var(--text); max-height: 240px; overflow: auto; }
.trr-text:focus-visible { box-shadow: var(--cx-ring); outline: none; }
.trr-choice { align-items: flex-start; }
.trr-limits { margin: 0; padding-left: 20px; font-size: .8125rem; color: var(--text-secondary); }
.trr-direct { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 8px 12px; }
.trr-past > summary, #hcn-tr-mine-d > summary, #hcn-tr-req-d > summary, #hcn-tr-owner-d > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.trr-past > summary:focus-visible, #hcn-tr-mine-d > summary:focus-visible, #hcn-tr-req-d > summary:focus-visible, #hcn-tr-owner-d > summary:focus-visible { box-shadow: var(--cx-ring); outline: none; border-radius: var(--radius-sm); }
#hcn-tr-owner h5 { margin: 0; }
