:root {
  color-scheme: light dark;
  /* #ai-hub-polish: allow block-size:auto to animate (accordion open/close). */
  interpolate-size: allow-keywords;
  /* Light theme — Apple-style near-white */
  --bg: #f5f5f7;
  --surface: #ffffff;
  --soft: #E8E8E8;
  --line: rgba(0, 0, 0, 0.10);
  --text: #1A1A1A;
  /* Issue #1572: darkened from #6B6B6B - 4.30-4.35:1 against real ancestor
     backgrounds (conv-time, stage-label, panel-kicker), below the 4.5:1 WCAG
     AA threshold for normal text. */
  --muted: #5a5a5a;
  --accent: #0071e3;
  --accent-strong: #0058b0;
  --accent-soft: #eef4ff;
  /* Issue #1572: darkened from #b08442 - 3.14-3.37:1 (kb-badge.kb-stopped,
     conv-status.stopped), the lowest ratios the audit found. */
  --warn: #8a6734;
  --warn-soft: #fdf6e8;
  /* Issue #1572: darkened from #2e7d32 - 3.66:1 for scope-badge.scope-proj
     against its own 10%-tint background (and as low as 4.37:1 against an
     active/highlighted row's additional background tint). */
  --done: #256b29;
  --danger: #a24747;
  --state-working: #006adc;
  --state-working-soft: rgba(0, 106, 220, 0.13);
  --state-waiting: #d2261f;
  --state-waiting-soft: rgba(210, 38, 31, 0.13);
  /* Issue #1572: darkened from #20833a - 3.88:1 (conv-status.complete) and
     4.05:1 (run-state-pill.complete against its own 13%-tint background). */
  --state-complete: #1d7534;
  --state-complete-soft: rgba(32, 131, 58, 0.13);
  --shadow: 0 0 0 1px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 0 0 1px rgba(0, 0, 0, 0.10), 0 4px 16px rgba(0, 0, 0, 0.08);
  --picker-delegation: #5b7eb0;
  --picker-learning: #8b5fbf;
  /* Issue #566: personalization / "teach" accent (growth offer + taught badge). */
  --teach: #5b3fa8;
  --teach-soft: #f6f2ff;
  --teach-line: #d8cdf2;
  /* Safe zone for macOS hiddenInset traffic lights (~28px) and
     Windows titleBarOverlay height (36px). Falls back to 0 in a browser tab. */
  --titlebar-inset: env(titlebar-area-height, 0px);
  /* z-index layers (ascending, avoid magic numbers in property declarations). */
  --z-cmd-palette: 9000;
  --z-dropdown-menu: 9100;
  /* Job-viz modal must clear #composer-suggestions/.conversation-focus-overlay
     (--z-cmd-palette). The #jv-tt tooltip portal (--z-jv-tt) must clear the
     modal so phase/skill popovers float above it when the modal is open. */
  --z-job-viz: 9200;
  --z-jv-tt: 9300;
}

/* #700: theming is driven by an explicit [data-theme] attribute set pre-paint
   by the <head> bootstrap (from localStorage['fraim-theme'] or, when unset, the
   OS prefers-color-scheme). This replaces the old prefers-color-scheme-only
   token block so the in-app toggle can override the OS preference. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #1E1E1E;
    --surface: #2A2A2A;
    --soft: #323232;
    --line: rgba(255, 255, 255, 0.10);
    --text: #E8E8E8;
    --muted: #999999;
    --accent: #5b8de8;
    --accent-strong: #82aaee;
    --accent-soft: rgba(91, 141, 232, 0.15);
    --warn: #d4a04e;
    --warn-soft: rgba(212, 160, 78, 0.12);
    --done: #5cb85c;
    --danger: #e07070;
    --state-working: #4da3ff;
    --state-working-soft: rgba(77, 163, 255, 0.18);
    --state-waiting: #ff5a4f;
    --state-waiting-soft: rgba(255, 90, 79, 0.18);
    --state-complete: #46c76a;
    --state-complete-soft: rgba(70, 199, 106, 0.18);
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 16px rgba(0, 0, 0, 0.40);
}

/* Electron shell: html.electron is set synchronously before CSS paints so there
   is no flash. Mica (Win11) / vibrancy (macOS) paint the window-level background;
   body + .page must be transparent to let that material show through. Content
   surfaces use frosted-glass layering so they read against the OS material. */
html.electron body,
html.electron .page {
  background: transparent;
}
/* Header floats directly on Mica — no card. Native Win11 pattern. */
html.electron .header {
  background: transparent;
  border: none;
}
/* Rail: frosted sidebar — clearly distinct from Mica, clearly distinct from
   the conversation. A solid-ish left edge gives it visual grounding. */
html.electron .rail {
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: none;
}
/* Conversation: the primary work surface — crisp white card on the Mica */
html.electron .conversation {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.60);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
html.electron .modal {
  background: rgba(253, 253, 253, 0.94);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.50);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.14);
}
html.electron .modal-backdrop {
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
html.electron[data-theme="dark"] .rail {
    background: rgba(42, 42, 42, 0.78);
    border-right-color: rgba(255, 255, 255, 0.06);
}
html.electron[data-theme="dark"] .conversation {
    background: rgba(36, 36, 36, 0.88);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.20);
}
html.electron[data-theme="dark"] .modal {
    background: rgba(30, 30, 30, 0.94);
    border-color: rgba(255, 255, 255, 0.10);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.40);
}
html.electron[data-theme="dark"] body.hub-shell,
html.electron[data-theme="dark"] .hub-area,
html.electron[data-theme="dark"] .area-main,
html.electron[data-theme="dark"] .hub-area-page,
html.electron[data-theme="dark"] #proj-overview,
html.electron[data-theme="dark"] #proj-workspace {
  background: var(--bg);
}

/* ── Native platform feel ───────────────────────────────────────────────────
   html.mac / html.win / html.linux are set pre-paint (see index.html). macOS
   renders SF Pro with grayscale smoothing — Chromium's default subpixel makes
   SF look heavy/fringed — while Windows keeps its native ClearType rendering
   for Segoe UI Variable. The in-content design system (Apple-blue accent,
   near-white surfaces, pill controls) stays consistent on both: an Apple-grade
   product that wears each OS's native window chrome. */
html.mac body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Electron window-chrome integration. The topmost bar (gs-rail on first run,
   otherwise hub-tabs) IS the OS titlebar: draggable, with a safe gutter for the
   native window controls — traffic lights top-left on macOS, min/max/close
   top-right on Windows. Interactive children opt back out of the drag region. */
html.electron .gs-rail,
html.electron .hub-tabs {
  -webkit-app-region: drag;
}
html.electron .gs-rail button,
html.electron .gs-rail a,
html.electron .hub-tabs button,
html.electron .hub-tabs a,
html.electron .hub-tabs select {
  -webkit-app-region: no-drag;
}
/* Titlebar owns the top inset now, so the work area starts snug below the bar. */
html.electron .page { padding-top: 14px; }

/* macOS hiddenInset: reserve top-left space for the traffic lights on the
   topmost visible bar. (titlebar-area env() vars are a Windows WCO feature and
   read 0 on macOS, so the inset is explicit here.) */
html.mac.electron .hub-tabs { padding-left: 78px; }
html.mac.electron .gs-rail { padding-left: 78px; min-height: 30px; }
html.mac.electron .gs-rail:not([hidden]) ~ .hub-tabs { padding-left: 0; }

/* Windows 11 titleBarOverlay: reserve top-right space for min/max/close on the
   topmost visible bar so the avatar and actions never sit under the controls. */
html.win.electron .hub-tabs { padding-right: 146px; }
html.win.electron .gs-rail { padding-right: 146px; }
html.win.electron .gs-rail:not([hidden]) ~ .hub-tabs { padding-right: 8px; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  /* System-native font stack: San Francisco on Mac, Segoe UI Variable on Windows */
  font-family: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  font-size: 15px;
  overflow: hidden;
  /* Thin native-style scrollbars */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

[data-theme="dark"] body { scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

button { font: inherit; cursor: pointer; }

.page {
  max-width: none;
  width: 100%;
  margin: 0;
  /* Push content below traffic lights on macOS hiddenInset titlebar */
  padding: calc(20px + var(--titlebar-inset)) 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100vh;
  min-height: 0;
}

/* Header — draggable titlebar strip on Electron (macOS hiddenInset).
   Buttons inside must override with no-drag so they remain clickable. */
.header {
  display: flex;
  align-items: center;
  gap: 16px;
  /* left margin reserves space for macOS traffic lights (78px) */
  padding-left: max(0px, env(titlebar-area-x, 0px));
}
.header button, .header a, .header select {
  -webkit-app-region: no-drag;
}
.header-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text);
}
.project-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--text);
  box-shadow: var(--shadow);
  max-width: 360px;
}
.project-button:hover { background: var(--soft); }
.project-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.project-button .folder { color: var(--muted); font-size: 13px; }
.project-button strong {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Welcome — inline in the header strip, no card styling */
.welcome {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.welcome strong.you { color: var(--text); font-weight: 600; }
.welcome .concept {
  position: relative;
  font-weight: 600;
  color: var(--accent);
}
.welcome .info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  margin-left: 3px;
  margin-right: 1px;
  cursor: pointer;
  vertical-align: 1px;
  border: none;
  font-family: serif;
  font-style: italic;
}
.welcome .info:hover { background: var(--accent); color: #fff; }
.welcome .info:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 320px;
  max-height: min(60vh, 480px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  font-weight: 400;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  display: none;
}
.popover.open { display: block; }
.popover .pop-title {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.popover .pop-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
}
.popover .pop-link:hover { text-decoration: underline; }
.popover .pop-jobs {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.popover .pop-jobs.open { display: grid; gap: 8px; }
.popover .pop-jobs .job-row {
  display: grid;
  gap: 1px;
  font-size: 13px;
}
.popover .pop-jobs .job-row strong {
  color: var(--accent);
  font-weight: 600;
}
.popover .pop-jobs .job-row span {
  color: var(--muted);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 326px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

/* Left rail */
.rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: min-content;
  gap: 14px;
  min-width: 0;
  align-self: start;
  max-height: 100%;
  overflow-y: auto;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.new-conv {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.rail-note {
  padding: 0 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.rail-section {
  display: grid;
  gap: 10px;
}
.rail-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 2px;
}
.new-conv:hover { background: var(--accent-strong); }
.new-conv:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.teach-btn {
  width: 100%;
  background: var(--teach-soft);
  color: var(--teach);
  border: 1px solid var(--teach-line);
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.teach-btn:hover { background: var(--teach-line); }
.teach-btn:focus-visible { outline: 2px solid var(--teach); outline-offset: 2px; }

/* Shared management controls occupy the same rail slot on all three scopes. */
.scope-management-actions { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.scope-management-actions .scope-management-action {
  display: block; width: 100%; margin: 0; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer;
}
.scope-management-actions [data-action="delegate"] { background: var(--accent); color: white; border-color: var(--accent); }
:root[data-theme="dark"] .scope-management-actions [data-action="delegate"],
:root[data-theme="dark"] .ipe-btn-create,
:root[data-theme="dark"] #teach-job-modal .send-button { color: var(--bg); }
.scope-management-actions [data-action="coach"] { background: var(--teach-soft); color: var(--teach); border-color: var(--teach-line); }
.scope-management-actions [data-action="roster"] { background: var(--warn); color: var(--bg); border-color: var(--warn); }
.scope-management-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Roster chip: teach icon revealed on hover (hidden on touch devices) */
.roster-chip { position: relative; }
.roster-chip-teach {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--teach-line);
  background: var(--teach-soft);
  color: var(--teach);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  cursor: pointer;
  padding: 0;
}
.roster-chip:hover .roster-chip-teach { opacity: 1; }
.roster-chip-teach:focus-visible { outline: 2px solid var(--teach); outline-offset: 2px; opacity: 1; }
@media (hover: none) { .roster-chip-teach { display: none; } }
.conv-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 0;
  min-width: 0;
}
.conv-employee-group {
  display: grid;
  gap: 6px;
}
/* #769: hire-pending polling indicator */
.hire-pending-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--state-working-soft);
  border-radius: 8px;
  margin: 2px 0;
}
.hire-pending-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--state-working);
  border-top-color: transparent;
  border-radius: 50%;
  animation: hire-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes hire-spin { to { transform: rotate(360deg); } }
.hire-pending-text {
  font-size: 11px;
  color: var(--state-working);
  font-weight: 600;
}
.hire-timeout-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--warn-soft);
  border-radius: 8px;
  margin: 2px 0;
}
.hire-timeout-icon { font-size: 12px; }
.hire-timeout-text {
  font-size: 11px;
  color: var(--warn);
  font-weight: 600;
}
.hire-timeout-row a {
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.hire-timeout-row a:hover { text-decoration: underline; }
.conv-employee-group > summary {
  list-style: none;
}
.conv-employee-group > summary::-webkit-details-marker { display: none; }
.conv-employee-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 2px;
  color: var(--muted);
  cursor: pointer;
}
.conv-employee-avatar {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}
img.conv-employee-avatar {
  object-fit: cover;
}
.conv-employee-tab::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  transition: transform 120ms ease;
}
.conv-employee-group[open] .conv-employee-tab::before { transform: rotate(90deg); }
.conv-employee-tab-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.conv-employee-tab-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-employee-tab-detail {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-employee-tab-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.conv-employee-add {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  font-size: 14px;
  line-height: 18px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  flex-shrink: 0;
}
.conv-employee-add:hover {
  background: var(--accent-soft);
  border-color: rgba(0,113,227,.28);
}
.conv-employee-manage {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  line-height: 14px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 0 3px;
}
.conv-employee-manage:hover,
.conv-employee-manage:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(0,113,227,.28);
}
.emp-manage-pop {
  z-index: var(--z-dropdown-menu);
  min-width: 112px;
  display: grid;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.emp-manage-pop button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  padding: 6px 8px;
}
.emp-manage-pop button:hover,
.emp-manage-pop button:focus-visible {
  background: var(--accent-soft);
  outline: none;
}
.emp-manage-delete { color: var(--danger) !important; }
.conv-employee-group--removed .conv-employee-tab-label {
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}
.emp-removed-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.emp-del-confirm { margin-left: 28px; margin-right: 4px; }
/* Issue #1008: No FRAIM employee group modifier */
/* R4: dashed avatar placeholder — no image or persona initials */
.conv-employee-avatar--absence,
.identity-avatar--absence {
  border-style: dashed;
  border-color: var(--muted);
  background: transparent;
  color: transparent;
}
/* R5/R7: muted label color for the No FRAIM employee group header */
.conv-employee-group--adhoc .conv-employee-tab-label {
  color: var(--muted);
  font-weight: 600;
}
.conv-persona-name--absence {
  color: var(--muted);
  font-weight: 600;
}
.conv-employee-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding-left: 23px;
}
.conv-item {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  box-shadow: none;
}
.conv-item:hover { background: var(--soft); }
.conv-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.conv-item.active {
  background: var(--accent-soft);
  border-color: rgba(31, 67, 125, 0.25);
  box-shadow: none;
}
/* Text column: stacks persona name label above job title */
.conv-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.conv-persona-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-strong);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Issue #851: role subtitle in the Project Employees roster row. */
.conv-persona-role {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-title {
  font-size: 17px;
  font-weight: 700;
  min-width: 0;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.conv-persona-chip {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-strong);
  overflow: hidden;
  line-height: 1;
  text-transform: uppercase;
}
.conv-persona-chip img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.conv-persona-chip--free { background: transparent; border-color: var(--line); color: var(--muted); }
.conv-status {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-top: 4px;
}
.conv-status.running { color: var(--accent); }
.conv-status.attention { color: var(--warn); }
.conv-status.failed { color: var(--danger); }
.conv-status.working { color: var(--state-working); }
.conv-status.waiting { color: var(--state-waiting); }
.conv-status.complete { color: var(--state-complete); }
/* #549 R4: Amber label for manager-stopped runs in the conversation rail. */
.conv-status.stopped { color: var(--warn); }
/* Issue #1491: parked-recurring - reuses the accent color, distinct from red/amber/green. */
.conv-status.scheduled { color: var(--accent); }
.state-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--line);
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 10%, transparent);
}
.conv-state-dot {
  align-self: center;
  margin-left: auto;
}

/* Conversation pane */
.conversation {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
.empty-state {
  display: grid;
  gap: 8px;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 80px 16px;
}
.empty-state::before {
  content: "F";
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 22px;
}
.empty-state h3 { margin: 0; color: var(--text); font-weight: 600; font-size: 17px; }
.empty-state p { margin: 0; max-width: 320px; }

#active-conv {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  min-width: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#active-conv[hidden] { display: none; }

.conv-header,
.support-stack,
.panel-details:not(.panel-details--thread),
.micro {
  flex-shrink: 0;
}
.conv-topline {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* #521: Stop button — interrupt a working employee and park it "waiting on you". */
.run-stop-btn {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fda29b;
  border-radius: 14px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .12s;
}
.run-stop-btn:hover { background: #fee4e2; }
.run-stop-btn:disabled { opacity: .55; cursor: default; }
.conversation-focus-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
}
.panel-details--thread .conversation-focus-btn {
  margin-left: auto;
}
.conversation-focus-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.conversation-focus-btn:focus-visible,
.conversation-focus-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Job title inline with employee avatar — replaces the old separate h2 row */
.conv-job-title {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.run-title-composed {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  max-width: 100%;
}
.run-title-job,
.run-title-separator {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-title-kickoff {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-title.run-title-composed {
  display: flex;
}
.employee-identity {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.identity-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-strong);
  flex-shrink: 0;
}
.identity-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.identity-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.identity-copy strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.identity-copy small {
  font-size: 13px;
  color: var(--muted);
}
.run-state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(31, 67, 125, 0.1);
  color: var(--accent-strong);
}
.run-state-pill.running {
  background: rgba(31, 67, 125, 0.14);
}
.run-state-pill.working {
  background: var(--state-working-soft);
  color: var(--state-working);
}
.run-state-pill.waiting {
  background: var(--state-waiting-soft);
  color: var(--state-waiting);
}
.run-state-pill.complete {
  background: var(--state-complete-soft);
  color: var(--state-complete);
}
.run-state-pill.failed {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}
.run-state-pill.completed {
  background: color-mix(in srgb, var(--done) 14%, transparent);
  color: var(--done);
}
/* #549 R3: Amber STOPPED pill — intentional pause, distinct from red WAITING ON YOU. */
.run-state-pill.stopped {
  background: color-mix(in srgb, var(--warn) 15%, transparent);
  color: var(--warn);
}
/* Issue #1491: parked-recurring pill - reuses the "Scheduled" trigger-badge accent color. */
.run-state-pill.scheduled {
  background: var(--accent-soft, rgba(0, 113, 227, .12));
  color: var(--accent);
}
.run-state-pill.approved {
  background: color-mix(in srgb, #2e7d32 18%, transparent);
  color: #2e7d32;
  font-weight: 800;
}
/* Issue #1345: job execution mode chip — shown in .conv-topline for Coached-mode jobs. */
.job-mode-chip {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
  cursor: default;
  position: relative;
}
.job-mode-chip--in-training {
  background: rgba(0, 88, 176, 0.10);
  color: #0058b0;
  border: 1px solid rgba(0, 88, 176, 0.18);
}
[data-theme="dark"] .job-mode-chip--in-training {
  background: rgba(96, 160, 224, 0.14);
  color: #60a0e0;
  border-color: rgba(96, 160, 224, 0.22);
}
.job-mode-chip--in-training .chip-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 260px;
  background: #fff;
  border: 1px solid #d0d0d5;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  padding: 12px 14px;
  font-size: 12px;
  color: #1d1d1f;
  line-height: 1.6;
  z-index: var(--z-dropdown-menu);
  pointer-events: none;
  white-space: normal;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}
[data-theme="dark"] .job-mode-chip--in-training .chip-tooltip {
  background: #2a2a2e;
  border-color: #3a3a3f;
  color: #e8e8ea;
}
.job-mode-chip--in-training:hover .chip-tooltip { display: block; }
.chip-tooltip-section { margin-bottom: 8px; }
.chip-tooltip-section:last-child { margin-bottom: 0; }
.chip-tooltip-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #0058b0;
  margin-bottom: 2px;
}
[data-theme="dark"] .chip-tooltip-label { color: #60a0e0; }

.conv-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 12px;
  row-gap: 4px;
}
.title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
.conv-header h2 { flex: 1 1 auto; min-width: 0; }
#artifact-slot { flex: 0 0 auto; }

.conv-header h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.conv-job { color: var(--muted); font-size: 14px; margin-top: 2px; }
.conversation-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  width: 100%;
  flex: 0 0 auto;
}
.conversation-status > * {
  min-width: 0;
}
.delegation-ledger {
  display: block;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
}
.delegation-ledger[hidden] {
  display: none;
}
.manager-oversight-board {
  display: block;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 84%, var(--accent) 16%);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
}
.manager-oversight-board[hidden] {
  display: none;
}
.manager-oversight-board > summary {
  padding: 12px;
}
.manager-oversight-board > summary::before {
  margin-top: 2px;
}
.manager-oversight-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.manager-oversight-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.manager-oversight-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.manager-oversight-copy strong {
  font-size: 15px;
  color: var(--text);
}
.manager-oversight-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
}
.manager-oversight-list {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}
.manager-plan-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}
.manager-plan-step {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}
.manager-plan-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.manager-plan-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.manager-plan-top strong,
.manager-plan-empty strong {
  font-size: 12px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.manager-plan-status {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.manager-plan-status.status-running,
.manager-plan-status.status-submitted {
  border-color: color-mix(in srgb, #0b63ce 28%, var(--line));
  background: #e8f1ff;
  color: #0b63ce;
}
.manager-plan-status.status-reviewed,
.manager-plan-status.status-completed {
  border-color: color-mix(in srgb, #1c7c36 30%, var(--line));
  background: #e9f7ee;
  color: #1c7c36;
}
.manager-plan-status.status-blocked,
.manager-plan-status.status-failed {
  border-color: color-mix(in srgb, #b3261e 28%, var(--line));
  background: #fdecea;
  color: #b3261e;
}
.manager-plan-meta,
.manager-plan-review,
.manager-plan-instructions,
.manager-plan-empty span {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.manager-plan-review {
  color: var(--text);
}
.manager-plan-empty {
  display: grid;
  gap: 3px;
  border: 1px dashed var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}
.delegation-ledger > summary {
  padding: 12px;
}
.delegation-ledger > summary::before {
  margin-top: 2px;
}
.delegation-ledger-body {
  padding: 0 12px 12px;
  display: grid;
  gap: 10px;
  overflow-y: auto;
}
.delegation-ledger-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.delegation-ledger-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.delegation-ledger-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.delegation-ledger-copy strong {
  font-size: 15px;
  color: var(--text);
}
.delegation-ledger-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
}
.delegation-ledger-summary {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.delegation-task-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.delegation-task {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
}
.delegation-task-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.delegation-task-assignee {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-strong);
}
.delegation-task-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--line);
  color: var(--muted);
}
.delegation-task-status.status-running,
.delegation-task-status.status-submitted {
  background: var(--state-working-soft);
  color: var(--state-working);
}
.delegation-task-status.status-reviewed,
.delegation-task-status.status-completed {
  background: var(--state-complete-soft);
  color: var(--state-complete);
}
.delegation-task-status.status-blocked,
.delegation-task-status.status-failed {
  background: var(--state-waiting-soft);
  color: var(--state-waiting);
}
.delegation-task-title {
  min-width: 0;
  font-size: 14px;
  color: var(--text);
}
.delegation-task-detail {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.delegation-task-summary {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}
.delegation-artifacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.delegation-artifact,
.delegation-review-note,
.delegation-view-work {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent-strong);
}
.delegation-artifact {
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  cursor: pointer;
}
.delegation-artifact:hover {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
/* Issue #1021: a child's pull request renders as an <a> in this strip, so the chip is
   now keyboard-navigable where it was previously only a <button> relying on the UA
   ring. Match the focus-visible convention used across this stylesheet. */
.delegation-artifact:focus-visible,
.delegation-view-work:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}
.delegation-artifact {
  text-decoration: none;
}
.delegation-review-note {
  background: var(--state-working-soft);
  color: var(--state-working);
}
.delegation-view-work {
  border: 1px solid var(--line);
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
}
.delegation-view-work:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}
.coach textarea:disabled {
  background: var(--soft);
  color: var(--muted);
  cursor: not-allowed;
}
.managed-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.conv-delegated-list {
  display: grid;
  gap: 6px;
  margin: 6px 0 10px 20px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.conv-delegated-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.conv-item--delegated-child {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--accent) 14%, var(--line));
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 8px 10px;
}
.conv-item--delegated-child .conv-body {
  flex: 1 0 100%;
}
.conv-item--delegated-child .conv-title {
  font-size: 12px;
  line-height: 1.25;
}
.conv-item--delegated-child .conv-status {
  flex: 1 1 auto;
  white-space: normal;
  padding-top: 0;
}
.status-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
.support-stack {
  display: grid;
  gap: 8px;
  flex-shrink: 0;
  min-height: 0;
}
.panel-details {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.panel-details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}
.panel-details > summary::-webkit-details-marker { display: none; }
.panel-details > summary::before {
  content: "▸";
  font-size: 11px;
  color: var(--muted);
  transition: transform 100ms ease;
  flex-shrink: 0;
}
.panel-details[open] > summary::before { transform: rotate(90deg); }
.panel-details:not([open]) > .panel-body,
.panel-details:not([open]) > .messages,
.panel-details:not([open]) > .micro-log,
.panel-details:not([open]) > .resume-command {
  display: none;
}
.panel-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.panel-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel-summary-text {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-body {
  padding: 0 14px 12px;
}
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* Agent picker sits in the composer control row; .coach-title-row no longer
   exists in HTML - kept only for browser cache safety. */
.active-employee-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.active-employee-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: default;
}
/* Hide the name text span - only badge + dropdown shown in compact controls. */
.coach-label-name { display: none; }
.coach-employee-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
img.coach-employee-avatar { object-fit: cover; border-radius: 4px; }
/* Quick-access coaching buttons row. */
.quick-coach-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quick-coach-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
}
.mark-complete-btn {
  border-color: color-mix(in srgb, var(--state-complete) 42%, var(--line));
  color: var(--state-complete);
  font-weight: 700;
}
/* R4/R5/R6: grouped coaching dropdowns */
.coach-dropdown {
  position: relative;
  display: inline-flex;
}
.coach-dropdown-menu {
  position: fixed;
  min-width: 200px;
  max-height: min(280px, calc(100vh - 16px));
  box-sizing: border-box;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: var(--z-dropdown-menu);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.coach-dropdown-menu .quick-coach-btn {
  text-align: left;
  width: 100%;
  white-space: nowrap;
}
/* Thread panel */
.panel-details--thread {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
  min-height: 0;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.panel-details--thread[open] {
  display: flex;
  flex-direction: column;
}
.panel-details--thread.thread-working {
  border-color: color-mix(in srgb, var(--state-working) 78%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--state-working) 34%, transparent);
}
.panel-details--thread.thread-waiting {
  border-color: color-mix(in srgb, var(--state-waiting) 82%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--state-waiting) 38%, transparent);
}
.panel-details--thread.thread-complete {
  border-color: color-mix(in srgb, var(--state-complete) 76%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--state-complete) 32%, transparent);
}
.panel-details--thread > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  cursor: pointer;
  list-style: none;
  flex-shrink: 0;
}
.panel-details--thread > summary::-webkit-details-marker { display: none; }
.panel-details--thread .messages {
  padding: 8px 22px 18px;
  flex: 1 1 0;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.employee-select.inline {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Progress is now a single-line status strip (was a tall card) so the
   messages region gets the vertical space it needs. */
.progress {
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
.progress .stage {
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.progress .latest {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.progress .stage::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: 1px;
  animation: pulse 1.4s infinite;
}
.progress.done .stage::before { background: #6cb39a; animation: none; }
.progress.attention .stage::before { background: var(--warn); animation: none; }
.progress.failed .stage::before { background: var(--danger); animation: none; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.progress-inline {
  flex: 1 1 auto;
}
.tracker-inline {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  width: 100%;
  flex: 1 1 100%;
  overflow-x: auto;
}

.thread-surface {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  flex: 1;
  padding: 16px 18px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.thread-surface-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.messages {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 0;
  min-width: 0;
  /* Scroll messages here, not the page. */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 8px 8px 2px;
  scroll-behavior: smooth;
}
.message {
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  width: 100%;
  display: grid;
  gap: 6px;
  animation: slidein 280ms ease;
}
@keyframes slidein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.message.manager {
  justify-items: end;
}
.message.employee {
  justify-items: start;
}
.message.system {
  justify-items: stretch;
}
.message-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  flex-wrap: wrap;
}
.message.manager .message-meta {
  justify-content: flex-end;
}
.message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(31, 67, 125, 0.1);
}
.message-avatar.manager {
  background: rgba(31, 67, 125, 0.12);
  color: var(--accent-strong);
}
.message-avatar.employee {
  background: #ffffff;
  color: var(--accent-strong);
}
.message-avatar.system {
  background: rgba(35, 30, 23, 0.08);
  color: var(--muted);
}
.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.message .who {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.message .lane-label {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.88;
}
.message-time {
  font-size: 11px;
  line-height: 1.25;
  color: var(--muted);
  opacity: 0.88;
  white-space: nowrap;
}
.transport-raw {
  display: none;
}
.bubble {
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: none;
  max-width: min(720px, 100%);
}
.message.manager .bubble {
  background: var(--accent);
  color: #fff;
  white-space: pre-wrap;
}
.message.employee .bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}
.message.employee .bubble a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.message.employee .bubble a:hover {
  color: var(--accent-strong);
}
.typing-indicator {
  animation: none;
  justify-items: start;
}
.typing-indicator .bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 48px;
  padding-block: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.45;
  animation: typing-bounce 1.1s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 120ms; }
.typing-dot:nth-child(3) { animation-delay: 240ms; }
/* #549 R1: Static dash shown in the working-indicator bubble while stop is in-flight.
   Replaces the animated typing-dots to signal "stopping in progress, please wait". */
.stopping-dash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
  line-height: 1;
}
@keyframes typing-bounce {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 0.9; transform: translateY(-3px); }
}
.message.system .bubble {
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--text);
}

/* Inline artifact pill that sits in the .conv-header next to the title.
   Compact so it never crowds Coach or Micro-manage. Hover reveals the
   path so the user can locate the file. */
.artifact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text);
  max-width: 320px;
  animation: slidein 280ms ease;
}
.artifact-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
  flex-shrink: 0;
}
.artifact-label {
  font-weight: 600;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  margin-right: 2px;
}
.artifact-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.artifact-where { display: none; }   /* full path lives in tooltip via title attr */

.coach {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  /* Issue #1651: anchors the drag-over dropzone overlay. */
  position: relative;
}
/* Send button embedded inside the textarea wrapper */
.coach-input {
  position: relative;
}
.coach-input textarea {
  width: 100%;
  min-height: 92px;
  max-height: 22vh;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 170px 48px 44px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  display: block;
}
.coach-input textarea:focus { outline: none; border-color: var(--accent); }
.coach-input #send,
.coach-input #ab-direct-send {
  position: absolute;
  bottom: 7px;
  right: 7px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

/* Issue #1651: attach button sits to the left inside the same textarea
   wrapper, sized to match #send (32x32, 6px radius). */
.attach-btn {
  position: absolute;
  bottom: 7px;
  left: 7px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.attach-btn:hover { background: var(--soft); color: var(--text); }
.attach-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.composer-coach-actions {
  position: absolute;
  left: 46px;
  right: 170px;
  bottom: 7px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  z-index: 2;
}
.composer-icon-btn,
.composer-stop-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 14px;
}
.composer-icon-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}
.composer-icon-btn:hover {
  background: var(--soft);
  color: var(--text);
}
.composer-icon-btn:focus-visible,
.composer-stop-btn:focus-visible,
.employee-select.inline:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.composer-stop-btn {
  border-color: #fda29b;
  background: #fef3f2;
  color: #b42318;
  white-space: nowrap;
}
.composer-stop-btn.composer-stop-btn--armed {
  width: auto;
  min-width: 112px;
  padding: 0 10px;
}
.composer-stop-btn:disabled {
  border-color: var(--line);
  background: var(--soft);
  color: var(--muted);
  opacity: 1;
}
.composer-agent-row {
  position: absolute;
  right: 47px;
  bottom: 7px;
  z-index: 2;
}
.composer-agent-row .employee-select.inline {
  height: 32px;
  max-width: 116px;
  background: var(--surface);
}

/* Issue #1657 (Treatment 1): the task-pane launcher reuses .coach-input/
   .attach-btn for visual consistency (R1) but keeps its own existing Next
   button outside the textarea wrapper (unlike the coaching composer's
   #send, which sits inside it) - so the right-hand gutter .coach-input
   textarea normally reserves for #send is not needed here. (The palette/
   ad-hoc-modal/Teach-dialog siblings this rule used to also cover -
   #cp-instructions-row, #step2, .tjd-form - are retired.) */
.tp-launcher-field .coach-input textarea {
  padding-right: 12px;
}

/* Staged attachments: chips shown above the composer before send. Thumbnail
   sizing/radius matches .brand-logo-drop .blp; remove control matches
   .srch-clear (bare glyph button). */
.staged-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.staged-attachments:empty { display: none; }
.attachment-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 6px 28px 6px 6px;
}
.attachment-chip .thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--line);
  flex-shrink: 0;
  overflow: hidden;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.attachment-chip .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attachment-chip .meta { min-width: 0; }
.attachment-chip .fname { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; display: block; }
.attachment-chip .fsize { font-size: 11px; color: var(--muted); }
.attachment-chip .chip-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px;
}
.attachment-chip .chip-remove:hover { color: var(--danger); }
.attachment-chip.chip-error { border-color: var(--danger); }
.attachment-chip .chip-error-text { font-size: 10.5px; color: var(--danger); }

/* Drag-over state: dashed accent overlay across the whole coach block, same
   visual language as .brand-logo-drop. */
.composer-dropzone {
  position: absolute;
  inset: -6px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 650;
  z-index: 3;
  pointer-events: none;
}
.coach.drag-active .composer-dropzone { display: flex; }

/* Issue #1657 (Treatment 1): the palette/ad-hoc/Teach/task-pane drop targets
   do not have their own .composer-dropzone overlay element (narrower Treatment
   1 scope - see docs/evidence/1657-feature-implementation-evidence.md); this
   generic outline gives drag-over feedback without one. */
#cp-instructions-row.drag-active,
.hm-field.drag-active,
#step2.drag-active,
.tp-launcher-field.drag-active {
  outline: 2px dashed color-mix(in srgb, var(--accent) 55%, var(--line));
  outline-offset: 2px;
  border-radius: 10px;
}

/* Attachment rendered inline inside a sent transcript message (appendMessageDom). */
.msg-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  margin-right: 6px;
  padding: 5px 8px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 11.5px;
  color: var(--text);
}
.msg-attachment .thumb { width: 26px; height: 26px; border-radius: 6px; overflow: hidden; background: var(--soft); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.msg-attachment .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.composer-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.coach-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
/* Issue #1292: the conversation's agent is unavailable. Reads as a warning
   rather than a muted aside — the alternative the user must not fall back on
   is "notice by eye that the wrong agent is selected".
   The warning tone is carried by the tinted background and the --warn rule,
   not by the text colour: --warn on --warn-soft measures 3.1:1, under the
   4.5:1 WCAG AA floor for 12px body text. --text on the same background
   clears it comfortably in both themes. */
.agent-unavailable-note {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 3px solid var(--warn);
  background: var(--warn-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}
.coach-note.pending-job {
  color: var(--text);
  font-weight: 600;
}
/* Per-message queued/redirecting badge shown next to a manager bubble's meta row. */
.message-delivery-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
}
.message-delivery-badge--redirecting {
  color: var(--danger);
}
@media (max-width: 760px) {
  .coach-input textarea {
    min-height: 126px;
    padding-right: 52px;
    padding-bottom: 82px;
  }
  .composer-coach-actions {
    right: 7px;
    bottom: 45px;
  }
  .composer-agent-row {
    left: 46px;
    right: 47px;
  }
  .composer-agent-row .employee-select.inline {
    width: 100%;
    max-width: none;
  }
}
.send-button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 600;
}
.send-button:hover { background: var(--accent-strong); }
.send-button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.send-button:disabled { background: color-mix(in srgb, var(--accent) 35%, var(--bg) 65%); cursor: not-allowed; }

.micro {
  margin-top: 0;
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 48%, var(--soft));
  /* Removed: position:sticky / bottom:0 / z-index:2 — sticky caused the
     micro-manage label to float over the coach section in the flex column.
     It's now a normal flow element at the bottom of the support-stack. */
}
.micro .panel-kicker {
  color: var(--accent-strong);
}
.micro summary {
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.micro summary::-webkit-details-marker { display: none; }
.micro summary::before {
  content: "▸";
  font-size: 11px;
  transition: transform 100ms;
}
.micro[open] summary::before { transform: rotate(90deg); }
.micro-log {
  margin: 0 16px 16px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  color: var(--muted);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: Consolas, Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
}

.resume-command {
  margin: 0 16px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 8px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--accent-soft) 30%, transparent);
}
.resume-command-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.resume-command-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.resume-command-code {
  flex: 1;
  margin: 0;
  font-family: Consolas, Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}
.resume-command-copy {
  flex-shrink: 0;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.resume-command-copy:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }

.status-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  min-height: 1.2em;
}
.status-line.error { color: var(--danger); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 40, 30, 0.36);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fade 180ms ease;
}
.modal-backdrop.open { display: flex; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rise 220ms ease;
  min-height: 0;
}
/* Each step IS the modal's main content — make it a flex column too so
   .modal-body can actually scroll inside the bounded .modal height
   instead of pushing the modal past 90vh. */
#step1, #step2 {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-header { padding: 22px 24px 12px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 19px; font-weight: 600; }
.modal-header p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.modal-body { padding: 18px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.modal-footer .left { color: var(--muted); font-size: 13px; }
.modal-footer .right { display: flex; gap: 10px; }

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 13px;
  color: var(--text);
  font-weight: 500;
}
.ghost:hover { background: var(--soft); }
.ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Manager-reported (2026-09-14, PR #1660 review): `.secondary` has been
   referenced as a button className throughout this file's job-composer/
   install-row code (Go to Manager -> AI Agents, Download/Install <agent>,
   Sign In) since before this PR, but was never actually defined - those
   buttons rendered with bare browser UA styling instead of the app's real
   button language. Styled as the accent-bordered counterpart to the neutral
   `.ghost` button, matching this app's other outlined-accent affordances. */
.secondary {
  background: transparent;
  border: 1px solid var(--accent, #0071e3);
  border-radius: 6px;
  padding: 7px 13px;
  color: var(--accent, #0071e3);
  font-weight: 600;
}
.secondary:hover { background: var(--accent-soft, rgba(0,113,227,.08)); }
.secondary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.secondary:disabled { opacity: .5; cursor: default; }

.search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  font: inherit;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 14px;
}
.search:focus { outline: none; border-color: var(--accent); }

.job-category { margin-bottom: 16px; }
.job-category h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
}
.job-option {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  margin-bottom: 5px;
  display: grid;
  gap: 2px;
  color: var(--text);
}
.job-option:hover { background: var(--soft); border-color: var(--accent); }
.job-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.job-option.selected { background: var(--accent-soft); border-color: var(--accent); }
.job-option strong { font-weight: 600; }
.job-option span { color: var(--muted); font-size: 13px; }

/* R2 (#521): ad-hoc row in the smart new-job input — type the work and start
   directly, without picking a catalog job. Replaces the old "Just describe what
   you need" button. */
.aj-adhoc {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: var(--text);
}
.aj-adhoc:hover { background: var(--soft); }
.aj-adhoc:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.aj-adhoc .aj-adhoc-ico {
  width: 30px; height: 30px; border-radius: 50%;
  background: #fff; color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.aj-adhoc .aj-adhoc-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.aj-adhoc .aj-adhoc-title { font-weight: 600; font-size: 14px; }
.aj-adhoc .aj-adhoc-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aj-adhoc .aj-adhoc-action {
  flex-shrink: 0; font-size: 13px; font-weight: 600; color: #fff;
  background: var(--accent); border-radius: 14px; padding: 5px 13px;
}

.step2 .assigned-job {
  background: var(--accent-soft);
  border: 1px solid #c5dcd0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.step2 .assigned-job .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.step2 .assigned-job .name { font-weight: 600; margin-top: 2px; }
.step2 .assigned-job .desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.step2 textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
}
.step2 textarea:focus { outline: none; border-color: var(--accent); }

.employee-select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--text);
}
.employee-select:focus { outline: none; border-color: var(--accent); }

/* Agent install panel */
.cp-agent-install-panel {
  margin: 0 14px 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.install-panel-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.install-panel-copy {
  margin: 0 0 8px;
  max-width: none;
  font-size: 13px;
  color: var(--muted);
}
.install-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}
.install-label { font-weight: 500; min-width: 90px; }
.install-status { color: var(--muted); flex: 1; font-size: 12px; }
button.small { padding: 4px 10px; font-size: 12px; }
/* #1390: quick-pick chips for uninstalled tools inside the Add Agent dialog's
   Delegate tab — the single setup entry point (see aam-* rules above). */
.aam-delegate-quickpicks { margin-bottom: 14px; }
.aam-delegate-quickpicks-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 6px;
}
.aam-delegate-quickpicks-list { display: flex; flex-wrap: wrap; gap: 6px; }
.aam-delegate-quickpick-caption {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
}

@media (max-width: 820px) {
  /* Single-column reflow — the rigid 100vh layout doesn't make sense at
     mobile width because the rail stacks above the conversation. Let the
     page scroll naturally and bound the messages section to keep the
     coach + micro-manage reachable at the bottom. */
  html, body { height: auto; }
  body { overflow: auto; }
  .page { height: auto; min-height: 100vh; padding: 16px; gap: 14px; }
  .layout { grid-template-columns: 1fr; flex: initial; }
  .rail { max-height: none; overflow-y: visible; }
  .conversation { height: auto; min-height: auto; overflow: visible; }
  /* ui-polish-validation P0 (2026-09-14): #empty (Treatment 3's idle composer
     state, `flex:1; min-height:0; overflow-y:auto`) has no defined height to
     flex-distribute against once .conversation above loses its own height
     constraint at this breakpoint - it was measured ballooning to ~2400px at
     700-768px specifically (the gap between this 820px query and the
     640px query below, where #proj-workspace's column reflow + explicit
     overflow:hidden happens to mask the same underlying sizing issue),
     pushing #persistent-composer ~1750-1900px off-screen and unreachable,
     a direct violation of R1 ("present at all times"). Capping it here
     matches this block's own stated intent ("bound X to keep the coach
     reachable at the bottom") for the one element Treatment 3 added. */
  #empty { max-height: calc(100vh - 160px); }
  #active-conv { flex: initial; overflow-y: visible; }
  .conv-stream { flex: initial; }
  /* Mobile: thread panel reverts to normal block flow; page scrolls naturally */
  .panel-details--thread { flex: initial; min-height: auto; display: block; max-height: 45vh; }
  .panel-details--thread .messages { flex: initial; min-height: auto; max-height: calc(45vh - 44px); overflow-y: auto; }
  .header { flex-wrap: wrap; gap: 10px; }
  /* Welcome inline: allow wrapping on mobile */
  .welcome { flex: 1 1 100%; font-size: 12px; }
  .conv-topline { align-items: flex-start; flex-direction: column; }
  .conv-job-title { font-size: 14px; }
  .thread-surface {
    padding: 16px 14px 14px;
  }
  .panel-summary-text {
    white-space: normal;
  }
  .team-roster {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  .popover { width: min(320px, calc(100vw - 60px)); }
  .quick-coach-row { flex-wrap: wrap; }
  .quick-coach-btn { font-size: 11px; }
}

@media (max-width: 480px) {
  /* Very narrow: hide welcome text to give maximum space to conversations */
  .welcome { display: none; }
  .page { padding: 12px; gap: 10px; }
  .header-title { font-size: 17px; }
}

/* ---------------------------------------------------------------- */
/* Issue #347 — Pizza tracker (R1), template picker (R2), totals (R4) */
/* ---------------------------------------------------------------- */

.tracker {
  padding: 12px 4px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.tracker-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tracker-row {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}
.tracker .stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 34px;
  position: relative;
  z-index: 2;
}
/* Connector segment to the previous stage in the same row. The fill
   color flips green when the previous stage is done or the current
   stage is current — that produces the "fill bar threads through
   completed stages" effect without an SVG path. */
.tracker .stage::before {
  content: '';
  position: absolute;
  top: 13px;
  left: -50%;
  right: 50%;
  height: 3px;
  background: var(--line);
  z-index: 0;
}
.tracker .tracker-row .stage:first-child::before { display: none; }
.tracker .stage.done::before { background: var(--done); }
.tracker .stage.current::before { background: var(--warn); }
.tracker .stage-circle {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
  font-weight: 600;
  position: relative;
  z-index: 2;
}
.tracker .stage.done .stage-circle {
  background: var(--done);
  border-color: var(--done);
  color: #fff;
}
.tracker .stage.current .stage-circle {
  background: var(--warn);
  border-color: var(--warn);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(176, 132, 66, 0.15);
}
.tracker .stage-visit-badge {
  position: absolute;
  right: -13px;
  top: -10px;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--surface);
  background: var(--text);
  color: var(--surface);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  z-index: 3;
  box-sizing: border-box;
}
.tracker .stage-label {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.tracker .stage.current .stage-label {
  color: var(--text);
  font-weight: 600;
}
.tracker-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.tracker-note .glyph { color: var(--accent); margin-right: 4px; }

/* Active-stage label that lives outside the rows. Always rendered by
   JS; hidden by default and shown only at narrow viewports where the
   per-stage labels are too cramped to read (spec R1.4 acceptance). */
.tracker-active-label {
  display: none;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  text-align: center;
}

/* Narrow-viewport label collapse (spec R1.4 acceptance). At ≤ 640px,
   per-stage labels disappear; the standalone active label below the
   rows tells the manager which stage is current. Numbered circles
   keep the journey visible. */
@media (max-width: 640px) {
  .tracker .stage .stage-label { display: none; }
  .tracker .stage { min-width: 24px; }
  .tracker .stage-circle {
    width: 20px;
    height: 20px;
    border-width: 1px;
    font-size: 10px;
  }
  .tracker .stage-visit-badge {
    right: -12px;
    top: -9px;
    min-width: 17px;
    height: 15px;
    font-size: 8px;
  }
  .tracker .stage::before { top: 10px; }
  .tracker-active-label { display: block; }
}

/* Pane-width label collapse: the tracker stays a single horizontal row at
   any width. When JS detects the pane is too narrow to fit every stage
   label (.tracker-compact), labels collapse to circles + the standalone
   active label — the row never wraps onto a second line. This is keyed to
   the tracker's own width, so it works even when the viewport is wide but
   the conversation pane is narrowed by the sidebar. */
.tracker.tracker-compact .stage .stage-label { display: none; }
.tracker.tracker-compact .tracker-active-label { display: block; }

/* Template picker popover. Fixed-position so it escapes overflow:hidden/auto
   ancestors (#active-conv, .panel-details). JS sets right/bottom on open. */
.template-popover {
  position: fixed;
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 10px;
  z-index: 200;
}
.template-popover .group {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.template-popover .group:last-child { border-bottom: none; }
.template-popover .group-label {
  font-size: 11px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin: 0 0 4px 0;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.template-popover .group-label .group-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.template-popover .group.delegation .group-dot { background: var(--picker-delegation); }
.template-popover .group.coaching .group-dot { background: var(--accent); }
.template-popover .group.verification .group-dot { background: var(--warn); }
.template-popover .group.learning .group-dot { background: var(--picker-learning); }
.template-popover .template-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  font: inherit;
  color: var(--text);
}
.template-popover .template-row:hover { background: var(--accent-soft); }
.template-popover .template-row strong { font-size: 13px; font-weight: 500; }
.template-popover .template-row span { font-size: 12px; color: var(--muted); }

/* Totals line — now inside the tracker inline section, below tracker-note. */
.totals {
  font-size: 11px;
  color: var(--muted);
  padding-top: 6px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.totals span { cursor: help; }
.totals .sep { color: var(--line); }
.totals strong { color: var(--text); font-weight: 600; }

/* Issue #711 — adhoc runs have no pizza tracker; render the run totals line on
   its own without the empty stage rows or a redundant top divider. */
.tracker--totals-only {
  padding: 10px 4px;
}
.tracker--totals-only .totals {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}


/* ── Issue #385: Team roster, Employee selector, Lock badges, Hire notice ── */

/* Team roster — horizontal chip row above conv list */
.team-roster {
  display: grid;
  gap: 10px;
}
.roster-chip {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  padding: 10px 12px;
  text-align: left;
  box-shadow: none;
}
.roster-chip.active {
  border-color: rgba(31, 67, 125, 0.25);
  background: var(--accent-soft);
  box-shadow: none;
}
.roster-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  overflow: hidden;
}
.roster-avatar img { width: 100%; height: 100%; object-fit: cover; }
.roster-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.roster-copy strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.roster-copy small {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.roster-chip--all .roster-avatar {
  background: var(--accent-soft);
}
.roster-chip-add {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px dashed var(--line);
  background: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.roster-chip-add:hover { border-color: var(--accent); color: var(--accent); }

/* Employee selector */
.employee-selector { padding: 4px 8px; position: relative; }
.emp-select-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.emp-select-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.emp-avatar-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.emp-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.emp-caret { margin-left: auto; color: var(--muted); font-size: 11px; }
.emp-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 8px;
  right: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
}
.emp-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font: inherit;
}
.emp-option:hover { background: var(--soft); }
.emp-option.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

/* Lock badge — inline after job title */
.lock-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--warn);
  margin-left: 6px;
  white-space: nowrap;
}
.job-option.locked { opacity: 0.85; }
.job-option.locked:hover { background: var(--warn-soft) !important; }
.locked-opt-panel {
  margin: 0 0 8px 0;
  padding: 10px 14px;
  background: var(--warn-soft, #fef9ec);
  border-left: 3px solid var(--warn, #f59e0b);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: var(--fg);
}
.locked-opt-panel p { margin: 0 0 8px 0; }
.job-option-start {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.job-option-start:hover { opacity: 0.88; }

/* Persona job filter bar inside New Job modal */
#job-persona-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.jf-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 6px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.jf-chip:hover { border-color: var(--accent); }
.jf-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.jf-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

/* Hire-required notice */
#hire-notice {
  margin: 0 0 0;
  border-left: 3px solid var(--warn);
  border-radius: 8px;
  background: var(--warn-soft);
  padding: 16px 18px;
  margin: 0 0 12px;
}
#hire-notice p { margin: 0 0 12px; font-size: 14px; color: var(--text); }
.hire-notice-actions { display: flex; align-items: center; gap: 10px; }

/* ── Issue #442: A/B Testing Mode ─────────────────────────────────────── */

/* Rail badge */
.ab-badge {
  margin-left: auto;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  flex-shrink: 0;
}

/* Issue #566 R7: "Taught by you" marking on runs of a personalized job.
   Follows the .ab-badge inline-badge pattern with a distinct purple accent. */
.taught-badge {
  margin-left: auto;
  padding: 1px 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 999px;
  background: var(--teach-soft);
  color: var(--teach);
  border: 1px solid var(--teach-line);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Issue #1002 R10: the level chip on a run row. Same geometry as .taught-badge
   above, which it replaces, tinted by the existing .scope-* tokens rather than a
   new colour so the three levels read the same here as on a learning card. */
.scope-badge {
  margin-left: auto;
  padding: 1px 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid transparent;
}
.scope-badge.scope-mgr  { border-color: rgba(139, 95, 191, 0.35); }
.scope-badge.scope-proj { border-color: rgba(46, 125, 50, 0.35); }
.scope-badge.scope-org  { border-color: rgba(0, 113, 227, 0.35); }

/* Full-panel A/B split: #conversation becomes a flex row */
#conversation.ab-mode {
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

#conversation.ab-mode #active-conv {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
}

/* Direct (B) panel — flex column matching #active-conv so topline/status/reply
   stay pinned and only the log area scrolls. */
#ab-direct-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  background: var(--bg);
}

/* Identity label in conv-topline */
.ab-direct-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ab-direct-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* Simple Running → Done progress row in the tracker area */
.ab-direct-progress {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px 4px 0;
  color: var(--muted);
}
.ab-direct-progress.running { color: var(--accent); }
.ab-direct-progress.done    { color: var(--done); }
.ab-direct-progress.failed  { color: var(--danger); }

/* Raw event log — scrolls inside the thread <details> the same way
   .messages does in A (the <details> itself has overflow-y: auto). */
#ab-direct-log {
  margin: 0;
  padding: 4px 16px 12px;
  font-size: 11px;
  font-family: var(--mono, monospace);
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 900px) {
  #conversation.ab-mode { flex-direction: column; }
}

/* ── Task-pane surface (embedded in Office sidebar at ~375px) ────────────────
   Applied when the Hub is loaded with ?surface=task-pane. The JS sets
   body:is([data-surface="task-pane"],[data-surface="extension"]). No media queries — this is a surface
   flag, not a viewport breakpoint. */

body:is([data-surface="task-pane"],[data-surface="extension"]) {
  font-size: 13px;
  overflow: auto;
  background: var(--bg);
  color: var(--text);
}
body:is([data-surface="task-pane"],[data-surface="extension"]) .hub-tabs,
body:is([data-surface="task-pane"],[data-surface="extension"]):not(.task-pane-run-active) .hub-area,
body:is([data-surface="task-pane"],[data-surface="extension"]) .proj-tabs {
  display: none !important;
}
.task-pane-launcher { display: none; }
body:is([data-surface="task-pane"],[data-surface="extension"]):not(.task-pane-run-active) .task-pane-launcher {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.07));
  background: var(--surface, #fff);
  color: var(--text, #171717);
}
body:is([data-surface="task-pane"],[data-surface="extension"]).task-pane-run-active #area-projects {
  display: flex !important;
  min-height: 100vh;
}
body:is([data-surface="task-pane"],[data-surface="extension"]).task-pane-run-active #proj-workspace {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}
body:is([data-surface="task-pane"],[data-surface="extension"]).task-pane-run-active .tree-sidebar,
body:is([data-surface="task-pane"],[data-surface="extension"]).task-pane-run-active .tree-collapse-btn,
body:is([data-surface="task-pane"],[data-surface="extension"]).task-pane-run-active .tree-resizer {
  display: none !important;
}
body:is([data-surface="task-pane"],[data-surface="extension"]).task-pane-run-active .workspace-conv {
  width: 100%;
  min-width: 0;
}
body:is([data-surface="task-pane"],[data-surface="extension"]).task-pane-run-active .workspace-conv .layout {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: visible;
}
body:is([data-surface="task-pane"],[data-surface="extension"]).task-pane-run-active .word-context-bar {
  flex: 0 0 auto;
}
.tp-launcher-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tp-launcher-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text, #171717);
}
.tp-launcher-context,
.tp-launcher-status {
  min-height: 16px;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tp-launcher-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.tp-launcher-field select,
.tp-launcher-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line, rgba(0,0,0,0.12));
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #171717);
  font: inherit;
  font-size: 12px;
}
.tp-launcher-field select:focus,
.tp-launcher-field textarea:focus {
  outline: 2px solid var(--accent, #0071e3);
  outline-offset: 1px;
  border-color: var(--accent, #0071e3);
}
.tp-launcher-field textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.tp-launcher-field select {
  height: 34px;
  padding: 0 8px;
}
.tp-launcher-field textarea {
  min-height: 78px;
  resize: vertical;
  padding: 8px;
  line-height: 1.35;
}
.tp-launcher-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}
body:is([data-surface="task-pane"],[data-surface="extension"]) #task-pane-start-job,
body:is([data-surface="task-pane"],[data-surface="extension"]) #task-pane-current-job {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
}
body:is([data-surface="task-pane"],[data-surface="extension"]) #task-pane-current-job[hidden] {
  display: none;
}
.task-pane-run-nav {
  display: none;
}
body:is([data-surface="task-pane"],[data-surface="extension"]).task-pane-run-active .task-pane-run-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.07));
  background: var(--surface, #fff);
  color: var(--text, #171717);
}
.tp-run-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tp-run-eyebrow,
.tp-run-meta {
  font-size: 11px;
  line-height: 1.25;
  color: var(--muted);
}
.tp-run-title {
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 650;
  color: var(--text, #171717);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tp-run-actions {
  flex: 0 0 auto;
}
body:is([data-surface="task-pane"],[data-surface="extension"]) #task-pane-new-job {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
}
:root[data-theme="dark"] body:is([data-surface="task-pane"],[data-surface="extension"]) {
  background: var(--bg);
}
:root[data-theme="dark"] body:is([data-surface="task-pane"],[data-surface="extension"]):not(.task-pane-run-active) .task-pane-launcher,
:root[data-theme="dark"] body:is([data-surface="task-pane"],[data-surface="extension"]).task-pane-run-active .task-pane-run-nav {
  background: #242424;
  border-color: rgba(255, 255, 255, 0.16);
}
:root[data-theme="dark"] body:is([data-surface="task-pane"],[data-surface="extension"]) .tp-launcher-field select,
:root[data-theme="dark"] body:is([data-surface="task-pane"],[data-surface="extension"]) .tp-launcher-field textarea {
  background: #171717;
  color: #f2f2f2;
  border-color: rgba(255, 255, 255, 0.22);
}
:root[data-theme="dark"] body:is([data-surface="task-pane"],[data-surface="extension"]) .tp-launcher-field select option {
  background: #171717;
  color: #f2f2f2;
}
:root[data-theme="dark"] body:is([data-surface="task-pane"],[data-surface="extension"]) .tp-launcher-context,
:root[data-theme="dark"] body:is([data-surface="task-pane"],[data-surface="extension"]) .tp-launcher-status,
:root[data-theme="dark"] body:is([data-surface="task-pane"],[data-surface="extension"]) .tp-launcher-field,
:root[data-theme="dark"] body:is([data-surface="task-pane"],[data-surface="extension"]) .tp-run-eyebrow,
:root[data-theme="dark"] body:is([data-surface="task-pane"],[data-surface="extension"]) .tp-run-meta {
  color: #c7c7c7;
}
body:is([data-surface="task-pane"],[data-surface="extension"]) .page {
  padding: 10px 12px 8px;
  gap: 10px;
  height: auto;
  min-height: 100vh;
}
/* Hide the full-width welcome header — task pane has no room for it */
body:is([data-surface="task-pane"],[data-surface="extension"]) .header { display: none; }
/* Collapse rail + conversation into a single column */
body:is([data-surface="task-pane"],[data-surface="extension"]) .layout {
  grid-template-columns: 1fr;
  gap: 0;
}
/* Rail: strip to just the "+ New job" button so the user can always start a
   new job even after a conversation is active. All other rail children stay
   hidden — task pane shows one job at a time with no history sidebar. */
body:is([data-surface="task-pane"],[data-surface="extension"]) .rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  padding: 0 0 8px;
  gap: 0;
  grid-row: 1;
}
body:is([data-surface="task-pane"],[data-surface="extension"]) .rail > :not(#new-conv-btn):not(#teach-btn):not(.tp-project-label) { display: none; }
/* Hidden by default — only shown inside the task-pane surface rail */
.tp-project-label { display: none; }
body:is([data-surface="task-pane"],[data-surface="extension"]) .tp-project-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  margin-right: 8px;
}
body:is([data-surface="task-pane"],[data-surface="extension"]) #new-conv-btn {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 8px;
  width: auto;
}
/* Hide the "+ New job" strip when the modal is open — redundant while modal
   is in view, and it avoids the button floating above the backdrop overlay. */
body:is([data-surface="task-pane"],[data-surface="extension"]):has(.modal-backdrop.open) .rail { display: none; }
/* Tighter conversation card */
body:is([data-surface="task-pane"],[data-surface="extension"]) .conversation {
  border-radius: 16px;
  padding: 12px 14px;
  height: auto;
  overflow: visible;
}
body:is([data-surface="task-pane"],[data-surface="extension"]) #active-conv {
  overflow: visible;
  flex: initial;
}
/* Shrink identity avatar to fit narrower column */
body:is([data-surface="task-pane"],[data-surface="extension"]) .identity-avatar {
  width: 36px; height: 36px;
  border-radius: 12px;
  font-size: 13px;
}
body:is([data-surface="task-pane"],[data-surface="extension"]) .identity-copy strong { font-size: 13px; }
body:is([data-surface="task-pane"],[data-surface="extension"]) .identity-copy small  { font-size: 10px; }
body:is([data-surface="task-pane"],[data-surface="extension"]) .conv-header h2       { font-size: 15px; }
body:is([data-surface="task-pane"],[data-surface="extension"]) .conv-job-title       { font-size: 12px; }
/* Compact message bubbles */
body:is([data-surface="task-pane"],[data-surface="extension"]) .bubble {
  font-size: 12px;
  padding: 7px 11px;
  border-radius: 13px;
}
/* Compact coach input */
body:is([data-surface="task-pane"],[data-surface="extension"]) .coach-input textarea {
  font-size: 12px;
  min-height: 44px;
  padding: 10px 44px 10px 12px;
}
/* Compact micro-manage log */
body:is([data-surface="task-pane"],[data-surface="extension"]) .micro-log { font-size: 11px; }
/* Thread panel: normal block flow, page scrolls naturally */
body:is([data-surface="task-pane"],[data-surface="extension"]) .panel-details--thread {
  flex: initial;
  min-height: auto;
  display: block;
  max-height: 40vh;
}
body:is([data-surface="task-pane"],[data-surface="extension"]) .panel-details--thread .messages {
  flex: initial;
  max-height: calc(40vh - 44px);
  overflow-y: auto;
}
/* Modal bottom-sheet instead of center-screen */
body:is([data-surface="task-pane"],[data-surface="extension"]) .modal-backdrop {
  align-items: flex-end;
  padding: 0;
}
body:is([data-surface="task-pane"],[data-surface="extension"]) .modal {
  border-radius: 18px 18px 0 0;
  max-width: 100%;
  max-height: 88vh;
}
/* Tighter modal chrome at task-pane widths */
body:is([data-surface="task-pane"],[data-surface="extension"]) .modal-header { padding: 16px 16px 10px; }
body:is([data-surface="task-pane"],[data-surface="extension"]) .modal-body { padding: 12px 16px; }
/* Stack footer: label on top (single line, ellipsis) then buttons in a row.
   Prevents "Just describe what you need" + long job names from bloating height. */
body:is([data-surface="task-pane"],[data-surface="extension"]) .modal-footer {
  padding: 10px 12px 14px;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
body:is([data-surface="task-pane"],[data-surface="extension"]) .modal-footer .left {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body:is([data-surface="task-pane"],[data-surface="extension"]) .modal-footer .right {
  display: flex;
  gap: 6px;
}
body:is([data-surface="task-pane"],[data-surface="extension"]) .modal-footer .right button {
  flex: 1;
  font-size: 11px;
  padding: 7px 6px;
  text-align: center;
}

/* ── Word context bar (between rail and conversation in task-pane) ─────────── */
.word-context-bar { display: none; }
body:is([data-surface="task-pane"],[data-surface="extension"]) .word-context-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 4px;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.07));
  min-height: 28px;
  overflow: hidden;
}
.word-ctx-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.word-ctx-refresh {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}
.word-ctx-refresh:hover { color: var(--accent); }

/* ── Extension surface overrides (Chrome/browser extensions) ─────────────────
   Inherits all task-pane layout rules (via :is() above) but hides the
   project label since extensions work on web pages, not local project paths. */
body[data-surface="extension"] .tp-project-label { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   Issue #512 — Manager-style team flow shell
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hide legacy .page when shell is active */
body.hub-shell > .page { display: none !important; }
body.hub-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* Get-started rail */
.gs-rail { display: flex; align-items: center; gap: 10px; padding: 6px 18px; background: #eef4ff; border-bottom: 1px solid rgba(0,113,227,.18); font-size: 12px; flex-shrink: 0; }
.gs-rocket { font-size: 14px; flex-shrink: 0; }
.gs-steps { display: flex; align-items: center; gap: 4px; flex: 1; }
.gs-step { padding: 3px 10px; border-radius: 12px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; background: none; border: none; }
.gs-step.done { color: var(--done); }
.gs-step.current { background: var(--accent); color: #fff; font-weight: 600; }
.gs-sep { color: var(--line); font-size: 11px; }
.gs-cta { padding: 5px 14px; background: var(--accent); color: #fff; border: none; border-radius: 12px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.gs-hide { background: none; border: none; color: var(--muted); font-size: 15px; cursor: pointer; flex-shrink: 0; width: 22px; height: 22px; }
.gs-pill { position: fixed; bottom: 16px; right: 16px; z-index: 60; background: var(--accent); color: #fff; border: none; border-radius: 20px; font-size: 12px; font-weight: 600; padding: 8px 16px; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.gs-pill[hidden] { display: none; }

/* Top nav: Company / Manager / Projects + avatar */
.hub-tabs { display: flex; align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 8px 0 0; flex-shrink: 0; position: relative; }
.htab { padding: 10px 18px; font-size: 13px; font-weight: 500; color: var(--muted); border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.htab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.htab:hover { color: var(--text); }
.hub-tabs-spacer { flex: 1; }
.hub-avatar-btn { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; border: none; font-size: 10px; font-weight: 700; cursor: pointer; flex-shrink: 0; margin: 0 6px; }

/* Account menu */
.account-menu { display: none; position: absolute; top: 44px; right: 8px; width: 260px; z-index: 90; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); overflow: hidden; }
.account-menu.open { display: block; }
.am-header { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.am-av { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.am-name { font-size: 13px; font-weight: 700; }
.am-email { font-size: 11px; color: var(--muted); }
.am-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 16px; cursor: pointer; font-size: 13px; color: var(--text); text-align: left; text-decoration: none; border: 0; background: none; }
.am-item:hover { background: var(--bg); }
.am-ico { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; margin-top: 1px; }
.am-label { font-weight: 600; }
.am-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.am-div { height: 1px; background: var(--line); margin: 4px 0; }
.am-foot { padding: 8px 16px; font-size: 13px; color: var(--muted); cursor: pointer; }
.am-foot:hover { background: var(--bg); }
/* #755: running-version footer + update-available nudge in the account menu */
.am-version { padding: 6px 16px 10px; font-size: 10px; color: var(--muted); text-align: center; }
#account-menu .am-update:not([hidden]) { display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; align-items: start; }
#account-menu .am-update { padding: 9px 16px; margin: 2px 8px 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
#account-menu .am-update .am-ico { width: 30px; margin: 0; text-align: center; font-size: 16px; }
.am-update .am-label { font-size: 13px; font-weight: 700; color: var(--text); }
.am-update .am-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
/* #700: theme toggle row + iOS-style switch */
.am-theme { align-items: center; width: 100%; border: none; background: none; text-align: left; font: inherit; color: var(--text); }
.am-theme .am-switch { box-sizing: border-box; margin-left: auto; align-self: center; width: 38px; height: 22px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); position: relative; flex-shrink: 0; transition: background .18s ease, border-color .18s ease; }
.am-switch-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform .18s ease; }
.am-theme[aria-checked="true"] .am-switch { background: var(--accent); border-color: var(--accent); }
.am-theme[aria-checked="true"] .am-switch-knob { transform: translateX(16px); }

/* Hub areas */
.hub-area { display: none; flex: 1; overflow: hidden; }
.hub-area.on { display: flex; flex-direction: column; }
.hub-area-page { max-width: 860px; margin: 0 auto; padding: 28px 24px 48px; overflow-y: auto; flex: 1; /* authoritative rule — see also Round-2 override below which is now removed */ }

.connected-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  background: var(--bg);
}
.connected-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.connected-title-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.connected-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.connected-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.connected-origin {
  min-width: 0;
  flex: 1;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.connected-close {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.connected-close:hover { background: var(--bg); }
.connected-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  background: var(--surface);
}

/* #521 R6: Company/Manager use the same rail + main shell as the project workspace. */
.area-shell { display: flex; flex: 1; min-height: 0; }
.area-rail { width: 244px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 6px 0; }
.area-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.area-rail-head { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 14px 16px 6px; }
.area-rail-job { display: flex; align-items: center; gap: 11px; padding: 10px 16px; cursor: pointer; border: none; background: none; width: 100%; text-align: left; }
.area-rail-job:hover { background: var(--bg); }
.area-rail-job .arj-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.area-rail-job .arj-name { font-size: 13px; font-weight: 600; color: var(--text); }
.area-rail-job .arj-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.area-rail-note { padding: 10px 16px 14px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.hub-section-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.hub-eyebrow { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.hub-h1 { font-size: 28px; font-weight: 700; letter-spacing: -.3px; margin: 0 0 6px; }
.hub-sub { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0; }

/* Profile rows */
.syn-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 24px; }
.syn-row { display: flex; align-items: flex-start; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.syn-row:last-child { border-bottom: none; }
.syn-label { font-size: 12px; font-weight: 600; color: var(--muted); width: 90px; flex-shrink: 0; padding-top: 1px; }
.syn-val { flex: 1; min-width: 0; overflow-wrap: break-word; font-size: 13px; color: var(--text); line-height: 1.5; }
.syn-edit { font-size: 12px; color: var(--accent); font-weight: 500; background: none; border: none; cursor: pointer; flex-shrink: 0; }

/* Learnings */
.learn-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.lc-scope { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 8px; flex-shrink: 0; white-space: nowrap; }
.scope-org { background: var(--accent-soft); color: var(--accent); }
.scope-mgr { background: rgba(139,95,191,.12); color: #7b46bc; }
.scope-proj { background: rgba(46,125,50,.1); color: var(--done); }
:root[data-theme="dark"] .scope-mgr {
  background: rgba(172,135,255,.18);
  color: #d6c5ff;
}
.lc-body { flex: 1; min-width: 0; }
.lc-text { font-size: 13px; color: var(--text); line-height: 1.55; }
.lc-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.bless-actions { display: flex; gap: 6px; flex-shrink: 0; }
.bless-btn { font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 12px; cursor: pointer; border: none; }
.bless-yes { background: var(--done); color: #fff; }
.bless-no  { background: var(--bg); color: var(--muted); }
.pending-banner { background: var(--warn-soft); border: 1px solid rgba(176,132,66,.25); border-radius: 12px; padding: 12px 16px; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }

/* Projects sub-tabs — HTML uses .proj-tabs (not .proj-tabs-bar) and .ptab-add (not .ptab-add-btn) */
.proj-tabs, .proj-tabs-bar { display: flex; align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 8px 0 0; flex-shrink: 0; overflow: hidden; }
#proj-tab-list { display: flex; align-items: center; min-width: 0; flex: 1 1 auto; overflow-x: auto; overflow-y: hidden; white-space: nowrap; }
.ptab { padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--muted); border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; flex-shrink: 0; margin-bottom: -1px; }
.ptab.on { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.ptab:hover { color: var(--text); }
.ptab-badge { font-size: 10px; font-weight: 700; color: var(--danger); background: rgba(162,71,71,.1); padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.ptab-add, .ptab-add-btn { margin-left: auto; padding: 8px 14px; font-size: 12px; color: var(--accent); font-weight: 500; background: none; border: none; cursor: pointer; flex-shrink: 0; }

/* Overview grid */
#proj-overview { flex: 1; overflow-y: auto; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 20px 18px; }
.proj-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; cursor: pointer; transition: box-shadow .12s; }
.proj-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.10); }
:root[data-theme="dark"] .proj-card {
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  border-color: rgba(255,255,255,.12);
}
:root[data-theme="dark"] .proj-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.34); }
.proj-card-add { display: flex; align-items: center; justify-content: center; border-style: dashed; color: var(--muted); font-size: 13px; min-height: 120px; }
.proj-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.proj-brief { font-size: 12px; color: var(--muted); line-height: 1.4; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.proj-team { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.proj-badge { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--danger); background: rgba(162,71,71,.09); padding: 2px 8px; border-radius: 10px; }
.proj-badge.quiet { color: var(--muted); background: var(--bg); }

/* #521 R5/R6.4: collapsible project context sections at the top of the workspace
   conversation pane (Brief / Learnings), consistent with Company/Manager. */
.proj-context-top { flex-shrink: 0; padding: 12px 16px 0; overflow-y: auto; max-height: 46vh; }
/* #521: shared empty/CTA block — used by BOTH the Brief and Learnings sections so
   they look consistent (a left-aligned message, optional note, primary button). */
.ctx-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px 16px; }
.ctx-cta-ico { font-size: 26px; line-height: 1; }
.ctx-cta-title { font-size: 14px; font-weight: 600; color: var(--text, #1a1a1a); margin: 0; }
.ctx-cta-msg { font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 520px; margin: 0; }
.ctx-cta-note { font-size: 12px; color: var(--text); line-height: 1.5; max-width: 520px; padding: 8px 12px; background: var(--soft, #f6f6f6); border: 1px solid var(--line, #e6e6e6); border-radius: 8px; }
.ctx-cta-btn { font-size: 14px; font-weight: 600; color: #fff; background: var(--accent, #1f6feb); border: none; border-radius: 8px; padding: 10px 16px; cursor: pointer; }
.ctx-cta-btn:hover { filter: brightness(1.05); }
.ctx-push-auto { font-size: 11px; color: var(--muted); opacity: .7; white-space: nowrap; }
/* Unified Company/Manager area layout: info view (accordions) vs conversation panel */
.area-info-view { flex: 1; overflow-y: auto; min-height: 0; }
/* Shared conversation host — a workspace-conv slot inside Company/Manager .area-main.
   The .page element is physically moved here when a company/manager job is active,
   inheriting all .workspace-conv CSS rules (header hidden, rail hidden, conv fills space). */
.area-conv-host { flex: 1; overflow: hidden; min-height: 0; }
/* Rail "info" nav button — mirrors the "Project Info" entry in the Projects tree sidebar */
.area-rail-info-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 16px;
  font-size: 13px; font-weight: 600; color: var(--text);
  background: none; border: none; border-bottom: 1px solid var(--line);
  text-align: left; cursor: pointer; margin-bottom: 2px;
}
.area-rail-info-btn:hover { background: var(--bg); }
.area-rail-info-btn.info-active { color: var(--accent); background: var(--accent-soft); }
/* #594 R2: area-level conversation panel (Company/Manager tab inline run view) — kept for reference */
.area-page-conv { display: flex; flex-direction: column; gap: 0; margin: 0 0 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.area-conv-topline { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.area-conv-thread { flex: 1; max-height: 340px; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.area-conv-empty { font-size: 13px; color: var(--muted); margin: 0; }
.area-conv-msg { display: flex; flex-direction: column; gap: 2px; }
.area-conv-msg--manager .area-conv-msg-text { align-self: flex-end; background: var(--accent-soft, #eef4ff); border-radius: 10px 10px 2px 10px; padding: 8px 12px; font-size: 13px; color: var(--text); max-width: 80%; margin: 0; }
.area-conv-msg--employee .area-conv-msg-text { align-self: flex-start; background: var(--surface, #f8f8f8); border: 1px solid var(--line); border-radius: 10px 10px 10px 2px; padding: 8px 12px; font-size: 13px; color: var(--text); max-width: 80%; margin: 0; white-space: pre-wrap; }
.area-conv-coach { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--bg, #fafafa); }
.area-conv-coach-ta { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; color: var(--text); background: var(--surface); outline: none; min-height: 38px; }
.area-conv-coach-ta:focus { border-color: var(--accent); }
.area-conv-coach-send { flex-shrink: 0; font-size: 13px; font-weight: 600; color: #fff; background: var(--accent, #0071e3); border: none; border-radius: 8px; padding: 8px 16px; cursor: pointer; height: 38px; }
.area-conv-coach-send:hover { filter: brightness(1.08); }
.ctx-loading { font-size: 13px; color: var(--muted); padding: 10px 4px; }
.ctx-push-bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; margin-top: 6px; background: var(--accent-soft, #eef4ff); border: 1px solid var(--line); border-radius: 8px; }
.ctx-push-msg { flex: 1; font-size: 13px; color: var(--text); }
.ctx-push-btn { font-size: 13px; font-weight: 600; color: #fff; background: var(--accent, #0071e3); border: none; border-radius: 6px; padding: 6px 14px; cursor: pointer; white-space: nowrap; }
.ctx-push-btn:hover { filter: brightness(1.07); }
.ctx-push-dismiss { font-size: 12.5px; color: var(--muted); background: none; border: 1px solid var(--line, rgba(0,0,0,.1)); border-radius: 5px; padding: 4px 10px; cursor: pointer; white-space: nowrap; }
.ctx-push-dismiss:hover { color: var(--text); border-color: var(--muted); }
.push-to-team-banner { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin: 10px 0; background: var(--accent-soft, #eef4ff); border: 1px solid var(--line); border-radius: 10px; }
.ptb-ico { font-size: 20px; flex-shrink: 0; line-height: 1.4; }
.ptb-copy { flex: 1; font-size: 13px; color: var(--text); line-height: 1.6; }
.ptb-copy strong { font-weight: 600; }
.ptb-push-btn { font-size: 13px; font-weight: 600; color: #fff; background: var(--accent, #0071e3); border: none; border-radius: 8px; padding: 8px 16px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.ptb-push-btn:hover { filter: brightness(1.07); }
.ptb-dismiss { font-size: 13px; color: var(--muted); background: none; border: 1px solid var(--line, rgba(0,0,0,.1)); border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.ptb-dismiss:hover { color: var(--text); border-color: var(--muted); }
/* #521: project-onboarding input modal (manager's direction before a run). */
.obi-input { width: 100%; box-sizing: border-box; resize: vertical; min-height: 96px; font: inherit; font-size: 14px; line-height: 1.5; padding: 11px 13px; border: 1px solid var(--line, #e2e2e2); border-radius: 10px; background: var(--surface, #fff); color: var(--text); }
.obi-input:focus { outline: none; border-color: var(--accent, #1f6feb); }
.obi-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.obi-cancel { font-size: 14px; font-weight: 500; color: var(--muted, #666); background: none; border: none; padding: 10px 14px; cursor: pointer; }
.obi-start { font-size: 14px; font-weight: 600; color: #fff; background: var(--accent, #1f6feb); border: none; border-radius: 8px; padding: 10px 18px; cursor: pointer; }
.obi-start:hover { filter: brightness(1.05); }
.ctx-acc { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; background: var(--surface); }
.ctx-acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; padding: 11px 14px; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.ctx-acc > summary::-webkit-details-marker { display: none; }
.ctx-acc > summary:hover { background: var(--bg); }
.ctx-acc > summary .ca-chev { font-size: 10px; color: var(--muted); transition: transform .15s; }
.ctx-acc[open] > summary .ca-chev { transform: rotate(90deg); }
.ctx-acc > summary .ca-note { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--muted); }
/* #ai-hub-polish F2: a long section must not bury the others. Cap the body and
   let it scroll internally so every accordion header stays reachable. */
.ctx-acc-body { padding: 4px 14px 14px; max-height: min(62vh, 620px); overflow-y: auto; }

:root[data-theme="dark"] .ctx-acc {
  background: #242424;
  border-color: rgba(255,255,255,.13);
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
}
:root[data-theme="dark"] .ctx-acc > summary {
  background: #262626;
  color: #b7b7b7;
}
:root[data-theme="dark"] .ctx-acc > summary:hover {
  background: #2e2e2e;
}
:root[data-theme="dark"] .ctx-acc[open] > summary {
  border-bottom: 1px solid rgba(255,255,255,.10);
}
:root[data-theme="dark"] .ctx-acc-body {
  background: #202020;
}

/* #ai-hub-polish F1: ease the open/close instead of snapping. Animate the
   <details> content slot; interpolate-size lets block-size animate to/from auto.
   @supports keeps older engines on the instant (pre-polish) behavior, and the
   prefers-reduced-motion block above neutralizes the transition. */
@supports selector(::details-content) {
  .ctx-acc::details-content {
    block-size: 0;
    overflow: clip;
    transition: block-size .24s ease, content-visibility .24s allow-discrete;
  }
  .ctx-acc[open]::details-content { block-size: auto; }
}

/* #521: project-onboarding loop banner inside the Brief — "team is processing /
   here's their understanding to review". */
.ob-brief-banner { display: flex; align-items: flex-start; gap: 10px; border-radius: 10px; padding: 12px 14px; margin: 6px 0 12px; font-size: 13px; line-height: 1.5; }
.ob-brief-banner .obb-ico { font-size: 16px; flex-shrink: 0; }
.ob-brief-banner.ob-processing { background: var(--accent-soft); border: 1px solid rgba(0,113,227,.22); color: var(--text); }
.ob-brief-banner.ob-review { background: var(--warn-soft); border: 1px solid rgba(176,132,66,.3); color: var(--text); }

/* Project workspace */
#proj-workspace {
  --tree-sidebar-width: 216px;
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}
.proj-switch-mask {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(2px);
  pointer-events: auto;
}
#proj-workspace.project-switching .proj-switch-mask { display: flex; }
.proj-switch-panel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  max-width: min(320px, calc(100vw - 48px));
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.proj-switch-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in srgb, var(--text) 14%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  flex: 0 0 auto;
  animation: proj-switch-spin .8s linear infinite;
}
@keyframes proj-switch-spin {
  to { transform: rotate(360deg); }
}
.ptab:disabled {
  cursor: wait;
  opacity: .72;
}
.tree-sidebar {
  width: var(--tree-sidebar-width);
  min-width: 176px;
  max-width: 380px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 10px 0;
}
.tree-collapse-btn {
  width: 22px;
  flex-shrink: 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}
.tree-collapse-btn:hover {
  color: var(--text);
  background: var(--bg);
}
.tree-collapse-btn::before { content: "<"; }
.tree-resizer {
  width: 7px;
  flex-shrink: 0;
  cursor: col-resize;
  background: linear-gradient(to right, transparent 0 2px, var(--line) 2px 3px, transparent 3px 100%);
}
.tree-resizer:hover,
#proj-workspace.tree-resizing .tree-resizer {
  background: linear-gradient(to right, transparent 0 2px, var(--accent) 2px 4px, transparent 4px 100%);
}
#proj-workspace.tree-collapsed .tree-sidebar {
  width: 0;
  min-width: 0;
  max-width: 0;
  padding: 0;
  border-right: 0;
  overflow: hidden;
}
#proj-workspace.tree-collapsed .tree-sidebar > * { display: none; }
#proj-workspace.tree-collapsed .tree-collapse-btn::before { content: ">"; }
#proj-workspace.tree-collapsed .tree-resizer { display: none; }
.tree-emp { display: flex; align-items: center; gap: 8px; padding: 7px 14px; cursor: pointer; user-select: none; }
.tree-emp:hover { background: var(--bg); }
.t-av { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; }
.t-name { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; }
.t-emp-add { width: 20px; height: 20px; border-radius: 50%; background: var(--bg); color: var(--accent); font-size: 14px; line-height: 20px; text-align: center; opacity: 1; border: 1px solid var(--line); cursor: pointer; flex-shrink: 0; transition: background .1s, border-color .1s; }
.tree-emp:hover .t-emp-add { background: var(--accent-soft); border-color: rgba(0,113,227,.28); }
.t-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.tree-job { display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 44px; cursor: pointer; }
.tree-job:hover { background: var(--bg); }
.tree-job.selected { background: var(--bg); }
.tj-label { font-size: 12px; color: var(--muted); flex: 1; }
.tree-job.selected .tj-label { color: var(--text); font-weight: 500; }
.tj-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* #533 R6 — delete a run. Hover-revealed controls (mirrors the eh-add "+"
   affordance) plus a small inline confirm. Hub-local delete; never touches disk. */
.conv-item { position: relative; }
.run-del { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1;
  display: none; align-items: center; justify-content: center; cursor: pointer; }
.conv-item:hover .run-del, .run-del:focus-visible { display: flex; }
.run-del:hover { color: var(--danger, #d2261f); border-color: var(--danger, #d2261f); }
.tree-job { position: relative; }
.tree-job .tj-del { margin-left: 4px; width: 18px; height: 18px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font-size: 11px; line-height: 1; display: none; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; }
.tree-job:hover .tj-del, .tj-del:focus-visible { display: flex; }
.tree-job .tj-del:hover { color: var(--danger, #d2261f); border-color: var(--danger, #d2261f); }
.del-confirm { margin: 8px 14px 4px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--text); line-height: 1.5; }
/* #1740: the confirm is rendered inside the ~175px employee rail. An unwrappable action
   row makes the box's min-content width exceed the rail, which clipped Cancel and forced a
   horizontal rail scrollbar. Wrapping the row lets the box shrink to the rail. */
.del-confirm .dc-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.del-confirm button { font: inherit; font-size: 12px; border-radius: 7px; padding: 5px 12px; cursor: pointer; }
/* #1740: the in-flight label ("Deleting...") is a single unbreakable token while the idle
   label ("Delete run") wraps to two lines. Without a stable box the control widened and the
   confirm collapsed ~34px mid-click. Keep both labels on one line and reserve the width of
   the wider of the two (measured 79.3px for "Delete run" at 12px/400) so the swap is inert.
   The regression test asserts both the button and the confirm box are unchanged by it. */
.del-confirm .dc-del { background: var(--danger, #d2261f); color: #fff; border: none;
  min-width: 80px; white-space: nowrap; }
.del-confirm .dc-del:disabled { opacity: .55; cursor: not-allowed; }
.del-confirm .dc-cancel { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.del-confirm .dc-detail { margin-top: 6px; color: var(--muted); }
.del-confirm .dc-detail:empty { display: none; }

/* #719 — remove a project from the Hub. The card-positioned copy of .run-del.
   Hidden via opacity (not display) so the control stays keyboard-focusable
   (R11: revealed on hover AND on keyboard focus). */
.proj-card { position: relative; }
.proj-card .proj-del { position: absolute; right: 10px; top: 10px;
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: 0; pointer-events: none; }
.proj-card:hover .proj-del, .proj-card .proj-del:focus-visible, .proj-card .proj-del:focus {
  opacity: 1; pointer-events: auto; }
.proj-card .proj-del:hover { color: var(--danger, #d2261f); border-color: var(--danger, #d2261f); }
/* Inside a card the confirm sits below the team row — zero the horizontal
   margin the run-list variant carries. */
.proj-card .del-confirm { margin: 10px 0 0; }

/* R1 (#521): employees are the heroes — large accordion rows replace .tree-emp.
   The summary is the employee (40px avatar, name, role, status dot); their jobs
   nest in the body and collapse with the row. */
/* .proj-updates-acc shares this chrome but is intentionally NOT .emp-hero (that
   class is the employee-hero selector). */
.emp-hero, .proj-updates-acc { border-bottom: 1px solid var(--line); }
.emp-hero > summary, .proj-updates-acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 11px; padding: 11px 14px; user-select: none; }
.emp-hero > summary::-webkit-details-marker, .proj-updates-acc > summary::-webkit-details-marker { display: none; }
.emp-hero > summary:hover, .proj-updates-acc > summary:hover { background: var(--bg); }
.emp-hero .eh-av, .proj-updates-acc .eh-av { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; }
.emp-hero .eh-id, .proj-updates-acc .eh-id { flex: 1; min-width: 0; }
.emp-hero .eh-name, .proj-updates-acc .eh-name { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.emp-hero .eh-role, .proj-updates-acc .eh-role { font-size: 11px; color: var(--muted); margin-top: 1px; }
.emp-hero .eh-dot, .proj-updates-acc .eh-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.emp-hero .eh-add, .proj-updates-acc .eh-add { width: 20px; height: 20px; border-radius: 50%; background: var(--bg); color: var(--accent); font-size: 13px; line-height: 18px; text-align: center; flex-shrink: 0; border: 1px solid var(--line); opacity: 0; transition: opacity .12s; cursor: pointer; }
.emp-hero > summary:hover .eh-add, .proj-updates-acc > summary:hover .eh-add { opacity: 1; }
/* Issue #538 — per-employee "find a human manager" action in the employee hero. */
.emp-hero .eh-hire-manager { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); font-size: 12px; line-height: 20px; text-align: center; flex-shrink: 0; border: 1px solid var(--line); opacity: 0; transition: opacity .12s; cursor: pointer; padding: 0; }
.emp-hero > summary:hover .eh-hire-manager { opacity: 1; }
.emp-hero .eh-hire-manager:hover { border-color: var(--accent); }
/* Project Updates "+" is a primary affordance — always visible, not hover-only. */
.proj-updates-acc .eh-add { opacity: 1; }
.emp-hero .eh-chev, .proj-updates-acc .eh-chev { font-size: 10px; color: var(--muted); flex-shrink: 0; transition: transform .15s; }
.emp-hero[open] > summary .eh-chev, .proj-updates-acc[open] > summary .eh-chev { transform: rotate(90deg); }
.emp-hero .eh-jobs, .proj-updates-acc .eh-jobs { padding: 0 0 6px; }
.emp-hero .eh-jobs .tree-job, .proj-updates-acc .eh-jobs .tree-job { padding-left: 36px; }
.emp-hero .eh-empty, .proj-updates-acc .eh-empty { font-size: 11px; color: var(--muted); padding: 4px 14px 6px 36px; }
.tree-sep { height: 1px; background: var(--line); margin: 6px 14px; }
.tree-action { margin: 2px 14px; padding: 7px 10px; font-size: 12px; color: var(--accent); font-weight: 600; background: none; border: none; cursor: pointer; text-align: left; width: calc(100% - 28px); }
.tree-action:hover { background: var(--bg); border-radius: 8px; }
.tree-legend { padding: 6px 14px 10px; display: flex; flex-direction: column; gap: 5px; }
.tree-legend-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tree-legend-row { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }

/* Dot color helpers */
.dot-red   { background: var(--state-waiting) !important; }
.dot-amber { background: var(--state-working) !important; }
.dot-green { background: var(--state-complete) !important; }
.dot-grey  { background: var(--line) !important; }
/* #549 R4: amber-static — same amber colour as dot-amber but no pulse animation.
   Used for manager-stopped runs to distinguish intentional pause from active work. */
.dot-amber-static { background: var(--warn) !important; }
/* Issue #1491: parked-recurring - scheduler resumes automatically, no action needed. */
.dot-scheduled { background: var(--accent) !important; }

/* Workspace conversation pane */
.workspace-conv { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.workspace-conv > .page { display: flex !important; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; padding: 0; max-width: none; }
.workspace-conv .layout { flex: 1; min-height: 0; overflow: hidden; }
.workspace-conv .conversation { flex: 1; width: 100%; min-width: 0; }
.workspace-conv .panel-details--thread { overflow: hidden; }

/* #521 UI rework: the project workspace has TWO mutually-exclusive views inside
   .workspace-conv — the Brief & Learnings page (#proj-context-top) and the job
   conversation (.page). Cramming both into one pane left the conversation short
   and squeezed the thread/coach/micro-manage. Now a job conversation gets the
   FULL height (no Brief stealing space), and the Brief is its own page reached
   from the sidebar. JS toggles .mode-conv / .mode-brief on .workspace-conv. */
.workspace-conv.mode-conv #proj-context-top { display: none; }
.workspace-conv.mode-brief > .page { display: none !important; }
.workspace-conv.mode-brief #proj-context-top {
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px;
}

/* Conversation view (full height): the open panels SHARE the available real
   estate instead of being pinned to fixed caps. Each open panel grows to fill its
   slice and scrolls internally when its content overflows (its own scrollbar).
   #active-conv keeps overflow-y:auto only as a fallback for very short windows
   where the panels' min-heights can't all fit. */
.workspace-conv #active-conv {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.workspace-conv #active-conv > .conv-topline,
.workspace-conv #active-conv > .conversation-status { flex: 0 0 auto; }

/* Manager/employee thread — the primary conversation. The "Ready for review"
   card lives inside #messages, so it scrolls with the thread. Open thread grows
   to fill spare height; collapsed it is just its summary bar. */
.workspace-conv #thread-panel { flex: 0 0 auto; min-height: 0; }
/* Open thread is the sole space-filler: it grows to take all height the support
   stack does not need, and scrolls #messages internally. Collapsed it is just
   its summary bar. */
.workspace-conv #thread-panel[open] {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 120px;
}
.workspace-conv #thread-panel > summary { flex: 0 0 auto; }
/* Chromium wraps <details> content in a ::details-content slot, so #messages is
   not a direct flex child of the panel. Make the slot a column flex container
   that fills the panel; then #messages can flex-grow and scroll inside it. */
.workspace-conv #thread-panel[open]::details-content {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.workspace-conv #thread-panel[open] #messages {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}
.workspace-conv #thread-panel:not([open]) #messages { display: none; }

/* Both Manage views use the same flex slot; switching does not resize the pane. */
#thread-panel .manage-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
#thread-panel:not([open]) .manage-body { display: none; }
#thread-panel .manage-activity {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
#thread-panel .manage-activity[hidden],
#thread-panel #messages[hidden] { display: none; }
#thread-panel .manage-activity .micro-log {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  white-space: pre;
}
#thread-panel .resume-command { flex: 0 0 auto; }
#thread-panel > summary { gap: 10px; }
#thread-panel > summary .panel-summary-copy { margin-right: auto; }
.micro-manage-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.micro-manage-toggle[hidden] { display: none; }
.micro-switch-track { width: 30px; height: 18px; border: 1px solid var(--muted); border-radius: 12px; background: var(--line); }
.micro-switch-track::after { content: ''; display: block; width: 12px; height: 12px; margin: 2px; border-radius: 50%; background: var(--muted); }
.micro-manage-toggle[aria-checked="true"] .micro-switch-track { background: var(--accent); border-color: var(--accent); }
.micro-manage-toggle[aria-checked="true"] .micro-switch-track::after { transform: translateX(12px); background: white; }
.micro-manage-toggle:focus-visible, .micro-return:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.micro-activity-state, .micro-return { margin: 0 16px 12px; color: var(--text); }
.micro-return { align-self: flex-start; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; }
@media (max-width: 480px) {
  #thread-panel > summary { flex-wrap: wrap; }
  #thread-panel > summary .conversation-focus-btn { order: 1; margin-left: auto; }
  #thread-panel > summary .micro-manage-toggle { margin-left: auto; }
}

/* Support stack: coaching controls. It sizes to its content and
   never grows past it, so the thread keeps the spare real estate. Each open body
   has a viewport-relative cap and scrolls internally, so it shows more on bigger
   screens (and far more than the old 1-line peek) without crowding the thread. */
.workspace-conv .support-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 0 1 auto;
}
.workspace-conv .coach-input textarea {
  min-height: 92px;
  padding-top: 9px;
  padding-right: 170px;
  padding-bottom: 48px;
}
.workspace-conv .coach-note { display: none; }
.workspace-conv .quick-coach-row { gap: 5px; }
.workspace-conv .quick-coach-btn { padding: 4px 9px; }
.workspace-conv .composer-icon-btn,
.workspace-conv .composer-stop-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
}
.workspace-conv .composer-stop-btn.composer-stop-btn--armed {
  width: auto;
  min-width: 112px;
  padding: 0 10px;
}
@media (max-width: 760px) {
  .workspace-conv .coach-input textarea {
    min-height: 126px;
    padding-right: 52px;
    padding-bottom: 82px;
  }
}

.workspace-conv .support-stack > .micro { flex: 0 0 auto; min-height: 0; }
.workspace-conv .support-stack > .micro[open] > .micro-log {
  max-height: clamp(120px, 24vh, 260px);
  overflow-y: auto;
}

/* #770: Deliverables panel sizes to its content and scrolls internally when open,
   mirroring the coach/micro support-stack panels. */
.workspace-conv .support-stack > .panel-details--deliverables { flex: 0 0 auto; }
.workspace-conv .support-stack > .panel-details--deliverables[open] > .panel-body {
  max-height: clamp(120px, 22vh, 240px);
  overflow-y: auto;
}

.workspace-conv #active-conv.has-delegation-board .delegation-ledger[open] .delegation-ledger-body {
  max-height: clamp(140px, 24vh, 260px);
}
.workspace-conv #active-conv.has-manager-oversight .manager-oversight-board[open] .manager-oversight-list {
  max-height: clamp(120px, 22vh, 240px);
  overflow-y: auto;
}
.workspace-conv #active-conv.has-delegation-board .progress,
.workspace-conv #active-conv.has-manager-oversight .progress {
  max-height: 68px;
  overflow: hidden;
}
.workspace-conv #active-conv.has-delegation-board .support-stack,
.workspace-conv #active-conv.has-manager-oversight .support-stack {
  flex: 0 0 auto;
  max-height: none;
  overflow-y: visible;
}
.workspace-conv #active-conv.has-manager-oversight {
  gap: 6px;
}
.workspace-conv .support-stack > .panel-details,
.workspace-conv .support-stack > .micro { margin-bottom: 0; }

.conversation-focus-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-cmd-palette);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 18px;
  background: rgba(14, 21, 32, 0.42);
  overflow: hidden;
}
.conversation-focus-overlay[hidden] {
  display: none;
}
.conversation-focus-dialog {
  width: min(1180px, 100%);
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  overflow: hidden;
}
.conversation-focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
}
.conversation-focus-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.conversation-focus-copy strong {
  color: var(--text);
  font-size: 15px;
}
.conversation-focus-copy span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-focus-close {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  cursor: pointer;
}
.conversation-focus-close:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}
.conversation-focus-panels {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.conversation-focus-panels #thread-panel {
  margin: 0;
  min-height: 0;
}
.conversation-focus-panels #thread-panel[open] {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
}
.conversation-focus-panels #thread-panel[open]::details-content {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.conversation-focus-panels #thread-panel[open] #messages {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}
.conversation-focus-panels #persistent-composer .coach {
  min-height: 0;
}
.conversation-focus-panels #persistent-composer .coach-input textarea {
  min-height: 68px;
}
.conversation-focus-panels:has(#thread-panel:not([open])) #persistent-composer,
.conversation-focus-panels:has(#thread-panel:not([open])) #persistent-composer .coach,
.conversation-focus-panels:has(#thread-panel:not([open])) #persistent-composer .coach-input {
  flex: 1 1 0;
}
.conversation-focus-panels:has(#thread-panel:not([open])) #persistent-composer .coach {
  display: flex;
  flex-direction: column;
}
.conversation-focus-panels:has(#thread-panel:not([open])) #persistent-composer .coach-input textarea {
  flex: 1 1 0;
  min-height: 160px;
}

@media (max-width: 820px) {
  /* On narrow screens drop the fill model: panels flow naturally and the page
     scrolls, with each open body keeping a viewport-relative scroll cap. */
  .workspace-conv #active-conv {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .workspace-conv #thread-panel[open],
  .workspace-conv .support-stack,
  .workspace-conv .support-stack:has(.micro[open]),
  .workspace-conv .support-stack > .micro[open] {
    flex: 0 0 auto;
    display: block;
    min-height: 0;
  }
  .workspace-conv #thread-panel[open] #messages,
  .workspace-conv .support-stack > .micro[open] > .micro-log {
    flex: initial;
    height: auto;
    max-height: clamp(140px, 32vh, 280px);
    overflow-y: auto;
  }
  .workspace-conv .support-stack > .panel-details[open] > .panel-body {
    max-height: clamp(140px, 32vh, 280px);
    overflow-y: auto;
  }
}

@media (max-width: 640px) {
  body.hub-shell { overflow-x: hidden; }
  .conversation-focus-overlay {
    padding: 8px;
  }
  .conversation-focus-dialog {
    border-radius: 8px;
    padding: 8px;
  }
  .conversation-focus-header {
    align-items: flex-start;
  }
  .conversation-focus-copy span {
    white-space: normal;
  }
  .conversation-focus-close {
    padding: 7px 9px;
  }
  .gs-rail { overflow-x: auto; padding-inline: 10px; }
  .hub-tabs { min-width: 0; }
  .htab { padding-inline: 14px; }
  .proj-tabs,
  .proj-tabs-bar {
    min-width: 0;
  }
  #proj-workspace {
    flex-direction: column;
    overflow: hidden;
  }
  .tree-sidebar {
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: 210px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .tree-collapse-btn,
  .tree-resizer {
    display: none;
  }
  #proj-workspace.tree-collapsed .tree-sidebar {
    width: 100%;
    max-width: none;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    overflow-y: auto;
  }
  #proj-workspace.tree-collapsed .tree-sidebar > * { display: flex; }
  .workspace-conv {
    width: 100%;
    min-width: 0;
  }
  .workspace-conv .layout {
    min-width: 0;
  }
  .manager-oversight-header {
    display: grid;
    gap: 4px;
  }
  .manager-oversight-meta {
    flex-shrink: 1;
  }
}

@media (max-width: 820px) {
  .workspace-conv #thread-panel[open] { max-height: none; }
  .workspace-conv #thread-panel[open] .manage-body { height: clamp(180px, 36vh, 320px); flex: none; }
  .workspace-conv #thread-panel[open] .manage-body #messages { flex: 1 1 0; height: auto; max-height: none; }
}

/* Review surfaces */
.completion-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; }
.completion-card .cc-title { font-weight: 700; margin-bottom: 6px; font-size: 14px; }
.completion-card .cc-row { font-size: 13px; color: var(--text); line-height: 1.65; }
.art-strip2 { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--bg); }
.art-strip2 .as-name { font-size: 13px; font-weight: 600; }
.art-strip2 .as-sub { font-size: 11px; color: var(--muted); }
.act-bar { border-top: 1px solid var(--line); padding: 8px 16px 12px; background: var(--surface); }
.act-note { font-size: 11px; color: var(--muted); margin-bottom: 7px; line-height: 1.4; }
.act-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 7px; }
.act-row .chips-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.act-input { display: flex; gap: 10px; align-items: flex-end; }
.act-input textarea { flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; font: inherit; font-size: 13px; background: var(--bg); color: var(--text); resize: none; height: 42px; }
.rv-open    { font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 14px; background: var(--text); color: #fff; border: none; cursor: pointer; flex-shrink: 0; }
.rv-ghost   { font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 14px; background: var(--bg); color: var(--text); border: 1px solid var(--line); cursor: pointer; flex-shrink: 0; }
.rv-changes { font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 14px; background: var(--bg); color: var(--warn); border: 1px solid rgba(176,132,66,.35); cursor: pointer; flex-shrink: 0; }
.rv-approve { font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 14px; background: var(--done); color: #fff; border: none; cursor: pointer; flex-shrink: 0; }

/* Issue #1253 — why the Hub opened with no project, on the Projects Overview. */
.proj-dropped-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--warn) 34%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--warn) 8%, var(--surface)); font-size: 13px; line-height: 1.5; }
.proj-dropped-note .pdn-ico { font-size: 16px; line-height: 1.3; }
.proj-dropped-note .pdn-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; padding: 1px 5px; border-radius: 5px; background: var(--soft); word-break: break-all; }

/* Issue #1253 — a listed folder that is not a FRAIM project yet. Marked, not hidden. */
.proj-not-setup { margin-left: 8px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; }

/* Issue #1198 / #1661 - active project folder with explicit rehome controls. */
.proj-folder-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 6px 10px; align-items: center; margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.proj-folder-row .pfr-label { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.proj-folder-row .pfr-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text); word-break: break-all; user-select: text; }
.proj-folder-row .pfr-change, .proj-folder-row .pfr-copy { justify-self: end; padding: 3px 10px; font-size: 12px; }
.proj-folder-row .pfr-hint, .proj-folder-row .pfr-reason { grid-column: 1 / -1; font-size: 11px; color: var(--muted); line-height: 1.5; }
.proj-folder-row .pfr-reason { color: var(--warn); }
.proj-folder-row .pfr-reason code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.proj-folder-row .pfr-edit { grid-column: 1 / -1; display: grid; gap: 8px; padding-top: 4px; }
.proj-folder-row .pfr-edit[hidden] { display: none; }
.proj-folder-row .pfr-warning { padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--warn) 38%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--warn) 8%, var(--surface)); color: var(--text); font-size: 12px; line-height: 1.45; }
.proj-folder-row .pfr-edit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.proj-folder-row .pfr-edit-row input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 12px; background: var(--bg); color: var(--text); }
.proj-folder-row .pfr-actions { display: flex; justify-content: flex-end; gap: 8px; }
.proj-folder-row .pfr-actions .modal-next { padding: 6px 14px; font-size: 12px; border-radius: 16px; }

/* Issue #1253 — the setup-consent dialog's folder callout. */
.spm-folder-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.spm-folder { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); word-break: break-all; user-select: text; }

/* Modals — .modal-card pattern (uses .modal-overlay, not .modal-backdrop) */
.modal-card { max-width: 560px; margin: 48px auto; background: var(--surface); border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,.22); overflow: hidden; }
.modal-hdr { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-hdr h2 { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.modal-hdr p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }
.modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-close { float: right; background: var(--bg); border: none; width: 28px; height: 28px; border-radius: 50%; font-size: 16px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-close:focus, .modal-close:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.aom-cancel-btn { background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent-strong) 52%, var(--line)); border-radius: 20px; padding: 9px 20px; font-size: 14px; cursor: pointer; color: var(--accent-strong); }
.aom-cancel-btn:hover { border-color: var(--accent-strong); color: var(--accent-strong); }
.aom-cancel-btn:focus, .aom-cancel-btn:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.modal-footer { padding: 12px 22px 20px; display: flex; align-items: center; justify-content: space-between; }
.modal-next { padding: 9px 22px; background: var(--accent-strong); color: var(--bg); border: none; border-radius: 20px; font-size: 14px; font-weight: 600; cursor: pointer; }
.modal-next:hover { opacity: .9; }
.modal-next:focus, .modal-next:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.modal-back { font-size: 13px; color: var(--muted); background: none; border: none; cursor: pointer; }
/* #1351: unified Add Agent dialog tabs (Add Manually / Delegate to Employee). */
.aam-tabs { display: flex; gap: 4px; padding: 10px 22px 0; border-bottom: 1px solid var(--line); }
.aam-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 4px 10px; margin-right: 18px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.aam-tab:hover { color: var(--text); }
.aam-tab.active { color: var(--accent-strong); border-bottom-color: var(--accent-strong); }
.aam-tab:focus, .aam-tab:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.modal-step-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.modal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.modal-dot.on { background: var(--text); }
.np-field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.np-field input, .np-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font: inherit; font-size: 13px; background: var(--bg); color: var(--text); resize: none; }
.np-field input:focus, .np-field textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.job-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.job-row:last-child { border-bottom: none; }
.job-row .jr-av { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; }
.job-row .jr-body { flex: 1; min-width: 0; }
.job-row .jr-name { font-size: 13px; font-weight: 600; }
.job-row .jr-who { font-size: 11px; color: var(--muted); margin-top: 1px; }
.job-row.locked { cursor: pointer; opacity: .72; }
.jr-lock { font-size: 11px; color: var(--muted); flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
.jr-action { font-size: 12px; font-weight: 600; padding: 5px 13px; border-radius: 13px; background: var(--accent); color: #fff; border: none; cursor: pointer; flex-shrink: 0; }
.modal-cat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 2px; }
.emp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.emp-tile { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; text-align: center; background: var(--bg); }
.emp-tile:hover, .emp-tile.selected { border-color: var(--accent); background: var(--accent-soft); }
.et-av { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; }
.et-name { font-size: 12px; font-weight: 600; color: var(--text); }
.et-role { font-size: 10px; color: var(--muted); }
.emp-tile.selected .et-name { color: var(--accent); }
.pricing-card { background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: 0 12px 32px rgba(0,0,0,.18); max-width: 380px; margin: 48px auto; text-align: center; padding: 28px 28px 24px; }
.pricing-av { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: #fff; margin: 0 auto 14px; }
.pricing-btn { width: 100%; padding: 12px; background: var(--accent); color: #fff; border: none; border-radius: 11px; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 16px; }
.sum-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sum-row:last-child { border-bottom: none; }
.sum-label { font-size: 12px; font-weight: 600; color: var(--muted); width: 80px; flex-shrink: 0; padding-top: 1px; }
.sum-val { font-size: 13px; color: var(--text); flex: 1; line-height: 1.5; }
.sum-team { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.brief-start-btn { width: 100%; padding: 12px; background: var(--accent); color: #fff; border: none; border-radius: 11px; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 4px; }


/* ── #512 CSS class-name corrections (hub-tab vs htab, avatar-btn, legacy suppression) ── */

/* The nav buttons use hub-tab, not htab */
.hub-tab { padding: 10px 18px; font-size: 13px; font-weight: 500; color: var(--muted); border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.hub-tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.hub-tab:hover { color: var(--text); }

/* Avatar button */
.avatar-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  cursor: pointer; flex-shrink: 0; margin-left: auto;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: opacity .12s, box-shadow .12s;
}
.avatar-btn:hover { opacity: .85; box-shadow: 0 2px 8px rgba(0,0,0,.22); }

/* Issue #1379: persistent top-bar update indicator, sits in .nav-right just before
   .avatar-btn. Pill sizing/radius matches the established .run-state-pill convention;
   accent-colored (not warn) since a new version is a nudge, not a problem. */
.hub-update-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  background: var(--accent); color: #fff; border: none;
  cursor: pointer; flex-shrink: 0; margin-left: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: opacity .12s, box-shadow .12s;
}
.hub-update-badge:hover { opacity: .85; box-shadow: 0 2px 8px rgba(0,0,0,.22); }
.hub-update-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hub-update-badge[hidden] { display: none; }
/* Issue #1415: while the restart-to-latest request is in flight / the new instance is coming up,
   the badge shows a live "Restarting…" state rather than the static hover affordance. */
.hub-update-badge:disabled { cursor: default; opacity: .7; }
.hub-update-badge:disabled:hover { box-shadow: 0 1px 4px rgba(0,0,0,.18); }

/* Suppress the old Hub's header and rail when inside the workspace-conv */
.workspace-conv .header { display: none !important; }
.workspace-conv .rail { display: none !important; }

/* The legacy "+ New job" entry (#new-conv-btn) is relocated by tfRenderTree out
   of the suppressed rail into the visible tree-sidebar. Style it as the
   prominent top action so the standalone conversation flow stays reachable. */
#tree-sidebar #new-conv-btn.tree-new-conv {
  display: block;
  width: 100%;
  margin: 0 0 4px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  color: #fff;
  background: var(--accent, #1f6feb);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
#tree-sidebar #new-conv-btn.tree-new-conv:hover { filter: brightness(1.05); }

/* #895: Teach button relocated from suppressed rail into tree-sidebar. */
#tree-sidebar #teach-btn.tree-teach-conv {
  display: block;
  width: 100%;
  margin: 0 0 4px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  color: var(--teach);
  background: var(--teach-soft);
  border: 1px solid var(--teach-line);
  border-radius: 8px;
  cursor: pointer;
}
#tree-sidebar #teach-btn.tree-teach-conv:hover { filter: brightness(0.97); }

/* #521: Brief & Learnings nav entry — the project's own page, above New job. */
#tree-sidebar .tree-brief-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 6px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e2e2e2);
  border-radius: 8px;
  cursor: pointer;
}
#tree-sidebar .tree-brief-nav:hover { background: var(--bg, #f6f6f6); }
#tree-sidebar .tree-brief-nav.active {
  border-color: var(--accent, #1f6feb);
  background: color-mix(in srgb, var(--accent, #1f6feb) 8%, transparent);
  color: var(--accent, #1f6feb);
}
#tree-sidebar .tree-brief-nav .tbn-ico { font-size: 14px; }

/* #521: Project Updates accordion — groups project-onboarding + sleep-on-learnings
   with run history. Reuses .emp-hero/.area-rail-acc chrome; adds the "+" run menu. */
#tree-sidebar .proj-updates-acc { position: relative; }
#tree-sidebar .pu-menu {
  position: absolute;
  top: 46px;
  right: 8px;
  z-index: 40;
  min-width: 200px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e2e2e2);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 6px;
}
#tree-sidebar .pu-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
}
#tree-sidebar .pu-menu-item:hover { background: var(--bg, #f6f6f6); }

/* Relocated Runs section (legacy conversation switcher) inside the tree. */
#tree-sidebar .rail-section--runs.tree-runs { display: block; margin-top: 6px; }
#tree-sidebar .rail-section--runs.tree-runs .rail-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--sub); margin: 4px 0; }
#tree-sidebar .rail-section--runs.tree-runs .conv-list { display: block; }
#tree-sidebar .rail-section--runs.tree-runs .conv-item { display: flex; width: 100%; text-align: left; }

/* Make workspace-conv take the remaining flex space and hide its outer scrollbar */
.workspace-conv > .page { overflow: hidden; }
.workspace-conv .layout { display: flex; gap: 0; min-height: 0; flex: 1; overflow: hidden; }

@media (max-width: 820px) {
  body.hub-shell {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  .hub-area,
  .area-main,
  #proj-workspace,
  .workspace-conv,
  .workspace-conv > .page,
  .workspace-conv .layout {
    overflow: visible;
  }
}

/* #ai-hub-polish F3: Company & Manager areas had no narrow-width layout — the
   fixed 244px rail pushed the main column off the right edge (horizontal scroll).
   Below the Projects-workspace breakpoint, stack the rail above the content and
   let the page shrink so nothing overflows. 2-column stays intact on tablets. */
/* #1669: keep long employee rosters inside the two-column tablet shell. */
@media (min-width: 641px) and (max-width: 820px) {
  body.hub-shell { height: 100vh; overflow: hidden; }
  .hub-area { min-height: 0; overflow: hidden; }
  .area-main,
  #proj-workspace,
  .workspace-conv,
  .workspace-conv > .page,
  .workspace-conv .layout { min-height: 0; overflow: hidden; }
}

@media (max-width: 640px) {
  body.hub-shell { overflow-x: hidden; }
  .area-shell { flex-direction: column; }
  .area-rail {
    width: 100%;
    flex-shrink: 0;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .hub-area-page { padding: 22px 16px 40px; min-width: 0; max-width: 100%; }
}


/* ── #512 Round 2: actual class names from rendered HTML ────────────────── */

/* Area layout — (D35 fix: consolidated at line ~2037; this duplicate removed) */
.eyebrow { font-size: 11px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.area-h1 { font-size: 28px; font-weight: 700; letter-spacing: -.3px; margin: 0 0 8px; }
.area-lede { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0; }
.sec-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* Profile card */
.card.area-profile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 24px; margin-top: 10px; }
.syn-row { display: flex; align-items: flex-start; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.syn-row:last-child { border-bottom: none; }
.syn-label { font-size: 12px; font-weight: 600; color: var(--muted); width: 88px; flex-shrink: 0; padding-top: 2px; }
.syn-val { flex: 1; min-width: 0; overflow-wrap: break-word; font-size: 13px; color: var(--text); line-height: 1.5; }
.syn-edit { font-size: 12px; color: var(--accent); font-weight: 500; background: none; border: none; cursor: pointer; flex-shrink: 0; }
/* #ai-hub-polish: at phone widths the fixed label column starves the value and
   forces mid-word wraps. Stack label over value so the value gets full width.
   Placed after the duplicate .syn-* block above so source order lets it win. */
@media (max-width: 560px) {
  .syn-row { flex-wrap: wrap; gap: 4px 12px; }
  .syn-label { width: 100%; }
  .syn-val { flex: 1 1 100%; }
}

/* Issue #512 R3/R8 — Team Context inline editor. */
/* ctx-content is now a div with rendered markdown (formatEmployeeText), not a raw <pre> */
.ctx-content { font-size: 13px; line-height: 1.6; color: var(--text); word-break: break-word; }
.ctx-content p { margin: 0 0 6px; }
.ctx-content p:last-child { margin-bottom: 0; }
.ctx-content ul, .ctx-content ol { margin: 4px 0 6px 18px; padding: 0; }
.ctx-content li { margin-bottom: 3px; }
.ctx-content h1, .ctx-content h2, .ctx-content h3 { font-size: 13px; font-weight: 700; margin: 8px 0 4px; }
.ctx-content code { background: var(--bg); border-radius: 4px; padding: 1px 5px; font-size: 12px; font-family: ui-monospace, Menlo, monospace; }
.ctx-content strong { font-weight: 700; }
.ctx-path { margin-top: 6px; font-size: 11px; color: var(--sub); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* #533 R1/R2 — readable context/rules document view: keep section headings and the
   file's numbering instead of flattening to compacted lines. */
.ctx-doc { font-size: 13px; line-height: 1.6; color: var(--text); }
.ctx-doc .cd-h { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.ctx-doc .cd-h:first-child { margin-top: 0; }
.ctx-doc ol, .ctx-doc ul { margin: 0 0 6px; padding-left: 22px; }
.ctx-doc ol li, .ctx-doc ul li { margin: 0 0 4px; padding-left: 3px; }
.ctx-doc ol li::marker { color: var(--muted); font-weight: 600; }
.ctx-doc p { margin: 0 0 8px; }
.ctx-doc p:last-child, .ctx-doc ol:last-child, .ctx-doc ul:last-child { margin-bottom: 0; }
.ctx-editor { width: 100%; min-height: 160px; resize: vertical; box-sizing: border-box; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.ctx-editor:focus { outline: none; border-color: var(--accent); }
.ctx-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ctx-save { font-size: 12px; font-weight: 600; color: #fff; background: var(--accent); border: none; border-radius: 8px; padding: 6px 14px; cursor: pointer; }
.ctx-save:disabled { opacity: .6; cursor: default; }
.ctx-cancel { font-size: 12px; color: var(--muted); background: none; border: none; cursor: pointer; }
.ctx-err { font-size: 12px; color: var(--red, #d33); }
.ctx-rerun-row { justify-content: flex-end; }

/* Friendly context/rules view: managers should not have to read Markdown. */
.ctx-content ul,
.ctx-content ol,
.ctx-content h1,
.ctx-content h2,
.ctx-content h3,
.ctx-content code {
  all: unset;
}
.ctx-content {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ctx-context-line {
  padding: 3px 0;
  font-size: 13px;
  line-height: 1.5;
}
.ctx-rule-block {
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.ctx-rule-item {
  position: relative;
  padding: 8px 10px 8px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 13px;
  line-height: 1.45;
}
.ctx-rule-item::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .65;
}
.ctx-editor {
  min-height: 132px;
  font-family: inherit;
  font-size: 13px;
}
.ctx-rule-editor { display: flex; flex-direction: column; gap: 8px; }
.ctx-rule-edit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.ctx-rule-input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.ctx-rule-input:focus { outline: none; border-color: var(--accent); }
.ctx-rule-remove,
.ctx-add-rule {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
  cursor: pointer;
}
.ctx-add-rule { margin-top: 8px; color: var(--accent); }
.ctx-rule-remove:hover,
.ctx-add-rule:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(0,113,227,.25);
}

/* Learnings head row */
.learn-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; margin-top: 24px; }
.learn-head-note { font-size: 12px; color: var(--muted); }
.learn-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.lh-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.lh-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.lh-run { padding: 5px 13px; background: var(--bg); color: var(--accent); border: 1px solid rgba(0,113,227,.22); border-radius: 14px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.lh-run:hover { background: var(--accent-soft); border-color: var(--accent); }

/* Empty state */
.learn-empty { text-align: center; padding: 40px 24px; }
.le-emoji { font-size: 32px; margin-bottom: 10px; }
.le-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.le-sub { font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 360px; margin: 0 auto; }
/* #521: real on-disk preserved-learning tally shown under the empty state. */
.le-count { font-size: 12px; color: var(--text); margin: 12px auto 0; max-width: 360px; padding: 8px 12px; background: var(--soft, #f6f6f6); border: 1px solid var(--line, #e6e6e6); border-radius: 8px; }

/* Learn card */
.learn-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.lc-scope { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 8px; flex-shrink: 0; white-space: nowrap; }
.scope-org { background: var(--accent-soft); color: var(--accent); }
.scope-mgr { background: rgba(139,95,191,.12); color: #7b46bc; }
.scope-proj { background: rgba(46,125,50,.1); color: var(--done); }
.lc-body { flex: 1; min-width: 0; }
.lc-text { font-size: 13px; color: var(--text); line-height: 1.55; }
.lc-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.bless-actions { display: flex; gap: 6px; flex-shrink: 0; }
.bless-btn { font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 12px; cursor: pointer; border: none; }
.bless-yes { background: var(--done); color: #fff; }
.bless-no  { background: var(--bg); color: var(--muted); }

/* Pending banner */
.pending-banner { background: var(--warn-soft); border: 1px solid rgba(176,132,66,.25); border-radius: 12px; padding: 12px 16px; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.pending-banner .pb-body { flex: 1; }
.pb-title { font-size: 13px; font-weight: 700; }
.pb-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pb-bless-all { padding: 6px 14px; background: var(--done); color: #fff; border: none; border-radius: 14px; font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0; }

/* Reverse mentoring */
.rm-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.rm-av { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; }
.rm-body { flex: 1; }
.rm-text { font-size: 13px; color: var(--text); line-height: 1.55; }
.rm-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.rm-actions { display: flex; gap: 6px; flex-shrink: 0; }
.rm-got-it { padding: 5px 12px; background: var(--done); color: #fff; border: none; border-radius: 12px; font-size: 11px; font-weight: 600; cursor: pointer; }
.rm-dismiss { padding: 5px 10px; background: var(--bg); color: var(--muted); border: none; border-radius: 12px; font-size: 11px; cursor: pointer; }
.rm-empty { text-align: center; padding: 28px 16px; color: var(--muted); font-size: 13px; }
.rm-footer { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.5; }

/* Get-started rail: proper pill steps */
.gs-step { background: none; border: none; }
.gs-step.done { color: var(--done); font-weight: 500; cursor: default; }
.gs-step.done::before { content: '✓ '; }
.gs-step.current { background: var(--accent); color: #fff; font-weight: 600; padding: 3px 12px; border-radius: 12px; }

/* Hub top nav: proper layout */
.hub-tabs { height: 44px; }
.hub-tab { height: 44px; }

/* Tree legend */
.tree-legend-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.tree-legend-row { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-red   { background: var(--state-waiting) !important; }
.dot-amber { background: var(--state-working) !important; }
.dot-green { background: var(--state-complete) !important; }
.dot-grey  { background: var(--line) !important; }

/* Project overview: section header */
.overview-head { padding: 20px 20px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* Proj card team avatars row */
.proj-team .av { width: 24px; height: 24px; font-size: 9px; position: relative; }
.proj-team .av .pip { position: absolute; bottom: 0; right: 0; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--surface); }

/* Workspace: make the tree legend not look like a wall of text */
.tree-legend { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════════════════
   #512 Comprehensive UI Polish — All missing CSS classes from audit
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── D01-D11: New-project modal (np-overlay, np-wrap, np-step, np-card, etc.) ── */
.np-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,20,30,.45);
  z-index: 60;
  overflow-y: auto;
}
.np-overlay:not([hidden]) { display: block; }
/* JS removes hidden attribute to show: also handle that */
#np-modal:not([hidden]) { display: block; }

.np-wrap {
  max-width: 560px;
  margin: 40px auto;
  padding: 0 24px 60px;
}

.np-step { display: none; }
.np-step.on { display: block; }

.np-close {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 18px;
  color: var(--muted);
  z-index: 61;
  border: none;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.np-close:hover { color: var(--text); }
.np-close:focus, .np-close:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

.np-step-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 24px;
}
.np-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}
.np-dot.on { background: var(--text); }

.np-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.np-hdr {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}
.np-hdr .step-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.np-hdr h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
}
.np-hdr p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.np-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.np-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.np-next {
  padding: 9px 22px;
  background: var(--accent-strong);
  color: var(--bg);
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.np-next:hover { opacity: .88; }
.np-next:focus, .np-next:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.np-next:disabled { opacity: .55; cursor: not-allowed; }

.np-back {
  font-size: 13px;
  color: var(--accent-strong);
  background: none;
  border: none;
  cursor: pointer;
}
.np-back:hover { color: var(--accent-strong); text-decoration: underline; }
.np-back:focus, .np-back:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

/* ── Discard-guard confirm (shown when a dirty wizard is dismissed) ── */
.np-discard {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20,20,30,.35);
}
.np-discard:not([hidden]) { display: flex; }
.np-discard-card {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 22px 22px 18px;
  width: calc(100% - 48px);
  max-width: 360px;
}
.np-discard-title { font-size: 16px; font-weight: 700; margin: 0 0 6px; color: var(--text); }
.np-discard-msg { font-size: 13px; color: var(--muted); margin: 0 0 18px; line-height: 1.5; }
.np-discard-row { display: flex; gap: 8px; justify-content: flex-end; }
.np-discard-row button { font: inherit; font-size: 13px; font-weight: 600; border-radius: 9px; padding: 8px 16px; cursor: pointer; }
.np-discard-keep { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.np-discard-keep:hover { border-color: var(--muted); }
.np-discard-yes { background: var(--danger, #d2261f); color: #fff; border: none; }
.np-discard-yes:hover { opacity: .9; }
.np-discard-row button:focus, .np-discard-row button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

/* ── D11: Source attachment row (step 2) ── */
.np-source {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.np-source input {
  flex: 1;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.np-source input::placeholder { color: var(--muted); }
.np-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.np-optional {
  color: var(--muted);
  font-weight: 400;
}
.np-link { color: var(--accent); }

/* ── D12: Shared .modal-overlay backdrop (assign-job, add-emp, pricing) ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,20,30,.45);
  z-index: 70;
  overflow-y: auto;
}
.modal-overlay:not([hidden]) { display: block; }
/* Also handle JS hidden attribute removal */
#assign-job-modal:not([hidden]),
#add-emp-modal:not([hidden]),
#pricing-modal:not([hidden]) { display: block; }

/* ── D36: Pricing modal internal structure ── */
.pricing-overlay { z-index: 71; }
.pricing-body {
  padding: 0 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.pricing-body h2 { font-size: 20px; font-weight: 700; margin: 0; }
.pricing-body p { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0; }
.pr-av {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 4px;
  flex-shrink: 0;
}
.pr-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
}
.pr-price span {
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
}
.pr-cta {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
  margin-top: 16px;
}
.pr-cta:hover { opacity: .88; }
.pr-foot {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 2px;
}

/* ── D37: Area foot note, project learnings panel, pl-back, stat-grid ── */
.area-foot-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
  line-height: 1.5;
  font-style: italic;
}
.proj-learnings-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}
.pl-back {
  font-size: 13px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 8px;
  font-weight: 500;
}
.pl-back:hover { opacity: .8; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.stat-card {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.stat-num { font-size: 26px; font-weight: 700; }
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── D18: Profile card — better shadow to match mock ── */
.card.area-profile {
  box-shadow: var(--shadow);
  border: none;
}
:root[data-theme="dark"] .card.area-profile {
  background: #2a2a2a;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow-lg);
}
:root[data-theme="dark"] .syn-row {
  border-bottom-color: rgba(255,255,255,.10);
}

/* ── D19: Hide lh-run button from default learnings head — only show when pending ── */
/* The JS always renders it; suppress via CSS for default display */
/* NOTE: We keep it functional; just reduce its visual weight (D19 P2) */
.lh-run {
  padding: 5px 12px;
  background: var(--bg);
  color: var(--accent);
  border: 1px solid rgba(0,113,227,.2);
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.lh-run:hover { background: var(--accent-soft); }

/* ── D22: proj-grid padding-top match mock spec ── */
.proj-grid { padding-top: 28px !important; }

/* ── D24: tree-action font-weight fix ── */
.tree-action { font-weight: 500; }

/* ── D29/D30: Account menu am-item inner div stacking ── */
.am-item > div {
  display: flex;
  flex-direction: column;
}
.am-label { display: block; font-size: 13px; font-weight: 600; }
.am-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ── D32: am-div separator — use background-color band not hairline ── */
.am-div { height: 6px; background: var(--bg); margin: 2px 0; border: none; }

/* ── D38: jr-av placeholder for locked rows ── */
.job-row.locked .jr-av {
  background: #cfcfd6;
}

/* ── D39: reduce bottom padding to prevent unnecessary scrollbar ── */
.hub-area-page { padding-bottom: 32px; }

/* ── nav-right alignment ── */
.nav-right {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
  padding-right: 8px;
}

/* ── Account menu position fix (was 44px, now relative to .nav-right) ── */
.account-menu {
  top: calc(100% + 6px);
  right: 0;
}

/* ── Ensure modal-card has correct max-width for pricing card ── */
.pricing-card {
  max-width: 380px;
  text-align: center;
  padding: 24px 0 0;
}

/* pr-av fallback background when persona color not set by JS */
.pr-av { background: var(--muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   #512 FINAL POLISH — all remaining missing classes + CSS variable gaps
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS variables required by JS inline styles (dot colors) ── */
:root {
  --red:   #ff3b30;
  --amber: #ff9500;
  --green: #34c759;
  --grey:  #c7c7cc;
  /* Issue #1491: parked-recurring - matches --accent, read directly by JS inline
     styles (e.g. the avatar pip) the same way --red/--amber/--green/--grey are. */
  --scheduled: #0071e3;
}
:root[data-theme="dark"] {
    --red:   #ff453a;
    --amber: #ff9f0a;
    --green: #30d158;
    --grey:  #636366;
    --scheduled: #5b8de8;
}

/* ── .av — standalone team avatar chip (proj-team context, set by JS) ── */
.av {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  position: relative;
  flex-shrink: 0;
}

/* ── Reverse mentoring card classes ── */
.rev-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.rev-from {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.rev-av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}
.rev-msg {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  font-style: italic;
}
.rev-actions {
  display: flex;
  gap: 6px;
}
.rev-gotit {
  padding: 5px 13px;
  background: var(--done);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.rev-dismiss {
  padding: 5px 10px;
  background: var(--bg);
  color: var(--muted);
  border: none;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
}

/* ── New-project step-4 summary rows (actual class names from JS) ── */
.np-summary-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.np-summary-row:last-of-type { border-bottom: none; }
.np-summary-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  width: 80px;
  flex-shrink: 0;
  padding-top: 1px;
}
.np-summary-val {
  font-size: 13px;
  color: var(--text);
  flex: 1;
  line-height: 1.5;
}

/* ── New-project reassurance note (step 4; single CTA lives in .np-footer) ── */
.np-start-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
}

/* ── cat-label — section label in assign-job / add-emp modal ── */
.cat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 12px 0 4px;
}

/* ── locked-tile — greyed-out not-hired emp tile ── */
.emp-tile.locked-tile {
  opacity: .55;
  cursor: not-allowed;
}
.emp-tile.locked-tile:hover {
  border-color: var(--line);
  background: var(--bg);
}

/* ── et-lock — 🔒 icon inside locked emp tile ── */
.et-lock {
  font-size: 11px;
  color: var(--muted);
}

/* ── assign-job modal: search + scrollable list ── */
#assign-job-modal .modal-card {
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}
#assign-job-modal .modal-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.aj-search-wrap {
  padding: 12px 22px 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.aj-search {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  border-radius: 8px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .15s;
}
.aj-search::placeholder { color: var(--muted); }
.aj-search:focus { border-color: var(--accent); }
.aj-list-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 4px 22px 16px;
}
.aj-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 14px 0;
}
.aj-shared-label { margin-top: 14px; }

/* #521 R9: hire-missing prompt in the new-project team step */
.np-hire-note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 6px; }
.emp-tile.locked-tile.hireable { opacity: 1; cursor: pointer; border-style: dashed; }
.emp-tile.locked-tile.hireable:hover { border-color: var(--accent); background: var(--accent-soft); }
.emp-tile.locked-tile.hireable .et-av { opacity: .7; }
.et-hire { font-size: 11px; font-weight: 700; color: var(--accent); }

/* ── gs-step pill shape refinements ── */
.gs-step { font-size: 12px; }
.gs-step.current { padding: 4px 12px; border-radius: 12px; }

/* ── hub-tabs height consistency + avatar-btn right-alignment ── */
.hub-tabs { height: 44px; }
.hub-tab  { height: 44px; }
.nav-right { height: 44px; display: flex; align-items: center; }
.avatar-btn { margin-left: 8px; }

/* ════════════════ Issue #744 — Hub cobranding ════════════════ */
/* Company brand lockup at the far left of the top nav (before the tabs).
   Sits in the Electron drag region; interactive children opt out. */
.hub-brand { display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 4px 0 14px; flex-shrink: 0; -webkit-app-region: drag; }
.hub-brand[hidden] { display: none; }
.hub-brand-logo { width: 22px; height: 22px; border-radius: 6px; display: block; flex-shrink: 0; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.hub-brand-logo img, .hub-brand-logo svg { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 6px; }
/* R1.6: a normal name shows in full; a very long one caps and ellipsizes so it
   never wraps or pushes the tabs off-screen. */
.hub-brand-name { font-size: 14px; font-weight: 650; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.hub-brand-divider { width: 1px; height: 20px; background: var(--line); margin: 0 6px 0 14px; flex-shrink: 0; }
.hub-brand-divider[hidden] { display: none; }
/* FRAIM co-mark on the right, before the avatar (co-branding, not white-label). */
.hub-cobrand { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin: 0 10px 0 0; white-space: nowrap; -webkit-app-region: no-drag; }
.hub-cobrand[hidden] { display: none; }
.hub-cobrand-mark { width: 17px; height: 17px; border-radius: 5px; display: block; }
.hub-cobrand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 5px; }
/* Tablet-width navs cannot hold the company lockup, tabs, search, co-mark, and
   account control together. Keep the functional controls and shed the co-mark. */
@media (max-width: 820px) {
  .hub-cobrand { display: none; }
}
/* Very narrow windows (the Hub is desktop/Electron-first, but keep the dense nav
   from forcing horizontal page scroll): drop the co-mark and the company name,
   keeping the company logo mark + tabs. */
@media (max-width: 560px) {
  .hub-brand-name { display: none; }
  .hub-brand { padding: 0 2px 0 10px; }
  .hub-brand-divider { margin: 0 4px 0 8px; }
  .hub-tab { padding: 10px 12px; }
  /* #1379: the badge's own text ("Updates available") is exactly what forced the same
     horizontal-scroll problem this block already exists to prevent - measured at 375px:
     95px of overflow with the badge shown, none without it. Same treatment as the
     co-mark above: the update is still reachable via #avatar-btn -> #am-update at this
     width, just not duplicated in the top bar where there's no room for it. */
  .hub-update-badge { display: none; }
}

/* Brand editor (Company tab → Brand accordion). */
.brand-editor { padding: 4px 2px 2px; }
.brand-field { margin: 0 0 16px; }
.brand-field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.brand-field .brand-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.brand-field .brand-hint.warn { color: var(--warn); }
.brand-logo-drop { display: flex; align-items: center; gap: 14px; border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 12px; padding: 14px; background: var(--accent-soft); cursor: pointer; }
.brand-logo-drop:focus-visible, .brand-swatch:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.brand-logo-drop .blp { width: 44px; height: 44px; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); flex-shrink: 0; overflow: hidden; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.brand-logo-drop .blp svg, .brand-logo-drop .blp img { width: 100%; height: 100%; object-fit: contain; }
.brand-logo-drop .blp-txt { font-size: 12.5px; color: var(--text); }
.brand-swatch-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.brand-swatch { width: 34px; height: 34px; border-radius: 9px; cursor: pointer; box-shadow: 0 0 0 1px var(--line); border: none; padding: 0; }
.brand-swatch.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.brand-color-hex { width: 96px; }
.brand-editor-actions { display: flex; gap: 10px; margin-top: 6px; align-items: center; }
[data-theme="dark"] .brand-editor-actions .send-button { color: var(--bg); }
.brand-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 14px; }
.brand-preview-cap { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--line); }

/* ── New-project: folder picker row ── */
.np-folder-row { display:flex; gap:8px; }
.np-folder-row input { flex:1; }
.np-browse-btn { padding:9px 16px; background:var(--accent-strong); color:var(--bg); border:none; border-radius:9px; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; flex-shrink:0; }
.np-browse-btn:hover { opacity:.85; }
.np-browse-btn:focus, .np-browse-btn:focus-visible { outline:2px solid var(--accent-strong); outline-offset:2px; }
.np-field-hint { font-size:11px; color:var(--muted); margin-top:5px; line-height:1.5; }

@media (max-width: 520px) {
  .np-wrap {
    margin: 12px auto;
    padding: 0 12px 28px;
  }
  .np-hdr {
    padding: 18px 22px 14px;
  }
  .np-body {
    padding: 16px 22px;
    gap: 12px;
  }
  .np-field textarea {
    height: 62px;
  }
  #np-rules {
    height: 82px;
  }
}

/* ── #512 R7: docx re-upload panel ── */
.rc-docx-upload { margin-top:10px; padding:12px 14px; background:var(--accent-soft); border:1px solid rgba(0,113,227,.2); border-radius:10px; display:flex; flex-direction:column; gap:10px; }
.rdu-label { font-size:12px; color:var(--muted); line-height:1.5; }
.rdu-file-label { display:flex; align-items:center; gap:10px; cursor:pointer; }
.rdu-choose-btn { padding:6px 14px; background:var(--surface); border:1px solid var(--line); border-radius:8px; font-size:12px; font-weight:600; color:var(--text); white-space:nowrap; }
.rdu-filename { font-size:12px; color:var(--muted); flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rdu-extract-btn { align-self:flex-end; padding:7px 16px; background:var(--accent); color:#fff; border:none; border-radius:8px; font-size:12px; font-weight:600; cursor:pointer; }
.rdu-extract-btn:disabled { opacity:.5; cursor:default; }

/* ── Issue #671: Kanban Visualization ── */
.kb-view-toggle { display:flex; gap:2px; margin-bottom:16px; }
.kb-vtab { padding:6px 14px; font-size:12px; font-weight:600; color:var(--muted); background:var(--bg); border:1px solid var(--line); border-radius:8px; cursor:pointer; }
.kb-vtab.on { background:var(--surface); color:var(--text); box-shadow:0 1px 3px rgba(0,0,0,.06); }
.kb-vtab:hover:not(.on) { color:var(--text); }

#proj-kanban { padding:0 24px 32px; overflow-x:auto; }
.kb-stats { font-size:12px; color:var(--muted); padding:0 0 14px; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.kb-stats-waiting { color:var(--state-waiting); font-weight:600; }
.kb-stats-running { color:var(--state-working); font-weight:600; }
.kb-stats-blocked { color:var(--warn); font-weight:600; }
.kb-stats-sep { color:var(--muted); }

.kb-board { display:flex; gap:12px; align-items:flex-start; min-width:max-content; }
.kb-col { background:var(--bg); border:1px solid var(--line); border-radius:12px; padding:12px; width:260px; flex-shrink:0; }
.kb-col.kb-col--empty { display:none; }
.kb-col-header { display:flex; align-items:center; gap:6px; margin-bottom:10px; }
.kb-col-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); flex:1; }
.kb-col-count { font-size:11px; font-weight:700; color:var(--muted); background:var(--soft); padding:1px 7px; border-radius:8px; }
.kb-done-filter { font-size:11px; color:var(--muted); background:transparent; border:none; cursor:pointer; padding:1px 2px; }
.kb-cards { display:flex; flex-direction:column; gap:8px; }

.kb-card { background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:12px 13px; box-shadow:var(--shadow); }
.kb-job { font-size:13px; font-weight:600; color:var(--text); margin-bottom:8px; }
.kb-meta { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:6px; }
.kb-proj-chip { font-size:10px; font-weight:700; color:var(--accent); background:var(--accent-soft); padding:2px 7px; border-radius:6px; }
.kb-badge { font-size:10px; font-weight:700; padding:2px 7px; border-radius:5px; }
.kb-waiting { color:var(--state-waiting); background:transparent; border:1px solid currentColor; }
.kb-stopped { color:var(--warn); background:var(--warn-soft); }
/* Issue #1491: parked-recurring Kanban card badge - reuses the accent color. */
.kb-scheduled { color:var(--accent); background:var(--accent-soft); }
.kb-av-row { margin-left:auto; display:flex; gap:4px; }
.kb-age { font-size:11px; color:var(--muted); margin-bottom:8px; }
.kb-actions { display:flex; gap:6px; flex-wrap:wrap; }
.kb-chip { font-size:11px; font-weight:600; color:var(--muted); background:var(--bg); border:1px solid var(--line); border-radius:6px; padding:3px 9px; cursor:pointer; }
.kb-chip:hover { border-color:var(--accent); color:var(--accent); }
.kb-chip--accent { color:var(--accent); background:var(--accent-soft); border-color:rgba(0,113,227,.25); }
.kb-chip--accent:hover { background:var(--accent); color:#fff; }
.kb-grid { display:flex; flex-wrap:wrap; gap:12px; padding:12px 24px 32px; }
.kb-grid .kb-card { width:260px; flex-shrink:0; }
.kb-empty-state { font-size:13px; color:var(--muted); padding:32px 24px; }

/* ── #512 R7: 'Done reviewing' button (replaces upload panel) ── */

/* ── Issue #538: Hire a human manager ─────────────────────────────────── */
.hm-roster-action {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 5px;
  font-size: 12px; font-weight: 600; color: var(--accent);
  background: none; border: none; cursor: pointer; padding: 0; text-align: left;
}
.hm-roster-action:hover { text-decoration: underline; }
.hm-section-cta {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.hm-section-cta .hm-ic { font-size: 24px; }
.hm-section-cta .hm-copy { flex: 1; }
.hm-section-cta .hm-copy strong { display: block; font-size: 14px; color: var(--text); }
.hm-section-cta .hm-copy small { font-size: 12px; color: var(--muted); }
.hm-fieldrow { display: flex; gap: 10px; }
.hm-fieldrow .hm-field { flex: 1; }
.hm-field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.hm-field select, .hm-field input, .hm-field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
  font: inherit; font-size: 13px; background: var(--bg); color: var(--text);
}
.hm-field textarea { resize: vertical; min-height: 60px; }
.hm-field select:focus, .hm-field input:focus, .hm-field textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.hm-query { display: flex; align-items: flex-start; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.hm-query code { flex: 1; font-family: ui-monospace, "SF Mono", "JetBrains Mono", monospace; font-size: 12px; line-height: 1.55; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.hm-copy-btn { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--accent); background: none; border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; cursor: pointer; }
.hm-copy-btn:hover { border-color: var(--accent); }
.hm-qualities { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 0; }
.hm-quality { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--text); }
.hm-quality .hm-check { flex-shrink: 0; width: 18px; height: 18px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-size: 11px; font-weight: 700; margin-top: 1px; }
.hm-quality small { display: block; color: var(--muted); font-size: 12px; }
.hm-jd > summary { list-style: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 7px; }
.hm-jd > summary::-webkit-details-marker { display: none; }
.hm-jd[open] > summary .hm-chev { transform: rotate(90deg); }
.hm-jd .hm-chev { font-size: 10px; transition: transform .15s; }
.hm-jd-body { margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); padding: 14px 16px; font-size: 13px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.hm-providers-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.hm-providers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hm-provider { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; text-decoration: none; color: var(--text); transition: border-color .15s, background .15s; }
.hm-provider:hover { border-color: var(--accent); background: var(--accent-soft); }
.hm-provider .hm-logo { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #fff; }
.hm-provider strong { font-size: 13px; }
.hm-provider small { font-size: 11px; color: var(--muted); }
.hm-logo.linkedin { background: #0a66c2; }
.hm-logo.indeed { background: #2557a7; }
.hm-logo.seekout { background: #6b3df0; }
.hm-foot { font-size: 11px; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--line); padding-top: 10px; }
@media (max-width: 520px) {
  .hm-fieldrow { flex-direction: column; }
  .hm-fieldrow .hm-field { max-width: none !important; }
}
/* ── #539/#1657: composer catalog rows ── */
/* Manager-reported (2026-09-14): "cannot scroll down the job list, and when
   I do the left nav disappears." Root cause: a prior same-day cleanup pass
   deleted these three rules as presumed dead leftovers of the retired
   command-palette modal, without checking that the CURRENT composer's
   #cp-results/.cp-section/.cp-section-label/.cp-job-chip elements (see
   index.html) still use those exact class names - the row/section markup
   was carried over from the old palette verbatim, so the class names look
   like old-palette-only artifacts but are not. Without .cp-results-scroll's
   flex/overflow, #cp-results (the actual scrollable region inside
   .composer-suggestions's fixed max-height box) had no scroll behavior at
   all, so wheel-scrolling over a long catalog list did nothing locally and
   chained up to scroll the whole page instead - moving #tree-sidebar out of
   its own viewport-locked position along with it. */
.cp-results-scroll { flex:1; overflow-y:auto; min-height:0; }
.cp-section { padding:6px 0; }
.cp-section-label { font-size:10px; font-weight:700; letter-spacing:.08em; color:var(--muted); padding:4px 16px 2px; text-transform:uppercase; }
.cp-job-chip { font-size:11px; font-weight:700; color:var(--accent,#0071e3); background:var(--accent-soft,rgba(0,113,227,.08)); border-radius:5px; padding:2px 8px; align-self:flex-start; }
.cp-row { display:flex; align-items:center; gap:10px; padding:9px 16px; cursor:pointer; border:none; background:transparent; width:100%; text-align:left; color:var(--text); font-size:13px; }
.cp-row:hover, .cp-row--highlighted { background:var(--accent-soft,rgba(0,113,227,.08)); }
.cp-row-select { display:flex; align-items:center; gap:10px; flex:1; min-width:0; padding:0; border:0; background:transparent; color:inherit; font:inherit; text-align:left; }
.cp-row-select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
#coach-text::placeholder { color:var(--muted); opacity:1; }
.cp-row:hover .cp-row-sub, .cp-row--highlighted .cp-row-sub { color:var(--text); }
.cp-row-icon { font-size:15px; flex-shrink:0; }
.cp-row-body { flex:1; min-width:0; }
/* #1340: block-level so overflow/ellipsis actually applies (a plain inline span never
   establishes its own overflow box, so a long title/description used to run on past the
   row and visually collide with whatever came after it, including the new viz control
   below). .tjd-mimic-row already carried this same fix locally; this closes the gap for
   the default row too. */
.cp-row-title { display:block; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cp-row-sub { display:block; font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px; }
.cp-row-tag { font-size:10px; color:var(--muted); background:var(--bg); border:1px solid var(--line); border-radius:4px; padding:1px 5px; flex-shrink:0; }
.cp-employee-footer { font-size:11px; color:var(--muted); padding:5px 14px 8px; }
.cp-rerun-toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:10px 18px; font-size:13px; color:var(--text); box-shadow:0 4px 16px rgba(0,0,0,.16); z-index:var(--z-dropdown-menu); pointer-events:none; white-space:nowrap; }

/* ── Issue #540: Company roster + Manager team ─────────────────────────── */
.company-hire-bar { display:flex; align-items:center; gap:8px; padding:9px 0 11px; flex-wrap:wrap; }
.chb-count { font-size:14px; font-weight:700; color:var(--text); }
.chb-label { font-size:13px; color:var(--sub); }
.chb-progress { flex:1; min-width:80px; height:5px; background:var(--line); border-radius:3px; overflow:hidden; }
.chb-progress-fill { height:100%; background:var(--accent,#0071e3); border-radius:3px; transition:width .3s; }
.persona-roster-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; padding:4px 0 16px; }
.persona-roster-tile { display:flex; flex-direction:column; align-items:center; gap:6px; padding:14px 10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface); cursor:default; transition:border-color .15s,background .15s; }
.persona-roster-tile.prt-hired { border-color:var(--accent,#0071e3); background:var(--accent-soft,rgba(0,113,227,.06)); }
.persona-roster-tile:not(.prt-hired):hover { border-color:var(--accent,#0071e3); background:var(--accent-soft,rgba(0,113,227,.04)); }
.prt-av { width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:800; color:#fff; }
.prt-name { font-size:13px; font-weight:700; color:var(--text); text-align:center; }
.prt-role { font-size:11px; color:var(--sub); text-align:center; line-height:1.3; }
.prt-hired-badge { font-size:10px; font-weight:700; color:var(--accent,#0071e3); background:var(--accent-soft,rgba(0,113,227,.1)); border-radius:5px; padding:2px 8px; margin-top:2px; }
.prt-hire-btn { font-size:11px; font-weight:700; color:#fff; background:var(--accent,#0071e3); border:none; border-radius:6px; padding:4px 12px; cursor:pointer; margin-top:2px; }
.prt-hire-btn:hover { background:var(--accent-hover,#005bbf); }
.prt-price { font-size:10px; color:var(--sub); margin-top:1px; }
.manager-no-team-msg { font-size:13px; color:var(--sub); margin:0 0 10px; }
.manager-go-company-btn { font-size:12px; font-weight:600; color:var(--accent,#0071e3); background:var(--accent-soft,rgba(0,113,227,.08)); border:1px solid var(--accent,#0071e3); border-radius:6px; padding:5px 13px; cursor:pointer; }
.manager-go-company-btn:hover { background:var(--accent-soft,rgba(0,113,227,.15)); }
:root[data-theme="dark"] .manager-no-team-msg,
:root[data-theme="dark"] .learn-empty,
:root[data-theme="dark"] .le-count {
  color: var(--text);
  background: #2a2a2a;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
}
:root[data-theme="dark"] .le-sub,
:root[data-theme="dark"] .manager-no-team-msg {
  color: var(--muted);
}
:root[data-theme="dark"] .manager-go-company-btn {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
:root[data-theme="dark"] .manager-go-company-btn:hover {
  background: var(--accent-strong);
}

/* ── Issue #540: AI Hub hiring surfaces ── */

/* Status dots (green=available, amber=out-of-stock, grey=none) */
.sdot { display:inline-block; width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.sdot--green { background:#34c759; }
.sdot--amber { background:#ff9f0a; }
.sdot--grey  { background:var(--line); border:1px solid var(--muted); }

/* Persona grid — Company tab */
.persona-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:12px; margin-top:8px; }
/* #538 UI-polish (538-UIPV-P1): allow the hire button to wrap to its own full-width
   row so the avatar + name/role take the full first row; otherwise the nowrap button
   squeezed .persona-card-info to ~31px and clipped every name/role to "M…". */
.persona-card { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:12px 14px; background:var(--surface); border:1px solid var(--line); border-radius:12px; position:relative; }
.persona-card-info { flex:1; min-width:0; }
.persona-card .btn-hire-primary { flex-basis:100%; margin-top:8px; }
.persona-card-info strong { display:block; font-size:13px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.persona-card-role { display:block; font-size:11px; color:var(--muted); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.seat-badge { display:block; font-size:10px; color:var(--muted); margin-top:3px; }
.btn-hire-primary { padding:5px 12px; background:var(--accent); color:#fff; border:none; border-radius:8px; font-size:11px; font-weight:600; cursor:pointer; white-space:nowrap; flex-shrink:0; text-decoration:none; }
.btn-hire-primary:hover { opacity:.85; }

/* Manager team pool — Manager tab */
.manager-team-pool { display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.team-row { display:flex; align-items:center; gap:10px; padding:10px 14px; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
.btn-add-seat { padding:5px 12px; background:var(--accent); color:#fff; border:none; border-radius:8px; font-size:11px; font-weight:600; cursor:pointer; white-space:nowrap; flex-shrink:0; }
.btn-add-seat:hover { opacity:.85; }
.btn-add-seat:disabled { opacity:.5; cursor:default; }
.btn-hired-check { font-size:12px; color:var(--done); font-weight:600; }

/* Delegate button on roster chips */
.delegate-btn { padding:3px 9px; background:var(--accent-soft); color:var(--accent); border:1px solid rgba(0,113,227,.2); border-radius:6px; font-size:11px; font-weight:600; cursor:pointer; white-space:nowrap; flex-shrink:0; margin-left:auto; }
.delegate-btn:hover { background:var(--accent); color:#fff; }

/* Non-blocking hire strip (between #messages and send bar) */
.hire-strip { display:flex; align-items:center; gap:12px; padding:12px 16px; background:var(--surface); border-top:1px solid var(--line); border-bottom:1px solid var(--line); flex-shrink:0; }
.hire-strip[hidden] { display:none; }
.hs-avatar { flex-shrink:0; width:36px; height:36px; }
.hs-body { flex:1; min-width:0; }
.hs-title { margin:0; font-size:13px; font-weight:600; color:var(--text); }
.hs-sub { margin:2px 0 0; font-size:11px; color:var(--muted); line-height:1.4; }
.hs-actions { display:flex; gap:8px; align-items:center; flex-shrink:0; }
.hs-btn { padding:6px 14px; border-radius:8px; font-size:12px; font-weight:600; cursor:pointer; white-space:nowrap; text-decoration:none; border:none; }
.hs-btn[hidden] { display:none; }
.hs-btn--primary { background:var(--accent); color:#fff; }
.hs-btn--primary:hover { opacity:.85; }
.hs-btn--ghost { background:transparent; color:var(--muted); border:1px solid var(--line); }
.hs-btn--ghost:hover { color:var(--text); border-color:var(--text); }

/* ── Issue #578: Scheduled + Reactive Employees ── */

/* sourceTrigger chip on run rail items */
.trigger-badge { display:inline-block; padding:1px 6px; border-radius:4px; font-size:10px; font-weight:600; letter-spacing:.02em; flex-shrink:0; }
/* Issue #1572: color was hardcoded #0071e3 - 4.02:1 against its own tint
   background, below the 4.5:1 WCAG AA threshold. Reuses --accent-strong
   (the existing darker-accent token) instead of a new one-off hex. */
.trigger-badge--scheduled { background:rgba(0,122,255,.12); color:var(--accent-strong); }
.trigger-badge--webhook   { background:rgba(88,86,214,.12); color:#5856d6; }

/* Deployment roster accordion */
#proj-deployments-acc { margin-top:0; }
.dep-actions { display:flex; gap:8px; margin-top:8px; }
.dep-add-btn { padding:4px 12px; background:var(--accent-soft,rgba(0,113,227,.08)); color:var(--accent,#0071e3); border:1px solid rgba(0,113,227,.2); border-radius:8px; font-size:12px; font-weight:600; cursor:pointer; }
.dep-add-btn:hover { background:var(--accent,#0071e3); color:#fff; }

/* Deployment / assignment detail rows (#693: grouped rows replace flat cards) */
.dep-detail { width:100%; font-size:11px; color:var(--muted,#888); margin-left:20px; }
.dep-detail--url { display:flex; align-items:center; gap:6px; }
.dep-inbound-url { font-size:11px; word-break:break-all; color:var(--muted,#888); flex:1; }
.dep-inbound-url--inline { display:inline; font-size:11px; }
/* Assignment modals — redesigned */
.dep-modal-card { max-width:540px; }
.dep-modal-card .modal-hdr p { font-size:12px; color:var(--muted,#888); margin:3px 0 0; font-weight:400; }
.dep-optional { font-weight:400; font-size:11px; color:var(--muted,#888); }
.dep-preset-chips { display:flex; gap:8px; flex-wrap:wrap; margin-top:2px; }
.dep-preset-chip { padding:6px 18px; border-radius:20px; font-size:13px; font-weight:500; border:1.5px solid var(--line,#e5e5e5); background:var(--bg,#f5f5f7); color:var(--muted,#888); cursor:pointer; transition:border-color .12s, color .12s, background .12s; }
.dep-preset-chip:hover { border-color:var(--accent,#0071e3); color:var(--accent,#0071e3); }
.dep-preset-chip.active { background:var(--accent,#0071e3); border-color:var(--accent,#0071e3); color:#fff; }
.dep-wh-inbound-reveal { margin-top:16px; padding-top:16px; border-top:1px solid var(--line,#e5e5e5); }
.dep-wh-inbound-header { margin-bottom:8px; }
.dep-wh-inbound-label { font-size:12px; font-weight:600; color:var(--text,#1d1d1f); display:block; }
.dep-wh-inbound-hint { font-size:11px; color:var(--muted,#888); display:block; margin-top:2px; }
.dep-edit-btn { padding:2px 8px; background:transparent; border:1px solid var(--line,#e5e5e5); border-radius:6px; font-size:11px; color:var(--muted,#888); cursor:pointer; }
.dep-edit-btn:hover { border-color:var(--accent,#0071e3); color:var(--accent,#0071e3); }
.dep-del-btn { padding:2px 8px; background:transparent; border:1px solid var(--line,#e5e5e5); border-radius:6px; font-size:11px; color:var(--muted,#888); cursor:pointer; }
.dep-del-btn:hover { border-color:#ff3b30; color:#ff3b30; }
.dep-empty { color:var(--muted,#888); font-size:12px; margin:4px 0 8px; line-height:1.5; }
/* #1477 R13: shown next to the (still-visible) prior list while a refresh is in flight. */
.dep-loading { color:var(--muted,#888); font-size:12px; margin:4px 0 8px; line-height:1.5; }
.dep-cron-preview { font-size:11px; color:var(--accent,#0071e3); margin:2px 0 0; }

/* Deployment modals */
.dep-modal-actions { display:flex; gap:8px; margin-top:12px; }
.dep-error { color:#ff3b30; font-size:12px; margin-top:4px; }
.cancel-button { padding:7px 18px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; background:transparent; color:var(--muted,#888); border:1px solid var(--line,#e5e5e5); }
.cancel-button:hover { border-color:var(--text,#1d1d1f); color:var(--text,#1d1d1f); }
.dep-inbound-url-row { display:flex; align-items:center; gap:8px; padding:6px 10px; background:var(--bg,#f5f5f7); border-radius:8px; margin-top:6px; }

/* ==========================================================================
   Issue #693 — Hub look & feel improvements
   ========================================================================== */

/* #693.7 — "+" assign controls: native, optically-centered glyph.
   Was a fixed line-height hack that let the glyph ride high; flex-center it. */
.conv-employee-add {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  font-size: 16px; font-weight: 400; line-height: 1; border-radius: 6px;
}
.emp-hero .eh-add {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  font-size: 16px; font-weight: 400; line-height: 1; border-radius: 6px;
}

/* #693.9 — Job names under employees: single line, not bold, italic, clean.
   Runs list uses .conv-title (was 17px/700, 2-line clamp); tree jobs use .tj-label. */
.conv-title {
  font-size: 13px; font-weight: 400; font-style: italic;
  line-height: 1.4; color: var(--text);
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  -webkit-line-clamp: 1;
}
.conv-time {
  display: block;
  min-width: 0;
  max-width: 100%;
  font-size: 11px;
  font-weight: 500;
  font-style: normal;
  line-height: 1.25;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-item { align-items: center; }
.emp-hero .eh-jobs .tree-job .tj-label,
.tree-runs .tj-label {
  font-style: italic; font-weight: 400; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* #693.8 superseded by #1008: the retired Watercooler icon rules were removed;
   employee-less work now uses the dashed absence avatar above. */

/* #693.6 — DiceBear avatar image for employees in the workspace tree. */
img.eh-av { object-fit: cover; background: var(--surface); }

/* #693.1 superseded by #1008: no Watercooler-specific emp-hero avatar override. */
/* #693.1 — runs rendered under an employee accordion reuse .tree-job; ensure the
   run title stays on one clean italic line (item 9) even as a run row. */
.emp-hero .eh-jobs .tree-run .tj-label { font-style: italic; }

/* #693.1 (PR round 2) — in the workspace tree the employee accordion label is the
   primary content. Reclaim width from tracking + the +/hire buttons so names like
   "AUDITYA" aren't truncated to a couple letters in the ~175px sidebar. */
.tree-runs .conv-employee-tab { gap: 4px; }
.tree-runs .conv-employee-avatar { width: 22px; height: 22px; }
.tree-runs .conv-employee-tab-label { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.tree-runs .conv-employee-add { width: 20px; height: 20px; font-size: 15px; }
.tree-runs .eh-hire-manager { width: 20px; height: 20px; font-size: 11px; line-height: 1; padding: 0; opacity: 1; border-radius: 6px; }

/* #693.4 — Account menu: every row (header, options, footer) shares one grid so
   the header name, all option labels, and Sign out line up on a single left
   edge. First column 30px + 12px gap → labels start at 58px. */
#account-menu .am-header,
#account-menu .am-item,
#account-menu .am-foot {
  display: grid; grid-template-columns: 30px 1fr; column-gap: 12px;
  align-items: center; padding: 10px 16px; margin: 0;
  width: 100%; box-sizing: border-box; text-align: left;
}
#account-menu .am-header { padding: 13px 16px; }
#account-menu .am-item > div { display: flex; flex-direction: column; min-width: 0; }
#account-menu .am-ico { width: 30px; margin: 0; text-align: center; font-size: 16px; line-height: 1; }
#account-menu .am-av { width: 30px; height: 30px; }
#account-menu .am-foot { color: var(--muted); font-weight: 500; cursor: pointer; }
#account-menu .am-foot .am-ico { color: var(--muted); }

/* #693.1 — lifecycle action button placed inside the Brief / Learnings (and
   Company/Manager context/learnings) accordion bodies, where the action's output
   lands. Replaces the retired standalone "Project Updates" section. */
.ctx-acc-action-row { display: flex; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.ctx-acc-action {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 9px; cursor: pointer;
  font-size: 12.5px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(0,113,227,.2);
}
.ctx-acc-action:hover { background: var(--accent); color: #fff; }
.ctx-acc-action .caa-ico { font-size: 14px; line-height: 1; }

/* #693.2 — consolidated New Assignment dialog: segmented Scheduled/Triggered. */
.dep-type-seg { display: inline-flex; background: var(--soft); border-radius: 9px; padding: 3px; gap: 3px; margin-bottom: 14px; }
.dep-type-btn { border: none; background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); padding: 7px 18px; border-radius: 7px; }
.dep-type-btn.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.dep-trig-note { font-size: 12px; color: var(--muted); margin: 0 0 6px; line-height: 1.5; }

/* #693.3 — grouped assignment rows (Runs-style, dedicated class). */
.dep-row {
  box-sizing: border-box; width: 100%; min-width: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--text);
}
.dep-row:hover { background: var(--soft); }
.dep-row-title { font-size: 13px; font-weight: 400; font-style: italic; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Issue #1610 R10: ad-hoc job label and instructions subtitle in assignment rows. */
.dep-row-job-label { display: block; font-size: 11px; font-weight: 600; color: var(--accent); margin-top: 1px; }
.dep-row-sub { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.assign-row-meta { display: flex; gap: 8px; align-items: center; margin-top: 3px; font-size: 11px; color: var(--muted); }
.assign-badge { font-size: 10px; font-weight: 700; letter-spacing: .02em; padding: 1px 7px; border-radius: 999px; }
.assign-badge--scheduled { background: rgba(0,113,227,.10); color: var(--accent); }
.assign-badge--triggered { background: rgba(255,149,0,.14); color: #b96b00; }
.dep-row-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.dep-inbound-sub { display: flex; align-items: center; gap: 8px; width: auto; margin: 0 0 4px 23px; min-width: 0; font-size: 11px; color: var(--muted); }
.dep-inbound-sub .dep-inbound-url--inline { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* #693.5 — command palette AI-agent picker. */
.cp-employee-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.configured-agents-panel {
  display: grid;
  gap: 8px;
  max-width: 100%;
}

.configured-agent-toolbar,
.configured-agent-card-actions,
.configured-agent-form-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.configured-agent-toolbar {
  justify-content: flex-end;
}

.configured-agent-action,
.configured-agent-icon-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
}

.configured-agent-action.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.configured-agent-icon-action.danger {
  color: var(--danger);
}

.configured-agent-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  min-width: 0;
}

.configured-agent-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.configured-agent-field input,
.configured-agent-field select,
.configured-agent-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  padding: 6px 8px;
}

.configured-agent-field textarea {
  resize: vertical;
}

.configured-agent-command-wrap {
  grid-column: 1 / -1;
}

/* Specificity note: `.configured-agent-field textarea` already sets
   `font: inherit` (the shorthand resets font-family too), at specificity
   (0,1,1) — higher than a bare `.configured-agent-command-field` class
   selector (0,1,0), which would silently lose. Scope through the parent
   class so this rule wins. */
.configured-agent-field .configured-agent-command-field {
  font-family: var(--mono, monospace);
  font-size: 12px;
}

.configured-agent-command-hint {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.configured-agent-form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.configured-agent-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
  min-width: 0;
}
:root[data-theme="dark"] .configured-agent-card,
:root[data-theme="dark"] .configured-agent-form,
:root[data-theme="dark"] .learn-card,
:root[data-theme="dark"] .learn-prop,
:root[data-theme="dark"] .team-row,
:root[data-theme="dark"] .persona-card,
:root[data-theme="dark"] .persona-roster-tile {
  background: #2a2a2a;
  border-color: rgba(255,255,255,.12);
}
:root[data-theme="dark"] .configured-agent-action,
:root[data-theme="dark"] .configured-agent-icon-action {
  background: #323232;
  border-color: rgba(255,255,255,.14);
  color: var(--text);
}
:root[data-theme="dark"] .configured-agent-action.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
:root[data-theme="dark"] .configured-agent-status.ok {
  background: rgba(92,184,92,.10);
}
:root[data-theme="dark"] .configured-agent-status.warn {
  background: rgba(212,160,78,.10);
}

.configured-agent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.configured-agent-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.configured-agent-status {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--muted);
}

.configured-agent-status.ok {
  color: var(--done);
  border-color: color-mix(in srgb, var(--done) 28%, var(--line));
}

.configured-agent-status.warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 32%, var(--line));
}

.configured-agent-status.dim {
  color: var(--muted);
}

.configured-agent-meta,
.configured-agent-detail {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Issue #1618 (R4): the per-card install/sign-in row is a continuation of the existing
   card, not a second panel — a dashed top border separates it from Check/Edit/Delete
   above, matching the mock (docs/feature-specs/mocks/1618-view.html). The shared
   .install-row/.install-label/.install-status/button.secondary.small/.ghost.small rules
   above are reused, scoped-overridden only where the card's ~750px width behaves
   differently than the job composer's ~340px standalone panel (PR #1620 feedback):
   `.install-status`'s `flex:1` is designed to fill a narrow panel; at card width an
   empty status span balloons into a large, unstyled-looking blank gap before the
   action button. Capping it to content width and right-aligning the button instead
   (matching the Check/Edit/Delete row's own right-aligned actions) keeps the same
   information, without a wide accidental gap. Only `.configured-agent-install-row`
   is affected; the 3 job-composer mounts keep their original layout unchanged. */
.configured-agent-install-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.configured-agent-install-row .install-status {
  flex: 0 1 auto;
}

.configured-agent-install-row .install-row button:first-of-type {
  margin-left: auto;
}

.configured-agents-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 520px) {
  .configured-agent-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .configured-agent-form {
    grid-template-columns: 1fr;
  }
  .configured-agent-toolbar,
  .configured-agent-form-actions {
    justify-content: stretch;
  }
  .configured-agent-toolbar > *,
  .configured-agent-form-actions > * {
    flex: 1 1 auto;
  }
}
.cp-agent-label { font-size: 12.5px; color: var(--muted); }
.cp-agent-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.cp-agent-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text);
}
.cp-agent-pill.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.cp-agent-pill:disabled { opacity: .45; cursor: not-allowed; }

/* ── Issue #834: per-area storage row ───────────────────────────────────── */
.storage-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.storage-where { flex: 1; font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.storage-note { font-size: 12px; color: var(--muted); }
.chooser-warn {
  margin-top: 10px; padding: 9px 12px; background: var(--state-waiting-soft);
  border-radius: 8px; font-size: 12px; color: var(--state-waiting); font-weight: 600;
}
.chooser-localpath-row { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.chooser-localpath-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.chooser-localpath-input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 11px; font: inherit; font-size: 13px; font-family: monospace;
  background: var(--bg); color: var(--text); box-sizing: border-box;
}
.chooser-localpath-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.chooser-conflict-note {
  padding: 7px 10px; background: var(--state-waiting-soft); border-radius: 7px;
  font-size: 12px; color: var(--state-waiting); font-weight: 600;
}
.storage-change-btn { font-size: 12px; padding: 4px 10px; flex-shrink: 0; }
.syn-card.mb-0 { margin-bottom: 0; }

/* ─── Issue #945: Create Your Own Employee (Design B) ──────────────────────── */

/* + New employee tree node */
.ipe-new {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 14px;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  border-radius: 7px;
  user-select: none;
}
.ipe-new:hover { background: var(--accent-soft); }
.ipe-new-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px dashed var(--accent);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

/* New employee popup — overrides on .modal-card */
.ipe-card { max-width: 480px; }
.ipe-card .modal-hdr { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.ipe-card .modal-hdr h2 { margin:0; }
.ipe-tabs { display:flex; gap:4px; margin:16px 20px 0; padding:4px; background:var(--soft); border-radius:10px; }
.ipe-tabs [role="tab"] { flex:1; padding:8px 12px; border:1px solid transparent; border-radius:7px; background:transparent; color:var(--muted); font-weight:600; }
.ipe-tabs [aria-selected="true"] { background:var(--surface); border-color:var(--line); color:var(--text); }
.ipe-tabs button:focus-visible, .ipe-jobs-summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.ipe-intro { margin:0; color:var(--muted); font-size:13px; line-height:1.5; }
.ipe-card-body[hidden], .ipe-fire-panel[hidden] { display:none; }
.ipe-fire-panel { padding:40px 20px; text-align:center; color:var(--muted); }
.ipe-jobs-summary { cursor:pointer; font-size:13px; font-weight:600; color:var(--text); }
.ipe-job-options { border-top:1px solid var(--line); padding-top:12px; }
.ipe-job-options .muted { font-size:12px; line-height:1.5; }
.ipe-card select { width:100%; padding:9px 10px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--text); font:inherit; font-size:13px; }
.ipe-card select:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.ipe-card-body { display: flex; flex-direction: column; gap: 14px; }
.ipe-card-field { display: flex; flex-direction: column; gap: 4px; }
.ipe-card-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ipe-card input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 11px;
  font: inherit;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
}
.ipe-card input[type="text"]:focus { outline: 2px solid var(--accent); border-color: transparent; }
.ipe-card input::placeholder { color:var(--muted); opacity:1; }
.ipe-card-error { font-size: 11.5px; color: var(--danger); }

/* Source-grouped job picker inside the create card */
/* Searchable job picker inside create-employee modal */
.ipe-jobs-search-wrap { position: relative; margin-bottom: 4px; }
.ipe-jobs-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font-size: 12.5px;
  padding: 5px 10px;
  outline: none;
}
.ipe-jobs-search:focus { border-color: var(--accent); }
.ipe-jobs-search::placeholder { color: var(--muted); }
.ipe-jobs { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.ipe-jobs-src { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 4px 0 2px; }
.ipe-job-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  color: var(--text);
}
.ipe-job-row:hover, .ipe-job-row--selected { background: var(--accent-soft, rgba(0,113,227,.08)); }
.ipe-job-row-check { width: 14px; font-size: 12px; color: var(--accent); flex-shrink: 0; }
.ipe-job-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ipe-jobs-empty { font-size: 12px; color: var(--muted); padding: 6px 8px; }
.ipe-job-src-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

/* Card action row */
.ipe-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ipe-btn-cancel {
  font-size: 12.5px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.ipe-btn-cancel:hover { background: var(--bg); }
.ipe-btn-create {
  font-size: 12.5px;
  padding: 5px 12px;
  border: none;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
.ipe-btn-create:hover { background: var(--accent-strong); }
.ipe-btn-create:disabled { opacity: .45; cursor: not-allowed; }

/* Employee-scoped delegate job picker popover */
.ipe-deleg-pop {
  position: absolute;
  z-index: 200;
  min-width: 280px;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,.12);
  padding: 6px 12px 4px;
  overflow: hidden;
}
.ipe-deleg-pop-hd {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 12px 2px;
}

/* Issue #976: Teach-new-job intake dialog */
.tjd-card { max-width:520px; max-height:calc(100vh - 48px); margin:24px auto; overflow:auto; }
.tjd-hdr { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.tjd-hdr h2 { margin:0; }
.tjd-body { display:flex; flex-direction:column; gap:12px; }
.tjd-form { display:flex; flex-direction:column; gap:10px; min-width:0; }
.tjd-modes { display:flex; gap:8px; }
.tjd-mode { flex:1; min-width:0; padding:12px; border:1px solid var(--line); border-radius:10px; text-align:left; background:var(--surface); color:var(--text); font:inherit; cursor:pointer; }
.tjd-mode[aria-pressed="true"] { border-color:var(--teach); background:var(--teach-soft); color:var(--teach); }
.tjd-mode strong { display:block; font-size:13px; margin-bottom:2px; }
.tjd-mode span { display:block; font-size:11.5px; color:var(--muted); }
.tjd-mode[aria-pressed="true"] span { color:inherit; }
.tjd-mode:focus-visible,
.tjd-mimic summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.tjd-new-fields { display:flex; flex-direction:column; gap:10px; }
.tjd-new-fields[hidden], .tjd-hint[hidden], #tjd-mimic-toggle[hidden] { display:none; }
.tjd-form .hm-field textarea { min-height:80px; }
.tjd-hint { margin:0; font-size:12px; line-height:1.45; color:var(--muted); }
.tjd-field-error,
.tjd-submit-error { color:var(--danger); font-size:12px; line-height:1.35; margin-top:4px; }
.tjd-field-error:empty, .tjd-submit-error:empty { display:none; }
.tjd-submit-error { grid-column:1 / -1; margin-top:0; }
.tjd-label { display:block; font-size:12px; font-weight:600; color:var(--muted); margin-bottom:5px; }
.tjd-search { width:100%; border:1px solid var(--line); border-radius:9px; padding:9px 12px; font:inherit; font-size:13px; background:var(--bg); color:var(--text); }
.tjd-search:focus { outline:2px solid var(--accent); border-color:transparent; }
.tjd-card input::placeholder, .tjd-card textarea::placeholder { color:var(--muted); opacity:1; }
.tjd-mimic { min-width:0; border:1px solid var(--line); border-radius:10px; background:var(--surface); overflow:hidden; }
.tjd-mimic summary { padding:10px 12px; font-size:12px; font-weight:600; cursor:pointer; }
.tjd-mimic-head { padding:12px; border-bottom:1px solid var(--line); background:var(--surface); }
.tjd-mimic-results { overflow-y:auto; overflow-x:hidden; min-height:0; max-height:156px; padding:5px 0; }
.tjd-mimic-row { display:flex; align-items:flex-start; gap:10px; padding:9px 12px; cursor:pointer; border:0; background:transparent; width:100%; max-width:100%; min-width:0; overflow:hidden; text-align:left; color:var(--text); font-size:13px; }
.tjd-mimic-row:hover,
.tjd-mimic-row.selected { background:var(--accent-soft,rgba(0,113,227,.08)); }
.tjd-mimic-row:hover .cp-row-sub, .tjd-mimic-row.selected .cp-row-sub { color:var(--text); }
.tjd-mimic-row .cp-row-body { display:flex; flex:1 1 auto; flex-direction:column; gap:2px; min-width:0; overflow:hidden; }
.tjd-mimic-row .cp-row-title,
.tjd-mimic-row .cp-row-sub { display:block; max-width:100%; white-space:normal; overflow:hidden; text-overflow:ellipsis; overflow-wrap:anywhere; }
.tjd-mimic-row .cp-row-title { line-height:1.25; }
.tjd-mimic-row .cp-row-sub { line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.tjd-mimic-row .cp-row-tag { max-width:72px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:1px; }
.tjd-mimic-empty { padding:16px 12px; color:var(--muted); font-size:12px; }
.tjd-selected-mimic { margin:10px 12px 4px; display:flex; align-items:flex-start; gap:8px; border:1px solid color-mix(in srgb,var(--accent) 42%,var(--line) 58%); background:var(--accent-soft,rgba(0,113,227,.08)); border-radius:8px; padding:8px 10px; font-size:12px; color:var(--text); }
.tjd-selected-mimic[hidden] { display:none; }
.tjd-selected-mimic span { min-width:0; flex:1; }
.tjd-selected-mimic button { border:0; background:transparent; color:var(--accent-strong); font-weight:700; cursor:pointer; padding:0; }
.tjd-actions { grid-column:1 / -1; display:flex; justify-content:flex-end; gap:10px; }
.tjd-secondary { border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:8px; padding:9px 14px; font-weight:700; cursor:pointer; }
.tjd-secondary:hover { border-color:var(--accent); }

@media (max-width: 760px) {
  .tjd-card { width:calc(100vw - 24px); margin:18px auto; max-height:calc(100vh - 36px); overflow:auto; }
  .tjd-body { padding:16px; }
  .tjd-actions { position:sticky; bottom:0; background:var(--surface); padding-top:10px; }
}
/* ─── End Issue #945 ─────────────────────────────────────────────────────── */

/* ─── Issue #1065: conversation search ───────────────────────────────────────
   New chrome is confined to the `srch-`/`conv-find` prefixes plus the single
   container class `.hub-search`. Deliberately NOT the `hs-` prefix: that belongs
   to the hire strip (.hs-avatar/.hs-title/.hs-sub/.hs-btn), so reusing it would
   restyle #hire-strip. Colour comes only from existing tokens so both themes work.
   R47: every control here is at least 24x24 and shows a keyboard focus ring.
   ───────────────────────────────────────────────────────────────────────────── */

.hub-search { display:flex; align-items:center; gap:7px; margin-left:auto; margin-right:10px;
              background:var(--bg); border:1px solid var(--line); border-radius:8px;
              padding:3px 8px; min-width:240px; max-width:420px; flex:0 1 380px; }
.hub-search:focus-within { border-color:var(--accent); }
.srch-icon { color:var(--muted); font-size:14px; flex-shrink:0; }
.srch-scope { font-size:11px; font-weight:600; color:var(--accent); background:var(--accent-soft,rgba(0,113,227,.08));
              border-radius:5px; padding:2px 7px; white-space:nowrap; flex-shrink:0; }
.hub-search input { flex:1; min-width:0; border:none; background:none; font:inherit; font-size:13px;
                    color:var(--text); padding:5px 0; }
.hub-search input:focus { outline:none; }
.srch-kbd { font-size:10px; color:var(--muted); border:1px solid var(--line); border-radius:4px;
            padding:1px 5px; white-space:nowrap; flex-shrink:0; }
.srch-kbd[hidden], .srch-clear[hidden], .srch-back[hidden] { display:none; }
/* R47: 24x24 minimum. The mock's first draft was 14x15px and only measurement caught it. */
.srch-clear { border:none; background:none; color:var(--muted); cursor:pointer; font-size:16px;
              line-height:1; flex-shrink:0; min-width:24px; min-height:24px; border-radius:6px;
              display:flex; align-items:center; justify-content:center; }
.srch-clear:hover { color:var(--text); }
.srch-back { border:1px solid var(--line); background:var(--surface); color:var(--accent); cursor:pointer;
             font:inherit; font-size:11px; font-weight:600; flex-shrink:0; white-space:nowrap;
             min-height:24px; padding:0 8px; border-radius:6px; }
.srch-back:hover { border-color:var(--accent); }
.srch-clear:focus-visible, .srch-back:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }

/* Results panel: fills the area's main panel while a search is active. */
.srch-panel { flex:1; min-height:0; overflow-y:auto; background:var(--bg); }
.srch-panel[hidden] { display:none; }
/* styles.css sets `.workspace-conv > .page { display:flex !important }`, which beats the `hidden`
   attribute, so hiding the conversation panel needs an explicit override. */
.workspace-conv > .page[hidden] { display:none !important; }
.srch-inner { max-width:860px; margin:0 auto; padding:20px 24px 40px; }
.srch-head { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; margin-bottom:4px; }
.srch-count { font-size:15px; font-weight:700; }
.srch-sub { font-size:12px; color:var(--muted); }
.srch-widen { border:1px solid transparent; background:none; color:var(--accent); font:inherit; font-size:12px;
              font-weight:600; cursor:pointer; margin-left:auto; min-height:24px; padding:0 6px; border-radius:6px; }
.srch-widen:hover { text-decoration:underline; }
/* R47: this is a borderless text button, so it has no resting affordance to thicken on focus.
   Ring on plain :focus as well as :focus-visible — :focus-visible alone is a UA heuristic and the
   control is left with no observable focus indicator whenever the heuristic declines. */
.srch-widen:focus, .srch-widen:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.srch-group-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
                    color:var(--muted); margin:20px 0 8px; display:flex; align-items:center; gap:8px; }
.srch-group-label .sgl-count { font-weight:600; letter-spacing:0; text-transform:none; }
.srch-row { display:block; width:100%; text-align:left; background:var(--surface);
            border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin-bottom:8px;
            cursor:pointer; font:inherit; color:var(--text); }
.srch-row:hover { box-shadow:0 3px 12px rgba(0,0,0,.08); }
.srch-row:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.srch-row-top { display:flex; align-items:center; gap:8px; }
.srch-av { width:22px; height:22px; border-radius:50%; color:#fff; font-size:9px; font-weight:700;
           display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.srch-row-title { font-size:13px; font-weight:600; overflow:hidden; text-overflow:ellipsis;
                  white-space:nowrap; min-width:0; }
.srch-row-spacer { flex:1; }
.srch-tag { font-size:10px; color:var(--muted); background:var(--bg); border:1px solid var(--line);
            border-radius:5px; padding:1px 6px; white-space:nowrap; flex-shrink:0; }
.srch-time { font-size:11px; color:var(--muted); white-space:nowrap; flex-shrink:0; }
.srch-row-meta { font-size:11px; color:var(--muted); margin:3px 0 0 30px; }
.srch-snip { font-size:12px; line-height:1.55; color:var(--muted); margin:7px 0 0 30px;
             padding-left:9px; border-left:2px solid var(--line); }
.srch-snip + .srch-snip { margin-top:4px; }
.srch-snip .who { color:var(--text); font-weight:600; }
.srch-panel mark { background:rgba(255,213,0,.38); color:inherit; border-radius:2px; padding:0 1px; }
.srch-more { font-size:11px; color:var(--accent); margin:6px 0 0 30px; font-weight:600; }
.srch-trunc { font-size:11px; color:var(--muted); margin:4px 0 0 30px; }
.srch-empty { text-align:center; padding:46px 20px; }
.srch-empty-ico { font-size:28px; }
.srch-empty-title { font-size:15px; font-weight:700; margin:10px 0 4px; }
.srch-empty-msg { font-size:13px; color:var(--muted); max-width:440px; margin:0 auto 16px; line-height:1.6; }
.srch-empty-btn { background:var(--accent); color:#fff; border:none; border-radius:8px;
                  padding:8px 16px; font:inherit; font-size:13px; font-weight:600; cursor:pointer; min-height:24px; }
.srch-empty-btn:focus-visible { outline:2px solid var(--text); outline-offset:2px; }
.srch-tips { font-size:11px; color:var(--muted); margin-top:18px; line-height:1.8; }
.srch-tips code { background:var(--surface); border:1px solid var(--line); border-radius:4px;
                  padding:1px 5px; font-size:11px; }
.srch-indexing, .srch-degraded, .srch-missing { display:flex; align-items:center; gap:8px; font-size:12px;
                 color:var(--muted); background:var(--warn-soft,rgba(176,132,66,.12));
                 border:1px solid rgba(176,132,66,.3); border-radius:8px; padding:8px 12px; margin-bottom:14px; }
.srch-missing { color:var(--text); }

/* In-conversation find (R44-R46). */
.conv-find { display:flex; align-items:center; gap:6px; padding:6px 12px;
             border-bottom:1px solid var(--line); background:var(--surface); }
.conv-find[hidden] { display:none; }
.conv-find .cf-icon { color:var(--muted); font-size:13px; flex-shrink:0; }
.conv-find input { flex:1; min-width:0; border:1px solid var(--line); border-radius:6px; background:var(--bg);
                   font:inherit; font-size:12px; color:var(--text); padding:4px 8px; min-height:24px; }
.conv-find input:focus { outline:none; border-color:var(--accent); }
.cf-count { font-size:11px; color:var(--muted); white-space:nowrap; flex-shrink:0; min-width:52px; text-align:right; }
.cf-step { border:1px solid var(--line); background:var(--bg); color:var(--text); cursor:pointer;
           min-width:24px; min-height:24px; border-radius:6px; font-size:12px; line-height:1; flex-shrink:0;
           display:flex; align-items:center; justify-content:center; }
.cf-step:hover:not(:disabled) { border-color:var(--accent); }
.cf-step:disabled { opacity:.45; cursor:default; }
.cf-step:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
#messages mark.conv-find-hit { background:rgba(255,213,0,.38); color:inherit; border-radius:2px; padding:0 1px; }
#messages mark.conv-find-hit.on { background:var(--accent); color:#fff; }

/* The nav already carries a brand lockup, three area tabs and the account avatar. Adding a
   240px-minimum field to that row forces horizontal page overflow on a narrow viewport, which
   breaks the Hub's own no-overflow guarantee (caught by the #339 delegation-ledger smoke test at
   390px). Shed the field's non-essential parts first, then the field itself, at the breakpoints
   the Hub already uses elsewhere. */
@media (max-width: 900px) {
  /* The shortcut hint is the least load-bearing part: the field is still clickable without it. */
  .srch-kbd { display: none; }
  .hub-search { min-width: 150px; flex: 0 1 220px; }
}
@media (max-width: 760px) {
  /* Below the Hub's mobile breakpoint the nav cannot hold a text field at all. */
  .hub-search { display: none; }
}
/* ─── End Issue #1065 ────────────────────────────────────────────────────── */

/* ─── End Issue #1178 ────────────────────────────────────────────────────── */

/* ─── Issue #1278: Job Visualization Modal ──────────────────────────────── */
/* Must sit above #composer-suggestions/.conversation-focus-overlay
   (var(--z-cmd-palette) = 9000) so the modal is reachable when opened from
   the persistent composer's catalog suggestions. Token: --z-job-viz. */
#job-viz-modal { z-index: var(--z-job-viz); }
.jv-modal-card { max-width: 860px; }
.jv-header { display: flex; align-items: flex-start; gap: 10px; }
.jv-header-text { flex: 1; min-width: 0; }
.jv-header-text h3 { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.jv-header-text p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.jv-personalized-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; flex-shrink: 0; margin-top: 2px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent); white-space: nowrap;
}
.jv-phases { position: relative; overflow: visible; padding: 8px 0 0; }
.jv-phases-scroll {
  display: flex; align-items: flex-start; gap: 0;
  overflow-x: auto; padding-bottom: 16px;
  scrollbar-width: thin; scrollbar-color: rgba(0,0,0,.15) transparent;
}
.jv-phase-wrap { display: flex; align-items: flex-start; gap: 0; flex-shrink: 0; }
.jv-phase-wrap:last-child .jv-arrow { display: none; }
.jv-arrow { align-self: flex-start; margin-top: 14px; color: var(--muted); font-size: 14px; padding: 0 4px; flex-shrink: 0; }
.jv-phase { display: flex; flex-direction: column; align-items: center; min-width: 120px; max-width: 148px; position: relative; }
.jv-phase-card {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text);
  transition: border-color 120ms, background 120ms; user-select: none; cursor: default;
}
.jv-phase-number {
  width: 20px; height: 20px; border-radius: 50%; margin: 0 auto 5px;
  background: var(--accent-soft); border: 1.5px solid var(--accent);
  color: var(--accent); font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.jv-phase-label { line-height: 1.3; }
.jv-skills { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; padding: 6px 2px 0; max-width: 148px; }
.jv-skill {
  display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 12px;
  font-size: 10px; font-weight: 500; background: var(--soft); color: var(--muted);
  border: 1px solid var(--line); cursor: default; white-space: nowrap;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.jv-skill:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
/* #jv-tt: fixed-position tooltip portal; appended to body, escapes scroll-container clip */
#jv-tt {
  position: fixed; z-index: var(--z-jv-tt);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.15);
  padding: 10px 12px; min-width: 180px; max-width: 260px;
  font-size: 12px; line-height: 1.5; color: var(--text); pointer-events: none;
  white-space: normal; text-align: left;
}
.jv-phase:hover .jv-phase-card { border-color: var(--accent); background: var(--accent-soft); }
.jv-skill:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.jv-popover-row { margin-bottom: 6px; }
.jv-popover-row:last-child { margin-bottom: 0; }
.jv-popover-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.jv-skill-wrap { display: inline-flex; }
.jv-loading { color: var(--muted); font-size: 13px; padding: 24px 0; text-align: center; }
/* Job visualization button — Delegate Job catalog rows and the assign-job picker (#1340: anchored
   next to the title instead of the row's trailing grid column, which unwrapped description text
   could push off-screen). */
.job-option { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 2px 6px; }
.job-option-title-row { grid-column: 1; display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.job-option > span:not(.lock-badge) { grid-column: 1; }
.job-viz-btn {
  background: transparent; border: none; padding: 2px 4px;
  color: var(--muted); cursor: pointer;
  border-radius: 4px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 120ms, color 120ms;
}
.job-viz-btn svg { display: block; width: 12px; height: 12px; }
.job-viz-btn:hover { background: var(--soft); color: var(--accent); }
.job-viz-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.job-row .job-viz-btn {
  flex-shrink: 0; width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%;
}
.job-row .job-viz-btn svg { width: 15px; height: 15px; }
/* ─── End Issue #1278 ────────────────────────────────────────────────────── */

/* ─── Issue #1657 Treatment 3: persistent composer ──────────────────────────
   One instruction composer, permanently docked at the bottom of #conversation
   (a flex column) - it never opens/closes/relocates; only the content above
   it (#empty, #hire-strip, #active-conv, #ab-direct-panel) changes. Those
   siblings get flex:1 so whichever is visible fills the remaining height and
   pushes the composer to the true bottom edge. */
#empty { flex: 1; min-height: 0; overflow-y: auto; }
#conversation:has(> #persistent-composer) { padding-bottom: 8px; }
#persistent-composer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Issue #1744: keep the draft and its controls in one bordered composer while
   letting the text area size independently above the always-reachable footer. */
#persistent-composer .coach-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: visible;
}
#persistent-composer .coach-input:focus-within { border-color: var(--accent); }
#persistent-composer .coach-input textarea {
  min-height: 54px;
  max-height: none;
  height: 54px;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px 8px 0 0;
  resize: none;
  overflow-y: hidden;
  line-height: 22px;
  box-sizing: border-box;
}
#persistent-composer .composer-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 7px;
  flex-wrap: wrap;
}
#persistent-composer .composer-footer .attach-btn,
#persistent-composer .composer-footer .composer-coach-actions,
#persistent-composer .composer-footer .composer-agent-row,
#persistent-composer .composer-footer #send {
  position: static;
  inset: auto;
  transform: none;
}
#persistent-composer .composer-footer .composer-coach-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  overflow: visible;
}
#persistent-composer .composer-footer .composer-coach-actions[hidden] { display: none; }
#persistent-composer .composer-footer .composer-agent-row {
  display: flex;
  min-width: 0;
  max-width: 150px;
  margin-left: auto;
}
#persistent-composer .composer-footer .composer-agent-row[hidden] { display: none; }
#persistent-composer .composer-footer .composer-agent-row .employee-select.inline { max-width: 120px; }
#persistent-composer .composer-footer #send { flex-shrink: 0; }

@media (max-width: 650px) {
  #persistent-composer .composer-footer { gap: 4px; }
  #persistent-composer .composer-footer .composer-agent-row { margin-left: auto; }
}

/* Full-panel A/B split (#442) turns #conversation into a flex row so
   #active-conv/#ab-direct-panel sit side by side - but #persistent-composer
   is now a third child of #conversation (not nested in either pane) and must
   stay docked full-width under BOTH panes, not become a third column. Grid
   keeps the two comparison panes side by side on row 1 while the composer
   spans both columns on row 2, without moving it in the DOM. */
#conversation.ab-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}
#conversation.ab-mode #active-conv { grid-column: 1; grid-row: 1; overflow-y: auto; }
#conversation.ab-mode #ab-direct-panel { grid-column: 2; grid-row: 1; }
#conversation.ab-mode #persistent-composer { grid-column: 1 / -1; grid-row: 2; }
/* ui-polish-validation P1 (2026-09-14): the pre-existing `@media (max-width:
   900px) { #conversation.ab-mode { flex-direction: column; } }` rule
   (written when .ab-mode was display:flex) became a silent no-op once this
   rule switched .ab-mode to display:grid - flex-direction has no effect on a
   grid container, so both panes kept rendering side by side (each squeezed to
   ~350px) all the way down to mobile widths, which then crowded/wrapped the
   coaching-panel header text (see the pre-existing .panel-kicker overflow
   noted separately). Grid needs its own reflow rule. */
@media (max-width: 900px) {
  #conversation.ab-mode {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto;
  }
  #conversation.ab-mode #active-conv { grid-column: 1; grid-row: 1; }
  #conversation.ab-mode #ab-direct-panel { grid-column: 1; grid-row: 2; }
  #conversation.ab-mode #persistent-composer { grid-column: 1; grid-row: 3; }
}

/* Inline, non-modal catalog-suggestion list (R2): sits directly above the
   input box, flush against it (shared border, no gap) rather than floating
   as a separate popup - matches the approved mock's .ac-list treatment. */
.composer-suggestions {
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: var(--surface);
  box-shadow: 0 -8px 20px rgba(0,0,0,.08);
  margin-bottom: -1px;
  max-height: 320px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.composer-suggestions[hidden] { display: none; }
.cp-employee-footer[hidden] { display: none; }

/* Issue #1657 post-launch fix: the armed-job chip shown while a catalog job
   is committed and the box is cleared for the manager to type instructions
   (see armSelectedJob in script.js). Sits directly above the input, in the
   same slot .composer-suggestions occupies (mutually exclusive - never both
   visible at once). */
.cp-armed-job-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.cp-armed-job-chip[hidden] { display: none; }
#cp-armed-job-clear {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
#cp-armed-job-clear:hover { color: var(--text); }
/* ─── End Issue #1657 Treatment 3 ────────────────────────────────────────── */
