:root {
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f4f4f5;
  --bg-subtle: #f8f8f9;
  --bg-dark: #09090b;
  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --border-color: #e4e4e7;
  --border-strong: #09090b;
  --border-light: #f0f0f2;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.spectra-studio-app {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ==========================================================================
   TOP PRECISION TELEMETRY HUD BAR
   ========================================================================== */
.hud-top-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-monogram {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mono-badge {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.version-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
}

.hud-divider {
  width: 1px;
  height: 18px;
  background: var(--border-color);
}

.live-pulse-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
}

.pulse-text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.hud-center {
  display: flex;
  align-items: center;
}

.view-switcher {
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.view-tab {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-tab:hover {
  color: var(--text-primary);
}

.view-tab.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hud-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.metric-lbl {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.metric-val.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hud-gh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-dark);
  color: #ffffff;
  text-decoration: none;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 600;
  transition: opacity 0.15s ease;
}

.hud-gh-btn:hover {
  opacity: 0.88;
}

/* ==========================================================================
   MAIN DUAL-PANE TELEMETRY STUDIO WORKSPACE
   ========================================================================== */
.studio-viewport {
  display: flex;
  min-height: calc(100vh - 52px);
  border-bottom: 1px solid var(--border-color);
}

/* LEFT COMMAND RAIL */
.command-rail {
  width: 380px;
  min-width: 380px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rail-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rail-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.rail-summary {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.install-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.install-bar:hover {
  border-color: var(--text-primary);
}

.prompt-sym {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 6px;
}

.prompt-cmd {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.copy-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

.rail-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sec-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.sec-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.scenario-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.scenario-card {
  text-align: left;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scenario-card:hover {
  border-color: var(--text-muted);
}

.scenario-card.active {
  border-color: var(--border-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.sc-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sc-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--radius-xs);
}

.sc-badge.ok {
  background: #ecfdf5;
  color: #065f46;
}

.sc-badge.err {
  background: #fef2f2;
  color: #991b1b;
}

.sc-flow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Scrubber Deck */
.scrubber-controls {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.scrubber-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.deck-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 0;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.1s ease;
}

.deck-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
}

.scrubber-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  outline: none;
}

.scrubber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-primary);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Metrics Ledger */
.metrics-ledger {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
}

.ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-light);
}

.ledger-row:last-child {
  border-bottom: none;
}

.ledger-key {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ledger-val.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* RIGHT PANE: Multi-View Stage Area */
.stage-canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
  position: relative;
}

.stage-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.stage-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.bc-sep {
  color: var(--border-color);
}

.bc-item.bold {
  font-weight: 700;
  color: var(--text-primary);
}

.action-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* View Panels */
.view-panel {
  display: none;
  flex: 1;
  overflow: auto;
  position: relative;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
}

/* VIEW 1: DAG CANVAS */
.dag-canvas-frame {
  position: relative;
  width: 100%;
  min-height: 480px;
  flex: 1;
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 24px 24px;
}

.dag-svg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.dag-nodes-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 2rem;
}

.dag-node {
  position: absolute;
  width: 220px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.dag-node:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dag-node.active {
  border-color: var(--border-strong);
  border-width: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.dag-node.dimmed {
  opacity: 0.28;
  filter: grayscale(1);
}

.node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.node-type-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
}

.node-status-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

.node-status-tag.ok {
  background: #ecfdf5;
  color: #065f46;
}

.node-status-tag.err {
  background: #fef2f2;
  color: #991b1b;
}

.node-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 0.35rem;
}

.node-dur, .node-tok {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
}

/* VIEW 2: STEP FRAMES FEED */
.frames-feed {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.frame-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.frame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.frame-step {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.frame-dur {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.frame-reasoning {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.frame-raw-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-primary);
  overflow-x: auto;
}

/* VIEW 3: WATERFALL */
.waterfall-container {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wf-header-row {
  display: grid;
  grid-template-columns: 200px 1fr 140px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.wf-rows-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wf-row {
  display: grid;
  grid-template-columns: 200px 1fr 140px;
  align-items: center;
  font-size: 0.8rem;
}

.wf-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1rem;
}

.wf-track {
  width: 100%;
  height: 18px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xs);
  position: relative;
  overflow: hidden;
}

.wf-fill {
  height: 100%;
  background: var(--text-primary);
  border-radius: var(--radius-xs);
}

.wf-fill.err {
  background: var(--accent-red);
}

.wf-tokens {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-align: right;
}

/* VIEW 4: EVENT BUS */
.event-bus-stage {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}

.bus-controls-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bus-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

.bus-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.bus-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-primary);
}

.bus-btn.clear {
  margin-left: auto;
  color: var(--text-muted);
}

.event-bus-stream {
  flex: 1;
  min-height: 320px;
  background: var(--bg-dark);
  color: #e4e4e7;
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.7;
  overflow-y: auto;
}

.event-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.event-item .ev-time {
  color: #71717a;
}

.event-item .ev-type {
  color: #a1a1aa;
  font-weight: 700;
}

.event-item.info .ev-type { color: #60a5fa; }
.event-item.tool .ev-type { color: #34d399; }
.event-item.warn .ev-type { color: #fbbf24; }
.event-item.err .ev-type { color: #f87171; }

/* IN-LINE INSPECTOR DRAWER */
.inspector-drawer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

.drawer-node-name {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-status-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer-stat-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  background: #ecfdf5;
  color: #065f46;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.drawer-time-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
}

.drawer-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.drawer-column {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.drawer-tab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.d-tab-lbl {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.d-copy-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.drawer-code-pre {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 0.5rem;
  max-height: 120px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-primary);
}

/* ==========================================================================
   SWISS SPECIFICATION LEDGER SECTION
   ========================================================================== */
.spec-ledger-section {
  padding: 5rem 2rem;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.spec-container {
  max-width: 1200px;
  margin: 0 auto;
}

.spec-section-head {
  margin-bottom: 3rem;
}

.spec-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.spec-main-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.spec-table-ledger {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-color);
}

.spec-row {
  display: grid;
  grid-template-columns: 60px 1.5fr 1fr 1fr;
  align-items: baseline;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  gap: 2rem;
}

.spec-col-idx {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.spec-name {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.spec-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.spec-col-metric {
  display: flex;
  flex-direction: column;
}

.spec-stat {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.spec-stat-lbl {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.spec-col-detail {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.detail-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  width: fit-content;
}

/* ==========================================================================
   PROTOCOL INTEGRATION MATRIX
   ========================================================================== */
.integration-matrix-section {
  padding: 5rem 2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.matrix-container {
  max-width: 1200px;
  margin: 0 auto;
}

.matrix-split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}

.matrix-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.matrix-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.matrix-nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.matrix-tab {
  text-align: left;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.matrix-tab:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.matrix-tab.active {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
}

.matrix-code-box {
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.code-box-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #18181b;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #27272a;
}

.code-box-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #a1a1aa;
}

.copy-matrix-btn {
  background: transparent;
  border: 1px solid #3f3f46;
  color: #e4e4e7;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-matrix-btn:hover {
  background: #27272a;
}

.matrix-pre {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: #f4f4f5;
  overflow-x: auto;
}

/* ==========================================================================
   EDITORIAL SYSTEM MANIFEST FOOTER
   ========================================================================== */
.manifest-footer {
  padding: 4rem 2rem 3rem;
  background: var(--bg-primary);
}

.manifest-container {
  max-width: 1200px;
  margin: 0 auto;
}

.manifest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.m-header {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.75rem;
}

.m-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.m-text.bold {
  font-weight: 700;
  color: var(--text-primary);
}

.m-text.small {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.m-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}

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

/* Comprehensive Responsive Optimization for Phone & Tablet */
@media (max-width: 1024px) {
  .studio-viewport {
    flex-direction: column;
  }
  .command-rail {
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .spec-row {
    grid-template-columns: 50px 1.5fr 1fr;
    gap: 1.5rem;
  }
  .spec-col-detail {
    grid-column: 2 / -1;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .matrix-split {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .manifest-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .hud-top-bar {
    height: auto;
    padding: 0.6rem 1rem;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .hud-left {
    flex: 1;
    justify-content: flex-start;
  }

  .hud-right {
    order: 2;
    gap: 0.6rem;
  }

  .hud-metric {
    display: none;
  }

  .hud-divider {
    display: none;
  }

  .hud-center {
    width: 100%;
    order: 3;
  }

  .view-switcher {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    display: flex;
    justify-content: flex-start;
    padding: 3px;
  }

  .view-switcher::-webkit-scrollbar {
    display: none;
  }

  .view-tab {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.74rem;
    white-space: nowrap;
  }

  .command-rail {
    padding: 1.25rem 1rem;
    gap: 1.25rem;
  }

  .rail-title {
    font-size: 1.25rem;
  }

  .deck-btn {
    padding: 8px 0;
    font-size: 0.78rem;
  }

  .stage-top-bar {
    padding: 0.6rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .dag-canvas-frame {
    min-height: 400px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .dag-svg-canvas,
  .dag-nodes-canvas {
    min-width: 620px;
    min-height: 400px;
  }

  .frames-feed {
    padding: 1rem;
  }

  .waterfall-container {
    padding: 1rem;
  }

  .wf-header-row,
  .wf-row {
    grid-template-columns: 110px 1fr 80px;
    gap: 0.5rem;
    font-size: 0.72rem;
  }

  .wf-name {
    padding-right: 0.5rem;
    font-size: 0.72rem;
  }

  .wf-tokens {
    font-size: 0.65rem;
  }

  .event-bus-stage {
    padding: 1rem;
  }

  .bus-controls-bar {
    gap: 0.4rem;
  }

  .bus-btn {
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  .inspector-drawer {
    padding: 1rem;
  }

  .drawer-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .drawer-body {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .spec-ledger-section,
  .integration-matrix-section {
    padding: 3.5rem 1rem;
  }

  .spec-main-title {
    font-size: 1.6rem;
  }

  .spec-row {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.5rem 0;
  }

  .spec-col-idx {
    font-size: 1.25rem;
  }

  .spec-stat {
    font-size: 1.4rem;
  }

  .matrix-title {
    font-size: 1.45rem;
  }

  .manifest-footer {
    padding: 3rem 1rem 2rem;
  }
}

@media (max-width: 600px) {
  .manifest-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

