/* SPDX-FileCopyrightText: 2026 Olivier Guyon et al
   SPDX-License-Identifier: LGPL-3.0-or-later */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0.75rem 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-alt);
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.search-input,
.select-input {
  padding: 0.34rem 0.62rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.84rem;
}

.sim-filter-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin: 0.75rem 0;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.filter-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
}

.filter-cat-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.48rem 0.68rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.filter-cat-box.cat-loop_operation { border-left: 4px solid var(--cat-loop_operation); }
.filter-cat-box.cat-calibration { border-left: 4px solid var(--cat-calibration); }
.filter-cat-box.cat-simulation { border-left: 4px solid var(--cat-simulation); }

.filter-cat-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: flex;
  align-items: center;
}

.filter-cat-box.cat-loop_operation .filter-cat-title .cat-dot {
  background: var(--cat-loop_operation);
}
.filter-cat-box.cat-calibration .filter-cat-title .cat-dot {
  background: var(--cat-calibration);
}
.filter-cat-box.cat-simulation .filter-cat-title .cat-dot {
  background: var(--cat-simulation);
}

.tristate {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-alt);
}

.tristate-btn {
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 0.28rem 0.56rem;
  font-size: 0.79rem;
  font-weight: 500;
  cursor: pointer;
}

.tristate-btn:last-child { border-right: none; }
.tristate-btn:hover { background: var(--surface); color: var(--text); }
.tristate-btn.active { font-weight: 700; }
.tristate-btn.active[data-val="any"] { background: var(--accent-soft); color: var(--accent); }
.tristate-btn.active[data-val="on"] { background: #047857; color: #ffffff; }
.tristate-btn.active[data-val="off"] { background: #475569; color: #ffffff; }

.filter-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.filter-inline-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 0.15rem;
}

.cmp-drawer {
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 1rem;
  background: var(--surface-alt);
  margin: 0.75rem 0 1rem;
}

.explorer-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: var(--surface-alt);
  margin: 1rem 0 1.4rem;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.8rem;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.bench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.8rem;
  margin: 0.8rem 0 1.2rem;
}

.bench-card {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.75rem 0.9rem;
  background: var(--surface-alt);
  font-size: 0.83rem;
}

.bench-card-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.bench-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.18rem 0.55rem;
  font-size: 0.78rem;
}

.bench-kv dt { color: var(--muted); font-family: monospace; }
.bench-kv dd { margin: 0; font-family: monospace; word-break: break-all; }

.canvas-wrap {
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
}

canvas.chart-canvas {
  display: block;
  width: 100%;
  height: 310px;
}

.canvas-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  font-size: 0.76rem;
  white-space: nowrap;
  display: none;
  z-index: 10;
}

.opt-ctrl-sep {
  display: inline-block;
  width: 1px;
  height: 1rem;
  background: var(--border);
  margin: 0 0.35rem;
  vertical-align: middle;
}

.opt-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.9rem;
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.opt-legend:empty { display: none; }

.opt-legend-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
}

.opt-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
}

.opt-legend-swatch {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top-width: 2.5px;
}

.opt-legend-note {
  font-size: 0.73rem;
  color: var(--muted);
}

.hbar-list { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.65rem; }

.hbar-row {
  display: grid;
  grid-template-columns: minmax(220px, 290px) 1fr 80px;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.hbar-label {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .hbar-row { grid-template-columns: 155px 1fr 64px; }
}

.hbar-track {
  height: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.hbar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.hbar-fill.cat-simulation { background: var(--cat-simulation-solid); }
.hbar-fill.cat-calibration { background: var(--cat-calibration-solid); }
.hbar-fill.cat-loop_operation { background: var(--cat-loop_operation-solid); }
.hbar-fill.cat-analysis { background: var(--cat-analysis-solid); }

.customizer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 0.65rem;
  margin: 0.65rem 0;
}

.field-box {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  font-size: 0.79rem;
}

.field-box label { font-weight: 600; color: var(--muted); }

.field-box input,
.field-box select {
  padding: 0.32rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.83rem;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.cat-pill.cat-simulation { border-color: var(--cat-simulation-border); color: var(--cat-simulation-text); }
.cat-pill.cat-simulation .cat-dot { background: var(--cat-simulation); }
.cat-pill.cat-simulation.active {
  background: var(--cat-simulation-solid);
  border-color: var(--cat-simulation-solid);
  color: #ffffff;
}

.cat-pill.cat-calibration { border-color: var(--cat-calibration-border); color: var(--cat-calibration-text); }
.cat-pill.cat-calibration .cat-dot { background: var(--cat-calibration); }
.cat-pill.cat-calibration.active {
  background: var(--cat-calibration-solid);
  border-color: var(--cat-calibration-solid);
  color: #ffffff;
}

.cat-pill.cat-loop_operation {
  border-color: var(--cat-loop_operation-border);
  color: var(--cat-loop_operation-text);
}
.cat-pill.cat-loop_operation .cat-dot { background: var(--cat-loop_operation); }
.cat-pill.cat-loop_operation.active {
  background: var(--cat-loop_operation-solid);
  border-color: var(--cat-loop_operation-solid);
  color: #ffffff;
}

.cat-pill.cat-analysis { border-color: var(--cat-analysis-border); color: var(--cat-analysis-text); }
.cat-pill.cat-analysis .cat-dot { background: var(--cat-analysis); }
.cat-pill.cat-analysis.active {
  background: var(--cat-analysis-solid);
  border-color: var(--cat-analysis-solid);
  color: #ffffff;
}

.cat-pill.active .cat-dot { background: #ffffff; }

.cat-empty-note {
  padding: 0.85rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  margin: 0.65rem 0;
}

.eof-pf-vis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: stretch;
}

.eof-pf-vis-grid.is-slice-only {
  grid-template-columns: 1fr;
}

.eof-pf-vis-grid.is-slice-only .eof-pf-main-wrap {
  display: none;
}

.eof-pf-main-wrap,
.eof-pf-slice-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.eof-pf-slice-wrap {
  border-top: 3px solid #f59e0b;
}

.eof-pf-slice-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.6rem;
  margin-bottom: 0.35rem;
}

.eof-pf-slice-hdr-left,
.eof-pf-slice-hdr-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
}

.eof-pf-slice-hdr h3 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
}

.eof-pf-lag-pill {
  display: inline-block;
  padding: 0.08rem 0.46rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid #f59e0b;
  color: #b45309;
  white-space: nowrap;
}

[data-theme="dark"] .eof-pf-lag-pill {
  color: #fbbf24;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .eof-pf-lag-pill {
    color: #fbbf24;
  }
}

.eof-pf-slice-meta {
  font-size: 0.75rem;
}

.eof-pf-slice-stage {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
}

.eof-pf-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem;
  margin-top: 0.85rem;
  align-items: stretch;
}

.eof-pf-step-btn {
  padding: 0.18rem 0.46rem;
  min-width: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

@media (max-width: 1080px) {
  .eof-pf-details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .eof-pf-details-grid > .eof-pf-side-card:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .eof-pf-vis-grid {
    grid-template-columns: 1fr;
  }
  .eof-pf-details-grid {
    grid-template-columns: 1fr;
  }
}

canvas.eof-pf-canvas {
  display: block;
  width: 100%;
  height: 450px;
  user-select: none;
}

canvas.eof-pf-slice-canvas {
  display: block;
  width: 100%;
  height: 416px;
  user-select: none;
  cursor: crosshair;
}

.eof-pf-vis-grid.is-slice-only canvas.eof-pf-slice-canvas {
  height: 460px;
}

canvas.eof-pf-kernel-canvas {
  display: block;
  width: 100%;
  height: 195px;
  cursor: pointer;
}

.eof-pf-side-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.78rem;
  background: var(--surface);
}

.eof-pf-side-card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
}

.eof-pf-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
}

.eof-pf-stat {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.34rem 0.48rem;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.75rem;
}

.eof-pf-stat span { color: var(--muted); }
.eof-pf-stat strong { font-size: 0.81rem; color: var(--text); font-variant-numeric: tabular-nums; }

.eof-pf-pair-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.eof-pf-ctrl-label {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.eof-pf-hint {
  font-size: 0.76rem;
  margin-top: 0.35rem;
}

.opt-cli-tip {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.81rem;
  color: var(--muted);
}

.opt-sub-meta {
  font-size: 0.73rem;
  color: var(--muted);
  margin-top: 0.14rem;
}

.opt-ref-link {
  color: inherit;
  text-decoration: underline dotted var(--border);
  text-underline-offset: 2px;
}

.opt-ref-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.opt-nondefault {
  color: var(--accent);
  font-weight: 700;
}

.opt-nondefault-tag {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.02rem 0.32rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
  vertical-align: middle;
}

.opt-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.35rem;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  cursor: pointer;
}

.opt-copy-btn:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--accent);
}

.opt-badge {
  display: inline-block;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.opt-badge-both {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--muted);
}

.opt-badge-fused {
  background: rgba(217, 119, 6, 0.14);
  border: 1px solid rgba(217, 119, 6, 0.45);
  color: var(--opt-fused-text);
}

.opt-badge-live {
  background: rgba(5, 150, 105, 0.14);
  border: 1px solid rgba(5, 150, 105, 0.45);
  color: var(--opt-live-text);
}

.opt-badge-init {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--muted);
}

.opt-badge-out {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.opt-badge-adv {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.02rem 0.3rem;
  border-radius: 4px;
  font-size: 0.67rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.14);
  color: var(--opt-adv-text);
}

@keyframes optRowFlash {
  0% { background-color: var(--accent-soft); }
  100% { background-color: transparent; }
}

.opt-row-flash {
  animation: optRowFlash 2.4s ease-out;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.adv-customizer {
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
}

.adv-customizer > summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.adv-customizer-group {
  margin-top: 0.65rem;
}

.adv-customizer-group-hdr {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0.4rem 0 0.25rem;
}

.field-check-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.22rem;
}

.field-check-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

/* Algorithms Catalog, 2D Dependency Matrix & Entry Pages */
.algo-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.85rem;
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  font-size: 0.81rem;
}

.algo-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.14rem 0.52rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--border);
}

.algo-legend-pill.cat-calibration {
  background: var(--cat-calibration-soft);
  color: var(--cat-calibration-text);
  border-color: var(--cat-calibration-border);
}
.algo-legend-pill.cat-online_calib {
  background: var(--cat-online_calib-soft);
  color: var(--cat-online_calib-text);
  border-color: var(--cat-online_calib-border);
}
.algo-legend-pill.cat-loop_operation {
  background: var(--cat-loop_operation-soft);
  color: var(--cat-loop_operation-text);
  border-color: var(--cat-loop_operation-border);
}
.algo-legend-pill.cat-analysis {
  background: var(--cat-analysis-soft);
  color: var(--cat-analysis-text);
  border-color: var(--cat-analysis-border);
}
.algo-legend-pill.cat-simulation {
  background: var(--cat-simulation-soft);
  color: var(--cat-simulation-text);
  border-color: var(--cat-simulation-border);
}
.algo-legend-pill.cat-planned {
  background: var(--cat-planned-soft);
  color: var(--cat-planned-text);
  border-color: var(--cat-planned-border);
  border-style: dashed;
}

.algo-code-badge,
a.algo-code-badge {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.16rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid var(--border);
  white-space: nowrap;
}

a.algo-code-badge:hover { filter: brightness(0.94); }

.algo-code-badge.cat-calibration {
  background: var(--cat-calibration-soft);
  color: var(--cat-calibration-text);
  border-color: var(--cat-calibration-border);
}
.algo-code-badge.cat-online_calib {
  background: var(--cat-online_calib-soft);
  color: var(--cat-online_calib-text);
  border-color: var(--cat-online_calib-border);
}
.algo-code-badge.cat-loop_operation {
  background: var(--cat-loop_operation-soft);
  color: var(--cat-loop_operation-text);
  border-color: var(--cat-loop_operation-border);
}
.algo-code-badge.cat-analysis {
  background: var(--cat-analysis-soft);
  color: var(--cat-analysis-text);
  border-color: var(--cat-analysis-border);
}
.algo-code-badge.cat-simulation {
  background: var(--cat-simulation-soft);
  color: var(--cat-simulation-text);
  border-color: var(--cat-simulation-border);
}
.algo-code-badge.cat-planned {
  background: var(--cat-planned-soft);
  color: var(--cat-planned-text);
  border-color: var(--cat-planned-border);
  border-style: dashed;
}

.algo-code-badge-opt { border-style: dashed; opacity: 0.9; }
.algo-code-badge-sm { font-size: 0.72rem; padding: 0.1rem 0.38rem; }

.algo-entry-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.algo-entry-link:hover .algo-entry-title { color: var(--accent); text-decoration: underline; }
.algo-entry-title { font-weight: 700; color: var(--text); }
.algo-entry-desc { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 0.14rem; }

.algo-var-pill {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.1rem 0.42rem;
  border-radius: 5px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  margin: 0.08rem 0.18rem 0.08rem 0;
  white-space: nowrap;
}
.algo-var-pill:hover { border-color: var(--accent); color: var(--accent); }

.algo-trace-btn {
  padding: 0.14rem 0.42rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 600;
  cursor: pointer;
}
.algo-trace-btn:hover,
.algo-trace-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.algo-trace-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  margin: 0.55rem 0;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  font-size: 0.83rem;
}

tr.cat-group-row.cat-online_calib,
tbody tr.cat-group-row.cat-online_calib:hover {
  background: var(--cat-online_calib-soft);
  color: var(--cat-online_calib-text);
  border-top: 2px solid var(--cat-online_calib-border);
}
tr.cat-group-row.cat-online_calib td:first-child {
  border-left: 4px solid var(--cat-online_calib);
}
tr.cat-group-row.cat-planned,
tbody tr.cat-group-row.cat-planned:hover {
  background: var(--cat-planned-soft);
  color: var(--cat-planned-text);
  border-top: 2px solid var(--cat-planned-border);
}
tr.cat-group-row.cat-planned td:first-child {
  border-left: 4px dashed var(--cat-planned);
}

.algo-row.cat-online_calib td:first-child {
  border-left: 4px solid transparent;
  border-image: linear-gradient(
    to bottom,
    var(--cat-calibration) 50%,
    var(--cat-loop_operation) 50%
  ) 1;
}
.algo-row.cat-planned td:first-child { border-left: 4px dashed var(--cat-planned); }
.algo-row.algo-dimmed { opacity: 0.25; }
.algo-row.algo-selected {
  background: var(--accent-soft);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.algo-row.algo-req { background: var(--cat-calibration-soft); }
.algo-row.algo-enables { background: var(--cat-loop_operation-soft); }

.algo-trace-tag {
  display: none;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.05rem 0.32rem;
  border-radius: 4px;
  margin-left: 0.28rem;
}
.algo-row.algo-selected .algo-trace-tag-sel {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
}
.algo-row.algo-req .algo-trace-tag-req {
  display: inline-block;
  background: var(--cat-calibration);
  color: #ffffff;
}
.algo-row.algo-enables .algo-trace-tag-en {
  display: inline-block;
  background: var(--cat-loop_operation);
  color: #ffffff;
}

/* 2D Dependency Matrix */
.dep-matrix-wrap {
  max-height: 76vh;
  overflow: auto;
}
.dep-matrix-table th,
.dep-matrix-table td {
  padding: 0.42rem 0.48rem;
  text-align: center;
}
.dep-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}
.dep-matrix-table th.dep-sticky-col,
.dep-matrix-table td.dep-sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  text-align: left;
  min-width: 210px;
  border-right: 2px solid var(--border);
}
.dep-matrix-table thead th.dep-sticky-col {
  z-index: 4;
  background: var(--surface-alt);
}
.dep-col-hdr {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.14rem 0.36rem;
  border-radius: 5px;
  text-decoration: none;
  white-space: nowrap;
}
.dep-cell {
  display: inline-block;
  min-width: 34px;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.12rem 0.3rem;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid transparent;
}
.dep-cell-req {
  background: var(--cat-calibration-soft);
  color: var(--cat-calibration-text);
  border-color: var(--cat-calibration-border);
}
.dep-cell-opt {
  background: var(--cat-online_calib-soft);
  color: var(--cat-online_calib-text);
  border-color: var(--cat-online_calib-border);
  border-style: dashed;
}
.dep-cell-fb {
  background: var(--cat-loop_operation-soft);
  color: var(--cat-loop_operation-text);
  border-color: var(--cat-loop_operation-border);
}
.dep-cell-excl {
  background: var(--cat-excl-soft);
  color: var(--cat-excl-text);
  border-color: var(--cat-excl-border);
}

/* Algorithm Detail Page */
.algo-hero {
  border: 1px solid var(--border);
  border-left: 6px solid var(--accent);
  border-radius: 12px;
  padding: 1.25rem 1.45rem;
  background: var(--surface-alt);
  margin-bottom: 1.25rem;
}
.algo-hero.cat-calibration { border-left-color: var(--cat-calibration); }
.algo-hero.cat-online_calib { border-left-color: var(--cat-online_calib); }
.algo-hero.cat-loop_operation { border-left-color: var(--cat-loop_operation); }
.algo-hero.cat-analysis { border-left-color: var(--cat-analysis); }
.algo-hero.cat-simulation { border-left-color: var(--cat-simulation); }
.algo-hero.cat-planned { border-left-color: var(--cat-planned); border-left-style: dashed; }

.algo-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}
.algo-dep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
  margin: 0.85rem 0 1.2rem;
}
.algo-dep-card {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.85rem 1rem;
  background: var(--surface-alt);
}
.algo-dep-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}
.algo-dep-list {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}
.algo-dep-item {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.83rem;
}
.algo-dep-item a.algo-dep-name {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}
.algo-dep-item a.algo-dep-name:hover { color: var(--accent); text-decoration: underline; }
.algo-excl-box {
  border: 1px solid var(--cat-excl-border);
  background: var(--cat-excl-soft);
  color: var(--cat-excl-text);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  margin: 0.7rem 0;
  font-size: 0.85rem;
}
.algo-sidebar-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.algo-sidebar-dot.cat-calibration { background: var(--cat-calibration); }
.algo-sidebar-dot.cat-online_calib { background: var(--cat-online_calib); }
.algo-sidebar-dot.cat-loop_operation { background: var(--cat-loop_operation); }
.algo-sidebar-dot.cat-analysis { background: var(--cat-analysis); }
.algo-sidebar-dot.cat-simulation { background: var(--cat-simulation); }
.algo-sidebar-dot.cat-planned { background: var(--cat-planned); }

/* Interactive 5-Column Pipeline Architecture Board */
.algo-pipe-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.6rem;
}

.algo-pipe-reset-default {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--default-badge-bg);
  border-color: var(--default-badge-border);
  color: var(--default-badge-text);
}

.algo-pipe-reset-default:hover {
  filter: brightness(1.08);
  color: var(--default-badge-text);
  border-color: var(--default-badge-border);
}

.algo-pipe-reset-default.is-default-match {
  background: var(--default-row-bg);
  color: var(--cat-calibration-text);
  border-color: var(--default-badge-border);
}

.algo-pipe-reset-default.is-default-match:hover {
  background: var(--default-badge-bg);
  color: var(--default-badge-text);
}

.algo-pipe-reset-stage1 {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--stage1-badge-bg);
  border-color: var(--stage1-badge-border);
  color: var(--stage1-badge-text);
}

.algo-pipe-reset-stage1:hover {
  filter: brightness(1.08);
  color: var(--stage1-badge-text);
  border-color: var(--stage1-badge-border);
}

.algo-pipe-reset-stage1.is-stage1-match {
  background: var(--stage1-row-bg);
  color: var(--cat-loop_operation-text);
  border-color: var(--stage1-badge-border);
}

.algo-pipe-reset-stage1.is-stage1-match:hover {
  background: var(--stage1-badge-bg);
  color: var(--stage1-badge-text);
}

.algo-banner-sep {
  color: var(--muted);
  opacity: 0.55;
  margin: 0 0.2rem;
}

.algo-default-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.48rem 0.78rem;
  margin-bottom: 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--default-badge-border);
  border-left: 4px solid var(--default-badge-bg);
  background: var(--default-row-bg);
  font-size: 0.82rem;
}

.hbar-fill-default {
  background: var(--default-badge-bg);
}

.hbar-fill-stage1 {
  background: var(--stage1-badge-bg);
}

.algo-pipe-status {
  padding: 0.45rem 0.78rem;
  margin-bottom: 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.83rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  height: 3.7rem;
  overflow-y: auto;
}

.algo-pipe-status strong { color: var(--text); }

.algo-outline-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.78rem;
  margin-bottom: 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.78rem;
}

.outline-key-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.16rem 0.55rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.73rem;
  background: var(--surface);
}
.outline-key-sel {
  border: 2px solid var(--good);
  color: var(--good);
  background: var(--good-soft);
}
.outline-key-avail {
  border: 2px solid var(--border);
  color: var(--text);
  background: var(--surface);
}
.outline-key-lock {
  border: 2px dashed var(--cat-excl-border);
  color: var(--cat-excl-text);
  background: repeating-linear-gradient(
    -45deg,
    var(--surface-alt),
    var(--surface-alt) 5px,
    var(--cat-excl-soft) 5px,
    var(--cat-excl-soft) 10px
  );
}
.outline-key-focus {
  border: 3px solid var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.outline-key-req {
  border: 3px solid var(--cat-calibration);
  color: var(--cat-calibration-text);
  background: var(--cat-calibration-soft);
}
.outline-key-opt {
  border: 3px dashed var(--cat-online_calib);
  color: var(--cat-online_calib-text);
  background: var(--cat-online_calib-soft);
}
.outline-key-down {
  border: 3px solid var(--cat-loop_operation);
  color: var(--cat-loop_operation-text);
  background: var(--cat-loop_operation-soft);
}
.outline-key-fb {
  border: 3px dotted var(--cat-loop_operation);
  color: var(--cat-loop_operation-text);
  background: var(--cat-loop_operation-soft);
}
.outline-key-excl {
  border: 3px dashed var(--cat-excl);
  color: var(--cat-excl-text);
  background: var(--cat-excl-soft);
}

/* Top Simulation & Stage Selection Area */
.algo-sim-strip {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: stretch;
  padding: 0.72rem 0.85rem;
  margin-bottom: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--cat-simulation-border);
  background: linear-gradient(
    180deg,
    var(--cat-simulation-soft) 0%,
    var(--surface) 100%
  );
}

.algo-sim-section {
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
  min-width: 0;
}

.algo-sim-section-hdr {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cat-simulation-text);
}

.algo-stage-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.algo-stage-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.42rem 0.72rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.algo-stage-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.algo-stage-btn.active {
  border-color: var(--good);
  background: var(--good-soft);
  color: var(--text);
}

.algo-stage-btn .algo-stage-track {
  width: 1.95rem;
  height: 1.05rem;
  flex: 0 0 1.95rem;
}

.algo-stage-btn .algo-stage-track .algo-switch-thumb {
  width: calc(1.05rem - 4px);
  height: calc(1.05rem - 4px);
}

.algo-stage-btn.active .algo-stage-track {
  background: var(--good);
}

.algo-stage-btn.active .algo-stage-track .algo-switch-thumb {
  left: calc(1.95rem - 1.05rem + 2px);
}

.algo-toolbar-select {
  padding: 0.3rem 0.52rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.algo-toolbar-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.algo-preset-select {
  min-width: 240px;
  max-width: 340px;
}

.algo-sim-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 0.8rem;
}

.algo-choice-group {
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
  min-width: 0;
}

.algo-choice-lbl {
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.algo-choice-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  padding-top: 0.22rem;
}

@media (max-width: 1120px) {
  .algo-sim-strip {
    grid-template-columns: 1fr;
  }
  .algo-sim-groups {
    grid-template-columns: 1fr;
  }
}

.algo-pipe-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) auto minmax(0, 1.15fr);
  gap: 0.7rem;
  align-items: stretch;
  margin-bottom: 0.75rem;
}

.algo-pipe-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.72rem 0.82rem 0.82rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 0;
}

.algo-group-calib {
  border-color: var(--cat-calibration-border);
  background: linear-gradient(
    180deg,
    var(--cat-calibration-soft) 0%,
    var(--surface) 44px
  );
}

.algo-group-control {
  border-color: var(--cat-loop_operation-border);
  background: linear-gradient(
    180deg,
    var(--cat-loop_operation-soft) 0%,
    var(--surface) 44px
  );
}

.algo-pipe-group-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
  padding-bottom: 0.32rem;
  border-bottom: 2px solid var(--border);
}

.algo-group-calib .algo-pipe-group-hdr {
  border-bottom-color: var(--cat-calibration-border);
  color: var(--cat-calibration-text);
}

.algo-group-control .algo-pipe-group-hdr {
  border-bottom-color: var(--cat-loop_operation-border);
  color: var(--cat-loop_operation-text);
}

.algo-pipe-group-sub {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--muted);
}

.algo-pipe-group-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.75;
  user-select: none;
  padding: 0 0.1rem;
}

.algo-calib-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  align-items: start;
}

.algo-ctrl-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
  padding-top: 0.16rem;
}

/* Pulldown (<select>) & ON/OFF Toggle Switch Pipeline Controls */
.algo-pipe-select-card {
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
  padding: 0.48rem 0.56rem 0.54rem;
  cursor: default;
}

.algo-pipe-select-compact {
  padding: 0.4rem 0.5rem 0.46rem;
}

.algo-select-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.algo-select-lbl {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.algo-select-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex: 0 0 auto;
}

.algo-badge-off {
  opacity: 0.55;
  filter: grayscale(0.75);
}

.algo-badge-locked,
a.algo-code-badge.algo-badge-locked {
  background: var(--cat-excl-soft);
  border-color: var(--cat-excl-border);
  border-style: dashed;
  color: var(--cat-excl-text);
}

.algo-lock-reason {
  margin-top: 0.24rem;
  padding: 0.18rem 0.42rem;
  border-radius: 5px;
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.algo-lock-reason.hidden {
  display: none;
}

.algo-lock-reason.algo-lock-full {
  background: var(--cat-excl-soft);
  border: 1px solid var(--cat-excl-border);
  color: var(--cat-excl-text);
}

.algo-lock-reason.algo-lock-partial {
  background: var(--surface-alt);
  border: 1px dashed var(--cat-excl-border);
  color: var(--cat-excl-text);
  font-weight: 600;
}

.algo-ctrl-select {
  width: 100%;
  min-width: 0;
  padding: 0.32rem 0.48rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.algo-ctrl-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.algo-ctrl-select:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  background: var(--surface-alt);
}

.algo-pipe-select-card.pipe-selected .algo-ctrl-select {
  border-color: var(--good);
  background: var(--surface);
}

.algo-pipe-toggle-card {
  padding: 0.42rem 0.54rem;
}

.algo-toggle-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.algo-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-width: 0;
}

.algo-toggle-top {
  display: flex;
  align-items: center;
  gap: 0.28rem;
}

.algo-switch {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  flex: 0 0 auto;
}

.algo-switch-track {
  position: relative;
  display: inline-block;
  width: 2.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.15s ease;
}

.algo-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.15rem - 4px);
  height: calc(1.15rem - 4px);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: left 0.15s ease;
}

.algo-pipe-toggle-card.pipe-selected .algo-switch-track {
  background: var(--good);
}

.algo-pipe-toggle-card.pipe-selected .algo-switch-thumb {
  left: calc(2.15rem - 1.15rem + 2px);
}

.algo-switch-lbl {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.algo-pipe-toggle-card.pipe-selected .algo-switch-lbl {
  color: var(--good);
}

.algo-pipe-toggle-card.pipe-locked .algo-switch-track {
  background: var(--cat-excl-soft);
  box-shadow: inset 0 0 0 1.5px var(--cat-excl-border);
  opacity: 0.9;
}

.algo-pipe-toggle-card.pipe-locked .algo-switch-thumb {
  background: var(--muted);
  box-shadow: none;
}

.algo-pipe-toggle-card.pipe-locked .algo-switch-lbl {
  color: var(--cat-excl-text);
}

@media (max-width: 1120px) {
  .algo-calib-split,
  .algo-ctrl-grid-2 {
    grid-template-columns: 1fr;
  }
}

.algo-pipe-sub {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.52rem 0.58rem 0.62rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  min-width: 0;
}

.algo-sub-offline {
  border-top: 3px solid var(--cat-calibration);
}

.algo-sub-online {
  border-top: 3px solid var(--cat-online_calib);
}

.algo-sub-control {
  border-top: 3px solid var(--cat-loop_operation);
}

.algo-sub-cmodes {
  border-top: 3px dashed var(--cat-planned);
}

.algo-sub-dm {
  border-top: 3px solid var(--cat-calibration);
}

.algo-pipe-sub-hdr {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.1rem;
}

.algo-sub-offline .algo-pipe-sub-hdr { color: var(--cat-calibration-text); }
.algo-sub-online .algo-pipe-sub-hdr { color: var(--cat-online_calib-text); }
.algo-sub-control .algo-pipe-sub-hdr { color: var(--cat-loop_operation-text); }
.algo-sub-cmodes .algo-pipe-sub-hdr { color: var(--cat-planned-text); }
.algo-sub-dm .algo-pipe-sub-hdr { color: var(--cat-calibration-text); }

.algo-pipe-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.68rem 0.58rem;
  padding-top: 0.22rem;
}

.algo-pipe-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.68rem 0.52rem;
  padding-top: 0.22rem;
}

.algo-pipe-grid-1 {
  display: flex;
  flex-direction: column;
  gap: 0.68rem;
  padding-top: 0.22rem;
}

/* Bottom Diagnostics & Telemetry Strip */
.algo-diag-strip {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.72rem 0.85rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--cat-analysis-border);
  background: linear-gradient(
    180deg,
    var(--cat-analysis-soft) 0%,
    var(--surface) 44px
  );
}

.algo-diag-strip .algo-pipe-group-hdr {
  border-bottom-color: var(--cat-analysis-border);
  color: var(--cat-analysis-text);
}

.algo-diag-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 0.72rem 0.62rem;
  padding-top: 0.22rem;
}

.algo-pipe-profile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.34rem;
  margin-top: 0.72rem;
  padding: 0.52rem 0.78rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.76rem;
}

.algo-pipe-guidance {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  margin-top: 0.5rem;
  padding: 0.58rem 0.82rem;
  border-radius: 8px;
  border: 1px solid var(--cat-loop_operation-border);
  background: var(--surface);
  font-size: 0.78rem;
}

.algo-guid-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.15rem;
  color: var(--text);
}

.algo-guid-row strong {
  color: var(--muted);
}

.algo-guid-notes {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.76rem;
}

.algo-guid-note::before {
  content: "\2022  ";
  color: var(--accent);
  font-weight: 800;
}

/* Architecture Taxonomy, Combination Rules & Findings Synthesis Section */
.algo-guide-panel {
  padding: 1.25rem 1.45rem;
}

.algo-guide-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.65rem;
  margin-bottom: 0.9rem;
}

.algo-guide-header h2 {
  margin: 0;
  font-size: 1.22rem;
}

.algo-guide-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.algo-guide-toc a {
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.algo-guide-toc a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.algo-guide-lead {
  margin: 0 0 1rem;
  padding: 0.78rem 0.98rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--surface-alt);
  font-size: 0.89rem;
  line-height: 1.58;
}

.algo-guide-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem 1.15rem;
  margin-bottom: 1.05rem;
}

.algo-guide-block {
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 9px;
  padding: 0.88rem 1.02rem;
  background: var(--surface);
  font-size: 0.855rem;
  line-height: 1.56;
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
}

.algo-guide-block.cat-calibration { border-top-color: var(--cat-calibration); }
.algo-guide-block.cat-online_calib { border-top-color: var(--cat-online_calib); }
.algo-guide-block.cat-loop_operation { border-top-color: var(--cat-loop_operation); }
.algo-guide-block.cat-planned { border-top-color: var(--cat-planned); border-top-style: dashed; }
.algo-guide-block.cat-analysis { border-top-color: var(--cat-analysis); }

.algo-guide-block h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.3;
}

.algo-guide-block p {
  margin: 0;
}

.algo-guide-block ul {
  margin: 0.1rem 0 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
}

.algo-guide-links {
  margin-top: auto;
  padding-top: 0.48rem;
  border-top: 1px dashed var(--border);
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
}

.algo-guide-links a {
  font-weight: 600;
}

.algo-inline-code {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78em;
  font-weight: 700;
  padding: 0.04rem 0.34rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.algo-inline-code:hover {
  border-color: var(--accent);
  background: var(--accent-soft, #e0f2fe);
  text-decoration: underline;
}

.algo-inline-code.cat-calibration {
  border-color: var(--cat-calibration-border);
  background: var(--cat-calibration-soft);
  color: var(--cat-calibration-text);
}

.algo-inline-code.cat-online_calib {
  border-color: var(--cat-online_calib-border);
  background: var(--cat-online_calib-soft);
  color: var(--cat-online_calib-text);
}

.algo-inline-code.cat-loop_operation {
  border-color: var(--cat-loop_operation-border);
  background: var(--cat-loop_operation-soft);
  color: var(--cat-loop_operation-text);
}

.algo-inline-code.cat-analysis {
  border-color: var(--cat-analysis-border);
  background: var(--cat-analysis-soft);
  color: var(--cat-analysis-text);
}

.algo-inline-code.cat-simulation {
  border-color: var(--cat-simulation-border);
  background: var(--cat-simulation-soft);
  color: var(--cat-simulation-text);
}

.algo-inline-code.cat-planned {
  border-color: var(--cat-planned-border);
  border-style: dashed;
  background: var(--cat-planned-soft);
  color: var(--cat-planned-text);
}

.algo-decision-wrap {
  margin-top: 0.45rem;
}

.algo-decision-wrap h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.98rem;
}

.algo-guide-block-wide {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .algo-guide-sections {
    grid-template-columns: 1fr;
  }
}

.algo-synth-panel h3 {
  margin: 1.05rem 0 0.5rem;
  font-size: 0.98rem;
}

.algo-synth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.78rem;
  margin: 0.75rem 0 0.9rem;
}

.algo-synth-card {
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 9px;
  padding: 0.78rem 0.9rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.81rem;
}

.algo-synth-card.cat-loop_operation { border-top-color: var(--cat-loop_operation); }
.algo-synth-card.cat-planned { border-top-color: var(--cat-planned); border-top-style: dashed; }
.algo-synth-card.cat-calibration { border-top-color: var(--cat-calibration); }

.algo-synth-kicker {
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.algo-synth-card h3 {
  margin: 0;
  font-size: 0.94rem;
}

.algo-synth-card ol,
.algo-synth-card ul {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.algo-synth-note {
  margin: auto 0 0;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border);
  font-size: 0.76rem;
  color: var(--muted);
}

.algo-synth-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
  padding: 0.62rem 0.8rem;
  margin: 0.7rem 0 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 700;
}

.algo-flow-step {
  padding: 0.2rem 0.52rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.algo-flow-step.cat-simulation {
  border-color: var(--cat-simulation-border);
  background: var(--cat-simulation-soft);
  color: var(--cat-simulation-text);
}

.algo-flow-step.cat-loop_operation {
  border-color: var(--cat-loop_operation-border);
  background: var(--cat-loop_operation-soft);
  color: var(--cat-loop_operation-text);
}

.algo-flow-step.cat-planned {
  border-color: var(--cat-planned-border);
  border-style: dashed;
  background: var(--cat-planned-soft);
  color: var(--cat-planned-text);
}

.algo-flow-arr {
  color: var(--accent);
  font-weight: 900;
}

.algo-synth-bench-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0.55rem 0 0.85rem;
}

.algo-synth-table {
  font-size: 0.79rem;
}

.algo-synth-cta {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

@media (max-width: 1120px) {
  .algo-synth-grid,
  .algo-synth-bench-grid {
    grid-template-columns: 1fr;
  }
}

.algo-prof-lbl {
  font-weight: 800;
  color: var(--muted);
  margin-right: 0.2rem;
}

.algo-prof-tag {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.71rem;
  font-weight: 700;
  padding: 0.08rem 0.4rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
}

.algo-prof-stage {
  border-color: var(--good);
  background: var(--good-soft);
  color: var(--text);
}
.algo-prof-tag.cat-simulation {
  border-color: var(--cat-simulation-border);
  background: var(--cat-simulation-soft);
  color: var(--cat-simulation-text);
}
.algo-prof-tag.cat-calibration {
  border-color: var(--cat-calibration-border);
  background: var(--cat-calibration-soft);
  color: var(--cat-calibration-text);
}
.algo-prof-tag.cat-online_calib {
  border-color: var(--cat-online_calib-border);
  background: var(--cat-online_calib-soft);
  color: var(--cat-online_calib-text);
}
.algo-prof-tag.cat-loop_operation {
  border-color: var(--cat-loop_operation-border);
  background: var(--cat-loop_operation-soft);
  color: var(--cat-loop_operation-text);
}
.algo-prof-tag.cat-analysis {
  border-color: var(--cat-analysis-border);
  background: var(--cat-analysis-soft);
  color: var(--cat-analysis-text);
}
.algo-prof-tag.cat-planned {
  border-color: var(--cat-planned-border);
  background: var(--cat-planned-soft);
  color: var(--cat-planned-text);
}

.algo-pipe-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.44rem 0.56rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  border-left: 5px solid var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  user-select: none;
  transition:
    opacity 0.14s ease,
    filter 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease;
}

.algo-pipe-card.cat-calibration {
  border-left-color: var(--cat-calibration);
  background: linear-gradient(90deg, var(--cat-calibration-soft) 0%, var(--surface) 22%);
}
.algo-pipe-card.cat-online_calib {
  border-left-color: var(--cat-online_calib);
  background: linear-gradient(90deg, var(--cat-online_calib-soft) 0%, var(--surface) 22%);
}
.algo-pipe-card.cat-loop_operation {
  border-left-color: var(--cat-loop_operation);
  background: linear-gradient(90deg, var(--cat-loop_operation-soft) 0%, var(--surface) 22%);
}
.algo-pipe-card.cat-analysis {
  border-left-color: var(--cat-analysis);
  background: linear-gradient(90deg, var(--cat-analysis-soft) 0%, var(--surface) 22%);
}
.algo-pipe-card.cat-simulation {
  border-left-color: var(--cat-simulation);
  background: linear-gradient(90deg, var(--cat-simulation-soft) 0%, var(--surface) 22%);
}
.algo-pipe-card.cat-planned {
  border-left-color: var(--cat-planned);
  border-left-style: dashed;
  background: linear-gradient(90deg, var(--cat-planned-soft) 0%, var(--surface) 22%);
}

.algo-pipe-card:hover {
  box-shadow: var(--shadow-lg);
}

.algo-pipe-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.algo-pipe-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.algo-pipe-card-link:hover .algo-pipe-card-name {
  color: var(--accent);
  text-decoration: underline;
}

.algo-pipe-card-name {
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.algo-pipe-card-meta {
  font-size: 0.71rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  margin-top: 0.1rem;
}

.algo-pipe-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.algo-pipe-state-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.12rem;
  height: 1.12rem;
  flex: 0 0 1.12rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
}

.algo-pipe-radio-dot {
  border-radius: 50%;
}

.algo-pipe-card.pipe-selected .algo-pipe-state-dot {
  border-color: var(--good);
  background: var(--good);
  color: #ffffff;
}
.algo-pipe-card.pipe-selected .algo-pipe-state-dot::after {
  content: "\2713";
}
.algo-pipe-card.pipe-selected .algo-pipe-radio-dot::after {
  content: "\25CF";
  font-size: 0.56rem;
}
.algo-pipe-card.pipe-locked .algo-pipe-state-dot {
  border-color: var(--border);
  background: var(--surface-alt);
  color: var(--muted);
}
.algo-pipe-card.pipe-locked .algo-pipe-state-dot::after {
  content: "\2013";
}

.algo-pipe-docs-link {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  line-height: 1;
  padding: 0.08rem 0.16rem;
  border-radius: 4px;
}
.algo-pipe-docs-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* Dynamic Selection States (Zero-Reflow: Fixed Border Width + Outlines) */
.algo-pipe-card.pipe-selected {
  border-color: var(--good);
  box-shadow: inset 0 0 0 1px var(--good), var(--shadow);
}
.algo-pipe-card.pipe-available {
  opacity: 1;
  filter: none;
  cursor: pointer;
}
.algo-pipe-card.pipe-locked {
  opacity: 0.9;
  border-style: dashed;
  border-color: var(--cat-excl-border);
  border-left-style: dashed;
  border-left-color: var(--cat-excl);
  background: repeating-linear-gradient(
    -45deg,
    var(--surface-alt),
    var(--surface-alt) 7px,
    var(--cat-excl-soft) 7px,
    var(--cat-excl-soft) 14px
  );
  cursor: not-allowed;
  box-shadow: none;
}
.algo-pipe-card.pipe-locked .algo-pipe-card-name,
.algo-pipe-card.pipe-locked .algo-select-lbl {
  color: var(--muted);
}
.algo-pipe-card.pipe-locked .algo-ctrl-select:disabled {
  opacity: 0.88;
  border-style: dashed;
  border-color: var(--cat-excl-border);
  color: var(--muted);
}

/* High-Visibility Hover Preview Outlines (Zero-Reflow) */
.algo-pipe-card.pipe-dim {
  opacity: 0.24;
  filter: grayscale(0.55);
}
.algo-pipe-card.pipe-locked.pipe-dim {
  opacity: 0.16;
  filter: grayscale(1);
}
.algo-pipe-card.pipe-focus {
  border-color: transparent;
  outline: 3px solid var(--accent);
  outline-offset: -2px;
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22), var(--shadow-lg);
  opacity: 1;
  filter: none;
}
.algo-pipe-card.pipe-up {
  border-color: transparent;
  outline: 3px solid var(--cat-calibration);
  outline-offset: -2px;
  background: var(--cat-calibration-soft);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.24), var(--shadow-lg);
  opacity: 1;
  filter: none;
}
.algo-pipe-card.pipe-opt {
  border-color: transparent;
  outline: 3px dashed var(--cat-online_calib);
  outline-offset: -2px;
  background: var(--cat-online_calib-soft);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.22), var(--shadow);
  opacity: 1;
  filter: none;
}
.algo-pipe-card.pipe-down {
  border-color: transparent;
  outline: 3px solid var(--cat-loop_operation);
  outline-offset: -2px;
  background: var(--cat-loop_operation-soft);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.24), var(--shadow-lg);
  opacity: 1;
  filter: none;
}
.algo-pipe-card.pipe-fb {
  border-color: transparent;
  outline: 3px dotted var(--cat-loop_operation);
  outline-offset: -2px;
  background: var(--cat-loop_operation-soft);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.22), var(--shadow);
  opacity: 1;
  filter: none;
}
.algo-pipe-card.pipe-excl {
  border-color: transparent;
  outline: 3px dashed var(--cat-excl);
  outline-offset: -2px;
  background: var(--cat-excl-soft);
  box-shadow: 0 0 0 2px rgba(190, 18, 60, 0.24), var(--shadow);
  opacity: 1;
  filter: none;
}
.algo-pipe-card.pipe-locked.pipe-focus,
.algo-pipe-card.pipe-locked.pipe-up,
.algo-pipe-card.pipe-locked.pipe-opt,
.algo-pipe-card.pipe-locked.pipe-down,
.algo-pipe-card.pipe-locked.pipe-fb,
.algo-pipe-card.pipe-locked.pipe-excl {
  opacity: 1;
  filter: none;
}

.pipe-rel-ribbon {
  display: none;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.42rem;
  border-radius: 5px;
  color: #ffffff;
  text-transform: uppercase;
  width: fit-content;
  margin-bottom: 0.14rem;
}
.algo-pipe-workspace .algo-pipe-card .pipe-rel-ribbon {
  position: absolute;
  top: -0.56rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.06rem 0.42rem;
  font-size: 0.62rem;
  line-height: 1.15;
  white-space: nowrap;
  pointer-events: none;
  z-index: 4;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}
.algo-pipe-card.pipe-focus .pipe-rel-focus { display: inline-block; background: var(--accent); }
.algo-pipe-card.pipe-up .pipe-rel-up { display: inline-block; background: var(--cat-calibration); }
.algo-pipe-card.pipe-opt .pipe-rel-opt { display: inline-block; background: var(--cat-online_calib); }
.algo-pipe-card.pipe-down .pipe-rel-down {
  display: inline-block;
  background: var(--cat-loop_operation);
}
.algo-pipe-card.pipe-fb .pipe-rel-fb {
  display: inline-block;
  background: var(--cat-loop_operation-solid);
}
.algo-pipe-card.pipe-excl .pipe-rel-excl {
  display: inline-block;
  background: var(--cat-excl);
}

/* 3-Column Flow Strip on Per-Algorithm Detail Pages */
.algo-flow-strip {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(230px, 1.05fr) auto minmax(210px, 1fr);
  gap: 0.9rem;
  align-items: center;
  padding: 0.95rem 0.9rem;
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow-x: auto;
}

.algo-flow-col {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.algo-flow-col-hdr {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.algo-flow-chevron {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
  user-select: none;
  padding: 0 0.15rem;
}

.algo-flow-center {
  padding: 0.85rem 0.95rem;
}

@media (max-width: 1120px) {
  .algo-pipe-board {
    grid-template-columns: 1fr;
  }
  .algo-pipe-group-arrow {
    transform: rotate(90deg);
    padding: 0.1rem 0;
  }
  .algo-diag-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .algo-calib-split,
  .algo-pipe-grid-2,
  .algo-pipe-grid-3,
  .algo-choice-row-2,
  .algo-diag-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .algo-flow-strip {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .algo-flow-chevron {
    transform: rotate(90deg);
  }
}

/* Default Turbulence & Perturbation Model cards, diff lists & calculator */
.turb-model-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--cat-simulation);
  border-radius: 10px;
  padding: 0.9rem 1.05rem;
  margin: 0.85rem 0 1.2rem;
  background: var(--surface-alt);
}

.turb-model-card.turb-card-default {
  border-left-color: #059669;
}

.turb-model-card.turb-card-modified {
  border-left-color: #d97706;
}

.turb-model-card.turb-card-legacy {
  border-left-color: #64748b;
}

.turb-model-card.turb-card-compact {
  padding: 0.65rem 0.9rem;
  margin: 0.6rem 0 1rem;
}

.turb-model-card p {
  margin: 0.45rem 0;
  font-size: 0.88rem;
}

.turb-card-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.turb-card-title,
.turb-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.turb-status-pill {
  display: inline-block;
  padding: 0.14rem 0.56rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.turb-pill-def {
  background: rgba(5, 150, 105, 0.15);
  border: 1px solid rgba(5, 150, 105, 0.48);
  color: #047857;
}

.turb-pill-mod {
  background: rgba(217, 119, 6, 0.16);
  border: 1px solid rgba(217, 119, 6, 0.52);
  color: #b45309;
}

.turb-pill-legacy {
  background: rgba(100, 116, 139, 0.16);
  border: 1px solid rgba(100, 116, 139, 0.45);
  color: var(--muted);
}

[data-theme="dark"] .turb-pill-def { color: #34d399; }
[data-theme="dark"] .turb-pill-mod { color: #fbbf24; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .turb-pill-def { color: #34d399; }
  :root:not([data-theme="light"]) .turb-pill-mod { color: #fbbf24; }
}

.turb-diff-list {
  margin: 0.45rem 0 0.35rem 1.15rem;
  padding: 0;
  font-size: 0.86rem;
}

.turb-diff-list li {
  margin: 0.24rem 0;
}

.turb-kept-strip,
.turb-realized-strip {
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
  font-size: 0.81rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.32rem;
}

.turb-sub-lbl {
  font-weight: 700;
  color: var(--text);
  margin-right: 0.15rem;
}

tr.turb-row-changed {
  background: rgba(217, 119, 6, 0.06);
}

.turb-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 0.75rem;
  margin: 0.65rem 0 0.85rem;
}

.turb-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.18rem 0.5rem;
}

.turb-calc-outputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.55rem;
  margin: 0.75rem 0;
}

.turb-stat-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
}

.turb-stat-box span {
  font-size: 0.74rem;
  color: var(--muted);
}

.turb-stat-box strong {
  font-size: 0.9rem;
  color: var(--text);
}

.turb-cmd-row {
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.turb-cmd-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.turb-cmd-row pre {
  margin: 0;
}

/* ── Predictive Control Practical Guide (/predictive-control/) ─────────────── */
.pcg-eq-box {
  margin: 0.75rem 0 1.05rem;
  padding: 0.72rem 1rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-alt);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  overflow-x: auto;
}

.pcg-eq-box .pcg-eq-lbl {
  display: block;
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.pcg-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
  margin: 0.85rem 0 1.25rem;
}

.pcg-card {
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: var(--surface-alt);
}

.pcg-card.pcg-card-warn {
  border-top-color: #d97706;
}

.pcg-card.pcg-card-good {
  border-top-color: #059669;
}

.pcg-card.pcg-card-danger {
  border-top-color: #dc2626;
}

.pcg-card h3,
.pcg-card h4 {
  margin: 0 0 0.4rem;
  font-size: 0.96rem;
}

.pcg-card p {
  margin: 0.35rem 0;
  font-size: 0.86rem;
  line-height: 1.5;
}

.pcg-card ul {
  margin: 0.35rem 0 0.1rem;
  padding-left: 1.15rem;
  font-size: 0.85rem;
}

.pcg-card li {
  margin: 0.22rem 0;
}

.pcg-callout-warn {
  margin: 1rem 0;
  padding: 0.78rem 1rem;
  border-left: 4px solid #d97706;
  background: rgba(217, 119, 6, 0.10);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
}

.pcg-callout-warn p {
  margin: 0.25rem 0;
}

.pcg-callout-good {
  margin: 1rem 0;
  padding: 0.78rem 1rem;
  border-left: 4px solid #059669;
  background: rgba(5, 150, 105, 0.10);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
}

.pcg-callout-good p {
  margin: 0.25rem 0;
}

.pcg-step-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.85rem 0 1.35rem;
}

.pcg-step {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 9px;
  padding: 0.8rem 1rem;
  background: var(--surface-alt);
}

.pcg-step-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.pcg-step p {
  margin: 0.3rem 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.pcg-step pre {
  margin: 0.45rem 0 0.15rem;
}

.pcg-tag-ok {
  display: inline-block;
  padding: 0.1rem 0.46rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  background: rgba(5, 150, 105, 0.15);
  border: 1px solid rgba(5, 150, 105, 0.48);
  color: #047857;
}

.pcg-tag-warn {
  display: inline-block;
  padding: 0.1rem 0.46rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  background: rgba(217, 119, 6, 0.16);
  border: 1px solid rgba(217, 119, 6, 0.52);
  color: #b45309;
}

.pcg-tag-bad {
  display: inline-block;
  padding: 0.1rem 0.46rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  background: rgba(220, 38, 38, 0.14);
  border: 1px solid rgba(220, 38, 38, 0.46);
  color: #b91c1c;
}

[data-theme="dark"] .pcg-tag-ok { color: #34d399; }
[data-theme="dark"] .pcg-tag-warn { color: #fbbf24; }
[data-theme="dark"] .pcg-tag-bad { color: #f87171; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pcg-tag-ok { color: #34d399; }
  :root:not([data-theme="light"]) .pcg-tag-warn { color: #fbbf24; }
  :root:not([data-theme="light"]) .pcg-tag-bad { color: #f87171; }
}

/* --- Phase 2: Linked Multi-Track Strip Charts & Comparison Studio --- */
.opt-zoom-hint {
  font-size: 0.76rem;
}

.strip-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.strip-hud {
  padding: 0.45rem 0.72rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.strip-track {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.4rem;
}

canvas.strip-canvas {
  display: block;
  width: 100%;
  height: 175px;
  cursor: crosshair;
}

.cmp-delta-pos {
  color: var(--good);
  font-weight: 700;
  font-family: var(--font-mono);
}

.cmp-delta-neg {
  color: #dc2626;
  font-weight: 700;
  font-family: var(--font-mono);
}

[data-theme="dark"] .cmp-delta-neg { color: #f87171; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cmp-delta-neg { color: #f87171; }
}

.cmp-delta-neutral {
  color: var(--muted);
  font-weight: 600;
  font-family: var(--font-mono);
}

.cmp-delta-base {
  display: inline-block;
  padding: 0.08rem 0.42rem;
  border-radius: 5px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.cmp-delta-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.cmp-curtain-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
  font-size: 0.8rem;
}

.cmp-curtain-controls input[type="range"] {
  flex: 1;
  min-width: 160px;
  max-width: 340px;
}

.cmp-curtain-stage {
  position: relative;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  user-select: none;
  cursor: ew-resize;
}

.cmp-curtain-img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.cmp-curtain-a {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  clip-path: inset(0 calc(100% - var(--wipe, 50%)) 0 0);
}

.cmp-curtain-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--wipe, 50%);
  width: 2px;
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 5;
}

.cmp-curtain-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #f59e0b;
  color: #0f172a;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.cmp-curtain-pill {
  position: absolute;
  top: 0.55rem;
  padding: 0.16rem 0.56rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.86);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.4);
  z-index: 4;
  pointer-events: none;
}

.cmp-pill-a { left: 0.6rem; border-color: #f59e0b; color: #fde68a; }
.cmp-pill-b { right: 0.6rem; border-color: #38bdf8; color: #bae6fd; }

.cmp-side-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (max-width: 860px) {
  .cmp-side-grid { grid-template-columns: 1fr; }
}

.cmp-diff-table td.cmp-diff-changed {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.cmp-diff-table tr.cmp-diff-metric-row td {
  background: var(--surface-alt);
}

/* --- Phase 3: Video Studio, Interactive Bench SVG & Turbulence Sandbox --- */
.vs-panel:focus {
  outline: none;
  border-color: var(--accent);
}

.vs-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  padding: 0.48rem 0.78rem;
  margin-bottom: 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.vs-hud-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.34rem;
}

.vs-hud-item span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.vs-hud-item strong {
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.vs-video-wrap {
  background: #080e1a;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  text-align: center;
}

.vs-video-wrap video {
  display: block;
  width: 100%;
  max-height: 70vh;
  margin: 0 auto;
  background: #080e1a;
}

.vs-jump-bar {
  margin: 0.6rem 0 0.5rem;
}

.vs-scrubber-wrap {
  cursor: ew-resize;
}

canvas.vs-scrubber-canvas {
  display: block;
  width: 100%;
  height: 152px;
  user-select: none;
}

.bench-svg-stage {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.5rem;
}

.bench-svg {
  display: block;
  min-width: 720px;
  height: auto;
  color: var(--text);
}

.bench-svg-node {
  cursor: pointer;
  transition: opacity 0.14s ease;
}

.bench-node-rect {
  fill: var(--surface-alt);
  transition: fill 0.14s ease, stroke-width 0.14s ease;
}

.bench-svg-node:hover .bench-node-rect,
.bench-svg-node.is-selected .bench-node-rect {
  fill: var(--accent-soft);
}

.bench-node-cat {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.bench-node-name {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  fill: var(--text);
}

.bench-node-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--muted);
}

.bench-inspector {
  margin-top: 0.65rem;
  padding: 0.68rem 0.85rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.83rem;
}

.bench-insp-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.turb-sandbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 0.9rem;
  margin: 0.9rem 0;
}

.turb-sandbox-card {
  padding: 0.65rem 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.turb-sandbox-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.83rem;
}

canvas.turb-sandbox-canvas {
  display: block;
  width: 100%;
  height: 250px;
  border-radius: 6px;
}

.turb-sandbox-foot {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
 * Unified Dynamic Interactive Figure Cards (.dyn-fig-card)
 * ========================================================================== */

figure.dyn-fig-card {
  margin: 1.25rem 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  text-align: left;
}

.figure-grid > figure.dyn-fig-card {
  grid-column: 1 / -1;
}

.dyn-fig-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.58rem 0.85rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.dyn-fig-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 260px;
}

.dyn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.48rem;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-glow);
  white-space: nowrap;
  flex-shrink: 0;
}

.dyn-fig-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.dyn-fig-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

a.dyn-dl-static {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.dyn-fig-live {
  padding: 0.65rem 0.8rem 0.7rem;
  background: var(--surface);
}

.dyn-fig-static {
  padding: 0.7rem;
  background: var(--surface);
  text-align: center;
}

.dyn-fig-static img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.dyn-fig-cap {
  padding: 0.45rem 0.85rem 0.55rem;
  font-size: 0.81rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}

.dyn-view-bar,
.dyn-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.55rem;
}

.dyn-view-bar {
  padding-bottom: 0.48rem;
  border-bottom: 1px dashed var(--border);
}

.dyn-ctrl-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.32rem;
}

.dyn-ctrl-lbl {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 0.15rem;
}

.dyn-sel-sm {
  font-size: 0.76rem;
  padding: 0.22rem 0.45rem;
}

.dyn-subtitle {
  font-size: 0.78rem;
  margin-bottom: 0.45rem;
}

.dyn-panel-grid {
  display: grid;
  gap: 0.65rem;
}

.dyn-panel-grid.dyn-cols-1 {
  grid-template-columns: 1fr;
}

.dyn-panel-grid.dyn-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 820px) {
  .dyn-panel-grid.dyn-cols-2 {
    grid-template-columns: 1fr;
  }
}

.dyn-panel-box {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dyn-panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.34rem 0.62rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.dyn-panel-title {
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--text);
}

.dyn-panel-focus-btn {
  padding: 0.12rem 0.42rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 600;
  cursor: pointer;
}

.dyn-panel-focus-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.dyn-canvas-wrap {
  position: relative;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  background: transparent;
}

canvas.dyn-canvas {
  display: block;
  width: 100%;
  height: 310px;
}

canvas.dyn-canvas.dyn-canvas-sub {
  height: 255px;
}

canvas.dyn-canvas.cursor-cross { cursor: crosshair; }
canvas.dyn-canvas.cursor-grab { cursor: grab; }
canvas.dyn-canvas.cursor-grab:active { cursor: grabbing; }
canvas.dyn-canvas.cursor-caliper { cursor: cell; }

.dyn-tooltip {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  max-width: 310px;
}

.dyn-tip-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.dyn-tip-delta {
  color: var(--warn);
  font-weight: 600;
}

.dyn-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.32rem 0.45rem;
  margin-top: 0.55rem;
}

.dyn-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.14s ease, border-color 0.14s ease;
}

.dyn-leg-item:hover {
  border-color: var(--accent);
}

.dyn-leg-item.is-hidden {
  opacity: 0.42;
  text-decoration: line-through;
}

.dyn-leg-item.is-solo {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dyn-leg-swatch {
  display: inline-block;
  width: 11px;
  height: 4px;
  border-radius: 2px;
}

.dyn-leg-swatch.is-dashed {
  height: 2px;
  border-top: 2px dashed currentColor;
}

.dyn-leg-hint {
  font-size: 0.71rem;
  margin-left: auto;
}

.dyn-stats-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin-top: 0.5rem;
  padding-top: 0.48rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.dyn-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.46rem;
  border-radius: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
}

.dyn-stat-caliper {
  border-color: var(--good);
  background: var(--good-soft);
}

.dyn-stat-hint {
  margin-left: auto;
  font-family: var(--font-sans);
  font-size: 0.72rem;
}

/* Heatmap 1D cross-section slices */
.dyn-hm-slice-wrap {
  border-top: 1px solid var(--border);
  padding: 0.35rem 0.55rem 0.45rem;
  background: var(--surface-alt);
}

.dyn-hm-slice-hdr {
  font-size: 0.72rem;
  margin-bottom: 0.25rem;
}

canvas.dyn-hm-slice-canvas {
  display: block;
  width: 100%;
  height: 120px;
}

/* CSV Pivot Explorer Controls */
.dyn-pivot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.85rem;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.dyn-pivot-field {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.dyn-pivot-ychips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
}

/* Fullscreen Interactive Modal */
body.dyn-fs-open {
  overflow: hidden;
}

.dyn-fs-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(8, 14, 26, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.dyn-fs-modal.hidden {
  display: none;
}

.dyn-fs-shell {
  width: min(1440px, 96vw);
  max-height: 94vh;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dyn-fs-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.68rem 1rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.dyn-fs-title {
  font-size: 0.96rem;
  color: var(--text);
}

.dyn-fs-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.dyn-fs-hint {
  font-size: 0.76rem;
}

.dyn-fs-body {
  padding: 0.85rem 1rem 1rem;
  overflow-y: auto;
}

.dyn-fs-body canvas.dyn-canvas {
  height: 58vh;
  min-height: 360px;
}

.dyn-fs-body canvas.dyn-canvas.dyn-canvas-sub {
  height: 38vh;
  min-height: 260px;
}

/* 3D Dynamic Chart Controls & Tensor Slice Bar */
.dyn-badge-3d {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #ffffff;
  border-color: transparent;
}

canvas.dyn-canvas.dyn-canvas-3d {
  height: 410px;
  cursor: grab;
}

canvas.dyn-canvas.dyn-canvas-3d:active {
  cursor: grabbing;
}

.dyn-fs-body canvas.dyn-canvas.dyn-canvas-3d {
  height: 64vh;
  min-height: 420px;
}

.dyn-3d-ctrl-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  padding: 0.38rem 0.6rem;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.76rem;
}

.dyn-3d-slider {
  width: 150px;
  accent-color: var(--accent);
}

.dyn-3d-readout {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  min-width: 96px;
}

.dyn-pivot-note {
  font-size: 0.73rem;
  color: var(--muted);
  margin: 0.25rem 0 0.45rem;
}

/* Streamlined simulation subpage cross-links & collapsible snapshot drawers */
.sim-crosslink-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.55rem;
  margin: 0.75rem 0 1.15rem;
}

.sim-crosslink-chip {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sim-crosslink-chip:hover {
  border-color: var(--accent);
  background: var(--surface-alt);
}

.sim-crosslink-chip strong {
  font-size: 0.84rem;
  color: var(--accent);
}

.sim-crosslink-chip span {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}

.vs-meta-strip {
  font-size: 0.78rem;
  padding: 0.25rem 0.1rem 0.45rem;
  line-height: 1.4;
}

.report-details {
  margin: 0.6rem 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.report-details > summary {
  cursor: pointer;
  padding: 0.7rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-alt);
  user-select: none;
}

.report-details > summary:hover {
  color: var(--accent);
}

.report-details-body {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
}
