:root {
  font-family: Inter, "Segoe UI", sans-serif;
  color: #dbe7fb;
  background: #020617;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  overflow: hidden;
  background: #0a0e1a;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea {
  border-radius: 12px;
  border: 1px solid #334155;
  background: rgba(8, 15, 30, 0.9);
  color: #e2e8f0;
  padding: 10px 12px;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

button {
  cursor: pointer;
  background: #2563eb;
  border-color: transparent;
  box-shadow: none;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.7);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(360px, 3fr);
  height: 100dvh;
  overflow: hidden;
}

.viewer-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: #070a12;
}

.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 24px 10px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  backdrop-filter: blur(10px);
}

.viewer-header h1,
.card h2 {
  margin: 0 0 8px;
}

.viewer-header h1 {
  font-size: 22px;
  line-height: 1.08;
  letter-spacing: 0;
}

.viewer-header p {
  margin: 0;
  max-width: 760px;
  color: #93a4c3;
  line-height: 1.55;
}

.runtime-pill {
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cfe4ff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.viewer-heading {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.viewer-header-status {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.viewer-header-status span {
  max-width: min(360px, 42vw);
  overflow: hidden;
  padding: 4px 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.54);
  color: #b7c7df;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

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

.runtime-note {
  color: #9eb1cf;
  font-size: 11px;
  text-align: right;
  max-width: 360px;
}

.ghost-button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  box-shadow: none;
}

.ghost-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

.viewer-canvas {
  position: absolute;
  inset: 0;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.viewer-canvas-shell {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.viewer-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.viewer-overlay {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(71, 85, 105, 0.45);
  background: rgba(6, 12, 24, 0.88);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.viewer-overlay strong {
  font-size: 14px;
}

.viewer-overlay span {
  color: #bdd0ec;
  line-height: 1.5;
  font-size: 12px;
}

.viewer-overlay.state-loading {
  border-color: rgba(56, 189, 248, 0.42);
}

.viewer-overlay.state-error {
  border-color: rgba(248, 113, 113, 0.5);
}

.viewer-face-tooltip {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(6, 12, 24, 0.92);
  backdrop-filter: blur(10px);
  pointer-events: none;
  max-width: 320px;
  animation: tooltipIn 0.18s ease-out;
}

@keyframes tooltipIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.viewer-face-tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.viewer-face-tooltip-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.viewer-face-tooltip strong {
  font-size: 13px;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.viewer-face-tooltip-label {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
}

.viewer-face-tooltip-roles {
  font-size: 11px;
  color: #94a3b8;
}

.viewer-face-tooltip small {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}

.viewer-face-tooltip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  pointer-events: auto;
}

.viewer-face-action-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  cursor: pointer;
  transition: background 0.15s ease;
}

.viewer-face-action-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.22);
}

.viewer-face-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.viewer-face-action-btn.secondary {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
}

.viewer-face-action-btn.secondary:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.2);
}

.viewer-face-multisel {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.4);
  background: rgba(6, 12, 24, 0.92);
  backdrop-filter: blur(10px);
  max-width: 260px;
  max-height: 220px;
  animation: tooltipIn 0.18s ease-out;
}

.viewer-face-multisel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.viewer-face-multisel-header strong {
  font-size: 12px;
  color: #e2e8f0;
}

.viewer-face-multisel-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.viewer-face-multisel-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.viewer-face-multisel-item code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #cbd5e1;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-face-multisel-badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.18);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.25);
  flex-shrink: 0;
}

.viewer-face-multisel-use {
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.viewer-face-multisel-use:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
}

.side-pane {
  overflow: auto;
  min-height: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(11, 21, 42, 0.96), rgba(6, 10, 21, 0.98));
}

.control-pane-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 4px;
  background:
    linear-gradient(180deg, rgba(11, 21, 42, 0.98), rgba(11, 21, 42, 0.86));
  backdrop-filter: blur(12px);
}

.control-pane-header div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.control-pane-header strong {
  color: #f3f8ff;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.control-pane-kicker {
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compact-button {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 10px;
}

.control-pane-tabs {
  position: sticky;
  top: 48px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.86);
  backdrop-filter: blur(12px);
}

.control-pane-tab {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  text-align: left;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.control-pane-tab:hover:not(:disabled) {
  transform: none;
  background: rgba(15, 23, 42, 0.8);
}

.control-pane-tab.active {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(14, 116, 144, 0.2);
}

.control-pane-tab strong {
  color: #eef6ff;
  font-size: 13px;
}

.control-pane-tab span {
  color: #8ea4c5;
  font-size: 11px;
  line-height: 1.25;
}

.control-status-banner {
  margin: 0;
}

.llm-readiness-pill {
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(71, 85, 105, 0.4);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.llm-readiness-pill.ready {
  color: #ccfbf1;
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(13, 148, 136, 0.14);
}

.llm-readiness-pill.degraded {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(120, 53, 15, 0.18);
}

.llm-template-panel {
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid rgba(71, 85, 105, 0.34);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.28);
}

.llm-template-select {
  min-width: 0;
}

/* ── Form field inputs (settings drawer) ──────────────────────────────────── */
.form-field input,
.form-field select {
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid rgba(71, 85, 105, 0.5);
  background: rgba(3, 7, 18, 0.4);
  color: #e2e8f0;
  outline: none;
  transition: border-color 0.15s;
}
.form-field input:focus,
.form-field select:focus {
  border-color: rgba(45, 212, 191, 0.6);
}
.form-field input::placeholder {
  color: rgba(148, 163, 184, 0.5);
}

/* ── Direct API key input ─────────────────────────────────────────────────── */
.api-key-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.api-key-input-row input[type="password"] {
  flex: 1;
  font-family: monospace;
}
.api-key-clear {
  white-space: nowrap;
  font-size: 12px;
}
.api-key-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.7);
  line-height: 1.4;
}
.api-key-hint code {
  font-family: monospace;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
}
.api-key-hint-ok {
  color: rgba(52, 211, 153, 0.85);
}

.llm-config-grid {
  margin-bottom: 12px;
}

.llm-facts-grid,
.llm-console-facts {
  margin-top: 0;
}

.llm-summary-note {
  margin-top: 2px;
}

.llm-inline-note {
  margin: 0;
}

.drawer-section {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(71, 85, 105, 0.35);
  background: rgba(3, 7, 18, 0.32);
}

.drawer-section + .drawer-section {
  margin-top: 14px;
}

.drawer-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.drawer-section-heading h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.drawer-section-heading p {
  margin: 0;
  color: #91a3c2;
  line-height: 1.45;
  font-size: 12px;
}

.card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px;
}

.card h2 {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.inline-form,
.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form input,
.action-row button {
  flex: 1 1 140px;
}

textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.45;
}

input[type="file"] {
  width: 100%;
  background: rgba(2, 6, 23, 0.72);
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}

.project-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(10, 16, 30, 0.98), rgba(15, 23, 42, 0.98));
}

.project-item strong {
  font-size: 14px;
}

.project-item span {
  color: #8fb6e9;
  font-size: 12px;
  white-space: nowrap;
}

.project-item.active {
  outline: 2px solid rgba(56, 189, 248, 0.9);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.json-block {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(51, 65, 85, 0.5);
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.98), rgba(7, 12, 25, 0.98));
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.card + .card {
  scroll-margin-top: 24px;
}

.side-pane::-webkit-scrollbar,
.json-block::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.side-pane::-webkit-scrollbar-thumb,
.json-block::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(71, 85, 105, 0.8);
}

.side-pane::-webkit-scrollbar-track,
.json-block::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 1280px) {
  .viewer-header {
    padding-inline: 20px;
  }

  .side-pane {
    padding: 14px;
  }

  .control-pane-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .viewer-pane {
    min-height: 52vh;
    border-right: 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  }

  .control-pane-header,
  .control-pane-tabs {
    position: static;
  }

  .viewer-header {
    flex-direction: column;
    align-items: stretch;
  }

  .runtime-pill {
    align-self: flex-start;
  }
}

.workbench-shell {
  background: #020617;
}

.viewer-toolbar,
.viewer-insights,
.semantic-overview,
.project-metadata {
  display: grid;
  gap: 12px;
}

.viewer-toolbar,
.viewer-insights {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 8px 24px 10px;
}

.viewer-toolbar-block,
.insight-card,
.project-metadata div,
.semantic-overview div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(71, 85, 105, 0.35);
  background: rgba(5, 10, 22, 0.72);
}

.viewer-toolbar .viewer-toolbar-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.viewer-toolbar .viewer-toolbar-block strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-toolbar-label,
.insight-card span,
.project-metadata span,
.semantic-overview span {
  color: #7f94b3;
  font-size: 12px;
}

.viewer-toolbar-block strong,
.insight-card strong,
.project-metadata strong,
.semantic-overview strong {
  font-size: 14px;
  color: #eef4ff;
}


/* Product-mode viewer summary: keep engineering internals available but folded. */
.viewer-summary-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin: 0 24px 12px;
  padding: 14px 16px;
  border: 1px solid rgba(71, 85, 105, 0.28);
  border-radius: 18px;
  background: rgba(5, 10, 22, 0.62);
}

.viewer-summary-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.viewer-summary-main strong {
  overflow: hidden;
  color: #eef4ff;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-summary-main small {
  color: #8da2c0;
  font-size: 12px;
}

.viewer-summary-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.viewer-summary-status span,
.viewer-technical-details summary {
  padding: 5px 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.74);
  font-size: 11px;
  font-weight: 800;
}

.viewer-technical-details {
  grid-column: 1 / -1;
}

.viewer-technical-details summary {
  display: inline-flex;
  cursor: pointer;
}

.viewer-technical-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.viewer-technical-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(71, 85, 105, 0.24);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.45);
}

.viewer-technical-grid span {
  color: #7f94b3;
  font-size: 11px;
  text-transform: uppercase;
}

.viewer-technical-grid strong {
  overflow: hidden;
  color: #eef4ff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .viewer-summary-strip {
    grid-template-columns: 1fr;
  }

  .viewer-summary-status {
    justify-content: flex-start;
  }

  .viewer-technical-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.viewer-stage-shell {
  flex: 1;
  min-height: 0;
  margin: 0 24px;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(71, 85, 105, 0.28);
  background: linear-gradient(180deg, rgba(3, 7, 18, 0.6), rgba(3, 7, 18, 0.2));
}

.viewer-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.35);
}

.viewer-stage-head div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.viewer-stage-head span {
  color: #90a0bc;
  font-size: 13px;
}

.viewer-stage-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(14, 116, 144, 0.18);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #d8fbff;
  font-size: 12px;
  white-space: nowrap;
}

.viewer-stage-shell .viewer-canvas {
  min-height: 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading p {
  margin: 0;
  color: #91a3c2;
  line-height: 1.5;
  font-size: 13px;
}

.runtime-config-grid,
.runtime-probe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.runtime-probe-grid {
  margin-top: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field span {
  color: #8ea4c5;
  font-size: 12px;
}

.runtime-config-span {
  grid-column: 1 / -1;
}

.runtime-config-actions {
  margin-top: 14px;
}

/* ── Local Agent adapter list ─────────────────────────────────────────────── */
.local-agent-adapter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.local-agent-adapter-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.3);
  background: rgba(15, 23, 42, 0.5);
}

.local-agent-adapter-item.available {
  border-color: rgba(45, 212, 191, 0.25);
  background: rgba(13, 148, 136, 0.08);
}

.local-agent-adapter-item.missing,
.local-agent-adapter-item.error,
.local-agent-adapter-item.blocked {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(153, 27, 27, 0.08);
  opacity: 0.85;
}

.local-agent-adapter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.local-agent-adapter-head strong {
  font-size: 13px;
  font-weight: 600;
}

.local-agent-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(71, 85, 105, 0.4);
}

.local-agent-status.available {
  color: #ccfbf1;
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(13, 148, 136, 0.14);
}

.local-agent-status.missing,
.local-agent-status.error,
.local-agent-status.blocked {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(153, 27, 27, 0.12);
}

.local-agent-adapter-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.85);
}

.local-agent-adapter-meta code {
  font-size: 11px;
  background: rgba(30, 41, 59, 0.6);
  padding: 1px 5px;
  border-radius: 4px;
}

.local-agent-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(71, 85, 105, 0.3);
  color: rgba(203, 213, 225, 0.8);
}

.local-agent-adapter-diagnostic {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.7);
  line-height: 1.45;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  padding: 24px;
  background: rgba(2, 6, 23, 0.56);
  backdrop-filter: blur(8px);
}

.settings-drawer {
  width: min(540px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  border: 1px solid rgba(71, 85, 105, 0.42);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(6, 10, 21, 0.99));
  box-shadow:
    0 24px 60px rgba(2, 6, 23, 0.45),
    inset 0 1px 0 rgba(148, 163, 184, 0.06);
  overflow: hidden;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
}

.drawer-header h2 {
  margin: 0 0 8px;
}

.drawer-header p {
  margin: 0;
  color: #91a3c2;
  line-height: 1.5;
  font-size: 13px;
}

.drawer-close {
  white-space: nowrap;
}

.drawer-body {
  overflow: auto;
  padding: 18px 22px 22px;
}

.global-settings-drawer {
  width: min(460px, 100%);
}

.global-setting-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(0, 1.3fr);
  gap: 14px;
  align-items: stretch;
}

.global-setting-row > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.global-setting-row strong {
  color: #edf5ff;
}

.global-setting-row span {
  color: #93a4c3;
  font-size: 12px;
  line-height: 1.45;
}

.language-choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.language-choice {
  display: flex;
  min-height: 72px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  border-radius: 14px;
  text-align: left;
}

.language-choice.active {
  border-color: rgba(125, 211, 252, 0.74);
  background:
    linear-gradient(180deg, rgba(14, 116, 144, 0.22), rgba(15, 23, 42, 0.96));
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.16);
}

.language-choice small {
  color: #9fb2d0;
}

.dropzone {
  position: relative;
  display: block;
  margin: 12px 0;
  border-radius: 18px;
  border: 1px dashed rgba(96, 165, 250, 0.48);
  background:
    linear-gradient(180deg, rgba(9, 17, 30, 0.95), rgba(6, 11, 24, 0.95)),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 35%);
  cursor: pointer;
}

.dropzone:hover {
  border-color: rgba(125, 211, 252, 0.76);
}

.dropzone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dropzone-content strong {
  font-size: 16px;
}

.dropzone-content span {
  color: #8ea4c5;
  line-height: 1.5;
}

.primary-actions button:first-child {
  min-width: 220px;
}

.workflow-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.workflow-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(51, 65, 85, 0.45);
  background: rgba(2, 6, 23, 0.58);
}

.workflow-item strong {
  display: block;
  margin-bottom: 4px;
}

.workflow-item p {
  margin: 0;
  color: #8ea4c5;
  font-size: 12px;
  line-height: 1.5;
}

.workflow-item span {
  font-size: 12px;
  white-space: nowrap;
  color: #d5e5ff;
}

.status-active {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.1);
}

.status-done {
  border-color: rgba(34, 197, 94, 0.45);
}

.status-error {
  border-color: rgba(248, 113, 113, 0.5);
}

.result-banner {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-banner strong {
  font-size: 14px;
}

.result-banner span {
  color: #dce8fb;
  line-height: 1.5;
}

.result-success {
  background: rgba(22, 101, 52, 0.22);
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.result-error {
  background: rgba(127, 29, 29, 0.26);
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.result-info {
  background: rgba(3, 105, 161, 0.22);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.project-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.project-item-main small {
  color: #7f94b3;
  font-size: 11px;
}

.project-metadata,
.semantic-overview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

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

.summary-note {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  background: rgba(9, 17, 30, 0.7);
}

.summary-note strong {
  display: block;
  margin-bottom: 8px;
}

.summary-note p {
  margin: 0;
  line-height: 1.6;
  color: #d8e4f6;
}

.summary-primary {
  border-color: rgba(34, 211, 238, 0.3);
  background: rgba(8, 47, 73, 0.28);
}

.summary-muted {
  border-color: rgba(71, 85, 105, 0.3);
  background: rgba(9, 17, 30, 0.46);
}

.semantic-block + .semantic-block {
  margin-top: 14px;
}

.semantic-block h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.fold-block {
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid rgba(71, 85, 105, 0.35);
  background: rgba(5, 10, 22, 0.5);
  overflow: hidden;
}

.fold-summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  color: #dce8fb;
  font-size: 13px;
  font-weight: 600;
}

.fold-summary::-webkit-details-marker {
  display: none;
}

.fold-block[open] .fold-summary {
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
}

.fold-block .json-block {
  margin: 0;
  border: 0;
  border-radius: 0;
  max-height: 260px;
}

.chat-reply {
  margin-bottom: 0;
}

.chat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: #9eb1cf;
  font-size: 12px;
}

.chat-suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chat-connection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.chat-connection-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  background: rgba(3, 7, 18, 0.5);
  border-color: rgba(71, 85, 105, 0.4);
  box-shadow: none;
}

.chat-connection-card:hover:not(:disabled) {
  transform: none;
  background: rgba(8, 15, 30, 0.88);
}

.chat-connection-card.active {
  border-color: rgba(45, 212, 191, 0.62);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.24), rgba(3, 7, 18, 0.68));
  box-shadow: inset 0 1px 0 rgba(153, 246, 228, 0.12);
}

.chat-connection-card strong {
  color: #eef6ff;
  font-size: 12px;
  word-break: break-word;
}

.chat-connection-card small {
  color: #8ea4c5;
  font-size: 11px;
  line-height: 1.25;
}

.connection-status {
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.connection-status.status-ready {
  color: #ccfbf1;
  background: rgba(13, 148, 136, 0.2);
}

.connection-status.status-configurable,
.connection-status.status-degraded {
  color: #fde68a;
  background: rgba(120, 53, 15, 0.24);
}

.connection-status.status-blocked {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.24);
}

.agent-chat-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(15, 23, 42, 0.72));
}

.agent-chat-strip > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.agent-chat-strip strong {
  color: #f0fdfa;
  font-size: 14px;
}

.agent-chat-strip span {
  color: #a7c7d9;
  font-size: 12px;
  line-height: 1.45;
}

.agent-chat-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.agent-chat-actions button {
  min-width: 0;
}

.agent-plan-preview {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(71, 85, 105, 0.34);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.38);
}

.compact-list {
  margin: 8px 0;
}

.chat-suggestion {
  border-radius: 999px;
  padding-inline: 14px;
}

.legacy-chat-panel {
  margin-top: 12px;
}

.legacy-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
}

.chat-window {
  min-height: 180px;
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(71, 85, 105, 0.35);
  background: rgba(3, 7, 18, 0.54);
  scrollbar-width: thin;
  scrollbar-color: rgba(71, 85, 105, 0.6) transparent;
}

.chat-window::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.chat-window::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(71, 85, 105, 0.6);
}

.chat-window::-webkit-scrollbar-track {
  background: transparent;
}

.chat-bubble {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(71, 85, 105, 0.35);
}

.chat-bubble.user {
  align-self: flex-end;
  width: min(88%, 520px);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.18), rgba(7, 11, 24, 0.8));
}

.chat-bubble.assistant {
  align-self: stretch;
  background: linear-gradient(180deg, rgba(17, 28, 52, 0.92), rgba(10, 16, 28, 0.94));
}

.chat-bubble header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #9eb1cf;
  font-size: 12px;
}

.chat-bubble p,
.chat-empty-state p {
  margin: 0;
  line-height: 1.6;
  color: #e8f1ff;
}

.chat-transcript {
  display: grid;
  gap: 10px;
  padding: 2px 0 6px;
}

.transcript-message {
  display: grid;
  gap: 5px;
  max-width: min(92%, 720px);
  line-height: 1.62;
  color: #dfe9f7;
}

.transcript-message-user {
  justify-self: end;
  padding: 9px 13px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 14px;
  background: rgba(8, 47, 73, 0.16);
}

.transcript-message-agent {
  justify-self: stretch;
  padding: 2px 2px 8px;
}

.transcript-speaker {
  color: #8da2c3;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.transcript-queued {
  width: fit-content;
  padding: 2px 6px;
  border: 1px solid rgba(217, 164, 65, 0.34);
  border-radius: 999px;
  color: #fde68a;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.transcript-intent-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  color: #cfe6ff;
  font-size: 12px;
}

.transcript-intent-line code {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(2, 6, 23, 0.32);
  color: #bfe3ff;
  font-weight: 700;
}

.transcript-intent-line .transcript-status-icon {
  color: #38bdf8;
}

.transcript-intent-clarify {
  border-color: rgba(217, 164, 65, 0.4);
  background: rgba(217, 164, 65, 0.1);
  color: #fde68a;
}

.transcript-intent-clarify .transcript-status-icon {
  color: #f5b945;
}

.transcript-intent-source {
  color: #8aa0c0;
  font-size: 11px;
}

.transcript-intent-bindings {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.intent-binding {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(2, 6, 23, 0.24);
}

.intent-binding code {
  padding: 0 4px;
  font-size: 10px;
  color: #9fb6d6;
}

.intent-binding-known {
  border-color: rgba(52, 211, 153, 0.4);
  color: #b8f0d6;
}

.intent-binding-warn {
  border-color: rgba(251, 191, 36, 0.5);
  color: #fde68a;
}

.intent-binding-warn-icon {
  width: 12px;
  height: 12px;
  color: #f5b945;
}

.intent-binding-unresolved {
  border-color: rgba(217, 164, 65, 0.4);
  color: #fcd9a0;
}

.intent-binding-unverified {
  color: #93a4c0;
}

.tool-line,
.artifact-line,
.transcript-status-line,
.transcript-error-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 9px;
  background: rgba(148, 163, 184, 0.05);
  color: #aebed6;
  font-size: 11px;
}

/* Post-edit regression-diff verdict line */
.transcript-verify-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 18px;
  padding: 5px 10px;
  border-left: 2px solid rgba(148, 163, 184, 0.3);
  border-radius: 0 6px 6px 0;
  background: rgba(148, 163, 184, 0.04);
  color: #b9c9e3;
  font-size: 12px;
}

.transcript-verify-ok {
  border-left-color: rgba(52, 211, 153, 0.6);
}

.transcript-verify-ok .transcript-status-icon {
  color: #34d399;
}

.transcript-verify-warn {
  border-left-color: rgba(251, 191, 36, 0.65);
  background: rgba(217, 164, 65, 0.07);
}

.transcript-verify-warn .transcript-status-icon {
  color: #f5b945;
}

.transcript-verify-neutral .transcript-status-icon {
  color: #94a3b8;
}

.transcript-verify-label {
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.transcript-verify-headline {
  color: #9fb6d6;
}

.transcript-verify-parts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

.verify-part {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(2, 6, 23, 0.24);
  color: #b8f0d6;
}

.verify-part-collateral {
  border-color: rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.verify-part-added {
  border-color: rgba(56, 189, 248, 0.45);
  color: #bfe3ff;
}

.verify-part-removed {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.tool-line code,
.artifact-line code {
  padding: 1px 6px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 5px;
  background: rgba(2, 6, 23, 0.32);
  color: #c4d6f4;
}

.tool-line-running .transcript-status-icon {
  color: #38bdf8;
}

.tool-line-done .transcript-status-icon,
.transcript-status-done .transcript-status-icon {
  color: #34d399;
}

.tool-line-failed .transcript-status-icon,
.transcript-error-line .transcript-status-icon {
  color: #fb7185;
}

.transcript-status-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #94a3b8;
}

.spin {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.approval-line {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(217, 164, 65, 0.2);
  border-radius: 12px;
  background: rgba(24, 18, 8, 0.28);
  backdrop-filter: blur(8px);
}

.ask-user-line {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  background: rgba(8, 20, 30, 0.46);
  backdrop-filter: blur(8px);
}

.ask-user-line-main {
  display: grid;
  gap: 6px;
  color: #d9e7ff;
}

.ask-user-line-main strong {
  overflow-wrap: anywhere;
  color: #eef6ff;
  font-size: 13px;
  line-height: 1.35;
}

.ask-user-line-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  background: rgba(14, 116, 144, 0.18);
  color: #7dd3fc;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.ask-user-reply {
  display: grid;
  gap: 8px;
}

.ask-user-reply textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.36);
  color: #e2e8f0;
  padding: 8px 9px;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
}

.ask-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ask-user-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.context-summary-panel {
  flex-shrink: 0;
  display: grid;
  gap: 8px;
  max-height: 42vh;
  overflow: hidden;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 8px;
  background: rgba(5, 10, 22, 0.46);
  color: #d9e7ff;
}

.context-summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.context-summary-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #eef6ff;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.context-summary-toggle:hover:not(:disabled) {
  background: transparent;
  color: #ffffff;
}

.context-summary-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.context-summary-meta,
.context-summary-counts {
  min-width: 0;
  color: #8da2c3;
  font-size: 11px;
  line-height: 1.25;
}

.context-summary-counts {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-summary-refresh {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-left: auto;
  padding: 0;
}

.context-summary-compact {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 8px;
  align-items: baseline;
  min-width: 0;
  color: #c9d7ec;
  font-size: 12px;
  line-height: 1.35;
}

.context-summary-compact strong,
.context-summary-compact span:not(.context-summary-label) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.context-summary-label {
  color: #8da2c3;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.context-summary-details {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.context-summary-block {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.context-summary-block ul,
.context-summary-engineering ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.context-summary-block li,
.context-summary-engineering li,
.context-summary-muted,
.context-summary-empty {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #c9d7ec;
  font-size: 12px;
  line-height: 1.35;
}

.context-summary-engineering {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-top: 2px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.context-summary-block-risk li {
  color: #fbbf24;
}

.context-summary-block code {
  color: #93c5fd;
  font-size: 11px;
  white-space: normal;
}

.context-summary-more,
.context-summary-muted {
  color: #8da2c3;
}

.context-summary-empty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.agent-plan-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  background: rgba(8, 13, 27, 0.26);
  color: #d9e7ff;
}

.agent-plan-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.agent-plan-card-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.agent-plan-card-header strong {
  overflow-wrap: anywhere;
  color: #eef6ff;
  font-size: 13px;
  line-height: 1.35;
}

.agent-plan-current {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.22);
  color: #c8d5ea;
  font-size: 12px;
  line-height: 1.45;
}

.agent-plan-current span {
  color: #8da2c3;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-plan-eyebrow {
  color: #8da2c3;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.agent-plan-state {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  max-width: 44%;
  padding: 3px 7px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.34);
  color: #b9c9e3;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  white-space: normal;
}

.agent-plan-diagnostics {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.agent-plan-diagnostic {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 5px 7px;
  border-left: 2px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.22);
}

.agent-plan-details {
  display: grid;
  gap: 8px;
}

.agent-plan-details summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #91a7c7;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-plan-diagnostic span {
  color: #8da2c3;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.agent-plan-diagnostic p {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #c9d7ec;
  font-size: 11px;
  line-height: 1.35;
}

.agent-plan-diagnostic-error {
  border-left-color: rgba(251, 113, 133, 0.75);
}

.agent-plan-diagnostic-error p {
  color: #fecdd3;
}

.agent-plan-diagnostic-warning {
  border-left-color: rgba(251, 191, 36, 0.72);
}

.agent-plan-diagnostic-warning p {
  color: #fde68a;
}

.agent-plan-diagnostic-output {
  border-left-color: rgba(52, 211, 153, 0.65);
}

.agent-plan-steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agent-plan-step {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 5px 7px;
  border-left: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.24);
}

.agent-plan-step-current {
  border-left-color: rgba(56, 189, 248, 0.72);
  background: rgba(8, 47, 73, 0.28);
}

.agent-plan-icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: #94a3b8;
}

.agent-plan-step-completed .agent-plan-icon,
.agent-plan-state-done .agent-plan-icon {
  color: #34d399;
}

.agent-plan-step-running .agent-plan-icon,
.agent-plan-state-running .agent-plan-icon {
  color: #38bdf8;
}

.agent-plan-step-blocked .agent-plan-icon,
.agent-plan-state-approval .agent-plan-icon,
.agent-plan-state-blocked .agent-plan-icon {
  color: #fbbf24;
}

.agent-plan-step-failed .agent-plan-icon,
.agent-plan-state-failed .agent-plan-icon {
  color: #fb7185;
}

/* Cancelled: stopped/neutral — never spins, never reads as "waiting approval". */
.agent-plan-step-cancelled .agent-plan-icon,
.agent-plan-state-cancelled .agent-plan-icon {
  color: #94a3b8;
}

.agent-plan-step-cancelled {
  opacity: 0.7;
}

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

.agent-plan-step-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.agent-plan-step-title span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 750;
}

.agent-plan-step-title small {
  flex: 0 0 auto;
  color: #8fa5c4;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-plan-step-copy p {
  margin: 0;
  overflow-wrap: anywhere;
  color: #8fa5c4;
  font-size: 11px;
  line-height: 1.35;
}

.approval-line-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  color: #f7e7b0;
  font-size: 12px;
}

.approval-line-main > * {
  min-width: 0;
}

.approval-line-main strong {
  color: #fff6d6;
  overflow-wrap: anywhere;
}

.approval-line-main small {
  color: #d9b96d;
  overflow-wrap: anywhere;
}

.approval-line-main code {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.approval-line-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(217, 164, 65, 0.16);
  color: #fde68a;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.approval-skill-plan {
  display: grid;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid rgba(217, 164, 65, 0.18);
  border-radius: 7px;
  background: rgba(2, 6, 23, 0.24);
  color: #f7e7b0;
  font-size: 12px;
}

.approval-skill-plan > strong {
  overflow-wrap: anywhere;
  color: #fff6d6;
  line-height: 1.35;
}

.approval-skill-list {
  display: grid;
  gap: 4px;
  color: #d9c38a;
}

.approval-skill-list > span {
  color: #d9b96d;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.approval-skill-list ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 17px;
}

.approval-skill-list li {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.approval-skill-list-warning li {
  color: #fca5a5;
}

.approval-details {
  display: grid;
  gap: 8px;
}

.approval-details summary {
  cursor: pointer;
  color: #d9b96d;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.approval-line-actions,
.artifact-link-row,
.artifact-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.approval-line-actions button,
.transcript-artifact-button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.approval-line-actions button .button-icon {
  width: 13px;
  height: 13px;
  margin-right: 5px;
}

.chat-approval-dock .approval-line-actions button:hover:not(:disabled),
.approval-line .approval-line-actions button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
}

.chat-approval-dock .approval-line-actions button:first-child,
.approval-line .approval-line-actions button:first-child {
  border-color: rgba(52, 211, 153, 0.18);
  background: rgba(52, 211, 153, 0.06);
  color: #b9f1d4;
}

.chat-approval-dock .approval-line-actions button:first-child:hover:not(:disabled),
.approval-line .approval-line-actions button:first-child:hover:not(:disabled) {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.1);
}

.approval-revise-input {
  display: grid;
  gap: 8px;
}

.approval-revise-input textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 7px;
  background: rgba(2, 6, 23, 0.48);
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.approval-revise-input textarea:focus {
  outline: none;
  border-color: rgba(148, 163, 184, 0.4);
}

.approval-revise-input textarea::placeholder {
  color: #64748b;
}

.approval-revise-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.approval-code-preview pre,
.event-detail pre {
  max-height: 260px;
  width: 100%;
  overflow: auto;
  margin: 6px 0 0;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 7px;
  background: rgba(2, 6, 23, 0.62);
  color: #d9e7ff;
  font-size: 11px;
  line-height: 1.45;
}

.event-detail {
  width: 100%;
  min-width: 0;
  color: #8fa5c4;
}

.event-detail summary,
.approval-code-preview summary,
.approval-details summary {
  cursor: pointer;
  color: #91a7c7;
  font-size: 11px;
  font-weight: 800;
}

.artifact-chip {
  padding: 2px 7px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 999px;
  background: rgba(8, 47, 73, 0.22);
  color: #bae6fd;
  font-size: 11px;
}

.new-activity-button {
  position: sticky;
  bottom: 10px;
  align-self: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 999px;
  background: rgba(8, 47, 73, 0.82);
  color: #dbeafe;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.32);
}

.setting-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dbeafe;
  font-weight: 750;
}

.markdown-text {
  display: grid;
  gap: 8px;
  color: #e8f1ff;
  line-height: 1.6;
}

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

.markdown-text h2,
.markdown-text h3 {
  color: #f3f8ff;
  font-weight: 850;
  letter-spacing: 0;
}

.markdown-text h2 {
  font-size: 15px;
}

.markdown-text h3 {
  font-size: 13px;
}

.markdown-text p {
  color: #e8f1ff;
}

.markdown-text ul,
.markdown-text ol {
  display: grid;
  gap: 5px;
  padding-left: 18px;
}

.markdown-text li {
  padding-left: 2px;
}

.markdown-text code {
  padding: 1px 5px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 5px;
  background: rgba(2, 6, 23, 0.45);
  color: #bfdbfe;
  font-size: 0.92em;
}

.markdown-text pre {
  max-width: 100%;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.55);
}

.markdown-text pre code {
  padding: 0;
  border: 0;
  background: transparent;
  white-space: pre;
}

.chat-plan-list,
.agent-plan-card,
.chat-error-list,
.cae-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.live-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.68);
  color: #b7c8e2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.live-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #94a3b8;
}

.live-sync-live {
  border-color: rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}

.live-sync-live .live-sync-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.live-sync-connecting,
.live-sync-reconnecting,
.live-sync-polling {
  border-color: rgba(217, 164, 65, 0.36);
  color: #fde68a;
}

.live-sync-connecting .live-sync-dot,
.live-sync-reconnecting .live-sync-dot,
.live-sync-polling .live-sync-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.live-sync-offline {
  border-color: rgba(248, 113, 113, 0.34);
  color: #fecaca;
}

.live-sync-offline .live-sync-dot {
  background: #ef4444;
}

.cae-list-item small,
.cae-chip-card small {
  color: #96a9c7;
  line-height: 1.5;
}

.chat-audit-link {
  color: #7dd3fc;
  text-decoration: none;
  font-size: 12px;
}

.chat-audit-link:hover {
  text-decoration: underline;
}

.chat-empty-state {
  margin: 0;
}

/* ── unified chat panel ────────────────────────────────────────────────────── */

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

.chat-header strong {
  font-size: 14px;
  color: #e2f0ff;
}

.chat-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-connection-select {
  background: rgba(15, 25, 48, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #a7c7d9;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
}

.chat-connection-select:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.5);
}

.icon-only-button {
  padding: 5px;
  min-width: unset;
}

.chat-mode-tag {
  font-size: 10px;
  color: #607a98;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 1px 5px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 8px;
}

.chat-input-row textarea {
  flex: 1;
  resize: none;
  font-family: inherit;
}

.chat-input-wrap {
  position: relative;
  flex: 1;
}

.chat-autocomplete {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(6, 12, 24, 0.96);
  backdrop-filter: blur(10px);
  max-height: 180px;
  overflow-y: auto;
  z-index: 10;
}

.chat-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.chat-autocomplete-item:hover,
.chat-autocomplete-item.active {
  background: rgba(56, 189, 248, 0.12);
}

.chat-autocomplete-item code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #e2e8f0;
  flex-shrink: 0;
}

.chat-autocomplete-badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.22);
  flex-shrink: 0;
}

.chat-autocomplete-label {
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Slash-command menu rows: command token + description + example. */
.chat-slash-item {
  align-items: flex-start;
}

.chat-slash-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.chat-slash-example {
  color: #64748b;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Lightweight, non-persistent natural-language command hint. */
.composer-suggestion {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
  padding: 2px 2px 4px;
}

.composer-suggestion-button {
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  cursor: pointer;
}

.composer-suggestion-button:hover {
  background: rgba(56, 189, 248, 0.2);
}

.chat-cad-progress {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(88, 28, 135, 0.15);
}
.viewer-cad-progress-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(6, 12, 24, 0.85);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  z-index: 10;
  animation: tooltipIn 0.2s ease-out;
}

.viewer-cad-progress-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(168, 85, 247, 0.2);
  border-top-color: #a855f7;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.viewer-cad-progress-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.viewer-cad-progress-text strong {
  font-size: 14px;
  color: #e2e8f0;
  text-transform: capitalize;
}

.viewer-cad-progress-text span {
  font-size: 12px;
  color: #94a3b8;
}

.chat-send-button {
  white-space: nowrap;
  align-self: flex-end;
  padding: 8px 18px;
}

.chat-sim-approval {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(6, 78, 59, 0.22);
}

.chat-sim-approval span {
  color: #6ee7b7;
}

.cae-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.cae-overview-grid div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(71, 85, 105, 0.35);
  background: rgba(2, 6, 23, 0.5);
}

.cae-overview-grid span,
.cae-field-head span,
.cae-chip-card span,
.cae-list-item span {
  color: #8ea4c5;
  font-size: 12px;
}

.cae-field-shell,
.cae-section-block {
  margin-top: 14px;
}

.cae-field-shell {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(71, 85, 105, 0.35);
  background: rgba(4, 10, 22, 0.58);
}

.cae-field-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.cae-field-head div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cae-legend {
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(90deg, #0ea5e9 0%, #fde047 52%, #ef4444 100%);
}

.cae-legend.pending {
  opacity: 0.45;
  filter: saturate(0.55);
}

.cae-legend-scale {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #a9bbd7;
  font-size: 12px;
}

.cae-chip-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cae-chip-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(71, 85, 105, 0.35);
  background: rgba(2, 6, 23, 0.5);
}

.cae-list-item.compact {
  gap: 0;
}

@media (max-width: 1280px) {
  .viewer-toolbar,
  .viewer-insights,
  .cae-overview-grid,
  .cae-chip-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .viewer-toolbar,
  .viewer-insights {
    padding-inline: 20px;
  }

  .viewer-stage-shell {
    margin-inline: 20px;
  }
}

@media (max-width: 1080px) {
  .viewer-toolbar,
  .viewer-insights,
  .cae-overview-grid,
  .cae-chip-list,
  .project-metadata,
  .semantic-overview,
  .action-grid,
  .runtime-config-grid,
  .runtime-probe-grid {
    grid-template-columns: 1fr;
  }

  .viewer-stage-shell {
    margin: 0 14px 14px;
    min-height: 48vh;
  }

  .viewer-stage-head {
    flex-direction: column;
  }

  .runtime-actions,
  .runtime-note {
    justify-content: flex-start;
    text-align: left;
  }

  .drawer-backdrop {
    padding: 0;
  }

  .settings-drawer {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }

  .global-setting-row,
  .language-choice-group {
    grid-template-columns: 1fr;
  }

  .chat-bubble.user {
    width: 100%;
  }

  .cae-field-head {
    flex-direction: column;
  }

  .drawer-header {
    flex-direction: column;
  }
}

.cae-mode-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.cae-mode-badge.mode-cad-only {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.cae-mode-badge.mode-cae-setup {
  background: rgba(14, 165, 233, 0.15);
  color: #7dd3fc;
  border-color: rgba(14, 165, 233, 0.45);
}

.cae-mode-badge.mode-cae-result {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.45);
}

.cae-mode-badge.mode-cae-validation {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.45);
}

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

@media (max-width: 1080px) {
  .cae-artifact-grid {
    grid-template-columns: 1fr;
  }
}

.cae-artifact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.45);
  font-size: 12px;
}

.cae-artifact-item.present {
  color: #86efac;
}

.cae-artifact-item.missing {
  color: #94a3b8;
  opacity: 0.8;
}

.cae-artifact-icon {
  font-size: 13px;
  width: 18px;
  text-align: center;
}

.cae-artifact-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

.agent-workbench-card {
  border-color: rgba(20, 184, 166, 0.28);
}

.agent-console-card {
  border-color: rgba(20, 184, 166, 0.32);
}

.capability-toolbar {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.capability-browser {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  min-height: 360px;
}

.capability-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow: auto;
  padding-right: 4px;
}

.capability-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(3, 7, 18, 0.56);
  box-shadow: none;
}

.capability-item strong {
  font-size: 12px;
  word-break: break-word;
}

.capability-item span {
  color: #8ea4c5;
  font-size: 11px;
}

.capability-item.active {
  border-color: rgba(45, 212, 191, 0.66);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.1);
}

.capability-detail {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(71, 85, 105, 0.35);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.42);
}

.capability-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.capability-detail-head div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.capability-detail-head span {
  color: #a6bad7;
  font-size: 12px;
  line-height: 1.45;
}

.capability-available,
.capability-missing {
  align-self: flex-start;
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}

.capability-available {
  color: #99f6e4;
  background: rgba(20, 184, 166, 0.14);
}

.capability-missing {
  color: #fecaca;
  background: rgba(220, 38, 38, 0.16);
}

.capability-facts,
.semantic-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.capability-facts div,
.semantic-map-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(71, 85, 105, 0.32);
  background: rgba(5, 10, 22, 0.55);
}

.capability-facts span,
.semantic-map-item span,
.workflow-step-item span {
  color: #8ea4c5;
  font-size: 11px;
}

.capability-facts strong,
.semantic-map-item strong {
  font-size: 12px;
  word-break: break-word;
}

.side-effect-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.side-effect-list span {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(94, 234, 212, 0.24);
  background: rgba(13, 148, 136, 0.12);
  color: #ccfbf1;
  font-size: 11px;
  line-height: 1.35;
}

.workflow-step-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.workflow-step-item {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(71, 85, 105, 0.34);
  background: rgba(3, 7, 18, 0.42);
}

.workflow-step-item strong {
  font-size: 12px;
  word-break: break-word;
}

.workflow-step-item small {
  color: #fde68a;
  font-size: 11px;
  white-space: nowrap;
}

.benchmark-result {
  margin-top: 12px;
}

.semantic-map-item.present {
  border-color: rgba(45, 212, 191, 0.35);
}

.semantic-map-item.present strong {
  color: #99f6e4;
}

.semantic-map-item.missing strong {
  color: #94a3b8;
}

@media (max-width: 1080px) {
  .capability-toolbar,
  .capability-browser,
  .capability-facts,
  .semantic-map-grid {
    grid-template-columns: 1fr;
  }

  .workflow-step-item {
    grid-template-columns: 1fr;
  }

  .agent-chat-actions {
    grid-template-columns: 1fr;
  }

  .chat-connection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cae-artifact-footer {
  margin-top: 10px;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
}

.artifact-link {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  color: #7dd3fc;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.artifact-link:hover {
  color: #bae6fd;
}

.chat-artifact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.chat-artifact-links small {
  color: #9eb1cf;
  font-size: 11px;
}

.chat-artifact-link {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  background: rgba(8, 15, 30, 0.92);
  border: 1px solid rgba(96, 165, 250, 0.34);
  color: #dbeafe;
  box-shadow: none;
}

.chat-artifact-diffs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.chat-artifact-diffs > small {
  color: #9eb1cf;
  font-size: 11px;
}

.chat-diff-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.35);
  background: rgba(2, 6, 23, 0.45);
}

.chat-diff-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.chat-diff-header span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

.chat-diff-op {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.15);
  color: #7dd3fc;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 600;
}

.chat-diff-pointer {
  color: #fde68a;
  font-size: 11px;
}

.chat-diff-paths {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-diff-paths small {
  color: #96a9c7;
  font-size: 10px;
}

.chat-diff-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.chat-diff-before,
.chat-diff-after {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.45;
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-diff-before {
  border: 1px solid rgba(248, 113, 113, 0.3);
  background: rgba(127, 29, 29, 0.14);
  color: #fecaca;
}

.chat-diff-after {
  border: 1px solid rgba(74, 222, 128, 0.3);
  background: rgba(22, 101, 52, 0.14);
  color: #bbf7d0;
}

.test-result {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.test-result.ok {
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(22, 101, 52, 0.12);
  color: #bbf7d0;
}

.test-result.error {
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.12);
  color: #fecaca;
}

/* Modern control-surface refresh */
:root {
  font-family: Aptos, "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: #e8edf2;
  background: #111418;
}

body {
  background:
    radial-gradient(circle at 18% 10%, rgba(211, 204, 187, 0.18), transparent 30%),
    linear-gradient(135deg, #12161b 0%, #090b0e 100%);
}

button,
input,
select,
textarea {
  border-radius: 12px;
}

.app-shell {
  grid-template-columns: minmax(0, 1fr) clamp(560px, 46vw, 740px);
  background: #111418;
}

.viewer-pane {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.12), transparent 30%),
    radial-gradient(circle at 84% 20%, rgba(169, 187, 174, 0.16), transparent 24%),
    linear-gradient(160deg, #1a1f24 0%, #0d1115 58%, #07090b 100%);
}

.viewer-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 18, 22, 0.64);
}

.viewer-header h1 {
  color: #f4f1ea;
  font-size: 22px;
  letter-spacing: 0;
  font-weight: 760;
}

.viewer-header p,
.runtime-note,
.viewer-stage-head span,
.viewer-toolbar-label,
.insight-card span {
  color: #aeb8bd;
}

.runtime-pill,
.viewer-stage-badge {
  color: #f3efe6;
  border-color: rgba(232, 219, 190, 0.22);
  background: rgba(232, 219, 190, 0.1);
}

.viewer-toolbar-block,
.insight-card,
.viewer-stage-shell {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.viewer-toolbar-block strong,
.insight-card strong,
.viewer-stage-head strong {
  color: #f7f3eb;
}

.viewer-stage-head {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: rgba(8, 10, 12, 0.28);
}

.viewer-overlay {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(18, 21, 24, 0.82);
}

.ghost-button {
  color: #ece7db;
  border-color: rgba(230, 220, 198, 0.2);
  background: rgba(255, 255, 255, 0.055);
}

.ghost-button:hover:not(:disabled) {
  border-color: rgba(230, 220, 198, 0.36);
  background: rgba(255, 255, 255, 0.09);
}

.side-pane {
  position: relative;
  gap: 16px;
  padding: 20px;
  color: #e2e8f0;
  border-left: 1px solid #ded8ca;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.94), rgba(246, 243, 235, 0.98)),
    repeating-linear-gradient(90deg, rgba(33, 39, 47, 0.035) 0 1px, transparent 1px 80px);
}

.side-pane::before {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  width: clamp(560px, 46vw, 740px);
  height: 100dvh;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 8%, rgba(216, 178, 98, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 32%);
}

.side-pane > * {
  position: relative;
  z-index: 1;
}

.control-pane-header {
  top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(34, 39, 47, 0.08);
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.86);
  box-shadow:
    0 18px 42px rgba(48, 44, 36, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.control-pane-header strong {
  color: #20252d;
  font-size: 15px;
}

.control-pane-kicker {
  color: #8a5d17;
}

.side-pane .compact-button {
  color: #e2e8f0;
  border-color: rgba(255,255,255,0.1);
  background: #111827;
}

.control-pane-tabs {
  position: relative;
  top: auto;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(34, 39, 47, 0.08);
  border-radius: 20px;
  background: rgba(235, 230, 219, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.control-pane-tab {
  min-height: 66px;
  padding: 11px 12px;
  border-radius: 16px;
  color: #e2e8f0;
}

.side-pane .control-pane-tab {
  color: #e2e8f0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.control-pane-tab:hover:not(:disabled) {
  background: rgba(255, 253, 247, 0.72);
}

.side-pane .control-pane-tab:hover:not(:disabled) {
  background: rgba(255, 253, 247, 0.72);
  transform: none;
}

.control-pane-tab.active {
  border-color: rgba(32, 37, 45, 0.1);
  background: #111827;
  box-shadow:
    0 12px 24px rgba(48, 44, 36, 0.1),
    inset 0 -2px 0 #c17d1f;
}

.side-pane .control-pane-tab.active {
  color: #20252d;
  border-color: rgba(32, 37, 45, 0.1);
  background: #111827;
  box-shadow:
    0 12px 24px rgba(48, 44, 36, 0.1),
    inset 0 -2px 0 #c17d1f;
}

.control-pane-tab strong {
  color: #1f252c;
  font-size: 12px;
}

.control-pane-tab span {
  color: #6d7480;
}

.notification-center {
  position: relative;
  top: auto;
  z-index: 6;
}

.notification-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(34, 39, 47, 0.1);
  background: rgba(255, 253, 247, 0.94);
  box-shadow:
    0 18px 42px rgba(48, 44, 36, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  animation: notice-slide-in 0.24s ease-out;
}

.notification-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
}

.notification-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.notification-copy strong {
  color: #20252d;
  font-size: 14px;
}

.notification-copy span {
  color: #5f6873;
  font-size: 12px;
  line-height: 1.5;
}

.notification-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  color: #68717d;
  background: transparent;
  box-shadow: none;
}

.notification-close:hover:not(:disabled) {
  color: #20252d;
  background: rgba(34, 39, 47, 0.06);
  transform: none;
}

.notification-success {
  border-left: 4px solid #2f8f65;
}

.notification-success .notification-icon {
  color: #f6fff9;
  background: #2f8f65;
}

.notification-error {
  border-left: 4px solid #b64545;
}

.notification-error .notification-icon {
  color: #fff8f6;
  background: #b64545;
}

.notification-info {
  border-left: 4px solid #bd7a1c;
}

.notification-info .notification-icon {
  color: #fffaf0;
  background: #bd7a1c;
}

@keyframes notice-slide-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.side-pane .card {
  border: 1px solid rgba(34, 39, 47, 0.08);
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow:
    0 18px 44px rgba(48, 44, 36, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.side-pane .card h2 {
  color: #20252d;
  font-size: 17px;
  font-weight: 760;
}

.side-pane .section-heading p,
.side-pane .project-item-main small,
.side-pane .workflow-item p,
.side-pane .summary-note p,
.side-pane .chat-bubble p,
.side-pane .chat-empty-state p,
.side-pane .chat-connection-card small,
.side-pane .agent-chat-strip span,
.side-pane .capability-detail-head span,
.side-pane .cae-list-item small,
.side-pane .cae-chip-card small {
  color: #65707c;
}

.side-pane input,
.side-pane select,
.side-pane textarea {
  color: #22272f;
  border-color: #d9d1c2;
  background: rgba(255, 253, 247, 0.92);
}

.side-pane input:focus,
.side-pane select:focus,
.side-pane textarea:focus {
  border-color: #bc7a22;
  box-shadow: 0 0 0 3px rgba(188, 122, 34, 0.16);
}

.side-pane button {
  color: #fffaf0;
  border-color: #20252d;
  background: linear-gradient(180deg, #2d333b, #1f252c);
  box-shadow: 0 10px 24px rgba(48, 44, 36, 0.14);
}

.side-pane button:hover:not(:disabled) {
  border-color: #3d4651;
  transform: translateY(-1px);
}

.side-pane .ghost-button,
.side-pane .chat-suggestion,
.side-pane .chat-artifact-link {
  color: #2c333b;
  border-color: #d9d1c2;
  background: rgba(255, 253, 247, 0.76);
  box-shadow: none;
}

.side-pane .ghost-button:hover:not(:disabled),
.side-pane .chat-suggestion:hover:not(:disabled),
.side-pane .chat-artifact-link:hover:not(:disabled) {
  background: #111827;
}

.dropzone {
  border-color: rgba(188, 122, 34, 0.38);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.9), rgba(248, 244, 235, 0.92)),
    radial-gradient(circle at top right, rgba(188, 122, 34, 0.12), transparent 36%);
}

.dropzone:hover {
  border-color: rgba(188, 122, 34, 0.66);
}

.dropzone-content strong,
.project-item strong,
.workflow-item strong,
.summary-note strong,
.semantic-block h3,
.capability-detail strong,
.chat-bubble header strong,
.cae-chip-card strong,
.cae-list-item strong {
  color: #22272f;
}

.dropzone-content span,
.project-metadata span,
.semantic-overview span,
.capability-facts span,
.semantic-map-item span,
.workflow-step-item span,
.cae-overview-grid span,
.cae-field-head span,
.cae-chip-card span,
.cae-list-item span {
  color: #6b7480;
}
.side-pane .project-item.active {
  outline: 0;
  border-color: rgba(188, 122, 34, 0.44);
  background: #111827;
  box-shadow: inset 4px 0 0 #bd7a1c, 0 10px 24px rgba(48, 44, 36, 0.08);
}

.project-item span {
  color: #8a5d17;
}

.workflow-item {
  align-items: stretch;
}

.status-active {
  border-color: rgba(188, 122, 34, 0.36);
  box-shadow: inset 4px 0 0 #bd7a1c;
}

.status-done {
  border-color: rgba(47, 143, 101, 0.28);
  box-shadow: inset 4px 0 0 #2f8f65;
}

.status-error {
  border-color: rgba(182, 69, 69, 0.3);
  box-shadow: inset 4px 0 0 #b64545;
}

.summary-primary {
  border-color: rgba(47, 143, 101, 0.22);
  background: rgba(229, 241, 232, 0.76);
}

.summary-muted {
  border-color: rgba(34, 39, 47, 0.08);
  background: rgba(241, 237, 226, 0.72);
}
.chat-connection-select {
  color: #e2e8f0;
  border-color: #d9d1c2;
  background: rgba(255, 253, 247, 0.92);
}
.chat-sim-approval {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(236, 253, 245, 0.85);
}

.chat-sim-approval span {
  color: #065f46;
}
.fold-summary {
  color: #e2e8f0;
}

.fold-block[open] .fold-summary {
  border-bottom-color: rgba(34, 39, 47, 0.08);
}

.side-pane .json-block {
  color: #e2e8f0;
  border-color: rgba(34, 39, 47, 0.08);
  background: #111827;
}

.side-pane .chat-connection-card,
.side-pane .capability-item {
  color: #e2e8f0;
  border-color: rgba(34, 39, 47, 0.08);
  background: rgba(248, 244, 235, 0.72);
  box-shadow: none;
}

.side-pane .project-item:hover:not(:disabled),
.side-pane .chat-connection-card:hover:not(:disabled),
.side-pane .capability-item:hover:not(:disabled) {
  background: #111827;
  transform: none;
}

.side-pane .chat-connection-card.active,
.side-pane .capability-item.active {
  border-color: rgba(47, 143, 101, 0.34);
  background: #111827;
  box-shadow: inset 4px 0 0 #2f8f65;
}

.chat-connection-card strong,
.capability-item strong {
  color: #22272f;
}

.connection-status.status-ready {
  color: #1f6f4c;
  background: rgba(47, 143, 101, 0.14);
}

.connection-status.status-configurable,
.connection-status.status-degraded {
  color: #8a5d17;
  background: rgba(189, 122, 28, 0.14);
}

.connection-status.status-blocked {
  color: #9f3232;
  background: rgba(182, 69, 69, 0.12);
}

.agent-chat-strip {
  border-color: rgba(34, 39, 47, 0.08);
  background:
    linear-gradient(135deg, rgba(247, 232, 196, 0.78), rgba(255, 253, 247, 0.86));
}

.agent-chat-strip strong {
  color: #22272f;
}

.chat-bubble.user {
  background: #111827;
}

.chat-bubble.assistant {
  background: rgba(255, 253, 247, 0.92);
}

.chat-bubble header {
  color: #75808b;
}

.chat-audit-link,
.artifact-link {
  color: #9a641a;
}

.artifact-link:hover {
  color: #6e4814;
}

.side-effect-list span {
  color: #1f6f4c;
  border-color: rgba(47, 143, 101, 0.22);
  background: rgba(47, 143, 101, 0.1);
}

.cae-mode-badge.mode-cae-validation {
  color: #7c5a1a;
  border-color: rgba(189, 122, 28, 0.28);
  background: rgba(189, 122, 28, 0.12);
}

.side-pane::-webkit-scrollbar-thumb,
.json-block::-webkit-scrollbar-thumb {
  background: rgba(110, 100, 82, 0.42);
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) minmax(540px, 46vw);
  }

  .side-pane::before {
    width: max(540px, 46vw);
  }

  .control-pane-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-pane {
    border-left: 0;
  }

  .side-pane::before {
    width: 100vw;
  }

  .notification-center {
    top: 12px;
  }
}

/* Deep glass control-surface correction */
:root {
  --glass-ink: #f4f7fb;
  --glass-muted: #9ca8b7;
  --glass-soft: #cbd5e1;
  --glass-line: rgba(180, 196, 218, 0.16);
  --glass-line-strong: rgba(216, 226, 239, 0.24);
  --glass-panel: rgba(13, 18, 27, 0.68);
  --glass-panel-strong: rgba(17, 24, 37, 0.82);
  --glass-panel-soft: rgba(255, 255, 255, 0.065);
  --glass-accent: #8ecae6;
  --glass-amber: #d9a441;
  --glass-green: #73d6a2;
  --glass-red: #ff8f8f;
  color: var(--glass-ink);
  background: #070a0f;
}

body {
  background:
    radial-gradient(circle at 16% 8%, rgba(142, 202, 230, 0.14), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(217, 164, 65, 0.11), transparent 24%),
    radial-gradient(circle at 68% 94%, rgba(115, 214, 162, 0.08), transparent 30%),
    linear-gradient(135deg, #111721 0%, #06080c 62%, #030406 100%);
}

.app-shell {
  grid-template-columns: minmax(0, 1fr) clamp(560px, 46vw, 740px);
  background: transparent;
}

.viewer-pane {
  border-right: 1px solid var(--glass-line);
  background:
    radial-gradient(circle at 18% 12%, rgba(142, 202, 230, 0.14), transparent 30%),
    radial-gradient(circle at 78% 10%, rgba(255, 255, 255, 0.08), transparent 26%),
    linear-gradient(160deg, #151b25 0%, #0b1018 58%, #05070a 100%);
}

.viewer-header {
  border-bottom-color: var(--glass-line);
  background: rgba(8, 11, 17, 0.58);
  backdrop-filter: blur(18px) saturate(1.22);
}

.viewer-toolbar-block,
.insight-card,
.viewer-stage-shell,
.viewer-overlay,
.runtime-pill,
.viewer-stage-badge {
  border-color: var(--glass-line);
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(18px) saturate(1.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 42px rgba(0, 0, 0, 0.2);
}

.viewer-header h1,
.viewer-toolbar-block strong,
.insight-card strong,
.viewer-stage-head strong,
.runtime-pill,
.viewer-stage-badge {
  color: var(--glass-ink);
}

.viewer-header p,
.runtime-note,
.viewer-stage-head span,
.viewer-toolbar-label,
.insight-card span {
  color: var(--glass-muted);
}

.side-pane {
  color: var(--glass-ink);
  border-left: 1px solid var(--glass-line);
  background:
    linear-gradient(180deg, rgba(15, 20, 30, 0.82), rgba(7, 10, 15, 0.94)),
    radial-gradient(circle at 20% 6%, rgba(142, 202, 230, 0.13), transparent 30%),
    radial-gradient(circle at 96% 24%, rgba(217, 164, 65, 0.1), transparent 28%);
}

.side-pane::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    radial-gradient(circle at 24% 8%, rgba(142, 202, 230, 0.13), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 36%);
  background-size: 88px 88px, 88px 88px, auto, auto;
  mask-image: linear-gradient(180deg, black, rgba(0, 0, 0, 0.72));
}
.control-pane-header {
  background: rgba(16, 22, 33, 0.76);
}

.control-pane-header strong,
.side-pane .card h2,
.dropzone-content strong,
.project-item strong,
.workflow-item strong,
.summary-note strong,
.semantic-block h3,
.capability-detail strong,
.chat-bubble header strong,
.cae-chip-card strong,
.cae-list-item strong,
.chat-connection-card strong,
.capability-item strong,
.agent-chat-strip strong {
  color: var(--glass-ink);
}

.control-pane-kicker {
  color: var(--glass-accent);
}

.side-pane .section-heading p,
.side-pane .project-item-main small,
.side-pane .workflow-item p,
.side-pane .summary-note p,
.side-pane .chat-bubble p,
.side-pane .chat-empty-state p,
.side-pane .chat-connection-card small,
.side-pane .agent-chat-strip span,
.side-pane .capability-detail-head span,
.side-pane .cae-list-item small,
.side-pane .cae-chip-card small,
.dropzone-content span,
.project-metadata span,
.semantic-overview span,
.capability-facts span,
.semantic-map-item span,
.workflow-step-item span,
.cae-overview-grid span,
.cae-field-head span,
.cae-chip-card span,
.cae-list-item span,
.control-pane-tab span {
  color: var(--glass-muted);
}

.control-pane-tabs {
  background: rgba(255, 255, 255, 0.045);
}

.side-pane .control-pane-tab {
  color: var(--glass-soft);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.side-pane .control-pane-tab:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.075);
}

.side-pane .control-pane-tab.active {
  color: var(--glass-ink);
  border-color: rgba(142, 202, 230, 0.3);
  background:
    linear-gradient(180deg, rgba(142, 202, 230, 0.16), rgba(255, 255, 255, 0.075));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 var(--glass-accent),
    0 14px 30px rgba(0, 0, 0, 0.2);
}

.control-pane-tab strong {
  color: inherit;
}

.side-pane input,
.side-pane select,
.side-pane textarea {
  color: var(--glass-ink);
  border-color: var(--glass-line);
  background: rgba(3, 7, 12, 0.42);
}

.side-pane input:focus,
.side-pane select:focus,
.side-pane textarea:focus {
  border-color: rgba(142, 202, 230, 0.72);
  box-shadow: 0 0 0 3px rgba(142, 202, 230, 0.14);
}

.side-pane button {
  color: var(--glass-ink);
  border-color: rgba(142, 202, 230, 0.26);
  background:
    linear-gradient(180deg, rgba(142, 202, 230, 0.22), rgba(63, 83, 105, 0.22)),
    rgba(255, 255, 255, 0.055);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 28px rgba(0, 0, 0, 0.2);
}

.side-pane .ghost-button,
.side-pane .chat-suggestion,
.side-pane .chat-artifact-link,
.side-pane .compact-button {
  color: var(--glass-soft);
  border-color: var(--glass-line);
  background: rgba(255, 255, 255, 0.055);
}

.side-pane .ghost-button:hover:not(:disabled),
.side-pane .chat-suggestion:hover:not(:disabled),
.side-pane .chat-artifact-link:hover:not(:disabled),
.side-pane .compact-button:hover:not(:disabled) {
  color: var(--glass-ink);
  border-color: var(--glass-line-strong);
  background: rgba(255, 255, 255, 0.09);
}

.dropzone {
  border-color: rgba(142, 202, 230, 0.32);
  background:
    linear-gradient(180deg, rgba(142, 202, 230, 0.09), rgba(255, 255, 255, 0.045)),
    rgba(6, 10, 16, 0.62);
  backdrop-filter: blur(18px) saturate(1.18);
}

.dropzone:hover {
  border-color: rgba(142, 202, 230, 0.62);
}

.summary-primary {
  border-color: rgba(115, 214, 162, 0.28);
  background: rgba(48, 112, 83, 0.18);
}

.summary-muted {
  background: rgba(255, 255, 255, 0.04);
}

.fold-summary {
  color: var(--glass-soft);
}

.side-pane .json-block {
  color: #d7e0eb;
  border-color: var(--glass-line);
  background: rgba(3, 7, 12, 0.68);
}

.side-pane .project-item.active {
  border-color: rgba(217, 164, 65, 0.34);
  background: rgba(217, 164, 65, 0.1);
  box-shadow:
    inset 4px 0 0 var(--glass-amber),
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 16px 34px rgba(0, 0, 0, 0.18);
}

.side-pane .chat-connection-card,
.side-pane .capability-item {
  color: var(--glass-soft);
  background: rgba(255, 255, 255, 0.052);
}

.side-pane .chat-connection-card:hover:not(:disabled),
.side-pane .capability-item:hover:not(:disabled),
.side-pane .project-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.085);
}

.side-pane .chat-connection-card.active,
.side-pane .capability-item.active {
  border-color: rgba(115, 214, 162, 0.34);
  background: rgba(115, 214, 162, 0.1);
  box-shadow:
    inset 4px 0 0 var(--glass-green),
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 16px 34px rgba(0, 0, 0, 0.18);
}

.connection-status.status-ready {
  color: #c9f7da;
  background: rgba(115, 214, 162, 0.17);
}

.connection-status.status-configurable,
.connection-status.status-degraded {
  color: #ffe6a8;
  background: rgba(217, 164, 65, 0.16);
}

.connection-status.status-blocked {
  color: #ffd0d0;
  background: rgba(255, 143, 143, 0.14);
}

.status-active {
  border-color: rgba(142, 202, 230, 0.36);
  box-shadow: inset 4px 0 0 var(--glass-accent);
}

.status-done {
  border-color: rgba(115, 214, 162, 0.3);
  box-shadow: inset 4px 0 0 var(--glass-green);
}

.status-error {
  border-color: rgba(255, 143, 143, 0.32);
  box-shadow: inset 4px 0 0 var(--glass-red);
}

.agent-chat-strip {
  border-color: rgba(142, 202, 230, 0.2);
  background:
    linear-gradient(135deg, rgba(142, 202, 230, 0.13), rgba(255, 255, 255, 0.055));
  backdrop-filter: blur(20px) saturate(1.18);
}

.chat-bubble.user {
  background: rgba(142, 202, 230, 0.1);
}

.chat-bubble.assistant {
  background: rgba(255, 255, 255, 0.055);
}

.chat-bubble header {
  color: var(--glass-muted);
}

.chat-audit-link,
.artifact-link {
  color: var(--glass-accent);
}

.side-effect-list span {
  color: #c9f7da;
  border-color: rgba(115, 214, 162, 0.22);
  background: rgba(115, 214, 162, 0.11);
}

.side-pane::-webkit-scrollbar-thumb,
.json-block::-webkit-scrollbar-thumb {
  background: rgba(142, 202, 230, 0.24);
}

.notification-center {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 100;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.notification-card {
  pointer-events: auto;
  border-color: var(--glass-line-strong);
  background:
    linear-gradient(180deg, rgba(19, 26, 38, 0.82), rgba(7, 10, 16, 0.76));
  color: var(--glass-ink);
  backdrop-filter: blur(24px) saturate(1.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 22px 64px rgba(0, 0, 0, 0.34);
}

.notification-copy strong {
  color: var(--glass-ink);
}

.notification-copy span {
  color: var(--glass-muted);
}

.notification-close {
  color: var(--glass-muted);
}

.notification-close:hover:not(:disabled) {
  color: var(--glass-ink);
  background: rgba(255, 255, 255, 0.08);
}

.notification-success {
  border-left-color: var(--glass-green);
}

.notification-success .notification-icon {
  color: #062012;
  background: var(--glass-green);
}

.notification-error {
  border-left-color: var(--glass-red);
}

.notification-error .notification-icon {
  color: #2a0707;
  background: var(--glass-red);
}

.notification-info {
  border-left-color: var(--glass-accent);
}

.notification-info .notification-icon {
  color: #061923;
  background: var(--glass-accent);
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) minmax(540px, 46vw);
  }

  .side-pane::before {
    width: max(540px, 46vw);
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-pane {
    border-left: 0;
  }

  .notification-center {
    top: 14px;
    right: 14px;
  }
}

/* Minimal highlight refinement */
.side-pane,
.viewer-pane {
  --radius-xl: 10px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --active-bg: rgba(142, 202, 230, 0.13);
  --active-bg-warm: rgba(217, 164, 65, 0.12);
  --active-border: rgba(142, 202, 230, 0.36);
}

button,
input,
select,
textarea {
  border-radius: var(--radius-md, 10px);
}

.runtime-pill,
.viewer-stage-badge,
.llm-readiness-pill,
.connection-status,
.cae-mode-badge {
  border-radius: var(--radius-md, 6px);
}

.viewer-toolbar-block,
.insight-card,
.viewer-stage-shell,
.viewer-overlay,
.control-pane-header,
.control-pane-tabs,
.side-pane .card,
.settings-drawer,
.drawer-section,
.dropzone,
.chat-window,
.agent-chat-strip,
.agent-plan-preview,
.capability-detail,
.cae-field-shell,
.notification-card {
  border-radius: var(--radius-xl);
}
.side-pane .control-pane-tab.active {
  border-color: var(--active-border);
  background: var(--active-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 24px rgba(0, 0, 0, 0.16);
}

.side-pane .project-item.active {
  border-color: rgba(217, 164, 65, 0.32);
  background: var(--active-bg-warm);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.16);
}

.side-pane .chat-connection-card.active,
.side-pane .capability-item.active {
  border-color: rgba(115, 214, 162, 0.32);
  background: rgba(115, 214, 162, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.16);
}

.status-active,
.status-done,
.status-error {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(0, 0, 0, 0.14);
}

.status-active {
  border-color: rgba(142, 202, 230, 0.34);
  background: rgba(142, 202, 230, 0.1);
}

.status-done {
  border-color: rgba(115, 214, 162, 0.3);
  background: rgba(115, 214, 162, 0.1);
}

.status-error {
  border-color: rgba(255, 143, 143, 0.3);
  background: rgba(255, 143, 143, 0.1);
}

.side-pane .control-pane-tab:hover:not(:disabled),
.side-pane .chat-connection-card:hover:not(:disabled),
.side-pane .capability-item:hover:not(:disabled),
.side-pane .project-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

/* Side icon rail for workspace navigation */
.side-pane {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-content: start;
  align-items: start;
  column-gap: 14px;
}

.side-pane > :not(.control-pane-header):not(.control-pane-tabs) {
  grid-column: 2;
  min-width: 0;
}

.control-pane-header {
  grid-column: 1 / -1;
}

.control-pane-tabs {
  position: sticky;
  top: 16px;
  grid-column: 1;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 58px;
  padding: 6px;
  border-radius: 10px;
}

.side-pane .control-pane-tab {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 46px;
  width: 46px;
  padding: 0;
  border-radius: 8px;
}

.control-pane-tab svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.control-pane-tab-copy {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  z-index: 80;
  display: flex;
  width: 190px;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--glass-line-strong);
  border-radius: 8px;
  background: rgba(9, 13, 20, 0.92);
  color: var(--glass-ink);
  opacity: 0;
  pointer-events: none;
  transform: translate(4px, -50%);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  backdrop-filter: blur(18px) saturate(1.16);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.control-pane-tab-copy strong {
  font-size: 12px;
}

.control-pane-tab-copy span {
  color: var(--glass-muted);
  font-size: 11px;
  line-height: 1.35;
}

.side-pane .control-pane-tab:hover .control-pane-tab-copy,
.side-pane .control-pane-tab:focus-visible .control-pane-tab-copy {
  opacity: 1;
  transform: translate(0, -50%);
}

/* Product-mode right rail: keep primary navigation compact and calm. */
.side-pane .control-pane-tabs {
  grid-column: 1 / -1;
  position: relative;
  top: auto;
  width: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(229, 224, 213, 0.82);
}

.side-pane .control-pane-tab {
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #3c4654;
}

.side-pane .control-pane-tab.active {
  color: #f8fafc;
  border-color: rgba(17, 24, 39, 0.18);
  background: #20252d;
  box-shadow: 0 10px 22px rgba(32, 37, 45, 0.16);
}

.side-pane .control-pane-tab strong {
  color: inherit;
  font-size: 12px;
}

.side-pane .control-pane-tab span {
  color: rgba(60, 70, 84, 0.78);
}

.side-pane .control-pane-tab.active span {
  color: rgba(248, 250, 252, 0.7);
}

.side-pane .control-pane-tab-copy {
  position: static;
  opacity: 1;
  transform: none;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.side-pane .control-pane-tab:hover .control-pane-tab-copy,
.side-pane .control-pane-tab:focus-visible .control-pane-tab-copy {
  transform: none;
}

.advanced-panel-intro {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(34, 39, 47, 0.08);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.72);
}

.advanced-panel-intro strong {
  color: #20252d;
  font-size: 13px;
}

.advanced-panel-intro span {
  color: #6d7480;
  font-size: 12px;
  line-height: 1.45;
}

.debug-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.debug-panel-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
}

.debug-panel-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(8, 15, 30, 0.74);
  color: #9fb1cc;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}

.debug-panel-tab.active {
  border-color: rgba(125, 211, 252, 0.54);
  background: rgba(14, 116, 144, 0.24);
  color: #e0f2fe;
}

.debug-panel-body {
  min-width: 0;
}

.selection-inspector-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.055);
}

/* ── Shape IR objects card ─────────────────────────────────────────────── */
.shapeir-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.055);
}

/* Editable Parameter Explorer panel */
.editparams-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.055);
}

.editparams-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.editparams-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.editparams-scope {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #b9c9e3;
}

.editparams-scope-local {
  border-color: rgba(52, 211, 153, 0.45);
  color: #b8f0d6;
}

.editparams-scope-global {
  border-color: rgba(217, 164, 65, 0.45);
  color: #fde0a3;
}

.editparams-scope-count {
  font-weight: 700;
  opacity: 0.8;
}

.editparams-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 12px;
  color: #c4d6f4;
}

.editparams-row:hover {
  background: rgba(148, 163, 184, 0.06);
}

.editparams-name {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 650;
  color: #cfe6ff;
  cursor: pointer;
  text-align: left;
}

.editparams-name:hover:not(:disabled) {
  text-decoration: underline;
}

.editparams-name:disabled {
  cursor: default;
  color: #b9c9e3;
}

.editparams-const {
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(2, 6, 23, 0.32);
  color: #9fb6d6;
  font-size: 10px;
}

.editparams-value {
  font-weight: 750;
  color: #e7f0ff;
}

.editparams-range {
  color: #8aa0c0;
  font-size: 11px;
}

.editparams-feature {
  margin-left: auto;
  color: #7f93b4;
  font-size: 11px;
}

.editparams-foot {
  color: #7f93b4;
  font-size: 11px;
}

.editparams-foot code {
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(2, 6, 23, 0.32);
}

/* Critique panel */
.critique-card,
.readiness-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.055);
}

.critique-head,
.readiness-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.critique-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.critique-sev {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #b9c9e3;
}

.critique-sev-high {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

.critique-sev-medium {
  border-color: rgba(217, 164, 65, 0.5);
  color: #fde0a3;
}

.critique-sev-count {
  font-weight: 700;
  opacity: 0.8;
}

.critique-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 12px;
  color: #c4d6f4;
}

.critique-row:hover {
  background: rgba(148, 163, 184, 0.06);
}

.critique-row-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.critique-rule {
  font-weight: 650;
  color: #cfe6ff;
}

.critique-feature {
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(2, 6, 23, 0.32);
  color: #9fb6d6;
  font-size: 10px;
}

.critique-observation {
  color: #9fb6d6;
}

.critique-fix,
.readiness-add {
  appearance: none;
  flex: 0 0 auto;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.1);
  color: #bfe3ff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.critique-fix:hover:not(:disabled),
.readiness-add:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.2);
}

.critique-fix:disabled,
.readiness-add:disabled {
  opacity: 0.5;
  cursor: default;
}

.critique-foot,
.readiness-foot {
  color: #7f93b4;
  font-size: 11px;
}

.critique-foot code,
.readiness-foot code {
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(2, 6, 23, 0.32);
}

/* Simulation readiness panel */
.readiness-ok {
  color: #34d399;
  font-weight: 750;
}

.readiness-blocked {
  color: #f5b945;
  font-weight: 750;
}

.readiness-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 12px;
  color: #c4d6f4;
}

.readiness-status {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
}

.readiness-status-present {
  background: #34d399;
}

.readiness-status-missing {
  background: #fb7185;
}

.readiness-status-defaultable {
  background: #f5b945;
}

.readiness-status-unknown {
  background: #94a3b8;
}

.readiness-label {
  font-weight: 650;
  color: #cfe6ff;
}

.readiness-required {
  color: #fb7185;
  margin-left: 2px;
}

.readiness-detail {
  flex: 1;
  min-width: 0;
  color: #8aa0c0;
}

/* Optimization panel */
.optimization-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.055);
}

.optimization-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.optimization-warnings {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.optimization-warning {
  font-size: 11px;
  color: #f5b945;
}

.optimization-honesty {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  width: fit-content;
}

.optimization-honesty-good {
  color: #34d399;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.optimization-honesty-bad {
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.optimization-honesty-neutral {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.optimization-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.optimization-feasibility {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #b9c9e3;
}

.optimization-feasibility-feasible {
  border-color: rgba(52, 211, 153, 0.45);
  color: #b8f0d6;
}

.optimization-feasibility-infeasible {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.optimization-feasibility-failed {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.optimization-feasibility-unknown {
  border-color: rgba(245, 185, 69, 0.45);
  color: #fde0a3;
}

.optimization-feasibility-count {
  font-weight: 700;
  opacity: 0.8;
}

.optimization-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 12px;
  color: #c4d6f4;
}

.optimization-row:hover {
  background: rgba(148, 163, 184, 0.06);
}

.optimization-row-unknown {
  opacity: 0.75;
}

.optimization-row-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.optimization-rank {
  font-weight: 750;
  color: #e7f0ff;
  min-width: 1.5em;
}

.optimization-candidate-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: #9fb6d6;
}

.optimization-score {
  font-weight: 750;
  color: #e7f0ff;
}

.optimization-confidence {
  font-size: 10px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}

.optimization-confidence-high {
  color: #b8f0d6;
  background: rgba(52, 211, 153, 0.12);
}

.optimization-confidence-medium {
  color: #fde0a3;
  background: rgba(245, 185, 69, 0.12);
}

.optimization-confidence-low {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
}

.optimization-unknown-badge {
  font-size: 9px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(245, 185, 69, 0.15);
  color: #fde0a3;
  font-weight: 700;
}

.optimization-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 1.5em;
}

.optimization-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.optimization-metric-key {
  color: #7f93b4;
}

.optimization-metric-value {
  color: #e7f0ff;
  font-weight: 650;
}

.optimization-accept {
  appearance: none;
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.1);
  color: #bfe3ff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.optimization-accept:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.2);
}

.optimization-accept-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.08);
  color: #94a3b8;
}

.optimization-recommendation {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(2, 6, 23, 0.3);
}

.optimization-recommendation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.optimization-recommendation-text {
  font-size: 12px;
  color: #cfe6ff;
  margin: 0;
}

.optimization-advisory-badge {
  font-size: 9px;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(245, 185, 69, 0.15);
  color: #fde0a3;
  font-weight: 700;
  border: 1px solid rgba(245, 185, 69, 0.25);
}

.optimization-reason-list {
  margin: 0;
  padding-left: 18px;
  font-size: 11px;
  color: #b9c9e3;
}

.optimization-caveats {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
}

.optimization-caveat {
  color: #f5b945;
}

.optimization-report {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.optimization-report-text {
  font-size: 11px;
  color: #b9c9e3;
  margin: 0;
}

.optimization-foot {
  color: #7f93b4;
  font-size: 11px;
}

.optimization-foot code {
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(2, 6, 23, 0.32);
}

/* ── Optimization panel deepening ─────────────────────────────────────────── */

.optimization-overview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(2, 6, 23, 0.3);
}

.optimization-overview-title {
  font-size: 12px;
  color: #e2e8f0;
}

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

.optimization-overview-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.4);
}

.optimization-overview-key {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7f93b4;
}

.optimization-overview-value {
  font-size: 11px;
  color: #e7f0ff;
  font-weight: 650;
}

.optimization-feasibility-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.optimization-feasibility-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.5);
  color: #b9c9e3;
}

.optimization-feasibility-pill-feasible {
  border-color: rgba(52, 211, 153, 0.4);
  color: #b8f0d6;
}

.optimization-feasibility-pill-infeasible {
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

.optimization-feasibility-pill-failed {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.optimization-feasibility-pill-unknown {
  border-color: rgba(245, 185, 69, 0.4);
  color: #fde0a3;
}

.optimization-expand-toggle {
  appearance: none;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
}

.optimization-expand-toggle:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
}

.optimization-expand-toggle:disabled {
  cursor: default;
  opacity: 0.35;
}

.optimization-expand-placeholder {
  display: inline-block;
  width: 14px;
}

.optimization-candidate-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  margin-left: 1.5em;
  border-radius: 6px;
  border: 1px solid rgba(71, 85, 105, 0.2);
  background: rgba(2, 6, 23, 0.35);
  font-size: 11px;
}

.optimization-detail-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.optimization-detail-key {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7f93b4;
}

.optimization-detail-value {
  color: #e7f0ff;
}

.optimization-delta-absolute {
  color: #94a3b8;
  margin-left: 4px;
}

.optimization-violations {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.optimization-violation {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.optimization-missing-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.optimization-missing-metric {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245, 185, 69, 0.12);
  color: #fde0a3;
  border: 1px solid rgba(245, 185, 69, 0.25);
}

.optimization-row-failed {
  opacity: 0.85;
}

.optimization-execution-status {
  font-size: 10px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  font-weight: 700;
}

.optimization-failed-reasons {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 1.5em;
}

.optimization-failed-reason {
  font-size: 11px;
  color: #fca5a5;
}

.optimization-iteration-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(2, 6, 23, 0.3);
}

.optimization-iteration-history-title {
  font-size: 12px;
  color: #e2e8f0;
}

.optimization-iteration-table-wrap {
  overflow: auto;
}

.optimization-iteration-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
  color: #c4d6f4;
}

.optimization-iteration-table th,
.optimization-iteration-table td {
  padding: 5px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(71, 85, 105, 0.25);
}

.optimization-iteration-table th {
  color: #7f93b4;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.optimization-iteration-table tr:last-child td {
  border-bottom: none;
}

.optimization-missing-stages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(245, 185, 69, 0.2);
  background: rgba(120, 53, 15, 0.1);
}

.optimization-missing-stages strong {
  font-size: 12px;
  color: #fde0a3;
}

.optimization-missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.optimization-missing-stage {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 185, 69, 0.12);
  color: #fde0a3;
  border: 1px solid rgba(245, 185, 69, 0.25);
}

.shapeir-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

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

.shapeir-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
}

.shapeir-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.shapeir-item.active {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--accent, #6ea8fe);
}

.shapeir-chip {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(110, 168, 254, 0.18);
  color: var(--text-secondary);
}

.shapeir-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--glass-line);
}

.shapeir-meta-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shapeir-hint {
  font-size: 10px;
  color: var(--accent, #6ea8fe);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.shapeir-meta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  margin: 0;
  font-size: 12px;
}

.shapeir-meta-grid dt {
  color: var(--text-secondary);
}

.shapeir-meta-grid dd {
  margin: 0;
  color: var(--text-primary);
}

.shapeir-params {
  font-size: 12px;
}

.shapeir-params-label {
  color: var(--text-secondary);
}

.shapeir-params ul {
  margin: 4px 0 0;
  padding-left: 16px;
}

.shapeir-verification {
  font-size: 12px;
  color: var(--text-secondary);
}

.selection-inspector-head,
.selection-inspector-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.selection-inspector-head strong {
  font-size: 13px;
}

.selection-inspector-head span,
.selection-inspector-item span {
  color: var(--glass-muted);
  font-size: 11px;
}

.selection-inspector-note {
  margin: 2px 0 0;
  color: var(--glass-muted);
  font-size: 11px;
  line-height: 1.4;
}

.selection-inspector-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selection-inspector-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  background: rgba(8, 15, 30, 0.44);
}

.selection-inspector-item code {
  color: #eaf6ff;
  font-size: 11px;
}

.selection-inspector-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selection-inspector-suggestions .compact-button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 11px;
}

@media (max-width: 1080px) {
  .side-pane {
    grid-template-columns: 1fr;
  }

  .side-pane > :not(.control-pane-header):not(.control-pane-tabs),
  .control-pane-header,
  .control-pane-tabs {
    grid-column: 1;
  }

  .control-pane-tabs {
    position: static;
    display: grid;
    width: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .side-pane .control-pane-tab {
    width: auto;
  }

  .control-pane-tab-copy {
    display: none;
  }
}

button .button-icon {
  flex: 0 0 auto;
  display: block;
  width: 15px;
  height: 15px;
  margin-right: 7px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

button:has(.button-icon) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.compact-button .button-icon,
.drawer-close .button-icon {
  width: 14px;
  height: 14px;
  margin-right: 6px;
}

.action-grid button,
.action-row button,
.runtime-actions button,
.runtime-config-actions button,
.agent-chat-actions button,
.legacy-chat-actions button,
.section-heading button,
.primary-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.chat-suggestion .button-icon,
.artifact-link .button-icon,
.notification-close .button-icon,
.control-pane-tab .button-icon {
  margin-right: 0;
}

/* Phase 39 — Recommendations panel (MVP) */
.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}
.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.panel__actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.panel__hint {
  color: rgba(241,245,249,0.55);
  font-size: 13px;
  margin: 0;
}
.panel__error {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  background: #111827;
  color: #e2e8f0;
}
.badge-pass { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-warn { background: rgba(251,191,36,0.15); color: #fbbf24; }
.badge-fail { background: rgba(248,113,113,0.15); color: #f87171; }
.recommendations__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
}
.recommendations__one-line {
  color: #5a6c7a;
  font-style: italic;
}
.recommendations__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recommendations__skipped {
  font-size: 13px;
  color: #5a6c7a;
}
.proposal-card {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 12px;
  background: #111827;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.proposal-card__header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}
.proposal-card__rank {
  background: #2d3a44;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
}
.proposal-card__action {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #111827;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
}
.proposal-card__confidence {
  color: #5a6c7a;
  font-size: 12px;
}
.proposal-card__row {
  font-size: 13px;
  color: #e2e8f0;
}
.proposal-card__row em {
  font-style: normal;
  color: #5a6c7a;
  font-weight: 500;
  margin-right: 4px;
}
.proposal-card__risks {
  margin: 4px 0;
  padding-left: 18px;
  color: #fbbf24;
  font-size: 13px;
}
.proposal-card__verdict-details {
  margin-top: 4px;
  font-size: 13px;
}
.proposal-card__checks {
  margin: 4px 0;
  padding-left: 18px;
}
.proposal-card__checks li {
  margin: 2px 0;
  color: #e2e8f0;
}
.proposal-card__checks code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  margin-right: 4px;
}

/* Phase 39b — Apply proposal controls */
.proposal-card__apply {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #d6dce0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.proposal-card__apply-blocked {
  font-size: 13px;
  color: #f87171;
  font-style: italic;
}
.proposal-card__apply-ack {
  font-size: 13px;
  color: #fbbf24;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}
.proposal-card__apply-btn {
  align-self: flex-start;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid #2d3a44;
  background: #2d3a44;
  color: #ffffff;
  cursor: pointer;
}
.proposal-card__apply-btn:hover:not(:disabled) {
  background: #1c2730;
}
.proposal-card__apply-btn:disabled {
  background: #adb6bd;
  border-color: #adb6bd;
  cursor: not-allowed;
}
.proposal-card__run-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.proposal-card__run-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #5a6c7a;
  background: #111827;
  padding: 1px 4px;
  border-radius: 3px;
}
.proposal-card__approve-btn {
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid #1d5a2c;
  background: #1d5a2c;
  color: #ffffff;
  cursor: pointer;
}
.proposal-card__approve-btn:disabled {
  background: #adb6bd;
  border-color: #adb6bd;
  cursor: not-allowed;
}
.proposal-card__reject-btn {
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid #8a1f1f;
  background: #111827;
  color: #f87171;
  cursor: pointer;
}
.proposal-card__reject-btn:disabled {
  color: #adb6bd;
  border-color: #adb6bd;
  cursor: not-allowed;
}
.proposal-card__run-errors {
  width: 100%;
  margin: 4px 0;
  padding-left: 18px;
  color: #f87171;
  font-size: 12px;
}

/* Closed-loop Copilot Stepper v0 */
.copilot-loop-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.copilot-loop__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: rgba(241,245,249,0.55);
  font-size: 13px;
}
.copilot-stepper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.copilot-step {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px;
  background: #111827;
}
.copilot-step--skipped {
  background: rgba(255, 255, 255, 0.02);
}
.copilot-step__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.copilot-step__header > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.copilot-step__header strong {
  color: #f1f5f9;
}
.copilot-step__header span {
  color: rgba(241, 245, 249, 0.55);
  font-size: 13px;
}
.copilot-step__badges,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.badge-muted {
  opacity: 0.65;
}
.danger {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}
.compact-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 10px;
  margin: 8px 0;
  font-size: 13px;
}
.compact-dl dt {
  color: #687783;
  font-weight: 600;
}
.compact-dl dd {
  margin: 0;
}
.copilot-loop__checks,
.copilot-loop__toolcalls,
.warning-list,
.error-list,
.artifact-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
}
.copilot-loop__checks li,
.copilot-loop__toolcalls li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 3px 0;
}
.warning-list {
  color: #fbbf24;
}
.error-list {
  color: #f87171;
}
.table-scroll {
  overflow-x: auto;
}
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}
.mini-table th,
.mini-table td {
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 5px 6px;
  text-align: left;
}
.mini-table th {
  background: rgba(96,165,250,0.1);
}
.markdown-preview {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  background: #111820;
  color: #eef7ff;
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
}
.copilot-loop-panel .claim-boundary-banner {
  border: 1px solid rgba(255,255,255,0.06);
  background: #111827;
  border-radius: 12px;
  padding: 20px;
  margin: 8px 0;
  font-size: 13px;
}
.copilot-loop-panel .claim-boundary-banner strong {
  display: block;
  color: #4ade80;
  margin-bottom: 2px;
}
.copilot-loop-panel .claim-boundary-banner p {
  margin: 0;
  color: rgba(241,245,249,0.55);
}
.copilot-loop-panel .claim-boundary-banner--compact {
  margin-top: 10px;
  padding: 7px 10px;
  font-size: 12px;
}

/* v0.32 workflow sections — Copilot Loop tab is organized into six
   numbered sections (Readiness, Inputs, CAD Evidence, Structural CAE,
   Target Comparison, Review & Export). Each section wraps existing
   cards without changing card markup; the header band is purely
   navigational and informational. */
.copilot-loop-panel .workflow-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px;
  background: #111827;
}
.copilot-loop-panel .workflow-section__header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.copilot-loop-panel .workflow-section__eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(241, 245, 249, 0.35);
  font-weight: 600;
}
.copilot-loop-panel .workflow-section__title {
  margin: 2px 0 0;
  font-size: 15px;
  color: #f1f5f9;
  font-weight: 600;
}
.copilot-loop-panel .workflow-section__safety {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.copilot-loop-panel .workflow-section--review .workflow-section__safety {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
  color: #4ade80;
}
.copilot-loop-panel .workflow-section--comparison .workflow-section__safety {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.25);
  color: #60a5fa;
}
.copilot-loop-panel .workflow-section__hint {
  margin: 0;
  color: rgba(241, 245, 249, 0.55);
  font-size: 13px;
  line-height: 1.45;
}
.copilot-loop-panel .workflow-section__anchor {
  background: rgba(255, 255, 255, 0.02);
  border-style: dashed;
}

/* v0.33 — contextual approval blocks rendered inside the workflow section
   that triggered the approval. Visual style is consistent with the v0.32
   section cards (amber accent for "needs your attention"); buttons reuse
   the existing primary/ghost classes. */
.copilot-loop-panel .workflow-section__approval {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.08);
  padding: 20px;
  margin-top: 4px;
}
.copilot-loop-panel .workflow-section__approval-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f1f5f9;
  font-size: 14px;
}
.copilot-loop-panel .workflow-section__approval-title strong {
  font-weight: 600;
}
.copilot-loop-panel .workflow-section__approval-reason {
  margin: 0;
  color: #f1f5f9;
  font-size: 13px;
  line-height: 1.45;
}
.copilot-loop-panel .workflow-section__approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.copilot-loop-panel .workflow-section__approval--structural {
  border-color: rgba(192, 132, 252, 0.3);
  background: rgba(192, 132, 252, 0.08);
}

/* v0.34 — engineering template authoring card. The preview blocks use a
   monospace pre so the inert CAD script / FEA setup JSON / suggestion table
   read like inputs to a downstream review, not like UI chrome. */
.engineering-template-card .engineering-template-card__preview {
  margin: 4px 0 0;
  padding: 10px 12px;
  background: #0a0e1a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #f1f5f9;
  white-space: pre;
  overflow-x: auto;
  max-height: 360px;
}
.copilot-loop-panel .copilot-loop__subcard--empty {
  background: rgba(255, 255, 255, 0.02);
  border-style: dashed;
  color: rgba(241, 245, 249, 0.35);
}
.copilot-loop-panel .copilot-loop__history,
.copilot-loop-panel .copilot-loop__compare {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #111827;
  border-radius: 12px;
  padding: 10px;
  margin-top: 12px;
}
.copilot-loop-panel .copilot-loop__compare {
  border-color: rgba(255, 255, 255, 0.06);
  background: #111827;
}
.copilot-loop-panel .copilot-loop__history-header,
.copilot-loop-panel .copilot-loop__compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.copilot-loop-panel .copilot-loop__history-table {
  font-size: 12px;
}
.copilot-loop-panel .copilot-loop__history-proposal {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.copilot-loop-panel .copilot-loop__history-row--active {
  background: rgba(96, 165, 250, 0.1);
}
.copilot-loop-panel .copilot-loop__compare-table th[scope="row"] {
  font-weight: 600;
  color: rgba(241, 245, 249, 0.55);
  white-space: nowrap;
}
.copilot-loop-panel .copilot-loop__compare-table th {
  background: rgba(255, 255, 255, 0.04);
}
.copilot-loop-panel .copilot-loop__report-diff {
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  margin-top: 10px;
  padding-top: 10px;
}
.copilot-loop-panel .copilot-loop__report-diff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.copilot-loop-panel .copilot-loop__report-diff-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: rgba(241, 245, 249, 0.55);
  margin: 6px 0;
}
.copilot-loop-panel .copilot-loop__report-diff-unified {
  font-size: 12px;
}
.copilot-loop-panel .copilot-loop__report-diff-raw {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.copilot-loop-panel .copilot-loop__report-diff-raw pre {
  font-size: 11px;
  max-height: 320px;
}
.copilot-loop-panel .copilot-loop__what-changed {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #111827;
  border-radius: 12px;
  padding: 8px 10px;
  margin: 8px 0;
}
.copilot-loop-panel .copilot-loop__what-changed strong {
  display: block;
  color: #f1f5f9;
  margin-bottom: 4px;
}
.copilot-loop-panel .copilot-loop__what-changed-table {
  font-size: 12px;
}
.copilot-loop-panel .copilot-loop__what-changed-row--critical td:first-child {
  border-left: 3px solid transparent;
}
.copilot-loop-panel .copilot-loop__what-changed-row--warning td:first-child {
  border-left: 3px solid transparent;
}
.copilot-loop-panel .copilot-loop__what-changed-row--info td:first-child {
  border-left: 3px solid transparent;
}
.copilot-loop-panel .copilot-loop__review-export {
  border-top: 1px dashed rgba(255,255,255,0.06);
  margin-top: 10px;
  padding-top: 10px;
}
.copilot-loop-panel .copilot-loop__review-export-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.copilot-loop-panel .copilot-loop__review-export-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: rgba(241,245,249,0.55);
  margin: 6px 0;
}
.copilot-loop-panel .copilot-loop__review-export-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.copilot-loop-panel .copilot-loop__review-export-result {
  border: 1px solid rgba(255,255,255,0.06);
  background: #111827;
  border-radius: 12px;
  padding: 20px;
  margin-top: 8px;
}
.copilot-loop-panel .copilot-loop__review-export-preview {
  max-height: 280px;
}
.copilot-loop-panel .copilot-loop__demo-card {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #111827;
  border-radius: 12px;
  padding: 20px;
  margin: 8px 0;
}
.copilot-loop-panel .copilot-loop__demo-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.copilot-loop-panel .copilot-loop__demo-card-header > div:first-child {
  flex: 1 1 320px;
  min-width: 0;
}
.copilot-loop-panel .copilot-loop__demo-card-header strong {
  display: block;
  color: #4ade80;
}
.copilot-loop-panel .copilot-loop__demo-bullets {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: rgba(241, 245, 249, 0.55);
}
.copilot-loop-panel .copilot-loop__demo-success {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.06);
  background: #111827;
  border-radius: 6px;
}
.copilot-loop-panel .copilot-loop__demo-success strong {
  display: block;
  color: #4ade80;
  margin-bottom: 4px;
}

/* Demo Health Check v0.7 */
.copilot-loop-panel .copilot-loop__demo-health {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: #111827;
  border-radius: 6px;
}
.copilot-loop-panel .copilot-loop__demo-health-header {
  margin-bottom: 8px;
}
.copilot-loop-panel .copilot-loop__demo-health-header strong {
  display: block;
  color: #4ade80;
  font-size: 13px;
}
.copilot-loop-panel .copilot-loop__demo-health-result {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  background: #111827;
}
.copilot-loop-panel .copilot-loop__demo-health-result--pass {
  border-color: #2e7d54;
  background: #111827;
}
.copilot-loop-panel .copilot-loop__demo-health-result--fail {
  border-color: #c62828;
  background: rgba(248,113,113,0.08);
}
.copilot-loop-panel .copilot-loop__demo-health-result strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}
.copilot-loop-panel .copilot-loop__demo-health-result--pass strong {
  color: #4ade80;
}
.copilot-loop-panel .copilot-loop__demo-health-result--fail strong {
  color: #f87171;
}
.copilot-loop-panel .copilot-loop__demo-health-checklist {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.copilot-loop-panel .copilot-loop__demo-health-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
}
.copilot-loop-panel .copilot-loop__demo-health-check:last-child {
  border-bottom: none;
}
.copilot-loop-panel .copilot-loop__demo-health-check .badge {
  flex-shrink: 0;
  margin-top: 1px;
}
.copilot-loop-panel .copilot-loop__demo-health-check-label {
  font-weight: 600;
  color: #f1f5f9;
  min-width: 160px;
}
.copilot-loop-panel .copilot-loop__demo-health-check-summary {
  color: rgba(241,245,249,0.55);
  flex: 1 1 auto;
}
.copilot-loop-panel .copilot-loop__demo-health-check--failed .copilot-loop__demo-health-check-label,
.copilot-loop-panel .copilot-loop__demo-health-check--failed .copilot-loop__demo-health-check-summary {
  color: #f87171;
}
.copilot-loop-panel .copilot-loop__demo-health-check-details {
  margin: 4px 0 0 0;
  padding-left: 14px;
  color: rgba(241,245,249,0.35);
}

/* Project Health Recommended Actions v0.9 */
.copilot-loop-panel .copilot-loop__actions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.copilot-loop-panel .copilot-loop__actions-title {
  display: block;
  font-size: 12px;
  color: #f1f5f9;
  margin-bottom: 8px;
}
.copilot-loop-panel .copilot-loop__action-group {
  margin-bottom: 8px;
}
.copilot-loop-panel .copilot-loop__action-group-header {
  margin-bottom: 4px;
}
.copilot-loop-panel .copilot-loop__action-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.copilot-loop-panel .copilot-loop__action-item {
  padding: 8px 10px;
  border-radius: 6px;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 6px;
}
.copilot-loop-panel .copilot-loop__action-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.copilot-loop-panel .copilot-loop__action-label {
  font-weight: 600;
  font-size: 12px;
  color: #f1f5f9;
}
.copilot-loop-panel .copilot-loop__action-type {
  font-size: 11px;
  color: rgba(241,245,249,0.35);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.copilot-loop-panel .copilot-loop__action-summary {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: rgba(241,245,249,0.55);
  line-height: 1.4;
}
.copilot-loop-panel .copilot-loop__action-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.copilot-loop-panel .copilot-loop__action-safety {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.copilot-loop-panel .copilot-loop__action-button {
  white-space: nowrap;
}
.copilot-loop-panel .safety-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  background: #111827;
  color: rgba(241,245,249,0.35);
  border: 1px solid rgba(255,255,255,0.06);
}
.copilot-loop-panel .safety-badge--ok {
  background: #111827;
  color: #4ade80;
  border-color: #2e7d54;
}
.copilot-loop-panel .guided-readiness-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: rgba(96,165,250,0.1);
  color: #1e3a8a;
  font-size: 12px;
}
.copilot-loop-panel .guided-readiness-hint--action {
  border-color: #bbf7d0;
  background: rgba(34,197,94,0.08);
  color: #14532d;
}
.copilot-loop-panel .readiness-highlight {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  animation: readinessPulse 1.3s ease-in-out 2;
}
@keyframes readinessPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.28);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

/* Design Targets Card v0.10 */
.copilot-loop-panel .design-targets-card--collapsed {
  background: #111827;
}
.copilot-loop-panel .computed-metrics-card--collapsed {
  background: #111827;
}
.copilot-loop-panel .design-targets-save-success {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.copilot-loop-panel .computed-metrics-save-success {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.copilot-loop-panel .design-targets-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 12px;
}
.copilot-loop-panel .computed-metrics-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 12px;
}
.copilot-loop-panel .design-targets-table th,
.copilot-loop-panel .design-targets-table td,
.copilot-loop-panel .computed-metrics-table th,
.copilot-loop-panel .computed-metrics-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.copilot-loop-panel .design-targets-table th,
.copilot-loop-panel .computed-metrics-table th {
  font-weight: 600;
  color: #f1f5f9;
  background: #111827;
}
.copilot-loop-panel .design-targets-table td,
.copilot-loop-panel .computed-metrics-table td {
  color: rgba(241,245,249,0.55);
}
.copilot-loop-panel .design-targets-table tr:last-child td,
.copilot-loop-panel .computed-metrics-table tr:last-child td {
  border-bottom: none;
}
.copilot-loop-panel .design-targets-form {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  background: #111827;
}
.copilot-loop-panel .design-targets-form strong {
  display: block;
  font-size: 12px;
  color: #f1f5f9;
  margin-bottom: 8px;
}
.copilot-loop-panel .design-targets-form .form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.copilot-loop-panel .design-targets-form label {
  display: flex;
  flex-direction: column;
  flex: 1;
  font-size: 11px;
  color: rgba(241,245,249,0.55);
  gap: 3px;
}
.copilot-loop-panel .design-targets-form input,
.copilot-loop-panel .design-targets-form select,
.copilot-loop-panel .design-targets-form textarea {
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  background: #111827;
  color: #f1f5f9;
}
.copilot-loop-panel .design-targets-form textarea {
  width: 100%;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.copilot-loop-panel .computed-metrics-import {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  background: #111827;
}
.copilot-loop-panel .computed-metrics-import textarea {
  width: 100%;
  margin: 8px 0;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  background: #111827;
  color: #f1f5f9;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.copilot-loop-panel .computed-metrics-format {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(241,245,249,0.55);
}
.copilot-loop-panel .computed-metrics-format select {
  padding: 4px 6px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
}
.copilot-loop-panel .computed-metrics-preview,
.copilot-loop-panel .computed-metrics-mapping {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  background: #111827;
}
.copilot-loop-panel .computed-metrics-preview--ok {
  border-color: #bbf7d0;
  background: rgba(34,197,94,0.08);
}
.copilot-loop-panel .computed-metrics-preview--error {
  border-color: #fecaca;
  background: rgba(248,113,113,0.08);
}
.copilot-loop-panel .inline-success {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #111827;
  color: #4ade80;
  border: 1px solid #2e7d54;
  font-size: 12px;
}

.copilot-loop-panel .freecad-inspection-card__provenance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0;
}
.copilot-loop-panel .freecad-inspection-card__provenance .compact-dl {
  margin: 0;
}
.copilot-loop-panel .freecad-inspection-card__provenance .compact-dl dt {
  font-size: 11px;
  color: rgba(241,245,249,0.35);
}
.copilot-loop-panel .freecad-inspection-card__provenance .compact-dl dd {
  font-size: 12px;
  color: #f1f5f9;
}

.copilot-loop-panel .claim-boundary-snippet {
  margin-top: 8px;
  font-size: 11px;
}

/* ----------------------------------------------------------------------- */
/* v0.18 — FreeCAD feature-inspection card (read-only)                     */
/* Scoped under .freecad-inspection-card to avoid global pollution.        */
/* ----------------------------------------------------------------------- */

.freecad-inspection-card .freecad-inspection-card__preflight {
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px;
  background: #111827;
}

.freecad-inspection-card .freecad-inspection-card__result {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px;
  background: #111827;
}

.freecad-inspection-card .freecad-inspection-card__edit {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px;
  background: #111827;
}

.freecad-inspection-card .freecad-inspection-card__result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.freecad-inspection-card .freecad-inspection-card__edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(140px, 0.75fr);
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.freecad-inspection-card .field-stack {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}

.freecad-inspection-card .field-stack input,
.freecad-inspection-card .field-stack select {
  width: 100%;
  min-height: 34px;
}

.freecad-inspection-card .freecad-inspection-card__validation,
.freecad-inspection-card .freecad-inspection-card__edit-result {
  margin: 10px 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
}

.freecad-inspection-card .freecad-inspection-card__validation ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.freecad-inspection-card .freecad-inspection-card__validation--ok,
.freecad-inspection-card .freecad-inspection-card__edit-result--ok {
  border: 1px solid rgba(34,197,94,0.25);
  background: #111827;
  color: #4ade80;
}

.freecad-inspection-card .freecad-inspection-card__validation--warn,
.freecad-inspection-card .freecad-inspection-card__edit-result--warn {
  border: 1px solid rgba(251,191,36,0.25);
  background: rgba(251,191,36,0.08);
  color: #fbbf24;
}

.freecad-inspection-card .freecad-inspection-card__claim-boundary {
  border-top: 1px dashed #c4d2da;
  margin-top: 10px;
  padding-top: 8px;
  font-size: 11px;
  color: #4b5b66;
}

.freecad-inspection-card .freecad-inspection-card__health-prompt {
  margin-top: 10px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #111827;
  border-radius: 12px;
}

.freecad-inspection-card.freecad-inspection-card--collapsed .copilot-loop__demo-health > :not(.copilot-loop__demo-health-header):not(.panel__hint) {
  display: none;
}

@media (max-width: 720px) {
  .freecad-inspection-card .freecad-inspection-card__edit-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Intent Planner / Pilot Console (v0.35.1) ──────────────────────────── */

.pilot-card .pilot-input-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pilot-card textarea {
  width: 100%;
  min-height: 5rem;
  font: inherit;
  padding: 0.6rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border, #d0d0d8);
}
.pilot-sample-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.pilot-error {
  color: var(--error, #b22a2a);
  margin: 0;
}
.pilot-summary-facts {
  margin-top: 0.75rem;
}
.pilot-summary-block {
  margin-top: 1rem;
}
.pilot-summary-block h3 {
  margin: 0 0 0.4rem 0;
  font-size: 0.95rem;
}
.pilot-bullet-list {
  margin: 0;
  padding-left: 1.2rem;
}
.pilot-bullet-list li {
  margin: 0.15rem 0;
}
.pilot-claim-boundary {
  margin-top: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: rgba(0, 0, 0, 0.04);
  border-left: 3px solid var(--info, #4063b0);
  font-size: 0.85rem;
}
.pilot-missing {
  border-left: 3px solid var(--warning, #c67d00);
  padding-left: 0.6rem;
}
.pilot-refusal {
  border-left: 3px solid var(--error, #b22a2a);
  padding-left: 0.6rem;
}
.pilot-warnings {
  border-left: 3px solid var(--warning, #c67d00);
  padding-left: 0.6rem;
}
.pilot-actions-block {
  margin-top: 1.25rem;
}
.pilot-action-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.pilot-action-card {
  border: 1px solid var(--border, #d0d0d8);
  border-radius: 0.5rem;
  padding: 0.7rem 0.85rem;
  background: var(--card-bg, #fff);
}
.pilot-action-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}
.pilot-action-head small {
  display: block;
  color: var(--muted, #6a6a78);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}
.pilot-action-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.pilot-mode-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pilot-mode-read_only {
  background: rgba(60, 130, 80, 0.15);
  color: #2e6a3e;
}
.pilot-mode-metadata_write {
  background: rgba(64, 99, 176, 0.15);
  color: #2f4b88;
}
.pilot-mode-mutation {
  background: rgba(198, 125, 0, 0.18);
  color: #8a5a00;
}
.pilot-mode-expensive {
  background: rgba(178, 42, 42, 0.18);
  color: #7e1d1d;
}
.pilot-approval-badge {
  background: rgba(178, 42, 42, 0.1);
  color: #7e1d1d;
  border: 1px solid rgba(178, 42, 42, 0.35);
  padding: 0.05rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.72rem;
  text-transform: uppercase;
}
.pilot-action-meta {
  margin-top: 0.4rem;
  font-size: 0.85rem;
}
.pilot-action-meta > span {
  display: block;
  color: var(--muted, #6a6a78);
  font-weight: 600;
  margin-bottom: 0.1rem;
}
.pilot-action-meta ul {
  margin: 0;
  padding-left: 1.2rem;
}
.pilot-action-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.6rem;
}
.pilot-run-status {
  font-size: 0.78rem;
  text-transform: uppercase;
  padding: 0.05rem 0.4rem;
  border-radius: 0.25rem;
  background: rgba(0, 0, 0, 0.05);
}
.pilot-run-status.status-awaiting_approval {
  background: rgba(198, 125, 0, 0.18);
  color: #8a5a00;
}
.pilot-run-status.status-completed {
  background: rgba(60, 130, 80, 0.18);
  color: #2e6a3e;
}
.pilot-run-status.status-failed,
.pilot-run-status.status-rejected {
  background: rgba(178, 42, 42, 0.18);
  color: #7e1d1d;
}
.pilot-run-error {
  color: var(--error, #b22a2a);
  font-size: 0.8rem;
}
.pilot-disabled-hint {
  color: var(--muted, #6a6a78);
}

/* ── Observation block (v0.35.2) ───────────────────────────────────────── */

.pilot-observation {
  margin-top: 0.75rem;
  padding: 0.6rem 0.7rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border, #d0d0d8);
  background: rgba(0, 0, 0, 0.02);
}
.pilot-observation-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}
.pilot-observation-summary {
  margin: 0 0 0.5rem 0;
  font-size: 0.92rem;
}
.pilot-observation-section {
  margin-top: 0.4rem;
  font-size: 0.85rem;
}
.pilot-observation-section > span {
  display: block;
  font-weight: 600;
  color: var(--muted, #6a6a78);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.pilot-observation-section ul {
  margin: 0.1rem 0 0 0;
  padding-left: 1.2rem;
}
.pilot-observation-section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
}
.pilot-observation-stale {
  border-left: 3px solid var(--warning, #c67d00);
  padding-left: 0.5rem;
}
.pilot-observation-warnings {
  border-left: 3px solid var(--warning, #c67d00);
  padding-left: 0.5rem;
}
.pilot-observation-errors {
  border-left: 3px solid var(--error, #b22a2a);
  padding-left: 0.5rem;
}
.pilot-observation-next {
  border-left: 3px solid var(--info, #4063b0);
  padding-left: 0.5rem;
}
.pilot-observation-next li {
  margin-bottom: 0.25rem;
}
.pilot-observation-next li strong {
  display: block;
}
.pilot-observation-next li em {
  display: block;
  font-style: normal;
  color: var(--muted, #6a6a78);
}
.pilot-observation-next li small {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted, #6a6a78);
}
.pilot-observation-boundary {
  display: block;
  margin-top: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border, #d0d0d8);
  color: var(--muted, #6a6a78);
  font-style: italic;
}
.pilot-observation-submitted_for_approval {
  background: rgba(198, 125, 0, 0.05);
}
.pilot-observation-approved_executed,
.pilot-observation-completed {
  background: rgba(60, 130, 80, 0.05);
}
.pilot-observation-rejected,
.pilot-observation-failed {
  background: rgba(178, 42, 42, 0.05);
}

/* ── CAD observation block (v0.36) ─────────────────────────────────────── */

.pilot-cad-observation {
  margin-top: 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: 0.4rem;
  border: 1px dashed var(--border, #d0d0d8);
  background: rgba(64, 99, 176, 0.03);
}
.pilot-cad-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.pilot-cad-status,
.pilot-cad-evidence {
  font-size: 0.72rem;
  padding: 0.05rem 0.4rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.05);
}
.pilot-cad-status.status-available {
  background: rgba(60, 130, 80, 0.18);
  color: #2e6a3e;
}
.pilot-cad-status.status-metadata_only {
  background: rgba(64, 99, 176, 0.15);
  color: #2f4b88;
}
.pilot-cad-status.status-missing,
.pilot-cad-status.status-invalid,
.pilot-cad-status.status-unknown {
  background: rgba(178, 42, 42, 0.15);
  color: #7e1d1d;
}
.pilot-cad-evidence.evidence-none {
  background: rgba(178, 42, 42, 0.1);
  color: #7e1d1d;
}
.pilot-cad-evidence.evidence-metadata {
  background: rgba(198, 125, 0, 0.15);
  color: #8a5a00;
}
.pilot-cad-evidence.evidence-exported_geometry,
.pilot-cad-evidence.evidence-live_cad_snapshot {
  background: rgba(60, 130, 80, 0.18);
  color: #2e6a3e;
}
.pilot-cad-summary {
  margin: 0 0 0.4rem 0;
  font-size: 0.9rem;
}
.pilot-cad-section {
  margin-top: 0.35rem;
  font-size: 0.85rem;
}
.pilot-cad-section > span {
  display: block;
  font-weight: 600;
  color: var(--muted, #6a6a78);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}
.pilot-cad-section ul {
  margin: 0.1rem 0 0 0;
  padding-left: 1.2rem;
}
.pilot-cad-section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
}
.pilot-cad-missing {
  border-left: 3px solid var(--warning, #c67d00);
  padding-left: 0.5rem;
}
.pilot-cad-readiness {
  border-left: 3px solid rgba(64, 99, 176, 0.4);
  padding-left: 0.5rem;
}
.pilot-cad-warnings {
  border-left: 3px solid var(--warning, #c67d00);
  padding-left: 0.5rem;
}
.pilot-cad-next {
  border-left: 3px solid var(--info, #4063b0);
  padding-left: 0.5rem;
}
.pilot-cad-next li strong {
  display: block;
}
.pilot-cad-next li em {
  display: block;
  font-style: normal;
  color: var(--muted, #6a6a78);
}
.pilot-cad-boundary {
  display: block;
  margin-top: 0.45rem;
  padding-top: 0.3rem;
  border-top: 1px dashed var(--border, #d0d0d8);
  color: var(--muted, #6a6a78);
  font-style: italic;
}

/* ── FreeCAD wrapper per-action inputs (v0.37) ─────────────────────────── */

.pilot-action-inputs {
  margin-top: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.35rem;
  border: 1px dashed var(--border, #d0d0d8);
  background: rgba(64, 99, 176, 0.04);
}
.pilot-action-input-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #6a6a78);
  margin-bottom: 0.25rem;
  letter-spacing: 0.02em;
}
.pilot-action-inputs textarea,
.pilot-action-inputs input[type="text"] {
  width: 100%;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  padding: 0.45rem 0.5rem;
  border-radius: 0.3rem;
  border: 1px solid var(--border, #d0d0d8);
  background: var(--card-bg, #fff);
}
.pilot-action-input-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.3rem;
  color: var(--muted, #6a6a78);
}

/* ── Pointer chips (LLM @face: / @feature: / @artifact: refs) ───────────── */

.pointer-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 2px;
  padding: 1px 6px 1px 4px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.55);
  color: inherit;
  font-size: 0.85em;
  line-height: 1.4;
  cursor: pointer;
  font-family: inherit;
  vertical-align: baseline;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.pointer-chip:hover {
  background: rgba(56, 73, 99, 0.85);
  border-color: rgba(125, 211, 252, 0.55);
}

.pointer-chip:active {
  transform: translateY(1px);
}

.pointer-chip__kind {
  font-size: 0.78em;
  color: #7dd3fc;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pointer-chip__id {
  color: #e2e8f0;
  background: transparent;
  padding: 0;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 0.9em;
}

.pointer-chip--face .pointer-chip__kind { color: #7dd3fc; }
.pointer-chip--feature .pointer-chip__kind { color: #c4b5fd; }
.pointer-chip--group .pointer-chip__kind { color: #fbbf24; }
.pointer-chip--edge .pointer-chip__kind { color: #6ee7b7; }
.pointer-chip--artifact .pointer-chip__kind { color: #f472b6; }

.pointer-chip--active {
  background: rgba(250, 204, 21, 0.18);
  border-color: rgba(250, 204, 21, 0.85);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35);
}

.pointer-chip--active .pointer-chip__kind {
  color: #facc15;
}

/* ── Viewer: highlighted-face badge (top-right counter) ─────────────────── */

.viewer-face-highlight-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(250, 204, 21, 0.65);
  border-radius: 8px;
  color: #fde68a;
  font-size: 12px;
  z-index: 8;
}

.viewer-face-highlight-badge strong {
  color: #facc15;
}

/* ── CAD generation progress panel (live stream visualisation) ──────────── */

.cad-progress-panel {
  width: min(420px, 90%);
  max-height: 80%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  color: #e2e8f0;
  overflow: hidden;
  animation: tooltipIn 0.2s ease-out;
}

.cad-progress-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cad-progress-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.cad-progress-panel__title strong {
  color: #f1f5f9;
}

.cad-progress-panel__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(168, 85, 247, 0.25);
  border-top-color: #c084fc;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
}

.cad-progress-panel__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.cad-progress-panel__icon--done {
  background: rgba(34, 197, 94, 0.25);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.cad-progress-panel__icon--error {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(252, 165, 165, 0.4);
}

.cad-progress-panel__counter {
  font-size: 11px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.cad-progress-bar {
  position: relative;
  height: 4px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.cad-progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #7dd3fc);
  border-radius: 2px;
  transition: width 280ms ease;
}

.cad-progress-stage-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cad-progress-stage {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  transition: background 160ms ease;
}

.cad-progress-stage--active {
  background: rgba(168, 85, 247, 0.12);
  border-left: 2px solid #a855f7;
  padding-left: 6px;
  animation: stagePulse 1.8s ease-in-out infinite;
}

.cad-progress-stage--completed {
  opacity: 0.78;
}

.cad-progress-stage--failed {
  background: rgba(239, 68, 68, 0.1);
}

.cad-progress-stage__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  margin-top: 1px;
}

.cad-progress-stage__icon--pending {
  color: #475569;
  border: 1px solid #334155;
}

.cad-progress-stage__icon--active {
  border: 2px solid rgba(168, 85, 247, 0.3);
  border-top-color: #c084fc;
  animation: spin 0.9s linear infinite;
}

.cad-progress-stage__icon--completed {
  background: rgba(34, 197, 94, 0.25);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.cad-progress-stage__icon--failed {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(252, 165, 165, 0.4);
}

.cad-progress-stage__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.cad-progress-stage__label {
  color: #cbd5e1;
  font-weight: 500;
}

.cad-progress-stage--completed .cad-progress-stage__label {
  color: #94a3b8;
}

.cad-progress-stage--active .cad-progress-stage__label {
  color: #f1f5f9;
}

.cad-progress-stage__message {
  color: #94a3b8;
  font-size: 11px;
}

.cad-progress-stage__hint {
  color: #fbbf24;
  font-size: 10px;
  font-style: italic;
}

@keyframes stagePulse {
  0%, 100% { background: rgba(168, 85, 247, 0.10); }
  50%      { background: rgba(168, 85, 247, 0.20); }
}

.cad-progress-codeblock {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 6px;
  background: rgba(8, 14, 28, 0.7);
  padding: 8px 10px;
}

.cad-progress-codeblock__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 11px;
  color: #7dd3fc;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.cad-progress-codeblock__toggle:hover {
  color: #bae6fd;
}

.cad-progress-codeblock__pre {
  margin: 0;
  padding: 8px;
  background: rgba(2, 6, 16, 0.65);
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 11px;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
  animation: tooltipIn 0.25s ease-out;
}

.cad-progress-errorblock {
  border: 1px solid rgba(252, 165, 165, 0.25);
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.08);
  padding: 6px 10px;
  font-size: 11px;
  color: #fecaca;
}

.cad-progress-errorblock summary {
  cursor: pointer;
}

.cad-progress-errorblock pre {
  margin: 6px 0 0;
  font-size: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow-y: auto;
}

.cad-progress-panel__fatal {
  padding: 8px 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(252, 165, 165, 0.35);
  border-radius: 6px;
  color: #fecaca;
  font-size: 12px;
}

/* Agent console cockpit */

.side-pane .agent-console-card {
  position: relative;
  display: flex;
  min-height: min(760px, calc(100dvh - 156px));
  max-height: calc(100dvh - 132px);
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-color: rgba(125, 211, 252, 0.22);
  background:
    linear-gradient(180deg, rgba(8, 16, 30, 0.92), rgba(4, 9, 18, 0.88)),
    radial-gradient(circle at 16% 0%, rgba(45, 212, 191, 0.12), transparent 32%);
}

.side-pane .agent-console-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(125, 211, 252, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(125, 211, 252, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.5;
}

.agent-console-card > * {
  position: relative;
  z-index: 1;
}

.agent-console-card .chat-header {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(125, 211, 252, 0.12);
  background: rgba(3, 8, 18, 0.52);
}

.chat-agent-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.chat-agent-orb {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid rgba(125, 211, 252, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.88), rgba(56, 189, 248, 0.26)),
    rgba(2, 6, 23, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 20px rgba(20, 184, 166, 0.16);
}

.chat-agent-orb.active {
  animation: agentCorePulse 1.25s ease-in-out infinite;
}

@keyframes agentCorePulse {
  0%,
  100% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 18px rgba(20, 184, 166, 0.18);
  }
  50% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 0 34px rgba(56, 189, 248, 0.34);
  }
}

.chat-agent-identity > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.chat-agent-identity strong {
  margin: 0;
  color: #f3f8ff;
  font-size: 14px;
  line-height: 1.15;
}

.chat-agent-identity span:not(.chat-agent-orb) {
  overflow: hidden;
  color: #8fb2c8;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-console-card .chat-window {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: rgba(2, 6, 23, 0.18);
  box-shadow: none;
}

.agent-console-card .chat-bubble {
  border-radius: 9px;
}

.agent-console-card .chat-empty-state {
  margin-top: auto;
  margin-bottom: auto;
}

.agent-console-card .chat-input-row {
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border-top: 1px solid rgba(125, 211, 252, 0.12);
  background: rgba(3, 8, 18, 0.78);
  box-shadow: 0 -18px 28px rgba(2, 6, 23, 0.22);
}

.agent-console-card .chat-input-wrap textarea {
  min-height: 54px;
  max-height: 150px;
  border-color: rgba(125, 211, 252, 0.18);
  border-radius: 9px;
  background: rgba(7, 13, 25, 0.92);
  line-height: 1.45;
}

.agent-console-card .chat-send-button {
  display: inline-flex;
  min-width: 104px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0f766e, #2563eb);
}

.agent-console-card .chat-send-button .button-icon {
  width: 16px;
  height: 16px;
}

@media (max-width: 980px) {
  .side-pane .agent-console-card {
    min-height: 520px;
    max-height: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Claude-style minimal theme override
   Clean, dark, low-chroma — no gradients, no heavy shadows, generous whitespace
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg-root: #0d0d0d;
  --bg-surface: #111111;
  --bg-elevated: #1a1a1a;
  --bg-hover: #222222;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.10);
  --text-primary: #e5e5e5;
  --text-secondary: #a3a3a3;
  --text-tertiary: #737373;
  --accent: #d97706;
  --accent-soft: rgba(217, 119, 6, 0.12);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

body {
  background: var(--bg-root);
  color: var(--text-primary);
}

/* ── Viewer (left/main) ── */
.viewer-pane {
  background: var(--bg-root);
  border-right: 1px solid var(--border-subtle);
}

.viewer-header {
  padding: 14px 20px;
  background: transparent;
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: none;
}

.viewer-header h1 {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
}

.viewer-header-status span {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 500;
}

.viewer-stage-shell {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  margin: 16px 20px;
}

.viewer-stage-head {
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  padding: 14px 16px;
}

.viewer-stage-head strong {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

.viewer-stage-head span {
  color: var(--text-tertiary);
}

.viewer-stage-badge {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* ── Sidebar ── */
.side-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--bg-root);
  border-left: 1px solid var(--border-subtle);
}

.side-pane::before {
  display: none;
}

.side-pane > * {
  position: static;
  z-index: auto;
}

/* Header */
.control-pane-header {
  position: static;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 0 8px;
  background: transparent;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: none;
  box-shadow: none;
}

.control-pane-header strong {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
}

.control-pane-kicker {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* Tabs */
.control-pane-tabs {
  position: static;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: auto;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: none;
  box-shadow: none;
}

.side-pane .control-pane-tabs {
  grid-column: auto;
  position: static;
  top: auto;
  width: auto;
}

.control-pane-tab,
.side-pane .control-pane-tab {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.control-pane-tab:hover:not(:disabled),
.side-pane .control-pane-tab:hover:not(:disabled) {
  background: var(--bg-hover);
  transform: none;
}

.control-pane-tab.active,
.side-pane .control-pane-tab.active {
  background: var(--bg-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
  box-shadow: none;
}

.control-pane-tab strong {
  color: inherit;
  font-size: 13px;
  font-weight: 500;
}

.control-pane-tab span {
  color: var(--text-tertiary);
  font-size: 12px;
}

.control-pane-tab.active span {
  color: var(--text-secondary);
}

.control-pane-tab-copy {
  position: static;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  width: auto;
  opacity: 1;
  transform: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.control-pane-tab-copy strong {
  font-size: 13px;
  font-weight: 500;
}

.control-pane-tab-copy span {
  display: none;
}
.card h2,
.side-pane .card h2,
.dropzone-content strong,
.project-item strong,
.workflow-item strong,
.summary-note strong,
.semantic-block h3,
.capability-detail strong,
.chat-bubble header strong,
.cae-chip-card strong,
.cae-list-item strong,
.chat-connection-card strong,
.capability-item strong,
.agent-chat-strip strong,
.viewer-toolbar-block strong,
.insight-card strong,
.viewer-stage-head strong,
.runtime-pill,
.viewer-stage-badge {
  color: var(--text-primary);
}

.side-pane .section-heading p,
.side-pane .project-item-main small,
.side-pane .workflow-item p,
.side-pane .summary-note p,
.side-pane .chat-bubble p,
.side-pane .chat-empty-state p,
.side-pane .chat-connection-card small,
.side-pane .agent-chat-strip span,
.side-pane .capability-detail-head span,
.side-pane .cae-list-item small,
.side-pane .cae-chip-card small,
.dropzone-content span,
.project-metadata span,
.semantic-overview span,
.capability-facts span,
.semantic-map-item span,
.workflow-step-item span,
.cae-overview-grid span,
.cae-field-head span,
.cae-chip-card span,
.cae-list-item span,
.control-pane-tab span {
  color: var(--text-secondary);
}

/* ── Chat ── */
.chat-window {
  background: transparent;
  border: none;
  padding: 0;
  gap: 8px;
}

.chat-bubble {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  gap: 8px;
}

.chat-bubble.user {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
  width: auto;
  max-width: 88%;
  align-self: flex-end;
}

.chat-bubble.assistant {
  background: transparent;
  border-color: transparent;
  align-self: stretch;
}

.chat-bubble header {
  color: var(--text-tertiary);
  font-size: 12px;
  margin-bottom: 4px;
}

.chat-bubble header strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.chat-empty-state {
  background: transparent;
  border: none;
  padding: 40px 20px;
  text-align: center;
}

.chat-empty-state strong {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
}

.chat-empty-state p {
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1.6;
}

.chat-input-row {
  padding: 12px 0 0;
  border-top: 1px solid var(--border-subtle);
  gap: 8px;
  margin: 0;
  background: transparent;
}

.chat-input-wrap textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  overflow-y: hidden;
  min-height: 48px;
}

.chat-input-wrap textarea:focus {
  border-color: var(--border-medium);
  box-shadow: none;
  outline: none;
}

.chat-send-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 500;
  box-shadow: none;
}

.chat-send-button:hover:not(:disabled) {
  background: #b45309;
  border-color: #b45309;
  transform: none;
}

/* ── Buttons ── */
button {
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  box-shadow: none;
  font-weight: 500;
}

button:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
  transform: none;
}

.ghost-button,
.side-pane .ghost-button,
.side-pane .chat-suggestion,
.side-pane .chat-artifact-link,
.side-pane .compact-button {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
  box-shadow: none;
}

.ghost-button:hover:not(:disabled),
.side-pane .ghost-button:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

/* ── Forms ── */
input,
select,
textarea,
.side-pane input,
.side-pane select,
.side-pane textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}

input:focus,
select:focus,
textarea:focus,
.side-pane input:focus,
.side-pane select:focus,
.side-pane textarea:focus {
  border-color: var(--border-medium);
  box-shadow: none;
  outline: none;
}

/* ── Project items ── */
.project-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.project-item.active {
  outline: none;
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: none;
}

.project-item span {
  color: var(--text-tertiary);
}

/* ── Status badges ── */
.status-ready,
.llm-readiness-pill.ready {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.08);
}

.status-active {
  border-color: rgba(142, 202, 230, 0.25);
  background: rgba(142, 202, 230, 0.08);
}

.status-done {
  border-color: rgba(115, 214, 162, 0.25);
  background: rgba(115, 214, 162, 0.08);
}

.status-error {
  border-color: rgba(255, 143, 143, 0.25);
  background: rgba(255, 143, 143, 0.08);
}

/* ── Scrollbars ── */
.side-pane::-webkit-scrollbar,
.json-block::-webkit-scrollbar {
  width: 6px;
}

.side-pane::-webkit-scrollbar-thumb,
.json-block::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 999px;
}

/* ── Agent console card (chat panel wrapper) ── */
.agent-console-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.agent-console-card .chat-window {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

.agent-console-card .chat-bubble {
  border-radius: var(--radius-md);
}

.agent-console-card .chat-input-row {
  padding: 12px 0 0;
  border-top: 1px solid var(--border-subtle);
  background: transparent;
  box-shadow: none;
}

.agent-console-card .chat-input-wrap textarea {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
  border-radius: var(--radius-md);
}

.agent-console-card .chat-send-button {
  background: var(--accent);
  border-color: var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.agent-console-card .chat-send-button:hover:not(:disabled) {
  background: #b45309;
  border-color: #b45309;
}

/* ── Chat header simplification ── */
.chat-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.chat-header strong {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

.chat-connection-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.live-sync-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
}

/* ── Drawers ── */
.drawer-backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.settings-drawer {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.drawer-header {
  border-bottom: 1px solid var(--border-subtle);
}

/* ── Confirm dialog ── */
.confirm-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.confirm-dialog-panel {
  width: min(360px, 90vw);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.confirm-dialog-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.confirm-dialog-message {
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-dialog-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.confirm-dialog-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ── Notification center ── */
.notification-center {
  top: 16px;
  right: 16px;
}

.notification-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: none;
}

.notification-copy strong {
  color: var(--text-primary);
}

.notification-copy span {
  color: var(--text-secondary);
}

/* ── Markdown text ── */
.markdown-text {
  color: var(--text-primary);
}

.markdown-text h2,
.markdown-text h3 {
  color: var(--text-primary);
}

.markdown-text p {
  color: var(--text-secondary);
}

.markdown-text code {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.markdown-text pre {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
}

/* ── JSON blocks ── */
.json-block {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

/* ── Misc cleanup ── */
.viewer-summary-strip,
.viewer-toolbar,
.viewer-insights,
.semantic-overview,
.project-metadata {
  display: none;
}

/* Remove leftover gradients from viewer-pane and side-pane */
.viewer-pane,
.side-pane {
  background-image: none !important;
}

/* App shell simplification */
.app-shell {
  display: grid;
  grid-template-rows: 44px 1fr;
  grid-template-columns: none;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-root);
}

/* Simplify runtime cluster/pill */
.runtime-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* Selection inspector */
.selection-inspector-card {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}

.selection-inspector-item {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

/* Heatmap / CAE */
.cae-legend {
  border-color: var(--border-subtle);
}
.chat-cad-progress {
  border-color: rgba(168, 85, 247, 0.25);
  background: rgba(168, 85, 247, 0.06);
}
/* Result banners */
.result-success {
  background: rgba(34, 197, 94, 0.06);
  border-color: rgba(34, 197, 94, 0.2);
}

.result-error {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
}

.result-info {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.2);
}

/* Connection status */
.connection-status.status-ready {
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.connection-status.status-configurable,
.connection-status.status-degraded {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
}

.connection-status.status-blocked {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Agent chat strip */
.agent-chat-strip {
  border-color: rgba(142, 202, 230, 0.15);
  background: rgba(142, 202, 230, 0.04);
}
/* Summary notes */
.summary-primary {
  border-color: rgba(142, 202, 230, 0.15);
  background: rgba(142, 202, 230, 0.04);
}

.summary-muted {
  border-color: var(--border-subtle);
  background: var(--bg-elevated);
}

/* Dropzone */
.dropzone {
  border-color: var(--border-medium);
  background: var(--bg-elevated);
}

.dropzone:hover {
  border-color: var(--text-secondary);
}

/* Fold block */
.fold-block {
  background: var(--bg-surface);
}

.fold-summary {
  color: var(--text-secondary);
}

/* Local agent adapter */
.local-agent-adapter-item.available {
  border-color: rgba(45, 212, 191, 0.15);
  background: rgba(13, 148, 136, 0.04);
}

.local-agent-adapter-item.missing,
.local-agent-adapter-item.error,
.local-agent-adapter-item.blocked {
  border-color: rgba(239, 68, 68, 0.12);
  background: rgba(153, 27, 27, 0.04);
}

/* CAD progress panel */
.cad-progress-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.cad-progress-panel__head {
  border-bottom: 1px solid var(--border-subtle);
}

.cad-progress-bar {
  background: var(--bg-hover);
}

.cad-progress-bar__fill {
  background: var(--accent);
}

.cad-progress-stage--completed .cad-progress-stage__label {
  color: var(--text-secondary);
}

.cad-progress-stage--active .cad-progress-stage__label {
  color: var(--text-primary);
}

.cad-progress-stage--failed .cad-progress-stage__label {
  color: var(--danger);
}

/* Face tooltips */
.viewer-face-tooltip {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
}

.viewer-face-multisel {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
}

/* Viewer overlay */
.viewer-overlay {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
}

.viewer-overlay strong {
  color: var(--text-primary);
}

.viewer-overlay span {
  color: var(--text-secondary);
}

/* Face action buttons */
.viewer-face-action-btn {
  border-color: var(--border-medium);
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.viewer-face-action-btn:hover:not(:disabled) {
  background: var(--bg-elevated);
}
/* Chat artifact links */
.chat-artifact-link,
.artifact-link {
  color: var(--text-secondary);
}

.chat-artifact-link:hover,
.artifact-link:hover {
  color: var(--text-primary);
}
/* ═══════════════════════════════════════════════════════════════════════════
   New 3-column layout: Sessions | Viewer | Chat
   ═══════════════════════════════════════════════════════════════════════════ */

.app-shell {
  display: grid;
  grid-template-rows: 44px 1fr;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-root);
}

.app-shell.embed-mode {
  grid-template-rows: 1fr;
}

/* ── Top bar ── */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  z-index: 10;
}

.app-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.app-topbar-divider {
  width: 1px;
  height: 16px;
  background: var(--border-medium);
}

.app-topbar-project {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-topbar-mcp {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-topbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.app-topbar-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.app-topbar-btn.active {
  background: var(--accent-soft, rgba(217, 119, 6, 0.12));
  border-color: var(--accent, #d97706);
  color: var(--accent, #d97706);
}

/* ── Main content area ── */
.app-main {
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
  min-height: 0;
}

.app-main.sidebar-collapsed {
  grid-template-columns: 56px 1fr;
}

.app-main.library-open {
  grid-template-columns: 240px 1fr 380px;
}

.app-main.sidebar-collapsed.library-open {
  grid-template-columns: 56px 1fr 380px;
}

/* ── Library side pane ── */
.library-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow: auto;
  min-height: 0;
  background: var(--bg-surface, #111111);
  border-left: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.library-pane-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  background: var(--bg-elevated, #1a1a1a);
}

.library-pane-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #a3a3a3);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.library-pane-tab:hover:not(:disabled) {
  background: var(--bg-hover, #222222);
  transform: none;
}

.library-pane-tab.active {
  background: var(--bg-hover, #222222);
  border-color: var(--border-medium, rgba(255, 255, 255, 0.10));
  color: var(--text-primary, #e5e5e5);
}

.library-pane-close {
  align-self: flex-end;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
}

/* ── Sessions sidebar ── */
.sessions-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  overflow: hidden;
}

.sessions-sidebar.collapsed {
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
}

.sessions-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.sessions-sidebar-header div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.sessions-sidebar-header strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sessions-sidebar-header span {
  overflow: hidden;
  color: var(--text-tertiary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sessions-sidebar-actions {
  padding: 4px;
}

.sessions-new-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-medium);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.sessions-icon-btn,
.sessions-mini-btn {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
}

.sessions-icon-btn:hover:not(:disabled),
.sessions-mini-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: none;
}

.sessions-new-btn:hover:not(:disabled) {
  border-color: var(--text-secondary);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 0 1 38%;
  min-height: 96px;
  padding: 4px;
}

.session-item-wrap {
  position: relative;
}

.session-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  width: 100%;
}

.session-item-delete {
  position: absolute;
  top: 6px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease;
}

.session-item-wrap:hover .session-item-delete,
.session-item-delete:focus-visible {
  opacity: 1;
}

.session-item-delete:hover {
  color: var(--text-primary);
}

.thread-item-wrap {
  position: relative;
}

.thread-item-wrap:hover .thread-item {
  padding-right: 24px;
}

.thread-item-delete {
  position: absolute;
  top: 7px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease;
  z-index: 1;
}

.thread-item-wrap:hover .thread-item-delete,
.thread-item-delete:focus-visible {
  opacity: 1;
}

.thread-item-delete:hover {
  color: var(--text-primary);
}

.session-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.session-item.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.session-item-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.session-item-row svg {
  flex: 0 0 auto;
  color: var(--text-tertiary);
}

.session-item-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-item-status {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: capitalize;
}

.session-item.active .session-item-status {
  color: var(--text-secondary);
}

.sessions-thread-panel {
  display: flex;
  min-height: 128px;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--border-subtle);
  padding: 8px 4px 4px;
}

.sessions-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 6px;
}

.sessions-thread-header strong {
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sessions-thread-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.thread-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  box-shadow: none;
  transition: padding-right 0.12s ease;
}

.thread-item:hover:not(:disabled),
.thread-item.active {
  border-color: var(--border-subtle);
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: none;
}

.thread-title {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-status {
  max-width: 82px;
  overflow: hidden;
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(148, 163, 184, 0.11);
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 650;
  text-transform: capitalize;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-status.status-running {
  background: rgba(56, 189, 248, 0.14);
  color: #9bdcf8;
}

.thread-status.status-completed {
  background: rgba(34, 197, 94, 0.13);
  color: #95e5b1;
}

.thread-status.status-failed,
.thread-status.status-cancelled {
  background: rgba(248, 113, 113, 0.13);
  color: #f4aaa8;
}

.thread-empty {
  padding: 10px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.sessions-import {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px 4px;
  border-top: 1px solid var(--border-subtle);
}

.sessions-dropzone {
  display: block;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-medium);
  background: transparent;
  cursor: pointer;
  text-align: center;
}

.sessions-dropzone:hover {
  border-color: var(--text-secondary);
}

.sessions-dropzone input {
  display: none;
}

.sessions-dropzone span {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.sessions-import-btn {
  width: 100%;
  padding: 8px;
  font-size: 13px;
  font-weight: 500;
}

/* ── Chat pane (right column) ── */
.chat-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-root);
  border-left: 1px solid var(--border-subtle);
}

.chat-pane-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 12px 14px 12px;
  gap: 12px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-root) 96%, #ffffff 4%) 0%, var(--bg-root) 100%);
}

.chat-stream-shell {
  display: flex;
  flex: 1 1 0%;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border-medium) 72%, transparent);
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 88%, var(--bg-elevated)) 0%, var(--bg-surface) 100%);
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.18);
}

.chat-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.chat-stream-heading {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.chat-stream-eyebrow {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.chat-stream-heading strong {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.chat-stream-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 70%, transparent);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.chat-stream-toggle span {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.chat-workflow-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.chat-workflow-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.chat-workflow-label {
  display: inline-flex;
  width: fit-content;
  min-height: 20px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.chat-workflow-copy strong {
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.4;
}

.chat-workflow-copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.chat-workflow-meta {
  display: flex;
  flex: 0 1 40%;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
  max-width: 40%;
  color: var(--text-tertiary);
  font-size: 11px;
  text-align: right;
}

.chat-workflow-meta code {
  padding: 2px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 72%, transparent);
  color: var(--text-secondary);
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.chat-workflow-summary-running .chat-workflow-label {
  color: #38bdf8;
}

.chat-workflow-summary-approval .chat-workflow-label {
  color: #fbbf24;
}

.chat-workflow-summary-done .chat-workflow-label {
  color: #34d399;
}

.chat-workflow-summary-error .chat-workflow-label {
  color: #f87171;
}

.chat-workflow-summary-idle .chat-workflow-label {
  color: var(--text-tertiary);
}

.chat-pane-body .chat-window {
  flex: 1 1 0%;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 12px 14px 12px;
  margin: 0;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-workbench-footer {
  flex-shrink: 0;
  display: grid;
  gap: 10px;
}

.chat-approval-dock {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  animation: chat-dock-slide-up 0.25s ease-out;
}

@keyframes chat-dock-slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-approval-dock .approval-line {
  margin: 0;
  border-color: rgba(217, 164, 65, 0.22);
  background: color-mix(in srgb, var(--bg-surface) 86%, rgba(217, 164, 65, 0.12));
}

.chat-pane-body .chat-empty-state {
  margin: auto;
  padding: 40px 20px;
  text-align: center;
}

.chat-pane-body .chat-bubble {
  margin-bottom: 4px;
  flex-shrink: 0;
}

.chat-pane-body .chat-composer {
  flex-shrink: 0;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--border-medium) 80%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-surface) 92%, var(--bg-elevated));
  box-shadow: 0 16px 38px rgba(2, 6, 23, 0.14);
  overflow: hidden;
}

.chat-pane-body .chat-input-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 10px 6px;
  margin: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.chat-pane-body .chat-connection-select {
  flex: 0 1 190px;
  min-width: 0;
  max-width: 210px;
  min-height: 22px;
  padding: 2px 20px 2px 6px;
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
}

.chat-pane-body .chat-input-toolbar .connection-status {
  border: 0;
  border-radius: 2px;
  padding: 1px 5px;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.chat-pane-body .chat-input-toolbar .connection-status.status-ready,
.chat-pane-body .chat-input-toolbar .connection-status.status-configurable,
.chat-pane-body .chat-input-toolbar .connection-status.status-degraded,
.chat-pane-body .chat-input-toolbar .connection-status.status-blocked {
  background: transparent;
}

.chat-pane-body .connection-health-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-surface) 94%, var(--bg-elevated));
}

.connection-health-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.connection-health-label {
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.78;
}

.connection-health-status {
  max-width: 150px;
  overflow: hidden;
  color: var(--text-secondary);
  font-weight: 600;
  text-overflow: ellipsis;
}

.connection-health-badge.health-ready {
  border-color: rgba(34, 197, 94, 0.18);
  background: rgba(34, 197, 94, 0.08);
}

.connection-health-badge.health-ready .connection-health-status {
  color: var(--success);
}

.connection-health-badge.health-warning {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.08);
}

.connection-health-badge.health-warning .connection-health-status {
  color: var(--warning);
}

.connection-health-badge.health-error {
  border-color: rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
}

.connection-health-badge.health-error .connection-health-status {
  color: var(--danger);
}

.connection-health-badge.health-loading,
.connection-health-badge.health-unknown {
  border-color: color-mix(in srgb, var(--border-subtle) 80%, transparent);
  background: color-mix(in srgb, var(--bg-muted) 70%, transparent);
}

.agent-mode-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex: 0 1 auto;
  gap: 6px;
  min-width: 0;
}

.agent-control-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 500;
}

.agent-control-select {
  max-width: 96px;
  min-height: 22px;
  padding: 2px 20px 2px 6px;
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
}

@media (max-width: 480px) {
  .agent-mode-controls {
    flex-basis: 100%;
  }

  .agent-control-field {
    flex: 1 1 120px;
  }

  .agent-control-select {
    width: 100%;
    max-width: none;
  }
}

.chat-pane-body .chat-input-row {
  flex-shrink: 0;
  display: flex;
  gap: 0;
  align-items: flex-end;
  padding: 0;
  margin: 0;
}

.chat-pane-body .chat-quick-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.chat-quick-action-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-1) 52%, transparent);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.chat-quick-action-chip:hover:not(:disabled) {
  background: var(--surface-1);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.chat-pane-body .chat-input-wrap {
  display: flex;
  min-width: 0;
  width: 100%;
  flex-direction: column;
}

.chat-context-chips {
  display: flex;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  padding: 8px 10px 0;
}

.chat-context-chips code,
.chat-context-chips span {
  display: inline-flex;
  max-width: 170px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 2px 5px;
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-pane-body .chat-input-wrap textarea {
  min-height: 54px;
  max-height: 160px;
  padding: 10px 12px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.55;
  box-shadow: none;
}

.chat-pane-body .chat-input-wrap textarea:focus {
  border-color: transparent;
  box-shadow: none;
  outline: none;
}

.chat-pane-body .chat-input-wrap textarea::placeholder {
  color: var(--text-tertiary);
}

.chat-composer-footer {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px 10px;
}

.chat-composer-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.chat-composer-icon-button {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-color: transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text-tertiary);
}

.chat-composer-icon-button:hover:not(:disabled) {
  border-color: var(--border-subtle);
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: none;
}

.chat-pane-body .chat-action-button {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s, opacity 0.12s;
}

.chat-pane-body .chat-action-button .button-icon {
  width: 16px;
  height: 16px;
  margin: 0;
}

.chat-pane-body .chat-action-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-pane-body .chat-action-button-send {
  color: var(--text-tertiary);
}

.chat-pane-body .chat-action-button-send:hover:not(:disabled) {
  border-color: var(--border-subtle);
  background: var(--bg-hover);
  color: var(--text-primary);
}

.chat-pane-body .chat-action-button-stop {
  color: var(--danger);
}

.chat-pane-body .chat-action-button-stop:hover:not(:disabled) {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.08);
}

.chat-quick-action-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.agent-activity-line {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  margin: 2px 0 8px;
  padding: 0 2px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

@keyframes agent-activity-sweep {
  0%,
  18% {
    background-position: 170% 50%;
  }
  58%,
  100% {
    background-position: -70% 50%;
  }
}

@keyframes streaming-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes streaming-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

.streaming-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--text-primary);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: streaming-blink 1s step-end infinite;
}

.streaming-pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  animation: streaming-pulse 1.4s ease-in-out infinite;
}

.streaming-tool-hint {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 13px;
  font-style: italic;
  padding: 4px 0;
}

/* ── Compact progress indicator (heartbeat phases) ── */
.streaming-progress-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  margin: 2px 0 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  width: fit-content;
  max-width: 100%;
  animation: streaming-progress-in 0.35s ease-out;
}

.streaming-progress-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: streaming-progress-dot 1.6s ease-in-out infinite;
}

.streaming-progress-text {
  animation: streaming-progress-text-in 0.3s ease-out;
}

@keyframes streaming-progress-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes streaming-progress-dot {
  0%, 100% {
    opacity: 0.4;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes streaming-progress-text-in {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.agent-activity-copy {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.agent-activity-copy strong {
  color: inherit;
  font-weight: 750;
}

.agent-activity-line.is-running .agent-activity-copy {
  color: transparent;
  background: linear-gradient(
    100deg,
    var(--text-secondary) 0%,
    var(--text-secondary) 40%,
    #ffffff 50%,
    var(--text-primary) 54%,
    var(--text-secondary) 64%,
    var(--text-secondary) 100%
  );
  background-size: 320% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: agent-activity-sweep 2.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.agent-activity-line time {
  flex: 0 0 auto;
  margin-left: auto;
  color: color-mix(in srgb, var(--text-secondary) 72%, transparent);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.agent-activity-running {
  color: var(--text-secondary);
}

.agent-activity-approval {
  color: #fbbf24;
}

.agent-activity-approval time {
  color: rgba(251, 191, 36, 0.72);
}

.agent-activity-done {
  color: var(--text-secondary);
}

.agent-activity-error {
  color: #fca5a5;
}

.agent-activity-line .pointer-chip {
  vertical-align: text-bottom;
}

/* MCP-first approval surface (#17): floating prompts in the live viewer when an
   external MCP agent requests a gated mutation. */
.pending-approvals {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(420px, 90vw);
}

.pending-approval-card {
  background: var(--surface, #1b1f27);
  border: 1px solid rgba(251, 191, 36, 0.55);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pending-approval-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pending-approval-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f1115;
  background: #fbbf24;
  border-radius: 4px;
  padding: 1px 6px;
}

.pending-approval-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.pending-approval-code pre {
  max-height: 180px;
  overflow: auto;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.28);
  padding: 8px;
  border-radius: 6px;
}

.pending-approval-actions {
  display: flex;
  gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .agent-activity-line.is-running .agent-activity-copy {
    animation: none;
    color: var(--text-secondary);
    background: none;
  }
}

/* ── Viewer pane tweaks ── */
.viewer-pane {
  border-right: none;
}

.viewer-header {
  padding: 12px 16px;
}

/* ── Responsive ── */
@media (max-width: 1280px) {
  .app-main {
    grid-template-columns: 200px 1fr;
  }
}

@media (max-width: 1024px) {
  .app-main {
    grid-template-columns: 0 1fr;
  }

  .sessions-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .app-main {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }

  .viewer-pane {
    min-height: 100%;
  }
}

/* Tab media query fixes */
@media (max-width: 1080px) {
  .side-pane {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }

  .side-pane > :not(.control-pane-header):not(.control-pane-tabs),
  .control-pane-header,
  .control-pane-tabs {
    grid-column: auto;
  }

  .control-pane-tabs {
    position: static;
    display: grid;
    width: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-pane .control-pane-tab {
    width: auto;
    flex-direction: row;
    gap: 8px;
  }

  .control-pane-tab-copy {
    display: flex;
    flex-direction: row;
    gap: 6px;
  }

  .control-pane-tab-copy span {
    display: none;
  }
}

/* The VS Code preview is project-bound, so its embedded workbench gives the
   full width to the viewer instead of reserving space for project navigation. */
.app-shell.embed-mode .app-main,
.app-shell.embed-mode .app-main.sidebar-collapsed,
.app-shell.embed-mode .app-main.embed-main {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 700px) {
  .app-shell.embed-mode .viewer-header {
    padding: 8px 10px;
  }

  .app-shell.embed-mode .viewer-stage-shell {
    margin: 8px 10px 10px;
  }

  .app-shell.embed-mode .viewer-stage-head {
    padding: 8px 10px;
  }
}

/* Convergence chart */
.convergence-chart {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.35);
  padding: 12px;
  margin: 10px 0 12px;
}

.convergence-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.convergence-chart-head strong {
  font-size: 13px;
  color: #e5e7eb;
}

.convergence-verdict {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.convergence-verdict-converged {
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(34, 197, 94, 0.28);
}

.convergence-verdict-running {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(96, 165, 250, 0.28);
}

.convergence-chart-svg {
  display: block;
  width: 100%;
  min-height: 170px;
}

.convergence-axis-line {
  stroke: rgba(148, 163, 184, 0.5);
  stroke-width: 1;
}

.convergence-grid-line {
  stroke: rgba(148, 163, 184, 0.16);
  stroke-width: 1;
}

.convergence-axis-text {
  fill: #94a3b8;
  font-size: 10px;
}

.convergence-axis-text-x {
  text-anchor: middle;
}

.convergence-axis-text-y {
  text-anchor: end;
}

.convergence-line {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.convergence-point {
  stroke: #0f172a;
  stroke-width: 1.5;
}

.convergence-point-feasible {
  fill: #22c55e;
}

.convergence-point-infeasible {
  fill: #f97316;
}

.convergence-missing-point {
  fill: transparent;
  stroke: rgba(148, 163, 184, 0.65);
  stroke-dasharray: 3 3;
}

.convergence-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  color: #cbd5e1;
  font-size: 11px;
}

.convergence-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.convergence-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.convergence-legend-dot-feasible {
  background: #22c55e;
}

.convergence-legend-dot-infeasible {
  background: #f97316;
}

.convergence-legend-safe {
  color: #bbf7d0;
}
