/* Spawned child sessions (sessions_spawn): sidebar tree, view-only subagent notice, header crumb.
   Ported from the Control UI (layout.css .sidebar-session-tree__*, .sidebar-child-session-toggle*;
   components.css .callout*; chat/layout.css .agent-chat__disabled-banner*). The Control UI's
   --accent is its brand red, so "running" maps to ClawChats' --accent-color (green), "failed" to danger. */

/* ── Sidebar tree ── */
.chat-tree-children {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: 16px;
}

.chat-item.chat-item--child {
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 13.5px;
}

.chat-children-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex: 0 0 31px;
  width: 31px;
  height: 22px;
  padding: 0 3px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

/* Expanded, the chevron only shows on hover (the indented children already say it's open). */
.chat-children-toggle[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.chat-item:hover .chat-children-toggle[aria-expanded="true"],
.chat-item:focus-within .chat-children-toggle[aria-expanded="true"] {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none), (pointer: coarse) {
  .chat-children-toggle[aria-expanded="true"] {
    opacity: 1;
    pointer-events: auto;
  }
}

.chat-children-toggle:hover,
.chat-children-toggle:focus-visible {
  background: color-mix(in srgb, var(--bg-hover, rgba(255, 255, 255, 0.07)) 88%, transparent);
  color: var(--text-primary);
}

.chat-children-toggle--running { color: var(--accent-text); }
.chat-children-toggle--failed { color: #e5534b; }

.chat-children-toggle svg {
  width: 11px;
  height: 11px;
  flex: none;
}

.chat-children-toggle__count {
  min-width: 9px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.chat-tree-more {
  align-self: flex-start;
  min-height: 28px;
  margin: 0 8px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.chat-tree-more:hover,
.chat-tree-more:focus-visible {
  color: var(--text-primary);
}

/* ── View-only subagent notice: replaces the composer (frontend/chat/subagent-view.js) ── */
.agent-chat__disabled-banner {
  box-sizing: border-box;
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
}

.agent-chat__disabled-banner[hidden] { display: none; }

.agent-chat__disabled-banner.callout {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--text-primary) 9%, transparent);
  background: var(--input-bg);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  user-select: text;
}

.agent-chat__disabled-banner .callout__content {
  flex: 1;
  min-width: 0;
}

.agent-chat__disabled-banner-title {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.35;
}

.agent-chat__disabled-banner-detail {
  color: var(--text-muted);
}

.agent-chat__disabled-banner .btn {
  flex: 0 0 auto;
  cursor: pointer;
}

.agent-chat__disabled-banner .btn[hidden] { display: none; }

/* ── Header: parent › child ── */
.header-parent-crumb {
  max-width: 40%;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  cursor: pointer;
}

.header-parent-crumb:hover,
.header-parent-crumb:focus-visible {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.header-crumb-sep {
  margin: 0 6px;
  color: var(--text-muted);
  font-weight: 400;
}

/* "Open" on a spawned sub-agent's tool row (frontend/chat/activity.js): the row's own colour with a faint
   underline, as Control UI .chat-tool-row__subagent-link (tool-cards.css). */
.activity-session-link {
  margin-left: 4px;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
  text-underline-offset: 2px;
}

.activity-session-link:hover,
.activity-session-link:focus-visible { text-decoration-color: currentColor; }

/* "Subagents working" subtitle (Control UI session-leading-indicator: running descendants). */
.chat-item .chat-item-subagents {
  color: var(--text-muted);
}

.chat-item .chat-item-subagents .streaming-dots {
  font-size: 8px;
  letter-spacing: 1px;
}

/* ── Subagents side panel (frontend/chat/subagents-panel.js) ──
   Port of the Control UI 2026.11.6 chat-subagents-panel-desktop.css, chat-subagents-mobile.css,
   chat-subagents-panel.css, chat-subagents-working.css and styles/session-panel-rail.css.
   Tokens by meaning: the Control UI's --accent (its red brand) on the working spinner is ClawChats'
   accent, as for every "running" here; Stop and Failed are --danger; --bg-accent (row hover) is --bg-hover. */
.subagents-panel {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  color: var(--text);
}

.subagents-panel__list {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.subagents-panel__list[hidden],
.chat-subagent-detail[hidden] { display: none; }

.subagents-desktop {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  color: var(--text);
  font-size: calc(13px * var(--control-ui-text-scale));
}

.subagents-desktop__content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px 20px 32px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.subagents-desktop__content:focus { outline: none; }
.subagents-desktop__content--empty { display: flex; padding: 0; }

.subagents-desktop__group + .subagents-desktop__group { margin-top: 28px; }

.subagents-desktop__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  margin: 0 0 9px;
  padding: 0;
  color: var(--text);
  font-size: calc(12px * var(--control-ui-text-scale));
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 20px;
}

.subagents-desktop__count { color: var(--muted); }

.subagents-desktop__disclosure {
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

.subagents-desktop__disclosure svg { width: 12px; height: 12px; }

.subagents-desktop__row {
  --subagent-divider: var(--border);
  position: relative;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto auto 24px;
  align-items: center;
  min-width: 0;
  margin: 0 -8px;
  padding: 0 8px;
  border-radius: 8px;
}

.subagents-desktop__row:not(:last-child)::after {
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 45px;
  height: 1px;
  background: var(--subagent-divider);
  content: "";
  pointer-events: none;
}

.subagents-desktop__row:hover,
.subagents-desktop__row:focus-within {
  --subagent-divider: transparent;
  background: var(--bg-hover);
}

.subagents-desktop__row:has(+ .subagents-desktop__row:hover),
.subagents-desktop__row:has(+ .subagents-desktop__row:focus-within) {
  --subagent-divider: transparent;
}

.subagents-desktop__open {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  grid-row: 1;
  align-items: center;
  min-width: 0;
  min-height: 69px;
  padding: 12px 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.subagents-desktop__open:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: -2px; }

.subagents-desktop__avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: hsl(var(--subagent-hue) 22% 30% / 0.35);
  color: hsl(var(--subagent-hue) 32% 65%);
}

.subagents-desktop__open > .subagents-desktop__avatar { grid-column: 1; grid-row: 1; }
.subagents-desktop__avatar > svg { width: 17px; height: 17px; }

.subagents-desktop__spinner {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 11px;
  height: 11px;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 2px var(--bg);
  animation: btn-spinner-spin 1.5s linear infinite;
}

.subagents-desktop__identity {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
  margin-left: 12px;
}

/* "chat" / "helper" tag after the name (ClawChats: the panel lists visible child chats too). */
.subagents-desktop__name-line,
.chat-subagents-mobile__name-line { display: flex; align-items: center; gap: 6px; min-width: 0; }

.subagents-kind {
  flex: none;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 14px;
  text-transform: lowercase;
}

.subagents-kind--chat { color: var(--text); }

.subagents-desktop__name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-strong);
  font-weight: 500;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subagents-desktop__status,
.subagents-desktop__elapsed {
  color: var(--muted);
  font-size: calc(12px * var(--control-ui-text-scale));
  font-variant-numeric: tabular-nums;
  line-height: 18px;
}

/* A long "Waiting for subagents" stays on one line. */
.subagents-desktop__status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subagents-desktop__row[data-group="failed"] .subagents-desktop__status { color: var(--danger); }

.subagents-desktop__elapsed {
  flex: none;
  grid-column: 3;
  grid-row: 1;
  margin-left: 12px;
  white-space: nowrap;
}

.subagents-desktop__chevron {
  display: inline-flex;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  margin-right: 2px;
  color: var(--muted);
  opacity: 0;
  grid-column: 5;
  grid-row: 1;
  justify-self: end;
}

.subagents-desktop__chevron svg { width: 12px; height: 12px; }

.subagents-desktop__stop {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 60px;
  min-height: 27px;
  margin: 0 0 0 12px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  color: var(--danger);
  font: inherit;
  font-size: calc(12px * var(--control-ui-text-scale));
  cursor: pointer;
  opacity: 0;
}

.subagents-desktop__row > .subagents-desktop__stop { z-index: 1; grid-column: 4; grid-row: 1; }
.subagents-desktop__stop svg { width: 10px; height: 10px; fill: currentColor; stroke: none; }

.subagents-desktop__row:hover .subagents-desktop__stop,
.subagents-desktop__row:focus-within .subagents-desktop__stop,
.subagents-desktop__row:hover .subagents-desktop__chevron,
.subagents-desktop__row:focus-within .subagents-desktop__chevron { opacity: 1; }

.subagents-desktop__row:hover .subagents-desktop__stop:disabled,
.subagents-desktop__row:focus-within .subagents-desktop__stop:disabled { opacity: 0.45; }

.subagents-desktop__row[data-group="done"] .subagents-desktop__open { min-height: 43px; padding: 9px 0; }

.subagents-desktop__more {
  min-height: 32px;
  margin: 10px 0 0 37px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: calc(12px * var(--control-ui-text-scale));
  cursor: pointer;
}

.subagents-desktop__more:hover { color: var(--text-strong); }

@media (hover: none) {
  .subagents-desktop__row .subagents-desktop__stop,
  .subagents-desktop__row .subagents-desktop__chevron { opacity: 1; }
  .subagents-desktop__row .subagents-desktop__stop:disabled { opacity: 0.45; }
}

/* One Working sweep (chat-subagents-working.css). */
@supports (background-clip: text) {
  @media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
    .subagents-desktop__working {
      display: inline-block;
      background: linear-gradient(100deg, var(--muted) 30%, var(--text-strong) 50%, var(--muted) 70%);
      background-repeat: no-repeat;
      background-size: 250% 100%;
      background-clip: text;
      -webkit-background-clip: text;
      color: transparent;
      animation: subagents-working-sweep 3.2s linear infinite;
    }
  }
}

@keyframes subagents-working-sweep {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .subagents-desktop__spinner { animation: none; }
}

.chat-subagents__error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  color: var(--danger);
  font-size: var(--control-ui-text-sm);
  overflow-wrap: anywhere;
}

/* Empty (components/solid/panel-empty-state.tsx + styles/panel-empty-state.css). */
.subagents-empty-state {
  display: grid;
  flex: 1 1 auto;
  box-sizing: border-box;
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  transform: translateY(-10px);
}

.subagents-empty-state__icon svg { width: 32px; height: 32px; margin-bottom: 18px; stroke-width: 1.5px; }
.subagents-empty-state__title { color: var(--text-strong); font-size: calc(16px * var(--control-ui-text-scale)); font-weight: 500; line-height: 1.25; }
.subagents-empty-state__description { max-width: 320px; margin: 8px 0 0; color: var(--muted); font-size: calc(13px * var(--control-ui-text-scale)); line-height: 1.45; }

/* ── A run beside its parent: the child rail and its transcript (chat-pane-layout-view.tsx) ── */
.chat-subagent-detail {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.chat-subagent-detail__pane {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.session-panel-rail {
  display: flex;
  box-sizing: border-box;
  min-width: 0;
  flex: none;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: calc(14px * var(--control-ui-text-scale, 1));
  line-height: 18px;
}

.session-panel-rail[data-presentation="desktop"] { min-height: 40px; padding: 3px 8px 4px; }

.session-panel-rail[data-presentation="mobile"] {
  min-height: 40px;
  padding: 0 8px;
  border-bottom-color: var(--border-strong);
  background: color-mix(in srgb, var(--popover) 70%, var(--bg));
  line-height: 20px;
}

.session-panel-rail .session-panel-rail__group {
  display: inline-flex;
  box-sizing: border-box;
  min-width: 0;
  flex: none;
  align-items: center;
  gap: var(--rail-header-action-gap, 2px);
  min-height: var(--rail-header-action-size, 28px);
  padding: 2px;
  border-radius: var(--radius-full);
  background: var(--bg-hover);
  box-shadow: inset 0 0 0 1px var(--border);
}

.session-panel-rail[data-presentation="mobile"] .session-panel-rail__group { padding: 0; background: transparent; box-shadow: none; }

.session-panel-rail .session-panel-rail__button {
  display: inline-flex;
  box-sizing: border-box;
  width: 24px;
  min-width: 24px;
  height: 24px;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--muted);
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.session-panel-rail[data-presentation="mobile"] .session-panel-rail__button { width: 32px; min-width: 32px; height: 32px; }
.session-panel-rail .session-panel-rail__button--labelled { width: auto; padding-inline: 8px; }
.session-panel-rail .session-panel-rail__button > svg { width: 16px; height: 16px; flex: none; }
.session-panel-rail .session-panel-rail__button:is(:hover, :focus-visible):not(:disabled) { background: var(--border); color: var(--text-strong); }
.session-panel-rail .session-panel-rail__button:disabled { opacity: 0.4; }

.subagents-desktop__child-rail > .subagents-desktop__avatar { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 6px; }
.subagents-desktop__child-rail > .subagents-desktop__avatar > svg { width: 15px; height: 15px; }

.subagents-desktop__child-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-strong);
  font-size: calc(13px * var(--control-ui-text-scale));
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subagents-desktop__child-rail .subagents-desktop__stop {
  min-width: 0;
  min-height: 0;
  margin: 0;
  background: transparent;
  color: var(--danger);
  opacity: 1;
}

.subagents-desktop__child-rail .subagents-desktop__stop > svg { width: 10px; height: 10px; }
.subagents-desktop__child-rail .subagents-desktop__stop:is(:hover, :focus-visible):not(:disabled) { color: var(--danger); }

/* The run's own pane: transcript only (no header, side panel, notice or composer). */
.chat-pane--embedded > .sidebar-region { grid-template-rows: minmax(0, 1fr); grid-template-areas: "main"; }
.chat-pane--embedded > .sidebar-region > .sidebar-region__header,
.chat-pane--embedded > .sidebar-region > .sidebar-region__right-runtime { display: none; }
.chat-pane--embedded .messages { padding-left: 12px; padding-right: 12px; }

/* ── Mobile (chat-subagents-mobile.css) ── */
.chat-subagents-mobile {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px 14px 24px;
  color: var(--text);
}

.chat-subagents-mobile__group { margin: 0 0 20px; }

.chat-subagents-mobile__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin: 0;
  padding: 0 12px;
  color: var(--muted);
  font-size: var(--control-ui-text-sm);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.chat-subagents-mobile__list {
  --subagent-row-surface: color-mix(in srgb, var(--popover) 95%, var(--text-strong) 5%);
  border-radius: 14px;
  background: var(--subagent-row-surface);
}

.chat-subagents-mobile__list[hidden] { display: none; }

.chat-subagents-mobile__row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.chat-subagents-mobile__row + .chat-subagents-mobile__row::before {
  position: absolute;
  top: 0;
  right: 12px;
  left: 49px;
  height: 1px;
  background: color-mix(in srgb, var(--border-strong) 65%, transparent);
  content: "";
}

.chat-subagents-mobile__open,
.chat-subagents-mobile__stop,
.chat-subagents-mobile__disclosure {
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.chat-subagents-mobile__disclosure { width: 100%; padding: 0; }
.chat-subagents-mobile__disclosure > svg { width: 12px; height: 12px; color: var(--muted); }

.chat-subagents-mobile__open {
  flex: 1;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  text-align: left;
}

.chat-subagents-mobile__open::after { position: absolute; inset: 0; border-radius: 14px; content: ""; }

.chat-subagents-mobile__indicator { position: relative; flex: 0 0 25px; width: 25px; height: 25px; color: var(--muted); }

.chat-subagents-mobile__status {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--subagent-row-surface);
  box-shadow: 0 0 0 2px var(--subagent-row-surface);
}

.chat-subagents-mobile__status svg { width: 11px; height: 11px; }
.chat-subagents-mobile__indicator[data-status="stopped"] .chat-subagents-mobile__status svg { fill: currentColor; stroke: none; }
.chat-subagents-mobile__indicator[data-status="finished"] .chat-subagents-mobile__status { color: var(--ok); }
.chat-subagents-mobile__indicator[data-status="failed"] .chat-subagents-mobile__status { color: var(--danger); }

.chat-subagents-mobile__chevron { pointer-events: none; display: inline-flex; flex: none; width: 14px; height: 14px; color: var(--muted); }
.chat-subagents-mobile__chevron svg { width: 14px; height: 14px; }

.chat-subagents-mobile__copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }

.chat-subagents-mobile__copy strong {
  display: block;
  overflow: hidden;
  color: var(--text-strong);
  font-size: var(--control-ui-text-md);
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-subagents-mobile__stats,
.chat-subagents-mobile__empty,
.chat-subagents-mobile__elapsed { color: var(--muted); font-size: var(--control-ui-text-sm); line-height: 18px; font-variant-numeric: tabular-nums; }

.chat-subagents-mobile__stats { display: flex; align-items: center; gap: 5px; }
.chat-subagents-mobile__empty { margin: 0; padding: 0 12px; }

.chat-subagents-mobile__stop {
  position: relative;
  z-index: 1;
  flex: none;
  justify-content: center;
  gap: 6px;
  min-width: 64px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--danger);
  font-size: var(--control-ui-text-sm);
  line-height: 16px;
}

.chat-subagents-mobile__stop svg { width: 10px; height: 10px; fill: currentColor; }
.chat-subagents-mobile__stop:disabled { opacity: 0.45; }

/* ── Wait indicator (chat-working-indicator.tsx, chat-handoff-sessions.tsx) ── */
.chat-subagent-wait {
  box-sizing: border-box;
  width: 100%;
  max-width: 48rem;
  margin: 4px auto 16px;
  padding: 0 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.chat-subagent-wait__link,
.activity-subagents__link {
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 2px;
}

.chat-subagent-wait__link:hover,
.chat-subagent-wait__link:focus-visible,
.activity-subagents__link:hover,
.activity-subagents__link:focus-visible { color: var(--text-primary); text-decoration-color: currentColor; }

.activity-subagents[hidden] { display: none; }

/* Last in a resumed hand-off's reply, in its column (Control UI working-indicator.css .chat-handoff-resume). */
.chat-handoff-resume {
  align-self: stretch;
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.chat-handoff-resume__rule {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 8px 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 11px;
  text-align: left;
}

button.chat-handoff-resume__rule { cursor: pointer; }
button.chat-handoff-resume__rule:hover,
button.chat-handoff-resume__rule:focus-visible { color: var(--text-primary); }

.chat-handoff-resume__rule::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border-color);
}

.chat-handoff-resume__chevron { display: inline-flex; width: 12px; height: 12px; }
.chat-handoff-resume__chevron svg { width: 12px; height: 12px; transition: transform 0.15s; }
.chat-handoff-resume__rule[aria-expanded="true"] .chat-handoff-resume__chevron svg { transform: rotate(90deg); }

/* One width for the list, so the status chips line up. */
.chat-handoff-sessions {
  width: 560px;
  max-width: calc(100% - 8px);
  margin: 4px 0 2px 7px;
  padding-inline-start: 15px;
  border-inline-start: 1px solid var(--border-color);
  list-style: none;
}

.chat-handoff-sessions[hidden] { display: none; }

.chat-handoff-sessions li {
  display: flex;
  gap: 8px;
  padding: 2px 0;
}

.chat-handoff-sessions__status {
  margin-inline-start: auto;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 11px;
}
