Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript
419 KB
Raw Blame
* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  min-height: 100%;
}

.app-frame {
  /* Published on the common ancestor of the title bar and the sidebar so the
     title bar's leading slot can align its actions to the app content's left
     edge (= sidebar width). Mirrors .left-nav / .left-nav.collapsed widths;
     App.tsx toggles data-sidebar-collapsed from the same sidebarCollapsed state
     that drives the sidebar's .collapsed class. */
  --sidebar-width: 328px;
  min-height: 100vh;
  display: grid;
  grid-template-rows: var(--window-titlebar-height) minmax(0, 1fr);
  background: var(--topbar-gradient);
}

.app-frame[data-sidebar-collapsed] {
  --sidebar-width: 74px;
}

/* Root wrapper around the app/auth tree. It exists so the BootSplash overlay
   can mark the whole background subtree `inert` during the startup/loading
   window, removing hidden controls from the tab order and accessibility tree
   until the splash exits. */
.app-root {
  min-height: 0;
  display: block;
  background: var(--bg);
}

body {
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
  background: var(--app-radial-left), var(--app-radial-right), var(--bg);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--text);
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

.muted {
  color: var(--text-muted);
  font-size: var(--font-size-md);
}

.glass-card {
  border: 1px solid rgba(var(--edge-rgb), 0.42);
  border-radius: var(--radius-xl);
  background: var(--glass-gradient);
  box-shadow: var(--shadow-hard);
  backdrop-filter: blur(8px);
}

.app-shell {
  min-height: calc(100vh - var(--window-titlebar-height));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0;
  padding: 0;
  width: 100%;
}

.window-titlebar {
  position: relative;
  /* Sit above the sidebar's own stacking layer (.left-nav uses
     --sidebar-flyout-layer = --layer-dropdown + 1000) so the leading slot's
     downward hover flyout paints over the sidebar column instead of behind it.
     Still below dialogs/toasts (2300+), which correctly cover the whole chrome.
     The title bar never vertically overlaps lower chrome, so this only affects
     that flyout. */
  z-index: calc(var(--layer-dropdown) + 1010);
  isolation: isolate;
  height: var(--window-titlebar-height);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 var(--space-2);
  background: var(--topbar-gradient);
  border-bottom: 1px solid var(--titlebar-divider-border);
  user-select: none;
  -webkit-app-region: drag;
}

/* Titlebar actions are portalled outside the content panel. Raise their owning
   stacking context while the fixed chat drawer is present so search and inbox
   overlays remain usable above that drawer. */
.app-frame:has(.chat-drawer) > .window-titlebar {
  z-index: var(--layer-dropdown);
}

.window-titlebar__actions {
  --titlebar-action-border: var(--titlebar-control-border);
  --titlebar-action-ink: var(--titlebar-control-ink);
  --titlebar-action-muted-ink: var(--titlebar-control-ink);
  --titlebar-action-surface: var(--titlebar-control-surface);

  position: fixed;
  top: 0;
  right: var(--space-2);
  left: calc((var(--window-titlebar-control-size) * 3) + (var(--space-1) * 2) + var(--space-4));
  z-index: calc(var(--layer-header) + 1);
  height: var(--window-titlebar-height);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  pointer-events: none;
}

:root[data-theme='dark'] .window-titlebar__actions {
  --titlebar-action-border: var(--titlebar-control-border);
  --titlebar-action-ink: var(--titlebar-control-ink);
  --titlebar-action-muted-ink: var(--titlebar-control-ink);
  --titlebar-action-surface: var(--titlebar-control-surface);
}

.window-titlebar__actions .top-bar {
  position: static;
  inset: auto;
  height: var(--window-titlebar-height);
  width: 100%;
  z-index: auto;
  align-items: center;
  gap: var(--space-2);
  pointer-events: auto;
}

.window-titlebar__actions .header-left {
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

.window-titlebar__actions .header-utilities {
  flex: 0 0 auto;
}

.window-titlebar__actions .global-search {
  --global-search-expanded: clamp(160px, 20vw, 280px);
  --global-search-expanded-min: 0;
  flex: 0 1 var(--global-search-expanded);
  width: var(--global-search-expanded);
  min-width: 0;
  max-width: min(var(--global-search-expanded), 100%);
  margin-right: 0;
  -webkit-app-region: no-drag;
}

.window-titlebar__actions .global-search:focus-within,
.window-titlebar__actions .global-search.is-open {
  width: var(--global-search-expanded);
  min-width: 0;
}

.window-titlebar__actions .search-input {
  height: 30px;
  min-height: 30px;
  padding-left: 34px;
  border-color: var(--titlebar-action-border);
  background: var(--titlebar-action-surface);
  color: var(--titlebar-action-ink);
  box-shadow: 0 6px 14px rgba(var(--overlay-rgb), 0.08);
  -webkit-app-region: no-drag;
}

.window-titlebar__actions .global-search::before {
  inset: 0 auto 0 11px;
  place-items: center;
  color: var(--titlebar-action-ink);
  font-size: var(--font-size-lg);
}

.window-titlebar__actions .search-input::placeholder {
  color: var(--titlebar-action-muted-ink);
  opacity: 1;
}

.window-titlebar__actions .search-input:focus {
  border-color: rgba(var(--focus-rgb), 0.85);
  box-shadow:
    0 0 0 2px rgba(var(--focus-rgb), 0.2),
    0 6px 14px rgba(var(--overlay-rgb), 0.1);
}

.window-titlebar__actions .global-search-results {
  top: calc(100% + var(--space-1));
  right: 0;
  width: min(720px, calc(100vw - var(--space-4)));
}

/* Ghost affordance, matching the chat drawer's new-chat / close IconButtons:
   no border or fill at rest, an accent border + neutral fill on hover. */
.window-titlebar__actions .notification-bell {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.window-titlebar__actions .notification-bell svg {
  width: 16px;
  height: 16px;
  color: var(--titlebar-action-ink);
}

.window-titlebar__actions .notification-bell:hover {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: var(--surface-hover);
}

.window-titlebar__actions .notification-bell:hover svg,
.window-titlebar__actions .notification-bell:focus-visible svg {
  color: var(--text);
}

.window-titlebar__controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-1);
  min-width: calc((var(--window-titlebar-control-size) * 3) + (var(--space-1) * 2));
  -webkit-app-region: no-drag;
}

.window-control-button {
  position: relative;
  width: var(--window-titlebar-control-size);
  min-width: var(--window-titlebar-control-size);
  height: var(--window-titlebar-control-size);
  min-height: var(--window-titlebar-control-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
  -webkit-app-region: no-drag;
}

.window-control-button:hover:enabled {
  background: var(--surface-hover);
  color: var(--text);
}

.window-control-button:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.window-control-icon {
  position: relative;
  width: 12px;
  height: 12px;
  display: inline-block;
  color: currentColor;
}

.window-control-icon--minimize::before {
  content: '';
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 3px;
  border-bottom: 1.5px solid currentColor;
}

.window-control-icon--toggleMaximize::before,
.window-control-icon--toggleMaximize::after {
  content: '';
  position: absolute;
  border: 1.5px solid currentColor;
}

.window-control-icon--toggleMaximize::before {
  inset: 1px;
}

.window-control-icon--restore::before {
  inset: 4px 1px 1px 4px;
}

.window-control-icon--restore::after {
  inset: 1px 4px 4px 1px;
}

.window-control-icon--close::before,
.window-control-icon--close::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 1px;
  width: 10px;
  border-bottom: 1.5px solid currentColor;
}

.window-control-icon--close::before {
  transform: rotate(45deg);
}

.window-control-icon--close::after {
  transform: rotate(-45deg);
}

.window-titlebar--platform-mac .window-titlebar__controls {
  gap: var(--space-1);
  min-width: calc((var(--window-titlebar-mac-control-size) * 3) + (var(--space-1) * 2));
}

.window-titlebar--platform-mac .window-titlebar__actions {
  left: calc((var(--window-titlebar-mac-control-size) * 3) + (var(--space-1) * 2) + var(--space-4));
}

.window-titlebar--platform-mac .window-control-button {
  width: var(--window-titlebar-mac-control-size);
  min-width: var(--window-titlebar-mac-control-size);
  height: var(--window-titlebar-mac-control-size);
  min-height: var(--window-titlebar-mac-control-size);
  border-color: var(--window-control-mac-border);
  border-radius: 999px;
}

.window-titlebar--platform-mac .window-control-button--close {
  background: var(--window-control-mac-close);
}

.window-titlebar--platform-mac .window-control-button--minimize {
  background: var(--window-control-mac-minimize);
}

.window-titlebar--platform-mac .window-control-button--toggleMaximize {
  background: var(--window-control-mac-expand);
}

.window-titlebar--platform-mac .window-control-button:hover:enabled {
  border-color: var(--window-control-mac-border);
}

.window-titlebar--platform-mac .window-control-icon {
  opacity: 0;
  transform: scale(0.72);
  color: rgba(var(--overlay-rgb), 0.72);
}

.window-titlebar--platform-mac .window-titlebar__controls:hover .window-control-icon,
.window-titlebar--platform-mac .window-control-button:focus-visible .window-control-icon {
  opacity: 1;
}

/* Leading slot: mounted-app actions live here (icon-only), packed just after
   the window controls in the same title-bar row so they sit at the top-left,
   over the sidebar's content column and clear of the macOS traffic lights. The
   header search + bell keep the right edge via .window-titlebar__actions. */
.window-titlebar__leading {
  /* Fixed so its left edge tracks the app content's left edge (= the sidebar
     width, which changes with collapse) instead of flowing a fixed gap after
     the window controls. The window controls sit on the LEFT on every platform,
     so the left edge is clamped to clear them (same offset as
     .window-titlebar__actions): collapsed the sidebar (74px) is narrower than
     the controls, so the clamp wins; expanded it aligns to the 328px content
     edge. The mac override uses the smaller traffic-light size. z-index keeps it
     above .window-titlebar__actions' fixed, full-width .top-bar so that band
     can't intercept pointer events over these actions. */
  position: fixed;
  top: 0;
  left: max(
    calc((var(--window-titlebar-control-size) * 3) + (var(--space-1) * 2) + var(--space-4)),
    var(--sidebar-width)
  );
  z-index: calc(var(--layer-header) + 2);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  height: var(--window-titlebar-height);
  /* Chromium unions all `-webkit-app-region` rects in DOCUMENT ORDER and, where
     they overlap, the LAST one wins (z-index, position and pointer-events do not
     enter into it). The only `drag` region is the root `.window-titlebar`; every
     control that must stay clickable carves itself out as `no-drag`. This slot
     sits over that root drag band, so it declares `no-drag` to lift the whole
     leading area (and its descendant buttons) out of it. It must NOT declare
     `drag` here: a later-in-document `drag` box covering another control would
     re-union over it and make that control draggable again. */
  pointer-events: auto;
  -webkit-app-region: no-drag;
}

/* mac: never overlap the traffic-light semaphore, even when the sidebar is
   narrower than the controls (collapsed). */
.window-titlebar--platform-mac .window-titlebar__leading {
  left: max(
    calc((var(--window-titlebar-mac-control-size) * 3) + (var(--space-1) * 2) + var(--space-4)),
    var(--sidebar-width)
  );
}

/* Narrow/mobile layout: the sidebar collapses into a full-width top bar, so
   there is no left content column to track. Zero the tracked width so the
   leading actions fall back to just clearing the window controls (the max()
   clamp above), instead of anchoring to the now-irrelevant 328/74 px. */
@media (max-width: 900px) {
  .app-frame,
  .app-frame[data-sidebar-collapsed] {
    --sidebar-width: 0px;
  }
}

.window-titlebar__leading-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  pointer-events: auto;
}

.window-titlebar__leading .titlebar-leading-action {
  display: inline-flex;
}

/* Ghost affordance matching the title-bar bell / chat-drawer IconButtons:
   no border or fill at rest, accent border + neutral fill on hover or when
   the toggle is pressed. */
.window-titlebar__leading .titlebar-leading-action__btn.ui-icon-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--titlebar-control-ink);
  /* Restate no-drag on the clickable button itself. The leading slot is already
     no-drag and propagates, so this is idempotent — kept for clarity next to the
     interactive control, and harmless because it never widens a drag region. */
  -webkit-app-region: no-drag;
}

.window-titlebar__leading .titlebar-leading-action__btn.ui-icon-button svg {
  width: 16px;
  height: 16px;
}

.window-titlebar__leading .titlebar-leading-action__btn.ui-icon-button:hover:enabled,
.window-titlebar__leading .titlebar-leading-action__btn.ui-icon-button[aria-pressed='true'] {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: var(--surface-hover);
  color: var(--text);
}

.top-bar {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--layer-header);
  overflow: visible;
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: nowrap;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

/* Header search section */
.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
  min-width: 0;
}

.global-search {
  position: relative;
  /* Collapsed to just the magnifier until focused, then expands to the full
     search width. The expanded size is carried in custom props so each
     breakpoint retunes it without re-declaring the collapsed state. Collapsed
     width matches the 40px input height so the icon sits in a square. */
  --global-search-expanded: var(--app-notification-drawer-width);
  --global-search-expanded-min: 220px;
  width: 40px;
  min-width: 40px;
  max-width: 100%;
  /* Collapsed, the 40px pill sits one gap from the notification bell, whose
     hover fill would otherwise crowd it — add a gap's worth of separation,
     dropped back to 0 once expanded (the wide field already reads clear of it). */
  margin-right: var(--space-2);
  transition:
    width var(--motion-medium),
    min-width var(--motion-medium),
    margin-right var(--motion-medium);
}

/* Stay expanded whenever the field is focused OR the results are open, so the
   collapse is tied to "closed", not merely "unfocused": tabbing out while the
   dropdown is still open must not hide the typed query behind the 40px box. */
.global-search:focus-within,
.global-search.is-open {
  width: var(--global-search-expanded);
  min-width: var(--global-search-expanded-min);
  margin-right: 0;
}

@media (prefers-reduced-motion: reduce) {
  .global-search {
    transition: none;
  }
}

/* Collapsed: the glyph fills the square and is centered both axes, so it reads
   as a balanced icon button instead of a small mark with dead space beside it. */
.global-search::before {
  content: '⌕';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-image: none;
  color: var(--text-dim);
  font-size: var(--font-size-xl);
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}

/* Expanded: pin the glyph to the left edge (ahead of the input's 40px left pad)
   and drop back to the in-field size so it aligns with the typed text. */
.global-search:focus-within::before,
.global-search.is-open::before {
  inset: 0 auto 0 12px;
  font-size: var(--font-size-lg);
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 40px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--edge-rgb), 0.4);
  background: var(--surface-soft);
  color: var(--text);
  font-size: var(--font-size-md);
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input:focus {
  border-color: rgba(var(--focus-rgb), 0.72);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.18);
}

.global-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: auto;
  right: 0;
  width: min(640px, calc(100vw - var(--space-4)));
  z-index: var(--layer-dropdown);
}

.search-results-card {
  display: grid;
  gap: var(--space-2);
  max-height: min(68vh, 560px);
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--edge-rgb), 0.36);
  background: rgba(var(--panel-rgb), 0.98);
  box-shadow: var(--shadow-hard);
  padding: var(--space-2);
}

.search-results-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1-5);
  min-height: 22px;
}

.search-results-meta {
  font-size: var(--font-size-xs);
  color: var(--text-dim);
}

.search-results-loading,
.search-results-prompt,
.search-results-empty {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: 16px;
  color: var(--text-dim);
}

.search-results-group {
  display: grid;
  gap: var(--space-1);
}

.search-results-group-title {
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.search-results-list {
  display: grid;
  gap: var(--space-1);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--edge-rgb), 0.28);
  background: var(--list-item-bg);
  padding: 7px 9px;
}

.search-result-item.ui-selectable-option {
  display: flex;
  align-items: center;
}

.search-result-item-button {
  width: 100%;
  text-align: left;
  min-height: 42px;
  background: var(--list-item-bg);
  border: 1px solid rgba(var(--edge-rgb), 0.28);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  padding: 7px 9px;
}

.search-result-item-button:hover:enabled {
  transform: none;
  filter: none;
  border-color: rgba(var(--accent-rgb), 0.36);
  background: var(--list-item-hover-bg);
}

.search-result-item-button:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.7);
  box-shadow:
    0 0 0 1px rgba(var(--focus-rgb), 0.54),
    0 0 0 3px rgba(var(--focus-rgb), 0.22);
}

.search-result-main {
  min-width: 0;
  display: grid;
  gap: var(--space-0-5);
  flex: 1 1 auto;
}

.search-result-main strong {
  font-size: var(--font-size-md);
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: anywhere;
}

.search-result-subline {
  font-size: var(--font-size-xs);
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.search-result-tag {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.search-result-badges {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-scope-badge {
  font-size: var(--font-size-2xs);
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 7px;
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  color: var(--text-muted);
}

.search-scope-badge.selected {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.2);
  color: var(--text);
}

.search-scope-badge.user {
  border-color: rgba(var(--success-rgb), 0.42);
  background: rgba(var(--success-rgb), 0.18);
  color: color-mix(in srgb, var(--success) 18%, var(--text) 82%);
}

/* Header utility controls */
.header-utilities {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
  min-width: 0;
  margin-left: auto;
}

.avatar-circle {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 999px;
  background: var(--avatar-gradient);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.avatar-initials {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--accent-contrast);
  letter-spacing: 0.02em;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-0-5);
  text-align: left;
}

.user-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: 1.2;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ghost affordance: no border or fill at rest, a border + neutral fill only on
   hover — same behavior as the drawer's new-chat / close IconButtons. Border,
   fill and radius come from the shared ghost .ui-icon-button base; this rule
   only sets the bell's own box metrics so it must NOT reimpose a persistent
   border/background or a pill radius. */
.notification-bell {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
}

.notification-bell:hover {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.48);
}

.notification-bell svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.notification-bell-wrapper {
  position: relative;
  z-index: var(--layer-dropdown);
  -webkit-app-region: no-drag;
}

.notification-bell.has-attention svg {
  color: var(--text);
}

.notification-bell-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-2xs);
  font-weight: 700;
  color: var(--text-inverse);
  background: var(--accent);
  border: 1px solid rgba(var(--panel-rgb), 0.9);
}

.notification-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  border: 1px solid rgba(var(--edge-rgb), 0.38);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-hard);
}

.notification-menu--app-drawer {
  position: fixed;
  /* Anchored just below the window title bar, where the notification bell now
     lives on every route, so the drawer opens flush under the bell instead of
     floating over the panel. */
  top: calc(var(--window-titlebar-height) + var(--space-2));
  right: var(--space-4);
  bottom: var(--space-4);
  width: var(--app-notification-drawer-width);
  max-height: none;
}

.notification-menu--app-drawer.notification-menu--embed-aligned {
  left: var(--notification-drawer-left);
  width: auto;
}

.notification-menu-title-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
}

.notification-menu-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
}

.notification-clear-btn {
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(var(--edge-rgb), 0.1);
  cursor: pointer;
}

.notification-clear-btn:hover:enabled {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.14);
}

.notification-clear-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.notification-menu-body {
  overflow: auto;
  padding: var(--space-1-5);
  display: grid;
  gap: var(--space-2-5);
  align-content: start;
}

.notification-menu-section {
  display: grid;
  gap: var(--space-1-5);
  align-content: start;
}

.notification-menu-section + .notification-menu-section {
  padding-top: 12px;
  border-top: 1px solid rgba(var(--edge-rgb), 0.18);
}

.notification-menu-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-1-5);
}

.notification-menu-section-heading {
  display: grid;
  gap: var(--space-0-5);
}

.notification-menu-section-heading strong {
  font-size: var(--font-size-md);
  color: var(--text);
}

.notification-menu-section-meta {
  font-size: var(--font-size-xs);
  color: var(--text-dim);
}

.notification-inline-spinner {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(var(--edge-rgb), 0.42);
  border-top-color: rgba(var(--accent-rgb), 0.9);
  border-right-color: rgba(var(--accent-rgb), 0.65);
  animation: notification-inline-spin 0.75s linear infinite;
}

@keyframes notification-inline-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.notification-section-refresh {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  background: var(--surface-soft);
  color: var(--text);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.notification-section-refresh:hover:enabled {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: var(--surface-hover);
}

.notification-menu-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-md);
  line-height: 1.5;
}

.notification-approval-list,
.notification-menu-list {
  display: grid;
  gap: var(--space-1-5);
  align-content: start;
}

.notification-menu-item {
  width: 100%;
  border: 1px solid rgba(var(--edge-rgb), 0.26);
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  color: inherit;
  text-align: left;
  padding: 9px 10px;
  display: grid;
  gap: 5px;
  cursor: default;
}

.notification-menu-item.is-clickable {
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background-color 120ms ease;
}

.notification-menu-item.is-clickable:hover {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: var(--surface-hover);
}

.notification-menu-item.is-clickable:focus-visible {
  outline: none;
  border-color: rgba(var(--focus-rgb), 0.6);
  box-shadow: 0 0 0 var(--space-0-5) rgba(var(--focus-rgb), 0.24);
}

.notification-menu-item.unread {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: var(--bg-elev-2);
}

.notification-menu-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1-5);
}

.notification-pill {
  border-radius: 999px;
  border: 1px solid rgba(var(--edge-rgb), 0.35);
  background: rgba(var(--edge-rgb), 0.14);
  color: var(--text-muted);
  font-size: var(--font-size-2xs);
  line-height: 1.3;
  letter-spacing: 0.02em;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
}

.notification-pill.reply {
  border-color: rgba(var(--success-rgb), 0.4);
  background: rgba(var(--success-rgb), 0.18);
  color: color-mix(in srgb, var(--success) 42%, var(--text) 58%);
}

.notification-pill.approval {
  border-color: rgba(var(--warning-rgb), 0.46);
  background: rgba(var(--warning-rgb), 0.2);
  color: color-mix(in srgb, var(--warning) 54%, var(--text) 46%);
}

.notification-menu-time {
  font-size: var(--font-size-xs);
  color: var(--text-dim);
}

.notification-menu-agent {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Placeholder while the access catalog (display-name map) is still loading —
 * same shimmer family as .chat-skeleton-line. */
.notification-menu-agent-skeleton {
  display: inline-block;
  width: 7.5rem;
  height: var(--font-size-sm);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(var(--edge-rgb), 0.12) 0%,
    rgba(var(--edge-rgb), 0.26) 46%,
    rgba(var(--edge-rgb), 0.12) 100%
  );
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  vertical-align: middle;
}

.notification-menu-text {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: 1.4;
}

.notification-menu-text--markdown {
  overflow-wrap: anywhere;
}

.notification-menu-text--markdown p,
.notification-menu-text--markdown ul,
.notification-menu-text--markdown ol,
.notification-menu-text--markdown pre,
.notification-menu-text--markdown blockquote {
  margin: 0;
}

.notification-menu-text--markdown > * + * {
  margin-top: var(--space-1);
}

.notification-menu-text--markdown ul,
.notification-menu-text--markdown ol {
  padding-left: var(--space-3);
}

.notification-menu-text--markdown code {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  color: var(--text);
  background: rgba(var(--edge-rgb), 0.14);
  border-radius: var(--radius-sm);
  padding: 1px 4px;
}

.notification-menu-text--markdown pre {
  overflow: visible;
  white-space: pre-wrap;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  background: rgba(var(--edge-rgb), 0.14);
}

.notification-menu-text--markdown pre code {
  padding: 0;
  background: transparent;
}

.notification-menu-text--markdown table {
  display: table;
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: var(--font-size-xs);
}

.notification-menu-text--markdown th,
.notification-menu-text--markdown td {
  padding: var(--space-0-5) var(--space-1);
  border: 1px solid rgba(var(--edge-rgb), 0.22);
  white-space: normal;
  overflow-wrap: anywhere;
}

.notification-menu-text--markdown th {
  color: var(--text);
  font-weight: var(--font-weight-semibold);
  background: rgba(var(--edge-rgb), 0.12);
}

.notification-menu-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
  margin-top: 2px;
}

.notification-menu-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-1-5);
  margin-top: 2px;
}

.notification-pill-footer {
  align-self: flex-end;
}

.notification-menu-footer .notification-menu-actions {
  margin-top: 0;
}

.notification-open-btn,
.notification-action-btn {
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  background: rgba(var(--edge-rgb), 0.1);
  color: var(--text-muted);
  cursor: pointer;
}

.notification-delete-btn {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  border-radius: var(--radius-sm);
  background: rgba(var(--edge-rgb), 0.1);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.notification-delete-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-open-btn:hover:enabled,
.notification-action-btn:hover:enabled,
.notification-delete-btn:hover:enabled {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
}

.notification-action-btn.approve {
  border-color: rgba(var(--success-rgb), 0.4);
  background: rgba(var(--success-rgb), 0.15);
  color: color-mix(in srgb, var(--success) 42%, var(--text) 58%);
}

.notification-action-btn.deny {
  border-color: rgba(var(--danger-rgb), 0.4);
  background: rgba(var(--danger-rgb), 0.14);
  color: color-mix(in srgb, var(--danger) 42%, var(--text) 58%);
}

.notification-item {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--edge-rgb), 0.28);
  background: var(--bg-elev);
}

.notification-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.notification-item-title-block {
  min-width: 0;
  display: grid;
  gap: var(--space-0-5);
}

.notification-item-recipe {
  font-size: var(--font-size-md);
  line-height: 1.2;
  color: var(--text);
}

.notification-item-namespace {
  font-size: var(--font-size-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notification-item-time {
  font-size: var(--font-size-xs);
  color: var(--text-dim);
  white-space: nowrap;
}

.notification-item-message {
  font-size: var(--font-size-md);
  line-height: 1.45;
  color: var(--text-muted);
}

.notification-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.notification-item-chip {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  border-radius: 999px;
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  padding: 2px 8px;
  background: var(--surface-soft);
}

.notification-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1-5);
}

.approval-action-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--edge-rgb), 0.32);
  background: var(--surface-soft);
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.approval-action-btn:hover:enabled {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.42);
}

.approval-action-btn.approve {
  border-color: rgba(var(--success-rgb), 0.42);
  background: rgba(var(--success-rgb), 0.16);
}

.approval-action-btn.approve:hover:enabled {
  background: rgba(var(--success-rgb), 0.24);
  border-color: rgba(var(--success-rgb), 0.56);
}

.approval-action-btn.deny {
  border-color: rgba(var(--danger-rgb), 0.42);
  background: rgba(var(--danger-rgb), 0.14);
}

.approval-action-btn.deny:hover:enabled {
  background: rgba(var(--danger-rgb), 0.22);
  border-color: rgba(var(--danger-rgb), 0.56);
}

.notification-action-btn:disabled,
.notification-section-refresh:disabled,
.approval-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.notification-item.expiring-soon {
  border-left: 3px solid rgba(var(--warning-rgb, 200, 160, 40), 0.72);
}

.notification-item.expired {
  border-color: rgba(var(--danger-rgb), 0.4);
  background: var(--bg-elev-2);
}

.notification-item-expired-label {
  font-size: var(--font-size-sm);
  font-style: italic;
  color: rgba(var(--danger-rgb), 0.8);
}

.notification-action-state {
  border-radius: 999px;
  padding: 2px 7px;
  font-size: var(--font-size-2xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.notification-action-state.approved {
  border: 1px solid rgba(var(--success-rgb), 0.4);
  background: rgba(var(--success-rgb), 0.16);
  color: color-mix(in srgb, var(--success) 44%, var(--text) 56%);
}

.notification-action-state.denied {
  border: 1px solid rgba(var(--danger-rgb), 0.4);
  background: rgba(var(--danger-rgb), 0.14);
  color: color-mix(in srgb, var(--danger) 44%, var(--text) 56%);
}

.status-banner {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
  border-radius: var(--radius-control);
  border: 1px solid var(--control-border);
  background: rgba(var(--edge-rgb), 0.1);
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-sm);
  box-shadow: none;
  opacity: 1;
}

.status-banner.tone-info {
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 78%, var(--accent) 22%);
}

.status-banner.tone-success {
  color: color-mix(in srgb, var(--success) 20%, var(--text) 80%);
  background: color-mix(in srgb, var(--panel) 80%, var(--success) 20%);
  border-color: rgba(var(--success-rgb), 0.36);
}

.status-banner.tone-error {
  color: color-mix(in srgb, var(--danger) 26%, var(--text) 74%);
  background: color-mix(in srgb, var(--panel) 78%, var(--danger) 22%);
  border-color: rgba(var(--danger-rgb), 0.36);
}

.profile-menu-wrapper {
  position: relative;
  z-index: var(--layer-dropdown);
}

.profile-trigger {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: transparent;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.profile-trigger:hover:enabled,
.profile-trigger.open {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.28);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  border: 1px solid rgba(var(--edge-rgb), 0.4);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 16px 28px rgba(var(--overlay-rgb), 0.4);
  padding: var(--space-1-5);
  z-index: var(--layer-dropdown);
}

.workspace-layout {
  min-height: 0;
  overflow: visible;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: calc(100vh - var(--window-titlebar-height));
}

.left-nav {
  --sidebar-flyout-layer: calc(var(--layer-dropdown) + 1000);
  --sidebar-height: calc(100vh - var(--window-titlebar-height));
  --sidebar-logo-brand-gap: 4px;
  --sidebar-logo-pad-top: 8px;
  --sidebar-nav-parent-pad-x: var(--space-1);
  --sidebar-nav-icon-gap: var(--space-1);
  --sidebar-nav-action-size: 28px;
  --sidebar-nav-label-indent: calc(
    var(--sidebar-nav-parent-pad-x) + 16px + var(--sidebar-nav-icon-gap)
  );
  --sidebar-nav-child-bg-bleed: var(--space-1);
  /* Floor so the Files tree keeps a usable, scrollable height when Chat sessions
     and apps are also expanded on a short window; below this the panel would
     collapse to 0 and the nav-column scroll fallback could never reach it. */
  --sidebar-file-explorer-min-height: 160px;
  width: 328px;
  min-width: 328px;
  max-width: 328px;
  padding: 0 var(--space-2) var(--space-2);
  display: flex;
  flex-direction: column;
  background: var(--sidebar-gradient);
  border: 1px solid rgba(var(--edge-rgb), 0.5);
  border-radius: 0;
  position: sticky;
  top: 0;
  z-index: var(--sidebar-flyout-layer);
  align-self: start;
  height: var(--sidebar-height);
  min-height: var(--sidebar-height);
  max-height: var(--sidebar-height);
  overflow: visible;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-right: 1px solid rgba(var(--edge-rgb), 0.38);
  box-shadow: none;
}

.left-nav.collapsed {
  width: 74px;
  min-width: 74px;
  max-width: 74px;
  padding-left: var(--space-1);
  padding-right: var(--space-1);
}

.sidebar-collapse-toggle.ui-icon-button {
  margin-left: auto;
  margin-right: 0;
  position: relative;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  z-index: 1;
  flex: 0 0 auto;
}

.sidebar-collapse-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    width var(--motion-fast),
    height var(--motion-fast),
    transform var(--motion-fast);
}

.sidebar-collapse-icon.expanded {
  transform: rotate(180deg);
}

.sidebar-collapse-toggle.ui-icon-button:hover:enabled {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: none;
  filter: none;
}

.sidebar-collapse-toggle.ui-icon-button:focus-visible {
  background: transparent;
  border-color: rgba(var(--focus-rgb), 0.68);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
  transform: none;
  filter: none;
}

.sidebar-collapse-toggle.ui-icon-button:hover:enabled .sidebar-collapse-icon,
.sidebar-collapse-toggle.ui-icon-button:focus-visible .sidebar-collapse-icon {
  width: 16px;
  height: 16px;
}

.sidebar-logo {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2-5);
  padding: var(--sidebar-logo-pad-top) var(--space-1) var(--space-2);
  margin-bottom: var(--space-1);
  min-height: 56px;
  /* It's a logo, not selectable copy — hovering/clicking must not blue-highlight
     the wordmark as a text selection. */
  -webkit-user-select: none;
  user-select: none;
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  gap: var(--sidebar-logo-brand-gap);
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  min-width: 0;
  border-radius: var(--radius-md);
  -webkit-user-select: none;
  user-select: none;
}

/* Bare <button>: the global button:hover:enabled accent fill (--accent-strong)
   outranks .sidebar-logo-link's background: none by specificity and paints the
   wordmark accent on hover. The logo has no hover affordance by design; keep it flat.
   Same leak already guarded on .nav-latest-session__main. */
.sidebar-logo-link:hover:enabled,
.sidebar-logo-link:active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: inherit;
}

.sidebar-logo-link:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.5);
  outline-offset: 2px;
}

.sidebar-mobile-menu-indicator {
  display: none;
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: var(--text-dim);
}

.sidebar-mobile-backdrop {
  display: none;
}

.sidebar-mobile-menu-indicator svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--motion-fast);
}

.sidebar-logo-mark {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  display: none;
  /* An <img>: user-select alone doesn't stop the blue image selection/drag ghost
     on hover/click. Make it inert so the <button> parent owns the interaction. */
  pointer-events: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

.sidebar-logo-lockup {
  display: block;
  width: 100%;
  max-width: 160px;
  /* Match the .sidebar-logo-mark height (28px) so the icon portion of the
     lockup renders at the same size as the standalone collapsed mark. The
     lockup's icon graphic spans the full SVG height, so render height = icon
     height. */
  max-height: 28px;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
  background: transparent;
  /* An <img> (logotype SVG): make it inert so hover/click can't blue-highlight
     it as an image selection/drag; the <button> parent owns the click. */
  pointer-events: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

.sidebar-logo-lockup--dark {
  display: none;
}

:root[data-theme='dark'] .sidebar-logo-lockup--light {
  display: none;
}

:root[data-theme='dark'] .sidebar-logo-lockup--dark {
  display: block;
}

.sidebar-menu-surface {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: clip;
  padding-bottom: 0;
  min-width: 0;
}

.nav-link-group {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.nav-link-group--bottom {
  margin-top: auto;
}

.nav-available-apps {
  display: grid;
  gap: 0;
  min-width: 0;
  margin: 0 0 var(--space-1) 0;
}

.nav-available-app {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  min-height: 28px;
  padding: var(--space-0-5) var(--sidebar-nav-parent-pad-x) var(--space-0-5)
    var(--sidebar-nav-label-indent);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  transition:
    background var(--motion-fast),
    color var(--motion-fast),
    border-color var(--motion-fast);
}

.nav-available-app.active {
  border-color: transparent;
  background: rgba(var(--accent-rgb), 0.12);
}

.nav-available-app:hover:enabled {
  background: var(--list-item-hover-bg);
  color: var(--text);
}

.nav-available-app:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.nav-available-app__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
}

/* Sidebar file explorer (spec 18 §3.A) — the accordion panel under "Files". */
.nav-file-explorer {
  min-width: 0;
  margin: 0 0 var(--space-1) 0;
  padding-left: var(--sidebar-nav-label-indent);
  /* Claim the sidebar's leftover height so the tree gets real room; the scroll
     is contained to .da-file-explorer below instead of the whole nav column.
     The min-height floor stops expanded siblings (Chat sessions, apps) from
     squeezing the tree to 0 on a short window: at the floor the whole .nav-links
     column overflows and scrolls to it, instead of the tree vanishing in place. */
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: var(--sidebar-file-explorer-min-height);
}

.da-file-explorer {
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* Chromium-only renderer: declaring scrollbar-width/scrollbar-color here would
     disable the ::-webkit-scrollbar pill below, so the custom thumb owns it. */
}

.da-file-explorer::-webkit-scrollbar {
  width: 8px;
}

.da-file-explorer::-webkit-scrollbar-thumb {
  background: rgba(var(--edge-rgb), 0.4);
  border-radius: 999px;
  /* Padded track so the thumb reads as a thin floating pill, not a full-width bar. */
  border: 2px solid transparent;
  background-clip: padding-box;
}

.da-file-explorer::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--edge-rgb), 0.6);
  background-clip: padding-box;
}

.da-file-explorer__message {
  padding: var(--space-1) var(--space-1);
  color: var(--text-dim);
  font-size: var(--font-size-xs);
}

/* Revoked-access surface for the sidebar tree — the compact-chrome sibling of
   the Files page's "File access is not authorized" empty state + Retry. */
.da-file-explorer__revoked {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-1);
}

.da-file-explorer__revoked-title {
  margin: 0;
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.da-file-explorer__revoked-body {
  margin: 0;
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-normal);
}

.da-file-explorer__tree,
.da-file-explorer__group {
  display: grid;
  align-content: start;
  gap: 0;
  min-width: 0;
}

.da-file-explorer__group {
  margin-left: var(--space-2);
  padding-left: var(--space-1);
  border-left: 1px solid rgba(var(--edge-rgb), 0.24);
}

.da-file-explorer__item {
  min-width: 0;
}

.da-file-explorer__row {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-0-5);
}

.da-file-explorer__toggle.ui-icon-button {
  width: 22px;
  min-width: 22px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--text-dim);
}

.da-file-explorer__toggle.ui-icon-button:hover:enabled,
.da-file-explorer__toggle.ui-icon-button:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-strong);
}

.da-file-explorer__toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--motion-fast);
}

.da-file-explorer__toggle.is-expanded svg {
  transform: rotate(90deg);
}

.da-file-explorer__toggle-placeholder {
  width: 22px;
  height: 26px;
}

.da-file-explorer__label.ui-button {
  min-width: 0;
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-0-5) var(--space-1);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  text-align: left;
}

.da-file-explorer__label.ui-button:hover:enabled,
.da-file-explorer__label.ui-button:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.38);
  background: var(--list-item-hover-bg);
  box-shadow: none;
  color: var(--text);
}

.da-file-explorer__label.is-selected {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
}

/* An unreadable row (folder grant without inheritance / non-inheriting parent)
   stays focusable so its activation can toast, but reads as non-actionable:
   muted text/icon even on hover and focus. The focus-visible frame/background
   from the base rule is kept for keyboard accessibility. */
.da-file-explorer__label--no-access.ui-button,
.da-file-explorer__label--no-access.ui-button:hover:enabled,
.da-file-explorer__label--no-access.ui-button:focus-visible {
  color: var(--text-dim);
}

.da-file-explorer__label--no-access .da-file-explorer__icon {
  color: var(--text-dim);
}

.da-file-explorer__no-access-badge {
  flex: 0 0 auto;
}

/* ── Drag-and-drop states (rev-2 D1; refusal UX matrix §5) ────────────────
   Tone-keyed by REASON, existing tokens only, no motion. Only `allowed`
   paints the accent (blue); `checking` is neutral; a deny paints the error
   inset unless its reason re-maps the tone — `same-parent` is the no-op
   (info, edge tokens) and the unknown family is a warning, never a deny
   look. Labels stay readable: the tint + inset carry the verdict, not label
   dimming (the old dim-only treatment was the invisible one). The Files
   grid's own tone rules live with the grid block further down the sheet,
   where they out-rank its row and hover backgrounds. */
.da-file-explorer__row[data-drop-state='checking'] {
  background: rgba(var(--edge-rgb), 0.08);
}

.da-file-explorer__row[data-drop-state='allowed'] {
  background: rgba(var(--accent-rgb), 0.12);
}

.da-file-explorer__row[data-drop-state='allowed'] .da-file-explorer__label.ui-button {
  background: transparent;
}

/* Deny = error inset + tint (UX matrix A1–A8). */
.da-file-explorer__row[data-drop-state='denied'] {
  background: rgba(var(--danger-rgb), 0.1);
  box-shadow: inset 2px 0 0 rgba(var(--danger-rgb), 0.72);
}

/* A4 no-op: informational, never error-red. */
.da-file-explorer__row[data-drop-state='denied'][data-drop-reason='same-parent'] {
  background: rgba(var(--edge-rgb), 0.12);
  box-shadow: inset 2px 0 0 rgba(var(--edge-rgb), 0.6);
}

/* A10 unknown/unverifiable: warning, must not look denied. */
.da-file-explorer__row[data-drop-state='denied'][data-drop-reason='unavailable'],
.da-file-explorer__row[data-drop-state='denied'][data-drop-reason='target-unavailable'],
.da-file-explorer__row[data-drop-state='denied'][data-drop-reason='source-location-unknown'],
.da-file-explorer__row[data-drop-state='unavailable'] {
  background: rgba(var(--warning-rgb), 0.1);
  box-shadow: inset 2px 0 0 rgba(var(--warning-rgb), 0.72);
}

/* Draggable tree labels and grid rows show the grab affordance. */
.da-file-explorer__label.ui-button[draggable='true'] {
  cursor: grab;
}

.da-grid__row--compact[draggable='true'] {
  cursor: grab;
}

.da-file-explorer__icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--text-dim);
}

.da-file-explorer__icon svg {
  width: 15px;
  height: 15px;
}

.da-file-explorer__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
}

.da-file-explorer__more {
  padding: var(--space-0-5) var(--space-1);
}

.nav-latest-sessions {
  display: grid;
  gap: 0;
  min-width: 0;
  margin: 0 0 var(--space-1) 0;
}

.nav-latest-sessions__list {
  display: grid;
  gap: 0;
  min-width: 0;
}

.nav-latest-sessions__empty {
  padding: var(--space-1) var(--space-2);
  color: var(--text-dim);
  font-size: var(--font-size-xs);
}

.nav-latest-session {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto var(--sidebar-nav-action-size);
  align-items: center;
  gap: 0;
  min-width: 0;
  padding: 0 var(--sidebar-nav-parent-pad-x) 0 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  transition:
    background var(--motion-fast),
    color var(--motion-fast);
}

.nav-latest-session.active {
  border-color: transparent;
  background: rgba(var(--accent-rgb), 0.12);
}

.nav-latest-session:hover {
  background: var(--list-item-hover-bg);
}

.nav-latest-session__main,
.nav-latest-session__menu-button {
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
}

.nav-latest-session__main {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
  min-width: 0;
  padding: 0 var(--space-1) 0 var(--sidebar-nav-label-indent);
  text-align: left;
}

/* __main is a bare <button>, so the global button:hover:enabled accent fill
   leaks onto it on hover and paints the row accent-blue over the neutral row
   hover. Reset it back to transparent so the row's own neutral hover shows
   through — the menu-button already has the same guard below. */
.nav-latest-session:hover .nav-latest-session__main,
.nav-latest-session:hover .nav-latest-session__menu-button {
  background: transparent;
  border-color: transparent;
  color: var(--text);
}

.nav-latest-session .nav-latest-session__menu-button.ui-icon-button,
.nav-latest-session .nav-latest-session__menu-button.ui-icon-button:hover:enabled {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.nav-latest-session__main:focus-visible,
.nav-latest-session__menu-button:focus-visible,
.nav-latest-sessions__toggle:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.nav-latest-session__menu-button svg {
  width: 14px;
  height: 14px;
}

.nav-latest-session__copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.nav-latest-session__title,
.nav-latest-session__agent {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: var(--line-height-tight);
}

.nav-latest-session__title {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.nav-latest-session__agent {
  color: var(--text-dim);
  font-size: var(--font-size-2xs);
}

.nav-latest-session__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin-right: -4px;
}

.nav-latest-session__badge:not(:empty) {
  padding-right: var(--space-1);
}

.nav-latest-session__menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sidebar-nav-action-size);
  padding: 0;
  color: var(--text-dim);
}

.nav-latest-session__menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  z-index: calc(var(--layer-dropdown) + 10);
  display: grid;
  min-width: 120px;
  padding: var(--space-1);
  border: 1px solid rgba(var(--edge-rgb), 0.4);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  box-shadow: 0 12px 24px rgba(var(--overlay-rgb), 0.34);
}

.nav-latest-session__menu button {
  min-height: 30px;
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-align: left;
}

.nav-latest-session__menu button:hover:enabled {
  background: var(--list-item-hover-bg);
  color: var(--text);
}

.nav-latest-session__menu button:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.nav-latest-session__menu button.danger {
  color: var(--danger);
}

.nav-latest-session__rename-input {
  min-width: 0;
  width: 100%;
  height: 24px;
  border: 1px solid rgba(var(--focus-rgb), 0.5);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: var(--font-size-sm);
  padding: 0 var(--space-1);
}

.nav-latest-session__rename-input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.nav-latest-sessions__toggle {
  justify-self: start;
  min-height: 24px;
  margin-left: var(--sidebar-nav-label-indent);
  padding: 0 var(--space-1) 0 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.nav-latest-sessions__toggle:hover:enabled {
  color: var(--accent-strong);
  background: var(--list-item-hover-bg);
}

.nav-link-divider {
  display: block;
  height: 1px;
  margin: var(--space-1) 6px;
  background: rgba(var(--edge-rgb), 0.38);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-1);
  padding-bottom: var(--space-0-5);
  display: grid;
}

.sidebar-settings-menu-wrapper {
  position: relative;
  z-index: var(--sidebar-flyout-layer);
  min-width: 0;
}

.sidebar-settings-trigger.open,
.sidebar-settings-trigger:hover:enabled {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.36);
}

.sidebar-settings-chevron,
.sidebar-settings-menu-arrow {
  width: var(--space-3);
  height: var(--space-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  color: var(--text-dim);
  flex: 0 0 auto;
}

.sidebar-settings-chevron svg,
.sidebar-settings-menu-arrow svg {
  width: var(--space-3);
  height: var(--space-3);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-settings-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + var(--space-1-5));
  min-width: 230px;
  display: grid;
  gap: var(--space-0-5);
  border: 1px solid rgba(var(--edge-rgb), 0.4);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: 0 16px 28px rgba(var(--overlay-rgb), 0.4);
  padding: var(--space-1-5);
  z-index: calc(var(--sidebar-flyout-layer) + 20);
}

.sidebar-settings-profile {
  display: grid;
  grid-template-columns: calc(var(--space-5) + var(--space-1-5)) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-1) var(--space-1-5);
}

.sidebar-settings-profile-avatar {
  width: calc(var(--space-5) + var(--space-1-5));
  height: calc(var(--space-5) + var(--space-1-5));
  border-radius: 999px;
  background: var(--avatar-gradient);
  display: grid;
  place-items: center;
}

.sidebar-settings-profile-avatar span {
  color: var(--text-inverse);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.sidebar-settings-profile-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.sidebar-settings-profile-name,
.sidebar-settings-profile-email {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.15;
}

.sidebar-settings-profile-name {
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.sidebar-settings-profile-email {
  color: var(--text-muted);
  font-size: var(--font-size-2xs);
}

.sidebar-settings-menu-item-wrapper {
  position: relative;
  min-width: 0;
}

.sidebar-settings-menu-item {
  width: 100%;
  min-height: calc(var(--space-5) + var(--space-2));
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  text-align: left;
  transform: none;
  filter: none;
}

.sidebar-settings-menu-item:hover:enabled,
.sidebar-settings-menu-item.active {
  background: var(--list-item-hover-bg);
  border-color: rgba(var(--accent-rgb), 0.34);
  color: var(--text);
  transform: none;
  filter: none;
}

.sidebar-settings-menu-item.active {
  background: var(--list-item-selected-bg);
  border-color: var(--list-item-selected-border);
  font-weight: var(--font-weight-semibold);
}

.sidebar-settings-menu-text,
.sidebar-settings-menu-item .ui-menu-item__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.sidebar-theme-icon-btn {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--edge-rgb), 0.4);
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--text-muted);
}

.sidebar-theme-icon-btn:hover:enabled {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.42);
  color: var(--text);
}

.sidebar-theme-icon-btn:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.sidebar-theme-icon-btn.is-sun {
  color: var(--text);
}

.sidebar-profile-menu-wrapper {
  position: relative;
  z-index: var(--layer-dropdown);
  flex: 1 1 auto;
  min-width: 0;
}

.sidebar-profile-chip {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(var(--edge-rgb), 0.4);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  text-align: left;
  min-width: 0;
}

.sidebar-profile-chip:hover:enabled,
.sidebar-profile-chip.open {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.36);
}

.sidebar-profile-chip:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.sidebar-profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--avatar-gradient);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.sidebar-profile-avatar .avatar-initials {
  font-size: var(--font-size-sm);
}

.sidebar-profile-text {
  min-width: 0;
  display: grid;
  gap: 1px;
  flex: 1 1 auto;
}

.sidebar-profile-name {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-email {
  margin: 0;
  font-size: var(--font-size-2xs);
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-chevron {
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--text-dim);
}

.sidebar-profile-chevron svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-profile-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  min-width: 0;
  border: 1px solid rgba(var(--edge-rgb), 0.4);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: 0 16px 28px rgba(var(--overlay-rgb), 0.4);
  padding: var(--space-1-5);
  z-index: calc(var(--layer-dropdown) + 20);
}

.nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sidebar-nav-icon-gap);
  text-align: left;
  border-radius: var(--radius-sm);
  min-height: 34px;
  padding: 0 var(--sidebar-nav-parent-pad-x);
  border: 1px solid transparent;
  background: var(--list-item-bg);
  color: var(--text-muted);
  font-size: var(--font-size-md);
  font-weight: 500;
  position: relative;
  transform: none;
  filter: none;
  transition:
    background var(--motion-fast),
    border-color var(--motion-fast),
    color var(--motion-fast);
}

.nav-icon,
.nav-link .ui-nav-item__icon,
.sidebar-settings-menu-item .ui-menu-item__icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  color: var(--text-dim);
  flex-shrink: 0;
}

.nav-icon svg,
.nav-link .ui-nav-item__icon svg,
.sidebar-settings-menu-item .ui-menu-item__icon svg {
  width: 16px;
  height: 16px;
}

.nav-link-label,
.nav-link .ui-nav-item__label {
  white-space: nowrap;
}

.nav-link.active {
  border-color: var(--list-item-selected-border);
  background: var(--list-item-selected-bg);
  color: var(--text);
  font-weight: 600;
}

.nav-link.active .nav-icon,
.nav-link.active .ui-nav-item__icon {
  color: var(--text);
}

.nav-link:hover:enabled {
  background: var(--list-item-hover-bg);
  transform: none;
  filter: none;
}

.nav-link--with-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-nav-action-size);
  gap: 0;
  padding-right: var(--sidebar-nav-parent-pad-x);
}

/* The Chat row carries an extra "new chat" icon to the LEFT of the session
 * toggle, so it needs three columns: main | new-chat | chevron. Apps rows keep
 * the default two-column layout. */
.nav-link--with-toggle.nav-link--with-new-chat {
  grid-template-columns:
    minmax(0, 1fr) var(--sidebar-nav-action-size)
    var(--sidebar-nav-action-size);
}

.nav-link--with-toggle:hover {
  background: var(--list-item-hover-bg);
}

.nav-link .nav-link-main.ui-nav-item,
.nav-link--with-toggle .nav-link-session-toggle.ui-icon-button,
.nav-link--with-toggle .nav-link-new-chat.ui-icon-button,
.nav-link .nav-link-main.ui-nav-item:hover:enabled,
.nav-link--with-toggle .nav-link-session-toggle.ui-icon-button:hover:enabled,
.nav-link--with-toggle .nav-link-new-chat.ui-icon-button:hover:enabled {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.nav-link-main,
.nav-link-session-toggle,
.nav-link-new-chat {
  min-width: 0;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
}

.nav-link-main {
  display: flex;
  align-items: center;
  gap: var(--sidebar-nav-icon-gap);
  padding: 0;
  text-align: left;
}

.nav-link-session-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: var(--sidebar-nav-action-size);
  color: var(--text-dim);
}

.nav-link-session-toggle:hover:enabled {
  color: var(--text);
}

/* "New chat" icon, immediately LEFT of the chat session chevron. Mirrors the
 * session toggle's sizing/theme so the two read as a pair. [title] drives the
 * native hover tooltip ("New chat"). */
.nav-link-new-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: var(--sidebar-nav-action-size);
  color: var(--text-dim);
}

.nav-link-new-chat:hover:enabled {
  color: var(--text);
}

.nav-link-new-chat svg {
  width: 16px;
  height: 16px;
}

.nav-link-main:focus-visible,
.nav-link-session-toggle:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.nav-link-session-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--motion-fast);
}

.nav-link-session-toggle svg.expanded {
  transform: rotate(90deg);
}

.nav-link:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.nav-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  border-radius: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(var(--edge-rgb), 0.35);
  background: var(--surface-strong);
  color: var(--text);
  font-size: var(--font-size-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fast);
  z-index: var(--layer-dropdown);
}

.left-nav.collapsed .sidebar-logo-mark {
  display: block;
}

.left-nav.collapsed .sidebar-logo-lockup {
  display: none;
}

.left-nav.collapsed .sidebar-logo {
  justify-content: center;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

.left-nav.collapsed .sidebar-logo-mark {
  width: 28px;
  height: 28px;
}

.left-nav.collapsed .sidebar-collapse-toggle {
  position: absolute;
  right: -4px;
  top: 50%;
  margin: 0;
  margin-top: -14px;
  transform: none;
}

.left-nav.collapsed .nav-link {
  justify-content: center;
  padding: 0;
  min-height: 40px;
}

.left-nav.collapsed .nav-link--with-toggle {
  display: flex;
}

.left-nav.collapsed .nav-link .ui-nav-item__trailing {
  display: none;
}

.left-nav.collapsed .nav-link-main {
  justify-content: center;
  width: 100%;
  min-height: 38px;
}

.left-nav.collapsed .nav-link-session-toggle {
  display: none;
}

.left-nav.collapsed .nav-link-label,
.left-nav.collapsed .nav-link .ui-nav-item__label {
  display: none;
}

.left-nav.collapsed .nav-latest-sessions {
  display: none;
}

.left-nav.collapsed .nav-link-divider {
  margin-left: var(--space-1);
  margin-right: var(--space-1);
}

.left-nav.collapsed .sidebar-footer-row {
  justify-content: center;
}

.left-nav.collapsed .sidebar-settings-chevron {
  display: none;
}

.left-nav.collapsed .sidebar-settings-menu {
  position: fixed;
  left: calc(74px + var(--space-1));
  right: auto;
  bottom: 16px;
  width: 230px;
  z-index: calc(var(--sidebar-flyout-layer) + 60);
}

.left-nav.collapsed .sidebar-profile-menu-wrapper {
  flex: 0 0 auto;
}

.left-nav.collapsed .sidebar-profile-chip {
  width: 40px;
  padding: 0;
  justify-content: center;
}

.left-nav.collapsed .sidebar-profile-menu {
  left: calc(100% + 8px);
  right: auto;
  min-width: 136px;
  bottom: 0;
}

.left-nav.collapsed .sidebar-profile-text,
.left-nav.collapsed .sidebar-profile-chevron {
  display: none;
}

.left-nav.collapsed .nav-link:hover .nav-tooltip,
.left-nav.collapsed .nav-link:focus-visible .nav-tooltip {
  opacity: 0;
}

.logout-link {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.2);
}

.logout-link:hover:enabled {
  background: rgba(var(--danger-rgb), 0.12);
  border-color: rgba(var(--danger-rgb), 0.4);
}

.logout-icon {
  flex-shrink: 0;
}

.profile-logout-btn {
  width: 100%;
  justify-content: flex-start;
  min-height: 34px;
}

.content-panel {
  --app-notification-drawer-width: clamp(280px, 42vw, 420px);
  --app-header-utilities-width: calc(var(--app-notification-drawer-width) + var(--space-4));
  /* Chat drawer owns its own width, decoupled from the notification drawer.
     React sets `--chat-drawer-width` inline (session-only, drag-resizable); this
     clamp is only the pre-mount / closed-state fallback. Floor 340px == the
     drawer's min-width (see useChatDrawerResize). */
  --chat-drawer-width: clamp(340px, 32vw, 525px);

  height: calc(100vh - var(--window-titlebar-height));
  min-height: 0;
  overflow: hidden;
  overflow-x: hidden;
  position: relative;
  z-index: var(--layer-content);
  padding: var(--space-1) var(--space-2) var(--space-2) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2-5);
  border-radius: 0;
  border: 0;
  background: var(--panel);
  box-shadow: none;
  backdrop-filter: none;
}

/* Agent page scrolls inside content-panel; the panel itself is the scroll container */
.content-panel:has(.agent-page) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: calc(100vh - var(--window-titlebar-height));
  padding: var(--space-4) var(--space-4) 0;
  gap: 0;
}

.content-panel:has(.agent-page) > .agent-page {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
}

/* Explicit class-based fallback for the same layout behavior in agent chat mode. */
.content-panel.content-panel--agent-chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: calc(100vh - var(--window-titlebar-height));
  /* Top pad clears the absolute top-bar: its space-2 top offset + the header's
     own height + a bit of gap below it. space-2 * 5 is the smallest step of the
     spacing scale that covers that stack; the other three sides are just space-2. */
  padding: calc(var(--space-2) * 5) var(--space-2) var(--space-2) var(--space-2);
  gap: 0;
}

/* The absolute top-bar aligns to the panel's own space-2 edges here (the panel
   owns the extra top breathing room via its padding, not the header). */
.content-panel.content-panel--agent-chat > .top-bar {
  top: var(--space-2);
  right: var(--space-2);
}

.content-panel.content-panel--agent-chat.content-panel--titlebar-actions {
  padding-top: var(--space-1);
}

.content-panel.content-panel--agent-chat > .agent-page {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
}

.content-panel.content-panel--settings {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: calc(100vh - var(--window-titlebar-height));
  padding: var(--space-1) var(--space-2) var(--space-2) var(--space-2);
  gap: var(--space-2-5);
}

/* -------------------------------------------------------------------------- */
/* Page shell (page/page-header/page-card/page-tabs)                           */
/* -------------------------------------------------------------------------- */

.page {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2-5);
  overflow: hidden;
}

.page-layout {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  display: grid;
  gap: var(--space-2-5);
  overflow: auto;
}

.page-header {
  flex: 0 0 auto;
  display: grid;
  gap: 4px;
}

.page-header h2 {
  font-size: var(--font-size-2xl);
  line-height: 1.2;
}

.page-header h3 {
  font-size: var(--font-size-3xl);
  line-height: 36px;
}

.page-card {
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  padding: var(--space-3);
  box-shadow: var(--shadow-soft);
}

.page > .page-card,
.page > .teams-detail-page-card {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
}

.page-card__header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  align-items: flex-start;
}

.page-card__header h3 {
  font-size: var(--font-size-2xl);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

.page-tabs,
.agents-fleet-tabs,
.context-tabs,
.team-tabs {
  margin-top: var(--space-2-5);
  display: flex;
  gap: var(--space-0-5);
  flex-wrap: wrap;
  padding-bottom: 2px;
}

/* .page-tab / .agents-fleet-tab / .context-tab / .team-tab share the
   .ui-tab-button design language (base, hover, active, focus grouped in the
   Common controls section). Only the container spacing lives here. */

.badge-row {
  display: flex;
  gap: var(--space-1-5);
  flex-wrap: wrap;
  margin-top: var(--space-1-5);
}

/* Shared square-chip base for Badge and ReferenceTag (§5 chip consolidation).
   Identical geometry + edge; each keeps its own tone / kind accents and the
   Pill is the fully-rounded variant. */
.badge,
.reference-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  width: fit-content;
  max-width: 22ch;
  height: 22px;
  min-height: 22px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: var(--radius-control);
  border: 1px solid var(--control-border);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  padding: 0 var(--space-1-5);
  color: var(--text-muted);
  background: rgba(var(--edge-rgb), 0.12);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge.tone-success {
  color: color-mix(in srgb, var(--success) 20%, var(--text) 80%);
  border-color: rgba(var(--success-rgb), 0.46);
  background: rgba(var(--success-rgb), 0.18);
}

/* tone-accent is the blue accent (was mis-mapped to --success). */
.badge.tone-accent {
  color: color-mix(in srgb, var(--accent) 72%, var(--text) 28%);
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.12);
}

.badge.tone-warning {
  color: color-mix(in srgb, var(--warning) 42%, var(--text) 58%);
  border-color: rgba(var(--warning-rgb), 0.34);
  background: rgba(var(--warning-rgb), 0.16);
}

.badge.tone-danger {
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.32);
  background: rgba(var(--danger-rgb), 0.14);
}

.badge.tone-info {
  color: color-mix(in srgb, var(--info) 48%, var(--text) 52%);
  border-color: rgba(var(--info-rgb), 0.34);
  background: rgba(var(--info-rgb), 0.16);
}

.badge.tone-accent::before {
  content: '';
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.settings-layout {
  width: 100%;
  max-width: none;
}

.settings-page {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.settings-page > .settings-layout {
  overflow-y: auto;
  align-content: start;
  padding-bottom: var(--space-4);
}

.settings-tabs {
  margin-top: 0;
}

.settings-tab-panel {
  display: grid;
  gap: var(--space-2-5);
  align-content: start;
  min-width: 0;
}

.settings-card {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  padding: var(--space-4);
}

.settings-card .page-card__header .muted {
  margin-top: var(--space-0-5);
}

.settings-card .page-card__header h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  letter-spacing: 0;
}

.settings-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 0;
}

.settings-card-title-icon {
  --settings-title-icon-size: calc(var(--space-5) + (var(--space-0-5) * 2));
  width: var(--settings-title-icon-size);
  height: var(--settings-title-icon-size);
  flex: 0 0 var(--settings-title-icon-size);
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--edge-rgb), 0.42);
  background: var(--surface-soft);
  color: var(--text-muted);
}

.settings-card-title-icon svg {
  width: var(--space-4);
  height: var(--space-4);
}

.settings-social-channel-list {
  display: grid;
  gap: var(--space-2);
}

.settings-social-channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid rgba(var(--edge-rgb), 0.42);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.settings-social-channel-copy {
  display: grid;
  gap: var(--space-0-5);
  min-width: 0;
}

.settings-social-channel-name {
  color: var(--text);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  letter-spacing: 0;
}

.settings-form {
  --settings-control-width: clamp(64ch, 35%, 74ch);
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

.settings-form > .settings-field,
.settings-form > .settings-runtime-details--diagnostics,
.settings-form > .settings-runtime-diagnostic-error {
  width: min(100%, var(--settings-control-width));
}

.settings-channel-fallback-form > .ui-field,
.settings-channel-fallback-form > .settings-checkbox-option {
  width: min(100%, var(--settings-control-width));
}

.settings-form > .settings-field--compact {
  width: fit-content;
  max-width: 100%;
}

.settings-field--compact .settings-radio-list {
  width: max-content;
  max-width: 100%;
  grid-template-columns: minmax(14ch, max-content);
}

.settings-account-summary {
  max-width: 520px;
}

.settings-actions.settings-account-actions {
  max-width: 520px;
  justify-content: flex-start;
}

.settings-readonly-row {
  display: grid;
  grid-template-columns: minmax(140px, max-content) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: baseline;
  color: var(--text);
}

.settings-readonly-label {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.settings-runtime-details {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.settings-runtime-details--diagnostics {
  grid-template-columns: 1fr;
}

.settings-runtime-details div {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.settings-runtime-details dt {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.settings-runtime-details dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: var(--font-size-sm);
  overflow-wrap: anywhere;
}

.settings-runtime-diagnostic-error {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(var(--danger-rgb), 0.48);
  border-radius: var(--radius-sm);
  background: rgba(var(--danger-rgb), 0.1);
  color: var(--danger);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.settings-field {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.settings-field-legend {
  padding: 0;
  margin-bottom: var(--space-1);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.settings-radio-list {
  display: grid;
  gap: var(--space-1-5);
  align-content: start;
  width: 100%;
}

.settings-radio-option,
.settings-checkbox-option {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  min-height: 38px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(var(--edge-rgb), 0.42);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  cursor: pointer;
  transition:
    background var(--motion-fast),
    border-color var(--motion-fast),
    box-shadow var(--motion-fast);
}

.settings-radio-option:hover,
.settings-checkbox-option:hover {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.38);
}

.settings-radio-option:has(input:focus-visible),
.settings-checkbox-option:has(input:focus-visible) {
  border-color: rgba(var(--focus-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.settings-radio-option.is-selected,
.settings-checkbox-option.is-selected {
  border-color: rgba(var(--accent-rgb), 0.62);
  background: rgba(var(--accent-rgb), 0.14);
}

.settings-radio-option input[type='radio'],
.settings-checkbox-option input[type='checkbox'] {
  width: var(--space-3);
  min-width: var(--space-3);
  height: var(--space-3);
  min-height: var(--space-3);
  flex: 0 0 var(--space-3);
  margin: var(--space-0-5) 0 0;
  padding: 0;
  border-radius: 999px;
  accent-color: var(--accent);
  transform: none;
}

.settings-checkbox-option input[type='checkbox'] {
  border-radius: var(--radius-sm);
}

.settings-radio-option input[type='radio']:focus,
.settings-radio-option input[type='radio']:focus-visible,
.settings-checkbox-option input[type='checkbox']:focus,
.settings-checkbox-option input[type='checkbox']:focus-visible {
  box-shadow: none;
  outline: none;
}

.settings-radio-copy {
  min-width: 0;
  display: flex;
  align-items: center;
}

.settings-radio-title {
  color: var(--text);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
}

.settings-volume-label {
  color: var(--text);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
}

.settings-volume-row {
  display: grid;
  grid-template-columns:
    calc(var(--space-5) + var(--space-2)) minmax(0, 1fr)
    calc(var(--space-5) * 4);
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.settings-volume-mute-button {
  width: calc(var(--space-5) + var(--space-2));
  height: calc(var(--space-5) + var(--space-2));
  min-height: calc(var(--space-5) + var(--space-2));
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: var(--radius-sm);
  border-color: rgba(var(--edge-rgb), 0.42);
  background: var(--surface-soft);
  color: var(--text-muted);
}

.settings-volume-mute-button:hover:enabled {
  transform: none;
  filter: none;
  border-color: rgba(var(--accent-rgb), 0.38);
  background: var(--surface-hover);
}

.settings-volume-mute-button svg {
  width: var(--space-4);
  height: var(--space-4);
}

.settings-volume-slider {
  min-width: 0;
  height: var(--space-5);
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}

.settings-volume-slider:hover,
.settings-volume-slider:focus-visible {
  background: transparent;
}

.settings-volume-input {
  min-height: 36px;
  text-align: right;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

@media (max-width: 720px) {
  .desktop-update-dialog {
    padding: var(--space-4);
  }

  .desktop-update-dialog__versions {
    grid-template-columns: 1fr;
  }

  .settings-form {
    --settings-control-width: 100%;
  }

  .settings-social-channel-row {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-social-channel-row > .ui-button {
    width: 100%;
  }

  .settings-runtime-details div {
    grid-template-columns: 1fr;
  }
}

.list-grid {
  display: grid;
  gap: 9px;
  margin-top: var(--space-2);
}

.select-card {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: var(--space-2-5) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  border: 1px solid transparent;
}

.select-card.selected {
  border-color: rgba(var(--accent-rgb), 0.7);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.26);
}

/* Tabs are standardized via `.page-tabs` / `.page-tab`. Legacy classes remain
   for selector compatibility (grouped below in the page-shell section). */

.agents-fleet-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.agents-fleet-controls {
  display: grid;
  gap: var(--space-2);
}

.agents-fleet-kpi-card {
  border: 0;
  border-radius: var(--radius-md);
  background: rgba(var(--panel-rgb), 0.54);
  padding: var(--space-2) var(--space-2-5);
  display: grid;
  gap: var(--space-1);
}

.agents-fleet-kpi-label {
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.agents-fleet-kpi-value {
  color: var(--text);
  font-size: var(--font-size-3xl);
  line-height: 1;
  font-weight: 700;
}

.agents-fleet-board-card {
  display: grid;
  gap: var(--space-2);
  align-content: start;
}

.agents-table-card {
  display: grid;
  gap: var(--space-2-5);
  align-content: start;
}

/* `.agents-table-row-clickable` is preserved on each `<tr>` purely as a
   selector hook for Playwright e2e tests. All visual behavior comes from
   `.da-table__row--clickable` — this class adds no styles. Once the e2e
   suite migrates to `.da-table__row--clickable`, the alias can be removed
   from JSX too. */

.agent-row-main {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  font-size: var(--font-size-md);
}

.agent-row-main-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.agent-row-main-copy strong {
  font-size: var(--font-size-xl);
  line-height: 1.15;
}

.agent-row-description {
  color: var(--text-muted);
  font-size: var(--font-size-md);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(48vw, 420px);
}

.agent-row-main:hover:enabled {
  transform: none;
  filter: none;
}

.agent-row-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.2);
  border: 1px solid rgba(var(--accent-rgb), 0.44);
}

.agent-row-icon svg {
  width: 15px;
  height: 15px;
}

:root[data-theme='light'] .agent-row-icon {
  color: color-mix(in srgb, var(--accent) 70%, var(--text) 30%);
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.52);
}

.agent-table-muted {
  color: var(--text-muted);
}

.agent-row-scope-tags {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  max-width: 320px;
}

.agent-table-mcp {
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.agent-table-mcp-button {
  width: 100%;
  max-width: 100%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.agent-table-mcp-button:hover:enabled {
  color: var(--text);
}

.agent-table-mcp-button:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.62);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.2);
}

.agent-table-mcp-list {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-1);
  width: auto;
}

.agent-table-mcp-unavailable {
  color: var(--text-dim);
}

.agent-mcp-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  background: rgba(var(--panel-rgb), 0.82);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-2xs);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.agent-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  padding: 2px 9px;
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.agent-status-pill.running {
  color: var(--success);
  border-color: rgba(var(--success-rgb), 0.45);
  background: rgba(var(--success-rgb), 0.14);
}

.agent-status-pill.idle {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.44);
  background: rgba(var(--accent-rgb), 0.14);
}

.agent-status-pill.error {
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.46);
  background: rgba(var(--danger-rgb), 0.15);
}

.agent-table-actions-cell {
  display: flex;
  justify-content: center;
}

.agent-table-row-action {
  min-height: 28px;
  padding: 0 10px;
}

.agent-fleet-row-menu {
  position: fixed;
  min-width: 136px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--edge-rgb), 0.38);
  background: rgba(var(--panel-rgb), 0.98);
  box-shadow: var(--shadow-soft);
  padding: var(--space-1);
  z-index: 3200;
}

.agent-fleet-row-menu-item {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: var(--font-size-sm);
  text-align: left;
  padding: 0 8px;
}

.agent-fleet-row-menu-item:hover,
.agent-fleet-row-menu-item:focus-visible {
  background: rgba(var(--accent-rgb), 0.18);
}

.agent-fleet-row-menu-divider {
  height: 1px;
  margin: var(--space-1) 4px;
  background: rgba(var(--edge-rgb), 0.28);
}

.agent-page {
  min-height: 0;
  height: calc(100vh - var(--space-4));
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.agent-workspace-head {
  display: grid;
  gap: var(--space-1-5);
}

.agent-workspace-head-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--space-2);
  min-width: 0;
}

.agent-workspace-head-row .page-breadcrumb {
  padding-right: 0;
}

.agent-workspace-heading-stack {
  display: grid;
  gap: 2px;
  min-width: 0;
}

/* Lifetime token usage for the active conversation — a discreet pill under the
 * breadcrumb. `justify-self: start` keeps it intrinsic-width inside the heading
 * grid (otherwise the grid cell would stretch the pill full-width). */
.agent-chat-tokens-row {
  justify-self: start;
  margin-top: var(--space-1);
}

/* Shared token-usage indicator (header pill + per-message micro label).
 * Separate input (↑) / output (↓) stats; the cache glyph appears only when
 * the provider reports cache figures. The exact breakdown lives in a custom
 * hover/focus tooltip (same pattern as .agent-runtime-age-tooltip), so the
 * wrapper is focusable (tabIndex=0 in the components). */
.token-usage {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: default;
}

.token-usage-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.token-usage-stat svg {
  flex: 0 0 auto;
  opacity: 0.7;
}

.token-usage--pill .token-usage-stat + .token-usage-stat {
  margin-left: var(--space-1);
  padding-left: var(--space-1);
  border-left: 1px solid rgba(var(--edge-rgb), 0.5);
}

.token-usage--micro {
  color: var(--text-dim);
  font-size: var(--font-size-2xs);
}

.token-usage--micro .token-usage-stat + .token-usage-stat {
  margin-left: var(--space-1);
}

.token-usage-stat--cache {
  color: var(--text-dim);
}

.token-usage:hover .token-usage-stat--cache,
.token-usage:focus-within .token-usage-stat--cache {
  color: var(--text);
}

/* Header pill sits at the top of the workspace → tooltip drops below it.
 * The micro variant (message footer) flips above, anchored right, like
 * .agent-runtime-age-tooltip. */
.token-usage-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  gap: var(--space-0-5);
  min-width: max-content;
  padding: var(--space-1) var(--space-1-5);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--edge-rgb), 0.6);
  background: var(--panel);
  color: var(--text);
  font-size: var(--font-size-xs);
  font-weight: 500;
  line-height: 1.3;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 80ms ease;
  transition-delay: 40ms;
}

.token-usage--micro .token-usage-tooltip {
  left: auto;
  right: 0;
  top: auto;
  bottom: calc(100% + 8px);
}

.token-usage:hover .token-usage-tooltip,
.token-usage:focus-within .token-usage-tooltip {
  opacity: 1;
}

.token-usage-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

.token-usage-tooltip-label {
  color: var(--text-dim);
}

.token-usage-tooltip-value {
  font-variant-numeric: tabular-nums;
}

.token-usage-tooltip-divider {
  border-top: 1px solid rgba(var(--edge-rgb), 0.5);
  margin: var(--space-0-5) 0;
}

/* Row that holds the lifetime-token pill and the context-window chip together.
 * It owns the top offset and vertical centering for BOTH pills, so the inner
 * wrappers must not re-add their own `margin-top` / `justify-self` (that double
 * offset is what pushed the token pill out of alignment with the context chip). */
.agent-chat-indicators-row {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  margin-top: var(--space-1);
}

/* Inside the shared indicators row, the token wrapper is a plain flex child:
 * the row already supplies the top offset + centering, so neutralize the
 * standalone offsets to keep both pills on the same baseline. */
.agent-chat-indicators-row .agent-chat-tokens-row,
.agent-chat-indicators-row .context-window-indicator {
  margin-top: 0;
  justify-self: initial;
  display: inline-flex;
  align-items: center;
}

/* "Running on fallback" badge (spec §3-R5.9): only rendered when the Host is
 * actively serving from a configured fallback. Warning-toned pill matching the
 * indicators row's discreet chips. */
.fallback-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.fallback-badge-glyph {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

/* Context-window chip + click-to-open popover. The chip mirrors the lifetime
 * token pill's discreet style; the popover is anchored below it. Bucket colors
 * map to existing semantic tokens so they stay theme-aware. */
.context-window-indicator {
  position: relative;
  display: inline-flex;
}

.context-window-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.context-window-chip-glyph {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  border: 1.5px solid currentColor;
  opacity: 0.7;
}

/* Probe in flight, no fill figure yet: icon-only muted pill (no bare "—").
 * Resolves to either the full chip (snapshot) or hidden (cold session). */
.context-window-chip--loading {
  color: var(--text-dim);
}

.context-window-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  gap: var(--space-1-5);
  min-width: 240px;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--edge-rgb), 0.6);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.context-window-popover-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.context-window-popover-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-dim);
}

.context-window-popover-fill {
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
}

.context-window-bar {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(var(--edge-rgb), 0.25);
}

.context-window-bar-seg {
  height: 100%;
  width: var(--seg-width, 0%);
}

.context-window-rows {
  display: grid;
  gap: var(--space-0-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.context-window-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
}

.context-window-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.context-window-row-label {
  color: var(--text-dim);
}

.context-window-row-pct {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.context-window-bar-seg--messages,
.context-window-dot--messages {
  background: var(--accent);
}

.context-window-bar-seg--systemTools,
.context-window-dot--systemTools {
  background: var(--success);
}

.context-window-bar-seg--metaContext,
.context-window-dot--metaContext {
  background: var(--warning);
}

.context-window-bar-seg--systemPrompt,
.context-window-dot--systemPrompt {
  background: var(--info);
}

.context-window-cache {
  font-size: var(--font-size-2xs);
  color: var(--text-dim);
  border-top: 1px solid rgba(var(--edge-rgb), 0.4);
  padding-top: var(--space-1);
}

.context-window-empty {
  font-size: var(--font-size-xs);
  color: var(--text-dim);
}

/* Per-session model selector (R2). Chip mirrors the context-window chip's
 * discreet style and sits in the same indicators row; the popover is anchored
 * below it and lists the operator-allowed models. */
.model-selector {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.model-selector-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 220px;
  white-space: nowrap;
}

.model-selector-chip-glyph {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0.7;
}

.model-selector-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-selector-chip-caret {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}

.model-selector-chip--disabled {
  color: var(--text-dim);
  cursor: default;
}

.model-selector-applied {
  font-size: var(--font-size-2xs);
  color: var(--info);
  white-space: nowrap;
}

.model-selector-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  gap: var(--space-1);
  min-width: 220px;
  max-width: 300px;
  padding: var(--space-1-5);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--edge-rgb), 0.6);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.model-selector-notice {
  margin: 0;
  font-size: var(--font-size-2xs);
  color: var(--text-dim);
  line-height: var(--line-height-tight);
}

.model-selector-notice--warning {
  color: var(--warning);
}

.model-selector-notice--error {
  color: var(--danger);
}

.model-selector-list {
  display: grid;
  gap: var(--space-0-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.model-selector-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-1) var(--space-1-5);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: var(--font-size-xs);
  text-align: left;
  cursor: pointer;
}

.model-selector-item:hover,
.model-selector-item:focus-visible {
  background: rgba(var(--edge-rgb), 0.25);
}

.model-selector-item:disabled {
  opacity: 0.6;
  cursor: default;
}

.model-selector-item--active {
  background: rgba(var(--edge-rgb), 0.2);
  font-weight: var(--font-weight-medium);
}

.model-selector-item-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-selector-item-check {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Upward placement (composer): the chip is anchored at the bottom of the
 * window, so the popover expands above it and is right-aligned to the chip so
 * it never spills off the window edge next to the send button. */
.model-selector--up .model-selector-popover {
  top: auto;
  bottom: calc(100% + var(--space-1));
  left: auto;
  right: 0;
}

/* Keep the transient "applies to your next message" badge out of the flex flow
 * in the composer so it doesn't shove the send button while it's visible. */
.model-selector--up .model-selector-applied {
  position: absolute;
  bottom: calc(100% + var(--space-1));
  right: 0;
}

/* The selector sits in the composer action row, just left of the solid send
 * button. Restyle it (scoped to the composer, so the base Pill and the top
 * indicators-row usage stay untouched) so it reads as a sibling composer
 * CONTROL of the ghost "Add context" trigger and the solid send button — a
 * control-height pill with a subtle ghost surface and a clear hover, not a
 * flat status pill. Height 34px lines it up with the ghost reference trigger
 * (34px) and stays under the 36px send button; align-items:center (inherited
 * from .ui-pill) vertically centers it with both. */
.composer-actions-right .model-selector-chip {
  height: 34px;
  max-width: 160px;
  padding-inline: var(--space-2);
  gap: var(--space-1-5);
  /* Square control radius (F1 §5): the base Pill is fully rounded, but in the
     composer footer this chip is a control, not a status pill. */
  border-radius: var(--radius-control);
  border-color: rgba(var(--edge-rgb), 0.32);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
}

/* Interactive hover/focus mirrors the ghost trigger's affordance — background,
 * border, text-color and shadow only, never transform/scale/filter (control
 * rules, docs/agents/frontend-style-rules.md). */
.composer-actions-right .model-selector-chip.ui-pill--interactive:hover,
.composer-actions-right .model-selector-chip.ui-pill--interactive:focus-visible {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.42);
  color: var(--text);
}

.composer-actions-right .model-selector-chip.ui-pill--interactive:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.68);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
  outline: none;
}

/* Preserve the blocked-model warning (sessionModelBlocked) at rest so the tint
 * survives the neutral composer treatment above (higher specificity). */
.composer-actions-right .model-selector-chip.ui-pill--warning {
  border-color: rgba(var(--warning-rgb), 0.34);
  background: rgba(var(--warning-rgb), 0.16);
  color: color-mix(in srgb, var(--warning) 42%, var(--text) 58%);
}

/* Keep the warning tint through hover/focus — a blocked chip stays warning-toned
 * (deeper, not neutral) exactly when the user interacts with it. Higher
 * specificity than the neutral interactive rule so it wins on hover/focus. */
.composer-actions-right .model-selector-chip.ui-pill--warning.ui-pill--interactive:hover,
.composer-actions-right .model-selector-chip.ui-pill--warning.ui-pill--interactive:focus-visible {
  border-color: rgba(var(--warning-rgb), 0.5);
  background: rgba(var(--warning-rgb), 0.24);
  color: color-mix(in srgb, var(--warning) 52%, var(--text) 48%);
}

/* Degraded (selection unavailable): non-interactive, dimmed but still legible
 * on the ghost surface. Must follow the neutral rule to win on color. */
.composer-actions-right .model-selector-chip.model-selector-chip--disabled {
  color: var(--text-dim);
}

/* Caret reads as a control affordance (muted), not a status accent. */
.composer-actions-right .model-selector-chip-caret {
  opacity: 0.55;
}

.agent-workspace-agent-breadcrumb-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.agent-workspace-agent-route-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  z-index: calc(var(--layer-dropdown) + 90);
}

.agent-workspace-agent-route-trigger.ui-icon-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  color: var(--text-dim);
}

.agent-workspace-agent-route-trigger.ui-icon-button:hover:enabled,
.agent-workspace-agent-route-trigger.ui-icon-button:focus-visible {
  color: var(--text);
}

.agent-workspace-agent-route-trigger.ui-icon-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.agent-workspace-agent-route-menu-panel {
  position: absolute;
  left: 0;
  top: calc(100% + var(--space-1));
  width: max-content;
  min-width: 170px;
  display: grid;
  gap: var(--space-0-5);
  border: 1px solid rgba(var(--edge-rgb), 0.4);
  border-radius: var(--radius-md);
  background: var(--bg-elev-2);
  box-shadow: 0 16px 28px rgba(var(--overlay-rgb), 0.36);
  padding: var(--space-1);
  z-index: calc(var(--layer-dropdown) + 100);
}

.agent-workspace-agent-route-menu-item {
  min-height: 30px;
}

.agent-workspace-breadcrumb-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.agent-workspace-breadcrumb-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 26px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
}

.agent-workspace-breadcrumb-trigger svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--text-dim);
}

.agent-workspace-breadcrumb-trigger:hover:enabled .agent-workspace-breadcrumb-agent-link,
.agent-workspace-breadcrumb-trigger:focus-visible .agent-workspace-breadcrumb-agent-link,
.agent-workspace-breadcrumb-trigger:hover:enabled .agent-workspace-breadcrumb-route-label,
.agent-workspace-breadcrumb-trigger:focus-visible .agent-workspace-breadcrumb-route-label {
  color: var(--text);
}

.agent-workspace-breadcrumb-trigger:hover:enabled svg,
.agent-workspace-breadcrumb-trigger:focus-visible svg {
  color: var(--text);
}

.agent-workspace-breadcrumb-trigger:focus-visible {
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.26);
}

.agent-workspace-breadcrumb-agent-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: var(--font-size-lg);
  font-weight: 600;
  padding: 0;
  text-decoration: none;
  transition: color 0.15s ease;
}

.agent-workspace-breadcrumb-agent-link:hover {
  color: var(--text);
}

.agent-workspace-breadcrumb-route-label {
  color: var(--text);
}

.agent-workspace-conversation-subtitle {
  margin: 0;
  min-width: 0;
  color: var(--text-dim);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-workspace-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-4);
  min-width: 0;
}

.agent-workspace-title-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.agent-workspace-title {
  min-width: 0;
  color: var(--text);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0;
  line-height: var(--line-height-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-workspace-route-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
}

.agent-workspace-header {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-2-5);
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
}

/* ─── Agent Workspace Shell ──────────────────────────────────────────────── */

.agent-workspace-shell {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: visible;
  height: 100%;
  min-height: 100%;
  border-color: transparent;
  box-shadow: none;
}

.agent-workspace-shell .agent-workspace-top {
  padding: 10px 12px 8px;
}

.agent-workspace-shell .agent-workspace-tabs {
  padding: 0 12px;
}

.agent-workspace-shell .agent-session-strip {
  padding: var(--space-1) var(--space-2-5);
}

.agent-chat-nav-stack {
  display: grid;
  gap: 10px;
  background: inherit;
}

.agent-page--chat-scroll-nav .agent-chat-nav-stack {
  position: sticky;
  top: -16px;
  z-index: calc(var(--layer-header) - 1);
  overflow: visible;
  max-height: none;
  background: var(--panel);
  padding-bottom: var(--space-1);
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  transition:
    transform 220ms ease,
    opacity 180ms ease;
}

.agent-page--chat-scroll-nav:not(.chat-scroll-nav-visible) .agent-chat-nav-stack {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.agent-workspace-body-slot {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  /* Non-chat routes (Details / Connectors / Contexts / Activity / Files) render
   * directly in this slot and can exceed the viewport. The chat session variant
   * below re-declares overflow: hidden so its internal ChatThread owns scroll. */
  overflow-x: hidden;
  overflow-y: auto;
}

.agent-workspace-body-slot--session {
  flex: 1 1 auto;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

/* Pins the composer to the bottom grid row and gives the floating sync
 * indicator a positioning context. */
.agent-chat-composer-dock {
  position: relative;
}

/* Subtle sync/offline status, floated just above the composer. It's absolutely
 * positioned (out of the grid flow) so toggling it never reflows the thread —
 * which would otherwise shift the scroll position when it appears/disappears. */
.agent-chat-sync-indicator {
  position: absolute;
  bottom: 100%;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  font-size: var(--font-size-2xs);
  line-height: 1.4;
  color: var(--text-muted);
  user-select: none;
  pointer-events: none;
}

.agent-chat-sync-indicator--offline {
  color: var(--warning);
}

.agent-chat-sync-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.7;
  animation: agent-chat-sync-pulse 1.4s ease-in-out infinite;
}

.agent-chat-sync-indicator--offline .agent-chat-sync-indicator-dot {
  animation: none;
  opacity: 0.9;
}

@keyframes agent-chat-sync-pulse {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.9;
  }
}

.chat-page-skeleton .agent-workspace-shell {
  gap: var(--space-6);
}

.chat-page-skeleton__body {
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  min-height: min(52vh, 460px);
}

.chat-page-skeleton__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--space-7);
  align-items: center;
  gap: var(--space-2);
  width: min(100%, 720px);
  min-height: var(--space-7);
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-2);
  border: 1px solid rgba(var(--edge-rgb), 0.28);
  border-radius: var(--radius-lg);
  background: rgba(var(--panel-rgb), 0.42);
}

.chat-skeleton-line,
.chat-skeleton-send {
  display: block;
  background: linear-gradient(
    90deg,
    rgba(var(--edge-rgb), 0.12) 0%,
    rgba(var(--edge-rgb), 0.26) 46%,
    rgba(var(--edge-rgb), 0.12) 100%
  );
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.chat-skeleton-line {
  height: var(--space-1-5);
  border-radius: 999px;
}

.chat-skeleton-line--breadcrumb {
  width: 180px;
  height: var(--space-2);
}

.chat-skeleton-line--subtitle {
  width: 132px;
}

.chat-skeleton-line--greeting {
  width: min(70%, 360px);
  height: var(--space-3);
}

.chat-skeleton-line--composer {
  width: min(72%, 420px);
}

.chat-skeleton-send {
  width: var(--space-5);
  height: var(--space-5);
  border-radius: var(--radius-sm);
}

.chat-bubble.assistant .progress-stepper {
  margin-top: 0;
}

.chat-bubble.assistant .progress-stepper.status-completed {
  border: none;
  background: transparent;
  padding: 4px 0 0;
  margin-top: 0;
  opacity: 1;
}

.stepper-details-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-1);
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: color var(--motion-fast);
}

.stepper-details-toggle:hover {
  color: var(--text-muted);
}

.stepper-details-chevron {
  display: inline-block;
  font-size: var(--font-size-sm);
  line-height: 1;
  transition: transform 0.15s ease-out;
}

.stepper-details-chevron--open {
  transform: rotate(90deg);
}

.agent-workspace-shell .chat-thread-container {
  flex: 1 1 auto;
  min-height: 0;
}

.agent-workspace-shell .chat-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: var(--space-3);
  align-content: start;
}

.agent-workspace-shell .chat-thread-dedicated {
  padding-inline: 0;
}

.agent-workspace-shell .chat-empty-state {
  min-height: 0;
  padding: 32px 0 20px;
}

/* Center the empty state when the chat thread has no messages */
.agent-workspace-shell .chat-thread:not(:has(.chat-group)):not(.chat-thread-dedicated) {
  align-content: center;
  justify-items: center;
}

.agent-workspace-shell .agent-workspace-panel,
.agent-workspace-shell .agent-mcp-panel,
.agent-workspace-shell .agent-activity-dashboard {
  flex: 1 1 auto;
  overflow: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Non-chat route grids should keep their content grouped at the top. */
.agent-workspace-shell .agent-workspace-panel,
.agent-workspace-shell .agent-mcp-panel,
.agent-workspace-shell .agent-activity-dashboard {
  align-content: start;
}

/* Dedicated sessions (no active chat) inside the shell — compact list style */
.agent-workspace-shell .agent-dedicated-sessions-card {
  padding: 0 14px 14px;
  margin-top: -4px;
}

.agent-workspace-shell .agent-dedicated-sessions-header {
  padding: 8px 0 6px;
}

.agent-workspace-shell .agent-dedicated-sessions-list {
  gap: 4px;
  max-height: none;
}

.agent-workspace-shell .agent-dedicated-session-row {
  min-height: 36px;
  padding: var(--space-1-5) var(--space-2);
  border-radius: var(--radius-sm);
  border-color: rgba(var(--edge-rgb), 0.2);
  background: rgba(var(--panel-rgb), 0.5);
}

.agent-workspace-shell .agent-dedicated-session-row:hover,
.agent-workspace-shell .agent-dedicated-session-row:focus-within,
.agent-workspace-shell .agent-dedicated-session-row.menu-open {
  background: rgba(var(--accent-rgb), 0.08);
}

.agent-workspace-shell .agent-dedicated-session-title {
  font-size: var(--font-size-sm);
}

.composer-shell-footer {
  flex: 0 0 auto;
  padding: var(--space-3);
  position: static;
  z-index: 14;
  background: var(--panel);
  border-top: 0;
}

.degraded-banner {
  padding: var(--space-2-5) var(--space-3);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  color: var(--text);
  background: rgba(var(--warning-rgb, 255 170 0), 0.12);
}

.agent-workspace-shell .degraded-banner {
  border-top: 1px solid rgba(var(--edge-rgb), 0.14);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin: 0;
}

/* ──────────────────────────────────────────────────────────────────────────── */

.agent-workspace-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 12px;
  margin-top: 10px;
  padding-bottom: 8px;
  border-bottom: 0;
}

.agent-workspace-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2-5);
  min-width: 0;
}

.agent-workspace-title-stack {
  display: grid;
  gap: var(--space-1-5);
}

.agent-workspace-agent-line {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  min-width: 0;
}

.agent-workspace-agent-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: var(--font-size-3xl);
  font-weight: 700;
  line-height: 1.1;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.agent-workspace-agent-link:hover:enabled,
.agent-workspace-agent-link:focus-visible {
  color: var(--text);
}

/* ── New-chat landing ────────────────────────────────────────────────────── */

.agent-workspace-new-chat {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 0;
}

.agent-workspace-greeting-row {
  width: min(100%, 1120px);
  max-width: min(100%, 1120px);
  margin: 0 auto;
  padding: 50px 0 var(--space-1);
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: center;
  gap: var(--space-1-5);
  min-width: 0;
}

.agent-workspace-greeting-row .agent-workspace-greeting {
  margin: 0;
  color: var(--text);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  line-height: 1.1;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-workspace-greeting-row .agent-title-selector {
  flex: 0 0 auto;
  align-self: center;
}

/* Keep the new-chat title and selector identical to the origin/dev greeting
 * row while retaining the current composer and sessions layout below it. */
.agent-workspace-greeting-row .agent-title-selector-trigger.ui-button,
.agent-workspace-greeting-row .agent-title-selector-trigger.ui-button--sm {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  line-height: 1.1;
  min-height: 0;
}

.agent-workspace-greeting-row .agent-title-selector-trigger.ui-button--text.ui-button--transparent {
  color: var(--brand-deep-blue);
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transition: color 120ms ease;
}

.agent-workspace-greeting-row
  .agent-title-selector-trigger.ui-button--text.ui-button--transparent:hover,
.agent-workspace-greeting-row
  .agent-title-selector-trigger.ui-button--text.ui-button--transparent:focus-visible,
.agent-workspace-greeting-row
  .agent-title-selector-trigger.ui-button--text.ui-button--transparent[aria-expanded='true'] {
  color: var(--accent);
  outline: none;
  text-decoration: none;
}

.agent-workspace-greeting-row .agent-title-selector-trigger svg {
  width: 18px;
  height: 18px;
}

/* ── Agent title selector dropdown ──
 * Two targets per row: [3-dots] [agent name]. The 3-dots opens a sections
 * sub-menu (Details / Connectors / …); the name selects the agent. */

.agent-title-selector {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.agent-title-selector-trigger:focus-visible {
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.26);
}

.agent-title-selector-trigger-label {
  min-width: 0;
  max-width: 32ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* Keep the label aligned with the trigger's current color state. */
}

/* The chevron svg uses stroke; point it at currentColor so it follows the
 * trigger's current color state. */
.agent-title-selector-trigger svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Portaled to document.body and positioned by useFlyoutPosition with a fixed
   rect clamped to the chat drawer (or the viewport in full screen). It sits above
   the persistent sidebar flyout layer (dropdown + 1000), matching the
   GfsResourceMenu portal. */
.agent-title-selector-menu {
  position: fixed;
  z-index: calc(var(--layer-dropdown) + 1100);
  min-width: 240px;
  max-height: calc(100vh - (var(--space-4) * 2));
  overflow-y: auto;
  border: 1px solid rgba(var(--edge-rgb), 0.32);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-hard);
  padding: var(--space-1);
  display: grid;
  gap: var(--space-0-5);
}

.agent-title-selector-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-0-5);
  min-width: 0;
  /* The ROW owns the unified hover/focus background + radius so the name and
   * dots read as one continuous target — no inner seam between them. */
  border-radius: var(--radius-sm);
  transition: background 120ms ease;
}

.agent-title-selector-row:hover,
.agent-title-selector-row:focus-within {
  background: rgba(var(--accent-soft-rgb), 0.14);
}

/* Currently-selected agent row: a subtle persistent tint (stronger than hover)
 * so the active selection stays identifiable without relying on hover. Restores
 * the active indicator the predecessor ResourceBreadcrumbSwitcher conveyed via
 * MenuItem active=. */
.agent-title-selector-row--active {
  background: rgba(var(--accent-soft-rgb), 0.2);
}

.agent-title-selector-row--active .agent-title-selector-row-name {
  font-weight: var(--font-weight-semibold);
}

.agent-title-selector-row-name {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-1-5);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* The name never paints its own background — the row does. */
.agent-title-selector-row-name:hover,
.agent-title-selector-row-name:focus-visible {
  background: transparent;
  outline: none;
}

.agent-title-selector-row-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-title-selector-row-dots {
  flex: 0 0 auto;
  /* Padding (not a fixed box) gives the dots a comfortable tappable area
   * without painting any background — the row owns the unified hover bg. */
  padding: var(--space-1);
  margin-right: var(--space-0-5);
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  /* Hidden by default; revealed when the row is hovered/focused or the dots
   * menu is open. Keeps the agent list visually clean until interaction. */
  opacity: 0;
  transition: opacity 120ms ease;
}

/* Reveal the dots on row hover, dots focus, or when its sub-menu is open. */
.agent-title-selector-row:hover .agent-title-selector-row-dots,
.agent-title-selector-row:focus-within .agent-title-selector-row-dots,
.agent-title-selector-row-dots:focus-visible,
.agent-title-selector-row-dots[aria-expanded='true'] {
  opacity: 1;
  color: var(--text);
}

.agent-title-selector-row-dots svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Sections sub-menu: portaled to document.body and positioned by
   useFlyoutPosition (right-of its row's dots button, flipping/clamping inside the
   drawer or viewport). It must be portaled rather than nested because the menu is
   a scroll container (max-height + overflow) and an overflow box can't host a
   sub-menu that escapes it. Sits above the sidebar flyout layer, like the Gfs
   resource-menu submenu. */
.agent-title-selector-submenu {
  position: fixed;
  z-index: calc(var(--layer-dropdown) + 1101);
  width: min(200px, calc(100vw - (var(--space-4) * 2)));
  max-height: calc(100vh - (var(--space-4) * 2));
  overflow-y: auto;
  border: 1px solid rgba(var(--edge-rgb), 0.32);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-hard);
  padding: var(--space-1);
  display: grid;
  gap: var(--space-0-5);
}

.agent-title-selector-empty {
  color: var(--text-dim);
  font-size: var(--font-size-sm);
  padding: var(--space-1-5) var(--space-2);
}

.agent-workspace-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: calc(100% + 8px);
  right: auto;
  min-width: 150px;
  display: grid;
  gap: 2px;
  padding: var(--space-1);
  border: 1px solid rgba(var(--edge-rgb), 0.38);
  border-radius: var(--radius-sm);
  background: rgba(var(--panel-rgb), 0.98);
  box-shadow: var(--shadow-soft);
  z-index: calc(var(--layer-dropdown) + 20);
}

.agent-workspace-menu--breadcrumb {
  left: 0;
  right: auto;
}

.agent-workspace-menu--route {
  left: 0;
  right: auto;
}

.agent-workspace-actions-trigger {
  flex: 0 0 auto;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.agent-workspace-menu-item {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-align: left;
  padding: 0 8px;
}

.agent-workspace-menu-item:hover:enabled,
.agent-workspace-menu-item:focus-visible,
.agent-workspace-menu-item.active {
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--text);
}

.agent-workspace-menu-item.active {
  border-left: 2px solid rgba(var(--accent-rgb), 0.7);
}

.agent-runtime-age {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  cursor: default;
}

.agent-runtime-age-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.agent-runtime-age-dot.fresh {
  color: var(--success);
}

.agent-runtime-age-dot.stale {
  color: var(--warning);
}

.agent-runtime-age-dot.critical {
  color: var(--danger);
}

.agent-runtime-age.fresh {
  color: var(--success);
}

.agent-runtime-age.stale {
  color: var(--warning);
}

.agent-runtime-age.critical {
  color: var(--danger);
}

.agent-runtime-age-tooltip {
  position: absolute;
  right: 0;
  top: auto;
  bottom: calc(100% + 8px);
  z-index: 20;
  min-width: max-content;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--edge-rgb), 0.6);
  background: var(--panel);
  color: var(--text);
  font-size: var(--font-size-xs);
  font-weight: 500;
  line-height: 1.2;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 80ms ease;
  transition-delay: 40ms;
}

.agent-runtime-age:hover .agent-runtime-age-tooltip,
.agent-runtime-age:focus-within .agent-runtime-age-tooltip {
  opacity: 1;
}

.agent-workspace-agent {
  font-size: var(--font-size-2xl);
  line-height: 1.25;
  font-weight: 700;
  color: var(--agent-beige-text);
}

.agent-workspace-agent-description {
  max-width: 560px;
  font-size: var(--font-size-sm);
  line-height: 1.3;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-workspace-agent-model {
  color: var(--text-dim);
  font-weight: 500;
}

.agent-workspace-chat {
  font-size: var(--font-size-sm);
  color: var(--text-dim);
  line-height: 1.2;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-workspace-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.agent-workspace-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.agent-workspace-status-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(var(--edge-rgb), 0.36);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.agent-workspace-status-pill.running {
  color: var(--success);
  border-color: rgba(var(--success-rgb), 0.45);
  background: rgba(var(--success-rgb), 0.14);
}

.agent-workspace-status-pill.connecting {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.15);
}

.agent-workspace-status-pill.error {
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.42);
  background: rgba(var(--danger-rgb), 0.15);
}

.agent-workspace-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-0-5);
  padding-bottom: 2px;
}

.agent-workspace-tab {
  min-height: 26px;
  padding: 0 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.agent-workspace-tab.active {
  border-bottom-color: rgba(var(--accent-rgb), 0.72);
  color: var(--text);
}

.agent-new-chat-btn {
  margin: 0;
  min-height: 45px;
  padding: 0 16px;
  font-size: var(--font-size-md);
}

.agent-mcp-toggle-btn {
  min-height: 44px;
}

.agent-mcp-panel {
  display: grid;
  gap: var(--space-2-5);
  padding: var(--space-2-5);
}

.agent-mcp-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.agent-mcp-context-groups {
  display: grid;
  gap: var(--space-2);
}

.agent-mcp-context-group {
  border: 1px solid rgba(var(--edge-rgb), 0.22);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: var(--space-2);
  display: grid;
  gap: var(--space-1-5);
}

.agent-mcp-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.agent-mcp-context-agents {
  display: grid;
  gap: var(--space-1-5);
}

.agent-mcp-context-agent {
  border: 1px solid rgba(var(--edge-rgb), 0.2);
  border-radius: var(--radius-sm);
  background: rgba(var(--panel-rgb), 0.52);
  padding: var(--space-1-5);
  display: grid;
  gap: var(--space-1);
}

.agent-mcp-context-agent.is-selected {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.08);
}

.agent-mcp-context-agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1-5);
}

.agent-mcp-context-agent-link {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.agent-mcp-context-agent-link:hover,
.agent-mcp-context-agent-link:focus-visible {
  color: var(--accent);
}

.agent-mcp-context-agent-link:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.5);
  outline-offset: 2px;
  border-radius: 4px;
}

.agent-mcp-context-server-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.agent-mcp-context-server-chip {
  border: 1px solid rgba(var(--edge-rgb), 0.26);
  border-radius: 999px;
  background: rgba(var(--panel-rgb), 0.72);
  color: var(--text-muted);
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  line-height: 1.3;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
    monospace;
}

.agent-mcp-live-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.agent-workspace-panel {
  display: grid;
  gap: var(--space-2-5);
  padding: var(--space-2-5);
}

.message-artifact-actions {
  margin-top: var(--space-3);
  width: 100%;
  display: grid;
  gap: var(--space-1-5);
}

.message-artifact-note {
  margin: 0;
  font-size: var(--font-size-xs);
}

.message-artifact-panel {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: var(--radius-sm);
  background: var(--message-artifact-panel-bg);
  box-shadow: var(--message-artifact-panel-shadow);
}

.message-artifact-panel-header {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-1-5) var(--space-1) var(--space-2);
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.22);
}

.message-artifact-panel-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  color: var(--accent-strong);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.message-artifact-panel-title svg,
.message-artifact-download-all-btn svg,
.message-artifact-download-btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-artifact-download-all-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  cursor: pointer;
}

.message-artifact-download-all-btn:hover:not(:disabled) {
  color: var(--accent-contrast);
}

.message-artifact-download-all-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.message-artifact-list {
  display: grid;
}

.message-artifact-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-1-5) var(--space-2);
}

.message-artifact-item + .message-artifact-item {
  border-top: 1px solid rgba(var(--edge-rgb), 0.18);
}

.message-artifact-format {
  display: inline-flex;
  width: 28px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--edge-rgb), 0.24);
  border-radius: 4px;
  background: rgba(var(--edge-rgb), 0.2);
  color: var(--text);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.message-artifact-format--pdf {
  border-color: rgba(var(--danger-rgb), 0.34);
  background: rgba(var(--danger-rgb), 0.74);
  color: var(--text-inverse);
}

.message-artifact-format--md,
.message-artifact-format--txt {
  background: rgba(var(--edge-rgb), 0.5);
  color: var(--text);
}

.message-artifact-format--html,
.message-artifact-format--htm {
  border-color: rgba(var(--info-rgb), 0.34);
  background: rgba(var(--info-rgb), 0.22);
}

.message-artifact-file-copy {
  display: grid;
  min-width: 0;
  gap: var(--space-0-5);
}

.message-artifact-filename {
  overflow: hidden;
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-artifact-meta {
  overflow: hidden;
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-tight);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-artifact-actions-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: max-content;
}

.message-artifact-download-btn {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: var(--space-1);
  border: 1px solid rgba(var(--edge-rgb), 0.24);
  background: rgba(var(--panel-rgb), 0.46);
  color: var(--accent-strong);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-1-5);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  cursor: pointer;
}

.message-artifact-download-btn:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-contrast);
}

.message-artifact-download-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.message-artifact-preview-btn {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
}

.message-artifact-preview-btn:hover:not(:disabled) {
  color: var(--text);
}

.message-artifact-preview-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.message-artifact-error {
  margin: 0;
  color: var(--danger);
  font-size: var(--font-size-xs);
}

@media (max-width: 640px) {
  .message-artifact-item {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .message-artifact-actions-cell {
    grid-column: 2;
    justify-content: flex-start;
  }
}

.message-html-preview {
  border: 1px solid rgba(var(--edge-rgb), 0.32);
  border-radius: var(--radius-sm);
  background: rgba(var(--panel-rgb), 0.65);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.message-artifact-html-preview {
  margin-bottom: var(--space-2);
  width: 100%;
}

.message-artifact-markdown-preview {
  max-height: min(62vh, 540px);
  overflow: auto;
  padding: var(--space-2);
  border-top: 1px solid rgba(var(--edge-rgb), 0.24);
  background: rgba(var(--surface-rgb), 0.9);
}

.message-artifact-file-preview-frame {
  width: 100%;
  height: min(62vh, 540px);
  border: 0;
  display: block;
  background: var(--surface);
}

.message-artifact-markdown-preview {
  max-height: min(62vh, 540px);
  overflow: auto;
  padding: var(--space-2);
  border-top: 1px solid rgba(var(--edge-rgb), 0.24);
  background: rgba(var(--surface-rgb), 0.9);
}

.message-artifact-file-preview-frame {
  width: 100%;
  height: min(62vh, 540px);
  border: 0;
  display: block;
  background: var(--surface);
}

.message-artifact-html-preview-head,
.message-html-preview-head {
  font-size: var(--font-size-xs);
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: var(--space-1) var(--space-2);
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.24);
}

.message-html-preview-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-1-5);
}

.message-html-preview-warning-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--warning);
  font-size: var(--font-size-sm);
  line-height: 1;
  cursor: help;
}

.message-html-preview-badge {
  font-size: var(--font-size-2xs);
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(var(--edge-rgb), 0.36);
  color: var(--text-dim);
}

.message-html-preview-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-1-5) var(--space-2);
}

.message-html-preview-open-full-btn {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.2);
}

.message-html-preview-open-full-btn:hover {
  background: rgba(var(--accent-rgb), 0.28);
}

.message-artifact-html-preview-frame,
.message-html-preview-frame {
  width: 100%;
  height: min(62vh, 540px);
  border: 0;
  background: var(--surface);
  display: block;
}

.message-html-preview-note {
  margin: 0;
  padding: 8px 10px 10px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.message-html-preview-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 2300;
  background: rgba(var(--overlay-rgb), 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.message-html-preview-fullscreen-dialog {
  width: min(98vw, 1600px);
  height: min(96vh, 1100px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-2);
  border: 1px solid rgba(var(--edge-rgb), 0.75);
  border-radius: var(--radius-lg);
  background: rgba(var(--surface-rgb), 0.98);
  box-shadow: var(--shadow-hard);
  padding: var(--space-2-5);
}

.message-html-preview-fullscreen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.message-html-preview-fullscreen-head p {
  margin: 2px 0 0;
  font-size: var(--font-size-sm);
}

.message-html-preview-fullscreen-close {
  white-space: nowrap;
}

.message-html-preview-fullscreen-frame {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(var(--edge-rgb), 0.8);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: 1px solid rgba(var(--edge-rgb), 0.5);
  outline-offset: -1px;
  box-shadow: inset 0 0 0 1px rgba(var(--surface-rgb), 0.55);
}

.agent-workspace-body {
  min-height: 0;
  display: grid;
  gap: var(--space-2-5);
  --agent-sessions-column: minmax(96px, 0.15fr);
  grid-template-columns: var(--agent-sessions-column) minmax(0, 1fr);
  transition: grid-template-columns var(--motion-medium);
}

.agent-workspace-body.sessions-collapsed {
  --agent-sessions-column: 52px;
}

.agent-recent-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-2);
  padding: var(--space-2-5);
  align-self: start;
  position: sticky;
  top: 0;
  max-height: calc(100vh - 220px);
  transition:
    padding var(--motion-medium),
    max-height var(--motion-medium);
}

.agent-recent-panel.collapsed {
  grid-template-rows: auto;
  padding: 8px 6px;
}

.agent-recent-panel.collapsed .agent-recent-header {
  justify-content: center;
}

.agent-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
}

.agent-recent-header strong {
  font-size: var(--font-size-lg);
  line-height: 1.2;
}

.agent-recent-toggle {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.agent-recent-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.agent-recent-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: var(--space-1-5);
  align-content: start;
}

.agent-session-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  gap: var(--space-2);
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.14);
}

.agent-workspace-header .agent-session-strip {
  margin-top: 2px;
}

.agent-session-label {
  font-size: var(--font-size-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

.agent-session-list {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-1-5);
  overflow-x: auto;
  padding-bottom: 2px;
}

.agent-session-toggle {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  font-weight: 600;
  flex: 0 0 auto;
  align-self: center;
  white-space: nowrap;
  padding: 0 var(--space-0-5);
  cursor: pointer;
}

.agent-session-toggle:hover:enabled {
  color: var(--text);
}

.agent-session-toggle:disabled {
  cursor: default;
  opacity: 0.8;
}

.agent-session-chip {
  min-width: 0;
  max-width: 24ch;
  border: 1px solid rgba(var(--edge-rgb), 0.4);
  background: rgba(var(--panel-rgb), 0.66);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 12px;
  position: relative;
}

.agent-session-chip-main {
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  display: grid;
  gap: var(--space-0-5);
  text-align: left;
  padding: 2px 0;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  cursor: pointer;
}

.agent-session-chip-main:hover:enabled {
  transform: none;
  filter: none;
}

.agent-session-chip-main span {
  font-size: var(--font-size-sm);
  line-height: 1.2;
  max-width: 15ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-session-chip-main small {
  font-size: var(--font-size-xs);
  color: var(--text-dim);
  line-height: 1.1;
}

.agent-session-chip:hover {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.12);
}

.agent-session-chip.active {
  border-color: rgba(var(--edge-rgb), 0.5);
  background: rgba(var(--edge-rgb), 0.15);
}

.agent-session-chip.active::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: var(--accent);
}

.agent-history-btn {
  width: 40px;
  min-width: 40px;
  min-height: 100%;
  padding: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.agent-history-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: none;
}

.agent-session-chip-menu-btn {
  width: 20px;
  height: 20px;
  min-height: 20px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  padding: 0;
  font-size: var(--font-size-sm);
  line-height: 1;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  opacity: 0;
  transition: opacity var(--motion-fast);
}

.agent-session-chip:hover .agent-session-chip-menu-btn,
.agent-session-chip:focus-within .agent-session-chip-menu-btn,
.agent-session-chip.active .agent-session-chip-menu-btn,
.agent-session-chip.menu-open .agent-session-chip-menu-btn {
  opacity: 1;
}

.agent-session-chip-menu-btn:hover:enabled {
  transform: none;
  filter: none;
  border-color: rgba(var(--accent-rgb), 0.36);
  background: rgba(var(--accent-rgb), 0.18);
}

.agent-session-chip-menu-btn:focus-visible {
  opacity: 1;
  border-color: rgba(var(--focus-rgb), 0.68);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.22);
}

.agent-session-chip-menu {
  position: fixed;
  z-index: var(--layer-dropdown);
  min-width: 104px;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--edge-rgb), 0.42);
  background: var(--surface-strong);
  box-shadow: var(--shadow-hard);
}

.agent-session-chip-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-1) var(--space-2);
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: var(--font-size-sm);
  line-height: 1.25;
  cursor: pointer;
}

.agent-session-chip-menu-item:hover:enabled {
  transform: none;
  filter: none;
  background: rgba(var(--accent-rgb), 0.18);
}

.agent-session-chip-menu-item:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.68);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.22);
}

.agent-session-chip-menu-item.danger {
  color: var(--danger);
}

.agent-session-chip-menu-item.danger:hover:enabled {
  background: rgba(var(--danger-rgb), 0.18);
}

.agent-session-chip-rename-input {
  width: 100%;
  min-width: 0;
  border-radius: 6px;
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--panel-rgb), 0.92);
  color: var(--text);
  font-size: var(--font-size-sm);
  line-height: 1.2;
  padding: 3px 6px;
}

.agent-session-empty {
  font-size: var(--font-size-sm);
  align-self: center;
}

.agent-dedicated-sessions-card {
  display: grid;
  gap: var(--space-2);
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.agent-dedicated-sessions-card-inline {
  padding-top: var(--space-2);
  width: 100%;
  max-width: none;
}

.composer-inline,
.agent-dedicated-sessions-card-inline {
  width: min(100%, 1120px);
  max-width: min(100%, 1120px);
  margin-left: auto;
  margin-right: auto;
}

.agent-workspace-body-slot > .agent-workspace-new-chat > .composer-inline,
.agent-workspace-shell .agent-dedicated-sessions-card-inline {
  width: min(100%, 920px);
  max-width: min(100%, 920px);
}

.agent-workspace-body-slot > .agent-workspace-new-chat > .composer-inline {
  padding-top: var(--space-3);
}

.agent-dedicated-sessions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.agent-dedicated-sessions-list {
  display: grid;
  gap: 0;
  max-height: none;
  overflow: visible;
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(var(--surface-rgb), 0.72);
}

.agent-dedicated-sessions-meta {
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-1-5);
}

.agent-dedicated-session-row {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  border-radius: 0;
  border: 0;
  border-top: 0;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  position: relative;
}

.agent-dedicated-session-row:first-child {
  border-top: 0;
}

.agent-dedicated-session-row:hover,
.agent-dedicated-session-row:focus-within,
.agent-dedicated-session-row.menu-open {
  transform: none;
  filter: none;
  background: color-mix(in srgb, var(--list-item-hover-bg) 76%, var(--surface-soft) 24%);
}

.agent-dedicated-session-main,
.agent-dedicated-session-side {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.agent-dedicated-session-side {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  justify-self: end;
}

.agent-dedicated-session-main {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  flex: 1 1 auto;
}

.agent-dedicated-session-title-btn {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
}

.agent-dedicated-session-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  font-weight: 700;
  line-height: 1;
}

.agent-dedicated-session-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.agent-dedicated-session-title {
  min-width: 0;
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-dedicated-session-rename-input {
  width: min(100%, 38ch);
  min-width: 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--panel-rgb), 0.92);
  color: var(--text);
  font: inherit;
  font-size: var(--font-size-md);
  font-weight: 600;
  padding: var(--space-1) var(--space-1-5);
}

.agent-dedicated-session-rename-input:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.42);
  outline-offset: 1px;
}

.agent-dedicated-session-meta,
.agent-dedicated-session-date {
  min-width: 0;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  line-height: 1.25;
}

.agent-dedicated-session-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-dedicated-session-time {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  color: var(--text-dim);
  white-space: nowrap;
}

.agent-dedicated-session-menu-btn {
  width: 24px;
  height: 24px;
  min-height: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  padding: 0;
  font-size: var(--font-size-md);
  line-height: 1;
  display: inline-grid;
  place-items: center;
  opacity: 0;
  cursor: pointer;
  transition:
    opacity var(--motion-fast),
    border-color var(--motion-fast),
    background var(--motion-fast);
}

.agent-dedicated-session-menu-btn.ui-icon-button {
  border-radius: var(--radius-sm);
}

.agent-dedicated-session-row:hover .agent-dedicated-session-menu-btn,
.agent-dedicated-session-row:focus-within .agent-dedicated-session-menu-btn,
.agent-dedicated-session-row.menu-open .agent-dedicated-session-menu-btn {
  opacity: 1;
}

.agent-dedicated-session-menu-btn.ui-icon-button:hover:enabled {
  transform: none;
  filter: none;
  border-color: transparent;
  box-shadow: none;
  background: rgba(var(--accent-rgb), 0.18);
}

.agent-dedicated-session-menu-btn:focus-visible {
  opacity: 1;
  border-color: rgba(var(--focus-rgb), 0.68);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.22);
}

.agent-dedicated-session-chevron {
  color: var(--text-dim);
  font-size: var(--font-size-lg);
  line-height: 1;
}

.agent-dedicated-session-menu {
  position: absolute;
  right: var(--space-2);
  top: calc(100% - var(--space-1));
  z-index: var(--layer-dropdown);
  min-width: 104px;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--edge-rgb), 0.42);
  background: var(--surface-strong);
  box-shadow: var(--shadow-hard);
}

.agent-dedicated-session-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-1) var(--space-2);
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: var(--font-size-sm);
  line-height: 1.25;
  cursor: pointer;
}

.agent-dedicated-session-menu-item:hover:enabled {
  transform: none;
  filter: none;
  background: rgba(var(--accent-rgb), 0.18);
}

.agent-dedicated-session-menu-item:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.68);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.22);
}

.agent-dedicated-session-menu-item.danger {
  color: var(--danger);
}

.agent-dedicated-session-menu-item.danger:hover:enabled {
  background: rgba(var(--danger-rgb), 0.18);
}

.confirm-dialog-backdrop {
  position: fixed;
  inset: 0;
  /* Above the sidebar's --sidebar-flyout-layer (layer-dropdown + 1000 = 1120)
     so the dialog dims the navbar too. Matches .message-html-preview-fullscreen-overlay. */
  z-index: 2300;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgba(var(--overlay-rgb), 0.42);
}

.command-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: grid;
  place-items: start center;
  padding: min(18vh, calc(var(--space-5) + var(--space-5) + var(--space-5))) var(--space-4)
    var(--space-4);
  background: rgba(var(--overlay-rgb), 0.58);
  backdrop-filter: blur(10px);
}

.command-palette {
  width: min(680px, 100%);
  max-height: min(640px, 72vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  box-shadow: var(--shadow-hard);
}

.command-palette__header {
  padding: var(--space-3);
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.3);
}

.command-palette__header .ui-control {
  width: 100%;
}

.command-palette__list {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  min-height: 0;
  padding: var(--space-2);
  overflow-y: auto;
}

.command-palette__item.ui-button {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  text-align: left;
}

.command-palette__item.ui-button:hover:enabled,
.command-palette__item.ui-button.is-selected {
  transform: none;
  filter: none;
  background: rgba(var(--accent-rgb), 0.16);
}

.command-palette__item-copy,
.settings-shortcuts-action {
  min-width: 0;
  display: grid;
  gap: var(--space-0-5);
}

.command-palette__item-copy strong,
.settings-shortcuts-action strong {
  color: var(--text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-tight);
}

.command-palette__item-copy span,
.settings-shortcuts-action span {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-normal);
}

.command-palette kbd,
.settings-shortcuts-grid kbd {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: var(--space-4);
  padding: var(--space-0-5) var(--space-1-5);
  border: 1px solid rgba(var(--edge-rgb), 0.44);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  white-space: nowrap;
}

.command-palette__empty {
  margin: 0;
  padding: var(--space-5) var(--space-3);
  color: var(--text-muted);
  text-align: center;
}

.settings-shortcuts-grid {
  max-width: 760px;
}

.confirm-dialog {
  width: min(360px, 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--edge-rgb), 0.42);
  background: var(--surface-strong);
  box-shadow: var(--shadow-hard);
  padding: var(--space-3);
}

.confirm-dialog h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--font-size-lg);
}

.confirm-dialog-body {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.confirm-dialog-body p {
  margin: 0;
}

.confirm-dialog-body p + p {
  margin-top: var(--space-2);
}

.auth-environment-confirm-url {
  overflow-wrap: anywhere;
  border: 1px solid rgba(var(--edge-rgb), 0.5);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  color: var(--text-primary);
  background: rgba(var(--panel-rgb), 0.48);
  font-family: var(--font-family-mono);
}

.confirm-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.confirm-dialog-confirm--danger {
  background: var(--danger);
}

.desktop-update-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgba(var(--overlay-rgb), 0.58);
}

.desktop-update-dialog {
  width: min(560px, 100%);
  display: grid;
  gap: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--edge-rgb), 0.48);
  background: var(--surface-strong);
  box-shadow: var(--shadow-hard);
  padding: var(--space-5);
}

.desktop-update-dialog h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-tight);
}

.desktop-update-dialog__body {
  display: grid;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.desktop-update-dialog__body p {
  margin: 0;
}

.desktop-update-dialog__more-info {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
}

.desktop-update-dialog__more-info:hover {
  color: var(--accent-strong);
}

.desktop-update-dialog__more-info:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.52);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.desktop-update-dialog__versions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0;
}

.desktop-update-dialog__versions div {
  display: grid;
  gap: var(--space-1);
  border: 1px solid rgba(var(--edge-rgb), 0.42);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  background: rgba(var(--panel-rgb), 0.42);
}

.desktop-update-dialog__versions dt,
.desktop-update-dialog__versions dd {
  margin: 0;
}

.desktop-update-dialog__versions dt {
  color: var(--text-soft);
  font-size: var(--font-size-xs);
}

.desktop-update-dialog__versions dd {
  color: var(--text-primary);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.desktop-update-dialog__actions {
  display: block;
}

.desktop-update-dialog__actions .ui-button {
  width: 100%;
}

.agent-dedicated-sessions-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-1-5);
}

.agent-dedicated-sessions-footer .agent-dedicated-sessions-meta {
  padding: 0;
}

.agent-dedicated-session-date {
  color: var(--text-dim);
  white-space: nowrap;
}

.agent-page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2-5);
}

.agent-page-footer-model {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.agent-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2-5);
  min-height: 68px;
  padding: 14px 16px;
}

.agent-page-header h2 {
  font-size: var(--font-size-3xl);
  line-height: 34px;
  font-weight: 700;
}

.agent-page-header .muted {
  font-size: var(--font-size-md);
  font-weight: 500;
  color: var(--text-muted);
}

.agent-page-header .badge-row {
  margin-top: 0;
  align-items: center;
}

.host-runtime-card {
  display: grid;
  gap: 4px;
  padding: var(--space-1) var(--space-2);
  background: var(--surface-strong);
  border-color: rgba(var(--edge-rgb), 0.3);
  box-shadow: none;
}

.host-runtime-card h3 {
  font-size: var(--font-size-sm);
  line-height: 14px;
  letter-spacing: 0.02em;
  color: var(--text);
  margin: 0;
}

.host-runtime-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.host-runtime-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.host-runtime-label {
  font-size: var(--font-size-2xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.host-runtime-value {
  font-size: var(--font-size-sm);
  line-height: 14px;
  font-weight: 600;
  color: var(--text);
}

.host-runtime-note {
  font-size: var(--font-size-2xs);
  line-height: 12px;
  margin: 0;
}

.runtime-warning {
  color: var(--warning);
}

.chat-thread-container {
  position: relative;
  min-height: 0;
}

.chat-thread {
  height: 100%;
  min-height: 280px;
  max-height: none;
  overflow: auto;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
}

.chat-thread-dedicated {
  min-height: 0;
  align-content: start;
  gap: var(--space-2-5);
}

.chat-scroll-to-bottom {
  position: absolute;
  inset-inline: 0;
  inset-block-end: var(--space-3);
  z-index: var(--layer-chat-overlay);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.chat-scroll-to-bottom-button.ui-icon-button {
  border-color: rgba(var(--edge-rgb), 0.58);
  box-shadow: var(--shadow-soft);
  pointer-events: auto;
}

.chat-scroll-to-bottom-button.ui-icon-button.ui-icon-button--solid.ui-icon-button--neutral:hover:enabled {
  background: var(--bg-elev-2);
}

.chat-scroll-to-bottom-button.ui-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.chat-history-page-control {
  display: flex;
  justify-content: center;
  padding-block: var(--space-1);
}

.virtualized-message-chunk {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

.chat-thread-dedicated .virtualized-message-chunk {
  gap: var(--space-2-5);
}

.chat-empty-state {
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: var(--space-0-5);
  min-height: min(52vh, 460px);
  border: none;
  background: transparent;
  padding: 0;
}

.chat-empty-state.empty-state {
  border: none;
  background: transparent;
  padding: 0;
}

.chat-empty-state-dedicated {
  min-height: 0;
  padding: 2px 0 4px;
  gap: var(--space-1-5);
}

.chat-empty-state-dedicated .chat-empty-icon {
  width: 58px;
  height: 38px;
  border-radius: 0;
}

.chat-empty-state-dedicated .chat-empty-icon svg {
  width: 30px;
  height: 30px;
}

.chat-empty-state-dedicated .chat-empty-title {
  font-size: var(--font-size-2xl);
}

.chat-empty-title {
  margin: 0;
  font-size: var(--font-size-2xl);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.chat-empty-icon {
  width: 78px;
  height: 78px;
  border-radius: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chat-empty-icon svg {
  width: 51px;
  height: 51px;
  color: var(--text-dim);
  fill: currentColor;
}

.chat-thread::-webkit-scrollbar {
  width: 8px;
}

.chat-thread::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.5);
}

.chat-group {
  display: grid;
  gap: var(--space-1-5);
}

.chat-role-label {
  color: var(--text);
  letter-spacing: 0.02em;
  font-weight: 700;
  font-size: var(--font-size-md);
}

.chat-role-label-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-rgb), 0.45);
  text-underline-offset: 2px;
}

.chat-group.assistant .chat-role-label {
  color: var(--agent-beige-text);
}

.chat-group.assistant .chat-role-label-button {
  color: var(--agent-beige-text);
}

.chat-role-label-button:hover:enabled,
.chat-role-label-button:focus-visible {
  color: var(--text);
}

.chat-time-label {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.chat-bubble {
  max-width: min(760px, 74ch);
  padding: var(--space-2-5);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  background: rgba(var(--panel-rgb), 0.92);
  line-height: 1.55;
  position: relative;
  overflow: visible;
}

.chat-bubble.chat-bubble--wide {
  max-width: 100%;
  width: 100%;
}

/* D-2: the user turn is the single turn with a fill. The band wraps ONLY the
   message text — the meta row (timestamp) rides below it, outside the fill,
   mirroring VS Code. So the bubble is a transparent, right-aligned column and
   the fill lives on the .message-block child, not the bubble container. */
.chat-group.user .chat-bubble {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
}

/* The fill band: a solid neutral surface (not an accent tint), small control
   radius, shrink-wrapped to the message and right-aligned by the column above.
   Uses the solid --surface-3 (widget) level: --surface-soft is a translucent
   panel and the thread sits ON --panel, so it composited to the same color and
   read as an invisible container. */
.chat-group.user .chat-bubble .message-block {
  max-width: 100%;
  padding: var(--space-2-5);
  border: none;
  border-radius: var(--radius-control);
  background: var(--surface-3);
}

.message-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1-5);
}

.message-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: min(320px, 100%);
  min-width: 0;
  height: 28px;
  padding: var(--space-0-5) var(--space-1);
  border: 1px solid rgba(var(--edge-rgb), 0.28);
  border-radius: var(--radius-sm);
  background: rgba(var(--surface-rgb), 0.62);
  box-sizing: border-box;
}

.message-attachment-chip--response-file {
  max-width: min(420px, 100%);
}

.message-attachment-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  flex-basis: 20px;
}

.message-attachment-icon svg {
  width: 12px;
  height: 12px;
}

.message-attachment-type-label {
  flex: 0 0 auto;
  color: rgb(var(--muted-rgb));
  font-size: var(--font-size-xs);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-semibold);
}

.message-attachment-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-semibold);
}

.message-attachment-download-button {
  flex: 0 0 auto;
  min-height: 20px;
  padding-inline: var(--space-1);
}

/* BUG-176: sent-message image chips open the shared GfsImagePreview modal.
 * Same trigger contract as the composer's chip (transparent inline-flex
 * button inside the chip frame, zoom-in cursor, keyboard focus ring). */
.message-attachment-preview-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  flex: 1 1 auto;
  height: 100%;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: zoom-in;
  font: inherit;
  line-height: 1;
  text-align: left;
}

.message-attachment-preview-trigger:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.56);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.chat-bubble.assistant {
  padding: 0;
  border-color: transparent;
  background: transparent;
}

.chat-bubble.assistant .message-block {
  padding-right: 0;
}

.chat-loading-bubble {
  width: min(520px, 100%);
}

.chat-loading-skeleton {
  display: grid;
  gap: var(--space-1-5);
  padding: var(--space-1) 0;
}

.chat-loading-skeleton-row {
  height: 12px;
  width: min(420px, 82%);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(var(--edge-rgb), 0.14) 0%,
    rgba(var(--edge-rgb), 0.3) 46%,
    rgba(var(--edge-rgb), 0.14) 100%
  );
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.chat-loading-skeleton-row-title {
  width: min(300px, 58%);
}

.chat-loading-skeleton-row-short {
  width: min(240px, 44%);
}

.chat-bubble p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-group.assistant .message-block {
  color: var(--agent-reply-text);
}

.chat-message-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

/* The user meta-row rides in normal flow at the foot of the band (mirroring the
   assistant row), right-aligned. Inherits margin-top: var(--space-1) from the
   base row. */
.chat-message-meta-row--user {
  justify-content: flex-end;
  white-space: nowrap;
}

.chat-message-meta-row--user .chat-message-meta-main {
  margin-left: auto;
  justify-content: flex-end;
}

.chat-message-meta-row--user .message-copy-button--inline {
  margin-left: 0;
  position: relative;
}

/* Agent responses group their meta on the leading (left) edge, mirroring the
   user message's trailing grouping. The copy button leads, time follows. */
.chat-message-meta-row--assistant {
  justify-content: flex-start;
}

.chat-message-meta-row--assistant .message-copy-button--inline {
  margin-left: 0;
  order: -1;
}

.chat-message-meta-main {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  min-width: 0;
}

/* Error bubble — Layer K from LLM error handling spec */
.chat-bubble--error {
  background: rgba(var(--danger-rgb), 0.16);
  border: 1px solid rgba(var(--danger-rgb), 0.42);
}

.error-bubble-content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2-5) var(--space-3);
}

.error-bubble-icon {
  background: rgba(var(--danger-rgb), 0.32);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--danger);
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-top: 2px;
}

.error-bubble-label {
  color: var(--danger);
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: 4px;
}

.error-bubble-message {
  color: var(--text-muted);
  font-size: var(--font-size-md);
}

.error-bubble-details {
  margin-top: 8px;
}

.error-bubble-details > summary {
  cursor: pointer;
  color: var(--danger);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.error-bubble-details-text {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(var(--danger-rgb), 0.28);
  background: rgba(var(--overlay-rgb), 0.72);
  color: var(--text);
  font-size: var(--font-size-sm);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow: auto;
}

.activity-timeline {
  margin-top: var(--space-2);
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  padding: var(--space-1-5);
  display: grid;
  gap: var(--space-1-5);
}

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1-5);
}

.activity-header strong {
  font-size: var(--font-size-sm);
  letter-spacing: 0.02em;
}

.activity-status {
  font-size: var(--font-size-xs);
  border-radius: 999px;
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  padding: 1px 7px;
  color: var(--text);
}

.activity-status.streaming,
.activity-status.completed {
  border-color: rgba(var(--success-rgb), 0.46);
  color: var(--success);
}

.activity-status.reconnecting,
.activity-status.error {
  border-color: rgba(var(--danger-rgb), 0.46);
  color: var(--danger);
}

.activity-caret {
  display: inline-block;
  width: 6px;
  height: 12px;
  margin-left: 6px;
  border-radius: 2px;
  background: currentColor;
  animation: activity-caret-blink 0.9s steps(1, end) infinite;
  vertical-align: -1px;
}

@keyframes activity-caret-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.15;
  }
}

.activity-event-list {
  display: grid;
  gap: var(--space-1);
}

.activity-event {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  background: var(--surface-strong);
  padding: var(--space-1);
  display: grid;
  gap: var(--space-1);
  animation: activity-event-appear 0.18s ease-out;
}

@keyframes activity-event-appear {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.activity-event.severity-warn {
  border-color: rgba(var(--warning-rgb), 0.52);
}

.activity-event.severity-error {
  border-color: rgba(var(--danger-rgb), 0.52);
}

.activity-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: var(--space-1-5);
  align-items: center;
}

.activity-time,
.activity-type {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.activity-title {
  font-size: var(--font-size-sm);
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}

.activity-meta {
  max-height: 180px;
  font-size: var(--font-size-xs);
}

.activity-redaction,
.activity-error,
.activity-empty {
  font-size: var(--font-size-xs);
}

.chat-bubble pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: none;
}

/* §8: prose is a single voice — sans, body size, no box. The box (mono + fill +
   border + radius) is reserved for code/JSON, applied via `.json-content`, not
   the turn container. Assistant prose adds `.markdown-content` (already sans);
   user prose is a bare `.message-block` and inherits this default. */
.message-block {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: var(--font-size-md);
  line-height: 1.55;
}

.json-content {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
    monospace;
  font-size: var(--font-size-sm);
  line-height: 18px;
}

/* Code/JSON is the boxed voice: mono content in a subtle framed surface. */
.message-block.json-content {
  padding: var(--space-2-5);
  border-radius: var(--radius-md);
  background: rgba(var(--panel-rgb), 0.66);
  border: 1px solid rgba(var(--edge-rgb), 0.3);
}

.markdown-content {
  font-family: inherit;
  font-size: var(--font-size-md);
  line-height: 1.55;
  white-space: normal;
}

.markdown-content > *:first-child {
  margin-top: 0;
}

.markdown-content > *:last-child {
  margin-bottom: 0;
}

.markdown-content p {
  margin: 0 0 10px;
  white-space: normal;
}

.markdown-content ul,
.markdown-content ol {
  margin: 0 0 10px;
  padding-left: 22px;
}

.markdown-content li + li {
  margin-top: 4px;
}

.markdown-content blockquote {
  margin: 0 0 10px;
  padding-left: 12px;
  border-left: 3px solid rgba(var(--accent-rgb), 0.38);
  color: var(--text-muted);
}

.markdown-content a {
  color: var(--accent);
  text-underline-offset: 2px;
}

.markdown-content code {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
    monospace;
  font-size: var(--font-size-sm);
  padding: 1px 4px;
  border-radius: 5px;
  background: rgba(var(--edge-rgb), 0.2);
}

.markdown-content pre {
  margin: 0 0 10px;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  overflow: auto;
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  background: rgba(var(--panel-rgb), 0.66);
}

.markdown-content pre code {
  background: transparent;
  padding: 0;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 10px;
}

.markdown-content th,
.markdown-content td {
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.markdown-content th {
  background: rgba(var(--edge-rgb), 0.14);
}

.message-copy-button {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 0;
  border: 0;
  opacity: 0;
  transition: opacity 0.15s;
  background: transparent;
  color: var(--message-copy-icon-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    border-color var(--motion-fast),
    background var(--motion-fast),
    color var(--motion-fast);
}

.message-copy-button:hover {
  color: var(--message-copy-icon-hover-color);
}

.message-copy-button.copied {
  color: var(--success);
  opacity: 1;
}

.chat-bubble:hover .message-copy-button,
.chat-bubble.assistant .message-copy-button,
.message-copy-button:focus-visible {
  opacity: 1;
}

.message-copy-button:focus-visible {
  outline: 1px solid rgba(var(--focus-rgb), 0.7);
  outline-offset: 2px;
}

.message-copy-button--inline {
  margin-left: auto;
}

.message-copy-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.copy-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: rgba(var(--accent-rgb), 0.92);
  color: var(--text-inverse);
  font-size: var(--font-size-xs);
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  animation: copy-tooltip-in 0.15s ease-out;
}

@keyframes copy-tooltip-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.composer {
  display: grid;
  gap: var(--space-1-5);
  margin-top: var(--space-1-5);
  padding: var(--space-3);
}

.composer-inline {
  margin-top: 0;
  padding: 8px 0 0;
  border-top: 0;
}

.composer-inline textarea {
  min-height: 48px;
}

.empty-state-composer {
  background: rgba(var(--panel-rgb), 0.7);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.composer textarea {
  min-height: 56px;
  padding: var(--space-2-5);
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
  line-height: 20px;
  border: 1px solid var(--control-border);
  background: var(--surface-soft);
  resize: none;
}

.composer-input-shell {
  position: relative;
  display: grid;
  gap: var(--space-1-5);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  box-shadow: 0 1px 6px rgba(var(--overlay-rgb), 0.08);
}

.composer-textarea-viewport {
  overflow: hidden;
  border-radius: calc(var(--radius-md) - 1px);
}

.composer-input-shell:focus-within {
  border-color: rgba(var(--focus-rgb), 0.76);
  box-shadow: 0 0 0 1px rgba(var(--focus-rgb), 0.56);
}

.composer-input-shell--drag-active textarea {
  border-color: rgba(var(--accent-rgb), 0.58);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.24);
}

.composer-input-shell textarea {
  display: block;
  width: 100%;
  max-height: 240px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow-y: hidden;
}

.composer-input-shell textarea:focus {
  border-color: transparent;
  box-shadow: none;
}

.composer-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: var(--layer-content);
  border: 1px dashed rgba(var(--accent-rgb), 0.7);
  border-radius: var(--radius-md);
  background: rgba(var(--panel-rgb), 0.84);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  pointer-events: none;
}

.composer-input-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
  min-width: 0;
  padding: var(--space-1-5);
  border-top: 1px solid transparent;
}

.composer textarea::placeholder {
  color: var(--composer-placeholder);
}

.composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
  margin-top: var(--space-1-5);
  gap: var(--space-1-5);
}

.composer-runtime-meta {
  margin: 2px 0 0;
  font-size: var(--font-size-xs);
  line-height: 1.35;
  text-align: right;
}

.composer-send-button {
  margin-left: auto;
}

.composer-send-button-compact {
  min-height: 30px;
  padding: 0 10px;
  font-size: var(--font-size-sm);
}

.composer-send-icon-btn {
  min-height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: var(--radius-control);
  display: inline-grid;
  place-items: center;
}

.composer-send-icon-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.composer-send-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: auth-button-spin 0.7s linear infinite;
}

.composer-queue-inline {
  color: var(--text-dim);
  font-size: var(--font-size-2xs);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  opacity: 0.76;
}

.composer-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1-5);
  flex-wrap: wrap;
}

.composer-desktop-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
}

.composer-file-input {
  display: none;
}

.composer-attach-btn {
  white-space: nowrap;
  min-height: 30px;
  padding: 0 10px;
  font-size: var(--font-size-sm);
}

.composer-icon-btn {
  min-height: 30px;
  width: 30px;
  min-width: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.composer-icon-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workflow-run-artifacts {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-2);
  padding: var(--space-1-5);
  border: 1px solid rgba(var(--edge-rgb), 0.22);
  border-radius: var(--radius-sm);
  background: rgba(var(--panel-rgb), 0.42);
}

.workflow-run-artifacts__header,
.workflow-run-artifacts__list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.workflow-run-artifacts__header {
  justify-content: space-between;
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.workflow-run-artifact-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(var(--accent-soft-rgb), 0.14);
  color: var(--text);
  font-size: var(--font-size-sm);
}

.workflow-run-artifact-btn:hover:enabled,
.workflow-run-artifact-btn:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.44);
  background: rgba(var(--accent-rgb), 0.16);
}

.workflow-run-artifacts__empty,
.workflow-run-artifacts__message {
  margin: 0;
  font-size: var(--font-size-sm);
}

.agent-activity-dashboard {
  display: grid;
  gap: var(--space-2-5);
  padding: var(--space-2-5);
}

.agent-activity-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
}

.agent-activity-metric-card {
  border: 1px solid rgba(var(--edge-rgb), 0.22);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: var(--space-2-5);
  display: grid;
  gap: var(--space-1);
}

.agent-activity-metric-card h4 {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-muted);
}

.agent-activity-metric-card strong {
  font-size: var(--font-size-3xl);
  line-height: 1.05;
}

.agent-activity-chart-card {
  border: 1px solid rgba(var(--edge-rgb), 0.24);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: var(--space-2-5);
  display: grid;
  gap: var(--space-2);
}

.agent-activity-chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.agent-activity-chart-header h4 {
  margin: 0;
  font-size: var(--font-size-lg);
}

.agent-activity-chart-shell {
  display: grid;
  gap: var(--space-1-5);
}

.agent-activity-chart-shell svg {
  width: 100%;
  height: auto;
}

.agent-activity-chart-x-axis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 4px;
}

.agent-activity-chart-x-axis span {
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.agent-activity-chart-empty {
  min-height: 120px;
  border: 1px dashed rgba(var(--edge-rgb), 0.3);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--text-dim);
}

.composer-attachments {
  display: grid;
  gap: var(--space-1);
}

.composer-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1-5);
}

.composer-attachments-list--inline {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  gap: var(--space-1);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.composer-attachments-count {
  flex: 0 0 auto;
  align-self: center;
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  line-height: 1.2;
  white-space: nowrap;
}

.composer-attachments-clear {
  appearance: none;
  flex: 0 0 auto;
  align-self: center;
  height: 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: var(--font-size-xs);
  line-height: 1;
  padding: 0 var(--space-1);
  cursor: pointer;
  white-space: nowrap;
}

.composer-attachments-clear:hover {
  color: var(--danger);
  background: rgba(var(--danger-rgb), 0.08);
}

.composer-attachments-clear:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.56);
  outline-offset: 1px;
}

.composer-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 34px;
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  border-radius: var(--radius-sm);
  background: rgba(var(--surface-rgb), 0.72);
  padding: var(--space-0-5) var(--space-1);
  max-width: 260px;
  min-width: 0;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.composer-attachment-preview-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 26px;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  cursor: zoom-in;
  font: inherit;
  line-height: 1;
  text-align: left;
}

.composer-attachment-preview-trigger:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.56);
  outline-offset: 2px;
}

/* Match the Settings menu hover across both themes. Highlight the chip frame
   only while its preview button is hovered, leaving the remove action alone. */
.message-attachment-chip:has(> .message-attachment-preview-trigger:hover),
.composer-attachment-chip:has(> .composer-attachment-preview-trigger:hover) {
  background: var(--list-item-hover-bg);
  border-color: rgba(var(--accent-rgb), 0.34);
  color: var(--text);
}

.message-attachment-preview-trigger:hover:enabled,
.composer-attachment-preview-trigger:hover:enabled {
  background: transparent;
  color: inherit;
}

.composer-attachment-chip img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(var(--edge-rgb), 0.25);
}

.composer-attachment-chip-body {
  min-width: 0;
  display: block;
  flex: 1 1 auto;
}

.composer-attachment-chip-body strong {
  display: block;
  font-size: var(--font-size-xs);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-attachment-chip-meta {
  display: block;
  font-size: var(--font-size-2xs);
  line-height: 1.2;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-attachment-remove {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: var(--font-size-md);
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.composer-attachment-remove.ui-icon-button {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  flex: 0 0 22px;
}

.composer-attachment-remove svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.composer-attachment-remove:hover {
  color: var(--danger);
}

.composer-attachment-error {
  margin: 0;
  color: var(--danger);
  font-size: var(--font-size-xs);
  line-height: 1.3;
}

.composer-agent-files-modal {
  position: fixed;
  inset: 0;
  z-index: var(--layer-chat-overlay);
  background: rgba(var(--overlay-rgb), 0.72);
  display: grid;
  place-items: center;
  padding: var(--space-4);
}

.composer-agent-files-panel {
  width: min(720px, 96vw);
  max-height: min(720px, 92vh);
  border: 1px solid rgba(var(--edge-rgb), 0.36);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: var(--shadow-hard);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.composer-agent-files-header,
.composer-agent-files-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3);
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.22);
}

.composer-agent-files-header h3 {
  margin: 0;
  font-size: var(--font-size-xl);
}

.composer-agent-files-header p {
  margin: 2px 0 0;
}

.composer-agent-files-footer {
  border-top: 1px solid rgba(var(--edge-rgb), 0.22);
  border-bottom: none;
}

.composer-agent-files-browser {
  min-height: 260px;
  overflow: auto;
  padding: var(--space-3);
  display: grid;
  align-content: start;
  gap: var(--space-2);
}

.composer-agent-files-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
}

.composer-agent-files-list {
  display: grid;
  gap: var(--space-1);
}

.composer-agent-file-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  border: 1px solid rgba(var(--edge-rgb), 0.22);
  border-radius: var(--radius-sm);
  background: rgba(var(--edge-rgb), 0.08);
  padding: var(--space-1-5) var(--space-2);
  text-align: left;
}

.composer-agent-file-row span {
  min-width: 0;
}

.composer-agent-file-details {
  min-width: 0;
  display: block;
  text-align: left;
}

.composer-agent-file-row strong,
.composer-agent-file-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-agent-file-row small {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: var(--font-size-xs);
}

.composer-agent-file-select {
  color: var(--text);
  cursor: pointer;
}

.composer-agent-file-checkbox,
.composer-agent-file-checkbox-placeholder {
  width: 16px;
  height: 16px;
  min-width: 16px;
  flex: 0 0 16px;
}

.composer-agent-file-checkbox {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  accent-color: var(--accent);
  cursor: pointer;
}

.composer-agent-file-checkbox-placeholder {
  display: inline-block;
}

.composer-agent-file-row--disabled {
  color: var(--text-dim);
}

.composer-agent-file-open-target.ui-button {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: inline-flex;
  justify-content: flex-start;
  gap: var(--space-2);
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  color: var(--text);
}

.composer-agent-file-open-target.ui-button:hover,
.composer-agent-file-open-target.ui-button:focus-visible {
  background: transparent;
  border-color: transparent;
}

.composer-image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1900;
  background: rgba(var(--overlay-rgb), 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

:root[data-theme='light'] .composer-image-preview-overlay {
  background: rgba(0, 0, 0, 0.72);
}

.composer-image-preview-dialog {
  position: relative;
  width: min(96vw, 1120px);
  max-height: 92vh;
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--edge-rgb), 0.45);
  background: var(--panel);
  box-shadow: var(--shadow-hard);
  padding: var(--space-4);
  display: grid;
  gap: var(--space-2-5);
}

.composer-image-preview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1-5);
}

.composer-image-preview-color,
.composer-image-preview-brush {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--text-dim);
}

.composer-image-preview-color input {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.composer-image-preview-brush input {
  width: 120px;
}

.composer-image-preview-dialog img {
  display: block;
  width: 100%;
  max-height: calc(92vh - 120px);
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--media-surface);
}

.composer-image-preview-canvas {
  display: block;
  width: 100%;
  max-height: calc(92vh - 170px);
  border-radius: var(--radius-sm);
  background: var(--media-surface);
  touch-action: none;
  cursor: crosshair;
}

.composer-image-preview-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: var(--font-size-3xl);
  line-height: 1;
  cursor: pointer;
  padding: 2px;
}

.composer-image-preview-error {
  margin: 0;
  color: var(--danger);
  font-size: var(--font-size-sm);
}

.composer-image-preview-meta {
  margin: 0;
  color: var(--text-dim);
  font-size: var(--font-size-sm);
}

.two-column-layout {
  display: grid;
  gap: var(--space-2-5);
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
}

/* Card that frames the connectors `da-table` (which renders frameless + full
   bleed): the page-card supplies the single frame; the table lays out inside
   it. */
.mcp-servers-board-card {
  min-height: 0;
  min-width: 0;
  display: grid;
  align-content: start;
}

.mcp-servers-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.mcp-servers-context-groups {
  display: grid;
  gap: var(--space-2-5);
}

.mcp-servers-context-group {
  background: var(--surface-soft);
  padding: var(--space-2);
  display: grid;
  gap: var(--space-1-5);
}

.mcp-servers-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1-5);
}

.mcp-servers-agent-cell {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mcp-servers-server-cell {
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

.mcp-servers-url-cell code {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  word-break: break-all;
}

.mcp-servers-url-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mcp-servers-url-inline {
  display: block;
  margin-top: var(--space-0-5);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reference-tag-list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

/* .reference-tag base geometry is shared with .badge in the chip base rule
   (§5 chip consolidation). Only the interactive/kind deltas live here. */
.reference-tag--button {
  appearance: none;
  border-style: solid;
  border-width: 1px;
  padding-top: 0;
  padding-bottom: 0;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
}

.reference-tag--agent {
  border-color: rgba(var(--unknown-fill-rgb), 0.2);
  background: rgba(var(--unknown-fill-rgb), 0.06);
  color: var(--unknown);
}

.reference-tag--context,
.reference-tag--user {
  border-color: rgba(var(--success-rgb), 0.22);
  background: rgba(var(--success-rgb), 0.055);
  color: color-mix(in srgb, var(--success) 72%, var(--text) 28%);
}

.reference-tag--team {
  border-color: rgba(var(--warning-rgb), 0.3);
  background: rgba(var(--warning-rgb), 0.085);
  color: color-mix(in srgb, var(--warning) 74%, var(--text) 26%);
}

.reference-tag--connector {
  border-color: rgba(var(--info-rgb), 0.28);
  background: rgba(var(--info-rgb), 0.085);
  color: color-mix(in srgb, var(--info) 74%, var(--text) 26%);
}

.reference-tag--disabled {
  opacity: 0.5;
}

.reference-tag__icon {
  display: block;
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reference-tag--agent .reference-tag__icon {
  fill: currentColor;
  stroke-width: 0;
}

.reference-tag__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reference-tag--button:hover:enabled {
  border-color: rgba(var(--unknown-fill-rgb), 0.3);
  background: rgba(var(--unknown-fill-rgb), 0.1);
  color: var(--text);
  transform: none;
  filter: none;
}

.reference-tag--context.reference-tag--button:hover:enabled,
.reference-tag--user.reference-tag--button:hover:enabled {
  border-color: rgba(var(--success-rgb), 0.28);
  background: rgba(var(--success-rgb), 0.095);
  color: color-mix(in srgb, var(--success) 78%, var(--text) 22%);
}

.reference-tag--team.reference-tag--button:hover:enabled {
  border-color: rgba(var(--warning-rgb), 0.38);
  background: rgba(var(--warning-rgb), 0.13);
  color: color-mix(in srgb, var(--warning) 82%, var(--text) 18%);
}

.reference-tag--connector.reference-tag--button:hover:enabled {
  border-color: rgba(var(--info-rgb), 0.36);
  background: rgba(var(--info-rgb), 0.13);
  color: color-mix(in srgb, var(--info) 82%, var(--text) 18%);
}

.reference-tag--button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

/* `.context-id-cell` is the first column in the contexts/agents/workflows
   listings — large title with overflow handling. */
.context-id-cell {
  min-width: 0;
  overflow-wrap: anywhere;
}

.context-id-cell strong {
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: anywhere;
}

.workflow-plugin-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.workflow-plugin-title .agent-row-icon {
  flex: 0 0 auto;
}

/* Compact "Recent Runs" cell for the flat Plugins table (spec 12 §5.F):
   latest run summary on one line, its artifact download buttons wrapping below.
   Replaces the old inline accordion detail panel. */
.workflow-recent-runs {
  display: flex;
  flex-direction: column;
  gap: var(--space-1-5);
  min-width: 0;
}

.workflow-recent-runs__summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1-5);
}

.workflow-recent-runs__artifacts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* When `.context-id-cell` is the first cell of a `.da-grid__row`, every
   sibling after it centers itself to match the header alignment of the
   contexts/agents/workflows listings. The general sibling combinator means
   this only fires when `.context-id-cell` is actually present, so it
   doesn't interfere with other `.da-grid` usages (members table, mcp-table,
   mcp-servers-context-table, etc.). */
.da-grid__row > .context-id-cell ~ * {
  justify-self: center;
}

.context-scope-badge {
  width: fit-content;
  min-width: 62px;
  border-radius: 999px;
  border: 1px solid rgba(var(--edge-rgb), 0.28);
  padding: 3px 10px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-align: center;
}

.context-scope-shared {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.18);
}

.context-scope-user {
  color: var(--success);
  border-color: rgba(var(--success-rgb), 0.46);
  background: rgba(var(--success-rgb), 0.2);
}

.context-scope-team {
  color: var(--warning);
  border-color: rgba(var(--warning-rgb), 0.46);
  background: rgba(var(--warning-rgb), 0.2);
}

.context-scope-unknown {
  color: var(--unknown);
  border-color: rgba(var(--unknown-fill-rgb), 0.46);
  background: rgba(var(--unknown-fill-rgb), 0.2);
}

.context-access-pill {
  width: fit-content;
  min-width: 68px;
  border-radius: 999px;
  border: 1px solid rgba(var(--edge-rgb), 0.22);
  padding: 3px 8px;
  font-size: var(--font-size-xs);
  text-align: center;
}

/* `.context-tabs` are now standardized via
   `.page-card__header` and `.page-tabs` (legacy classes kept in markup). */

.context-access-pill.allowed {
  color: var(--success);
  border-color: rgba(var(--success-rgb), 0.46);
  background: rgba(var(--success-rgb), 0.28);
}

.context-access-pill.denied {
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.42);
  background: rgba(var(--danger-rgb), 0.26);
}

.context-access-pill.warning {
  color: var(--warning);
  border-color: rgba(var(--warning-rgb), 0.46);
  background: rgba(var(--warning-rgb), 0.24);
}

.context-access-pill.info {
  color: var(--info);
  border-color: rgba(var(--info-rgb), 0.42);
  background: rgba(var(--info-rgb), 0.18);
}

.context-access-pill.muted {
  color: var(--unknown);
  border-color: rgba(var(--unknown-fill-rgb), 0.42);
  background: rgba(var(--unknown-fill-rgb), 0.2);
}

.context-detail-grid {
  margin-top: var(--space-2);
  display: grid;
  gap: var(--space-1-5);
}

.context-detail-item {
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  padding: 9px 10px;
  display: grid;
  gap: 4px;
}

.context-resource-list {
  margin-top: var(--space-2-5);
  display: grid;
  gap: var(--space-1-5);
}

.context-resource-row {
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.workflow-run-artifacts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.workflow-run-artifact-btn {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-mcp-server-name {
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

.context-mcp-count {
  justify-self: center;
  min-width: 26px;
  color: var(--text);
  font-weight: 600;
}

.context-mcp-agent-list {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  word-break: break-word;
}

.context-members-name {
  color: var(--text);
  font-weight: 600;
}

.context-members-email {
  color: var(--text-muted);
}

.context-members-role {
  display: inline-flex;
  justify-self: start;
}

.contexts-footnote {
  font-size: var(--font-size-sm);
}

.teams-detail-page-card {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: var(--space-2-5);
}

.page-breadcrumb {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1-5);
  min-height: 28px;
  padding: 2px 2px 0;
  padding-right: clamp(480px, 54vw, 620px);
}

.page-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
}

.page-breadcrumb-link {
  min-height: 0;
  border: 0;
  border-radius: 0;
  width: auto;
  background: transparent;
  color: var(--text-dim);
  padding: 0;
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
}

button.page-breadcrumb-link {
  cursor: pointer;
}

button.page-breadcrumb-link:hover:enabled {
  transform: none;
  filter: none;
  color: var(--text);
  text-decoration: underline;
}

button.page-breadcrumb-link--plain-action:hover:enabled {
  color: var(--text-dim);
  text-decoration: none;
}

.page-breadcrumb-link.is-current {
  color: var(--text);
}

.page-breadcrumb-link:focus-visible {
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.26);
}

.page-breadcrumb-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
}

.resource-breadcrumb-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.resource-breadcrumb-switcher .resource-breadcrumb-trigger.ui-button {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.resource-breadcrumb-switcher .resource-breadcrumb-trigger.ui-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--text-dim);
}

.resource-breadcrumb-switcher .resource-breadcrumb-trigger.ui-button:hover:enabled,
.resource-breadcrumb-switcher .resource-breadcrumb-trigger.ui-button:focus-visible {
  color: var(--text);
}

.resource-breadcrumb-switcher .resource-breadcrumb-trigger.ui-button:hover:enabled svg,
.resource-breadcrumb-switcher .resource-breadcrumb-trigger.ui-button:focus-visible svg {
  color: var(--text);
}

.resource-breadcrumb-switcher .resource-breadcrumb-trigger.ui-button:focus-visible {
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.26);
}

.resource-breadcrumb-trigger-label {
  min-width: 0;
  max-width: 32ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-breadcrumb-menu {
  position: absolute;
  left: 0;
  top: calc(100% + var(--space-1));
  width: max-content;
  min-width: 190px;
  max-width: min(320px, calc(100vw - var(--space-4)));
  display: grid;
  gap: var(--space-0-5);
  border: 1px solid rgba(var(--edge-rgb), 0.4);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  box-shadow: 0 16px 28px rgba(var(--overlay-rgb), 0.36);
  padding: var(--space-1);
  z-index: calc(var(--layer-dropdown) + 10);
}

.resource-breadcrumb-menu-item {
  min-height: 30px;
}

.resource-breadcrumb-empty {
  color: var(--text-dim);
  font-size: var(--font-size-sm);
  padding: var(--space-1) var(--space-1-5);
}

.agent-workspace-agent-route-menu-panel,
.resource-breadcrumb-menu {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.teams-board-card,
.teams-detail-section {
  min-height: 0;
  min-width: 0;
  display: grid;
  align-content: start;
}

.teams-board-card {
  gap: var(--space-2);
  overflow: visible;
}

.teams-board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.teams-board-toolbar h3 {
  font-size: var(--font-size-2xl);
  line-height: 1.2;
}

.teams-board-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
}

.teams-directory-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  border: 1px solid rgba(var(--warning-rgb), 0.46);
  border-radius: var(--radius-md);
  background: rgba(var(--warning-rgb), 0.14);
  color: color-mix(in srgb, var(--warning) 42%, var(--text) 58%);
  padding: var(--space-2);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.teams-list-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1-5);
}

.teams-filter-input {
  min-height: 34px;
  background: var(--surface-soft);
}

.teams-filter-select {
  width: 140px;
  min-height: 34px;
}

/* Subtler `--list-item-*` palette for hover/selected to match other top-level
   board listings. Override the `--grid-card-*` tokens locally. */
.teams-board-card .da-grid {
  --grid-card-bg: var(--list-item-bg);
  --grid-card-border: rgba(var(--edge-rgb), 0.24);
  --grid-card-bg-hover: var(--list-item-hover-bg);
  --grid-card-border-hover: rgba(var(--accent-rgb), 0.34);
  --grid-card-bg-selected: var(--list-item-selected-bg);
  --grid-card-border-selected: var(--list-item-selected-border);
}

.teams-board-card .da-grid__row {
  border-radius: var(--radius-lg); /* 12px — matches legacy `.team-list-row` */
}

.team-list-name {
  line-height: 1.1;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}

.team-list-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.team-list-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-dim);
}

.team-list-meta {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.team-table-name-cell,
.team-table-personnel-cell,
.team-table-count-cell,
.team-table-context-cell {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.team-table-personnel-cell {
  justify-items: start;
}

.team-table-count-cell > strong,
.team-agent-count-chip > strong {
  font-size: var(--font-size-2xl);
  line-height: 1;
}

.team-agent-count-chip {
  background: none;
  border: 0;
  color: inherit;
  cursor: default;
  font: inherit;
  position: relative;
  display: inline-grid;
  justify-items: center;
  gap: 1px;
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  outline: none;
}

.team-agent-count-chip:focus-visible {
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.team-table-count-cell {
  justify-items: center;
}

.team-table-context-cell .reference-tag {
  max-width: 160px;
}

.team-table-context-cell {
  justify-items: center;
}

.team-row-context-badges {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.team-cell-muted {
  font-size: var(--font-size-sm);
  color: var(--text-dim);
}

.teams-inline-skeleton,
.teams-detail-skeleton-row {
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(var(--edge-rgb), 0.18) 0%,
    rgba(var(--edge-rgb), 0.34) 46%,
    rgba(var(--edge-rgb), 0.18) 100%
  );
  background-size: 220% 100%;
  animation: teams-skeleton-shimmer 1.2s ease-in-out infinite;
}

.teams-inline-skeleton-members {
  width: 96px;
  height: 22px;
}

.teams-inline-skeleton-count {
  width: 36px;
  height: 30px;
}

.teams-inline-skeleton-context {
  width: 76px;
  height: 22px;
}

.teams-detail-skeleton-list {
  display: grid;
  gap: var(--space-1-5);
}

.teams-detail-skeleton-row {
  height: 44px;
  border-radius: var(--radius-md);
}

.sessions-skeleton-list {
  display: grid;
  gap: 6px;
}

.sessions-skeleton-row {
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    rgba(var(--edge-rgb), 0.14) 0%,
    rgba(var(--edge-rgb), 0.28) 46%,
    rgba(var(--edge-rgb), 0.14) 100%
  );
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes teams-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.team-member-avatar-stack,
.team-detail-member-strip,
.team-selector-members {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: nowrap;
  margin-top: 2px;
}

.team-member-avatar-chip {
  background: none;
  border: 0;
  color: inherit;
  cursor: default;
  font: inherit;
  padding: 0;
  position: relative;
  margin-left: -9px;
}

.team-member-avatar-chip:first-child {
  margin-left: 0;
}

.team-member-avatar-chip:hover {
  z-index: 20 !important;
}

.team-member-initial-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(var(--edge-rgb), 0.36);
  background: var(--surface-soft);
  display: inline-grid;
  place-items: center;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text);
  transition:
    box-shadow 150ms ease,
    border-color 150ms ease;
}

.team-member-avatar-chip:hover .team-member-initial-avatar {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: var(--shadow-soft);
}

.team-member-avatar-chip:focus-visible .team-member-initial-avatar {
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.team-floating-tooltip {
  position: fixed;
  top: var(--team-floating-tooltip-top);
  left: var(--team-floating-tooltip-left);
  z-index: 3600;
  pointer-events: none;
  min-width: 170px;
  max-width: 240px;
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--edge-rgb), 0.36);
  background: rgba(var(--panel-rgb), 0.98);
  color: var(--text);
  box-shadow: var(--shadow-hard);
}

.team-floating-tooltip.is-top {
  transform: translate(-50%, -100%);
}

.team-floating-tooltip.is-bottom {
  transform: translate(-50%, 0);
}

.team-floating-tooltip-name {
  font-size: var(--font-size-sm);
  line-height: 1.25;
}

.team-floating-tooltip-meta {
  font-size: var(--font-size-xs);
  line-height: 1.2;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-floating-tooltip-list {
  display: grid;
  gap: 3px;
  max-height: 140px;
  overflow: auto;
}

.team-floating-tooltip-item {
  font-size: var(--font-size-xs);
  line-height: 1.2;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.team-member-overflow {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-dim);
  margin-left: 2px;
}

/* layout is standardized via `.page-card__header`. */

.team-detail-title-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.team-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1-5);
}

.team-switch-notice {
  margin-top: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  background: var(--surface-strong);
  padding: var(--space-2);
  display: grid;
  gap: var(--space-1-5);
}

/* `.team-tabs` and `.team-tab` are standardized via `.page-tabs` / `.page-tab`. */

.team-overview-grid {
  margin-top: var(--space-2-5);
  display: grid;
  gap: var(--space-1-5);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-summary-card {
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  padding: var(--space-2);
  display: grid;
  gap: 4px;
}

.team-summary-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.team-summary-card strong {
  font-size: var(--font-size-xl);
  line-height: 1.2;
}

.team-summary-value-id {
  font-size: var(--font-size-md) !important;
  overflow-wrap: anywhere;
}

.team-resource-list {
  margin-top: var(--space-2-5);
  display: grid;
  gap: var(--space-1-5);
}

.team-resource-row {
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.team-member-row-main {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.details-grid {
  display: grid;
  gap: var(--space-1-5);
}

.detail-row {
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  border-radius: var(--radius-control);
  padding: var(--space-1-5) var(--space-2);
  display: grid;
  gap: var(--space-0-5);
  background: var(--surface-strong);
}

.detail-key {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}

.detail-value {
  font-size: var(--font-size-lg);
  word-break: break-word;
}

.agent-details-panel {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-3);
}

.agent-details-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  min-height: 84px;
  padding: var(--space-3);
  border-block: 1px solid rgba(var(--edge-rgb), 0.18);
}

.agent-details-hero--flush {
  padding-inline: 0;
  border-block: 0;
}

.agent-details-avatar {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: var(--radius-md);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent-strong);
}

.agent-details-avatar svg,
.agent-details-resource-icon svg {
  width: 20px;
  height: 20px;
}

.agent-details-identity {
  min-width: 0;
  display: grid;
  gap: var(--space-0-5);
}

.agent-details-eyebrow,
.agent-details-resource-label {
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-caps);
  line-height: var(--line-height-tight);
  text-transform: uppercase;
}

.agent-details-name {
  min-width: 0;
  color: var(--text);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-details-subtitle {
  min-width: 0;
  color: var(--text-dim);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-details-resource-grid {
  display: grid;
  gap: var(--space-1);
  padding: 0 var(--space-3) var(--space-3);
}

.agent-details-resource {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--space-2);
  min-height: 58px;
  padding: var(--space-2-5) 0;
  border-top: 1px solid rgba(var(--edge-rgb), 0.16);
}

.agent-details-resource:first-child {
  border-top: 0;
}

.agent-details-resource-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(var(--edge-rgb), 0.22);
  border-radius: var(--radius-sm);
  background: rgba(var(--edge-rgb), 0.08);
  color: var(--text-muted);
}

.agent-details-resource-copy {
  min-width: 0;
  display: grid;
  gap: var(--space-1);
  justify-items: start;
}

.detail-badges {
  margin-top: 0;
}

.details-cta-row {
  margin-top: var(--space-2);
  padding-top: 10px;
  border-top: 1px solid rgba(var(--edge-rgb), 0.16);
}

.mcp-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(230px, 0.65fr) minmax(300px, 1fr) minmax(300px, 1fr);
}

.mcp-tab-layout {
  display: grid;
  gap: var(--space-2-5);
}

.mcp-server-table-card {
  padding: var(--space-2-5);
  gap: var(--space-2);
}

.mcp-table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-1-5);
}

.mcp-table-scroll {
  overflow-x: auto;
  border: 1px solid rgba(var(--edge-rgb), 0.28);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.mcp-mono-cell {
  font-family: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.mcp-transport-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  background: rgba(var(--accent-rgb), 0.85);
  color: var(--accent-contrast);
}

.mcp-transport-pill.empty {
  background: rgba(var(--edge-rgb), 0.2);
  color: var(--text-muted);
}

.mcp-unknown-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(var(--edge-rgb), 0.2);
}

.mcp-simple-grid {
  display: grid;
  gap: var(--space-2-5);
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  align-items: start;
}

.mcp-simple-grid.split {
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
}

.mcp-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-1-5);
}

.mcp-select-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-1-5);
  align-items: center;
}

.server-compact-meta {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
  flex-wrap: wrap;
}

.mcp-grid.adaptive {
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 2fr);
  align-items: start;
}

.invoke-response {
  display: grid;
  gap: var(--space-2-5);
}

.invoke-response-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  align-items: center;
}

.invoke-response-body {
  display: grid;
  gap: var(--space-2-5);
  grid-template-columns: 1fr;
}

.invoke-response.split .invoke-response-body {
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
}

.invoke-pane,
.response-pane {
  display: grid;
  gap: var(--space-2);
}

.response-meta-line {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
  flex-wrap: wrap;
}

.response-tab-row {
  display: flex;
  gap: var(--space-1);
}

.active-tab {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: rgba(var(--accent-rgb), 0.2);
  color: var(--text);
}

.parsed-response {
  display: grid;
  gap: var(--space-2);
}

.parsed-tool-list {
  display: grid;
  gap: var(--space-1-5);
  max-height: 46vh;
  overflow: auto;
  padding-right: 2px;
}

.parsed-tool-item {
  display: grid;
  gap: 4px;
  border-radius: var(--radius-md);
  padding: var(--space-2);
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  background: var(--surface-strong);
}

.server-row-meta {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin-top: var(--space-1);
}

.meta-inline {
  font-size: var(--font-size-xs);
}

.card-main-action {
  width: 100%;
  min-height: 0;
  border-radius: var(--radius-sm);
  padding: 0;
  background: transparent;
  border: none;
  display: grid;
  text-align: left;
  gap: 4px;
}

.context-team-name {
  font-size: var(--font-size-lg);
  line-height: 1.2;
}

.card-main-action:hover:enabled {
  transform: none;
  filter: none;
}

.mcp-error-panel {
  display: grid;
  gap: var(--space-1-5);
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--danger-rgb), 0.42);
  background: rgba(var(--danger-rgb), 0.12);
  padding: var(--space-2);
}

.method-helpers {
  margin-top: 2px;
}

.invoke-primary-actions {
  margin-top: 2px;
}

.invoke-advanced-actions {
  padding-top: 8px;
  border-top: 1px solid rgba(var(--edge-rgb), 0.16);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.server-list {
  max-height: 48vh;
  overflow: auto;
}

.response-frame {
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  padding: 2px;
}

.response-frame.tone-success {
  border-color: rgba(var(--success-rgb), 0.5);
}

.response-frame.tone-error {
  border-color: rgba(var(--danger-rgb), 0.5);
}

.row {
  display: grid;
  gap: var(--space-1);
}

.ui-field {
  display: grid;
  gap: var(--space-1);
}

.ui-field__label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.ui-field__hint {
  font-size: var(--font-size-sm);
  line-height: 1.45;
  color: var(--text-dim);
}

.ui-control {
  width: 100%;
}

.ui-control--dense {
  min-height: var(--control-height-lg);
  padding: 0 var(--space-2);
  font-size: var(--font-size-md);
}

.ui-dropdown-select {
  position: relative;
  min-width: 0;
}

.ui-dropdown-select__trigger.ui-button {
  min-width: 0;
  min-height: var(--control-height);
  padding-inline: var(--space-2-5);
  border-color: var(--control-border);
  border-radius: var(--radius-control);
  background: var(--control-bg-strong);
  color: var(--text);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
}

.ui-dropdown-select__trigger.ui-button > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-dropdown-select__trigger.ui-button:hover:enabled,
.ui-dropdown-select__trigger.ui-button[aria-expanded='true'] {
  border-color: var(--control-border-hover);
  background: var(--surface-hover);
}

.ui-dropdown-select__placeholder {
  color: var(--text-dim);
}

.ui-dropdown-select__chevron {
  width: var(--space-1-5);
  height: var(--space-1-5);
  flex: 0 0 var(--space-1-5);
  margin: 0 var(--space-0-5) var(--space-0-5) 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: var(--text-muted);
  transform: rotate(45deg);
}

.ui-dropdown-select__menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  left: 0;
  z-index: calc(var(--layer-dropdown) + 40);
  width: 100%;
  max-height: 260px;
  display: grid;
  gap: var(--space-0-5);
  overflow-y: auto;
  padding: var(--space-1);
  border: 1px solid rgba(var(--edge-rgb), 0.46);
  border-radius: var(--radius-md);
  background: var(--bg-elev-2);
  box-shadow: var(--shadow-hard);
  scrollbar-width: thin;
}

.ui-dropdown-select__menu--portal {
  position: fixed;
  z-index: calc(var(--layer-dropdown) + 40);
}

.ui-dropdown-select__option.ui-menu-item {
  min-height: 38px;
  padding-inline: var(--space-2);
  color: var(--text-muted);
}

.ui-dropdown-select__option.ui-menu-item.active {
  border-color: rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
}

.ui-button,
.ui-icon-button,
.ui-tab-button,
.page-tab,
.agents-fleet-tab,
.context-tab,
.team-tab,
.ui-menu-item,
.ui-nav-item,
.ui-selectable-option {
  transform: none;
  filter: none;
  transition:
    border-color var(--motion-fast),
    background var(--motion-fast),
    color var(--motion-fast),
    box-shadow var(--motion-fast),
    opacity var(--motion-fast);
}

.ui-button:hover:enabled,
.ui-icon-button:hover:enabled,
.ui-tab-button:hover:enabled,
.ui-menu-item:hover:enabled,
.ui-nav-item:hover:enabled,
.ui-selectable-option:hover:enabled {
  transform: none;
  filter: none;
}

.ui-button {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.ui-button--align-start {
  justify-content: flex-start;
  text-align: left;
}

.ui-button--align-center {
  justify-content: center;
  text-align: center;
}

.ui-button--align-between {
  justify-content: space-between;
  text-align: left;
}

.ui-button--xs {
  min-height: 24px;
  padding: 0 var(--space-1);
  font-size: var(--font-size-xs);
}

.ui-button--sm {
  min-height: 30px;
  padding: 0 var(--space-1-5);
  font-size: var(--font-size-sm);
}

.ui-button--md {
  min-height: 36px;
  padding: 0 var(--space-3);
  font-size: var(--font-size-md);
}

.ui-button--lg {
  min-height: 40px;
  padding: 0 var(--space-4);
  font-size: var(--font-size-lg);
}

.ui-button--xl {
  min-height: 44px;
  padding: 0 var(--space-5);
  font-size: var(--font-size-xl);
}

.ui-button--solid.ui-button--primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.ui-button--solid.ui-button--danger {
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--danger) 88%, black 12%),
    var(--danger)
  );
  color: var(--text-inverse);
}

.ui-button--solid.ui-button--success {
  background: color-mix(in srgb, var(--success) 82%, var(--panel) 18%);
  color: var(--text-inverse);
}

.ui-button--solid.ui-button--warning {
  background: color-mix(in srgb, var(--warning) 82%, var(--panel) 18%);
  color: var(--text-inverse);
}

.ui-button--solid.ui-button--neutral,
.ui-button--solid.ui-button--secondary {
  background: var(--surface-strong);
  border-color: rgba(var(--edge-rgb), 0.44);
  color: var(--text);
}

.ui-button--solid:hover:enabled {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: var(--accent-strong);
}

.ui-button--solid.ui-button--neutral:hover:enabled,
.ui-button--solid.ui-button--secondary:hover:enabled {
  background: var(--surface-hover);
  border-color: rgba(var(--edge-rgb), 0.58);
  color: var(--text);
}

.ui-button--solid.ui-button--danger:hover:enabled {
  border-color: rgba(var(--danger-rgb), 0.62);
  background: color-mix(in srgb, var(--danger) 86%, var(--surface-strong) 14%);
}

.ui-button--solid.ui-button--success:hover:enabled {
  border-color: rgba(var(--success-rgb), 0.62);
  background: rgba(var(--success-rgb), 0.3);
}

.ui-button--solid.ui-button--warning:hover:enabled {
  border-color: rgba(var(--warning-rgb), 0.62);
  background: rgba(var(--warning-rgb), 0.3);
}

.ui-button--soft {
  background: var(--surface-soft);
  border-color: rgba(var(--edge-rgb), 0.32);
  color: var(--text);
}

.ui-button--soft.ui-button--primary,
.ui-button--soft.ui-button--secondary {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.28);
  color: var(--text);
}

.ui-button--soft.ui-button--danger {
  background: rgba(var(--danger-rgb), 0.12);
  border-color: rgba(var(--danger-rgb), 0.3);
  color: var(--danger);
}

.ui-button--soft.ui-button--success {
  background: rgba(var(--success-rgb), 0.16);
  border-color: rgba(var(--success-rgb), 0.34);
  color: color-mix(in srgb, var(--success) 38%, var(--text) 62%);
}

.ui-button--soft.ui-button--warning {
  background: rgba(var(--warning-rgb), 0.16);
  border-color: rgba(var(--warning-rgb), 0.34);
  color: color-mix(in srgb, var(--warning) 38%, var(--text) 62%);
}

.ui-button--soft:hover:enabled {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.42);
  color: var(--text);
}

.ui-button--soft.ui-button--danger:hover:enabled {
  background: rgba(var(--danger-rgb), 0.22);
  border-color: rgba(var(--danger-rgb), 0.5);
}

.ui-button--soft.ui-button--success:hover:enabled {
  background: rgba(var(--success-rgb), 0.24);
  border-color: rgba(var(--success-rgb), 0.56);
}

.ui-button--outline {
  background: transparent;
  border-color: var(--control-border);
  color: var(--text);
}

.ui-button--outline:hover:enabled {
  background: var(--surface-hover);
  border-color: var(--control-border-hover);
}

.ui-button--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.ui-button--ghost:hover:enabled {
  background: var(--surface-hover);
  color: var(--text);
}

.ui-button--text {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-strong);
}

.ui-button--text:hover:enabled {
  color: var(--text);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ui-button--text.ui-button--neutral {
  color: var(--text-dim);
}

.ui-button--text.ui-button--neutral:hover:enabled {
  color: var(--text);
  text-decoration: none;
}

.ui-button--text.ui-button--transparent {
  color: inherit;
}

.ui-button--text.ui-button--transparent:hover:enabled {
  color: inherit;
  text-decoration: none;
}

.ui-button--block {
  width: 100%;
}

.ui-button:focus-visible,
.ui-icon-button:focus-visible,
.ui-tab-button:focus-visible,
.page-tab:focus-visible,
.agents-fleet-tab:focus-visible,
.context-tab:focus-visible,
.team-tab:focus-visible,
.ui-menu-item:focus-visible,
.ui-nav-item:focus-visible,
.ui-selectable-option:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.ui-button:disabled,
.ui-icon-button:disabled,
.ui-tab-button:disabled,
.ui-menu-item:disabled,
.ui-nav-item:disabled,
.ui-selectable-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ui-icon-button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-muted);
}

.ui-icon-button--xs {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
}

.ui-icon-button--sm {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
}

.ui-icon-button--lg {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
}

.ui-icon-button--xl {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

.ui-icon-button--solid {
  background: var(--accent);
  color: var(--accent-contrast);
}

.ui-icon-button--solid.ui-icon-button--neutral,
.ui-icon-button--solid.ui-icon-button--secondary {
  background: var(--surface-strong);
  border-color: rgba(var(--edge-rgb), 0.44);
  color: var(--text);
}

.ui-icon-button--soft {
  background: var(--surface-soft);
  border-color: rgba(var(--edge-rgb), 0.36);
}

.ui-icon-button--outline {
  border-color: var(--control-border);
  background: transparent;
}

.ui-icon-button:hover:enabled {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.42);
  color: var(--text);
}

.ui-icon-button--solid:hover:enabled {
  background: var(--accent-strong);
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--accent-contrast);
}

.ui-icon-button--solid.ui-icon-button--neutral:hover:enabled,
.ui-icon-button--solid.ui-icon-button--secondary:hover:enabled {
  background: var(--surface-hover);
  border-color: rgba(var(--edge-rgb), 0.58);
  color: var(--text);
}

.ui-icon-button--danger:hover:enabled,
.ui-icon-button--soft.ui-icon-button--danger:hover:enabled {
  background: rgba(var(--danger-rgb), 0.16);
  border-color: rgba(var(--danger-rgb), 0.38);
  color: var(--danger);
}

.ui-tab-button,
.page-tab,
.agents-fleet-tab,
.context-tab,
.team-tab {
  min-height: var(--control-height-lg);
  padding: 0 var(--space-2);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

/* .ui-tab-button--md intentionally uses the base .ui-tab-button sizing. */
.ui-tab-button--sm {
  min-height: 28px;
  font-size: var(--font-size-md);
}

.ui-tab-button--lg {
  min-height: 36px;
  font-size: var(--font-size-xl);
}

.ui-tab-button:hover:enabled,
.page-tab:hover:enabled,
.agents-fleet-tab:hover:enabled,
.context-tab:hover:enabled,
.team-tab:hover:enabled {
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--text);
}

.ui-tab-button.active,
.page-tab.active,
.agents-fleet-tab.active,
.context-tab.active,
.team-tab.active {
  border-bottom-color: rgba(var(--accent-rgb), 0.72);
  color: var(--text);
}

.ui-menu-item,
.ui-nav-item {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  text-align: left;
  padding: 0 var(--space-2);
}

.ui-nav-item {
  min-height: 34px;
  background: var(--list-item-bg);
  padding-left: var(--space-3);
}

.left-nav .nav-link.ui-nav-item {
  gap: var(--sidebar-nav-icon-gap);
  padding: 0 var(--sidebar-nav-parent-pad-x);
}

.left-nav .nav-link-main.ui-nav-item {
  gap: var(--sidebar-nav-icon-gap);
  padding: 0;
}

.left-nav .nav-link .ui-nav-item__trailing {
  width: var(--sidebar-nav-action-size);
  display: inline-grid;
  place-items: center;
  flex: 0 0 var(--sidebar-nav-action-size);
  margin-left: auto;
}

.ui-menu-item:hover:enabled,
.ui-nav-item:hover:enabled {
  background: var(--list-item-hover-bg);
  border-color: rgba(var(--accent-rgb), 0.34);
  color: var(--text);
}

.ui-menu-item.active,
.ui-nav-item.active {
  background: var(--list-item-selected-bg);
  border-color: var(--list-item-selected-border);
  color: var(--text);
  font-weight: var(--font-weight-semibold);
}

.ui-menu-item--danger,
.ui-nav-item--danger {
  color: var(--danger);
}

.ui-menu-item--danger:hover:enabled,
.ui-nav-item--danger:hover:enabled {
  background: rgba(var(--danger-rgb), 0.12);
  border-color: rgba(var(--danger-rgb), 0.4);
}

.ui-menu-item__icon,
.ui-nav-item__icon,
.ui-menu-item__trailing,
.ui-nav-item__trailing {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.ui-menu-item__label,
.ui-nav-item__label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-0-5);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.ui-pill--xs {
  padding: 1px var(--space-1);
  font-size: var(--font-size-2xs);
}

.ui-pill--sm {
  padding: 2px var(--space-1-5);
  font-size: var(--font-size-xs);
}

.ui-pill--md {
  padding: var(--space-0-5) var(--space-2);
  font-size: var(--font-size-sm);
}

.ui-pill--success {
  background: rgba(var(--success-rgb), 0.16);
  border-color: rgba(var(--success-rgb), 0.34);
  color: color-mix(in srgb, var(--success) 42%, var(--text) 58%);
}

.ui-pill--danger {
  background: rgba(var(--danger-rgb), 0.14);
  border-color: rgba(var(--danger-rgb), 0.32);
  color: var(--danger);
}

.ui-pill--warning {
  background: rgba(var(--warning-rgb), 0.16);
  border-color: rgba(var(--warning-rgb), 0.34);
  color: color-mix(in srgb, var(--warning) 42%, var(--text) 58%);
}

.ui-pill--info {
  background: rgba(var(--info-rgb), 0.16);
  border-color: rgba(var(--info-rgb), 0.34);
  color: color-mix(in srgb, var(--info) 48%, var(--text) 52%);
}

.ui-pill--accent {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(var(--accent-rgb), 0.34);
  color: var(--text);
}

/* TASK-172 — an interactive pill acts as a button, so it must read as one. */
.ui-pill--interactive {
  cursor: pointer;
}

.ui-pill--interactive:hover {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.42);
  color: var(--text);
}

.ui-selectable-option {
  width: 100%;
  display: grid;
  gap: var(--space-1);
  text-align: left;
  border-radius: var(--radius-control);
  border: 1px solid var(--control-border);
  background: var(--surface-soft);
  color: var(--text);
}

.ui-selectable-option--sm {
  min-height: 42px;
  padding: var(--space-1-5) var(--space-2);
}

.ui-selectable-option--md {
  min-height: 56px;
  padding: var(--space-2-5) var(--space-3);
}

.ui-selectable-option--lg {
  min-height: 72px;
  padding: var(--space-3) var(--space-4);
}

.ui-selectable-option:hover:enabled {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.38);
}

.ui-selectable-option.is-selected {
  border-color: rgba(var(--accent-rgb), 0.62);
  background: rgba(var(--accent-rgb), 0.14);
}

.row.inline {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.empty-state {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2-5);
  border-radius: var(--radius-control);
  border: 1px dashed rgba(var(--edge-rgb), 0.3);
  background: var(--surface-strong);
}

.error-text {
  color: var(--danger);
  font-size: var(--font-size-md);
  line-height: 18px;
}

.composer-error {
  display: grid;
  gap: var(--space-1-5);
  max-width: 70ch;
  padding: var(--space-2) var(--space-2-5);
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--danger-rgb), 0.42);
  background: rgba(var(--danger-rgb), 0.12);
}

.error-details {
  margin-top: 2px;
  max-height: 180px;
  overflow: auto;
  font-size: var(--font-size-sm);
}

.error-details > summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
}

.error-details pre {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(var(--edge-rgb), 0.28);
  border-radius: 8px;
  background: rgba(var(--overlay-rgb), 0.32);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.status-dot {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--status-dot-bg);
  font-size: var(--font-size-xs);
  flex-shrink: 0;
}

.toast-stack {
  position: fixed;
  top: calc(var(--window-titlebar-height) + var(--space-2));
  right: 16px;
  z-index: 4000;
  display: grid;
  gap: var(--space-1-5);
  width: min(320px, calc(100% - 24px));
}

.toast {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  gap: var(--space-1-5);
  border-radius: var(--radius-control);
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  background: var(--surface-strong);
  padding: var(--space-2) var(--space-2-5);
  font-size: var(--font-size-md);
  line-height: 18px;
  box-shadow: var(--shadow-hard);
}

.toast-icon {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  font-size: var(--font-size-xs);
  border-radius: 999px;
  background: var(--status-dot-bg);
  margin-top: 1px;
}

.toast-body {
  flex: 1 1 auto;
  min-width: 0;
}

.toast-action {
  appearance: none;
  flex: 0 0 auto;
  align-self: center;
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: var(--font-size-xs);
  line-height: 1;
  padding: var(--space-1) var(--space-1-5);
  cursor: pointer;
  white-space: nowrap;
}

.toast-action:hover {
  border-color: rgba(var(--danger-rgb), 0.5);
  color: var(--danger);
}

.toast-action:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.56);
  outline-offset: 1px;
}

.toast.tone-success {
  border-color: rgba(var(--success-rgb), 0.5);
}

.toast.tone-warn {
  border-color: rgba(var(--warning-rgb), 0.5);
}

.toast.tone-error {
  border-color: rgba(var(--danger-rgb), 0.52);
}

/* Unverifiable-but-not-forbidden outcomes (refusal UX matrix A10): the
   warning border pairs with the warn toast tone. */
.toast.tone-warn {
  border-color: rgba(var(--warning-rgb), 0.52);
}

.auth-page {
  min-height: calc(100vh - var(--window-titlebar-height));
  padding: var(--space-5);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(420px, 94vw);
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
}

/* Boot / session-loading splash. The brand mark + copy reveal as a single
   cohesive unit (no staggered fragmentation), with one calm shimmer bar
   underneath signaling the load. */
.boot-screen {
  width: min(420px, 94vw);
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-4);
  place-items: center;
  text-align: center;
  animation: boot-screen-in 420ms ease both;
}

/* Fixed overlay that carries the branded splash across the booting → ready
   transition. Its backdrop remains opaque until unmount so incomplete
   workspace surfaces never show through the exit animation. */
.boot-overlay {
  --boot-exit-duration: 240ms;

  position: fixed;
  inset: var(--window-titlebar-height) 0 0 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: var(--space-5);
  background: var(--bg);
}

.boot-overlay--leaving .boot-screen {
  animation: boot-screen-out var(--boot-exit-duration) ease forwards;
}

/* The splash carries the same lockup as the auth cards, one step larger since
   it stands alone on a full-screen backdrop rather than above a form. */
.boot-brand {
  --brand-lockup-height: 34px;

  display: inline-flex;
  align-items: center;
  opacity: 0;
  animation: boot-brand-in 600ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.boot-progress {
  position: relative;
  width: 200px;
  height: 3px;
  border-radius: var(--radius-xl);
  background: rgba(var(--edge-rgb), 0.3);
  overflow: hidden;
  opacity: 0;
  animation: boot-fade-in 360ms ease 0.3s both;
}

.boot-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(var(--accent-rgb), 0),
    rgba(var(--accent-rgb), 0.9),
    var(--accent-strong)
  );
  animation: boot-progress-sweep 1.4s cubic-bezier(0.45, 0, 0.15, 1) infinite;
}

.boot-status {
  margin: 0;
  font-size: var(--font-size-sm);
  opacity: 0;
  animation: boot-fade-in 360ms ease 0.3s both;
}

@keyframes boot-screen-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes boot-brand-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes boot-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes boot-progress-sweep {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(322%);
  }
}

@keyframes boot-screen-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.auth-form {
  display: grid;
  gap: var(--space-5);
  padding: 28px;
}

.auth-card__header {
  display: grid;
  gap: var(--space-2);
  justify-items: center;
}

/* Hairline separating the brand from the form or wizard step below. Its own
   element rather than a border on the header, so the space above and below is
   the rule's own margin and can be tuned without touching header padding.
   Uses the edge token so it tracks the theme instead of pinning one grey. */
.auth-card__divider {
  width: 70%;
  height: 1px;
  /* No margin — the card's grid gap already spaces this. `justify-self` does
     the centering instead, so the two never compound. */
  justify-self: center;
  background: rgba(var(--edge-rgb), 0.3);
}

/* One logotype asset carrying mark and wordmark together, the same lockup
   Control UI's login card and this app's SidebarNav use — not the square mark
   beside hand-typed text. Shared by every brand surface (auth, onboarding, the
   boot splash) so they cannot drift apart. The two theme files are swapped by
   CSS rather than by reading the theme in JS, so the right one paints on the
   first frame. Height is a variable so a surface can scale the lockup without
   forking the rule. */
.auth-brand {
  display: inline-flex;
  align-items: center;
  margin: var(--space-2) 0;
}

.brand-lockup {
  display: block;
  width: 100%;
  max-width: 200px;
  max-height: var(--brand-lockup-height, 28px);
  object-fit: contain;
  background: transparent;
}

.brand-lockup--dark {
  display: none;
}

:root[data-theme='dark'] .brand-lockup--light {
  display: none;
}

:root[data-theme='dark'] .brand-lockup--dark {
  display: block;
}

.auth-flow-card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  border-radius: var(--radius-lg);
  background: rgba(var(--panel-rgb), 0.46);
}

.auth-flow-card__header {
  display: grid;
  gap: var(--space-2);
}

.auth-flow-card__copy,
.auth-flow-card__note {
  max-width: 58ch;
  line-height: 1.5;
}

.auth-flow-card__meta,
.auth-flow-card__actions,
.auth-form-stack {
  display: grid;
  gap: var(--space-3);
}

.auth-form-row {
  display: grid;
  gap: var(--space-1-5);
}

.auth-field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2-5);
}

.auth-mode-toggle.ui-button {
  width: fit-content;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--accent);
  background: transparent;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.auth-mode-toggle.ui-button:hover:enabled,
.auth-mode-toggle.ui-button:focus-visible {
  transform: none;
  filter: none;
  color: var(--accent-strong);
  text-decoration: underline;
}

.auth-inline-link {
  width: fit-content;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.auth-inline-link:hover:enabled,
.auth-inline-link:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
}

.auth-inline-link:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.auth-form-stack .ui-button--block {
  margin-top: 2px;
}

.auth-backend-hint {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: stretch;
}

/* First-run onboarding (spec §5.2). The wizard reuses the auth card shell and
   the auth form/link primitives; only the answer list is new. */

/* Hold one height across every step so the card stops growing and shrinking as
   the user moves through the wizard. The body takes the slack and scrolls if a
   step ever outgrows it, and the footer keeps Back pinned to the bottom so it
   does not travel with the content above it. Capped against the viewport so a
   short window scrolls instead of overflowing. */
/* One card shape shared by every pre-authentication screen — the onboarding
   wizard and sign-in alike — so the card never resizes as the user moves
   between steps, or when onboarding hands off to sign-in.

   Sized to the tallest content: the manual environment form with the Localhost
   option showing, which needs ~500px (two fields, a 72px option, and the brand
   header). Shorter screens carry the slack as empty space; that is the trade
   for a card that holds still. Capped against the viewport so a short window
   scrolls the body instead of overflowing. */
.auth-card--flow {
  /* 20% wider than the base auth card (420px): the wizard carries option rows
     and the run-style comparison, which read cramped at sign-in's width. */
  width: min(504px, 94vw);
  height: min(540px, 86vh);
  /* header, divider, body, footer — the body takes the slack. */
  grid-template-rows: auto auto 1fr auto;
}

.auth-card__body {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  overflow-y: auto;
  min-height: 0;
}

.auth-card__footer {
  display: flex;
  align-items: end;
  min-height: var(--space-5);
}

/* A bare h1 falls back to the browser's 2em — 32px, which is off the type
   scale entirely and oversized inside a 420px card. Pull it onto the scale,
   above the 18px brand title so the step heading still leads. */
.auth-card--flow h1 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.onboarding-options {
  display: grid;
  gap: var(--space-2);
}

.onboarding-option {
  display: grid;
  gap: var(--space-1);
  justify-items: start;
  text-align: left;
  white-space: normal;
}

.onboarding-option__title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text);
}

.onboarding-option__hint {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  line-height: 1.4;
  color: var(--text-muted);
}

/* Q2's "I have no idea" branch: the two run styles compared. Stacked rather
   than side-by-side columns, which would be unreadable at the card's width. */
.onboarding-compare {
  display: grid;
  gap: var(--space-3);
}

.onboarding-compare__group {
  display: grid;
  gap: var(--space-1-5);
}

.onboarding-compare__title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text);
}

.onboarding-compare__lead {
  font-size: var(--font-size-sm);
  line-height: 1.4;
  color: var(--text-muted);
}

.onboarding-compare__list {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.onboarding-compare__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-1-5);
  font-size: var(--font-size-sm);
  line-height: 1.45;
  color: var(--text-muted);
}

.onboarding-compare__mark {
  font-weight: var(--font-weight-semibold);
}

.onboarding-compare__mark--pro {
  color: var(--success);
}

.onboarding-compare__mark--con {
  color: var(--warning);
}

.auth-button-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

.auth-button-spinner {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(var(--edge-rgb), 0.35);
  border-top-color: currentColor;
  animation: auth-button-spin 0.75s linear infinite;
}

@keyframes auth-button-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.auth-runtime-config {
  width: 100%;
}

.auth-runtime-dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--layer-toast);
}

.auth-runtime-dock__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(var(--edge-rgb), 0.35);
  background: rgba(var(--panel-rgb), 0.9);
  color: var(--text-muted);
  box-shadow: var(--shadow-soft);
}

.auth-runtime-dock__toggle:hover:enabled,
.auth-runtime-dock__toggle:focus-visible {
  transform: none;
  filter: none;
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.4);
}

.auth-runtime-dock__toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.auth-runtime-dock__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--space-2));
  width: min(420px, calc(100vw - 24px));
  padding: var(--space-3);
  border: 1px solid rgba(var(--edge-rgb), 0.35);
  background: rgba(var(--panel-rgb), 0.82);
  z-index: var(--layer-toast);
}

.auth-runtime-config__field {
  margin: 0;
}

.auth-runtime-menu {
  display: grid;
  gap: var(--space-3);
}

.auth-runtime-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.auth-runtime-menu__header .ui-icon-button {
  flex: 0 0 auto;
}

.auth-runtime-menu__header svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.auth-runtime-menu__label,
.auth-runtime-menu__heading {
  display: block;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.auth-runtime-menu__label {
  margin-bottom: 0;
}

.auth-runtime-menu__heading {
  padding: 0 var(--space-1);
  text-transform: uppercase;
}

.auth-runtime-menu__section {
  display: grid;
  gap: var(--space-1);
}

.auth-runtime-menu__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: var(--space-1);
  border-radius: var(--radius-md);
}

.auth-runtime-menu__select,
.auth-runtime-menu__delete {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.auth-runtime-menu__select {
  width: 100%;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-1);
  justify-content: start;
  padding: var(--space-1) var(--space-1-5);
  text-align: left;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
}

.auth-runtime-menu__select--standalone {
  grid-template-columns: 20px minmax(0, 1fr);
}

.auth-runtime-menu__delete {
  width: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-muted);
}

.auth-runtime-menu__delete svg,
.auth-runtime-menu__check svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-runtime-menu__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.auth-runtime-menu__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-runtime-menu__select:hover:enabled,
.auth-runtime-menu__select:focus-visible,
.auth-runtime-menu__delete:hover:enabled,
.auth-runtime-menu__delete:focus-visible {
  transform: none;
  filter: none;
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.08);
}

.auth-runtime-menu__select.selected {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.12);
}

.auth-runtime-menu__select.selected:hover:enabled,
.auth-runtime-menu__select.selected:focus-visible {
  background: rgba(var(--accent-rgb), 0.15);
}

label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

input,
textarea,
select,
button {
  width: 100%;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  background: var(--control-bg);
  color: var(--text);
  font: inherit;
  padding: var(--space-2) var(--space-2-5);
  outline: none;
  transition:
    border-color var(--motion-fast),
    background var(--motion-fast);
}

/* Single-line controls carry the shared control height as a floor. */
input,
select {
  min-height: var(--control-height);
}

textarea {
  background: var(--control-bg-strong);
}

button {
  width: auto;
  background: var(--accent);
  border-color: transparent;
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  color: var(--accent-contrast);
}

button:hover:enabled {
  background: var(--accent-strong);
  transform: none;
  filter: none;
}

@media (max-width: 720px) {
  .auth-page {
    padding: var(--space-4);
  }

  .auth-card {
    width: min(100%, 94vw);
    padding: 24px 20px;
    gap: var(--space-4);
  }

  .auth-runtime-dock {
    right: 12px;
    bottom: 12px;
  }

  .auth-runtime-dock__panel {
    width: calc(100vw - 24px);
  }

  .auth-field-label {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-1);
  }
}

.left-nav .nav-link:hover:enabled {
  transform: none;
  filter: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 55vh;
  overflow: auto;
  padding: var(--space-2-5);
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  border-radius: var(--radius-md);
  background: rgba(var(--panel-rgb), 0.92);
}

@media (max-width: 1220px) {
  .team-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Responsive: tighten teams-board column template at this breakpoint.
     Inline `--da-grid-cols` has higher specificity than any class rule, so
     we override `grid-template-columns` directly (which is a different
     property than the variable, and therefore wins). */
  .teams-board-card .da-grid__head,
  .teams-board-card .da-grid__row {
    grid-template-columns:
      minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 0.55fr) minmax(0, 0.9fr)
      minmax(0, 0.48fr);
    gap: var(--space-2);
  }

  .team-list-name {
    font-size: var(--font-size-xl);
  }

  .team-table-count-cell > strong,
  .team-agent-count-chip > strong {
    font-size: var(--font-size-xl);
  }

  .mcp-grid {
    grid-template-columns: 1fr;
  }

  .mcp-simple-grid,
  .mcp-simple-grid.split {
    grid-template-columns: 1fr;
  }

  .mcp-grid.adaptive {
    grid-template-columns: 1fr;
  }

  .chat-bubble {
    max-width: 680px;
  }

  .host-runtime-inline {
    gap: var(--space-1-5);
  }

  .agent-page-header h2 {
    font-size: var(--font-size-2xl);
    line-height: 30px;
  }

  .page-header h2 {
    font-size: var(--font-size-3xl);
    line-height: 36px;
  }

  .page-header h3 {
    font-size: var(--font-size-2xl);
    line-height: 30px;
  }

  .agent-workspace-body-slot > .composer,
  .agent-workspace-body-slot > .composer-inline,
  /* The new-chat landing wraps its inline composer in
   * `.agent-workspace-new-chat`; without this arm the wrapper breaks the
   * direct-child chain and the composer goes full-bleed (no gutter). */
  .agent-workspace-body-slot > .agent-workspace-new-chat > .composer-inline {
    width: min(calc(100% - (var(--space-3) * 2)), 1024px);
    max-width: min(calc(100% - (var(--space-3) * 2)), 1024px);
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 1020px) {
  /* `.has-details` split-view was removed (unused in JSX). */
}

@media (max-width: 900px) {
  body.mobile-sidebar-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(var(--overlay-rgb), 0.72);
    pointer-events: none;
    z-index: calc(var(--layer-dropdown) + 20);
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .workspace-layout {
    grid-template-rows: auto minmax(0, 1fr);
  }

  /* Sidebar is gone and the aside spans the full top, so the extra top
     breathing room (space-2 * 5) is no longer needed — drop it to space-2. */
  .content-panel.content-panel--agent-chat {
    padding-top: var(--space-2);
  }

  .left-nav {
    position: sticky;
    top: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 0;
    max-height: none;
    padding-top: var(--space-2);
    border-right: 0;
    border-bottom: 1px solid rgba(var(--edge-rgb), 0.38);
    overflow: visible;
  }

  .left-nav.mobile-open {
    z-index: calc(var(--layer-dropdown) + 30);
  }

  .left-nav.collapsed {
    width: 100%;
    min-width: 0;
    max-width: none;
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }

  .sidebar-logo {
    position: relative;
    z-index: 2;
    margin-bottom: 0;
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }

  .sidebar-mobile-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(var(--overlay-rgb), 0.72);
    z-index: 1;
  }

  /* Bare <button>: the global button:hover:enabled accent fill (--accent-strong)
     outranks the overlay background above by specificity and would flash the whole
     backdrop accent-blue on hover. It is a dismiss target, not an affordance; hold
     the overlay tint. Same leak class already guarded on .nav-latest-session__main. */
  .sidebar-mobile-backdrop:hover:enabled {
    background: rgba(var(--overlay-rgb), 0.72);
  }

  .left-nav.mobile-open .sidebar-mobile-backdrop {
    display: block;
  }

  .sidebar-logo-link {
    width: 100%;
  }

  .sidebar-mobile-menu-indicator {
    display: inline-flex;
  }

  .left-nav.mobile-open .sidebar-mobile-menu-indicator svg {
    transform: rotate(180deg);
  }

  /* Match the base rule's `.sidebar-collapse-toggle.ui-icon-button` specificity:
     media queries don't add specificity, so a bare `.sidebar-collapse-toggle`
     loses to it and the toggle would stay visible. In this viewport the sidebar
     is an overlay menu with no persistent rail, so collapsing it is meaningless. */
  .sidebar-collapse-toggle.ui-icon-button {
    display: none;
  }

  .sidebar-menu-surface {
    display: none;
    position: absolute;
    top: calc(100% + var(--space-1));
    left: var(--space-2);
    right: var(--space-2);
    max-height: calc(100vh - 88px);
    overflow: auto;
    border: 1px solid rgba(var(--edge-rgb), 0.4);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: 0 16px 28px rgba(var(--overlay-rgb), 0.4);
    padding: var(--space-1-5);
    z-index: 3;
  }

  .left-nav.mobile-open .sidebar-menu-surface {
    display: flex;
  }

  .nav-links {
    flex: 0 0 auto;
    overflow: visible;
  }

  .left-nav.collapsed .sidebar-logo {
    justify-content: flex-start;
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }

  .left-nav.collapsed .sidebar-logo-mark {
    width: 28px;
    height: 28px;
    display: none;
  }

  /* Reveal the wordmark in the collapsed mobile bar, but keep the light/dark
     toggle. Targeting the shared `.sidebar-logo-lockup` (0,3,0) would outrank
     `.sidebar-logo-lockup--dark { display: none }` (0,1,0) and paint both
     variants at once (double logo), so drive the variants directly. */
  .left-nav.collapsed .sidebar-logo-lockup--light {
    display: block;
  }

  :root[data-theme='dark'] .left-nav.collapsed .sidebar-logo-lockup--light {
    display: none;
  }

  :root[data-theme='dark'] .left-nav.collapsed .sidebar-logo-lockup--dark {
    display: block;
  }

  .left-nav.collapsed .nav-link {
    justify-content: flex-start;
    padding: 0 var(--space-2) 0 var(--space-3);
  }

  .left-nav.collapsed .nav-link-label,
  .left-nav.collapsed .nav-link .ui-nav-item__label {
    display: inline;
  }

  .left-nav.collapsed .nav-link.active::before {
    display: block;
  }

  .left-nav.collapsed .sidebar-settings-chevron {
    display: inline-flex;
  }

  .sidebar-footer {
    margin-top: var(--space-1-5);
    padding-top: var(--space-1-5);
    border-top: 1px solid rgba(var(--edge-rgb), 0.32);
  }

  .sidebar-settings-menu {
    position: static;
    width: auto;
    min-width: 0;
    margin-top: var(--space-1);
    box-shadow: none;
  }

  .left-nav.collapsed .sidebar-settings-menu {
    position: static;
    width: auto;
    min-width: 0;
    margin-top: var(--space-1);
    box-shadow: none;
  }

  .nav-tooltip {
    display: none;
  }

  .top-bar {
    position: static;
    top: auto;
    right: auto;
    justify-content: flex-end;
    margin-bottom: var(--space-1-5);
  }

  .header-left {
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: row;
    align-items: center;
  }

  .global-search {
    /* Header is a full-width row here — the search fills it and never
       collapses; expanded props match so :focus-within keeps it at 100%. */
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-right: 0;
    --global-search-expanded: 100%;
    --global-search-expanded-min: 0;
  }

  /* Never collapses here, so the icon stays left-pinned even when unfocused —
     without this the centered collapsed-state glyph floats mid-bar. */
  .global-search::before {
    inset: 0 auto 0 12px;
    font-size: var(--font-size-lg);
  }

  .page-header,
  .page-breadcrumb {
    padding-right: 0;
  }

  .search-result-item {
    align-items: flex-start;
  }

  .search-result-tag {
    white-space: normal;
    text-align: right;
  }

  /* Responsive behavior now comes from `.page-card__header`. */
  .page-card__header {
    flex-direction: column;
  }

  .teams-list-toolbar {
    grid-template-columns: 1fr;
  }

  .teams-filter-select {
    width: 100%;
  }

  .teams-board-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Narrow viewport: collapse teams-board listing to a single stacked
     column, hide the column header (no longer meaningful). */
  .teams-board-card .da-grid__head {
    display: none;
  }

  .teams-board-card .da-grid__row {
    grid-template-columns: 1fr;
    gap: var(--space-1-5);
    padding: var(--space-2-5);
  }

  .team-list-name {
    font-size: var(--font-size-lg);
  }

  .team-table-count-cell > strong,
  .team-agent-count-chip > strong {
    font-size: var(--font-size-xl);
  }

  .team-table-action-cell {
    justify-items: start;
  }

  .context-resource-row,
  .team-resource-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .two-column-layout {
    grid-template-columns: 1fr;
  }

  .agent-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .agent-workspace-top {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .agent-workspace-head-row {
    grid-template-columns: 1fr;
  }

  .agent-workspace-actions {
    margin-left: 0;
  }

  .agent-workspace-body {
    grid-template-columns: 1fr;
  }

  .agent-workspace-body.sessions-collapsed {
    grid-template-columns: 1fr;
  }

  .agent-recent-panel {
    max-height: 260px;
  }

  .agent-session-strip {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .agent-page-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-bubble {
    min-width: 0;
    max-width: 100%;
  }

  .composer-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .composer-input-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .composer-actions {
    margin-left: 0;
    width: 100%;
    justify-content: stretch;
  }

  .composer-actions > button,
  .composer-desktop-actions > button {
    width: 100%;
  }

  .composer-runtime-meta {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .agent-details-hero {
    align-items: start;
  }

  .agent-dedicated-session-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .agent-dedicated-session-side {
    justify-items: start;
    text-align: left;
  }
}

.btn-danger {
  background: var(--danger);
  color: var(--bg);
}

.btn-danger:hover {
  opacity: 0.85;
}

.btn-sm {
  padding: 2px 8px;
  font-size: var(--font-size-sm);
}

/* Agent page anchors absolutely-positioned descendants (session menus) */
.agent-page {
  position: relative;
}

/* -------------------------------------------------------------------------- */
/* DataTable component — see components/Common/DataTable/                     */
/* All token-driven; no per-table colour overrides should be needed.          */
/* -------------------------------------------------------------------------- */

.da-table__scroll {
  overflow-x: auto;
  border: 1px solid var(--table-frame-border);
  border-radius: var(--table-radius);
  background: var(--table-frame-bg);
}

.da-table__scroll--frameless {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.da-table__scroll--full-bleed {
  margin: calc(-1 * var(--space-3));
  width: calc(100% + (var(--space-3) * 2));
  overflow: hidden auto;
  border-radius: inherit;
}

.da-table__scroll--full-bleed .da-table__col-header:first-child {
  padding-left: var(--space-3);
}

.da-table__scroll--full-bleed .da-table__col-header:last-child {
  padding-right: var(--space-3);
}

.da-table__scroll--full-bleed .da-table__cell:first-child {
  padding-left: var(--space-3);
}

.da-table__scroll--full-bleed .da-table__cell:last-child {
  padding-right: var(--space-3);
}

.da-table {
  --table-value-font-size: var(--font-size-lg);

  width: 100%;
  border-collapse: collapse;
}

.da-table__col-header {
  padding: var(--table-cell-padding-y) var(--table-cell-padding-x);
  text-align: left;
  font-size: var(--table-header-font-size);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-caps);
  color: var(--table-header-color);
  background: var(--table-header-bg);
  border-bottom: 1px solid var(--table-row-divider);
  vertical-align: middle;
}

.da-table__col-header--center {
  text-align: center;
}

.da-table__col-header--right {
  text-align: right;
}

.da-table-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
}

.da-table-filter__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.da-table-filter__select {
  width: 150px;
  min-height: var(--control-height);
  border-radius: var(--radius-control);
  border: 1px solid var(--control-border);
  background: var(--surface-soft);
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: none;
  letter-spacing: 0;
}

.da-table-filter__select:hover {
  background: var(--surface-hover);
  border-color: var(--control-border-hover);
}

.da-table-filter__select:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.da-table-filter--icon {
  justify-content: flex-start;
  gap: var(--space-1);
}

.da-table-filter__icon-control {
  position: relative;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--text-dim);
}

.da-table-filter__icon-control:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.da-table-filter--active .da-table-filter__icon-control {
  color: var(--accent);
}

.da-table-filter__icon-control:focus-within {
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.2);
}

.da-table-filter--active .da-table-filter__icon-control:focus-within {
  color: var(--accent);
}

.da-table-filter__icon-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.da-table-filter__icon {
  width: 15px;
  height: 15px;
  display: inline-flex;
  pointer-events: none;
}

.da-table-filter__icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.da-table-filter--active .da-table-filter__icon svg {
  stroke-width: 2.35;
}

.da-table__cell {
  padding: var(--table-cell-padding-y) var(--table-cell-padding-x);
  font-size: var(--table-value-font-size);
  color: var(--text);
  border-bottom: 1px solid var(--table-row-divider);
  vertical-align: middle;
}

.da-table .agent-row-main,
.da-table .agent-row-main-copy strong,
.da-table .context-id-cell strong,
.da-table .context-members-email,
.da-table .context-members-name,
.da-table .mcp-servers-agent-cell,
.da-table .mcp-servers-server-cell,
.da-table .team-list-name {
  font-size: var(--table-value-font-size);
}

.da-table__cell--center {
  text-align: center;
}

.da-table__cell--right {
  text-align: right;
}

.da-table tbody tr {
  height: var(--table-row-height-comfortable);
  transition: background-color var(--motion-medium);
}

.da-table--compact tbody tr {
  height: var(--table-row-height);
}

.da-table tbody tr:last-child .da-table__cell {
  border-bottom: none;
}

.da-table__row--clickable {
  cursor: pointer;
}

/*
 * Row-level paint (NOT per-cell). Some cells override their <td> display
 * (inline-flex / grid) for inner layout, which makes per-cell hover paint
 * leave gaps where the cell shrinks to content. Painting the <tr> covers
 * the full row width regardless of individual cell display.
 */
.da-table tbody tr:hover {
  background: var(--table-row-hover-bg);
}

.da-table__row--clickable:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.72);
  outline-offset: -2px;
}

.notification-bell:hover {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.48);
}

.profile-trigger:hover:enabled,
.profile-trigger.open {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.28);
}

.profile-menu {
  border-color: rgba(var(--edge-rgb), 0.4);
  background: var(--surface-strong);
}

.left-nav {
  background: var(--sidebar-gradient);
  border-color: rgba(var(--edge-rgb), 0.5);
}

.sidebar-logo-mark:not(img) {
  background: linear-gradient(135deg, var(--accent) 0%, var(--warning) 100%);
}

.nav-link {
  background: rgba(var(--edge-rgb), 0.07);
  color: var(--text-muted);
}

.nav-icon {
  color: color-mix(in srgb, var(--text-muted) 90%, var(--accent) 10%);
}

.nav-link.active {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.22);
  color: var(--text);
}

.nav-link:hover:enabled {
  background: rgba(var(--accent-rgb), 0.16);
}

.nav-link:focus-visible {
  border-color: rgba(var(--focus-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.nav-tooltip {
  border-color: rgba(var(--edge-rgb), 0.35);
  background: var(--surface-strong);
  color: var(--text);
}

.content-panel {
  border-color: rgba(var(--edge-rgb), 0.32);
  background: var(--panel);
}

.section-card {
  border-color: rgba(var(--edge-rgb), 0.34);
  background: var(--surface-strong);
}

.da-table__row--selected {
  background: var(--table-row-selected-bg);
}

/* AgentsPage usage: wide table needs horizontal scroll on narrow viewports. */
.agents-data-table {
  min-width: 1080px;
}

.contexts-data-table {
  min-width: 720px;
}

.agent-contexts-data-table {
  min-width: 620px;
}

.teams-data-table {
  min-width: 860px;
}

.mcp-servers-data-table {
  min-width: 940px;
}

.context-agents-data-table,
.context-teams-data-table {
  min-width: 720px;
}

.context-mcp-servers-data-table {
  min-width: 1060px;
}

.context-members-data-table {
  min-width: 620px;
}

.team-members-data-table {
  min-width: 460px;
}

.team-contexts-data-table,
.team-agents-data-table {
  min-width: 720px;
}

/* -------------------------------------------------------------------------- */
/* DataGrid (da-grid*) — token-driven card-list pattern.                       */
/*                                                                             */
/* Used for "lista-tarjeta" tables where rows are aligned cards (clickable or */
/* read-only) with shared column geometry. Visual columns come from a         */
/* per-table CSS variable `--da-grid-cols`, set inline via style attribute,   */
/* so the column template is shared between header and rows automatically.    */
/*                                                                             */
/* da-grid is ALWAYS self-framing (border + radius + bg). Never override      */
/* those properties to none/transparent in a contextual selector — see        */
/* STYLE_STANDARDIZATION.md §3 "Table frame ownership".                       */
/*                                                                             */
/* Usage:                                                                      */
/*   <div                                                                      */
/*     className="da-grid"                                                     */
/*     style={{ '--da-grid-cols': 'minmax(0, 1.5fr) minmax(0, 0.9fr)' }}       */
/*   >                                                                         */
/*     <div className="da-grid__head">                                         */
/*       <span className="da-grid__col-header">Name</span>                     */
/*       <span className="da-grid__col-header da-grid__col-header--center">    */
/*         Status                                                              */
/*       </span>                                                               */
/*     </div>                                                                  */
/*     <div className="da-grid__body">                                         */
/*       {rows.map(row => (                                                    */
/*         <button                                                             */
/*           type="button"                                                     */
/*           className="da-grid__row da-grid__row--clickable"                  */
/*           onClick={() => onSelect(row.id)}                                  */
/*         >                                                                   */
/*           ...                                                               */
/*         </button>                                                           */
/*       ))}                                                                   */
/*     </div>                                                                  */
/*   </div>                                                                    */
/*                                                                             */
/* For non-button rows (e.g. <div>), pair with `clickableRowProps()` to get    */
/* the same keyboard/aria semantics. Real <button> elements don't need it.    */
/* -------------------------------------------------------------------------- */

.da-grid {
  display: grid;
  gap: var(--grid-row-gap);
  min-width: 0;
  width: 100%;
  border: 1px solid var(--table-frame-border);
  border-radius: var(--table-radius);
  background: var(--table-frame-bg);
  overflow: hidden;
}

.da-grid__head {
  display: grid;
  grid-template-columns: var(--da-grid-cols);
  gap: var(--grid-col-gap);
  align-items: center;
  border-bottom: 1px solid var(--table-row-divider);
  padding: var(--table-cell-padding-y) var(--table-cell-padding-x);
  background: var(--table-header-bg);
}

.da-grid__col-header {
  font-size: var(--table-header-font-size);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-caps);
  color: var(--table-header-color);
}

.da-grid__col-header--center {
  text-align: center;
}

.da-grid__col-header--right {
  text-align: right;
}

.da-grid__body {
  display: grid;
  gap: var(--grid-row-gap);
  padding: 0 var(--grid-row-gap) var(--grid-row-gap) var(--grid-row-gap);
}

.da-grid__row {
  display: grid;
  grid-template-columns: var(--da-grid-cols);
  gap: var(--grid-col-gap);
  align-items: center;
  width: 100%;
  min-height: var(--grid-card-min-height);
  padding: var(--table-cell-padding-y) var(--table-cell-padding-x);
  border-radius: var(--radius-md);
  border: 1px solid var(--grid-card-border);
  background: var(--grid-card-bg);
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.da-grid__row--compact {
  min-height: 0;
}

.da-grid__row--clickable {
  cursor: pointer;
  transition:
    border-color var(--motion-fast),
    background-color var(--motion-fast);
}

/* Override the global button hover (`transform`/`filter`) so card rows don't
   wobble — they signal interactivity via colour change, not motion. */
.da-grid__row--clickable:hover:enabled {
  transform: none;
  filter: none;
  border-color: var(--grid-card-border-hover);
  background: var(--grid-card-bg-hover);
}

.da-grid__row--clickable:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.72);
  outline-offset: -2px;
}

.da-grid__row--selected {
  border-color: var(--grid-card-border-selected);
  background: var(--grid-card-bg-selected);
}

.da-grid__cell {
  min-width: 0;
}

.da-grid__cell--center {
  justify-self: center;
  text-align: center;
}

.da-grid__cell--right {
  justify-self: end;
  text-align: right;
}

@media (max-width: 1220px) {
  .user-email {
    display: none;
  }
}

/* ── Apps page view toggle + grid layout ───────────────────────────────── */

.apps-page {
  align-content: start;
}

.apps-page-header {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
}

.apps-page-header-text h2 {
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-tight);
}

.apps-page-header-text .muted {
  margin-top: var(--space-0-5);
}

.apps-page-showcase {
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  width: 100%;
  margin-top: clamp(48px, 7vh, 80px);
}

.apps-page-copy {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  max-width: 620px;
  text-align: center;
}

.apps-page-slogan {
  margin: 0;
  color: var(--text);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.apps-page-intro {
  margin: 0 auto;
  max-width: 560px;
  color: var(--text-dim);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
}

/* Grid card view */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 280px));
  justify-content: center;
  gap: var(--space-3);
  width: min(100%, 920px);
}

.apps-grid__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--grid-card-border);
  border-radius: var(--radius-md);
  background: var(--grid-card-bg);
  cursor: default;
  transition:
    border-color var(--motion-fast),
    background-color var(--motion-fast);
}

.apps-grid__card--skeleton {
  pointer-events: none;
}

.apps-grid__card--clickable {
  cursor: pointer;
}

.apps-grid__card--clickable:hover {
  border-color: var(--grid-card-border-hover);
  background: var(--grid-card-bg-hover);
}

.apps-grid__card--clickable:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.72);
  outline-offset: -2px;
}

.apps-grid__card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--space-5);
  height: var(--space-5);
  border-radius: var(--radius-sm);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent-strong);
}

.apps-grid__card-icon svg,
.apps-grid__card-icon img {
  width: 20px;
  height: 20px;
}

.apps-grid__card-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
}

.apps-status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(var(--edge-rgb), 0.26);
  padding: 1px var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  white-space: nowrap;
}

.apps-status-pill--allowed {
  color: var(--success);
  border-color: rgba(var(--success-rgb), 0.46);
  background: rgba(var(--success-rgb), 0.16);
}

.apps-status-pill--warning {
  color: var(--warning);
  border-color: rgba(var(--warning-rgb), 0.46);
  background: rgba(var(--warning-rgb), 0.16);
}

.apps-status-pill--denied {
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.44);
  background: rgba(var(--danger-rgb), 0.16);
}

.apps-status-pill--info {
  color: var(--info);
  border-color: rgba(var(--info-rgb), 0.42);
  background: rgba(var(--info-rgb), 0.14);
}

.apps-status-pill--muted {
  color: var(--text-dim);
  border-color: rgba(var(--edge-rgb), 0.3);
  background: rgba(var(--panel-rgb), 0.44);
}

.apps-card-meta__updated {
  min-width: 0;
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-tight);
}

.apps-grid__card-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: var(--font-size-sm);
  color: var(--text-dim);
  line-height: var(--line-height-normal);
}

.apps-page-copy--skeleton {
  width: min(100%, 620px);
}

.apps-grid--skeleton {
  width: min(100%, 280px);
}

.apps-skeleton-icon,
.apps-skeleton-line,
.apps-skeleton-pill {
  display: block;
  background: linear-gradient(
    90deg,
    rgba(var(--edge-rgb), 0.12) 0%,
    rgba(var(--edge-rgb), 0.26) 46%,
    rgba(var(--edge-rgb), 0.12) 100%
  );
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.apps-skeleton-icon {
  width: var(--space-5);
  height: var(--space-5);
  border-radius: var(--radius-sm);
}

.apps-skeleton-line {
  height: var(--space-1-5);
  border-radius: 999px;
}

.apps-skeleton-line--slogan {
  width: min(100%, 460px);
  height: var(--space-2);
}

.apps-skeleton-line--intro {
  width: min(100%, 560px);
}

.apps-skeleton-line--intro-short {
  width: min(72%, 420px);
}

.apps-skeleton-line--title {
  width: 92px;
}

.apps-skeleton-line--meta {
  width: 142px;
}

.apps-skeleton-line--body {
  width: 100%;
}

.apps-skeleton-line--body-short {
  width: 78%;
}

.apps-skeleton-pill {
  width: 46px;
  height: 20px;
  border-radius: 999px;
}

.apps-pagination {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--space-5);
}

.apps-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--space-5);
  height: var(--space-5);
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  border-radius: var(--radius-sm);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-strong);
  cursor: pointer;
  transition:
    border-color var(--motion-fast),
    background-color var(--motion-fast),
    color var(--motion-fast);
}

.apps-pagination__btn:hover:enabled {
  border-color: rgba(var(--accent-rgb), 0.64);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-strong);
}

.apps-pagination__btn:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.72);
  outline-offset: 2px;
}

.apps-pagination__btn:disabled {
  cursor: default;
  border-color: rgba(var(--edge-rgb), 0.32);
  background: rgba(var(--panel-rgb), 0.46);
  color: var(--text-dim);
  opacity: 0.78;
}

.apps-pagination__chevron {
  display: block;
  color: currentColor;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  transform: translateY(-1px);
}

.apps-pagination__label {
  min-width: var(--space-8);
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-tight);
  text-align: center;
}

/* ── Theme-specific overrides ────────────────────────────────────────────── */

:root[data-theme='light'] .context-scope-badge,
:root[data-theme='light'] .context-access-pill {
  color: var(--text);
  font-weight: 600;
}

:root[data-theme='light'] .context-scope-shared {
  color: color-mix(in srgb, var(--accent) 74%, var(--text) 26%);
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.18);
}

:root[data-theme='light'] .context-scope-user {
  color: color-mix(in srgb, var(--success) 76%, var(--text) 24%);
  border-color: rgba(var(--success-rgb), 0.46);
  background: rgba(var(--success-rgb), 0.24);
}

:root[data-theme='light'] .context-scope-team {
  color: color-mix(in srgb, var(--warning) 74%, var(--text) 26%);
  border-color: rgba(var(--warning-rgb), 0.46);
  background: rgba(var(--warning-rgb), 0.24);
}

:root[data-theme='light'] .context-scope-unknown {
  color: var(--unknown);
  border-color: rgba(var(--unknown-fill-rgb), 0.5);
  background: rgba(var(--unknown-fill-rgb), 0.2);
}

:root[data-theme='light'] .context-access-pill.allowed {
  color: color-mix(in srgb, var(--success) 78%, var(--text) 22%);
  border-color: rgba(var(--success-rgb), 0.48);
  background: rgba(var(--success-rgb), 0.26);
}

:root[data-theme='light'] .context-access-pill.denied {
  color: color-mix(in srgb, var(--danger) 78%, var(--text) 22%);
  border-color: rgba(var(--danger-rgb), 0.48);
  background: rgba(var(--danger-rgb), 0.22);
}

:root[data-theme='light'] .context-access-pill.warning {
  color: color-mix(in srgb, var(--warning) 74%, var(--text) 26%);
  border-color: rgba(var(--warning-rgb), 0.48);
  background: rgba(var(--warning-rgb), 0.24);
}

:root[data-theme='light'] .context-access-pill.info {
  color: color-mix(in srgb, var(--info) 76%, var(--text) 24%);
  border-color: rgba(var(--info-rgb), 0.46);
  background: rgba(var(--info-rgb), 0.18);
}

:root[data-theme='light'] .context-access-pill.muted {
  color: color-mix(in srgb, var(--unknown) 70%, var(--text) 30%);
  border-color: rgba(var(--unknown-fill-rgb), 0.5);
  background: rgba(var(--unknown-fill-rgb), 0.22);
}

.agent-page-header .muted,
.host-runtime-label,
.chat-time-label,
.activity-time,
.activity-type {
  color: var(--text-dim);
}

.host-runtime-value,
.activity-title {
  color: var(--text);
}

:root[data-theme='dark'] .sidebar-logo-mark:not(img) {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

:root[data-theme='dark'] .profile-menu {
  background: rgba(var(--panel-rgb), 0.98);
  border-color: rgba(var(--edge-rgb), 0.44);
}

:root[data-theme='dark'] .agent-page-header .muted,
:root[data-theme='dark'] .host-runtime-label,
:root[data-theme='dark'] .chat-time-label,
:root[data-theme='dark'] .activity-time,
:root[data-theme='dark'] .activity-type,
:root[data-theme='dark'] .team-summary-label {
  color: var(--text-dim);
}

:root[data-theme='dark'] .host-runtime-value,
:root[data-theme='dark'] .activity-title {
  color: var(--text);
}

:root[data-theme='dark'] .chat-bubble,
:root[data-theme='dark'] .message-block.json-content,
:root[data-theme='dark'] pre {
  background: rgba(var(--panel-rgb), 0.94);
  border-color: rgba(var(--edge-rgb), 0.34);
}

:root[data-theme='dark'] .chat-bubble.assistant {
  background: transparent;
  border-color: transparent;
}

:root[data-theme='dark'] .chat-group.user .chat-bubble {
  background: transparent;
  border-color: transparent;
}

:root[data-theme='dark'] .chat-group.user .chat-bubble .message-block {
  background: var(--surface-3);
}

:root[data-theme='dark'] .chat-thread::-webkit-scrollbar-thumb {
  background: rgba(var(--edge-rgb), 0.62);
}

:root[data-theme='dark'] .chat-onboarding-hint {
  border-color: rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text-muted);
}

/* ── Connector health table (AgentsPage) ───────────────────────────────── */

.mcp-health-section,
.mcp-health-empty {
  margin: 6px 0 0;
  border: 1px solid var(--table-frame-border);
  border-radius: var(--table-radius);
  background: var(--table-frame-bg);
  overflow: hidden;
}

.mcp-health-section--table-only,
.mcp-health-empty--table-only {
  margin: 0;
}

.mcp-health-empty {
  padding: var(--space-1) var(--space-2);
}

.mcp-health-empty--table-only {
  padding: 0;
}

/*
 * Header is a full-width <button>. Using flex + pointer so the entire
 * strip is a click target — no dead zones around the caret.
 * Compact vertical rhythm (~26px) when collapsed so the section barely
 * claims screen space; the expanded state relaxes the padding a little.
 */
.mcp-health-heading {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
  width: 100%;
  padding: 4px 10px;
  min-height: 26px;
  line-height: 1.1;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: default;
}

.mcp-health-section.is-expanded .mcp-health-heading {
  padding: var(--space-1) var(--space-2-5);
}

.mcp-health-heading--minimal {
  justify-content: flex-end;
  padding: 4px 8px 2px;
}

.mcp-health-heading h4 {
  margin: 0;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.1;
  color: var(--text-muted);
}

.mcp-health-heading--toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--motion-fast);
}

.mcp-health-heading--static {
  cursor: default;
}

.mcp-health-heading--toggle:hover,
.mcp-health-heading--toggle:focus-visible {
  background: rgba(var(--accent-rgb), 0.08);
}

.mcp-health-heading--static:hover,
.mcp-health-heading--static:focus-visible {
  background: transparent;
}

.mcp-health-heading--toggle:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.55);
  outline-offset: -2px;
}

.mcp-health-heading--toggle:hover h4,
.mcp-health-heading--toggle:focus-visible h4 {
  color: var(--text);
}

.mcp-health-caret {
  width: 9px;
  height: 9px;
  color: var(--text-dim);
  transition:
    transform 150ms ease,
    color var(--motion-fast);
  flex-shrink: 0;
}

.mcp-health-caret.is-expanded {
  transform: rotate(90deg);
  color: var(--text-muted);
}

.mcp-health-summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  font-size: var(--font-size-xs);
  line-height: 1.1;
}

.mcp-health-summary-count {
  color: var(--text-dim);
  line-height: 1.1;
}

.mcp-health-summary-attention {
  color: var(--danger);
  border: 1px solid rgba(var(--danger-rgb), 0.5);
  background: rgba(var(--danger-rgb), 0.15);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: var(--font-size-xs);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.mcp-health-fallback {
  font-size: var(--font-size-xs);
  line-height: 1.1;
  font-style: italic;
  color: var(--text-dim);
}

.mcp-health-refresh {
  margin-left: auto;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    color var(--motion-fast),
    border-color var(--motion-fast),
    background var(--motion-fast);
}

.mcp-health-refresh:hover:not(:disabled) {
  color: var(--text);
  border-color: rgba(var(--edge-rgb), 0.36);
  background: rgba(var(--accent-rgb), 0.12);
}

.mcp-health-refresh:disabled {
  cursor: default;
  opacity: 0.6;
}

.mcp-health-refresh svg {
  width: 13px;
  height: 13px;
}

.mcp-health-refresh.is-refreshing svg {
  animation: mcp-health-spin 0.8s linear infinite;
}

@keyframes mcp-health-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ── Expanded body ──────────────────────────────────────────────────── */

.mcp-health-rows {
  margin: 0;
  padding: var(--table-cell-padding-y) var(--table-cell-padding-x) var(--grid-row-gap);
  display: grid;
  gap: var(--grid-row-gap);
  border-top: 1px solid var(--table-row-divider);
  background: transparent;
}

.mcp-health-section--table-only .mcp-health-rows {
  padding: 0;
  border-top: none;
  gap: 0;
}

.agent-mcp-health-data-table {
  min-width: 620px;
}

.mcp-health-rows ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
}

.mcp-health-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  padding: var(--table-cell-padding-y) var(--table-cell-padding-x);
  font-size: var(--table-header-font-size);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-caps);
  text-transform: uppercase;
  color: var(--table-header-color);
  background: var(--table-header-bg);
  border-bottom: 1px solid var(--table-row-divider);
}

.mcp-health-columns span:last-child {
  justify-self: end;
}

.mcp-health-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  padding: var(--table-cell-padding-y) var(--table-cell-padding-x);
  font-size: var(--font-size-md);
  border: 1px solid var(--grid-card-border);
  border-radius: var(--radius-md);
  background: var(--grid-card-bg);
}

.mcp-health-name-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  min-width: 0;
}

.mcp-health-name {
  font-family: inherit;
  font-size: var(--table-value-font-size);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcp-health-row-attention {
  border: 1px solid rgba(var(--danger-rgb), 0.5);
  background: rgba(var(--danger-rgb), 0.14);
  color: var(--danger);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  line-height: 1.2;
  flex-shrink: 0;
}

.mcp-health-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1-5);
  min-width: max-content;
  justify-self: end;
}

/* ── Status chips — semantic tokens ─────────────────────────────────── */

.mcp-health-chip {
  border-radius: 999px;
  padding: 2px 9px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  background: rgba(var(--panel-rgb), 0.6);
  color: var(--text-muted);
}

.mcp-health-chip--running {
  color: var(--success);
  border-color: rgba(var(--success-rgb), 0.5);
  background: rgba(var(--success-rgb), 0.14);
}

.mcp-health-chip--degraded {
  color: var(--warning);
  border-color: rgba(var(--warning-rgb), 0.55);
  background: rgba(var(--warning-rgb), 0.14);
}

.mcp-health-chip--failed {
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.55);
  background: rgba(var(--danger-rgb), 0.14);
}

.mcp-health-chip--starting {
  color: var(--info);
  border-color: rgba(var(--info-rgb), 0.5);
  background: rgba(var(--info-rgb), 0.12);
}

.mcp-health-chip--disabled {
  color: var(--text-dim);
  border-color: rgba(var(--edge-rgb), 0.34);
  border-style: dashed;
  background: transparent;
}

.mcp-health-chip--stale,
.mcp-health-chip--unknown {
  color: var(--text-dim);
  border-color: rgba(var(--edge-rgb), 0.28);
  background: rgba(var(--panel-rgb), 0.4);
}

.sandbox-ui-embed-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  /* Floor only — flex: 1 stretches the slot to fill the available column
     height (see the flex chain below). min-height keeps it usable on very
     short windows rather than collapsing toward zero. */
  min-height: 240px;
  background: var(--bg-elev-2);
  overflow: hidden;
}

.sandbox-ui-embed-preview {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

/* Recovery action (Reopen / Retry) at the trailing end of an app status banner. */
.sandbox-ui-status-action {
  margin-left: auto;
  flex-shrink: 0;
}

.sandbox-ui-loading {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  color: var(--text-dim);
}

.sandbox-ui-loading__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  width: var(--space-10);
  height: var(--space-10);
  border: 1px solid rgba(var(--edge-rgb), 0.28);
  border-radius: var(--radius-sm);
  background: rgba(var(--panel-rgb), 0.72);
  box-shadow: var(--shadow-soft);
}

.sandbox-ui-loading__mark span {
  width: var(--space-1);
  height: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--accent-strong);
  opacity: 0.42;
  animation: sandbox-ui-loading-pulse 920ms ease-in-out infinite;
}

.sandbox-ui-loading__mark span:nth-child(2) {
  animation-delay: 120ms;
}

.sandbox-ui-loading__mark span:nth-child(3) {
  animation-delay: 240ms;
}

.sandbox-ui-loading__text {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
}

@keyframes sandbox-ui-loading-pulse {
  0%,
  100% {
    opacity: 0.32;
    transform: scaleY(0.62);
  }

  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .apps-skeleton-icon,
  .apps-skeleton-line,
  .apps-skeleton-pill,
  .chat-skeleton-line,
  .chat-skeleton-send,
  .sandbox-ui-loading__mark span,
  .boot-screen,
  .boot-brand,
  .boot-progress,
  .boot-status,
  .boot-overlay--leaving .boot-screen {
    animation: none;
    transform: none;
    opacity: 1;
  }
}

/* Pull the embed up and let it fill the column: tighten the page-shell gap,
   trim the content-panel top padding, and switch the page to a flex column
   so the embed slot's flex: 1 stretches to the available height instead of
   relying on a hardcoded min-height. The app actions moved to the title bar's
   leading slot, so these :has() selectors now anchor on the embed slot itself
   — present only in the mounted/minting view, never in the picker. */
.page:has(.sandbox-ui-embed-slot) {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-height: 0;
}

.content-panel:has(.sandbox-ui-embed-slot) {
  padding: var(--space-1) var(--space-2) var(--space-2) var(--space-2);
  align-content: stretch;
}

.content-panel:has(.sandbox-ui-embed-slot) > .top-bar {
  right: var(--space-4);
}

.content-panel.content-panel--app-notification-drawer-open > .page:has(.sandbox-ui-embed-slot) {
  padding-right: var(--app-header-utilities-width);
}

/* Chat drawer — Cursor-style chat column beside the live app embed. It shrinks
   the embed with the same `--app-header-utilities-width` gutter the notification
   drawer uses, but derives that gutter from its OWN width (`--chat-drawer-width`)
   so resizing the chat drawer never disturbs the notification drawer. The two
   drawer-open states are mutually exclusive (see App.tsx notificationTrayUsesDrawer),
   so this higher-specificity override is unambiguous. */
.content-panel.content-panel--chat-drawer-open {
  /* Docked drawer: the embed shrinks by exactly the drawer's width so its right
     edge meets the drawer's left edge at the 1px resize seam — no transparent
     gutter between them. (The drag/clamp math in useChatDrawerResize keeps its
     own, deliberately more conservative, embed-floor reserve; this value only
     drives the visual padding.) */
  --app-header-utilities-width: var(--chat-drawer-width);
}

/* Universal tab-area gutter (mini-spec 04a §A1). The chat drawer is available on
   any non-chat tab, so the "tab area" — the page content between the sidebar and
   the drawer — must shrink for ANY active tab kind, not only the app embed. The
   gutter is `padding-right` on the active tab's `.page` child (app embed slot,
   files, settings, connectors, agents, plugins, the apps picker — all render a
   direct `.page`), never on the measured content-panel, so opening the drawer
   (which is `position: fixed`) never changes the panel's `clientWidth` and there
   is no ResizeObserver feedback loop (confirmed in useChatDrawerResize). */
.content-panel.content-panel--chat-drawer-open > .page {
  padding-right: var(--app-header-utilities-width);
}

/* Right-rail shell (mini-spec 04a §B): the fixed right column that a single
   occupant fills. It owns the rail geometry via one shared token set
   (`--rail-width`, `--rail-top`); the occupant supplies the values. Flush to the
   panel's right and bottom edges (VS Code secondary-side-bar style). */
.right-rail-shell {
  position: fixed;
  /* Follow the measured top the occupant publishes (`--rail-top`); when
     unmeasured (DOM tabs, tests) fall back to a single-row header at
     space-4 + 36px + space-2 = 64px so the rail never waits on a measurement
     that never arrives (§A2). */
  top: var(--rail-top, calc(var(--space-4) + 36px + var(--space-2)));
  right: 0;
  bottom: 0;
  width: var(--rail-width);
  z-index: var(--layer-chat-overlay);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Per-occupant rail width is published inline by RightRailShell from the
   occupant's runtime width (the chat drawer is resizable), so it lives on the
   element, not here. A future notification-tray occupant sets its own inline
   --rail-width the same way. */

.chat-drawer {
  /* Positioning context for the absolute resize handle; the drawer fills the
     rail shell (which owns top/right/bottom/width). The only visible edge is the
     1px resize seam on the LEFT (see __resize-handle::after), which owns the
     border between the content and the drawer — the drawer itself carries no
     border. */
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Pairs with the sidebar surface so the drawer reads as a secondary side bar,
     distinct from the editor/embed zone (which is --surface-0/--panel). */
  background: var(--surface-3);
  overflow: hidden;
  /* Anti-flash: reveal only after the drawer is ready (app tabs: the embed acks
     its shrunk bounds; DOM tabs: immediately, same frame — §A2). */
  opacity: 0;
  pointer-events: none;
}

.chat-drawer.is-ready {
  opacity: 1;
  pointer-events: auto;
}

/* Drag handle on the drawer's LEFT edge. A comfortable ~8px grab strip (the
   hit-area) whose ::after paints the docked seam: a persistent 1px rule at rest
   that thickens to a 2px accent on hover / during a drag. Sits inside the drawer
   (which clips overflow), above the header/surface content. */
.chat-drawer__resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 100%;
  z-index: 2;
  cursor: col-resize;
  background: transparent;
  touch-action: none;
}

.chat-drawer__resize-handle::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: var(--zone-border);
  transition: background var(--motion-fast);
}

.chat-drawer__resize-handle:hover::after,
.chat-drawer.is-resizing .chat-drawer__resize-handle::after {
  width: 2px;
  background: rgba(var(--accent-rgb), 0.55);
}

/* Compact chrome — narrow-column only. Scoped entirely under `.chat-drawer`, so
   the full-screen chat route (which renders the same <ChatPage> OUTSIDE this
   ancestor) is untouched. Trims the padding/margins that read as "loose" in the
   slim column and neutralizes the full-height grid the workspace uses in
   full-screen (which would overflow this fixed rail and leave odd gaps). */
.chat-drawer .agent-page {
  height: 100%;
}

/* Propagate the 0 width-floor down the chat body chain so no descendant's
   min-content (the greeting heading, the composer action row) inflates the slim
   column and reintroduces the horizontal scrollbar the surface just clipped.
   Full-screen gets this from `.chat-view-surface__content > .agent-page`, which
   the drawer's <ChatPage> renders outside of; this mirrors it, scoped here. */
.chat-drawer .agent-page,
.chat-drawer .agent-workspace-shell,
.chat-drawer .agent-workspace-body-slot {
  min-width: 0;
}

.chat-drawer .agent-workspace-shell .chat-thread {
  padding: var(--space-2);
}

.chat-drawer .agent-workspace-shell .chat-empty-state {
  padding: var(--space-4) 0 var(--space-2);
}

.chat-drawer .agent-workspace-shell .agent-workspace-top {
  padding: var(--space-1) var(--space-2);
}

/* The workspace head (session breadcrumb + token/context indicators) lives in
   the nav-stack, which — unlike the thread, top and tabs below — had no
   drawer-scoped inset, so its title and token pills sat flush against the slim
   column's top-left edge. Give it the same horizontal rhythm the other sections
   use so the breadcrumb aligns with the thread text; full-screen gets this inset
   from `.content-panel--agent-chat` instead, which the drawer's <ChatPage>
   renders outside of. Keep the nav-stack's sticky `padding-bottom` intact. */
.chat-drawer .agent-workspace-shell .agent-chat-nav-stack {
  padding: var(--space-2) var(--space-2) var(--space-1);
}

.chat-drawer .agent-workspace-shell .agent-workspace-tabs {
  padding: 0 var(--space-2);
}

/* New-chat greeting ("New chat with [agent ▾]"). Like the nav-stack head above,
   this row has zero horizontal padding by design — full-screen chat insets it
   via `.content-panel--agent-chat` (which the drawer's <ChatPage> renders
   outside of) and its 1120px max-width + `margin: 0 auto` centers it there. In
   the slim column neither applies, so the title sat flush against the left
   edge. Give it the same `var(--space-2)` horizontal rhythm the thread and head
   use; keep the base rule's hero top offset and bottom padding intact. */
.chat-drawer .agent-workspace-shell .agent-workspace-greeting-row {
  padding-inline: var(--space-2);
  /* The slim column can't fit the greeting + agent selector on one line at the
     full-screen 2xl size, so let them wrap and step the type down to lg. */
  flex-wrap: wrap;
}

.chat-drawer .agent-workspace-greeting-row .agent-workspace-greeting,
.chat-drawer .agent-workspace-greeting-row .agent-title-selector-trigger.ui-button,
.chat-drawer .agent-workspace-greeting-row .agent-title-selector-trigger.ui-button--sm {
  font-size: var(--font-size-lg);
}

/* Let the agent selector shrink and its label ellipsize instead of forcing the
   row wider than the column (full-screen pins it at `flex: 0 0 auto`). */
.chat-drawer .agent-workspace-greeting-row .agent-title-selector {
  flex: 0 1 auto;
  min-width: 0;
}

.chat-drawer .agent-workspace-greeting-row .agent-title-selector-trigger {
  min-width: 0;
}

.chat-drawer .composer {
  margin-top: var(--space-1);
  padding: var(--space-2);
}

/* The composer action row packs the agent selector, reference toolbar, model
   chip and send button; at full-screen widths they sit on one line, but their
   combined min-content exceeds the slim column. Let the row wrap and the
   right-hand cluster shrink so it reflows instead of forcing the column wider. */
.chat-drawer .composer-input-actions {
  flex-wrap: wrap;
}

.chat-drawer .composer-actions-right {
  min-width: 0;
  flex: 0 1 auto;
}

/* Tighter table cells so the data table breathes in the slim column; the
   `.da-table__scroll` horizontal overflow still handles anything too wide. */
.chat-drawer .da-table {
  --table-cell-padding-x: var(--space-1-5);
  --table-cell-padding-y: var(--space-1);
}

.chat-drawer__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.24);
  flex: 0 0 auto;
}

.chat-drawer__header-main {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-drawer__header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex: 0 0 auto;
}

/* The base .ui-icon-button sizes the button but never the glyph — each call
   site sets its own svg size. Match the app's standard 16px icon inside a 30px
   (sm) icon button so the new-chat / close controls line up with the rest of
   the app instead of rendering the raw 24-viewbox artwork oversized. */
.chat-drawer__header-actions .ui-icon-button svg {
  width: 16px;
  height: 16px;
}

.chat-drawer__title {
  display: block;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-drawer__surface {
  flex: 1 1 auto;
  min-height: 0;
  /* min-width:0 establishes a 0 width-floor so the embedded chat's min-content
     can't inflate this fixed rail wider than the drawer; overflow-x:hidden clips
     any residual. Per CSS spec `overflow-y:auto` with a `visible` overflow-x
     would compute overflow-x to `auto` and surface a horizontal scrollbar — this
     pins it to `hidden`. The full-screen route gets the same floor/clip from
     `.chat-view-surface`, which the drawer's <ChatPage> renders outside of. */
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Open-chats selector in the drawer header — a thin dropdown over chatViewTabs.
   The narrow drawer column can't host a horizontal tab strip, so the switcher
   lists chats vertically with their status badge. */
.chat-switcher {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.chat-switcher__trigger {
  min-width: 0;
}

.chat-switcher__trigger-main {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  min-width: 0;
  overflow: hidden;
}

.chat-switcher__chevron {
  flex: 0 0 auto;
  margin-left: var(--space-1);
  color: var(--text-dim);
}

.chat-switcher__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-switcher__menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  left: 0;
  right: 0;
  z-index: calc(var(--layer-dropdown) + 10);
  border: 1px solid rgba(var(--edge-rgb), 0.32);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-hard);
  padding: var(--space-1);
  display: grid;
  gap: var(--space-1);
}

.chat-switcher__options {
  display: grid;
  gap: var(--space-0-5);
  max-height: min(360px, 50vh);
  overflow-y: auto;
  scrollbar-width: thin;
}

.chat-switcher__option {
  min-width: 0;
  gap: var(--space-1-5);
}

.chat-switcher__option.is-active {
  background: rgba(var(--accent-rgb), 0.14);
}

.chat-switcher__footer {
  border-top: 1px solid rgba(var(--edge-rgb), 0.24);
  padding-top: var(--space-1);
}

/* Overlay confinement. The native app view paints above ALL DOM, so any chat
   overlay that crosses the embed's rect is hidden behind it. The drawer is
   RIGHT-docked, so the embed sits to its LEFT. The composer reference SUBMENU
   used to be in-flow here and had to pin a rightward direction to stay off the
   embed; it is now portaled to document.body and confined to the drawer's rect
   in JS (useFlyoutPosition), so no in-flow override is needed — a submenu clamped
   inside the drawer is by construction off the embed. The primary panel is still
   in flow and left-anchored at the composer's left edge. */
.chat-drawer .composer-reference-menu-panel {
  left: 0;
  right: auto;
}

@media (min-width: 901px) and (max-width: 1220px) {
  .global-search {
    --global-search-expanded: clamp(160px, 32vw, var(--app-notification-drawer-width));
    --global-search-expanded-min: 160px;
  }
}

.window-titlebar__actions .search-input {
  border-color: var(--titlebar-action-border) !important;
  background: var(--titlebar-action-surface) !important;
  color: var(--titlebar-action-ink) !important;
  box-shadow: 0 6px 14px rgba(var(--overlay-rgb), 0.08) !important;
  -webkit-text-fill-color: var(--titlebar-action-ink) !important;
}

.window-titlebar__actions .search-input--titlebar {
  border-color: var(--titlebar-action-border) !important;
  background: var(--titlebar-action-surface) !important;
  color: var(--titlebar-action-ink) !important;
  opacity: 1 !important;
  -webkit-text-fill-color: var(--titlebar-action-ink) !important;
}

.window-titlebar__actions .global-search::before,
.window-titlebar__actions .global-search--titlebar::before {
  color: var(--titlebar-action-ink) !important;
}

.window-titlebar__actions .global-search--titlebar::before {
  content: none !important;
}

.window-titlebar__actions .global-search__titlebar-icon {
  position: absolute;
  inset: 0 auto 0 11px;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--titlebar-action-ink) !important;
  font-size: var(--font-size-lg);
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}

.window-titlebar__actions .search-input__titlebar-placeholder {
  position: absolute;
  inset: 0 auto 0 34px;
  z-index: 1;
  display: flex;
  align-items: center;
  color: var(--titlebar-action-ink) !important;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  pointer-events: none;
}

.window-titlebar__actions .search-input::placeholder,
.window-titlebar__actions .search-input--titlebar::placeholder {
  color: var(--titlebar-action-ink) !important;
  opacity: 1 !important;
}

.window-titlebar__actions .search-input--titlebar::placeholder {
  color: transparent !important;
}

/* The titlebar bell is a ghost control: border and fill live on :hover only
   (see the .window-titlebar__actions .notification-bell block above). Only its
   icon ink is pinned here so the glyph stays legible against the title bar. */
.window-titlebar__actions .notification-bell--titlebar {
  color: var(--titlebar-action-ink) !important;
  opacity: 1 !important;
}

.window-titlebar__actions .notification-bell svg,
.window-titlebar__actions .notification-bell--titlebar svg {
  color: var(--titlebar-action-ink) !important;
  stroke: var(--titlebar-action-ink) !important;
}

/* Chat-drawer toggle (mini-spec 04a §C): a ghost control between the search and
   the bell, styled like the titlebar bell. In the title bar the whole cluster
   is packed to the right by `.window-titlebar__actions .top-bar`'s
   `justify-content: flex-end` (search/toggle/bell are all `flex: 0 0 auto` with
   `margin-left: 0`), so the toggle sits in flow between the search and the bell
   with the top-bar gap — it must NOT carry a `margin-left: auto`, which would
   absorb the row's free space and shove the search pill to the far left, on top
   of the app's leading actions. */
.window-titlebar__actions .chat-drawer-toggle {
  /* 36px wide to match the bell's footprint: the real toggle is an IconButton,
     whose `.ui-icon-button` base pins `min-width: 36px`, so its used width is 36
     regardless of this `width`. Pin `min-width` here too so the placeholder span
     (which lacks `.ui-icon-button`) reserves the identical 36px — otherwise it
     collapses to 30px and the search pill still shifts ~6px on toggle. */
  width: 36px;
  min-width: 36px;
  height: 30px;
  min-height: 30px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  /* The root title bar is the only `-webkit-app-region: drag` band; every
     clickable control carves itself out as `no-drag` (see .window-titlebar__leading)
     or the OS swallows its clicks for window dragging. */
  -webkit-app-region: no-drag;
}

.window-titlebar__actions .chat-drawer-toggle svg {
  width: 16px;
  height: 16px;
  color: var(--titlebar-action-ink) !important;
  stroke: var(--titlebar-action-ink) !important;
}

.window-titlebar__actions .chat-drawer-toggle:hover:enabled,
.window-titlebar__actions .chat-drawer-toggle[aria-pressed='true'] {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: var(--surface-hover);
}

/* Slot-reserving twin of the chat-drawer toggle. On chat tabs the real button
   is unmounted, but this inert placeholder shares `.chat-drawer-toggle`'s box
   (same 36px footprint + top-bar gap) so the toggle appears/disappears in place
   without sliding the search pill and bell sideways. */
.window-titlebar__actions .chat-drawer-toggle--placeholder {
  visibility: hidden;
  pointer-events: none;
}

:root[data-theme='dark'] .window-titlebar__actions .search-input {
  border-color: var(--titlebar-action-border) !important;
  background: var(--titlebar-action-surface) !important;
}

:root[data-theme='dark'] .window-titlebar__actions .search-input,
:root[data-theme='dark'] .window-titlebar__actions .global-search::before,
:root[data-theme='dark'] .window-titlebar__actions .notification-bell svg {
  color: var(--titlebar-action-ink) !important;
}

:root[data-theme='dark'] .window-titlebar__actions .search-input::placeholder {
  color: var(--titlebar-action-ink) !important;
}

/* Agent Files tab - read-only browser of attached SharedFileSystems */
.shared-files-tab {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.shared-files-tab-main {
  width: 100%;
}

.shared-files-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: var(--font-size-md);
  color: var(--text);
}

.shared-files-crumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.shared-files-crumb-sep {
  color: var(--text-muted);
}

.shared-files-refresh {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(var(--edge-rgb), 0.34);
  color: var(--text);
  padding: 2px 10px;
  border-radius: 6px;
  font-size: var(--font-size-sm);
}

.shared-files-browser {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shared-files-browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.18);
}

.shared-files-browser-path code {
  font-size: var(--font-size-sm);
  background: rgba(var(--panel-rgb), 0.4);
  padding: 2px 8px;
  border-radius: 6px;
}

.shared-files-up {
  align-self: flex-start;
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: var(--font-size-md);
  padding: 0;
}

.shared-files-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-md);
}

.shared-files-table th,
.shared-files-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.14);
}

.shared-files-link {
  background: transparent;
  border: 0;
  color: var(--accent);
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.shared-files-download {
  background: transparent;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 6px;
  font-size: var(--font-size-sm);
}

.shared-files-download:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* ── Chat page ── */

.chat-page .agent-workspace-shell {
  position: relative;
}

/* ── Chat page session header ── */

.chat-page-session-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.12);
  min-height: 44px;
  flex-shrink: 0;
}

.chat-page-back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
}

.chat-page-back-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.chat-page-back-link:hover:enabled {
  color: var(--text-dim);
}

.chat-page-back-link:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.5);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.chat-page-session-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-page-session-agent {
  font-size: var(--font-size-xs);
  color: var(--text-dim);
  background: rgba(var(--accent-soft-rgb), 0.14);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  margin-left: auto;
}

/* ── Agent selector in composer ── */

.composer-agent-selector-slot {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
}

.composer-actions-right {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.composer-reference-toolbar {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  flex: 1 1 auto;
  margin-right: auto;
}

.composer-reference-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: calc(var(--layer-dropdown) + 60);
}

.composer-reference-trigger {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: var(--radius-control);
  line-height: 0;
}

.composer-reference-trigger svg {
  display: block;
  width: 16px;
  height: 16px;
}

.composer-reference-menu-panel,
.composer-reference-submenu {
  z-index: calc(var(--layer-dropdown) + 60);
  min-width: 210px;
  border: 1px solid rgba(var(--edge-rgb), 0.32);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-hard);
  padding: var(--space-1);
  display: grid;
  gap: var(--space-0-5);
}

/* The primary panel stays in flow (210px fits the 340px drawer). Only the
   submenu is portaled. */
.composer-reference-menu-panel {
  position: absolute;
  bottom: calc(100% + var(--space-1));
  left: 0;
}

/* Portaled to document.body and positioned by useFlyoutPosition with a fixed
   rect clamped to the chat drawer (or the viewport in full screen), so it carries
   no in-flow anchor offsets. It sits above the persistent sidebar flyout layer
   (dropdown + 1000), matching the GfsResourceMenu portal. */
.composer-reference-submenu {
  position: fixed;
  z-index: calc(var(--layer-dropdown) + 1101);
  width: min(210px, calc(100vw - (var(--space-4) * 2)));
  min-width: min(210px, calc(100vw - (var(--space-4) * 2)));
  max-height: min(420px, 65vh);
  overflow-y: auto;
  scrollbar-width: thin;
}

.composer-reference-submenu::-webkit-scrollbar {
  width: 8px;
}

.composer-reference-submenu::-webkit-scrollbar-thumb {
  background: rgba(var(--edge-rgb), 0.4);
  border-radius: 4px;
}

.composer-reference-submenu::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--edge-rgb), 0.6);
}

.composer-inline .composer-reference-menu-panel {
  top: calc(100% + var(--space-1));
  bottom: auto;
}

.composer-reference-menu-primary {
  display: grid;
  gap: var(--space-0-5);
}

.composer-reference-menu-primary .ui-menu-item__icon {
  width: 16px;
  height: 16px;
}

.composer-reference-menu-primary .ui-menu-item__icon svg {
  width: 16px;
  height: 16px;
}

.composer-reference-menu-empty {
  color: var(--text-dim);
  font-size: var(--font-size-sm);
  padding: var(--space-1-5) var(--space-2);
}

.composer-reference-menu-item-disabled {
  color: var(--text-dim);
  cursor: not-allowed;
}

.composer-reference-icon {
  width: 26px;
  height: 26px;
  min-width: 26px;
  flex: 0 0 26px;
  border-radius: var(--radius-sm);
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  line-height: 1;
  color: var(--text);
  border: 1px solid rgba(var(--edge-rgb), 0.28);
  background: rgba(var(--edge-rgb), 0.14);
}

.composer-reference-icon svg {
  display: block;
  width: 14px;
  height: 14px;
}

.composer-reference-icon--uploaded-image svg {
  width: 13px;
  height: 13px;
  stroke-width: 1.8;
}

.composer-reference-icon--plugin {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(var(--accent-rgb), 0.36);
}

.composer-reference-icon--connector {
  background: rgba(var(--info-rgb), 0.14);
  border-color: rgba(var(--info-rgb), 0.34);
}

.composer-reference-icon--uploaded-image {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.34);
}

.composer-reference-icon--uploaded-file {
  background: rgba(var(--info-rgb), 0.14);
  border-color: rgba(var(--info-rgb), 0.34);
}

.composer-reference-icon--uploaded-file svg {
  width: 13px;
  height: 13px;
  stroke-width: 1.8;
}

/* Support the JS attachment type and the CSS-friendly alias used by modal rows. */
.composer-reference-icon--agent_file,
.composer-reference-icon--agent-file {
  background: rgba(var(--success-rgb), 0.14);
  border-color: rgba(var(--success-rgb), 0.34);
}

.composer-reference-icon--global_file {
  background: rgba(var(--accent-rgb), 0.15);
  border-color: rgba(var(--accent-rgb), 0.38);
  color: var(--accent-strong);
}

.composer-global-files-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--layer-chat-overlay) + 1);
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgba(var(--overlay-rgb), 0.76);
  backdrop-filter: blur(10px);
}

.composer-global-files-panel {
  width: min(780px, 96vw);
  height: min(680px, 90vh);
  min-height: 460px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.1), transparent 34%), var(--surface-strong);
  box-shadow:
    var(--shadow-hard),
    inset 0 1px 0 rgba(var(--edge-rgb), 0.18);
}

.composer-global-files-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.2);
}

.composer-global-files-heading-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  border-radius: var(--radius-lg);
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent-strong);
  box-shadow: inset 0 1px 0 rgba(var(--edge-rgb), 0.18);
}

.composer-global-files-heading-icon svg {
  width: 21px;
  height: 21px;
}

.composer-global-files-heading {
  min-width: 0;
  display: grid;
  gap: var(--space-0-5);
}

.composer-global-files-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-tight);
}

.composer-global-files-heading .muted {
  font-size: var(--font-size-sm);
}

.composer-global-files-eyebrow {
  color: var(--accent-strong);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-caps);
  text-transform: uppercase;
}

.composer-global-files-breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-0-5);
  overflow-x: auto;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.18);
  background: rgba(var(--overlay-rgb), 0.1);
  scrollbar-width: thin;
}

.composer-global-files-crumb-group {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-0-5);
}

.composer-global-files-crumb-group > svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: var(--text-dim);
}

.composer-global-files-crumb.ui-button {
  max-width: 190px;
  min-width: 0;
  overflow: hidden;
  padding-inline: var(--space-1);
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-global-files-crumb.ui-button:disabled {
  color: var(--text);
  opacity: 1;
}

.composer-global-files-browser {
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-3) var(--space-4);
  scrollbar-width: thin;
}

.composer-global-files-list {
  display: grid;
  align-content: start;
  gap: var(--space-1);
}

.composer-global-files-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid rgba(var(--edge-rgb), 0.22);
  border-radius: var(--radius-md);
  background: rgba(var(--edge-rgb), 0.07);
  color: var(--text);
  padding: var(--space-1-5) var(--space-2-5);
  transition:
    background var(--motion-fast),
    border-color var(--motion-fast),
    box-shadow var(--motion-fast);
}

.composer-global-files-row--folder.ui-button {
  min-height: 58px;
  padding: var(--space-1-5) var(--space-2-5);
  border: 1px solid rgba(var(--edge-rgb), 0.22);
  background: rgba(var(--edge-rgb), 0.07);
}

.composer-global-files-row--folder.ui-button:hover:enabled,
.composer-global-files-row--file:hover {
  border-color: rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.1);
  box-shadow: inset 3px 0 0 rgba(var(--accent-rgb), 0.55);
}

.composer-global-files-row--file {
  cursor: pointer;
}

.composer-global-files-row--selected {
  border-color: rgba(var(--accent-rgb), 0.52);
  background: rgba(var(--accent-rgb), 0.14);
  box-shadow: inset 3px 0 0 var(--accent);
}

.composer-global-files-entry-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--edge-rgb), 0.24);
  border-radius: var(--radius-sm);
  background: rgba(var(--edge-rgb), 0.11);
  color: var(--text-muted);
}

.composer-global-files-row--folder .composer-global-files-entry-icon {
  border-color: rgba(var(--warning-rgb), 0.28);
  background: rgba(var(--warning-rgb), 0.1);
  color: var(--warning);
}

.composer-global-files-row--selected .composer-global-files-entry-icon {
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-strong);
}

.composer-global-files-entry-icon svg {
  width: 17px;
  height: 17px;
}

.composer-global-files-entry-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: var(--space-0-5);
  text-align: left;
}

.composer-global-files-entry-copy strong,
.composer-global-files-entry-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-global-files-entry-copy strong {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
}

.composer-global-files-entry-copy small,
.composer-global-files-selected-label {
  color: var(--text-dim);
  font-size: var(--font-size-xs);
}

.composer-global-files-row-chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--text-dim);
}

.composer-global-files-checkbox {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.composer-global-files-checkbox:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.58);
  outline-offset: 2px;
}

.composer-global-files-selected-label {
  min-width: 48px;
  text-align: right;
}

.composer-global-files-row--selected .composer-global-files-selected-label {
  color: var(--accent-strong);
  font-weight: var(--font-weight-semibold);
}

.composer-global-files-loading {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.composer-global-files-load-more.ui-button {
  justify-self: center;
  margin-top: var(--space-2);
}

.composer-global-files-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid rgba(var(--edge-rgb), 0.22);
  background: rgba(var(--overlay-rgb), 0.12);
}

.composer-global-files-selection-summary {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.composer-global-files-selection-summary strong {
  color: var(--accent-strong);
  font-size: var(--font-size-lg);
}

@media (max-width: 680px) {
  .composer-global-files-modal {
    padding: var(--space-2);
  }

  .composer-global-files-panel {
    width: 100%;
    height: min(720px, 96vh);
  }

  .composer-global-files-header,
  .composer-global-files-browser,
  .composer-global-files-footer {
    padding-inline: var(--space-3);
  }

  .composer-global-files-breadcrumbs {
    padding-inline: var(--space-3);
  }

  .composer-global-files-selected-label {
    display: none;
  }
}

.chat-agent-selector {
  appearance: none;
  background: rgba(var(--panel-rgb), 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--font-size-sm);
  font-family: inherit;
  padding: 4px 26px 4px 10px;
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2392969e' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.chat-agent-selector:hover {
  border-color: var(--border-soft);
}

.chat-agent-selector:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.5);
  outline-offset: 1px;
}

/* ── Agent label in session rows ── */

.agent-dedicated-session-agent {
  font-size: var(--font-size-xs);
  color: var(--text-dim);
  background: rgba(var(--accent-soft-rgb), 0.14);
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

/* ───────────────────────────────────────────────────────────────────────────
   D.5 — chat-state affordances (sidebar badges, in-flight placeholder,
   header sync/offline banners). Tokens only, no hardcoded hex.
   ─────────────────────────────────────────────────────────────────────────── */

/* Header banners (StatusBanner extensions) */
.status-banner.tone-warn {
  color: color-mix(in srgb, var(--warning) 30%, var(--text) 70%);
  background: color-mix(in srgb, var(--panel) 80%, var(--warning) 20%);
  border-color: rgba(var(--warning-rgb), 0.36);
}

.status-banner--compact {
  padding: var(--space-0-5) var(--space-1-5);
  font-size: var(--font-size-xs);
  border-radius: var(--radius-control);
}

/* Sidebar chat-state badges — icon/dot-only (no text children) */
.badge--running,
.badge--awaiting_approval,
.badge--completed_unread {
  flex: 0 0 auto;
  padding: 0;
  border-radius: 50%;
  overflow: visible;
}

.badge--running {
  width: 8px;
  height: 8px;
  min-width: 8px;
  max-width: 8px;
  /* Lock height too: the base .badge sets height/min-height: 22px, which would
     stretch this dot into an ellipse without a matching min/max-height. */
  min-height: 8px;
  max-height: 8px;
  border: 1.5px solid rgba(var(--info-rgb), 0.28);
  border-top-color: var(--info);
  background: transparent;
  animation: da-badge-spin 0.8s linear infinite;
}

.badge--awaiting_approval,
.badge--completed_unread {
  width: 12px;
  height: 12px;
  min-width: 12px;
  max-width: 12px;
  min-height: 12px;
  max-height: 12px;
}

.badge--awaiting_approval {
  border-color: rgba(var(--warning-rgb), 0.5);
  background: color-mix(in srgb, var(--panel) 60%, var(--warning) 40%);
}

.badge--completed_unread {
  border-color: rgba(var(--success-rgb), 0.5);
  background: var(--success);
  animation: da-badge-pulse 1.5s ease-in-out infinite;
}

@keyframes da-badge-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes da-badge-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* In-flight assistant placeholder bubble (rejoined task with no local message) */
.chat-message--in-flight {
  border-left: 3px solid rgba(var(--info-rgb), 0.6);
  opacity: 0.92;
}

/* D.5b — time-aware nudges (rendered below the in-flight progress) */
/* TASK-228: the nudge renders as one contained card — banner + dismiss (×) in
 * a header row, mini-summary and the tier action in a footer row — instead of
 * loosely stacked rows. */
.nudge-area {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
  /* Cap the width so the nudge reads as a contained card instead of stretching
   * full-width with the chat (and growing on larger windows). */
  max-width: 460px;
  padding: var(--space-2);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  background: var(--panel);
}

.nudge-area__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-1-5);
  min-width: 0;
}

.nudge-area__header .status-banner {
  flex: 1 1 auto;
  min-width: 0;
}

.nudge-area__dismiss {
  flex: 0 0 auto;
  margin: calc(-1 * var(--space-0-5)) calc(-1 * var(--space-1)) 0 0;
}

.nudge-area__footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1-5) var(--space-2);
  min-width: 0;
}

/* The nudge's call-to-action: anchored bottom-right of the card, level with
 * the mini-summary when one is present (T5), alone otherwise (T3). */
.nudge-area-action {
  margin-left: auto;
}

.nudge-mini-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ── Global File System (Files page) — P4-S07 ─────────────────────────────── */
/* Card headers and tabs use the shared page primitives (see
   STYLE_STANDARDIZATION.md). GFS-specific rules below only arrange the
   browser workspace, file rows, and delegation controls. */
.da-gfs-layout {
  align-content: stretch;
}

.da-gfs-workspace-card {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: var(--space-3);
}

.da-gfs-workspace-card .page-card__header .muted {
  margin: var(--space-1) 0 0;
  max-width: 64ch;
}

.da-gfs-eyebrow {
  margin: 0 0 var(--space-0-5);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.da-gfs-open-link {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  background: var(--surface-soft);
}

.da-gfs-file-picker__row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.da-gfs-file-picker__input {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.da-gfs-file-picker__input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.da-gfs-file-picker__scheme {
  flex: 0 0 auto;
  padding-left: var(--space-2);
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--font-size-sm);
}

.da-gfs-file-picker__input input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.da-gfs-current-copy {
  min-width: 0;
}

.da-gfs-current-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

.da-gfs-file-action {
  cursor: pointer;
}

.da-gfs-inline-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: var(--space-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  margin: var(--space-3) 0;
  padding: var(--space-3);
  background: var(--surface-soft);
}

.da-gfs-inline-form__field {
  display: grid;
  min-width: min(22rem, 100%);
  gap: var(--space-1);
}

.da-gfs-inline-form__field span,
.da-gfs-inline-form__copy {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.da-gfs-inline-form__field input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.da-gfs-inline-form__field input:focus-visible {
  border-color: var(--focus-ring);
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.da-gfs-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  min-height: calc(var(--space-5) + var(--space-1));
}

.da-gfs-breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.da-gfs-breadcrumb__sep {
  color: var(--text-muted);
}

.da-gfs-list__icon {
  display: grid;
  place-items: center;
  width: var(--space-5);
  height: var(--space-5);
  color: var(--text-muted);
  overflow: hidden;
}

.da-gfs-list__icon svg {
  width: 100%;
  height: 100%;
}

.da-gfs-list__identity {
  display: grid;
  gap: var(--space-0-5);
  min-width: 0;
}

.da-gfs-list__name,
.da-gfs-list__name .ui-button {
  min-width: 0;
  color: var(--text);
  font-weight: 700;
}

.da-gfs-inline-rename {
  min-width: 0;
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
}

.da-gfs-inline-rename__input.ui-control {
  min-width: 0;
  flex: 1 1 auto;
}

.da-gfs-inline-rename__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-0-5);
  flex: 0 0 auto;
}

.da-gfs-inline-rename__actions .ui-icon-button {
  flex: 0 0 auto;
}

.da-gfs-inline-rename__actions svg {
  width: calc(var(--space-3) + var(--space-0-5));
  height: calc(var(--space-3) + var(--space-0-5));
}

.da-gfs-inline-rename__confirm.ui-icon-button {
  border-color: rgba(var(--success-rgb), 0.34);
  color: var(--success);
}

.da-gfs-inline-rename__confirm.ui-icon-button:hover:enabled,
.da-gfs-inline-rename__confirm.ui-icon-button:focus-visible {
  border-color: rgba(var(--success-rgb), 0.58);
  background: rgba(var(--success-rgb), 0.24);
  color: var(--success);
}

.da-gfs-inline-rename__cancel.ui-icon-button {
  color: var(--text-muted);
}

.da-gfs-drive__inline-rename {
  width: min(20rem, 100%);
}

.da-gfs-current-file__inline-rename {
  flex: 1 1 auto;
}

.da-gfs-list__actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--space-2);
  justify-self: end;
}

.da-gfs-drive__grid .da-gfs-list__actions > .ui-icon-button {
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fast);
}

.da-gfs-drive__grid .da-grid__row:hover .da-gfs-list__actions > .ui-icon-button,
.da-gfs-drive__grid .da-grid__row:focus-within .da-gfs-list__actions > .ui-icon-button,
.da-gfs-drive__grid .da-gfs-list__actions > .ui-icon-button:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.da-gfs-list__rid {
  max-width: 8rem;
  overflow: hidden;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.da-gfs-section-title {
  font-size: var(--font-size-lg);
  margin: 0;
}

.da-gfs-delegation {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.da-gfs-delegation__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.32fr);
  gap: var(--space-2);
  align-items: stretch;
}

.da-gfs-delegation:not(.da-gfs-delegation--details) .da-gfs-delegation__composer {
  grid-template-columns: minmax(0, 1fr);
}

.da-gfs-delegation__composer > .ui-dropdown-select {
  min-width: 150px;
}

.da-gfs-subject-picker,
.da-gfs-permission-dropdown {
  position: relative;
  min-width: 0;
  display: flex;
}

.da-gfs-subject-picker__field,
.da-gfs-permission-dropdown__trigger.ui-button {
  flex: 1;
}

.da-gfs-subject-picker__field {
  min-height: 46px;
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-1);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--control-bg-strong);
  transition:
    border-color var(--motion-fast),
    box-shadow var(--motion-fast);
}

.da-gfs-subject-picker__field:focus-within,
.da-gfs-subject-picker__field.is-open {
  border-color: rgba(var(--accent-rgb), 0.72);
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.16);
}

.da-gfs-subject-picker__chip {
  min-width: 0;
  max-width: 210px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-0-5) var(--space-0-5) var(--space-0-5) var(--space-1);
  border-radius: var(--radius-md);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
}

.da-gfs-subject-picker__chip-label {
  min-width: 0;
  overflow: hidden;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.da-gfs-subject-picker__chip-remove.ui-icon-button {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: var(--space-0-5);
}

.da-gfs-subject-picker__chip-remove svg {
  width: var(--space-3);
  height: var(--space-3);
}

.da-gfs-subject-picker__input.ui-control {
  min-width: 140px;
  min-height: 34px;
  flex: 1 1 140px;
  padding: 0 var(--space-1);
  border: 0;
  background: transparent;
  box-shadow: none;
}

.da-gfs-subject-picker__input.ui-control:focus {
  border: 0;
  outline: 0;
  box-shadow: none;
}

.da-gfs-subject-picker__menu,
.da-gfs-permission-dropdown__menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  z-index: calc(var(--layer-dropdown) + 40);
  display: grid;
  gap: var(--space-0-5);
  padding: var(--space-1);
  border: 1px solid rgba(var(--edge-rgb), 0.46);
  border-radius: var(--radius-md);
  background: var(--bg-elev-2);
  box-shadow: var(--shadow-hard);
}

.da-gfs-subject-picker__menu {
  left: 0;
  width: 100%;
  max-height: min(300px, 42vh);
  overflow-y: auto;
  scrollbar-width: thin;
}

.da-gfs-subject-picker__option.ui-menu-item {
  min-height: 50px;
  padding: var(--space-1) var(--space-2);
}

.da-gfs-subject-picker__option-copy {
  min-width: 0;
  display: grid;
  gap: var(--space-0-5);
}

.da-gfs-subject-picker__option-copy > span,
.da-gfs-subject-picker__option-copy > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.da-gfs-subject-picker__option-copy > span {
  color: var(--text);
  font-size: var(--font-size-md);
}

.da-gfs-subject-picker__option-copy > small {
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
}

.da-gfs-subject-picker__avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent-strong);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
}

.da-gfs-subject-picker__avatar--team {
  background: rgba(var(--warning-rgb), 0.15);
  color: var(--warning);
}

.da-gfs-subject-picker__avatar--host {
  background: rgba(var(--success-rgb), 0.16);
  color: var(--success);
}

.da-gfs-subject-picker__avatar svg {
  width: var(--space-4);
  height: var(--space-4);
}

.da-gfs-subject-picker__type {
  color: var(--text-dim);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-caps);
  text-transform: uppercase;
}

.da-gfs-subject-picker__empty {
  padding: var(--space-3);
  color: var(--text-dim);
  font-size: var(--font-size-sm);
  text-align: center;
}

.da-gfs-permission-dropdown__trigger.ui-button {
  min-height: 46px;
  padding-inline: var(--space-2-5);
  border-color: var(--control-border);
  border-radius: var(--radius-md);
  background: var(--control-bg-strong);
  font-weight: var(--font-weight-regular);
}

.da-gfs-permission-dropdown__menu {
  right: 0;
  min-width: 190px;
}

.da-gfs-permission-dropdown__option.ui-menu-item {
  min-height: 38px;
}

.da-gfs-permission-dropdown__check {
  width: var(--space-4);
  height: var(--space-4);
  display: grid;
  place-items: center;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  color: var(--accent-strong);
  font-size: var(--font-size-xs);
}

.da-gfs-permission-dropdown__option.active .da-gfs-permission-dropdown__check {
  border-color: rgba(var(--accent-rgb), 0.52);
  background: rgba(var(--accent-rgb), 0.16);
}

.da-gfs-delegation__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-left: auto;
}

.da-gfs-delegation__scope-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.da-gfs-footer-actions {
  display: flex;
  justify-content: center;
}

.da-gfs-delegation__empty {
  display: grid;
  gap: var(--space-0-5);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  background: var(--surface-soft);
  color: var(--text-muted);
}

.da-gfs-delegation__empty strong {
  color: var(--text);
}

.da-gfs-drive {
  position: relative;
  min-width: 0;
  min-height: min(680px, calc(100vh - 180px));
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.da-gfs-drive__header.page-card__header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 0;
}

.da-gfs-drive__title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-0-5);
}

.da-gfs-drive__breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-0-5);
  overflow-x: auto;
  scrollbar-width: thin;
}

.da-gfs-drive__crumb-group {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-0-5);
}

.da-gfs-drive__crumb-group > svg {
  width: var(--space-3);
  height: var(--space-3);
  flex: 0 0 auto;
  color: var(--text-dim);
}

.da-gfs-drive__breadcrumb.ui-button {
  min-width: 0;
  max-width: 240px;
  overflow: hidden;
  padding-inline: var(--space-1);
  color: var(--text);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.da-gfs-drive__breadcrumb.ui-button[aria-current='page'] {
  color: var(--text);
  opacity: 1;
  background: rgba(var(--accent-rgb), 0.1);
  cursor: default;
}

/* Breadcrumb drop-move verdict tints (drop-move parity, refusal UX matrix):
   identical treatment to Control UI's cu-gfs-breadcrumb verdicts — the
   target gets a crisp 2px accent ring, checking dashes neutrally, ordinary
   denials read as error, the unknown family warns, and the same-parent
   no-op stays neutral. The active (disabled) crumb is never a target, so
   these only ever render on ancestor crumbs. */
.da-gfs-drive__breadcrumb.ui-button[data-drop-state='checking'] {
  outline: 2px dashed rgba(var(--accent-rgb), 0.4);
  outline-offset: -2px;
  background: rgba(var(--edge-rgb), 0.08);
}

.da-gfs-drive__breadcrumb.ui-button[data-drop-state='allowed'],
.da-gfs-drive__breadcrumb.ui-button.da-gfs-drive__breadcrumb--allowed {
  outline: 2px solid rgba(var(--accent-rgb), 0.72);
  outline-offset: -2px;
  background: rgba(var(--accent-rgb), 0.14);
}

.da-gfs-drive__breadcrumb.ui-button[data-drop-state='denied'] {
  outline: 2px solid rgba(var(--danger-rgb), 0.6);
  outline-offset: -2px;
  background: rgba(var(--danger-rgb), 0.12);
}

.da-gfs-drive__breadcrumb.ui-button[data-drop-state='denied'][data-drop-reason='same-parent'] {
  outline: 2px solid rgba(var(--accent-rgb), 0.35);
  outline-offset: -2px;
  background: rgba(var(--edge-rgb), 0.08);
}

.da-gfs-drive__breadcrumb.ui-button[data-drop-state='denied'][data-drop-reason='unavailable'],
.da-gfs-drive__breadcrumb.ui-button[data-drop-state='denied'][data-drop-reason='target-unavailable'],
.da-gfs-drive__breadcrumb.ui-button[data-drop-state='denied'][data-drop-reason='source-location-unknown'],
.da-gfs-drive__breadcrumb.ui-button[data-drop-state='unavailable'] {
  outline: 2px solid rgba(var(--warning-rgb), 0.6);
  outline-offset: -2px;
  background: rgba(var(--warning-rgb), 0.12);
}

.da-gfs-drive__header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-1);
  flex: 0 0 auto;
}

.da-gfs-upload-status {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) var(--space-4) 0;
  padding: var(--space-3);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: var(--radius-md);
  background: rgba(var(--accent-rgb), 0.06);
}

.da-gfs-upload-status__head,
.da-gfs-upload-status__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.da-gfs-upload-status__head {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.da-gfs-upload-status__head strong {
  color: var(--text);
}

.da-gfs-upload-status progress {
  width: 100%;
  height: 0.5rem;
  accent-color: var(--accent-strong);
}

.da-gfs-upload-status__actions {
  justify-content: flex-end;
}

.da-gfs-drive > .status-banner,
.da-gfs-drive > .empty-state {
  margin: var(--space-3) var(--space-4);
}

.da-gfs-loading {
  min-height: 11rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* BUG-175 — folder-zip assembly progress strip. */
.da-gfs-zip-progress {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: var(--radius-control);
  background: rgba(var(--panel-rgb), 0.72);
  color: var(--text);
  padding: var(--space-1-5) var(--space-2);
  font-size: var(--font-size-sm);
  line-height: 1.35;
}

.da-gfs-zip-progress__label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.da-gfs-zip-progress__stop {
  appearance: none;
  flex: 0 0 auto;
  align-self: center;
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: var(--font-size-xs);
  line-height: 1;
  padding: var(--space-1) var(--space-1-5);
  cursor: pointer;
  white-space: nowrap;
}

.da-gfs-zip-progress__stop:hover {
  border-color: rgba(var(--danger-rgb), 0.5);
  color: var(--danger);
}

.da-gfs-zip-progress__stop:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.56);
  outline-offset: 1px;
}

.da-gfs-zip-progress__label::before {
  content: '';
  flex: 0 0 auto;
  width: var(--space-1);
  height: var(--space-1);
  border-radius: 999px;
  background: var(--accent);
  margin-right: var(--space-1-5);
  display: inline-block;
  animation: da-gfs-loading-dot 1.2s ease-in-out infinite;
}

.da-gfs-loading__dots {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.da-gfs-loading__dot {
  width: var(--space-1);
  height: var(--space-1);
  border-radius: 999px;
  background: var(--accent);
  animation: da-gfs-loading-dot 1.2s ease-in-out infinite;
}

.da-gfs-loading__dot:nth-child(2) {
  animation-delay: 0.16s;
}

.da-gfs-loading__dot:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes da-gfs-loading-dot {
  0%,
  70%,
  100% {
    opacity: 0.24;
  }

  35% {
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .da-gfs-loading__dot {
    animation: none;
    opacity: 0.62;
  }
}

.da-gfs-drive__grid {
  container-type: inline-size;
  min-height: 0;
  flex: 1 1 auto;
  width: auto;
  align-content: start;
  gap: 0;
  margin: var(--space-2) 0 var(--space-3);
  overflow: visible;
}

.da-gfs-drive__grid .da-grid__head {
  padding-inline: calc(var(--table-cell-padding-x) + var(--grid-row-gap));
  border-radius: 0;
  border-bottom: 1px solid var(--grid-card-border);
  background: var(--table-header-bg);
}

.da-gfs-drive__grid .da-grid__row {
  width: 100%;
  font-size: var(--font-size-md);
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--grid-card-border);
  background: transparent;
  transition: background-color var(--motion-fast);
}

.da-gfs-drive__grid .da-grid__row:last-child {
  border-bottom: 0;
}

.da-gfs-drive__grid .da-grid__row[data-dragging='true'] {
  opacity: 0.55;
}

.da-gfs-drive__grid .da-grid__row[data-drop-target='true'] {
  outline: 2px solid rgba(var(--accent-rgb), 0.72);
  outline-offset: -2px;
  background: rgba(var(--accent-rgb), 0.14);
}

.da-gfs-drive__grid .da-grid__row[data-drop-target='true']:hover {
  background: rgba(var(--accent-rgb), 0.18);
}

.da-gfs-drive__grid .da-grid__row[draggable='true'] {
  cursor: grab;
}

.da-gfs-drive__grid .da-grid__row[draggable='true']:active {
  cursor: grabbing;
}

.da-gfs-drive__grid .da-grid__row--clickable:hover:enabled {
  background: var(--grid-card-bg-hover);
  border-color: var(--grid-card-border);
}

/* ── Files-grid drop-verdict tints (refusal UX matrix §5) ──────────────────
   Grid- AND clickable-scoped so every tone out-ranks BOTH the base row
   background above (`background: transparent`) and the clickable-hover
   background: the verdict must stay readable on the hovered row too. Only
   `allowed` stays blue — through the data-drop-target highlight above,
   unchanged. Tone keys on the reason: deny=error, same-parent=info (the
   no-op), unknown/unavailable=warning. */
.da-gfs-drive__grid .da-grid__row--clickable.da-grid__row--compact[data-drop-state='checking'] {
  background: rgba(var(--edge-rgb), 0.08);
}

.da-gfs-drive__grid .da-grid__row--clickable.da-grid__row--compact[data-drop-state='denied'] {
  background: rgba(var(--danger-rgb), 0.1);
  box-shadow: inset 2px 0 0 rgba(var(--danger-rgb), 0.72);
}

.da-gfs-drive__grid
  .da-grid__row--clickable.da-grid__row--compact[data-drop-state='denied'][data-drop-reason='same-parent'] {
  background: rgba(var(--edge-rgb), 0.12);
  box-shadow: inset 2px 0 0 rgba(var(--edge-rgb), 0.6);
}

.da-gfs-drive__grid
  .da-grid__row--clickable.da-grid__row--compact[data-drop-state='denied'][data-drop-reason='unavailable'],
.da-gfs-drive__grid
  .da-grid__row--clickable.da-grid__row--compact[data-drop-state='denied'][data-drop-reason='target-unavailable'],
.da-gfs-drive__grid
  .da-grid__row--clickable.da-grid__row--compact[data-drop-state='denied'][data-drop-reason='source-location-unknown'],
.da-gfs-drive__grid .da-grid__row--clickable.da-grid__row--compact[data-drop-state='unavailable'] {
  background: rgba(var(--warning-rgb), 0.1);
  box-shadow: inset 2px 0 0 rgba(var(--warning-rgb), 0.72);
}

.da-gfs-current-file {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-5);
  text-align: left;
}

.da-gfs-current-file__icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: var(--radius-md);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-strong);
}

.da-gfs-current-file__icon svg {
  width: var(--space-5);
  height: var(--space-5);
}

.da-gfs-current-file__copy {
  min-width: 0;
  max-width: 560px;
  display: grid;
  gap: var(--space-1);
}

.da-gfs-current-file__title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.da-gfs-current-file__title-row h3,
.da-gfs-current-file__copy p {
  margin: 0;
}

.da-gfs-current-file__title-row h3 {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.da-gfs-current-file__copy p {
  font-size: var(--font-size-sm);
}

.da-gfs-drive__size {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.da-gfs-resource-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.da-gfs-resource-menu.is-open {
  z-index: calc(var(--layer-dropdown) + 20);
}

.da-gfs-resource-menu__trigger.ui-icon-button {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  color: var(--text-muted);
}

.da-gfs-resource-menu__trigger.ui-icon-button:hover:enabled,
.da-gfs-resource-menu__trigger.ui-icon-button:focus-visible {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
}

.da-gfs-resource-menu__trigger svg {
  width: var(--space-4);
  height: var(--space-4);
}

.da-gfs-resource-menu__panel {
  position: fixed;
  /* The persistent sidebar owns dropdown + 1000. Resource menus are portaled
     to body and must remain above it while the navigation expands/collapses. */
  z-index: calc(var(--layer-dropdown) + 1100);
  width: min(360px, calc(100vw - (var(--space-4) * 2)));
  max-height: calc(100vh - (var(--space-4) * 2));
  display: grid;
  gap: 0;
  overflow-y: auto;
  padding: var(--space-1-5);
  border: 1px solid rgba(var(--edge-rgb), 0.46);
  border-radius: var(--radius-md);
  background: var(--bg-elev-2);
  box-shadow: var(--shadow-hard);
  scrollbar-width: thin;
}

.da-gfs-resource-menu__submenu {
  position: fixed;
  z-index: calc(var(--layer-dropdown) + 1101);
  width: min(240px, calc(100vw - (var(--space-4) * 2)));
  max-height: calc(100vh - (var(--space-4) * 2));
  display: grid;
  gap: 0;
  overflow-y: auto;
  padding: var(--space-1-5);
  border: 1px solid rgba(var(--edge-rgb), 0.46);
  border-radius: var(--radius-md);
  background: var(--bg-elev-2);
  box-shadow: var(--shadow-hard);
  scrollbar-width: thin;
}

.da-gfs-resource-menu__panel .ui-menu-item,
.da-gfs-resource-menu__submenu .ui-menu-item {
  min-height: 44px;
  padding: 0 var(--space-2-5);
  gap: var(--space-2);
  border-radius: calc(var(--radius-sm) - 2px);
  color: var(--text);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
}

.da-gfs-resource-menu__panel .ui-menu-item:hover:enabled,
.da-gfs-resource-menu__panel .ui-menu-item:focus-visible,
.da-gfs-resource-menu__submenu .ui-menu-item:hover:enabled,
.da-gfs-resource-menu__submenu .ui-menu-item:focus-visible {
  border-color: transparent;
  background: var(--surface-hover);
  color: var(--text);
}

.da-gfs-resource-menu__panel .ui-menu-item__icon,
.da-gfs-resource-menu__submenu .ui-menu-item__icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: var(--text-dim);
}

.da-gfs-resource-menu__panel .ui-menu-item__icon svg,
.da-gfs-resource-menu__submenu .ui-menu-item__icon svg {
  width: 18px;
  height: 18px;
}

.da-gfs-resource-menu__panel .ui-menu-item__trailing {
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: var(--text-dim);
}

.da-gfs-resource-menu__panel .ui-menu-item__trailing svg {
  width: 18px;
  height: 18px;
}

.da-gfs-resource-menu__panel .ui-menu-item--danger,
.da-gfs-resource-menu__submenu .ui-menu-item--danger {
  color: var(--danger);
}

.da-gfs-resource-menu__panel .ui-menu-item--danger:hover:enabled,
.da-gfs-resource-menu__panel .ui-menu-item--danger:focus-visible,
.da-gfs-resource-menu__submenu .ui-menu-item--danger:hover:enabled,
.da-gfs-resource-menu__submenu .ui-menu-item--danger:focus-visible {
  background: rgba(var(--danger-rgb), 0.12);
  color: var(--danger);
}

.da-gfs-resource-menu__separator {
  height: 1px;
  margin: var(--space-1) 0;
  background: rgba(var(--edge-rgb), 0.32);
}

.da-gfs-link-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--layer-chat-overlay) + 2);
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgba(var(--overlay-rgb), 0.18);
  backdrop-filter: blur(10px);
}

.da-gfs-link-dialog {
  width: min(520px, 94vw);
  overflow: hidden;
  border: 1px solid rgba(var(--edge-rgb), 0.4);
  border-radius: var(--radius-xl);
  background: var(--bg-elev);
  box-shadow:
    var(--shadow-hard),
    inset 0 1px 0 rgba(var(--edge-rgb), 0.16);
}

.da-gfs-link-dialog__header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.2);
  background: rgba(var(--panel-rgb), 0.48);
}

.da-gfs-link-dialog__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: var(--radius-md);
  background: rgba(var(--accent-rgb), 0.11);
  color: var(--accent-strong);
}

.da-gfs-link-dialog__icon svg {
  width: var(--space-4);
  height: var(--space-4);
}

.da-gfs-link-dialog__heading {
  min-width: 0;
  display: grid;
  gap: var(--space-0-5);
}

.da-gfs-link-dialog__heading .da-gfs-eyebrow,
.da-gfs-link-dialog__heading h3,
.da-gfs-link-dialog__heading .muted {
  margin: 0;
}

.da-gfs-link-dialog__heading .da-gfs-eyebrow {
  color: var(--accent-strong);
  font-size: var(--font-size-2xs);
  letter-spacing: var(--letter-spacing-caps);
}

.da-gfs-link-dialog__heading h3 {
  color: var(--text);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.da-gfs-link-dialog__heading .muted {
  font-size: var(--font-size-sm);
}

.da-gfs-link-dialog__body {
  padding: var(--space-4);
}

.da-gfs-link-dialog .da-gfs-file-picker {
  display: grid;
  gap: var(--space-3);
}

.da-gfs-image-preview-modal,
.da-gfs-markdown-preview-modal,
.da-gfs-video-preview-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--layer-chat-overlay) + 3);
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgba(var(--overlay-rgb), 0.18);
  backdrop-filter: blur(12px);
}

.da-gfs-image-preview-dialog,
.da-gfs-markdown-preview-dialog,
.da-gfs-video-preview-dialog {
  width: min(960px, 100%);
  height: min(760px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(var(--edge-rgb), 0.38);
  border-radius: var(--radius-xl);
  background: var(--bg-elev);
  box-shadow: var(--shadow-hard);
}

.da-gfs-image-preview-dialog__header,
.da-gfs-markdown-preview-dialog__header,
.da-gfs-video-preview-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.24);
  background: rgba(var(--panel-rgb), 0.48);
}

.da-gfs-image-preview-dialog__header-actions,
.da-gfs-markdown-preview-dialog__header-actions,
.da-gfs-video-preview-dialog__header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.da-gfs-image-preview-dialog__header-main {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.da-gfs-image-preview-dialog__header-main .da-gfs-preview-title {
  flex: 0 1 auto;
}

.da-gfs-image-preview-dialog__header-main .da-gfs-image-preview-dialog__copy {
  flex: 0 0 auto;
}

.da-gfs-image-preview-dialog__close.ui-button,
.da-gfs-markdown-preview-dialog__close.ui-button,
.da-gfs-video-preview-dialog__close.ui-button {
  width: 2.25rem;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 999px;
}

.da-gfs-image-preview-dialog__copy.ui-button,
.da-gfs-markdown-preview-dialog__copy.ui-button {
  height: 2.25rem;
  padding-inline: var(--space-3);
  border-radius: 999px;
  color: var(--text-muted);
}

.da-gfs-image-preview-dialog__copy.ui-button:hover:enabled,
.da-gfs-markdown-preview-dialog__copy.ui-button:hover:enabled {
  color: color-mix(in srgb, var(--accent-strong) 62%, var(--text-muted) 38%);
}

.da-gfs-preview-button__label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.da-gfs-text-preview__content {
  min-width: 0;
  min-height: 0;
  padding: var(--space-5);
}

.da-gfs-text-preview__body {
  max-width: 60rem;
  margin: 0;
  padding: var(--space-4);
  border: 1px solid rgba(var(--edge-rgb), 0.24);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.da-gfs-image-preview-dialog__header h3,
.da-gfs-markdown-preview-dialog__header h3,
.da-gfs-video-preview-dialog__header h3,
.da-gfs-preview-title {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* File preview in a workspace tab (spec 18 §3.B.3). Reuses the shared
 * Gfs*PreviewBody inner classes; this container gives the header + body the same
 * two-row layout the dialog frame provided, without any modal chrome. */
.da-gfs-preview-page {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--table-frame-border);
  border-radius: var(--table-radius);
  background: var(--table-frame-bg);
}

.da-gfs-image-preview-dialog__body,
.da-gfs-video-preview-dialog__body {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: var(--space-4);
  background: rgba(var(--overlay-rgb), 0.32);
}

.da-gfs-image-preview-dialog__loading {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.da-gfs-image-preview-dialog__image {
  max-width: 100%;
  max-height: 100%;
  display: block;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.da-gfs-video-preview-dialog__loading {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.da-gfs-video-preview-dialog__video {
  width: 100%;
  max-width: min(920px, calc(96vw - var(--space-5) * 2));
  max-height: 100%;
  display: block;
  border-radius: var(--radius-sm);
  background: var(--media-surface);
}

.da-gfs-markdown-preview-dialog__body {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: var(--space-5);
  background: var(--panel);
}

.da-gfs-markdown-preview-dialog__loading {
  min-height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.da-gfs-markdown-preview__content {
  width: min(100%, 52rem);
  margin: 0 auto;
  color: var(--text);
  font-family: var(--font-family-base);
  overflow-wrap: anywhere;
}

.da-gfs-markdown-preview__content img {
  max-width: 100%;
  height: auto;
}

.da-gfs-markdown-preview__content .gfs-markdown-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 var(--space-3);
  overscroll-behavior-x: contain;
}

.da-gfs-markdown-preview__content .gfs-markdown-table-scroll:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.85);
  outline-offset: 2px;
}

.da-gfs-markdown-preview__content .gfs-markdown-table-scroll table {
  width: max-content;
  min-width: 100%;
  margin: 0;
}

.da-gfs-markdown-preview__content .gfs-markdown-table-scroll th,
.da-gfs-markdown-preview__content .gfs-markdown-table-scroll td {
  max-width: 24rem;
  overflow-wrap: anywhere;
}

.da-gfs-markdown-preview__content h1,
.da-gfs-markdown-preview__content h2,
.da-gfs-markdown-preview__content h3,
.da-gfs-markdown-preview__content h4,
.da-gfs-markdown-preview__content h5,
.da-gfs-markdown-preview__content h6 {
  margin: var(--space-5) 0 var(--space-2);
  color: var(--text);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.da-gfs-markdown-preview__content h1 {
  font-size: var(--font-size-3xl);
}

.da-gfs-markdown-preview__content h2 {
  font-size: var(--font-size-2xl);
}

.da-gfs-markdown-preview__content h3 {
  font-size: var(--font-size-xl);
}

.da-gfs-markdown-preview__content h4,
.da-gfs-markdown-preview__content h5,
.da-gfs-markdown-preview__content h6 {
  font-size: var(--font-size-lg);
}

.da-gfs-markdown-preview__content hr {
  margin: var(--space-4) 0;
  border: 0;
  border-top: 1px solid var(--border-soft);
}

.da-gfs-markdown-preview__empty {
  color: var(--text-muted);
}

.da-gfs-manage-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--layer-chat-overlay) + 2);
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: var(--space-4);
  background: rgba(var(--overlay-rgb), 0.18);
  backdrop-filter: blur(12px) saturate(0.86);
}

.da-gfs-manage-dialog {
  /* Keep every Share-dialog accent in the blue family while preserving the
     global semantic palette used by the rest of Desktop. */
  --success: var(--accent);
  --success-rgb: var(--accent-rgb);
  --warning: var(--accent-strong);
  --warning-rgb: var(--accent-rgb);
  --danger: var(--accent-strong);
  --danger-rgb: var(--accent-rgb);
  width: min(720px, 96vw);
  max-height: min(760px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: visible;
  border: 1px solid rgba(var(--edge-rgb), 0.38);
  border-radius: var(--radius-xl);
  background: var(--bg-elev);
  box-shadow: var(--shadow-hard);
}

.da-gfs-manage-dialog__header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 0;
}

.da-gfs-manage-dialog__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
}

.da-gfs-manage-dialog__icon--folder {
  color: var(--text-muted);
}

.da-gfs-manage-dialog__icon svg {
  width: var(--font-size-2xl);
  height: var(--font-size-2xl);
}

.da-gfs-manage-dialog__heading {
  min-width: 0;
  display: grid;
  gap: var(--space-1);
}

.da-gfs-manage-dialog__heading h3 {
  margin: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  text-overflow: ellipsis;
  white-space: normal;
}

.da-gfs-manage-dialog__title-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-1);
}

.da-gfs-manage-dialog__title-edit .ui-control {
  min-width: 0;
}

.da-gfs-manage-dialog__top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.da-gfs-manage-dialog__heading .da-gfs-eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: var(--font-size-2xs);
  letter-spacing: var(--letter-spacing-caps);
}

.da-gfs-manage-dialog__body {
  min-height: 0;
  display: grid;
  align-items: start;
  align-content: start;
  gap: var(--space-3);
  overflow: visible;
  padding: 0 var(--space-5) var(--space-5);
}

/* GfsMoveConfirmDialog — the compact folder-move confirmation (rev-2 §1).
   Scoped restyling of the share-dialog shell to match the Control UI
   treatment: ~30rem panel, plain h3 header without icon chrome, muted
   impact copy, tight right-aligned actions. */
.da-gfs-move-confirm-dialog.da-gfs-manage-dialog {
  width: min(30rem, 96vw);
  max-height: none;
  grid-template-rows: auto auto auto;
}

.da-gfs-move-confirm-dialog .da-gfs-manage-dialog__header {
  grid-template-columns: minmax(0, 1fr);
  padding: var(--space-5) var(--space-5) var(--space-2);
}

.da-gfs-move-confirm-dialog .da-gfs-manage-dialog__heading h3 {
  font-size: var(--font-size-lg);
}

.da-gfs-move-confirm-dialog .da-gfs-manage-dialog__body {
  padding: 0 var(--space-5);
}

.da-gfs-move-confirm-dialog__impact {
  margin: 0;
  color: var(--text-muted);
}

.da-gfs-move-confirm-dialog__rename-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  cursor: pointer;
}

.da-gfs-move-confirm-dialog__rename-toggle input[type='checkbox'] {
  width: var(--space-3);
  min-width: var(--space-3);
  height: var(--space-3);
  min-height: var(--space-3);
  flex: 0 0 var(--space-3);
  margin: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  accent-color: var(--accent);
}

.da-gfs-move-confirm-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-5) var(--space-5);
}

.da-gfs-manage-section {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  padding: 0;
}

.da-gfs-manage-section--access {
  min-height: 0;
}

.da-gfs-manage-section__header h4,
.da-gfs-manage-section__header p {
  margin: 0;
}

.da-gfs-manage-section__header h4 {
  color: var(--text);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.da-gfs-manage-section__header p {
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
}

.da-gfs-manage-resource-link {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2-5);
  border: 1px solid rgba(var(--edge-rgb), 0.24);
  border-radius: var(--radius-md);
  background: rgba(var(--overlay-rgb), 0.12);
}

.da-gfs-manage-resource-link__copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: var(--space-0-5);
}

.da-gfs-manage-resource-link__copy > span {
  color: var(--text-dim);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-caps);
  text-transform: uppercase;
}

.da-gfs-manage-resource-link__copy code {
  overflow: hidden;
  color: var(--text-muted);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.da-gfs-current-actions--manage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.da-gfs-manage-action.ui-button {
  min-width: 0;
  min-height: 66px;
  justify-content: flex-start;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid rgba(var(--edge-rgb), 0.24);
  border-radius: var(--radius-md);
  background: rgba(var(--edge-rgb), 0.06);
  color: var(--text);
  white-space: normal;
}

.da-gfs-manage-action.ui-button:hover:enabled,
.da-gfs-manage-action.da-gfs-file-action:hover,
.da-gfs-manage-action.da-gfs-file-action:focus-within {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.1);
  box-shadow: inset 3px 0 0 rgba(var(--accent-rgb), 0.58);
}

.da-gfs-manage-action.ui-button:focus-visible,
.da-gfs-manage-action.da-gfs-file-action:focus-within {
  outline: 2px solid rgba(var(--focus-rgb), 0.66);
  outline-offset: 2px;
}

.da-gfs-manage-action__icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: var(--radius-sm);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-strong);
}

.da-gfs-manage-action__icon svg {
  width: var(--space-4);
  height: var(--space-4);
}

.da-gfs-manage-action__copy {
  min-width: 0;
  display: grid;
  gap: var(--space-0-5);
  text-align: left;
}

.da-gfs-manage-action__copy strong {
  color: var(--text);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
}

.da-gfs-manage-action__copy small {
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
}

.da-gfs-manage-action--danger.ui-button {
  color: var(--danger);
}

.da-gfs-manage-action--danger .da-gfs-manage-action__icon {
  border-color: rgba(var(--danger-rgb), 0.24);
  background: rgba(var(--danger-rgb), 0.09);
  color: var(--danger);
}

.da-gfs-manage-action--danger.ui-button:hover:enabled {
  border-color: rgba(var(--danger-rgb), 0.4);
  background: rgba(var(--danger-rgb), 0.09);
  box-shadow: inset 3px 0 0 rgba(var(--danger-rgb), 0.6);
}

.da-gfs-manage-section--actions .da-gfs-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  margin: 0;
  border-color: rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--accent-rgb), 0.07);
}

.da-gfs-manage-dialog__body > .da-gfs-inline-form {
  margin: 0;
  border: 0;
  background: var(--surface-soft);
}

.da-gfs-new-folder-modal {
  z-index: calc(var(--layer-chat-overlay) + 3);
}

.da-gfs-new-folder-dialog {
  width: min(420px, 94vw);
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid rgba(var(--edge-rgb), 0.42);
  border-radius: var(--radius-xl);
  background: var(--bg-elev);
  box-shadow: var(--shadow-hard);
}

.da-gfs-new-folder-dialog__header h3,
.da-gfs-new-folder-dialog__copy {
  margin: 0;
}

.da-gfs-new-folder-dialog__header h3 {
  color: var(--text);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.da-gfs-new-folder-dialog__copy {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.da-gfs-new-folder-dialog__form,
.da-gfs-new-folder-dialog__field {
  min-width: 0;
  display: grid;
  gap: var(--space-2);
}

.da-gfs-new-folder-dialog__field > span {
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.da-gfs-new-folder-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* Compact Drive-style move picker. The hierarchy stays inline, but rows read
   as a folder list rather than large cards. */
.da-gfs-move-dialog {
  width: min(680px, 94vw);
  max-height: min(620px, 90vh);
  overflow: hidden;
}

.da-gfs-move-dialog .da-gfs-manage-dialog__header {
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5) var(--space-3);
  border-bottom: 0;
}

.da-gfs-move-dialog .da-gfs-manage-dialog__icon {
  width: 28px;
  height: 28px;
}

.da-gfs-move-dialog .da-gfs-manage-dialog__heading h3 {
  font-size: var(--font-size-xl);
}

.da-gfs-move-dialog .da-gfs-manage-dialog__body {
  grid-template-rows: auto auto minmax(180px, 1fr) auto auto;
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.da-gfs-move-dialog__current-location {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-5) var(--space-3);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.da-gfs-move-dialog__location-pill {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--control-bg-strong);
  color: var(--text);
}

.da-gfs-move-dialog__location-pill svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--text-muted);
}

.da-gfs-move-dialog__location-pill strong {
  min-width: 0;
  overflow: hidden;
  font-weight: var(--font-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.da-gfs-move-dialog__tree-heading {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 var(--space-5);
  border-top: 1px solid rgba(var(--edge-rgb), 0.2);
  border-bottom: 1px solid rgba(var(--edge-rgb), 0.2);
}

.da-gfs-move-dialog__tree-heading-copy {
  min-width: 0;
  display: grid;
  gap: var(--space-0-5);
}

.da-gfs-move-dialog__tree-heading-copy strong {
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.da-gfs-move-dialog__tree {
  min-height: 180px;
  max-height: min(360px, 48vh);
  overflow-y: auto;
  padding: var(--space-1) var(--space-3);
  background: var(--bg-elev);
  scrollbar-width: thin;
}

.da-gfs-move-dialog__tree-root,
.da-gfs-move-dialog__tree-group {
  display: grid;
  align-content: start;
  gap: 0;
}

.da-gfs-move-dialog__tree-group {
  margin-left: 28px;
  padding-left: var(--space-1);
  border-left: 1px solid rgba(var(--edge-rgb), 0.24);
}

.da-gfs-move-dialog__tree-item {
  min-width: 0;
}

.da-gfs-move-dialog__tree-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-1);
}

.da-gfs-move-dialog__tree-toggle.ui-icon-button {
  width: 28px;
  min-width: 28px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--text-dim);
}

.da-gfs-move-dialog__tree-toggle.ui-icon-button:hover:enabled,
.da-gfs-move-dialog__tree-toggle.ui-icon-button:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-strong);
}

.da-gfs-move-dialog__tree-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform var(--motion-fast);
}

.da-gfs-move-dialog__tree-toggle.is-expanded svg {
  transform: rotate(90deg);
}

.da-gfs-move-dialog__tree-toggle-placeholder {
  width: 28px;
  height: 34px;
}

.da-gfs-move-dialog__tree-select.ui-button {
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-0-5) var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
  transition:
    background var(--motion-fast),
    border-color var(--motion-fast),
    box-shadow var(--motion-fast);
}

.da-gfs-move-dialog__tree-select.ui-button:hover:enabled,
.da-gfs-move-dialog__tree-select.ui-button:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.1);
  box-shadow: none;
}

.da-gfs-move-dialog__tree-select.ui-button[aria-selected='true'] {
  border-color: rgba(var(--accent-rgb), 0.52);
  background: rgba(var(--accent-rgb), 0.14);
  box-shadow: none;
}

.da-gfs-move-dialog__tree-folder-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--warning);
}

.da-gfs-move-dialog__tree-folder-icon svg {
  width: 18px;
  height: 18px;
}

.da-gfs-move-dialog__tree-folder-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.da-gfs-move-dialog__tree-selected-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
}

.da-gfs-move-dialog__tree-selected-icon svg {
  width: 16px;
  height: 16px;
}

.da-gfs-move-dialog__tree-group > .muted,
.da-gfs-move-dialog__tree > .muted {
  margin: var(--space-2);
  font-size: var(--font-size-sm);
}

.da-gfs-move-dialog__tree-more {
  display: flex;
  justify-content: flex-start;
  padding: var(--space-1) 0 0;
}

.da-gfs-move-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid rgba(var(--edge-rgb), 0.2);
}

.da-gfs-move-dialog__selection {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.da-gfs-move-dialog__selection strong {
  color: var(--text);
  font-weight: var(--font-weight-semibold);
}

.da-gfs-move-dialog__action-buttons {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.da-gfs-move-dialog__action-buttons .ui-button {
  border-radius: 999px;
}

.da-gfs-manage-section--actions .da-gfs-inline-form__field {
  min-width: 0;
}

.da-gfs-manage-section--actions .da-gfs-inline-form__copy {
  align-self: center;
}

.da-gfs-manage-section--access .da-gfs-delegation__empty {
  border-color: rgba(var(--accent-rgb), 0.22);
  border-radius: var(--radius-md);
  padding: var(--space-2-5);
  background: rgba(var(--accent-rgb), 0.07);
}

.da-gfs-delegation__hint {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.da-gfs-delegation__inherit {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: box-shadow var(--motion-fast);
}

.da-gfs-delegation__inherit:has(input:focus-visible) {
  box-shadow: 0 0 0 2px rgba(var(--focus-rgb), 0.24);
}

.da-gfs-delegation__inherit input[type='checkbox'] {
  width: var(--space-3);
  min-width: var(--space-3);
  height: var(--space-3);
  min-height: var(--space-3);
  flex: 0 0 var(--space-3);
  margin: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  accent-color: var(--accent);
}

.da-gfs-delegation__inherit input[type='checkbox']:focus,
.da-gfs-delegation__inherit input[type='checkbox']:focus-visible {
  box-shadow: none;
  outline: none;
}

.da-gfs-grant-list {
  display: grid;
  gap: var(--space-2);
  max-height: calc(((var(--space-5) + var(--space-4) + var(--space-2)) * 3) + (var(--space-1) * 2));
  margin: 0;
  overflow-y: auto;
  padding: 0;
  list-style: none;
  scrollbar-width: thin;
}

.da-gfs-grant-list__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  min-height: 52px;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
}

.da-gfs-grant-list__avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent-strong);
}

.da-gfs-grant-list__avatar--team {
  background: rgba(var(--warning-rgb), 0.15);
  color: var(--warning);
}

.da-gfs-grant-list__avatar--agent,
.da-gfs-grant-list__avatar--workflow {
  background: rgba(var(--success-rgb), 0.16);
  color: var(--success);
}

.da-gfs-grant-list__avatar svg {
  width: var(--space-4);
  height: var(--space-4);
}

.da-gfs-grant-list__identity {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
}

.da-gfs-grant-list__label {
  color: var(--text);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.da-gfs-grant-list__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.da-gfs-grant-list__role {
  width: 112px;
  flex: 0 0 112px;
}

.da-gfs-grant-list__role .ui-dropdown-select__trigger.ui-button {
  min-height: 32px;
  padding-inline: var(--space-2);
  border-color: transparent;
  background: transparent;
  color: var(--text);
  font-weight: var(--font-weight-medium);
}

.da-gfs-grant-list__role .ui-dropdown-select__trigger.ui-button:hover:enabled,
.da-gfs-grant-list__role .ui-dropdown-select__trigger.ui-button[aria-expanded='true'] {
  border-color: var(--control-border);
  background: var(--control-bg-strong);
}

.da-gfs-grant-list__role-label {
  min-width: 112px;
  padding-inline: var(--space-2);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

/* Parent-folder confirmation for inherited access rows (Share dialog). */
.da-gfs-parent-update-dialog {
  width: min(460px, 94vw);
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid rgba(var(--edge-rgb), 0.42);
  border-radius: var(--radius-xl);
  background: var(--bg-elev);
  box-shadow: var(--shadow-hard);
}

.da-gfs-parent-update-dialog__header h3 {
  margin: 0;
  color: var(--text);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.da-gfs-parent-update-dialog__body {
  min-width: 0;
  display: grid;
  gap: var(--space-3);
}

.da-gfs-parent-update-dialog__lead {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.da-gfs-parent-update-dialog__learn-more {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.da-gfs-parent-update-dialog__learn-more:focus-visible {
  outline: 2px solid rgba(var(--focus-rgb), 0.8);
  outline-offset: 2px;
}

/* R1-H1: every affected ancestor folder plus the file, stacked. */
.da-gfs-parent-update-dialog__folders {
  display: grid;
  gap: var(--space-1);
}

.da-gfs-parent-update-dialog__folder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(var(--edge-rgb), 0.32);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.da-gfs-parent-update-dialog__name {
  overflow: hidden;
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.da-gfs-parent-update-dialog__change {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.da-gfs-parent-update-dialog__role {
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
}

.da-gfs-parent-update-dialog__role--next {
  color: var(--text);
}

/* R1-M5: the confirmation states the surviving Editor shares BEFORE the
   user approves, not only in the post-change toast. */
.da-gfs-parent-update-dialog__residual {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.da-gfs-parent-update-dialog__help {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding-inline-start: 1.25rem;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.da-gfs-parent-update-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.da-gfs-grant-list__chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.da-gfs-access-row-menu {
  display: inline-flex;
  flex: 0 0 auto;
}

.da-gfs-access-row-menu__panel.da-gfs-resource-menu__panel {
  width: min(184px, calc(100vw - (var(--space-4) * 2)));
}

@media (max-width: 940px) {
  .da-gfs-manage-dialog__body {
    padding: var(--space-4);
  }

  .da-gfs-manage-section--access {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  /* `.page-card__header` stacks via its own `max-width: 900px` rule, and the
     `da-grid` listings keep their inline `--da-grid-cols` (the flexible name
     column shrinks); neither needs a bespoke reflow here anymore. */
  .da-gfs-current-actions,
  .da-gfs-file-picker__row {
    display: grid;
  }

  .da-gfs-delegation__composer {
    grid-template-columns: minmax(0, 1fr);
  }

  .da-gfs-current-copy {
    max-width: 100%;
  }

  .da-gfs-drive__header.page-card__header {
    align-items: stretch;
    flex-direction: column;
  }

  .da-gfs-drive__header-actions {
    justify-content: flex-end;
  }

  .da-gfs-drive__grid {
    overflow: visible;
  }

  .da-gfs-drive__grid .da-grid__head,
  .da-gfs-drive__grid .da-grid__row {
    grid-template-columns: calc(var(--space-5) + var(--space-1)) minmax(0, 1fr) 9.5rem;
  }

  .da-gfs-drive__size-column,
  .da-gfs-drive__size {
    display: none;
  }

  .da-gfs-manage-modal {
    padding: var(--space-2);
  }

  .da-gfs-manage-dialog {
    width: 100%;
    max-height: 96vh;
  }
}

@container (max-width: 720px) {
  .da-gfs-drive__grid .da-grid__head,
  .da-gfs-drive__grid .da-grid__row {
    grid-template-columns: calc(var(--space-5) + var(--space-1)) minmax(0, 1fr) 9.5rem;
  }

  .da-gfs-drive__size-column,
  .da-gfs-drive__size {
    display: none;
  }
}

@media (max-width: 560px) {
  .da-gfs-image-preview-modal,
  .da-gfs-markdown-preview-modal,
  .da-gfs-video-preview-modal {
    padding: var(--space-2);
  }

  .da-gfs-image-preview-dialog,
  .da-gfs-markdown-preview-dialog,
  .da-gfs-video-preview-dialog {
    width: 100%;
    height: 96vh;
  }

  .da-gfs-image-preview-dialog__body,
  .da-gfs-markdown-preview-dialog__body,
  .da-gfs-video-preview-dialog__body {
    padding: var(--space-2);
  }

  .da-gfs-manage-dialog__header {
    gap: var(--space-2);
    padding: var(--space-3);
  }

  .da-gfs-manage-dialog__icon {
    width: 40px;
    height: 40px;
  }

  .da-gfs-manage-dialog__heading h3 {
    font-size: var(--font-size-xl);
  }

  .da-gfs-manage-dialog__header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .da-gfs-manage-dialog__top-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .da-gfs-manage-dialog__title-edit {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .da-gfs-manage-dialog__title-edit .ui-button:last-child {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .da-gfs-manage-dialog__body {
    padding: var(--space-2);
  }

  .da-gfs-move-dialog__tree-heading {
    align-items: start;
    flex-direction: column;
    gap: var(--space-1);
  }

  .da-gfs-move-dialog__tree-heading > .muted {
    text-align: left;
  }

  .da-gfs-move-dialog__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .da-gfs-move-dialog__action-buttons {
    justify-content: flex-end;
  }

  .da-gfs-manage-section--actions .da-gfs-inline-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Plugin consent prompt (spec §9.4) ─────────────────────────────────
   Reuses the confirm-dialog shell; only the permission rows are new. Wider
   than a confirm dialog because each row carries a full scope sentence, and
   a batched prompt can list up to eight of them. */
.da-plugin-consent {
  width: min(480px, 100%);
}

.da-plugin-consent__count {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-sm);
}

.da-plugin-consent__rows {
  list-style: none;
  margin: 0 0 var(--space-2);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.da-plugin-consent__row {
  border: 1px solid rgba(var(--edge-rgb), 0.32);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
}

.da-plugin-consent__label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2);
  align-items: start;
  cursor: pointer;
}

.da-plugin-consent__row-title {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.da-plugin-consent__row-detail {
  display: block;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.da-plugin-consent__footer {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-sm);
}
/* Keyboard-first chat view tabs */
.chat-view-tabs {
  /* The strip is now a global sibling ABOVE the per-kind seam (mini-spec 03 §3),
     no longer nested in `.chat-view-workspace` — which is where this token is
     otherwise declared. Declare it here too so the strip's own baseline shelf
     (`::after`) and the inactive-tab borders keep resolving on every route. */
  --chat-view-selected-border: rgba(var(--accent-rgb), 0.25);

  flex: 0 0 auto;
  display: flex;
  min-width: 0;
  padding: var(--space-2) 0 0;
  position: relative;
  width: 100%;
  z-index: 1;
}

/* Bottom shelf of the tab strip. It lives on the non-scrolling container (not
   the scroller/list) so it stays under the whole visible strip when the tabs
   overflow and scroll — a shelf on the scrolling list only spans the initial
   viewport and slides away on scroll. z-index:-1 keeps it below the opaque
   tabs (so it only shows through the gaps between them); each inactive tab
   draws its own matching bottom border, and the active tab omits it to notch
   through and merge with the surface below. */
.chat-view-tabs::after {
  background: var(--chat-view-selected-border);
  bottom: 0;
  content: '';
  height: 1px;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  z-index: -1;
}

.chat-view-tabs__scroller {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  transform: rotateX(180deg);
  width: 100%;
}

.chat-view-tabs__list {
  display: flex;
  gap: var(--space-1);
  min-width: 100%;
  position: relative;
  transform: rotateX(180deg);
  width: 100%;
}

.chat-view-tab {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 0;
  display: flex;
  flex: 1 1 var(--chat-tab-max);
  min-width: var(--chat-tab-min);
  max-width: var(--chat-tab-max);
  transition: background var(--motion-fast);
}

/* Flat VS Code tabs: inactive tabs drop their side/top edges and read only as a
   surface; the shared bottom shelf border is kept (it is the strip baseline). */
.chat-view-tab:not(.is-active) {
  border-bottom: 1px solid var(--chat-view-selected-border);
  border-left-color: transparent;
  border-right-color: transparent;
  border-top-color: transparent;
}

/* The active tab is set apart by a stronger surface plus a top accent bar, not
   by an accent outline on every edge. The bar is an inset shadow so it adds no
   layout box. */
.chat-view-tab.is-active {
  background: var(--surface-strong);
  border-color: transparent;
  border-bottom: 0;
  box-shadow: inset 0 2px 0 0 var(--accent);
  flex-shrink: 0.4;
  position: relative;
  z-index: 1;
}

.chat-view-tab:hover {
  background: var(--surface-hover);
}

.chat-view-tab.is-active:hover {
  background: var(--surface-strong);
}

.chat-view-tab .chat-view-tab__select.ui-button:hover:enabled,
.chat-view-tab .chat-view-tab__close.ui-button:hover:enabled {
  background: transparent;
  border-color: transparent;
}

.chat-view-tab__select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.chat-view-tab__label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  white-space: nowrap;
}

.chat-view-tab__close {
  flex: 0 0 auto;
}

/* Reorder feedback (session-only drag & drop / keyboard). The dragged tab dims;
   a vertical accent bar marks the insertion side. The bar is a pseudo-element so
   it composes with the active tab's top accent box-shadow instead of fighting
   it. */
.chat-view-tab.is-dragging {
  opacity: 0.5;
}

.chat-view-tab.is-drop-before,
.chat-view-tab.is-drop-after {
  position: relative;
}

.chat-view-tab.is-drop-before::after,
.chat-view-tab.is-drop-after::after {
  background: var(--accent);
  bottom: 0;
  content: '';
  position: absolute;
  top: 0;
  width: 2px;
  z-index: 2;
}

.chat-view-tab.is-drop-before::after {
  left: 0;
}

.chat-view-tab.is-drop-after::after {
  right: 0;
}

.chat-view-workspace {
  --chat-view-selected-border: rgba(var(--accent-rgb), 0.25);

  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

/* Empty-workspace home state (mini-spec 03 §5): shown when the last tab closes. */
.workspace-home-empty {
  align-items: center;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: center;
  padding: var(--space-5);
  text-align: center;
}

.chat-view-surface {
  background: var(--surface-strong);
  border-color: var(--chat-view-selected-border);
  border-style: solid;
  border-width: 0 1px 1px;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding-left: var(--space-3);
  width: 100%;
}

.chat-view-surface__content {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

.content-panel:has(.agent-page) > .chat-view-workspace,
.content-panel.content-panel--agent-chat > .chat-view-workspace,
.chat-view-surface__content > .agent-page {
  flex: 1 1 0;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.chat-view-surface__content > .page {
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
  width: 100%;
}

/* Contextual find surfaces remain in trusted Desktop chrome. */
.current-content-search {
  align-items: center;
  align-self: flex-end;
  background: var(--surface-strong);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-control);
  display: flex;
  gap: var(--space-1);
  margin: var(--space-2) var(--space-3) 0;
  padding: var(--space-1);
  position: relative;
  z-index: var(--layer-header);
}

.current-content-search__input {
  min-width: 220px;
}

.current-content-search__count {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  min-width: 44px;
  text-align: center;
}

.chat-search-match {
  background: var(--search-match-bg);
  border-radius: 2px;
  color: var(--search-match-text);
}

.chat-search-match--active {
  background: var(--search-match-current-bg);
}

@media (forced-colors: active) {
  .chat-search-match,
  .chat-search-match--active {
    background: Highlight;
    color: HighlightText;
    forced-color-adjust: none;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Progress stepper (migrated from the legacy component-level ProgressStepper.css
   into shared styles — hardcoded dark-only literals replaced with tokens so the
   surface renders in both themes; selectors and effects unchanged).
   ───────────────────────────────────────────────────────────────────────────── */

.progress-stepper {
  margin-top: var(--space-2);
  border: 1px solid rgba(var(--edge-rgb), 0.22);
  border-radius: var(--radius-md);
  background: transparent;
  padding: var(--space-2) var(--space-2-5);
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
    monospace;
  font-size: var(--font-size-sm);
  line-height: 18px;
  overflow: hidden;
  animation: stepper-fade-in 0.25s ease-out;
}

@keyframes stepper-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Completed tools collapse to a single dim line (see the chat-scoped override
   below), not a dimmed card — no opacity fade, no collapse animation. */
.progress-stepper.status-completed {
  padding: var(--space-1) var(--space-2-5);
}

.stepper-completed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stepper-completed-summary {
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.stepper-expand-btn {
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: var(--font-size-2xs);
  font-family: inherit;
  padding: 2px 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.stepper-expand-btn:hover {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: rgba(var(--accent-rgb), 0.4);
}

.status-completed .stepper-step-list {
  margin-top: 8px;
  animation: stepper-fade-in 0.2s ease-out;
}

.stepper-completed-icon {
  color: var(--success);
  font-size: var(--font-size-sm);
}

.stepper-completed-tools {
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepper-completed-tools-inline {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stepper-details-toggle-icon {
  font-size: var(--font-size-xs);
  line-height: 1;
}

.stepper-completed-duration {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stepper-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.stepper-counter {
  color: var(--text-dim);
  white-space: nowrap;
}

.stepper-intent {
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepper-thinking {
  min-width: 0;
  flex: 1;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper-connecting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stepper-running-row {
  min-height: var(--control-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stepper-cancel-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.stepper-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stepper-thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.7);
  animation: stepper-thinking-bounce 1s ease-in-out infinite;
}

.stepper-thinking-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.stepper-thinking-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes stepper-thinking-bounce {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.status-suspended {
  border-color: rgba(var(--warning-rgb), 0.34);
}

.stepper-suspended-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.stepper-suspended-icon {
  color: var(--warning);
  font-size: var(--font-size-lg);
}

.stepper-suspended-label {
  min-width: 0;
  flex: 1;
  color: var(--warning);
  font-size: var(--font-size-sm);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepper-approval-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 2px;
  justify-content: flex-end;
}

.stepper-btn {
  font-family: inherit;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    opacity 0.15s;
}

.stepper-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stepper-btn-approve {
  background: rgba(var(--success-rgb), 0.18);
  border-color: rgba(var(--success-rgb), 0.4);
  color: var(--success);
}

.stepper-btn-approve:hover:not(:disabled) {
  background: rgba(var(--success-rgb), 0.3);
  border-color: rgba(var(--success-rgb), 0.6);
}

.stepper-btn-deny {
  background: rgba(var(--danger-rgb), 0.12);
  border-color: rgba(var(--danger-rgb), 0.3);
  color: var(--danger);
}

.stepper-btn-deny:hover:not(:disabled) {
  background: rgba(var(--danger-rgb), 0.22);
  border-color: rgba(var(--danger-rgb), 0.5);
}

.stepper-error-status {
  color: var(--danger);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.stepper-step-list {
  display: grid;
  gap: 4px;
}

.stepper-step {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  gap: 6px;
  align-items: center;
  min-height: 24px;
  padding: 2px 4px;
  border-radius: 6px;
  animation: stepper-step-slide 0.2s ease-out;
}

@keyframes stepper-step-slide {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.stepper-step-icon {
  display: inline-grid;
  place-items: center;
  font-size: var(--font-size-sm);
  width: 18px;
  height: 18px;
}

.stepper-step-icon.state-completed {
  color: var(--success);
}

.stepper-step-icon.state-running {
  color: var(--accent);
  animation: stepper-pulse 1.2s ease-in-out infinite;
}

@keyframes stepper-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.stepper-step-icon.state-error {
  color: var(--danger);
}

.stepper-step-name {
  color: var(--text);
  font-size: var(--font-size-sm);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepper-step-fn {
  color: var(--text-dim);
  font-weight: 400;
}

.stepper-step-fn::before {
  content: ' · ';
  color: var(--text-dim);
}

.stepper-step-duration {
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stepper-step-duration.state-running {
  color: var(--accent);
}

.stepper-step-duration.state-error {
  color: var(--danger);
  font-size: var(--font-size-2xs);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepper-step-error-detail {
  grid-column: 2 / -1;
  margin-left: 24px;
  padding: 4px 8px;
  background: rgba(var(--danger-rgb), 0.12);
  border-radius: 4px;
  color: var(--danger);
  font-size: var(--font-size-2xs);
  line-height: 14px;
  word-break: break-word;
  white-space: pre-wrap;
}

.stepper-iteration-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: var(--text-dim);
  font-size: var(--font-size-2xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stepper-iteration-divider::before,
.stepper-iteration-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(var(--edge-rgb), 0.2);
}

/* ─── Input Preview (own row below tool name) ──────────── */

.stepper-step-input-preview {
  grid-column: 2 / -1;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: 400;
  margin-top: -2px;
  padding-left: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Expand Chevron ────────────────────────────────────── */

.stepper-step-chevron {
  color: var(--text-dim);
  font-size: var(--font-size-2xs);
  transition:
    transform 0.15s ease-out,
    color 0.15s;
  flex-shrink: 0;
}

.stepper-step-chevron--open {
  transform: rotate(90deg);
  color: var(--text-muted);
}

/* ─── Expandable Step Row ───────────────────────────────── */

.stepper-step-expandable {
  cursor: pointer;
  transition: background 0.15s;
}

.stepper-step-expandable:hover {
  background: rgba(var(--edge-rgb), 0.1);
}

.stepper-step-expandable:hover .stepper-step-chevron {
  color: var(--text-muted);
}

/* ─── Output Panel ──────────────────────────────────────── */

.stepper-step-output {
  margin-left: 24px;
  margin-bottom: 4px;
  border-left: 2px solid var(--border);
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  background: rgba(var(--edge-rgb), 0.16);
  animation: stepper-output-reveal 0.15s ease-out;
}

.stepper-step-output--error {
  border-left-color: var(--danger);
  background: rgba(var(--danger-rgb), 0.08);
}

@keyframes stepper-output-reveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.stepper-step-output-code {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.stepper-step-output--error .stepper-step-output-code {
  color: var(--danger);
}

/* ─── Completed state: keep output readable ─────────────── */

.status-completed .stepper-step-output {
  opacity: calc(1 / 0.7);
}

/* ─── Cancelled terminal state ──────────────────────────── */

.progress-stepper.status-cancelled {
  padding: var(--space-1) var(--space-2-5);
  opacity: 0.7;
  border-color: rgba(var(--text-dim-rgb), 0.3);
}

.stepper-cancelled-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.stepper-cancelled-badge {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(var(--edge-rgb), 0.18);
  border: 1px solid rgba(var(--edge-rgb), 0.3);
  border-radius: 4px;
  padding: 1px 7px;
}

.stepper-cancelled-reason {
  color: var(--text-dim);
  font-size: var(--font-size-xs);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Stop agent button ────────────────────────────────── */

.progress-cancel-btn {
  margin-top: 0;
  margin-left: auto;
  width: var(--control-height);
  min-width: var(--control-height);
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--text-dim-rgb), 0.08);
  border-color: rgba(var(--edge-rgb), 0.3);
  color: var(--text-dim);
}

.stepper-stop-symbol {
  display: inline-block;
  font-size: var(--font-size-sm);
  line-height: 1;
  vertical-align: middle;
}

.progress-cancel-btn:hover:not(:disabled) {
  background: rgba(var(--danger-rgb), 0.1);
  border-color: rgba(var(--danger-rgb), 0.25);
  color: var(--danger);
}

/* ==========================================================================
   F2 · Shell — VS Code app frame
   Structural surfaces (title bar / activity bar / sidebar / editor) read as
   flat zones with a single crisp 1px separation border, no translucent "glass"
   edges or backdrop blur. This block lands last so it wins by source order over
   the earlier per-surface declarations it supersedes.
   ========================================================================== */

/* --- Zone separation: one solid 1px border, no backdrop blur ------------- */
.window-titlebar {
  border-bottom: 1px solid var(--zone-border);
}

.left-nav {
  border-right: 1px solid var(--zone-border);
  /* Structural zone: drop the .glass-card blur so the sidebar reads as an
     opaque VS Code activity-bar surface, not a frosted overlay. */
  backdrop-filter: none;
}

/* --- Title bar command center: search + notifications grouped at the right - */
.window-titlebar__actions .top-bar {
  position: relative;
  justify-content: flex-end;
}

.window-titlebar__actions .header-left {
  flex: 0 0 auto;
  justify-content: flex-end;
}

/* Search pill and the notification bell sit together at the right edge, in
   flow (the .top-bar gap separates them). Drop the base margin-left:auto so the
   bell hugs the search instead of being pushed to the far edge. */
.window-titlebar__actions .header-utilities {
  margin-left: 0;
}

.window-titlebar__actions .global-search {
  --global-search-expanded: var(--titlebar-search-width);
  flex: 0 0 auto;
  width: var(--titlebar-search-width);
  max-width: 100%;
  margin-right: 0;
}

.window-titlebar__actions .global-search:focus-within,
.window-titlebar__actions .global-search.is-open {
  width: var(--titlebar-search-width);
}

/* --- Windows/Linux close control: red destructive hover ------------------ */
.window-titlebar--platform-windows .window-control-button--close:hover:enabled,
.window-titlebar--platform-linux .window-control-button--close:hover:enabled {
  background: var(--window-control-close-hover-bg);
  border-color: var(--window-control-close-hover-bg);
  color: var(--window-control-close-hover-ink);
}

/* --- Sidebar: accent bar on the active item (expanded AND collapsed) ------ */
/* VS Code marks the active destination with a 2px vertical accent bar at the
   left edge, in both the labeled list (328px) and the icon-only activity bar
   (74px). Anchors to .nav-link (position: relative); the active class sits on
   the row wrapper for Chat/Apps and on the bare row otherwise. */
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 60%;
  border-radius: var(--radius-xs);
  background: var(--accent);
  pointer-events: none;
}

/* --- Sidebar item states: neutral VS Code fills (dark AND light) ----------
   Bug fix: hover/active of sidebar rows previously painted an ACCENT tint under
   the label (rgba(accent,.16/.22), and the accent-based --list-item and
   --surface-hover tokens). On the translucent sidebar surface that blue wash
   crushed label contrast. The active destination is marked by the vertical
   accent bar (.nav-link.active::before) plus a NEUTRAL raised fill and full
   text — never an accent fill. Values are neutral edge overlays measured to
   clear AA (>=4.5:1) for the label in both themes. Scoped to .left-nav so the
   global --list-item-* / --surface-hover tokens (tables, grids, menus) are
   untouched. */
.left-nav .nav-link:hover,
.left-nav .nav-link--with-toggle:hover,
.left-nav .nav-available-app:hover:enabled,
.left-nav .nav-latest-session:hover,
.left-nav .nav-latest-sessions__toggle:hover:enabled,
.left-nav .sidebar-settings-trigger:hover:enabled,
.left-nav .sidebar-settings-trigger.open {
  background: rgba(var(--edge-rgb), 0.16);
}

.left-nav .nav-link.active,
.left-nav .nav-available-app.active,
.left-nav .nav-latest-session.active {
  background: rgba(var(--edge-rgb), 0.26);
  border-color: transparent;
  color: var(--text);
}

/* The nested session label carries its own explicit color, so lift it to full
   text on the selected row (the row-level color above cannot reach it). */
.left-nav .nav-latest-session.active .nav-latest-session__main {
  color: var(--text);
}