:root {
  --bg-obsidian: #090d16;
  --bg-elevated: #0d1321;
  --bg-card: rgba(15, 22, 37, 0.88);
  --bg-card-hover: rgba(20, 30, 50, 0.94);
  --bg-input: #080c15;
  --bg-code: #060911;

  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.26);
  --border-cyan: rgba(56, 189, 248, 0.42);
  --border-emerald: rgba(16, 185, 129, 0.45);
  --border-amber: rgba(245, 158, 11, 0.48);
  --border-rose: rgba(244, 63, 94, 0.56);

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --cyan: #38bdf8;
  --cyan-soft: rgba(56, 189, 248, 0.13);
  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --amber: #f59e0b;
  --amber-bright: #fbbf24;
  --amber-soft: rgba(245, 158, 11, 0.15);
  --rose: #f43f5e;
  --rose-bright: #fb7185;
  --rose-soft: rgba(244, 63, 94, 0.16);

  --font-sans: "Space Grotesk", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 13px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-obsidian);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(56, 189, 248, 0.08), transparent 36%),
    radial-gradient(circle at 88% 4%, rgba(16, 185, 129, 0.07), transparent 34%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 1000;
  background: var(--cyan);
  color: #041019;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* TOP STUDIO HEADER BAR */
.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  padding: 8px 18px;
  background: rgba(9, 13, 22, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}

body.is-embedded .quick-links {
  display: none;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-mark:hover {
  text-decoration: none;
}

.brand-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.015em;
  color: #f8fafc;
}

.honesty-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--cyan-soft);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  max-width: 100%;
}

.session-pill[data-state="live"] {
  border-color: rgba(16, 185, 129, 0.42);
  background: rgba(6, 78, 59, 0.22);
  color: #d1fae5;
}

.session-pill[data-state="waiting"],
.session-pill[data-state="error"] {
  border-radius: var(--radius-md);
  align-items: flex-start;
  max-width: 640px;
}

.session-pill[data-state="waiting"] {
  border-color: var(--border-amber);
  background: rgba(120, 53, 15, 0.25);
  color: #fde68a;
}

.session-pill[data-state="error"] {
  border-color: var(--border-rose);
  background: var(--rose-soft);
  color: #fecdd3;
}

.session-body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 6px;
  row-gap: 2px;
  min-width: 0;
}

.session-pill[data-state="waiting"] .session-label,
.session-pill[data-state="error"] .session-label {
  white-space: normal;
}

.session-countdown {
  font-weight: 700;
  white-space: nowrap;
}

.session-detail {
  flex-basis: 100%;
  font-size: 10.5px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.session-retry-btn {
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.session-retry-btn:hover,
.session-retry-btn:focus-visible {
  background: rgba(253, 230, 138, 0.14);
}

.session-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}

.session-pill[data-state="live"] .session-dot {
  background: var(--emerald-bright);
  box-shadow: 0 0 8px var(--emerald);
}

.session-pill[data-state="waiting"] .session-dot,
.session-pill[data-state="error"] .session-dot {
  margin-top: 4px;
}

.session-pill[data-state="error"] .session-dot {
  background: var(--rose-bright);
}

/* Said next to buttons that need a live Tessera session while they are off */
.session-gate-note {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #fde68a;
}

.session-gate-note-cli {
  margin: 0;
  padding: 5px 12px;
  background: #080c17;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
}

.session-gate-note-inline {
  margin: 0;
  font-size: 10.5px;
}

.sync-status {
  font-size: 10.5px;
  color: var(--text-muted);
}

.sync-status[data-ok="false"] {
  color: var(--rose-bright);
}

.session-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.mode-switcher {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: #060911;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  gap: 3px;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.mode-btn:hover {
  color: var(--text-primary);
}

.mode-btn.is-active {
  background: rgba(56, 189, 248, 0.16);
  color: #e0f2fe;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.quick-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  font-weight: 500;
}

.quick-links a {
  color: var(--text-secondary);
  white-space: nowrap;
}

.quick-links a:hover {
  color: var(--cyan);
  text-decoration: none;
}

.quick-links .eranos-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: #6ee7b7;
  font-weight: 600;
}

.quick-links .eranos-pill:hover {
  background: rgba(16, 185, 129, 0.24);
  color: #a7f3d0;
}

/* MAIN SPLIT GRID (52% Left / 48% Right on Desktop) */
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 52fr) minmax(0, 48fr);
  gap: 14px;
  padding: 12px 16px 14px;
  max-width: 1960px;
  margin: 0 auto;
}

@media (min-width: 1160px) {
  .studio-grid {
    height: calc(100vh - 61px);
    overflow: hidden;
  }
}

.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.pane-left {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pane-right {
  gap: 12px;
}

/* SCENARIO TABS BAR */
.workspace-bar {
  padding: 8px 12px;
  background: rgba(8, 12, 21, 0.86);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

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

.scenario-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.45);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.scenario-tab:hover {
  color: var(--text-primary);
  background: rgba(30, 41, 59, 0.58);
}

.scenario-tab.is-active {
  background: rgba(56, 189, 248, 0.14);
  border-color: var(--border-cyan);
  color: #f0f9ff;
}

.scenario-tab[data-scenario="ngo"].is-active {
  background: var(--emerald-soft);
  border-color: var(--border-emerald);
  color: #ecfdf5;
}

.scenario-tab[data-scenario="worker"].is-active {
  background: var(--amber-soft);
  border-color: var(--border-amber);
  color: #fffbeb;
}

.scenario-tab-cli.is-active {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(167, 139, 250, 0.48);
  color: #f5f3ff;
}

.tab-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.scenario-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.panel-scroll > *,
.chat-stream > *,
.cli-output > *,
.inspector-scroll > * {
  flex-shrink: 0;
}

.panel-intro {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(11, 17, 30, 0.65);
  flex-shrink: 0;
}

.panel-intro-compact {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.panel-intro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.kicker-cyan { color: var(--cyan); }
.kicker-emerald { color: var(--emerald-bright); }
.kicker-amber { color: var(--amber-bright); }

.metric-chip,
.example-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.example-pill {
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
  background: rgba(120, 53, 15, 0.24);
}

.panel-desc {
  margin: 0;
  font-size: 12.8px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.panel-desc code {
  font-size: 11.5px;
  color: #bae6fd;
  background: rgba(15, 23, 42, 0.85);
  padding: 1px 5px;
  border-radius: 4px;
}

/* CHAT + HERMA SHIM */
.starter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.chip-btn {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(14, 24, 42, 0.88);
  color: #e0f2fe;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
  text-align: left;
}

.chip-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--cyan);
}

.chat-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-turn {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-user-bubble {
  align-self: flex-end;
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 11px 11px 3px 11px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.34);
  color: #f0f9ff;
  font-size: 13px;
  font-weight: 500;
}

.shim-card {
  background: rgba(8, 13, 24, 0.92);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shim-card[data-direct="true"] {
  border-left-color: var(--emerald-bright);
}

.shim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.shim-prov-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prov-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: #6ee7b7;
}

.ref-badge {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
}

.shim-latency {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.shim-answer {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.shim-diff-details {
  border-top: 1px solid var(--border-subtle);
  padding-top: 7px;
}

.shim-diff-details summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--cyan);
  user-select: none;
}

.shim-diff-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 8px;
  margin-top: 7px;
}

.diff-box {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 7px 9px;
  min-width: 0;
}

.diff-box-added {
  border-color: rgba(16, 185, 129, 0.35);
}

.diff-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.diff-box pre {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #cbd5e1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 150px;
  overflow-y: auto;
}

.chat-composer {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(8, 12, 21, 0.9);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
}

.chat-input:focus,
.ngo-textarea:focus,
.cli-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

.btn-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  opacity: 0.86;
}

.btn-primary {
  background: linear-gradient(180deg, #0284c7, #0369a1);
  border-color: rgba(125, 211, 252, 0.4);
  color: #f8fafc;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #0ea5e9, #0284c7);
}

.btn-emerald {
  background: linear-gradient(180deg, #10b981, #059669);
  border-color: rgba(110, 231, 183, 0.45);
  color: #022c22;
}

.btn-emerald .btn-main-line,
.btn-emerald .btn-sub {
  color: #ecfdf5;
}

.btn-emerald:hover:not(:disabled) {
  background: linear-gradient(180deg, #34d399, #10b981);
}

.btn-tall {
  height: 100%;
  min-height: 54px;
  padding: 8px 16px;
}

.btn-subtle {
  flex-direction: row;
  gap: 5px;
  background: rgba(30, 41, 59, 0.72);
  border-color: var(--border-strong);
  color: var(--text-primary);
  font-weight: 600;
}

.btn-subtle:hover:not(:disabled) {
  border-color: var(--cyan);
  color: #e0f2fe;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 11.5px;
  border-radius: 6px;
}

.btn-link {
  border: 0;
  background: none;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-link:disabled,
.cli-chip:disabled,
.worker-step-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}

/* NGO SUBMITS TASK PANEL */
.ngo-form-card {
  background: rgba(8, 13, 24, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.field-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preset-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.14s ease;
}

.preset-card:hover {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(15, 29, 46, 0.9);
}

.preset-card.is-selected {
  border-color: var(--emerald-bright);
  background: rgba(6, 78, 59, 0.26);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.25);
}

.preset-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--emerald-bright);
}

.preset-title {
  font-size: 12.2px;
  line-height: 1.28;
  color: #f8fafc;
}

.preset-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.32;
}

.ngo-constraint-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.ngo-constraint-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ngo-textarea {
  width: 100%;
  resize: vertical;
  min-height: 46px;
  max-height: 92px;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.4;
}

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

.section-heading {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f8fafc;
}

.pipeline-status-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-secondary);
}

.pipeline-status-badge[data-state="running"] {
  border-color: var(--border-cyan);
  color: #7dd3fc;
}

.pipeline-status-badge[data-state="held_for_person"] {
  border-color: var(--border-amber);
  background: var(--amber-soft);
  color: #fde68a;
  font-weight: 700;
}

.pipeline-status-badge[data-state="failed"] {
  border-color: var(--border-rose);
  background: var(--rose-soft);
  color: #fecdd3;
  font-weight: 700;
}

.pipeline-status-badge[data-state="approved"] {
  border-color: var(--border-emerald);
  background: var(--emerald-soft);
  color: #6ee7b7;
  font-weight: 700;
}

.step-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.step-card {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(8, 12, 22, 0.78);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.step-card[data-status="running"] {
  border-color: var(--cyan);
  background: rgba(14, 34, 58, 0.52);
}

.step-card[data-status="done"] {
  border-color: rgba(16, 185, 129, 0.42);
  background: rgba(6, 48, 39, 0.34);
}

.step-card[data-status="held"] {
  border-color: var(--amber);
  background: rgba(120, 53, 15, 0.26);
}

.step-card[data-status="failed"] {
  border-color: var(--rose);
  background: rgba(76, 5, 25, 0.3);
}

.step-card[data-status="skipped"] {
  opacity: 0.6;
}

.step-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.step-title {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  flex-shrink: 0;
}

.step-card[data-status="done"] .step-pill {
  color: #6ee7b7;
}

.step-card[data-status="held"] .step-pill {
  color: #fde68a;
}

.step-card[data-status="failed"] .step-pill {
  color: #fecdd3;
}

.step-detail {
  font-family: var(--font-mono);
  font-size: 10.8px;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.human-gate-card {
  padding: 11px 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--amber);
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.32), rgba(15, 23, 42, 0.92));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.human-gate-card.is-approved {
  border-color: var(--emerald-bright);
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.36), rgba(15, 23, 42, 0.92));
}

.gate-copy {
  flex: 1;
  min-width: 240px;
}

.gate-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-bright);
  text-transform: uppercase;
}

.human-gate-card.is-approved .gate-kicker {
  color: var(--emerald-bright);
}

.gate-copy h3 {
  margin: 2px 0 4px;
  font-size: 13.5px;
  color: #fffbeb;
}

.gate-copy p {
  margin: 0;
  font-size: 12px;
  color: #e2e8f0;
}

.kit-inspector-card {
  background: var(--bg-code);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kit-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.kit-meta-box {
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.kit-meta-box span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* WORKER + 409 CONFLICT PANEL */
.worker-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.worker-step-btn {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: rgba(14, 21, 36, 0.92);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.14s ease;
}

.worker-step-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  background: rgba(20, 32, 54, 0.96);
}

.worker-step-btn.is-done {
  border-color: rgba(16, 185, 129, 0.48);
}

.worker-step-danger {
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(69, 10, 26, 0.26);
}

.worker-step-danger:hover:not(:disabled) {
  border-color: var(--rose-bright);
  background: rgba(136, 19, 55, 0.34);
}

.w-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  flex-shrink: 0;
}

.worker-step-danger .w-num {
  color: var(--rose-bright);
}

.w-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.w-body strong {
  font-size: 12.4px;
  color: #f8fafc;
}

.w-body small {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.lease-telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(6, 9, 17, 0.92);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  flex-wrap: wrap;
}

.lease-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.lease-k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.lease-v {
  font-size: 12px;
  color: #e2e8f0;
  font-weight: 600;
}

.lease-fence {
  color: var(--amber-bright);
}

.lease-timer[data-live="true"] {
  color: var(--emerald-bright);
}

.conflict-spotlight {
  padding: 11px 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--rose);
  background: linear-gradient(135deg, rgba(136, 19, 55, 0.36), rgba(9, 13, 22, 0.95));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conflict-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.conflict-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(244, 63, 94, 0.24);
  border: 1px solid var(--rose-bright);
  color: #ffe4e6;
}

.conflict-spotlight pre {
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(6, 9, 17, 0.92);
  border: 1px solid rgba(244, 63, 94, 0.32);
  font-size: 11px;
  color: #fecdd3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.worker-feed {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.worker-event {
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(8, 12, 22, 0.84);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.worker-event[data-tone="conflict"],
.worker-event[data-tone="fail"] {
  border-color: rgba(244, 63, 94, 0.5);
  background: rgba(76, 5, 25, 0.24);
}

.worker-event-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* TERMINAL / CLI MODE */
.cli-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #050810;
}

.cli-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  background: #0b101d;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.cli-dots {
  display: inline-flex;
  gap: 6px;
}

.cli-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-r { background: #f43f5e; }
.dot-y { background: #f59e0b; }
.dot-g { background: #10b981; }

.cli-title {
  color: var(--text-secondary);
  font-weight: 600;
}

.cli-hint {
  color: var(--text-dim);
  font-size: 10.5px;
}

.cli-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 7px 12px;
  background: #080c17;
  border-bottom: 1px solid var(--border-subtle);
}

.cli-chip {
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #0f172a;
  color: #bae6fd;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}

.cli-chip:hover {
  border-color: var(--cyan);
  background: rgba(56, 189, 248, 0.16);
}

.cli-chip-warn {
  border-color: rgba(244, 63, 94, 0.42);
  color: #fda4af;
}

.cli-output {
  flex: 1;
  min-height: 260px;
  overflow-y: auto;
  padding: 11px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cli-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cli-line-cmd { color: #38bdf8; font-weight: 600; }
.cli-line-ok { color: #34d399; }
.cli-line-warn { color: #fbbf24; }
.cli-line-err { color: #fb7185; font-weight: 600; }
.cli-line-muted { color: #94a3b8; }

.cli-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: #090e1a;
  border-top: 1px solid var(--border-subtle);
}

.cli-prompt {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--emerald-bright);
  white-space: nowrap;
}

.cli-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 4px 2px;
}

/* RIGHT PANE TOP: VISUAL LIVE CALL TOPOLOGY */
.topology-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 10px 14px 8px;
  flex-shrink: 0;
}

.topology-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.topology-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.topology-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.live-wire-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #060a13;
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-secondary);
  max-width: 100%;
}

.live-wire-pill[data-tone="ok"] {
  border-color: var(--border-emerald);
  color: #6ee7b7;
}

.live-wire-pill[data-tone="conflict"] {
  border-color: var(--rose-bright);
  background: rgba(136, 19, 55, 0.32);
  color: #fecdd3;
}

.wire-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

.live-wire-pill[data-tone="ok"] .wire-pill-dot {
  background: var(--emerald-bright);
  box-shadow: 0 0 8px var(--emerald);
}

.live-wire-pill[data-tone="conflict"] .wire-pill-dot {
  background: var(--rose-bright);
  box-shadow: 0 0 8px var(--rose);
}

.topology-stage {
  background: #060a13;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 10px;
  padding: 4px 6px;
}

.topology-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 248px;
}

.topo-edge {
  stroke: rgba(100, 116, 139, 0.36);
  stroke-width: 1.8;
  stroke-dasharray: 5 4;
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.topo-edge.is-active {
  stroke: var(--cyan);
  stroke-width: 2.6;
  stroke-dasharray: none;
}

.topo-edge.is-conflict {
  stroke: var(--rose-bright);
  stroke-width: 2.8;
  stroke-dasharray: none;
}

.node-box {
  fill: #0d1526;
  stroke: rgba(148, 163, 184, 0.28);
  stroke-width: 1.4;
  transition: stroke 0.2s ease, fill 0.2s ease;
}

.topo-node-core .node-box {
  stroke: rgba(56, 189, 248, 0.42);
}

.topo-node.is-lit .node-box {
  fill: #13223d;
  stroke: var(--emerald-bright);
  stroke-width: 2.2;
}

.topo-node.is-conflict .node-box {
  fill: #2a0e1d;
  stroke: var(--rose-bright);
  stroke-width: 2.4;
}

.node-led {
  fill: #475569;
  transition: fill 0.2s ease;
}

.topo-node.is-lit .node-led {
  fill: var(--emerald-bright);
}

.topo-node.is-conflict .node-led {
  fill: var(--rose-bright);
}

.node-title {
  fill: #f8fafc;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
}

.node-host {
  fill: #94a3b8;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.node-stat {
  fill: #38bdf8;
  font-family: var(--font-mono);
  font-size: 10.2px;
}

/* RIGHT PANE BOTTOM: LIVE WIRE & STATE INSPECTOR */
.inspector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 300px;
  overflow: hidden;
}

.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 7px 10px;
  background: rgba(8, 12, 21, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.inspector-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 6px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11.8px;
  font-weight: 600;
  cursor: pointer;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspector-tab:hover {
  color: var(--text-primary);
  background: rgba(30, 41, 59, 0.45);
}

.inspector-tab.is-active {
  background: rgba(56, 189, 248, 0.14);
  border-color: var(--border-cyan);
  color: #f0f9ff;
}

.count-pill {
  padding: 1px 6px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(15, 23, 42, 0.9);
  color: #7dd3fc;
  flex-shrink: 0;
}

.inspector-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.inspector-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(11, 17, 30, 0.72);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-muted);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.inspector-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* WIRE LOG ENTRIES */
.wire-row {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(7, 11, 20, 0.88);
  overflow: hidden;
}

.wire-row[data-status-group="fail"] {
  border-color: rgba(244, 63, 94, 0.5);
  background: rgba(48, 8, 22, 0.28);
}

.wire-summary {
  width: 100%;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11.2px;
  text-align: left;
  cursor: pointer;
}

.wire-summary:hover {
  background: rgba(30, 41, 59, 0.35);
}

.w-method {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.w-method[data-m="MCP"] {
  background: rgba(167, 139, 250, 0.18);
  color: #c4b5fd;
}

.w-status {
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}

.w-status[data-ok="false"],
.w-status[data-code="409"] {
  background: rgba(244, 63, 94, 0.25);
  border: 1px solid rgba(251, 113, 133, 0.55);
  color: #fecdd3;
}

.w-url {
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.w-ms {
  color: var(--text-muted);
  font-size: 10.5px;
}

.w-reqid {
  color: var(--text-dim);
  font-size: 10px;
}

.wire-detail {
  padding: 9px 10px 10px;
  border-top: 1px solid var(--border-subtle);
  background: #050810;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wire-detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10.8px;
  color: var(--text-muted);
}

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

.wire-box {
  background: #090e1a;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 7px 9px;
  min-width: 0;
}

.wire-box-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 4px;
}

.wire-box pre {
  margin: 0;
  font-size: 10.8px;
  line-height: 1.38;
  color: #cbd5e1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 185px;
  overflow-y: auto;
}

/* TASKS & NOUNS TABLES */
.state-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.state-table th,
.state-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.state-table th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.55);
}

.state-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
}

.state-badge[data-st="done"],
.state-badge[data-st="steward_approved_demo"] {
  background: var(--emerald-soft);
  color: #6ee7b7;
}

.state-badge[data-st="leased"] {
  background: rgba(56, 189, 248, 0.22);
  color: #bae6fd;
}

.state-badge[data-st="held_for_person"] {
  background: var(--amber-soft);
  color: #fde68a;
}

.noun-card {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(8, 12, 22, 0.85);
  padding: 8px 10px;
}

.noun-card summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.2px;
  color: #e2e8f0;
  list-style: none;
}

.noun-card pre {
  margin: 7px 0 0;
  padding: 7px 9px;
  background: var(--bg-code);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  font-size: 10.8px;
  color: #cbd5e1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 170px;
  overflow-y: auto;
}

/* MCP GUIDE TAB */
.mcp-guide-scroll {
  gap: 10px;
}

.mcp-mapping-intro h3 {
  margin: 2px 0 4px;
  font-size: 13px;
  color: #f8fafc;
}

.mcp-mapping-intro p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.mcp-map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.mcp-map-item {
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(8, 12, 22, 0.86);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mcp-role {
  font-size: 11px;
  font-weight: 700;
  color: var(--emerald-bright);
}

.mcp-map-item code {
  font-size: 10.5px;
  color: #7dd3fc;
  overflow-wrap: anywhere;
}

.mcp-map-item p {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.harness-config-block {
  background: #060911;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
}

.harness-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}

.harness-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.harness-pill {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #0f172a;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.harness-pill.is-active {
  border-color: var(--cyan);
  background: var(--cyan-soft);
  color: #e0f2fe;
}

.code-pre {
  margin: 0;
  padding: 8px 10px;
  background: #04070e;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.42;
  color: #bae6fd;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 16px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1159px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }

  .pane-left {
    min-height: 560px;
  }

  .inspector-card {
    min-height: 400px;
  }
}

@media (max-width: 780px) {
  html,
  body {
    overflow-x: hidden;
  }

  .studio-header {
    padding: 10px 12px;
    overflow-x: clip;
  }

  .brand-cluster,
  .header-controls,
  .quick-links {
    max-width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }

  .mode-switcher {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
  }

  .mode-btn {
    font-size: 11px;
    padding: 5px 8px;
    white-space: normal;
    text-align: left;
  }

  .scenario-tabs,
  .inspector-tabs,
  .preset-grid,
  .step-cards,
  .worker-actions-grid,
  .wire-cols,
  .shim-diff-grid,
  .mcp-map-grid,
  .kit-meta-grid {
    grid-template-columns: 1fr;
  }

  .ngo-constraint-row {
    grid-template-columns: 1fr;
  }
}

/* Failure text inside a wire-log row, a Herma card or the NGO review gate */
.wire-problem {
  margin: 0 10px 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--rose-soft);
  color: #fecdd3;
  font-family: var(--font-mono);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.shim-card[data-ok="false"] {
  border-left-color: var(--rose-bright);
}

.ref-badge-fail {
  background: var(--rose-soft);
  color: #fecdd3;
}

.gate-error {
  color: #fecdd3;
}

.noun-source {
  margin: 4px 0;
  font-size: 11px;
  color: var(--text-muted);
}
