.agent-observer-page {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.agent-observer-page .page-command-bar { padding-block: 10px; }
.agent-observer-page .page-command-description { max-width: 78ch; }
.agent-observer-page .page-command-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.agent-observer-page select,
.agent-observer-search { min-height: 34px; border: 1px solid var(--console-border); border-radius: 5px; background: var(--console-surface); color: var(--console-text); }
.agent-observer-page select { max-width: 230px; padding: 0 28px 0 9px; }
.agent-observer-search { min-width: min(330px, 100%); display: flex; align-items: center; gap: 7px; padding: 0 8px; }
.agent-observer-search input { width: 100%; min-width: 80px; border: 0; outline: 0; background: transparent; color: inherit; }
.agent-observer-search button { border: 0; background: transparent; color: var(--console-muted); display: inline-flex; }
.agent-observer-stream,
.agent-observer-target { min-height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--console-border); border-radius: 5px; background: var(--console-surface); font-size: 12px; white-space: nowrap; }
.agent-observer-stream[data-phase="live"] svg { color: var(--console-success); }
.agent-observer-stream[data-phase="replay"] svg,
.agent-observer-stream[data-phase="handoff"] svg,
.agent-observer-stream[data-phase="reconnecting"] svg { color: var(--console-accent); }
.agent-observer-stream[data-phase="error"],
.agent-observer-stream[data-phase="stale"] { border-color: color-mix(in srgb, var(--console-danger) 45%, var(--console-border)); }
.agent-observer-target { color: var(--console-muted); font-size: 11px; }
.agent-observer-secondary-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agent-observer-filter-trigger { display: none; min-height: 34px; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--console-border); border-radius: 5px; background: var(--console-surface); color: var(--console-text); }
.agent-observer-segment { display: inline-flex; border: 1px solid var(--console-border); border-radius: 5px; overflow: hidden; }
.agent-observer-segment button,
.agent-observer-density { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 9px; border: 0; border-right: 1px solid var(--console-border); background: var(--console-surface); color: var(--console-muted); }
.agent-observer-segment button:last-child { border-right: 0; }
.agent-observer-segment button[aria-pressed="true"] { background: var(--console-accent-soft); color: var(--console-accent); }
.agent-observer-density { border: 1px solid var(--console-border); border-radius: 5px; }
.agent-observer-page > .console-status-strip { border-inline: 0; border-radius: 0; }
.agent-observer-page > .console-status-strip .console-status-item { min-width: 112px; padding-block: 6px; }

.agent-observer-inline-error,
.agent-observer-window-warning,
.agent-observer-window-note { padding: 7px 13px; border-bottom: 1px solid var(--console-border); font-size: 12px; overflow-wrap: anywhere; }
.agent-observer-inline-error,
.agent-observer-window-warning { border-color: color-mix(in srgb, var(--console-danger) 35%, var(--console-border)); background: color-mix(in srgb, var(--console-danger) 8%, var(--console-surface)); color: var(--console-danger); }
.agent-observer-window-note { margin: 0; background: var(--console-surface-muted); color: var(--console-muted); }

.agent-observer-workspace { grid-row: -2 / -1; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.agent-observer-workspace.has-inspector { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); }
.agent-observer-content { min-width: 0; min-height: 0; overflow: hidden; background: var(--console-surface); display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.agent-observer-content > .table-pagination { border-top: 1px solid var(--console-border); background: var(--console-surface); }
.agent-observer-skeleton { height: 100%; padding: 12px; display: grid; align-content: start; gap: 7px; }
.agent-observer-skeleton span { height: 48px; border-radius: 3px; background: var(--console-surface-muted); }
.agent-observer-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; color: var(--console-muted); text-align: center; }
.agent-observer-empty strong { color: var(--console-text); }

.agent-observer-table { height: 100%; min-width: 0; display: grid; grid-template-rows: 38px minmax(0, 1fr); overflow: hidden; }
.agent-observer-table > .console-virtual-list { overflow: auto; }
.agent-observer-table-head,
.agent-observer-table-row { min-width: 1280px; display: grid; grid-template-columns: 190px minmax(190px, 1.15fr) minmax(170px, 1fr) minmax(145px, .85fr) 120px 120px 160px minmax(170px, 1fr); align-items: center; gap: 10px; padding-inline: 12px; }
.agent-observer-table-head { border-bottom: 1px solid var(--console-border); background: var(--console-surface-muted); color: var(--console-muted); font-size: 11px; font-weight: 700; }
.agent-observer-table-row { height: calc(100% - 1px); border-bottom: 1px solid var(--console-border); outline: 0; cursor: default; }
.agent-observer-table-row:hover,
.agent-observer-table-row[data-selected="true"] { background: var(--console-accent-soft); }
.agent-observer-table-row:focus-visible { box-shadow: inset 0 0 0 2px var(--console-accent); }
.agent-observer-table-row[data-recent="true"] { animation: agent-observer-row-highlight 1.4s ease-out; }
.agent-observer-table-row > span { min-width: 0; display: grid; gap: 3px; }
.agent-observer-table-row strong,
.agent-observer-table-row small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-observer-table-row small { color: var(--console-muted); font-size: 11px; }
.agent-observer-status-stack { display: flex !important; align-items: center; gap: 4px !important; flex-wrap: wrap; }

.agent-observer-card-grid { height: 100%; min-height: 0; padding: 10px; }
.console-virtual-grid { min-width: 0; min-height: 0; }
.console-virtual-grid > .console-virtual-list { overflow: auto; }
.console-virtual-grid-row { display: grid; padding-bottom: 10px; }
.console-virtual-grid-cell { min-width: 0; min-height: 0; }
.agent-observer-card { height: 100%; min-width: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 10px; padding: 11px 12px; border: 1px solid var(--console-border); border-left: 3px solid var(--console-muted); border-radius: 4px; background: var(--console-surface); outline: 0; }
.agent-observer-card[data-status="running"] { border-left-color: var(--console-accent); }
.agent-observer-card[data-status="failed"] { border-left-color: var(--console-danger); }
.agent-observer-card[data-status="completed"] { border-left-color: var(--console-success); }
.agent-observer-card[data-selected="true"] { box-shadow: inset 0 0 0 2px var(--console-accent); }
.agent-observer-card:focus-visible { outline: 2px solid var(--console-accent); outline-offset: -2px; }
.agent-observer-card header { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; color: var(--console-muted); font-size: 11px; }
.agent-observer-card-identity { min-width: 0; display: grid; gap: 4px; }
.agent-observer-card h2,
.agent-observer-card p,
.agent-observer-card footer { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-observer-card h2 { font-size: 14px; }
.agent-observer-card p { color: var(--console-muted); font-size: 11px; }
.agent-observer-card dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; align-content: start; }
.agent-observer-card dl div { min-width: 0; }
.agent-observer-card dt { color: var(--console-muted); font-size: 10px; text-transform: uppercase; }
.agent-observer-card dd { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.agent-observer-card footer { padding-top: 8px; display: grid; gap: 3px; border-top: 1px solid var(--console-border); color: var(--console-muted); font-size: 11px; }
.agent-observer-card footer strong { color: var(--console-text); }
.agent-observer-card footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.agent-observer-tree { height: 100%; min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.agent-observer-tree > .agent-mind-map { grid-row: -2 / -1; }
.agent-mind-map { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--console-surface-muted); }
.agent-mind-map-flow { width: 100%; height: 100%; }
.agent-mind-map-flow .vue-flow__pane { cursor: grab; }
.agent-mind-map-flow .vue-flow__pane.dragging { cursor: grabbing; }
.agent-mind-map-flow .vue-flow__edge-path { stroke: var(--console-graphite-500); stroke-width: 2; vector-effect: non-scaling-stroke; }
.agent-mind-map-flow .vue-flow__arrowhead { fill: var(--console-graphite-500); }
.agent-mind-map-flow .vue-flow__handle { width: 1px; height: 1px; min-width: 1px; min-height: 1px; border: 0; opacity: 0; pointer-events: none; }
.agent-mind-map-node { width: 220px; height: 70px; min-width: 0; display: grid; grid-template-rows: 19px 1fr 16px; gap: 2px; padding: 7px 9px; border: 1px solid var(--console-border); border-left: 3px solid var(--console-muted); border-radius: 5px; background: var(--console-surface); color: var(--console-text); outline: 0; box-shadow: 0 2px 7px rgb(15 23 42 / 8%); cursor: pointer; }
.agent-mind-map-node[data-kind="scope"] { width: 260px; }
.agent-mind-map-node[data-kind="run"] { width: 244px; }
.agent-mind-map-node[data-status="running"] { border-left-color: var(--console-accent); }
.agent-mind-map-node[data-status="failed"] { border-left-color: var(--console-danger); }
.agent-mind-map-node[data-status="completed"] { border-left-color: var(--console-success); }
.agent-mind-map-node[data-selected="true"] { box-shadow: inset 0 0 0 2px var(--console-accent), 0 2px 7px rgb(15 23 42 / 8%); }
.agent-mind-map-node:focus-visible { outline: 2px solid var(--console-accent); outline-offset: 2px; }
.agent-mind-map-node header { min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--console-muted); font-size: 10px; }
.agent-mind-map-node header > span:first-child { font-weight: 700; }
.agent-mind-map-node header .status-badge { margin-left: auto; }
.agent-mind-map-node strong,
.agent-mind-map-node small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-mind-map-node strong { font-size: 12px; }
.agent-mind-map-node small { color: var(--console-muted); font-size: 10px; }
.agent-mind-map-toggle { width: 18px; height: 18px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--console-border); border-radius: 3px; background: var(--console-surface); color: var(--console-muted); font-size: 14px; line-height: 1; }
.agent-mind-map-controls { position: absolute; right: 10px; bottom: 10px; z-index: 5; display: inline-flex; border: 1px solid var(--console-border); border-radius: 5px; overflow: hidden; background: var(--console-surface); box-shadow: 0 2px 8px rgb(15 23 42 / 10%); }
.agent-mind-map-controls button { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border: 0; border-right: 1px solid var(--console-border); background: transparent; color: var(--console-text); }
.agent-mind-map-controls button:last-child { border-right: 0; }
.agent-mind-map-controls button:hover { background: var(--console-accent-soft); color: var(--console-accent); }

.agent-observer-inspector { min-width: 0; min-height: 0; overflow: hidden; border-left: 1px solid var(--console-border); background: var(--console-surface); }
.agent-observer-inspector > .operations-inspector-panel { height: 100%; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.agent-observer-inspector .operations-inspector-header { position: static; min-width: 0; }
.agent-observer-inspector .operations-inspector-header > div { min-width: 0; }
.agent-observer-inspector .operations-inspector-header h2,
.agent-observer-inspector .operations-inspector-header p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-observer-inspector .operations-inspector-tabs { min-width: 0; overflow-y: hidden; scrollbar-width: none; }
.agent-observer-inspector .operations-inspector-tabs::-webkit-scrollbar { display: none; }
.agent-observer-inspector .operations-inspector-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.agent-observer-inspector-section { display: grid; gap: 14px; }
.agent-observer-status-matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.agent-observer-status-matrix > span { min-width: 0; display: grid; gap: 5px; padding: 8px; border: 1px solid var(--console-border); }
.agent-observer-status-matrix small { color: var(--console-muted); }
.agent-observer-inspector-grid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--console-border); }
.agent-observer-inspector-grid div { min-width: 0; padding: 9px; background: var(--console-surface); }
.agent-observer-inspector-grid dt { color: var(--console-muted); font-size: 10px; text-transform: uppercase; }
.agent-observer-inspector-grid dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 12px; }
.agent-observer-inspector-wide { grid-column: 1 / -1; }
.agent-observer-break { overflow-wrap: anywhere; word-break: break-all; }
.agent-observer-event-tail { margin: 0; padding: 0; display: grid; gap: 1px; list-style: none; background: var(--console-border); }
.agent-observer-event-tail li { min-width: 0; display: grid; grid-template-columns: 128px minmax(120px, .6fr) minmax(0, 1fr); gap: 8px; padding: 8px; background: var(--console-surface); font-size: 11px; }
.agent-observer-event-tail span,
.agent-observer-event-tail small { color: var(--console-muted); }
.agent-observer-inspector .content-viewer,
.agent-observer-inspector-drawer .content-viewer { min-height: 320px; max-height: min(62dvh, 620px); }
.agent-observer-inspector .content-viewer-body,
.agent-observer-inspector-drawer .content-viewer-body { min-height: 0; }
.agent-observer-inspector-drawer .operations-inspector-panel { min-height: 0; }
.operations-inspector-panel[data-embedded="true"] { min-height: 0; }
.operations-inspector-panel[data-embedded="true"] .operations-inspector-tabs { position: sticky; top: 0; z-index: 1; background: var(--console-surface); }

.agent-observer-drawer-fields { display: grid; gap: 12px; }
.agent-observer-drawer-fields label { display: grid; gap: 5px; color: var(--console-muted); font-size: 12px; }
.agent-observer-drawer-fields select { width: 100%; max-width: none; }
.agent-observer-help-content { display: grid; gap: 10px; }
.agent-observer-help-content h3,
.agent-observer-help-content p { margin: 0; }
.agent-observer-help-content h3 { padding-top: 6px; font-size: 13px; }
.agent-observer-help-content p { color: var(--console-muted); font-size: 12px; line-height: 1.6; }

@keyframes agent-observer-row-highlight {
  from { background: color-mix(in srgb, var(--console-accent) 20%, var(--console-surface)); }
  to { background: transparent; }
}

@media (max-width: 1199px) {
  .agent-observer-workspace.has-inspector { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1100px) {
  .agent-observer-page .page-command-filters { align-items: stretch; }
  .agent-observer-secondary-filters { order: 5; flex: 1 0 100%; }
  .agent-observer-secondary-filters select { flex: 1 1 180px; }
  .agent-observer-density { order: 4; }
  .agent-observer-segment { order: 3; }
  .agent-observer-primary-status { order: 2; }
  .agent-observer-search { order: 1; flex: 1 1 320px; }
}

@media (max-width: 600px) {
  .agent-observer-page { grid-template-rows: auto auto auto auto minmax(0, 1fr); }
  .agent-observer-page .page-command-bar { padding-block: 8px; }
  .agent-observer-page .page-command-description { display: none; }
  .agent-observer-page .page-command-actions { gap: 5px; }
  .agent-observer-target,
  .agent-observer-reconnect { display: none; }
  .agent-observer-help { min-width: 34px; padding-inline: 8px; font-size: 0; }
  .agent-observer-page .page-command-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .agent-observer-search { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .agent-observer-primary-status { grid-column: 1; width: 100%; max-width: none !important; }
  .agent-observer-filter-trigger { grid-column: 2; display: inline-flex; }
  .agent-observer-secondary-filters,
  .agent-observer-density { display: none; }
  .agent-observer-segment { grid-column: 1 / -1; width: 100%; }
  .agent-observer-segment button { flex: 1; }
  .agent-observer-page > .console-status-strip .console-status-item { min-width: 96px; }
  .agent-observer-table-head,
  .agent-observer-table-row { min-width: 690px; grid-template-columns: 118px minmax(190px, 1fr) 145px minmax(180px, 1fr); }
  .agent-observer-table-head > :nth-child(3),
  .agent-observer-table-head > :nth-child(5),
  .agent-observer-table-head > :nth-child(6),
  .agent-observer-table-head > :nth-child(7),
  .agent-observer-table-row > :nth-child(3),
  .agent-observer-table-row > :nth-child(5),
  .agent-observer-table-row > :nth-child(6),
  .agent-observer-table-row > :nth-child(7) { display: none; }
  .agent-observer-card-grid { padding: 7px; }
  .agent-observer-card dl { grid-template-columns: 1fr; gap: 6px; }
  .agent-mind-map-controls { right: 7px; bottom: 7px; }
  .agent-observer-inspector-grid { grid-template-columns: 1fr; }
  .agent-observer-inspector-wide { grid-column: auto; }
  .agent-observer-event-tail li { grid-template-columns: 1fr; }
  .agent-observer-inspector-drawer .content-viewer { min-height: 260px; max-height: 52dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .agent-observer-table-row[data-recent="true"] { animation: none; }
  .agent-mind-map-flow .vue-flow__viewport { transition: none !important; }
}
