/* Bore Sight — deep space glass shell */
:root {
  --bg-deep: #05060a;
  --bg-panel: #0a0b12;
  --glass: rgba(16, 18, 28, 0.72);
  --glass-strong: rgba(20, 22, 36, 0.88);
  --glass-border: rgba(153, 69, 255, 0.22);
  --glass-border-hot: rgba(0, 240, 255, 0.35);
  --purple: #9945FF;
  --magenta: #FF00A8;
  --cyan: #00F0FF;
  --mint: #14F195;
  --text: #e8eaf0;
  --text-dim: #8b90a5;
  --text-faint: #5c6178;
  --danger: #ff4d6d;
  --absent: #ffb020;
  --gate-closed: #ff4d6d;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-glow: 0 0 40px rgba(153, 69, 255, 0.12);
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --topbar-h: 64px;
  --footer-h: 44px;
}

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


/* Dark-theme scrollbars (thin purple thumb on deep track) */
html, body, .sim-shell, .pane, .pane-body, .results-inner, .table-wrap, .viz-host, .code-block, .block-rail-scroll {
  scrollbar-width: thin;
  scrollbar-color: #5a3a7a var(--bg-panel);
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--bg-panel); }
*::-webkit-scrollbar-thumb {
  background: #5a3a7a;
  border-radius: 8px;
  border: 2px solid var(--bg-panel);
}
*::-webkit-scrollbar-thumb:hover { background: var(--purple); }


html, body {
  margin: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden; /* desktop: no document scroll — panes scroll internally */
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { position: relative; overflow: hidden; }

.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(153, 69, 255, 0.28), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(255, 0, 168, 0.16), transparent 50%),
    radial-gradient(ellipse 50% 35% at 70% 100%, rgba(20, 241, 149, 0.08), transparent 45%),
    radial-gradient(ellipse 40% 30% at 20% 80%, rgba(0, 240, 255, 0.06), transparent 40%),
    var(--bg-deep);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem 1.25rem;
  min-height: var(--topbar-h);
  padding: 0.65rem 1.25rem;
  background: rgba(5, 6, 10, 0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid rgba(153, 69, 255, 0.18);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.logo-mark {
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.45));
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #fff, #c9b3ff 40%, #14F195);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
}

.topnav a {
  position: relative;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.topnav a:hover {
  color: var(--text);
  background: rgba(153, 69, 255, 0.12);
}

.topnav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(153, 69, 255, 0.35), rgba(255, 0, 168, 0.2));
  box-shadow: 0 0 0 1px rgba(153, 69, 255, 0.45), 0 0 20px rgba(153, 69, 255, 0.25);
}

.topnav a.active::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
}

.gate-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.chip-closed {
  color: #ffd0d8;
  background: rgba(255, 77, 109, 0.18);
  border-color: rgba(255, 77, 109, 0.55);
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.2);
}

.chip-ineligible {
  color: #ffe0a8;
  background: rgba(255, 176, 32, 0.14);
  border-color: rgba(255, 176, 32, 0.5);
}

.chip-claim {
  color: #d4c2ff;
  background: rgba(153, 69, 255, 0.18);
  border-color: rgba(153, 69, 255, 0.5);
}

/* ── Main ── */
.main {
  flex: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.page.hidden, .hidden { display: none !important; }

.page-head { margin-bottom: 1.25rem; }
.page-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.lede {
  margin: 0;
  color: var(--text-dim);
  max-width: 52rem;
}
.lede code, .note code, .dim {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--cyan);
}

/* ── Glass cards ── */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  margin-bottom: 1rem;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.card-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.28);
  color: var(--cyan);
}

/* ── Grids ── */
.grid { display: grid; gap: 1rem; }
.grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }

.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--magenta), var(--mint));
  opacity: 0.85;
}
.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-all;
}
.stat-value.mint { color: var(--mint); }
.stat-value.absent-tone { color: var(--absent); }
.stat-value.danger { color: var(--danger); }
.stat-value.cyan { color: var(--cyan); }

/* ── Forms ── */
.form-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  min-width: 160px;
}
.form-grid label span { font-weight: 500; }
.form-grid select,
.form-grid input[type="number"],
.form-grid input[type="search"],
.toolbar input[type="search"] {
  appearance: none;
  background: rgba(5, 6, 10, 0.65);
  border: 1px solid rgba(153, 69, 255, 0.3);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-grid select:focus,
.form-grid input:focus,
.toolbar input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}
.check-label {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
  min-width: auto !important;
  cursor: pointer;
  padding-bottom: 0.55rem;
}
.check-label input { accent-color: var(--purple); }

.btn-primary {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.88rem;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--magenta));
  box-shadow:
    0 0 24px rgba(153, 69, 255, 0.45),
    0 0 48px rgba(255, 0, 168, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s;
}
.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow:
    0 0 32px rgba(153, 69, 255, 0.55),
    0 0 56px rgba(0, 240, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
  filter: none;
}

.btn-ghost {
  appearance: none;
  cursor: pointer;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text);
  background: rgba(153, 69, 255, 0.12);
  border: 1px solid rgba(153, 69, 255, 0.35);
}
.btn-ghost:hover { background: rgba(153, 69, 255, 0.22); }

.text-link {
  color: var(--cyan);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
}
.text-link:hover { text-decoration: underline; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
.table-wrap.muted-empty { color: var(--text-dim); font-size: 0.9rem; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
table.data th {
  text-align: left;
  padding: 0.5rem 0.65rem;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(153, 69, 255, 0.2);
}
table.data td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  vertical-align: middle;
}
table.data tr:hover td { background: rgba(153, 69, 255, 0.06); }

.mono { font-family: var(--font-mono); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── ABSENT badge ── */
.badge-absent {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1a1200;
  background: linear-gradient(135deg, #ffb020, #ffd060);
  box-shadow: 0 0 12px rgba(255, 176, 32, 0.35);
  vertical-align: middle;
}
.badge-absent::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a1200;
}

.tip-zero {
  color: var(--mint);
  font-family: var(--font-mono);
  font-weight: 600;
}

.pnl-neg { color: var(--danger); }
.pnl-pos { color: var(--mint); }

/* ── Viz ── */
.viz-host {
  min-height: 0;
  width: 100%;
}
.viz-host svg, .viz-host canvas {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 100%;
}
.viz-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  border: 1px dashed rgba(139, 144, 165, 0.35);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

.sealed-row, .kv-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.5rem;
}
.kv-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.kv-row .k { color: var(--text-dim); }
.kv-row .v {
  font-family: var(--font-mono);
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
  overflow-x: auto;
  min-width: 0;
  max-width: 100%;
  scrollbar-width: none; /* hide tiny bar until hover */
}
.kv-row .v:hover,
.kv-row .v:focus {
  scrollbar-width: thin;
}
.kv-row .v::-webkit-scrollbar { height: 0; }
.kv-row .v:hover::-webkit-scrollbar,
.kv-row .v:focus::-webkit-scrollbar { height: 6px; }

.sealed-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(20, 241, 149, 0.1);
  border: 1px solid rgba(20, 241, 149, 0.35);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--mint);
  width: fit-content;
}
.sealed-chip.missing {
  color: var(--absent);
  background: rgba(255, 176, 32, 0.1);
  border-color: rgba(255, 176, 32, 0.4);
}

/* ── Quick links ── */
.quick-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.ql {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.ql:hover {
  border-color: var(--glass-border-hot);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.12);
  transform: translateY(-2px);
}
.ql span { font-weight: 600; font-size: 0.9rem; }
.ql em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ── Toolbar / notes / code ── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.toolbar .inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.78rem;
}
.note {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.45;
}
.code-block {
  margin: 0;
  padding: 0.85rem;
  background: rgba(5, 6, 10, 0.7);
  border: 1px solid rgba(153, 69, 255, 0.18);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  overflow: auto;
  max-height: 320px;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Error banner ── */
.error-banner {
  margin: 0.75rem 1.25rem 0;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid rgba(255, 77, 109, 0.45);
  color: #ffc0cb;
  font-size: 0.85rem;
}
.error-banner.hidden { display: none !important; }

/* ── Footer ── */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--footer-h);
  padding: 0.65rem 1rem;
  border-top: 1px solid rgba(153, 69, 255, 0.15);
  background: rgba(5, 6, 10, 0.85);
  backdrop-filter: blur(10px);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.footer .sep { color: var(--purple); opacity: 0.6; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .gate-chips { justify-content: flex-start; }
  .topnav { justify-content: flex-start; }
  .grid.cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid.two-col,
  .grid.cards-4,
  .quick-links { grid-template-columns: 1fr; }
  .kv-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .btn-primary:hover, .ql:hover { transform: none; }
}

/* ── Soft-fail / tools / sweep / detail (extended) ── */
.softfail-note {
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 176, 32, 0.1);
  border: 1px solid rgba(255, 176, 32, 0.45);
  color: #ffe0a8;
  font-size: 0.82rem;
  line-height: 1.45;
}
.softfail-note.hidden { display: none !important; }

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.form-stack label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.form-stack label span { font-weight: 500; }
.form-stack input[type="text"],
.form-stack input[type="number"],
.form-stack select,
.form-grid input[type="text"] {
  appearance: none;
  background: rgba(5, 6, 10, 0.65);
  border: 1px solid rgba(153, 69, 255, 0.3);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-stack input:focus,
.form-stack select:focus,
.form-grid input[type="text"]:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}
.form-stack .btn-primary { align-self: flex-start; }

.tools-grid { align-items: start; }
.tool-card .card-head { flex-wrap: wrap; }
.tool-result { margin-top: 0.75rem; }
.tool-result.hidden { display: none !important; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.field-chip {
  display: inline-flex;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #ffe0a8;
  background: rgba(255, 176, 32, 0.12);
  border: 1px solid rgba(255, 176, 32, 0.4);
}

.subhead {
  margin: 1rem 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.collapsible {
  margin-top: 1rem;
  border: 1px solid rgba(153, 69, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem 0.75rem;
  background: rgba(5, 6, 10, 0.35);
}
.collapsible summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--cyan);
  padding: 0.4rem 0;
  list-style: none;
}
.collapsible summary::-webkit-details-marker { display: none; }
.collapsible summary::before {
  content: "▸ ";
  color: var(--purple);
}
.collapsible[open] summary::before { content: "▾ "; }

.run-link {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 500;
}
.run-link:hover { text-decoration: underline; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: rgba(0, 240, 255, 0.05); }

.toolbar-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.audit-md {
  max-height: 480px;
  white-space: pre-wrap;
}

.quick-links {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kv-row {
  grid-template-columns: minmax(110px, 160px) 1fr;
}

@media (max-width: 1100px) {
  .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .quick-links { grid-template-columns: 1fr; }
}

/* ── Block timeline rail (dense fill-row chips) ── */
.block-rail-host { min-height: 120px; }
.block-rail {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
}
.block-rail-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}
.block-rail-overflow {
  font-size: 0.75rem;
  color: var(--cyan);
  border-left: 2px solid var(--cyan);
  padding-left: 0.55rem;
}
.block-rail-scroll {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  gap: 0.4rem;
  overflow-x: auto;
  overflow-y: auto;
  min-height: 0;
  padding: 0 24px 0.25rem 8px;
  scroll-padding-inline: 24px;
  scroll-snap-type: x mandatory;
}
.block-col {
  flex: 0 0 auto;
  min-width: 280px;
  max-width: 360px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.block-col-head {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 0.2rem 0.35rem;
  border-radius: 5px;
  background: rgba(153, 69, 255, 0.1);
  border: 1px solid rgba(153, 69, 255, 0.22);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.block-col-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Compact rows: allow ~8–10 fills without nested scroll war */
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
/* Dense single-line trade rows (market-trades density) */
.fill-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  min-height: 24px;
  height: 24px;
  padding: 0 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1;
  border-bottom: 1px solid rgba(139, 144, 165, 0.12);
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
}
.fill-row:last-child { border-bottom: none; }
.fill-row .fr-actor {
  flex: 0 0 auto;
  font-weight: 650;
  min-width: 2.6rem;
  text-transform: lowercase;
  color: var(--text);
}
.fill-row .fr-side {
  flex: 0 0 auto;
  font-size: 0.62rem;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0.85;
}
.fill-row .fr-size {
  flex: 1 1 auto;
  text-align: right;
  color: var(--text);
  min-width: 3.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Tip chip: never shrink/clip inside dense fill cols (PRESENT incl 0). Tok yields. */
.fill-row .fr-tip {
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: min-content;
  width: max-content;
  color: var(--text-dim);
  font-size: 0.62rem;
  white-space: nowrap;
  overflow: visible;
}
.fill-row .fr-tok {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 6.2rem;
  color: var(--cyan);
  font-size: 0.62rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fill-row.actor-creator {
  border-left: 2px solid rgba(255, 0, 168, 0.75);
  background: rgba(255, 0, 168, 0.06);
}
.fill-row.actor-creator .fr-actor { color: var(--magenta); }
.fill-row.actor-rival {
  border-left: 2px solid rgba(153, 69, 255, 0.45);
  background: rgba(100, 70, 160, 0.07);
}
.fill-row.actor-rival .fr-actor { color: #c4a8ff; }
.fill-row.actor-own {
  border-left: 2px solid rgba(20, 241, 149, 0.85);
  background: rgba(20, 241, 149, 0.07);
}

.fill-row.actor-own .fr-actor { color: var(--mint); }
/* Own EXIT sell — readable EXIT (not raw sell); keep tooltip honesty in JS */
.fill-row.is-exit .fr-side,
.fill-row .fr-side.fr-exit {
  color: #ffb020;
  font-weight: 750;
  letter-spacing: 0.05em;
  opacity: 1;
}
.fill-row.actor-own.is-exit {
  border-left-color: rgba(255, 176, 32, 0.85);
  background: rgba(255, 176, 32, 0.08);
}
.fill-row.actor-own.is-exit .fr-actor { color: #ffb020; }

.fill-row.actor-create {
  border-left: 2px solid rgba(0, 240, 255, 0.55);
}
.fill-row.actor-create .fr-actor { color: var(--cyan); }
.fill-row.miss,
.fill-row.actor-other.miss {
  border-left-color: rgba(255, 176, 32, 0.75);
  background: rgba(255, 176, 32, 0.08);
}
/* Honest empty later-block state with carried curve meta (snapshot ≠ live fill) */
.block-empty-state {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.55rem 0.45rem;
  border-radius: 6px;
  border: 1px dashed rgba(139, 144, 165, 0.35);
  background: rgba(5, 6, 10, 0.35);
  min-height: 52px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: center;
  overflow: hidden;
}
.block-empty-state .be-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: lowercase;
}
.block-empty-state .be-meta {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--cyan);
  opacity: 0.9;
  line-height: 1.35;
  word-break: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
/* Carry snap: allow wrap so trailing SOL isn't clipped inside narrow cols / partial rail view */
.block-empty-state.block-carry-snap .be-meta {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

.block-empty-state.block-carry-snap {
  border-style: dashed;
  border-color: rgba(0, 240, 255, 0.32);
  background: rgba(0, 240, 255, 0.035);
  gap: 0.2rem;
}
/* Outlined CARRIED — snapshot chip, not solid live-fill actor pill */
.block-empty-state .be-carry-badge,
.block-col-head .be-carry-badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px dashed rgba(0, 240, 255, 0.55);
  padding: 0.06rem 0.32rem;
  border-radius: 3px;
  white-space: nowrap;
}
.block-empty-state .be-block {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Empty / CARRIED columns: distinct from live fill stacks; no jam into neighbors */
.block-col.is-carry {
  min-width: 220px;
  max-width: 280px;
  flex: 0 0 auto;
}
.block-col.is-carry .block-col-head {
  border-style: dashed;
  border-color: rgba(0, 240, 255, 0.35);
  background: rgba(0, 240, 255, 0.05);
  color: var(--cyan);
  flex-wrap: nowrap;
}
.block-col.is-carry .block-col-stack {
  overflow: hidden;
}
.block-rail-scroll .block-col.is-carry {
  min-width: 220px;
  max-width: 280px;
  flex: 0 0 auto;
}

/* Dense fill rows: never wrap / jam tip·tok chips */
.fill-row {
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}
/* Legacy fill-node kept for soft compat; prefer .fill-row */
.fill-node {
  border-radius: 10px;
  padding: 0.5rem 0.55rem;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 0 0 1px rgba(5, 6, 10, 0.4);
}
.fill-node.creator {
  border-color: rgba(255, 0, 168, 0.55);
  background: rgba(255, 0, 168, 0.08);
}
.fill-node.rival {
  border-color: rgba(153, 69, 255, 0.35);
  background: rgba(100, 70, 160, 0.12);
}
.fill-node.own {
  border: 2px solid rgba(20, 241, 149, 0.75);
  background: rgba(0, 240, 255, 0.08);
}
.fill-node.miss {
  border-color: rgba(255, 176, 32, 0.7);
  background: rgba(255, 176, 32, 0.1);
}
.fill-node.empty-slot {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  border-style: dashed;
}
.fill-node-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
}
.fill-actor {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text);
}
.fill-node.creator .fill-actor { color: var(--magenta); }
.fill-node.own .fill-actor { color: var(--mint); }
.fill-node.rival .fill-actor { color: #c4a8ff; }
.fill-side {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(139, 144, 165, 0.12);
}
.fill-block-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--cyan);
  opacity: 0.85;
}
.fill-node-body { display: flex; flex-direction: column; gap: 0.18rem; }
.fill-kv {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.25rem;
  font-size: 0.72rem;
}
.fill-kv .k {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
}
.fill-kv .v {
  font-family: var(--font-mono);
  color: var(--text);
  text-align: right;
}
.curve-spark {
  margin-top: 0.25rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(153, 69, 255, 0.2);
  background: rgba(5, 6, 10, 0.4);
  flex: 0 0 auto;
}
.curve-spark-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}
.block-rail-empty { padding: 1rem 0.5rem; }
.nested-card {
  background: rgba(10, 11, 18, 0.45);
  border: 1px solid rgba(153, 69, 255, 0.18);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.dim { color: var(--text-dim); }

@media (prefers-reduced-motion: reduce) {
  .fill-row.actor-own { background: rgba(20, 241, 149, 0.1); }
  .fill-node.own { box-shadow: 0 0 0 1px rgba(20, 241, 149, 0.4); }
}

/* ═══════════════════════════════════════════════════════════
   Fixed multi-pane simulator shell (TradingView / DexScreener)
   Regions: shell-chrome · pane-params · pane-viz · pane-info · pane-results
   ═══════════════════════════════════════════════════════════ */
:root {
  --chrome-h: 56px;
  --ticker-h: 34px;
  --results-h: 108px;
  --params-w: 280px;
  --info-w: 300px;
}

.sim-shell {
  position: relative;
  z-index: 1;
  display: grid;
  /* Prefer JS --shell-h (visual/safe viewport); keep vh/dvh fallbacks */
  height: 100vh;
  height: 100dvh;
  height: var(--shell-h, 100dvh);
  max-height: 100vh;
  max-height: 100dvh;
  max-height: var(--shell-h, 100dvh);
  overflow: hidden;
  /* results+footer FIXED tracks; only center viz row flex-shrinks */
  grid-template-rows: auto auto minmax(0, 1fr) var(--results-h) var(--footer-h);
  grid-template-columns: var(--params-w) minmax(0, 1fr) var(--info-w);
  grid-template-areas:
    "chrome chrome chrome"
    "banner banner banner"
    "params viz info"
    "results results results"
    "footer footer footer";
  gap: 0;
  min-height: 0;
  min-width: 0;
}

/* Legacy .app-shell unused when sim-shell is root; keep for offline compat */
.app-shell { min-height: 0; }

.shell-chrome {
  grid-area: chrome;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: rgba(10, 11, 18, 0.92);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
}
.chrome-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.45rem 1rem;
  min-height: var(--chrome-h);
}
.chrome-ticker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  padding: 0.28rem 0.85rem 0.4rem;
  min-height: var(--ticker-h);
  border-top: 1px solid rgba(153, 69, 255, 0.14);
  background: rgba(5, 6, 10, 0.55);
  overflow: hidden;
}
.chrome-ticker .tick {
  flex: 0 0 auto;
  font-size: 0.68rem;
  padding: 0.22rem 0.55rem;
  white-space: nowrap;
}
.chrome-ticker .tick-snap {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-left: 0.35rem;
  padding-left: 0.65rem;
  border-left: 1px solid rgba(153, 69, 255, 0.22);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}
.chrome-ticker .tick-snap.hidden { display: none !important; }
.chrome-ticker .tick-kv em {
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-right: 0.2rem;
  font-size: 0.58rem;
}
.chrome-ticker .tick-kv b {
  font-weight: 600;
  color: var(--cyan);
}
.chip-tip-absent {
  color: var(--absent);
  border-color: rgba(255, 176, 32, 0.45);
  background: rgba(255, 176, 32, 0.08);
}
.chip-tip-present {
  color: var(--mint);
  border-color: rgba(20, 241, 149, 0.4);
  background: rgba(20, 241, 149, 0.1);
}

/* tip≠route: bundle route unknown — dim/amber outline, not mint success */
.chip-bundle-unknown {
  color: #ffc9a8;
  border-color: rgba(255, 176, 32, 0.5);
  background: rgba(255, 176, 32, 0.08);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-bundle-unknown.hidden { display: none !important; }
#res-bundle-route.chip-bundle-unknown {
  font-size: 0.58rem;
  padding: 0.12rem 0.45rem;
  vertical-align: middle;
  max-width: 9rem;
}

.mode-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
  justify-content: center;
}

.mode-switcher button {
  appearance: none;
  cursor: pointer;
  border: 1px solid rgba(153, 69, 255, 0.28);
  background: rgba(16, 18, 28, 0.6);
  color: var(--text-dim);
  font: 500 0.75rem/1 var(--font-ui);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.mode-switcher button:hover {
  color: var(--text);
  border-color: rgba(0, 240, 255, 0.4);
}

.mode-switcher button[aria-pressed="true"] {
  color: #fff;
  border-color: var(--purple);
  box-shadow: 0 0 18px rgba(153, 69, 255, 0.35);
  background: linear-gradient(135deg, rgba(153, 69, 255, 0.35), rgba(255, 0, 168, 0.18));
}

.error-banner.sim-banner,
.sim-banner {
  grid-area: banner;
}

.pane {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

.pane-params {
  grid-area: params;
  border-left: none;
  border-bottom: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pane-params > .pane-head { flex: 0 0 auto; padding: 0.4rem 0.65rem; }
.pane-params > .pane-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.55rem 0.65rem;
}
.params-cta-bar {
  flex: 0 0 auto;
  padding: 0.55rem 0.65rem 0.7rem;
  border-top: 1px solid rgba(153, 69, 255, 0.22);
  background: rgba(10, 11, 18, 0.92);
  box-shadow: 0 -8px 24px rgba(153, 69, 255, 0.08);
}
.params-cta-bar .cta-slot { display: block; }
.params-cta-bar .cta-slot.hidden { display: none !important; }
.params-cta-bar .btn-primary,
.params-cta-bar .btn-ghost { width: 100%; }
.params-cta-bar .cta-hint {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.45rem 0;
}

.pane-viz {
  grid-area: viz;
  border-bottom: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}
.pane-viz > .pane-head,
.pane-viz > .viz-tabs { flex: 0 0 auto; }

.pane-info {
  grid-area: info;
  border-right: none;
  border-bottom: none;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.pane-info > .pane-body { flex: 1 1 auto; min-height: 0; overflow: auto; }

.pane-results {
  grid-area: results;
  border-left: none;
  border-right: none;
  height: var(--results-h);
  min-height: var(--results-h);
  max-height: var(--results-h);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 5;
}
.results-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-bottom: 1px solid rgba(153, 69, 255, 0.14);
  background: rgba(10, 11, 18, 0.75);
}
.results-tabs button {
  appearance: none;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font: 500 0.7rem/1 var(--font-ui);
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
}
.results-tabs button[aria-selected="true"] {
  color: var(--cyan);
  border-color: rgba(0, 240, 255, 0.35);
  background: rgba(0, 240, 255, 0.08);
}
.results-tabs .results-role { margin-left: auto; }
.results-tab-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.results-panel {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.results-panel.active { display: flex; flex-direction: column; }
.results-panel > .results-inner {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.recent-runs-compact {
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  min-height: 0;
  overflow: auto;
}
.recent-runs-compact table.data {
  font-size: 0.68rem;
  width: 100%;
}
.recent-runs-compact table.data th,
.recent-runs-compact table.data td {
  padding: 0.2rem 0.35rem;
}
.results-sweep-panel { padding: 0.35rem 0.65rem; min-height: 0; overflow: auto; }
.results-sweep-summary {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--cyan);
  max-height: 100%;
  overflow: auto;
}
.results-sweep-summary .sw-chip {
  border: 1px solid rgba(153, 69, 255, 0.28);
  border-radius: 7px;
  padding: 0.16rem 0.36rem;
  background: rgba(5, 6, 10, 0.45);
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 56px;
  color: var(--text-dim);
  font-size: 0.78rem;
  text-align: center;
  padding: 0.65rem;
}
.empty-glyph {
  font-size: 1.1rem;
  opacity: 0.55;
  color: var(--purple);
  line-height: 1;
}
.viz-empty.empty-state {
  flex-direction: column;
  gap: 0.4rem;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(153, 69, 255, 0.15);
  position: sticky;
  top: 0;
  background: rgba(10, 11, 18, 0.88);
  z-index: 2;
}

.pane-head h2 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.role-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--cyan);
  opacity: 0.9;
}

.pane-body { padding: 0.75rem; }
.pane-info > .pane-head { padding: 0.4rem 0.65rem; }
.pane-info > .pane-body { padding: 0.55rem 0.65rem; }
.info-sec.subhead { margin: 0.65rem 0 0.3rem; }

.form-stack label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.form-stack select,
.form-stack input[type="number"],
.form-stack input[type="text"],
.form-stack input[type="search"] {
  background: rgba(5, 6, 10, 0.8);
  border: 1px solid rgba(153, 69, 255, 0.28);
  border-radius: 8px;
  color: var(--text);
  padding: 0.45rem 0.55rem;
  font: 0.85rem/1.2 var(--font-mono);
}

.form-stack .btn-primary,
.form-stack .btn-ghost { width: 100%; }

.locked {
  margin-top: 0.85rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px dashed rgba(255, 176, 32, 0.4);
  background: rgba(255, 176, 32, 0.06);
  font-size: 0.72rem;
  color: var(--absent);
}

.locked code { color: #ffd27a; }

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

.viz-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(153, 69, 255, 0.12);
}

.viz-tabs button {
  appearance: none;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font: 500 0.72rem/1 var(--font-ui);
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
}

.viz-tabs button[aria-selected="true"] {
  color: var(--mint);
  border-color: rgba(20, 241, 149, 0.35);
  background: rgba(20, 241, 149, 0.08);
}

.viz-stage {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.viz-panel {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
}
.viz-panel.active {
  display: flex;
}

.viz-host-wrap {
  margin: 0.5rem 0.75rem 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 240, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(153, 69, 255, 0.06), transparent 40%),
    rgba(5, 6, 10, 0.55);
  padding: 0.65rem 0.85rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.viz-host-wrap > .card-head { flex: 0 0 auto; }
.viz-host-wrap > .viz-host {
  flex: 1 1 auto;
  min-height: 0;
}
.viz-host-wrap-compact {
  flex: 0 0 auto;
  overflow: hidden;
  min-height: 0;
  max-height: 140px;
}
.viz-host-compact {
  min-height: 0 !important;
  flex: 0 0 auto !important;
}
.card-head-compact {
  margin-bottom: 0.35rem;
}

.results-inner {
  display: grid;
  grid-template-columns:
    minmax(64px, 0.7fr)
    minmax(140px, 1.35fr)
    minmax(84px, 0.9fr)
    minmax(110px, 1.1fr)
    minmax(220px, 1.85fr)
    minmax(110px, 1.25fr)
    minmax(68px, 0.7fr);
  gap: 0.45rem;
  padding: 0.4rem 0.75rem 0.55rem;
  align-items: stretch;
  align-content: start;
  grid-auto-rows: minmax(52px, auto);
}

.metric {
  border-radius: 10px;
  border: 1px solid rgba(153, 69, 255, 0.22);
  background: rgba(5, 6, 10, 0.45);
  padding: 0.35rem 0.5rem;
  min-width: 0;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.metric .lbl {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.metric .val {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  margin-top: 0.2rem;
  color: var(--cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Prefer readable metric numbers — chips flex-shrink / ellipsis first */
.metric .val-row > .val {
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
.metric .val-row > .anti-pass-chip,
.metric .val-row > .chip-bundle-unknown {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
}
.metric .val-row > .chip-params-assumed,
.metric .val-row > .chip-sealed-ref {
  flex: 0 0 auto;
  min-width: max-content;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

.metric .val.mint { color: var(--mint); }
.metric .val.warn { color: var(--absent); }

/* Card hosts live inside results-inner grid — never stretch metric rows */
.results-inner > #run-result-cards,
.results-inner > #sweep-result-cards {
  grid-column: 1 / -1;
  min-height: 0;
}
.results-inner > #run-result-cards.hidden,
.results-inner > #sweep-result-cards.hidden {
  display: none !important;
}

/* Summary strip must stay metric-height; bulky stat-cards belong in Sweep tab / info */
.results-inner > #run-result-cards:not(.hidden),
.results-inner > #sweep-result-cards:not(.hidden) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 56px;
  overflow: hidden;
  padding: 0.15rem 0 0;
}
.results-inner > #run-result-cards .stat-card,
.results-inner > #sweep-result-cards .stat-card {
  padding: 0.25rem 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
}
.results-inner > #run-result-cards .stat-label,
.results-inner > #sweep-result-cards .stat-label {
  margin-bottom: 0.1rem;
  font-size: 0.58rem;
}
.results-inner > #run-result-cards .stat-value,
.results-inner > #sweep-result-cards .stat-value {
  font-size: 0.72rem;
}

.mini-table {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  overflow: auto;
  max-height: 96px;
  min-height: 0;
}

.sim-footer {
  grid-area: footer;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  justify-content: center;
  align-items: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  border-top: 1px solid var(--glass-border);
  background: rgba(10, 11, 18, 0.95);
  flex-shrink: 0;
  height: var(--footer-h);
  min-height: var(--footer-h);
  max-height: var(--footer-h);
  overflow: hidden;
  z-index: 5;
}

.sim-footer .sep { opacity: 0.4; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.legend em {
  font-style: normal;
  font-family: var(--font-mono);
  color: var(--mint);
  margin-right: 0.2rem;
}

.nested-card .card-head { margin-bottom: 0.35rem; }
.nested-card .card-head h2 { font-size: 0.8rem; }

.tool-picker .form-stack { margin-top: 0.35rem; }

@media (max-width: 1199px) {
  /* Mid desktop/tablet: still no document scroll — panes scroll internally */
  html, body { overflow: hidden; height: 100%; }
  .sim-shell {
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto var(--results-h) var(--footer-h);
    grid-template-areas:
      "chrome chrome"
      "banner banner"
      "params viz"
      "info viz"
      "results results"
      "footer footer";
    height: 100vh;
    height: 100dvh;
    height: var(--shell-h, 100dvh);
    max-height: 100vh;
    max-height: 100dvh;
    max-height: var(--shell-h, 100dvh);
    overflow: hidden;
  }
  .pane-info { max-height: 200px; overflow: auto; }
  .results-inner {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-content: start;
    grid-auto-rows: minmax(52px, auto);
  }
  .results-inner > #run-result-cards,
  .results-inner > #sweep-result-cards {
    grid-column: 1 / -1;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border: 0;
  }
  .results-inner > #run-result-cards:not(.hidden),
  .results-inner > #sweep-result-cards:not(.hidden) {
    max-height: 72px;
    overflow: auto;
  }
  .pane-results { max-height: var(--results-h); }
}



/* Short desktop (chrome+taskbar → ~655–720 content box): shrink chrome/viz/results so strip+footer stay in view */
@media (max-height: 760px) {
  :root {
    --chrome-h: 46px;
    --ticker-h: 26px;
    --results-h: 92px;
    --footer-h: 32px;
  }
  .chrome-top { padding: 0.26rem 0.7rem; min-height: var(--chrome-h); }
  .chrome-ticker { padding: 0.12rem 0.65rem 0.2rem; min-height: var(--ticker-h); }
  .pane-head { padding: 0.28rem 0.5rem; }
  .pane-viz > .pane-head,
  .pane-params > .pane-head,
  .pane-info > .pane-head { padding: 0.28rem 0.5rem; }
  .viz-tabs { padding: 0.22rem 0.5rem; }
  .viz-host-wrap {
    margin: 0.22rem 0.45rem 0.3rem;
    padding: 0.32rem 0.45rem;
  }
  .viz-host-wrap-compact { max-height: 108px; }
  .params-cta-bar { padding: 0.32rem 0.5rem 0.4rem; }
  .pane-results {
    height: var(--results-h);
    min-height: var(--results-h);
    max-height: var(--results-h);
  }
  .sim-footer,
  .footer {
    padding: 0.18rem 0.65rem;
    height: var(--footer-h);
    min-height: var(--footer-h);
    max-height: var(--footer-h);
  }
  .results-inner {
    padding: 0.2rem 0.5rem 0.24rem;
    grid-auto-rows: minmax(40px, auto);
    gap: 0.35rem;
  }
  .results-tabs { padding: 0.16rem 0.5rem; }
  .metric { min-height: 40px; padding: 0.16rem 0.35rem; }
  .metric .val { font-size: 0.82rem; }
  .block-rail-host { min-height: 56px; }
  .empty-state { min-height: 40px; padding: 0.35rem; }
}

/* Real 1280×800 chrome+taskbar content box ~655px */
@media (max-height: 700px) {
  :root {
    --chrome-h: 42px;
    --ticker-h: 24px;
    --results-h: 86px;
    --footer-h: 28px;
  }
  .chrome-top { padding: 0.2rem 0.6rem; }
  .chrome-ticker { padding: 0.08rem 0.55rem 0.14rem; }
  .chrome-ticker .tick { font-size: 0.62rem; padding: 0.14rem 0.36rem; }
  .viz-tabs { padding: 0.16rem 0.45rem; }
  .viz-tabs button { padding: 0.26rem 0.45rem; font-size: 0.68rem; }
  .viz-host-wrap {
    margin: 0.16rem 0.4rem 0.22rem;
    padding: 0.26rem 0.4rem;
  }
  .viz-host-wrap-compact { max-height: 92px; }
  .block-rail-host { min-height: 48px; }
  .params-cta-bar { padding: 0.26rem 0.45rem 0.32rem; }
  .results-inner {
    padding: 0.14rem 0.45rem 0.18rem;
    grid-auto-rows: minmax(36px, auto);
  }
  .metric { min-height: 36px; padding: 0.12rem 0.3rem; }
  .metric .lbl { font-size: 0.58rem; }
  .metric .val { font-size: 0.78rem; }
}

@media (max-height: 640px) {
  :root {
    --results-h: 80px;
    --footer-h: 26px;
    --chrome-h: 40px;
    --ticker-h: 22px;
  }
  .chrome-ticker .tick { font-size: 0.6rem; padding: 0.12rem 0.32rem; }
  .viz-host-wrap-compact { max-height: 80px; }
  .block-rail-host { min-height: 40px; }
}

@media (max-width: 767px) {
  /* Phone: allow document scroll */
  html, body { height: auto; max-height: none; overflow: auto; }
  body { overflow: auto; }
  .sim-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "chrome"
      "banner"
      "viz"
      "results"
      "params"
      "info"
      "footer";
    height: auto;
    min-height: 100vh;
    max-height: none;
    overflow: visible;
  }
  .pane-params, .pane-info, .pane-viz, .pane-results { max-height: none; overflow: visible; }
  .viz-stage, .viz-panel.active, .viz-host-wrap { overflow: visible; min-height: 180px; }
  .results-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mode-switcher {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .mode-switcher button { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .mode-switcher button,
  .btn-primary { box-shadow: none; transition: none; }
}

/* anti_pass chip beside descriptive_pnl */
.anti-pass-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffc9a8;
  background: rgba(255, 176, 32, 0.14);
  border: 1px solid rgba(255, 176, 32, 0.55);
  vertical-align: middle;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.anti-pass-chip.hidden { display: none !important; }

/* PARAMS_ASSUMED honesty — amber/warning, not purple sealed glow, not green pass */
.chip-params-assumed,
.params-assumed-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffc9a8;
  background: rgba(255, 176, 32, 0.12);
  border: 1px solid rgba(255, 176, 32, 0.55);
  vertical-align: middle;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-params-assumed.hidden,
.params-assumed-chip.hidden { display: none !important; }
#tick-params-status.chip-params-assumed {
  font-size: 0.62rem;
}
#res-params-status.chip-params-assumed {
  font-size: 0.58rem;
  padding: 0.12rem 0.4rem;
  max-width: 8rem;
}

/* SEALED_REF honesty — cool cyan/sealed, visually separable from PARAMS_ASSUMED amber */
.chip-sealed-ref {
  display: inline-flex;
  align-items: center;
  margin-left: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #9af7ff;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.55);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.16);
  vertical-align: middle;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-sealed-ref.hidden { display: none !important; }
#tick-params-status.chip-sealed-ref {
  font-size: 0.62rem;
}
#res-params-status.chip-sealed-ref {
  font-size: 0.58rem;
  padding: 0.12rem 0.4rem;
  max-width: none;
  flex: 0 0 auto;
}

.block-rail-params-badge,
.curve-spark-params-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffc9a8;
  background: rgba(255, 176, 32, 0.14);
  border: 1px solid rgba(255, 176, 32, 0.55);
  vertical-align: middle;
}
.block-rail-params-badge.chip-sealed-ref,
.curve-spark-params-badge.chip-sealed-ref {
  color: #9af7ff;
  background: rgba(0, 240, 255, 0.14);
  border: 1px solid rgba(0, 240, 255, 0.55);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.16);
}
.curve-spark-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}
.curve-spark-head .curve-spark-label { margin-bottom: 0; }
.params-status-row {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.params-status-row.hidden { display: none !important; }
.params-status-row .chip-params-assumed,
.params-status-row .chip-sealed-ref { margin-left: 0; }
.params-status-row .params-status-echo {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.metric .val-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  max-width: 100%;
}

/* Mode-gated center viz tabs (UI-SM3) — buttons hidden via [hidden] */
.viz-tabs button[hidden] { display: none !important; }

.metric .name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  margin-top: 0.15rem;
}
.metric .val.truncate-name,
#res-name.truncate-name {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  color: var(--cyan);
}
#res-name.truncate-name:hover,
#res-name.truncate-name:focus {
  color: var(--mint);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#metric-name {
  min-width: 0;
  max-width: 100%;
}
#metric-name .val {
  min-width: 0;
}
.btn-view {
  flex: 0 0 auto;
  padding: 0.2rem 0.55rem !important;
  font-size: 0.68rem !important;
  line-height: 1.2;
  white-space: nowrap;
}

/* Compact ABSENT chip strip (center tab demoted from giant SVG legend) */
.absent-chip-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-height: 28px;
  max-height: 44px;
  padding: 0.15rem 0;
}
.absent-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.absent-chip-miss {
  color: #1a1200;
  background: var(--absent);
  border-color: rgba(255, 176, 32, 0.8);
}
.absent-chip-zero {
  color: #04140c;
  background: var(--mint);
  border-color: rgba(20, 241, 149, 0.7);
}
.absent-chip-sol {
  color: var(--text);
  background: rgba(153, 69, 255, 0.22);
  border-color: rgba(153, 69, 255, 0.45);
}
.absent-marker-rail {
  position: relative;
  height: 18px;
  margin: 0.25rem 0 0.15rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,77,109,0.35), rgba(153,69,255,0.35), rgba(20,241,149,0.35));
  border: 1px solid rgba(153, 69, 255, 0.25);
}
.absent-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
}
.absent-marker-idle { display: none; }
.absent-marker-miss { background: var(--absent); color: #1a1200; }
.absent-marker-neg { background: var(--danger); color: #fff; }
.absent-marker-pos { background: var(--mint); color: #04140c; }
.absent-marker-zero { background: var(--cyan); color: #041018; }
.absent-run-meta {
  font-size: 0.62rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fixture-alias-note {
  margin: 0 0 0.65rem;
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.35;
}
.fixture-alias-note code { color: var(--cyan); font-size: 0.66rem; }

/* In-shell strip drawer (Name/View) — right slide-over */
.json-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.json-modal.strip-drawer {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}
.json-modal.hidden,
.json-modal[hidden] { display: none !important; }
.json-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.json-modal-card {
  position: relative;
  z-index: 1;
  width: min(720px, 96vw);
  max-height: min(80vh, 80dvh);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: rgba(10, 11, 18, 0.95);
  box-shadow: 0 0 40px rgba(153, 69, 255, 0.25);
  overflow: hidden;
}
.json-modal.strip-drawer .strip-drawer-card {
  width: min(420px, 92vw);
  max-height: 100vh;
  max-height: 100dvh;
  height: 100%;
  border-radius: 14px 0 0 14px;
  margin: 0;
  box-shadow: -12px 0 40px rgba(153, 69, 255, 0.22);
  animation: stripDrawerIn 0.18s ease-out;
}
@keyframes stripDrawerIn {
  from { transform: translateX(18px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .json-modal.strip-drawer .strip-drawer-card { animation: none; }
}
.badge-present {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--mint);
  background: rgba(20, 241, 149, 0.12);
  border: 1px solid rgba(20, 241, 149, 0.4);
}
.badge-gate-closed {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #ff8a9a;
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid rgba(255, 77, 109, 0.45);
}
.strip-structured.drawer-kv {
  grid-template-columns: 1fr;
  gap: 0.35rem;
}
.strip-structured.drawer-kv .strip-field {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem;
}
.strip-structured.drawer-kv .strip-field .sf-lbl {
  margin: 0;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.68rem;
}
.strip-structured.drawer-kv .strip-field.span-2 {
  grid-template-columns: 120px 1fr;
}
.json-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(153, 69, 255, 0.2);
  flex: 0 0 auto;
}
.json-modal-head h2 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.json-modal-actions { display: flex; gap: 0.4rem; }
.json-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  overflow: auto;
  max-height: none;
  border-radius: 0;
  border: none;
  background: rgba(5, 6, 10, 0.6);
}

/* Block-rail / board hosts fill remaining viz height; denser cols share width */
.block-rail-host {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.block-rail {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.block-rail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: row;
  gap: 0.4rem;
  overflow-x: auto;
  overflow-y: auto;
}
.block-rail-scroll .block-col {
  flex: 1 1 0;
  min-width: 360px;
}
.block-rail-scroll .block-col-stack {
  max-height: none;
  overflow: visible;
}
.block-rail-scroll .fill-row {
  height: 24px;
  min-height: 24px;
}
#batch-board.viz-host,
#sweep-grid-viz.viz-host,
#cal-tip-cdf.viz-host {
  min-height: 0;
}


/* ── tip-cdf run-bind honesty sticky (unbind 2026-09-26h) ── */
.tip-cdf-bind-status {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin: 0.15rem 0 0.45rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.35;
  border: 1px solid rgba(255, 176, 32, 0.55);
  background: rgba(255, 176, 32, 0.14);
  color: var(--absent);
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: 0 0 0 1px rgba(255, 176, 32, 0.12);
}
.tip-cdf-bind-status.tip-cdf-bind-absent {
  border-color: rgba(255, 176, 32, 0.65);
  background: rgba(255, 176, 32, 0.16);
  color: var(--absent);
}
.tip-cdf-bind-status.tip-cdf-bind-bound {
  border-color: rgba(20, 241, 149, 0.4);
  background: rgba(20, 241, 149, 0.1);
  color: var(--mint);
}
.tip-cdf-bind-label {
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}
.tip-cdf-bind-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}
.tip-cdf-bind-chip[data-bind="ABSENT"] {
  color: var(--absent);
  border-color: rgba(255, 176, 32, 0.55);
}
.tip-cdf-bind-chip[data-bind="BOUND"] {
  color: var(--mint);
  border-color: rgba(20, 241, 149, 0.45);
}
.tip-cdf-bind-note {
  opacity: 0.92;
  font-size: 0.68rem;
  color: inherit;
}
/* ── tip-cdf owns the center (reject-fix 2026-09-26b) ── */
.viz-panel[data-viz-panel="tip-cdf"] .tip-cdf-wrap {
  overflow: auto;
}
.viz-panel[data-viz-panel="tip-cdf"] .tip-cdf-host.hidden {
  display: none !important;
  flex: 0 0 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}
.viz-panel[data-viz-panel="tip-cdf"] .tip-cdf-host:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.viz-panel[data-viz-panel="tip-cdf"] .tip-cdf-host:not(.hidden) > svg {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.cdf-meta-line {
  flex: 0 0 auto;
  margin-top: 0.35rem;
  padding: 0.2rem 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--text-dim);
  max-height: 2.6em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#info-cal-detail .subhead {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
#info-cal-detail .pill { margin-bottom: 0.35rem; }

/* Structured NAME/View drawer (Raw toggle default OFF) */
.json-modal:not(.strip-drawer) .json-modal-card {
  width: min(640px, 96vw);
}
.raw-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  margin-right: 0.25rem;
}
.raw-toggle input { accent-color: var(--cyan); }
.strip-structured {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.75rem 1rem 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.65rem;
}
.strip-field {
  border-radius: 8px;
  border: 1px solid rgba(153, 69, 255, 0.2);
  background: rgba(5, 6, 10, 0.5);
  padding: 0.4rem 0.55rem;
  min-width: 0;
}
.strip-field.span-2 { grid-column: 1 / -1; }
.strip-field .sf-lbl {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.15rem;
}
.strip-field .sf-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--cyan);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.strip-field .sf-val .badge-absent { font-size: 0.72rem; }
#strip-json-body.hidden,
#strip-json-body[hidden] { display: none !important; }
#strip-json-structured.hidden { display: none !important; }


/* ── Tools CLI-site wiring honesty (2026-09-27c) ── */
.tool-honesty-sticky {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0.35rem 0 0.55rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.35;
  border: 1px solid rgba(255, 176, 32, 0.55);
  background: rgba(255, 176, 32, 0.14);
  color: var(--absent);
}
.tool-honesty-sticky.tip-cdf-bind-absent {
  border-color: rgba(255, 176, 32, 0.65);
  background: rgba(255, 176, 32, 0.16);
}
.tool-honesty-sticky.tip-cdf-bind-bound {
  border-color: rgba(20, 241, 149, 0.4);
  background: rgba(20, 241, 149, 0.1);
  color: var(--mint);
}
.tool-honesty-row {
  margin: 0.35rem 0 0.55rem;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tool-honesty-chip,
.chip-honesty-absent,
.chip-honesty-ok,
.chip-honesty-anti {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.chip-honesty-absent {
  color: var(--absent);
  background: rgba(255, 176, 32, 0.14);
  border-color: rgba(255, 176, 32, 0.55);
}
.chip-honesty-ok {
  color: var(--mint);
  background: rgba(20, 241, 149, 0.1);
  border-color: rgba(20, 241, 149, 0.45);
}
.chip-honesty-anti {
  color: #ffd0d8;
  background: rgba(255, 77, 109, 0.16);
  border-color: rgba(255, 77, 109, 0.5);
}
.tool-result-cards {
  margin: 0.35rem 0 0.55rem;
}
.tool-result-kv {
  margin-bottom: 0.5rem;
}
.dataset-locks {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.25rem 0 0.65rem;
}
.lock-card {
  border-radius: 8px;
  border: 1px solid rgba(255, 176, 32, 0.35);
  background: rgba(5, 6, 10, 0.55);
  padding: 0.45rem 0.6rem;
}
.lock-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}
.lock-axis {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
  font-weight: 600;
}
.lock-reason {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.35;
}
.dataset-refused {
  margin-bottom: 0.55rem;
}
#cal-report-bind.hidden { display: none !important; }


/* Fixture select: full value in title; avoid mid-glyph mystery truncate without title */
select#run-fixture,
select#sweep-family,
select#sweep-grid {
  text-overflow: ellipsis;
}
