/* Thought-experiment views — mounted natively in workbench (no iframe) */
.workbench-demo-host {
  display: none;
  max-width: 820px;
  margin: 0 auto;
}

.workbench-demo-host.is-active {
  display: block;
}

.solver-panels.is-hidden {
  display: none !important;
}

.demo-view h1 {
  font-size: 1.25rem;
  color: var(--accent, #00d4ff);
  margin-bottom: 6px;
}

.demo-view .demo-lead {
  font-size: 0.85rem;
  color: var(--muted, #8888a0);
  margin-bottom: 16px;
  line-height: 1.65;
}

.demo-view .demo-card {
  background: var(--card, #14141f);
  border: 1px solid var(--border, #1e1e2e);
  border-radius: 6px;
  padding: 16px;
}

.demo-view .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 0.76rem;
  margin-bottom: 12px;
  color: var(--muted, #8888a0);
}

.demo-view .legend span { display: flex; align-items: center; gap: 6px; }
.demo-view .legend i {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.demo-view .lg-grid { background: #555; width: 10px; height: 10px; border-radius: 0; }
.demo-view .lg-blue { background: rgba(0, 180, 255, 0.9); box-shadow: 0 0 8px rgba(0, 180, 255, 0.5); }
.demo-view .lg-orange { background: rgba(255, 140, 0, 0.9); box-shadow: 0 0 8px rgba(255, 140, 0, 0.4); }
.demo-view .lg-src { background: rgba(255, 200, 0, 0.95); box-shadow: 0 0 10px rgba(255, 200, 0, 0.6); }
.demo-view .lg-pkg { background: #aaaaff; box-shadow: 0 0 8px rgba(170, 170, 255, 0.5); }
.demo-view .lg-rest { background: #444; }

.demo-view .status-box {
  min-height: 3em;
  padding: 10px 12px;
  margin: 12px 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border, #1e1e2e);
  border-radius: 4px;
  font-size: 0.82rem;
  color: #c8c8e0;
  line-height: 1.6;
  transition: border-color 0.25s;
}
.demo-view .status-box.gw-active { border-color: rgba(255, 200, 0, 0.45); }
.demo-view .status-box.slow-active { border-color: rgba(0, 212, 255, 0.35); }

.demo-view .controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 0.8rem;
  color: var(--muted, #8888a0);
  margin-top: 12px;
}
.demo-view .controls label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-view .controls input[type="range"] { width: 120px; accent-color: var(--accent, #00d4ff); }
.demo-view .controls input[type="range"]:disabled { opacity: 0.45; }

.demo-view .mode-group { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-view .demo-btn {
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border, #1e1e2e);
  background: transparent;
  color: var(--muted, #8888a0);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}
.demo-view .demo-btn:hover { border-color: var(--accent, #00d4ff); color: var(--accent, #00d4ff); }
.demo-view .demo-btn.active {
  border-color: var(--accent, #00d4ff);
  color: var(--accent, #00d4ff);
  background: rgba(0, 212, 255, 0.1);
}
.demo-view .demo-btn.gw.active {
  border-color: rgba(255, 200, 0, 0.8);
  color: rgba(255, 200, 0, 1);
  background: rgba(255, 200, 0, 0.08);
}

.demo-view .hint {
  font-size: 0.75rem;
  color: var(--muted, #8888a0);
  margin-top: 10px;
  line-height: 1.6;
}
.demo-view .hint kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--border, #1e1e2e);
  border-radius: 3px;
  font-size: 0.7rem;
  color: var(--text, #e8e8f0);
}

.demo-view .caption {
  font-size: 0.85rem;
  color: #b8b8d0;
  line-height: 1.7;
  padding: 14px 0 0;
  border-top: 1px solid var(--border, #1e1e2e);
  margin-top: 12px;
}
.demo-view .caption strong { color: var(--text, #e8e8f0); }

.demo-view .zone-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.72rem;
  color: var(--muted, #8888a0);
  margin-bottom: 10px;
}
.demo-view .zone-hint span { display: flex; align-items: center; gap: 6px; }
.demo-view .zone-hint i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.demo-view .zh-straight { background: rgba(0, 212, 255, 0.7); }
.demo-view .zh-wave { background: rgba(255, 200, 0, 0.75); }

.demo-view .freq-readout {
  font-variant-numeric: tabular-nums;
  color: var(--accent, #00d4ff);
  font-weight: 600;
  min-width: 4.5em;
}

.demo-view .canvas-aspect-wide {
  width: 100%;
  max-width: 960px;
  margin: 0 auto 12px;
  aspect-ratio: 960 / 400;
  border-radius: 6px;
  border: 1px solid var(--border, #1e1e2e);
  overflow: hidden;
  background: #0a0a0f;
}
.demo-view .canvas-aspect-wide canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.demo-view canvas.drag-blue { cursor: grabbing; }
.demo-view canvas.has-orange { cursor: pointer; }

.demo-view-err {
  padding: 20px;
  color: #e07050;
  font-size: 0.85rem;
}

html.lang-zh .demo-view .lang-en { display: none !important; }
html.lang-en .demo-view .lang-zh { display: none !important; }

@media (max-width: 640px) {
  .demo-view h1 { font-size: 1.05rem; }
  .demo-view .demo-lead { font-size: 0.78rem; }
  .demo-view .demo-card { padding: 12px; }
  .demo-view .controls input[type="range"] { width: 88px; }
}
