/* Figures for "Drawing 6,684 ideas in one dependency graph".
   Harmonizes the blog's tokens (main.css) with the --c-* palette read by
   theorems-visualizations/assets/js/viz/core.js in light and dark mode. */

@import url("https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css");

:root {
  --panel: #ffffff;
  --panel-2: #f5f5f4;
  --ink: var(--fg);
  --ink-2: var(--fg-2);
  --ink-3: var(--fg-3);
  --font-ui: var(--sans);
  --font-mono: var(--mono);

  /* Canvas runtime palette (--c-*) read by assets/js/viz/core.js */
  --c-ink: #18181b;
  --c-muted: #64646a;
  --c-faint: #a1a1aa;
  --c-grid: #ececea;
  --c-bg: #f8f8f7;
  --c-panel: #ffffff;
  --c-accent: #2563eb;
  --c-blue: #2563eb;
  --c-red: #dc2626;
  --c-green: #16a34a;
  --c-orange: #d97706;
  --c-purple: #7c3aed;
  --c-teal: #0d9488;
  --c-pink: #db2777;
  --c-gold: #ca8a04;
  --c-gray: #71717a;
  --c-pma: #2563eb;
  --c-rca: #c4442a;
  --c-fa: #0e8a6e;
}

:root[data-theme="dark"] {
  --panel: #141417;
  --panel-2: #1c1c20;
  --ink: var(--fg);
  --ink-2: var(--fg-2);
  --ink-3: var(--fg-3);

  --c-ink: #ececef;
  --c-muted: #a1a1aa;
  --c-faint: #52525b;
  --c-grid: #232329;
  --c-bg: #111114;
  --c-panel: #151519;
  --c-accent: #6ea2ff;
  --c-blue: #6ea2ff;
  --c-red: #f87171;
  --c-green: #4ade80;
  --c-orange: #fbbf24;
  --c-purple: #c084fc;
  --c-teal: #2dd4bf;
  --c-pink: #f472b6;
  --c-gold: #facc15;
  --c-gray: #9ca3af;
  --c-pma: #6ea2ff;
  --c-rca: #ff8a6b;
  --c-fa: #43d1a8;
}

/* --------------------------------------------------------- figure chrome */
.fig-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.fig-controls .tabs {
  gap: 4px 14px;
  flex-wrap: wrap;
}
.fig-controls .tabs button {
  font-size: 13px;
  white-space: nowrap;
}
.fig-controls .grow { flex: 1; }
.fig-num {
  font-size: 12px;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
  white-space: normal;
}

/* ----------------------------------------------------- architecture svg */
.arch .lbl { fill: var(--fg-3); font: 500 12px var(--sans); }
.arch .box { fill: var(--bg); stroke: var(--line-2); stroke-width: 1; }
.arch .box.em { stroke: var(--fg-2); stroke-width: 1.25; }
.arch .t { fill: var(--fg); font: 500 13px var(--sans); text-anchor: middle; dominant-baseline: central; }
.arch .st { fill: var(--fg-3); font: 11.5px var(--sans); text-anchor: middle; dominant-baseline: central; }
.arch .edge { fill: none; stroke: var(--fg-3); stroke-width: 1; }
.arch .edge-strong { fill: none; stroke: var(--fg); stroke-width: 1.2; }
.arch .el { fill: var(--fg-3); font: 10.5px var(--mono); text-anchor: middle; }
.arch .head { fill: var(--fg-3); }
.arch .head-strong { fill: var(--fg); }

/* ------------------------------------------ embedded viz(v) runtime DOM */
.tv-viz-mount .viz {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tv-viz-mount .viz-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.tv-viz-mount .stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tv-viz-mount .stage[hidden] { display: none !important; }
.tv-viz-mount .stage-title {
  font-size: 12.5px;
  color: var(--fg-2);
  font-weight: 500;
  padding: 0 2px;
}
.tv-viz-mount .stage-box {
  position: relative;
  background: var(--c-panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.tv-viz-mount .stage-box canvas {
  display: block;
  position: absolute;
  inset: 0;
}
.tv-viz-mount .stage-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tv-viz-mount .tex-label {
  position: absolute;
  white-space: nowrap;
  line-height: 1;
  text-shadow: 0 0 3px var(--c-panel), 0 0 3px var(--c-panel), 0 0 2px var(--c-panel);
}
.tv-viz-mount .tex-label.plate {
  background: color-mix(in srgb, var(--c-panel) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}
.tv-viz-mount .stage-hint {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 11px;
  color: var(--fg-3);
  pointer-events: none;
  transition: opacity 0.35s;
}
.tv-viz-mount .stage-box.touched .stage-hint { opacity: 0; }
.tv-viz-mount .viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12.5px;
  color: var(--fg-2);
  padding: 0 2px;
}
.tv-viz-mount .viz-legend:empty { display: none; }
.tv-viz-mount .lg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tv-viz-mount .lg-swatch {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--sw);
  flex: none;
  display: inline-block;
}
.tv-viz-mount .lg-swatch.dash {
  background: repeating-linear-gradient(90deg, var(--sw) 0 5px, transparent 5px 8px);
}
.tv-viz-mount .lg-swatch.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.tv-viz-mount .lg-swatch.area {
  height: 9px;
  opacity: 0.45;
  border-radius: 2px;
}
.tv-viz-mount .viz-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  padding: 12px 2px 2px;
  border-top: 1px solid var(--line);
}
.tv-viz-mount .viz-controls:empty { display: none; }
.tv-viz-mount .viz-controls [hidden] { display: none !important; }
.tv-viz-mount .ctl {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.tv-viz-mount .ctl-label {
  color: var(--fg-2);
  white-space: nowrap;
}
.tv-viz-mount .ctl-label .katex { font-size: 1.02em; color: var(--fg); }
.tv-viz-mount .ctl-slider {
  flex: 1 1 220px;
  max-width: 380px;
  min-width: 0;
}
.tv-viz-mount .ctl-slider .ctl-label {
  white-space: normal;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 58%;
  line-height: 1.25;
}
.tv-viz-mount .ctl-slider input[type="range"] {
  flex: 1;
  min-width: 84px;
}
.tv-viz-mount .ctl-value {
  flex: none;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
  min-width: 3.6em;
  text-align: right;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.tv-viz-mount .ctl-play { gap: 6px; }
.tv-viz-mount .ctl-play .play {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.tv-viz-mount .btn-icon {
  min-width: 30px;
  padding: 0 8px;
  font-size: 13px;
}
.tv-viz-mount .seg {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--subtle);
}
.tv-viz-mount .seg button {
  border: 0;
  background: none;
  padding: 4px 10px;
  font: 12.5px/1.3 var(--sans);
  cursor: pointer;
  color: var(--fg-2);
  border-radius: 4px;
}
.tv-viz-mount .seg button.on {
  background: var(--fg);
  color: var(--bg);
}
.tv-viz-mount .seg button:hover:not(.on) {
  color: var(--fg);
}
.tv-viz-mount .switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.tv-viz-mount .switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.tv-viz-mount .switch-track {
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: var(--line-2);
  position: relative;
  transition: background 0.15s;
  flex: none;
}
.tv-viz-mount .switch-track::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.tv-viz-mount .switch input:checked + .switch-track {
  background: var(--accent);
}
.tv-viz-mount .switch input:checked + .switch-track::after {
  transform: translateX(14px);
}
.tv-viz-mount .viz-readout {
  overflow-x: auto;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-2);
  padding: 2px 2px 0;
  font-variant-numeric: tabular-nums;
}
.tv-viz-mount .viz-readout:empty { display: none; }
.tv-viz-mount .viz-readout p { margin: 0; }
.tv-viz-mount .viz-readout .katex { font-size: 1.02em; color: var(--fg); }

/* ------------------------------------------- Figure 2: Dependency Atlas */
.tv-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}
.tv-presets .tv-pill {
  padding: 2.5px 6px;
  font-size: 10.5px;
  gap: 4px;
}
.tv-pill {
  display: inline-flex;
  align-items: center;
  gap: 4.5px;
  padding: 2.5px 6.5px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg-2);
  font: 11px/1.35 var(--sans);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.tv-pill:hover {
  color: var(--fg);
  border-color: var(--fg-3);
}
.tv-pill[aria-pressed="true"] {
  color: var(--fg);
  border-color: var(--fg);
  background: var(--subtle);
  font-weight: 600;
}
.tv-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  flex: none;
}
.tv-search {
  padding: 2.5px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font: 10.75px/1.35 var(--sans);
  width: 116px;
  flex: 0 1 116px;
  min-width: 88px;
}
.tv-search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.tv-canvas-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--c-panel);
  overflow: hidden;
}
.tv-map-canvas {
  display: block;
  width: 100%;
  height: 440px;
  cursor: grab;
  touch-action: none;
}
.tv-map-canvas:active { cursor: grabbing; }
.tv-map-hud {
  position: absolute;
  top: 9px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  gap: 8px;
}
.tv-map-hud > * { pointer-events: auto; }
.tv-map-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 3.5px 9px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--c-panel) 92%, transparent);
  backdrop-filter: blur(4px);
  border: 1px solid var(--line);
  font-size: 11.75px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.tv-map-badge b { color: var(--fg); font-weight: 600; }
.tv-map-tools {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tv-map-tools .btn {
  min-height: 25px;
  padding: 0 8px;
  font-size: 11.75px;
  background: color-mix(in srgb, var(--c-panel) 92%, transparent);
  backdrop-filter: blur(4px);
}
.tv-map-legend {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 3px 9px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--c-panel) 88%, transparent);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--fg-3);
  pointer-events: none;
}
.tv-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Local 3-column lineage inspector under the map */
.tv-lineage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.38fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subtle);
}
@media (max-width: 720px) {
  .tv-lineage { grid-template-columns: minmax(0, 1fr); }
}
.tv-lin-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.tv-lin-hdr {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-3);
  margin-bottom: 2px;
}
.tv-lin-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tv-lin-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4.5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--fg-2);
  font: 12px/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, color 0.15s;
}
.tv-lin-node:hover {
  border-color: var(--fg-3);
  color: var(--fg);
}
.tv-lin-node code {
  font-size: 11px;
  padding: 0;
  background: none;
  color: var(--fg);
  font-weight: 500;
  flex: none;
  white-space: nowrap;
}
.tv-lin-node span:not(.tv-dot) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-lin-center {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 13px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--bg);
  min-width: 0;
}
.tv-lin-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--fg-3);
  min-width: 0;
}
.tv-lin-eyebrow span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-lin-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
  margin: 5px 0 8px;
}
.tv-lin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px 8px;
  border-radius: 5px;
  background: var(--subtle);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}
.tv-lin-stats div b {
  display: block;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--fg);
}
.tv-lin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}
.tv-lin-actions a, .tv-lin-actions button {
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

/* Cross-field chord & flow matrix view */
.tv-flows-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: center;
}
@media (max-width: 720px) {
  .tv-flows-grid { grid-template-columns: minmax(0, 1fr); }
}
.tv-chord-svg {
  display: block;
  width: 100%;
  max-width: 375px;
  margin: 0 auto;
  height: auto;
}
.tv-flow-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tv-flow-row {
  display: grid;
  grid-template-columns: 124px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 12.5px;
  cursor: pointer;
}
.tv-flow-row:hover, .tv-flow-row.active {
  background: var(--subtle);
}
.tv-flow-track {
  height: 7px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.tv-flow-fill {
  height: 100%;
  border-radius: 4px;
}
.tv-flow-ex {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--fg-2);
}

/* 77-step chain view */
.tv-chain-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tv-skyline-svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--c-panel);
}
.tv-chain-box {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--subtle);
}
.tv-chain-box-hdr {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11.75px;
  color: var(--fg-2);
}
.tv-chain-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 3.5px;
}
.tv-chain-step {
  padding: 2px 5.5px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--bg);
  font: 10.5px/1.3 var(--mono);
  color: var(--fg-2);
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
}
.tv-chain-step:hover {
  color: var(--fg);
  border-color: var(--fg-3);
}
.tv-chain-step.active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg) !important;
  font-weight: 600;
}

/* ------------------------------------------- Figure 3: 13-Field Workbench */
.tv-field-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 3.5px;
  margin-bottom: 10px;
}
.tv-field-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3.5px 6px;
  flex: 1 1 auto;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg-2);
  font: 11.5px/1.3 var(--sans);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tv-field-btn:hover {
  color: var(--fg);
  border-color: var(--fg-3);
}
.tv-field-btn[aria-pressed="true"] {
  color: var(--fg);
  background: var(--subtle);
  border-color: var(--fg);
  font-weight: 600;
}
.tv-wb-card {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg);
  padding: 14px 16px;
}
.tv-wb-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.tv-wb-eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--fg-2);
}
.tv-wb-title {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
}
.tv-wb-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--subtle);
  border: 1px solid var(--line-2);
  font: 500 11px/1.45 var(--mono);
  color: var(--fg-2);
  white-space: nowrap;
  flex: none;
}
.tv-wb-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--fg-3);
  min-width: 0;
}
.tv-wb-links span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-wb-links a {
  color: var(--fg-2);
  text-decoration: none;
  white-space: nowrap;
  flex: none;
  font-weight: 500;
}
.tv-wb-links a:hover { color: var(--fg); text-decoration: underline; }
.tv-wb-stmt {
  font-size: 13.5px;
  line-height: 1.52;
  color: var(--fg);
  padding: 8px 12px;
  border-left: 2.5px solid var(--fc, var(--accent));
  background: var(--subtle);
  border-radius: 0 6px 6px 0;
  margin-bottom: 8px;
}
.tv-wb-stmt p { margin: 0 0 5px; }
.tv-wb-stmt p:last-child { margin-bottom: 0; }
.tv-wb-stmt .katex-display { margin: 0.45em 0; }
.tv-wb-cap {
  font-size: 12.75px;
  line-height: 1.48;
  color: var(--fg-2);
  margin-bottom: 10px;
}
.tv-wb-cap p { margin: 0; }
.tv-wb-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11.75px;
  color: var(--fg-3);
}
.tv-api-tags {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.tv-api-tag {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--subtle);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-2);
}
.tv-code-drawer {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--subtle);
  border: 1px solid var(--line);
  font: 12px/1.55 var(--mono);
  color: var(--fg);
  overflow-x: auto;
  white-space: pre;
}

/* ------------------------------------------- Figure 4: Cross-Field Bridges */
.tv-bridge-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.tv-bridge-pills .tv-pill {
  flex: 1 1 auto;
  justify-content: center;
}
.tv-swimlane-svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--c-panel);
  margin-bottom: 10px;
}
.tv-step-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--subtle);
  margin-bottom: 10px;
}
.tv-step-note {
  font-size: 13px;
  line-height: 1.48;
  color: var(--fg);
  flex: 1 1 360px;
}
.tv-step-note b { font-weight: 600; }

/* ------------------------------------------- Figure 5: Audit & Coverage */
.tv-audit-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.18fr);
  gap: 14px;
  align-items: stretch;
}
@media (max-width: 740px) {
  .tv-audit-grid { grid-template-columns: minmax(0, 1fr); }
}
.tv-cov-box, .tv-case-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.tv-cov-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}
.tv-cov-row {
  display: grid;
  grid-template-columns: 88px 1fr 78px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tv-cov-bar {
  height: 7.5px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
  display: flex;
}
.tv-audit-canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--c-panel);
  margin: 8px 0;
}
.tv-slider-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 12.5px;
}
.tv-slider-row input { flex: 1 1 80px; min-width: 0; max-width: 100%; }
.tv-slider-row > span:last-child { margin-left: auto; }
.tv-prim-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.tv-prim-cell {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--subtle);
  font-size: 11px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.tv-prim-cell b {
  display: block;
  font-size: 13.5px;
  color: var(--fg);
  font-family: var(--mono);
}
