/* SPEC: PJ2026-010401 Web工作台; PJ2026-010405 云端控制台. */
/* Responsibility: Workbench-only layout, projection, trace and composer styling. */

.workbench-grid {
  display: grid;
  min-height: 0;
  height: 100%;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}

.workbench-center,
.session-rail,
.hwpod-panel,
.caserun-panel,
.message-card {
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: white;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

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

.workbench-center.has-launch-context {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.workbench-context-strip {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid #d8e1eb;
  color: #334155;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
}

.workbench-context-strip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-rail,
.hwpod-panel,
.caserun-panel {
  position: relative;
  display: grid;
  height: 100%;
  min-height: 0;
  min-width: 0;
  align-content: start;
  gap: 8px;
  padding: 10px;
  overflow: hidden;
}

.session-rail {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.session-rail-header-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.session-detail-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.session-collapse-toggle {
  min-width: 30px;
  padding: 0 8px;
  font-size: 16px;
  line-height: 1;
}

.session-rail.is-collapsed {
  width: 48px !important;
  grid-template-rows: auto;
  justify-items: center;
  padding: 8px;
}

.session-rail.is-collapsed .panel-header.compact {
  width: 100%;
  justify-content: center;
}

.session-rail.is-collapsed .session-rail-header-actions {
  width: 100%;
  justify-content: center;
}

.hwpod-panel {
  align-content: stretch;
  grid-template-rows: auto minmax(220px, 1fr);
  overflow: auto;
  overscroll-behavior: contain;
}

.caserun-panel {
  align-content: stretch;
  grid-template-rows: auto auto auto minmax(96px, 1fr) auto;
  overflow: hidden;
  overscroll-behavior: contain;
}

.caserun-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: end;
}

.caserun-controls label {
  grid-column: 1 / -1;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.caserun-controls select {
  min-width: 0;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  padding: 0 8px;
  color: #0f172a;
  font-size: 12px;
}

.caserun-controls button {
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 12px;
  font-weight: 750;
}

.caserun-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.caserun-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.caserun-meta div,
.caserun-aggregate {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  padding: 7px 8px;
}

.caserun-meta dt {
  color: #64748b;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.caserun-meta dd {
  margin: 2px 0 0;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caserun-event-panel {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
}

.caserun-event-panel header,
.caserun-aggregate {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.caserun-event-panel header {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.caserun-event-panel pre {
  min-height: 0;
  margin: 0;
  overflow: auto;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  background: #eff6ff;
  padding: 8px;
  color: #1e3a8a;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.caserun-aggregate {
  color: #334155;
  font-size: 11px;
}

.caserun-aggregate strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
}

.session-list {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 6px;
  grid-auto-rows: max-content;
  overflow: auto;
}

.session-list[data-loading="true"] {
  overflow: auto;
}

.session-list-refreshing {
  width: 100%;
  min-height: 32px;
  justify-content: flex-start;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  background: #f0f9ff;
  padding: 6px 9px;
}

.conversation-panel {
  display: flex;
  min-height: 0;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  overflow-x: hidden;
  overflow-y: auto;
}

.session-tab {
  position: relative;
  display: flex;
  align-self: start;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  width: 100%;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  padding: 7px 9px;
  color: #334155;
  text-align: left;
  overflow: hidden;
}

.session-tab > * {
  position: relative;
  z-index: 1;
}

.session-tab[data-active="true"] {
  border-color: #38bdf8;
  background: #f0f9ff;
}

.session-tab[data-running="true"]::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 3px;
  left: 8px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(8, 145, 178, 0), rgba(8, 145, 178, 0.82), rgba(8, 145, 178, 0));
  background-size: 220% 100%;
  opacity: 0.82;
  pointer-events: none;
  animation: session-tab-running 1100ms linear infinite;
}

.session-tab[data-projection-health="degraded"],
.session-tab[data-projection-health="stalled"],
.session-tab[data-projection-health="unavailable"] {
  border-color: #f59e0b;
  background: #fffbeb;
}

@keyframes session-tab-running {
  from { background-position: 220% 0; }
  to { background-position: -220% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .session-tab[data-running="true"]::after {
    animation: none;
  }
}

.session-tab-title {
  min-width: 0;
  flex: 1 1 auto;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-tab-diagnostic {
  flex: 0 0 auto;
  max-width: 88px;
  border-radius: 4px;
  background: #fef3c7;
  padding: 2px 5px;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-tab-time {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.session-list-footer {
  display: grid;
  gap: 6px;
  padding: 2px 0 6px;
}

.session-load-more {
  width: 100%;
  justify-content: center;
}

.session-list-terminal,
.session-list-error {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.session-list-error {
  color: #b91c1c;
}

.muted-box {
  color: #64748b;
  font-size: 12px;
}

.muted-box,
.empty-state {
  padding: 14px;
}

.conversation-panel {
  padding: 8px;
  scroll-behavior: auto;
}

.conversation-panel[data-following="true"],
.trace-timeline[data-following="true"] ol,
.trace-raw-list[data-following="true"] {
  overflow-anchor: none;
}

.conversation-empty-hint {
  align-self: center;
  margin-top: 24px;
  color: #64748b;
  font-size: 13px;
}

.conversation-detail-loading {
  align-self: center;
  margin: auto;
}

.conversation-error-hint {
  color: #b91c1c;
}

.message-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: max-content;
  flex: 0 0 auto;
  flex-direction: column;
  align-self: stretch;
  gap: 5px;
  border-radius: 4px;
  padding: 8px;
  overflow: visible;
}

.message-card[data-role="agent"] {
  align-self: stretch;
  width: 100%;
}

.message-card[data-role="agent"][data-status="pending"],
.message-card[data-role="agent"][data-status="running"] {
  border-color: #7dd3fc;
  background:
    linear-gradient(90deg, transparent, #0891b2, #22c55e, transparent) no-repeat -180px 0 / 180px 2px,
    linear-gradient(180deg, #ffffff 0%, #f8fdff 100%);
  animation: agent-run-scan 1.6s ease-in-out infinite;
}

.message-card[data-role="user"] {
  align-self: flex-end;
  width: max-content;
  min-width: min(120px, 100%);
  max-width: min(720px, 100%);
  margin-left: auto;
  border-color: #bfdbfe;
  background: #eff6ff;
  padding: 8px 10px;
  box-shadow: none;
}

.message-card[data-role="user"] .message-text {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.4;
}

.message-meta-footer,
.trace-timeline header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.message-meta-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 6px;
  border-top: 1px solid #e2e8f0;
  padding-top: 6px;
}

.message-timing-meta {
  display: inline-flex;
  min-width: 64px;
  flex: 0 0 auto;
  align-items: center;
  color: #64748b;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.25;
}

.message-duration-meta,
.message-activity-meta {
  white-space: nowrap;
}

.message-activity-meta {
  display: inline-flex;
  min-width: 0;
  overflow: hidden;
  flex: 0 1 auto;
  justify-content: flex-start;
  color: #475569;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.message-activity-group {
  display: inline-flex;
  min-width: 0;
  overflow: hidden;
  align-items: center;
  justify-self: start;
  gap: 4px;
}

.message-header-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-self: end;
  gap: 8px;
  white-space: nowrap;
}

.message-detail-button {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: white;
  color: #475569;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.agent-running-indicator {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
}

.agent-running-indicator span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #bae6fd;
  border-top-color: #0891b2;
  animation: workbench-spin 0.8s linear infinite;
}

.message-text,
.message-markdown {
  margin: 0;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.55;
}

.message-loading {
  align-self: flex-start;
  border-radius: 3px;
  padding: 6px 0;
}

.projection-diagnostic {
  align-self: flex-start;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  background: #fffbeb;
  padding: 7px 8px;
  color: #92400e;
}

.message-markdown {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.message-markdown > * {
  margin: 0;
}

.message-markdown ul,
.message-markdown ol {
  display: grid;
  gap: 4px;
  padding-left: 20px;
}

.message-markdown code {
  border-radius: 3px;
  background: rgba(175, 184, 193, 0.2);
  color: #24292f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 85%;
}

.message-markdown pre {
  max-width: 100%;
  overflow: auto;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #f6f8fa;
  color: #24292f;
  padding: 10px;
}

.message-markdown code {
  padding: 2px 4px;
}

.message-markdown pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 100%;
}

.message-markdown table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  border-spacing: 0;
  line-height: 1.45;
}

.message-markdown th,
.message-markdown td {
  border: 1px solid #d0d7de;
  padding: 6px 13px;
  color: #24292f;
  text-align: left;
}

.message-markdown th {
  background: #f6f8fa;
  font-weight: 700;
}

.message-markdown tr {
  background: white;
}

.message-markdown tr:nth-child(2n) {
  background: #f6f8fa;
}

.message-markdown a {
  color: #0e7490;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.trace-timeline {
  display: grid;
  gap: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  background: #f8fafc;
  padding: 4px;
}

.trace-disclosure {
  display: grid;
  gap: 5px;
}

.trace-disclosure summary::-webkit-details-marker,
.trace-tool-details summary::-webkit-details-marker {
  display: none;
}

.trace-disclosure-summary {
  display: inline-flex;
  width: max-content;
  min-height: 22px;
  align-items: center;
  gap: 5px;
  border: 1px solid #d8e1eb;
  border-radius: 3px;
  background: white;
  color: #475569;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  list-style: none;
  padding: 2px 6px;
}

.trace-disclosure-caret {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #0f766e;
  transition: transform 120ms ease;
}

.trace-disclosure[open] > .trace-disclosure-summary .trace-disclosure-caret {
  transform: rotate(90deg);
}

.trace-disclosure-label {
  line-height: 1;
}

.trace-disclosure-count {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.trace-disclosure-body {
  display: grid;
  gap: 5px;
}

.trace-meta-panel {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  background: white;
  padding: 6px;
}

.trace-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 4px 8px;
  margin: 0;
}

.trace-meta-grid div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.trace-meta-grid dt {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.trace-meta-grid dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.trace-meta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.message-trace-debug-panel {
  display: grid;
  gap: 8px;
}

.trace-raw-list {
  display: grid;
  max-height: min(340px, 42vh);
  gap: 4px;
  margin: 0;
  overflow: auto;
  padding: 0;
  scroll-behavior: auto;
  list-style: none;
}

.trace-raw-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  border-top: 1px solid #e2e8f0;
  padding: 5px 0 0;
  color: #475569;
  font-size: 12px;
}

.trace-raw-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.trace-raw-list li span,
.trace-raw-list li small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.trace-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trace-summary-chip {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  border: 1px solid #d8e1eb;
  border-radius: 3px;
  background: white;
  color: #334155;
  padding: 4px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.trace-summary-chip b {
  color: #64748b;
  font-family: inherit;
  text-transform: uppercase;
}

.trace-id {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-id {
  max-width: 220px;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.trace-warning,
.trace-empty {
  margin: 0;
  border-radius: 3px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.45;
}

.trace-warning {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.trace-window-notice {
  margin: 0;
  border: 1px solid #d8e1eb;
  border-radius: 3px;
  background: white;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  padding: 5px 7px;
}

.trace-empty {
  border: 1px solid #d8e1eb;
  background: white;
  color: #64748b;
}

.trace-timeline[data-projection-health="degraded"] .trace-empty,
.trace-timeline[data-projection-health="stalled"] .trace-empty,
.trace-timeline[data-projection-health="unavailable"] .trace-empty {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.trace-timeline ol {
  display: grid;
  max-height: 320px;
  gap: 4px;
  margin: 0;
  overflow: auto;
  padding: 0;
  scroll-behavior: auto;
  list-style: none;
}

.trace-tool-details {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.trace-tool-details > summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.trace-tool-details > summary::before {
  width: 0;
  height: 0;
  flex: 0 0 auto;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #64748b;
  content: "";
  transition: transform 120ms ease;
}

.trace-tool-details[open] > summary::before {
  transform: rotate(90deg);
}

.trace-tool-details > summary code {
  min-width: 0;
  max-width: 42%;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-tool-command-preview {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: #334155;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-timeline li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  border-top: 1px solid #e2e8f0;
  padding: 5px 0 0;
  color: #475569;
  font-size: 12px;
}

.trace-timeline li:first-child {
  border-top: 0;
  padding-top: 0;
}

.trace-timeline li[data-terminal="true"] {
  border-left: 3px solid #22c55e;
  padding-left: 8px;
}

.trace-render-row .trace-row-body {
  width: 100%;
  min-width: 0;
  margin: 0;
  white-space: pre-wrap;
}

.trace-render-row .trace-row-markdown {
  display: grid;
  gap: 6px;
  white-space: normal;
}

.trace-render-row .muted {
  color: #94a3b8;
}

.trace-render-row pre.trace-row-body {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #d8e1eb;
  border-radius: 3px;
  background: white;
  color: #334155;
  padding: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}

.trace-timeline li span,
.trace-timeline li small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
}

.message-actions a {
  text-decoration: none;
}

.message-action-status {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.code-agent-status-summary {
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #f8fafc;
}

.code-agent-status-summary summary {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.code-agent-status-summary dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid #d8e1eb;
}

.code-agent-error-summary {
  display: grid;
  gap: 4px;
  border-top: 1px solid #d8e1eb;
  background: #fff7ed;
  padding: 9px 10px;
  color: #7c2d12;
}

.code-agent-error-summary strong {
  font-size: 12px;
  font-weight: 800;
}

.code-agent-error-summary p {
  margin: 0;
  overflow-wrap: anywhere;
  color: #7f1d1d;
  font-size: 12px;
  line-height: 1.45;
}

.code-agent-status-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding: 7px 10px;
  font-size: 12px;
}

.code-agent-status-row dt,
.code-agent-status-row dd {
  min-width: 0;
  margin: 0;
}

.code-agent-status-row dt {
  color: #64748b;
  font-weight: 700;
}

.code-agent-status-row dd {
  overflow-wrap: anywhere;
  color: #1f2937;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.trace-timeline code,
.mini-log,
.json-panel,
.help-body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.trace-timeline code {
  min-width: 0;
  overflow-wrap: anywhere;
}

@keyframes agent-run-scan {
  0% { background-position: -180px 0, 0 0; }
  55%, 100% { background-position: calc(100% + 180px) 0, 0 0; }
}

.command-composer {
  display: grid;
  gap: 10px;
  border-top: 1px solid #d8e1eb;
  padding: 12px;
}

.composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.composer-field {
  display: grid;
  min-width: min(260px, 100%);
  gap: 4px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.composer-field select {
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  padding: 0 10px;
  color: #0f172a;
}

.command-composer textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
}

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.composer-warning {
  margin-right: auto;
  color: #b45309;
  font-size: 13px;
}

.composer-mode {
  margin-right: auto;
  color: #0e7490;
  font-size: 13px;
  font-weight: 700;
}

.composer-mode[data-mode="steer"] {
  color: #7c2d12;
}

.drafts-list {
  display: grid;
  gap: 8px;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.drafts-list-head,
.session-rail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drafts-list-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.draft-chip {
  max-width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  padding: 6px 8px;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  text-align: left;
}

.session-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.session-detail-grid div {
  min-width: 0;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
}

.session-detail-grid dt {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.session-detail-grid dd {
  margin: 3px 0 0;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.session-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
}

.session-resize-handle {
  position: absolute;
  top: 0;
  right: -7px;
  width: 12px;
  height: 100%;
  cursor: col-resize;
}

.session-resize-handle:focus-visible {
  outline: 2px solid #0891b2;
  outline-offset: -2px;
}

.session-rail.is-resizing {
  user-select: none;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.evidence-grid span {
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 7px 8px;
  color: #334155;
  font-size: 11px;
  font-weight: 750;
}

.hwpod-panel-actions {
  display: inline-flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.hwpod-diagnostics-button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: white;
  color: #0c4a6e;
  font-size: 13px;
  font-weight: 900;
}

.hwpod-node-status,
.hwpod-event-panel {
  display: grid;
  min-height: 0;
  gap: 10px;
}

.hwpod-node-status {
  overflow: auto;
}

.hwpod-event-panel {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.hwpod-node-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.summary-tile {
  display: grid;
  min-width: 0;
  gap: 4px;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px;
  color: #334155;
  text-align: left;
}

.summary-tile span,
.summary-tile strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-tile span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-tile strong {
  color: #0f172a;
  font-size: 13px;
}

.hwpod-node-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.hwpod-node-meta div {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid #e2e8f0;
  padding: 7px 8px;
  background: #f8fafc;
}

.hwpod-node-meta dt,
.hwpod-node-meta dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.hwpod-node-meta dt {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.hwpod-node-meta dd {
  color: #0f172a;
  font-size: 12px;
}

.hwpod-errors li {
  display: grid;
  gap: 4px;
  color: #475569;
  font-size: 12px;
}

.hwpod-errors code {
  color: #991b1b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.hwpod-event-panel header button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: #334155;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 750;
}

.hwpod-event-panel header div {
  display: flex;
  gap: 6px;
}

.hwpod-event-scroll {
  min-height: 0;
  overflow: auto;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
}

.hwpod-event-scroll pre,
#hwpod-detail-body {
  margin: 0;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .workbench-route {
    min-height: calc(100dvh - 102px);
    overflow: auto;
  }

  .workbench-grid,
  .session-rail,
  .workbench-center,
  .hwpod-panel,
  .caserun-panel {
    min-height: 0;
  }

  .hwpod-event-scroll {
    max-height: 260px;
  }
}

@media (max-width: 720px) {
  .workbench-route,
  .workbench-grid,
  .workbench-center {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .workbench-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .hwpod-panel,
  .caserun-panel {
    display: none;
  }

  .session-rail {
    display: grid;
    width: 100% !important;
    max-height: 184px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: stretch;
    overflow: hidden;
  }

  .session-rail.is-collapsed {
    width: 100% !important;
    max-height: 44px;
    grid-template-rows: auto;
    justify-items: stretch;
  }

  .session-rail .panel-header.compact {
    min-height: 34px;
  }

  .session-rail .panel-header.compact .page-eyebrow,
  .session-rail .session-resize-handle {
    display: none;
  }

  .session-rail.is-collapsed .panel-header.compact {
    justify-content: flex-end;
  }

  .session-rail .session-rail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 0 12px 10px;
  }

  .session-rail .session-rail-actions .btn {
    min-width: 44px;
    min-height: 28px;
    padding: 0 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  .session-rail .panel-header.compact h2 {
    font-size: 14px;
  }

  #session-create {
    min-width: 56px;
    min-height: 32px;
  }

  .session-list {
    max-height: 78px;
  }

  .command-composer {
    gap: 8px;
    padding: 10px;
  }

  .composer-toolbar {
    gap: 6px;
  }

  .composer-field {
    min-width: 100%;
  }

  .command-composer textarea {
    min-height: 72px;
  }
}
