/* ARYA-WEB-001 · Instrument panel — overflow scrolls, never vanishes */

.ops-view {
  -webkit-user-select: text;
  user-select: text;
  --ops-bg: #0b0e14;
  --ops-panel: #121821;
  --ops-line: rgba(148, 163, 184, 0.16);
  --ops-text: #e8eef7;
  --ops-muted: #8b9bb0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  /* Flex child of .shell — never height:100%/100vh (that ignores brandbar). */
  flex: 1 1 auto;
  height: auto;
  max-height: none;
  min-height: 0;
  min-width: 0;
  padding: 0.45rem 0.65rem 0.6rem;
  color: var(--ops-text);
  background: radial-gradient(1200px 600px at 20% -10%, #152033 0%, var(--ops-bg) 55%);
  box-sizing: border-box;
}

.ops-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex: 0 0 auto;
  min-width: 0;
}

.ops-eyebrow {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ops-muted);
}

.ops-title {
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.ops-title span {
  color: var(--ops-muted);
  font-weight: 400;
  font-size: 0.8rem;
}

.ops-health {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 0 0 auto;
  min-width: 0;
}

.ops-health-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--ops-line);
  border-radius: 0.35rem;
  background: rgba(18, 24, 33, 0.92);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.ops-health-chip[data-ok="true"] {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.12);
}
.ops-health-chip[data-ok="false"] {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}
.ops-health-chip[data-ok="null"] {
  border-color: rgba(148, 163, 184, 0.35);
  color: var(--ops-muted);
}

.ops-identity {
  font-size: 0.72rem;
  color: var(--ops-muted);
  text-align: right;
  max-width: 28rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

/*
  Chat is the conversation. The workspace shows the selected turn's journey.
  The Evidence drawer is closed until a stage or technical detail is asked for.
  Default chat width is 500px. The divider can move it. Minimum 380px.
*/
.ops-grid {
  --ops-chat-width: 500px;
  position: relative;
  display: grid;
  grid-template-columns: var(--ops-chat-width) 0.45rem minmax(22rem, 1fr);
  gap: 0.45rem;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.ops-grid.is-drawer-open {
  grid-template-columns: var(--ops-chat-width) 0.45rem minmax(22rem, 1fr) minmax(20rem, 28rem);
}

.ops-inspector[hidden] {
  display: none !important;
}

/* Below this width the drawer floats over the journey instead of squeezing chat or journey. */
@media (max-width: 1320px) {
  .ops-grid.is-drawer-open {
    grid-template-columns: var(--ops-chat-width) 0.45rem minmax(22rem, 1fr);
  }
  .ops-grid .ops-inspector {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(28rem, 92%);
    z-index: 4;
    background: #121821;
    box-shadow: -18px 0 40px rgba(0, 0, 0, 0.55);
  }
}

.ops-splitter {
  cursor: col-resize;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  align-self: stretch;
}

.ops-splitter:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.8);
  outline-offset: 1px;
}

.ops-grid.is-chat-focus {
  grid-template-columns: minmax(0, 1fr);
}

.ops-grid.is-chat-focus .ops-splitter,
.ops-grid.is-chat-focus .ops-workspace,
.ops-grid.is-chat-focus .ops-inspector {
  display: none;
}

.ops-chat,
.ops-workspace,
.ops-inspector {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
  border: 1px solid var(--ops-line);
  border-radius: 0.5rem;
  background: rgba(18, 24, 33, 0.88);
  /* Contain children to panel bounds; scrolling happens on inner regions */
  overflow: hidden;
}

.ops-workspace {
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.06);
}

.ops-chat-head,
.ops-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--ops-line);
  flex: 0 0 auto;
  min-width: 0;
}

.ops-chat-head h2,
.ops-panel-head h2 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
}

.ops-voice-panel {
  display: grid;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--ops-line);
  font-size: 0.72rem;
}

.ops-voice-panel p { margin: 0; }

.ops-voice-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.ops-voice-row span {
  flex: 1;
  font-family: ui-monospace, monospace;
}

.ops-listen {
  align-self: flex-start;
  margin: 0 0 0.25rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.68rem;
}

.ops-episode-chart {
  height: 420px;
  min-height: 240px;
}

/* Chat: header | scroll messages | sticky composer */
.ops-chat-log {
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.45rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
  min-width: 0;
}

.ops-chat-day {
  align-self: center;
  margin: 0.45rem 0 0.15rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.72);
  background: rgba(148, 163, 184, 0.12);
}

.ops-bubble {
  max-width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.92rem;
  line-height: 1.45;
  min-width: 0;
}

.ops-view button,
.ops-view .ops-splitter {
  -webkit-user-select: none;
  user-select: none;
}

.ops-bubble-text,
.ops-raw,
.ops-view textarea,
.ops-view input,
.ops-view p,
.ops-view li,
.ops-view td,
.ops-view th {
  -webkit-user-select: text;
  user-select: text;
}

.ops-bubble-text { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }

.ops-bubble[data-role="user"] {
  align-self: flex-end;
  background: rgba(37, 99, 235, 0.22);
}

.ops-bubble[data-role="arya"] {
  align-self: flex-start;
  background: rgba(52, 211, 153, 0.1);
}

.ops-bubble time,
.ops-sources {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.6rem;
  color: var(--ops-muted);
}

.ops-trace-link,
.ops-obs-link,
.ops-trace-clear {
  display: inline;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  color: #93c5fd;
  cursor: pointer;
  font: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ops-trace-clear {
  color: var(--ops-muted);
  margin-left: 0.35rem;
}

.ops-chat-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem;
  border-top: 1px solid var(--ops-line);
  flex: 0 0 auto;
  min-width: 0;
  background: rgba(18, 24, 33, 0.96);
}

.ops-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.ops-composer-actions {
  display: flex;
  gap: 0.35rem;
}

.ops-speak-wrap {
  display: inline-flex;
  cursor: not-allowed;
}

#ops-speak-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.ops-composer-note {
  margin: 0;
  font-size: 0.78rem;
  color: #fbbf24;
}

.ops-speech-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.45rem 0 0;
}

.ops-why-panel {
  display: grid;
  gap: 0.45rem;
  margin: 0.45rem 0 0.15rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.ops-why-panel[hidden] {
  display: none;
}

.ops-thought-text {
  margin: 0;
  white-space: pre-wrap;
  user-select: text;
  color: var(--ops-text);
}

.ops-why-label {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ops-muted);
}

.ops-why-text,
.ops-why-note {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.ops-why-note {
  color: var(--ops-muted);
}

.ops-chat-form textarea {
  resize: none;
  min-height: 4.8rem;
  max-height: 12rem;
  width: 100%;
  min-width: 0;
  overflow-y: auto;
  border-radius: 0.45rem;
  border: 1px solid var(--ops-line);
  background: rgba(0, 0, 0, 0.28);
  color: inherit;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
}

#ops-focus-chat {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.ops-chat-form button,
.ops-workspace-tabs button,
.ops-graph-filters button,
.ops-inspector-tabs button,
#ops-sign-in {
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(37, 99, 235, 0.18);
  color: var(--ops-text);
  border-radius: 0.35rem;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
}

#ops-chat-send {
  min-width: 2.2rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.95rem;
  line-height: 1;
  align-self: end;
}

.ops-workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--ops-line);
  flex: 0 0 auto;
  min-width: 0;
}

.ops-workspace-tabs button.is-active,
.ops-graph-filters button.is-active,
.ops-inspector-tabs button.is-active {
  background: rgba(96, 165, 250, 0.28);
}

.ops-pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.ops-pane[hidden] {
  display: none !important;
}

.ops-pane-meta {
  padding: 0.4rem 0.65rem 0.35rem;
  border-bottom: 1px solid var(--ops-line);
  flex: 0 0 auto;
  min-width: 0;
}

.ops-pane-meta p {
  margin: 0;
  font-size: 0.64rem;
  color: var(--ops-muted);
}

.ops-kind-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.ops-kind-legend span {
  font-size: 0.58rem;
  padding: 0.08rem 0.3rem;
  border-radius: 0.22rem;
  border: 1px solid transparent;
  color: var(--kind);
  border-color: color-mix(in srgb, var(--kind) 40%, transparent);
}

.ops-kind-legend [data-kind="conversation"],
.ops-timeline-item[data-kind="conversation"],
.ops-trace-list li[data-kind="conversation"] { --kind: #60a5fa; }
.ops-kind-legend [data-kind="cognition"],
.ops-timeline-item[data-kind="cognition"],
.ops-trace-list li[data-kind="cognition"] { --kind: #a78bfa; }
.ops-kind-legend [data-kind="memory"],
.ops-timeline-item[data-kind="memory"],
.ops-trace-list li[data-kind="memory"] { --kind: #34d399; }
.ops-kind-legend [data-kind="system"],
.ops-timeline-item[data-kind="system"],
.ops-trace-list li[data-kind="system"] { --kind: #94a3b8; }
.ops-kind-legend [data-kind="error"],
.ops-timeline-item[data-kind="error"],
.ops-trace-list li[data-kind="error"] { --kind: #f87171; }

.ops-timeline-head {
  display: grid;
  grid-template-columns: 6.5rem 4.8rem 6.5rem minmax(0, 1fr) 4.5rem 4rem 7.5rem;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ops-muted);
  border-bottom: 1px solid var(--ops-line);
  flex: 0 0 auto;
  min-width: 0;
}

.ops-timeline-list {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: auto;
  min-height: 0;
  min-width: 0;
}

.ops-timeline-item {
  display: grid;
  grid-template-columns: 6.5rem 4.8rem 6.5rem minmax(0, 1fr) 4.5rem 4rem 7.5rem;
  gap: 0.35rem;
  align-items: baseline;
  padding: 0.32rem 0.4rem;
  border-left: 3px solid var(--kind, #94a3b8);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.28rem;
  cursor: pointer;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}

.ops-timeline-item.is-selected {
  outline: 1px solid rgba(96, 165, 250, 0.55);
  background: rgba(37, 99, 235, 0.12);
}

.ops-timeline-item[data-status="error"] {
  background: rgba(127, 29, 29, 0.28);
}

.ops-timeline-item .ops-kind { color: var(--kind); text-transform: lowercase; }
.ops-timeline-item .ops-service { color: var(--kind); }
.ops-timeline-item .ops-op { opacity: 0.95; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ops-timeline-item .ops-dur,
.ops-timeline-item .ops-status,
.ops-timeline-item .ops-trace-col { color: var(--ops-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ops-timeline-total {
  margin: 0;
  padding: 0.35rem 0.65rem 0.45rem;
  font-size: 0.66rem;
  color: var(--ops-muted);
  border-top: 1px solid var(--ops-line);
  flex: 0 0 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ops-graph-filters,
.ops-explore-chrome {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--ops-line);
  flex: 0 0 auto;
  min-width: 0;
}

.ops-explore-domains {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.ops-context-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.ops-context-table td,
.ops-context-table th {
  text-align: left;
  vertical-align: top;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.ng-cy {
  height: 440px;
  margin: 0.5rem 0 1rem;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 0.6rem;
  background: #0b1020;
}

.ops-story {
  margin: 0.35rem 0;
  line-height: 1.45;
}

.ops-stage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.6rem 0;
}

.ops-stage-row button {
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
}

.ops-stage-row button.is-active {
  background: rgba(96, 165, 250, 0.28);
}

.ops-explore-domains button,
.ops-explore-search button,
.ops-explore-actions button,
.ops-explore-chip {
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(37, 99, 235, 0.18);
  color: var(--ops-text);
  border-radius: 0.35rem;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
}

.ops-explore-domains button.is-active,
.ops-explore-chip.is-active {
  background: rgba(96, 165, 250, 0.28);
}

.ops-explore-search {
  display: flex;
  flex: 1 1 16rem;
  gap: 0.3rem;
  min-width: 12rem;
}

.ops-explore-search input {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 0.35rem;
  border: 1px solid var(--ops-line);
  background: rgba(0, 0, 0, 0.28);
  color: inherit;
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 0.78rem;
}

.ops-explore-hero {
  margin: 0 0 0.75rem;
}

.ops-explore-hero h2 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ops-explore-hero p {
  margin: 0;
  font-size: 0.68rem;
  color: var(--ops-muted);
}

.ops-explore-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.ops-explore-card {
  border: 1px solid var(--ops-line);
  border-radius: 0.4rem;
  padding: 0.55rem 0.65rem;
  background: rgba(0, 0, 0, 0.18);
  min-width: 0;
}

.ops-explore-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ops-muted);
}

.ops-explore-card[data-domain="memory"] h3 { color: #34d399; }
.ops-explore-card[data-domain="codex"] h3 { color: #93c5fd; }

.ops-explore-counts {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ops-explore-empty {
  margin: 0.55rem 0 0;
  font-size: 0.74rem;
  color: var(--ops-muted);
  line-height: 1.4;
}

.ops-explore-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.55rem 0 0.75rem;
}

.ops-explore-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ops-explore-results button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--ops-line);
  background: rgba(0, 0, 0, 0.18);
  color: var(--ops-text);
  border-radius: 0.35rem;
  padding: 0.45rem 0.55rem;
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.ops-explore-results button.is-selected,
.ops-table tr.is-selected {
  outline: 1px solid rgba(96, 165, 250, 0.55);
  background: rgba(37, 99, 235, 0.12);
}

.ops-explore-badge {
  display: inline-block;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.08rem 0.3rem;
  border-radius: 0.22rem;
  margin-right: 0.35rem;
  border: 1px solid transparent;
}

.ops-explore-badge[data-domain="MEMORY"] {
  color: #34d399;
  border-color: color-mix(in srgb, #34d399 40%, transparent);
}

.ops-explore-badge[data-domain="MEANING"] {
  color: #93c5fd;
  border-color: color-mix(in srgb, #93c5fd 40%, transparent);
}

.ops-explore-detail h3 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
}

.ops-explore-detail section {
  margin: 0.65rem 0;
}

.ops-explore-detail h4 {
  margin: 0 0 0.3rem;
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ops-muted);
}

.ops-explore-link {
  border: 0;
  background: none;
  color: #93c5fd;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ops-explore-graph {
  width: 100%;
  height: 16rem;
  border: 1px solid var(--ops-line);
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.22);
  margin-top: 0.5rem;
}

.ops-explore-graph text {
  fill: #dbeafe;
  font-size: 10px;
  font-family: ui-monospace, Consolas, monospace;
}

.ops-explore-graph .center {
  fill: #60a5fa;
}

.ops-explore-graph .neighbour {
  fill: #334155;
  stroke: #93c5fd;
  cursor: pointer;
}

.ops-explore-unresolved {
  border-left: 3px solid #fbbf24;
  padding: 0.4rem 0.55rem;
  background: rgba(120, 53, 15, 0.2);
  font-size: 0.74rem;
  margin: 0.4rem 0;
}

.ops-pane-body,
.ops-inspector-body {
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: auto;
  padding: 0.55rem 0.65rem;
  min-height: 0;
  min-width: 0;
}

.ops-inspector-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.ops-inspector .ops-panel-head {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.ops-inspector:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.8);
  outline-offset: -2px;
}

.ops-drawer-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ops-drawer-close {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: transparent;
  color: var(--ops-text);
  border-radius: 0.35rem;
  width: 1.9rem;
  height: 1.9rem;
  font: inherit;
  cursor: pointer;
}

.ops-drawer-subject {
  margin: 0;
  font-size: 0.68rem;
  color: var(--ops-muted);
  overflow-wrap: anywhere;
}

.ops-inspector-tabs[hidden] {
  display: none;
}

.ops-empty {
  margin: 0;
  color: var(--ops-muted);
  font-size: 0.76rem;
}

.ops-explore-title {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.ops-raw {
  margin: 0;
  font-size: 0.68rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.ops-inspector-body dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ops-inspector-body dl > div {
  display: grid;
  grid-template-columns: minmax(4.5rem, 5.5rem) minmax(0, 1fr);
  gap: 0.35rem;
  font-size: 0.7rem;
  min-width: 0;
}

.ops-inspector-body dt {
  margin: 0;
  color: var(--ops-muted);
  font-weight: 500;
}

.ops-inspector-body dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ops-related {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
}

.ops-related-meta {
  margin-top: 0.15rem;
  font-size: 0.64rem;
  color: var(--ops-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ops-related-event,
.ops-trace-list li,
.ops-history-list button,
.ops-table tr[data-obs],
.ops-system-list button {
  cursor: pointer;
}

.ops-related-event {
  padding: 0.25rem 0.2rem;
  border-radius: 0.25rem;
}

.ops-related-event:hover,
.ops-related-event.is-active,
.ops-trace-list li.is-selected,
.ops-trace-list li:hover,
.ops-table tr.is-selected,
.ops-table tr:hover,
.ops-system-list button.is-active,
.ops-system-list button:hover {
  background: rgba(96, 165, 250, 0.1);
}

.ops-trace-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ops-trace-list li {
  padding: 0.3rem 0.35rem;
  border-radius: 0.28rem;
  border-left: 3px solid var(--kind, #94a3b8);
  font-size: 0.74rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  min-width: 28rem;
}

.ops-table th,
.ops-table td {
  text-align: left;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--ops-line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.ops-table th {
  color: var(--ops-muted);
  font-weight: 500;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ops-history-list,
.ops-system-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ops-history-list button,
.ops-system-list button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--ops-line);
  background: rgba(0, 0, 0, 0.18);
  color: var(--ops-text);
  border-radius: 0.35rem;
  padding: 0.45rem 0.55rem;
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.ops-auth-gate {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.75rem;
  background: rgba(11, 14, 20, 0.82);
  z-index: 5;
}

.ops-auth-gate[hidden] {
  display: none !important;
}

/* A narrow window keeps Chat as the working surface until the workspace is asked for. */
@media (max-width: 960px) {
  .ops-grid:not(.is-workspace) {
    grid-template-columns: minmax(0, 1fr);
  }
  .ops-grid:not(.is-workspace) .ops-splitter,
  .ops-grid:not(.is-workspace) .ops-workspace,
  .ops-grid:not(.is-workspace) .ops-inspector {
    display: none;
  }
}

@media (max-width: 900px) {
  .ops-timeline-head,
  .ops-timeline-item {
    grid-template-columns: 5.5rem 4.2rem 5.5rem minmax(8rem, 1fr) 4rem 3.5rem;
  }
  .ops-timeline-head span:last-child,
  .ops-timeline-item .ops-trace-col {
    display: none;
  }
}

/* COMPANION-WORKBENCH-RESTORE-001 · Turn Analysis */
.ops-why { font-weight: 600; }
.ops-ta-ids { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 0 0 10px; font-size: 12px; }
.ops-ta-ids dt { opacity: 0.65; }
.ops-ta-ids dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.ops-ta-step { margin: 10px 0; }
.ops-ta-row { border-left: 2px solid rgba(148, 163, 184, 0.25); padding: 2px 0 2px 8px; margin: 3px 0; }
.ops-ta-row summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; list-style: none; }
.ops-ta-row summary::-webkit-details-marker { display: none; }
.ops-ta-name { font-weight: 600; font-size: 12px; }
.ops-ta-brief { flex-basis: 100%; font-size: 12px; opacity: 0.8; word-break: break-word; }
.ops-ta-chip { font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; border-radius: 999px; padding: 1px 7px; border: 1px solid currentColor; }
.ops-ta-chip[data-status="captured"] { color: #6ee7b7; }
.ops-ta-chip[data-status="none"] { color: #93c5fd; }
.ops-ta-chip[data-status="not_invoked"] { color: #fbbf24; }
.ops-ta-chip[data-status="not_captured"] { color: #f87171; }
.ops-ta-row[data-status="captured"] { border-left-color: rgba(110, 231, 183, 0.5); }
.ops-ta-row[data-status="none"] { border-left-color: rgba(147, 197, 253, 0.5); }
.ops-ta-row[data-status="not_invoked"] { border-left-color: rgba(251, 191, 36, 0.5); }
.ops-ta-row[data-status="not_captured"] { border-left-color: rgba(248, 113, 113, 0.5); }
.ops-ta-raw { font-size: 11px; max-height: 260px; overflow: auto; background: rgba(15, 23, 42, 0.6); padding: 6px; border-radius: 6px; white-space: pre-wrap; word-break: break-word; }
.ops-ta-supplied { max-height: 420px; border-left: 2px solid rgba(125, 211, 252, 0.5); }

/* COMPANION-TURN-JOURNEY-001 · one turn, from your message to Arya's reply */
.tj-body { padding: 0.9rem 1.1rem 1.4rem; }
.tj { max-width: 62rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1.1rem; }
.tj-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.tj-heading { min-width: 0; flex: 1 1 18rem; }
.tj-title { margin: 0.2rem 0 0.25rem; font-size: 1.15rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.tj-sub { margin: 0; font-size: 0.78rem; color: var(--ops-muted); font-variant-numeric: tabular-nums; }
.tj-head-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
/* Which moment the turn belongs to. An earlier turn is marked so its path is not read as today's. */
.tj-era {
  margin: 0.45rem 0 0;
  padding: 0.35rem 0.6rem;
  border-left: 3px solid var(--tj-era, #7dd3fc);
  border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--tj-era, #7dd3fc) 8%, transparent);
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--ops-muted);
}
.tj-era[data-era="earlier"] { --tj-era: #fcd34d; }
.tj-era-head { display: block; color: var(--ops-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.tj-era-detail { display: block; overflow-wrap: anywhere; }
.tj-button {
  border: 1px solid rgba(96, 165, 250, 0.45);
  background: rgba(37, 99, 235, 0.18);
  color: var(--ops-text);
  border-radius: 0.4rem;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.tj-button:hover { background: rgba(37, 99, 235, 0.3); }

.tj [data-state="completed"] { --tj: #6ee7b7; }
.tj [data-state="failed"] { --tj: #fca5a5; }
.tj [data-state="not_part"] { --tj: #cbd5e1; }
.tj [data-state="no_evidence"] { --tj: #fcd34d; }
.tj-chip {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  color: var(--tj, var(--ops-text));
  border: 1px solid color-mix(in srgb, var(--tj, #94a3b8) 60%, transparent);
  background: color-mix(in srgb, var(--tj, #94a3b8) 10%, transparent);
  white-space: nowrap;
}
.tj-chip[data-state="not_part"],
.tj-chip[data-state="no_evidence"] { border-style: dashed; }

/* At a glance: seven nodes. A solid link is drawn only between two stages that both recorded evidence. */
.tj-glance { list-style: none; margin: 0; padding: 0.2rem 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tj-glance-item { position: relative; display: flex; justify-content: center; }
.tj-glance-link { position: absolute; top: 0.95rem; right: 50%; width: 100%; height: 0; border-top: 2px dashed rgba(148, 163, 184, 0.35); }
.tj-glance-link[data-observed="true"] { border-top: 2px solid rgba(110, 231, 183, 0.65); }
.tj-glance-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 0;
  color: var(--ops-text);
  font: inherit;
  cursor: pointer;
  padding: 0.2rem 0.15rem;
  border-radius: 0.4rem;
  min-width: 0;
}
.tj-glance-node[aria-pressed="true"] .tj-glance-label { color: #bfdbfe; font-weight: 600; }
.tj-glance-label { font-size: 0.74rem; text-align: center; overflow-wrap: anywhere; }
.tj-dot, .tj-node {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  box-sizing: border-box;
  background: #121821;
  border: 2px solid var(--tj);
}
.tj [data-state="completed"] .tj-dot,
.tj [data-state="completed"] .tj-node { background: var(--tj); box-shadow: 0 0 10px color-mix(in srgb, var(--tj) 45%, transparent); }
.tj [data-state="failed"] .tj-dot,
.tj [data-state="failed"] .tj-node { background: var(--tj); border-radius: 0.2rem; transform: rotate(45deg) scale(0.85); }
.tj [data-state="not_part"] .tj-dot,
.tj [data-state="not_part"] .tj-node { border-style: dashed; opacity: 0.8; }
.tj [data-state="no_evidence"] .tj-dot,
.tj [data-state="no_evidence"] .tj-node { border-style: dotted; }

/* The flow: one card per stage on a vertical rail. */
.tj-flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tj-stage { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 0.75rem; }
.tj-rail { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 0.95rem; }
.tj-node { flex: 0 0 auto; }
.tj-link { flex: 1 1 auto; width: 0; margin: 0.25rem 0 -0.95rem; border-left: 2px dashed rgba(148, 163, 184, 0.35); }
.tj-link[data-observed="true"] { border-left: 2px solid rgba(110, 231, 183, 0.55); }
.tj-card {
  margin: 0 0 0.7rem;
  border: 1px solid var(--ops-line);
  border-left: 3px solid color-mix(in srgb, var(--tj) 70%, transparent);
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.18);
  padding: 0.55rem 0.8rem 0.65rem;
  min-width: 0;
}
.tj-stage[data-state="not_part"] .tj-card,
.tj-stage[data-state="no_evidence"] .tj-card { border-left-style: dashed; background: rgba(0, 0, 0, 0.1); }
.tj-stage.is-selected .tj-card { border-color: rgba(96, 165, 250, 0.6); box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35); background: rgba(37, 99, 235, 0.08); }
.tj-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.7rem;
  width: 100%;
  background: none;
  border: 0;
  padding: 0.15rem 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 0.3rem;
}
.tj-name { font-size: 0.98rem; font-weight: 600; }
.tj-time { margin-left: auto; font-size: 0.74rem; color: var(--ops-muted); font-variant-numeric: tabular-nums; }
.tj-claims { list-style: none; margin: 0.35rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.tj-claim {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0.18rem 0.3rem;
  margin: 0 -0.3rem;
  color: #d5deea;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.45;
  border-radius: 0.3rem;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.tj-claim-row.is-headline .tj-claim { font-size: 0.98rem; color: var(--ops-text); }
.tj-claim[data-status="not_captured"],
.tj-claim[data-status="not_invoked"] { color: #aebbcc; font-style: italic; }
.tj-claim[data-status="failed"] { color: #fecaca; font-weight: 600; }
.tj-claim:hover, .tj-card-head:hover { background: rgba(96, 165, 250, 0.1); }
.tj-missing { margin: 0.4rem 0 0; font-size: 0.74rem; color: #aebbcc; }

.tj-writes-title { margin: 0 0 0.5rem; font-size: 0.9rem; font-weight: 600; }
.tj-writes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.6rem; }
.tj-write {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--tj) 45%, transparent);
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.18);
  color: var(--ops-text);
  font: inherit;
  cursor: pointer;
}
.tj-write[data-state="not_part"],
.tj-write[data-state="no_evidence"] { border-style: dashed; background: rgba(0, 0, 0, 0.08); }
.tj-write-label { font-weight: 600; font-size: 0.86rem; }
.tj-write-text { font-size: 0.82rem; line-height: 1.4; color: #d5deea; }

.tj-legend { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 0.7rem; margin: 0; font-size: 0.76rem; color: #aebbcc; border-top: 1px solid var(--ops-line); padding-top: 0.8rem; }
.tj-legend dd { margin: 0; align-self: center; }

.tj-empty { max-width: 34rem; margin: 3rem auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.tj-empty-title { margin: 0; font-size: 1.1rem; font-weight: 600; }
.tj-empty-text { margin: 0; font-size: 0.88rem; line-height: 1.5; color: #aebbcc; }

.tj button:focus-visible,
.ops-journey-select:focus-visible,
.ops-drawer-close:focus-visible,
.tj-event summary:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }

.ops-bubble.is-journey { box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.55); }
.ops-bubble[data-correlation-id] { cursor: pointer; }
.ops-journey-select[aria-pressed="true"] { border-color: rgba(96, 165, 250, 0.8); background: rgba(37, 99, 235, 0.28); }

/* Evidence drawer contents */
.tj-evidence { margin: 0.6rem 0; padding: 0.45rem 0.55rem; border: 1px solid var(--ops-line); border-radius: 0.45rem; }
.tj-evidence.is-focused { border-color: rgba(96, 165, 250, 0.7); background: rgba(37, 99, 235, 0.08); }
.tj-evidence-head { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: baseline; }
.tj-evidence-name { font-weight: 600; font-size: 0.8rem; }
.tj-evidence-source { margin: 0.2rem 0; font-size: 0.68rem; color: var(--ops-muted); overflow-wrap: anywhere; }
.tj-evidence-events { margin-top: 0.8rem; }
.tj-events { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.tj-event { border-left: 3px solid rgba(148, 163, 184, 0.4); padding-left: 0.45rem; }
.tj-event[data-status="ok"] { border-left-color: rgba(110, 231, 183, 0.55); }
.tj-event[data-status="error"] { border-left-color: rgba(252, 165, 165, 0.75); }
.tj-event.is-focused { background: rgba(37, 99, 235, 0.1); }
.tj-event summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; font-size: 0.72rem; }
.tj-event-time { color: var(--ops-muted); }
.tj-event-stage { font-weight: 600; }
.tj-event-op { color: #d5deea; }
.tj-event-id { flex-basis: 100%; color: var(--ops-muted); font-size: 0.66rem; overflow-wrap: anywhere; }

@media (max-width: 720px) {
  .tj-glance { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 0.6rem; }
  .tj-glance-link { display: none; }
  .tj-time { margin-left: 0; flex-basis: 100%; }
}
