.c04-page, .c04-panel {
  min-width: 0;
  --c04-signal: var(--blue);
  --c04-reference: var(--muted);
  --c04-region: color-mix(in srgb, var(--blue) 14%, transparent);
  --c04-pass: #207650;
  --c04-fail: #a34819;
}

[data-theme="dark"] .c04-panel {
  --c04-pass: #79cba8;
  --c04-fail: #ffb282;
}

.c04-instruction {
  margin: 0 0 10px;
  color: var(--muted);
}

.c04-tools, .c04-playback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 15px;
  margin-bottom: 12px;
}

.c04-tools .c01-options {
  margin: 0;
  row-gap: 5px;
}

.c04-action {
  padding: 6px 11px;
  font-size: .86em;
}

.c04-parameter {
  display: grid;
  grid-template-columns: auto minmax(66px, 104px) 6.1ch;
  gap: 6px;
  align-items: center;
  max-width: 100%;
}

.c04-panel input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
}

.c04-panel input[type="number"] {
  min-width: 0;
  padding: 3px 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: .87em;
  font-variant-numeric: tabular-nums;
}

.c04-playback {
  padding: 9px 0;
  margin: 5px 0 10px;
  border-block: 1px solid var(--line);
  font-size: .93em;
}

.c04-playback label {
  display: inline-grid;
  grid-template-columns: auto minmax(95px, 150px);
  align-items: center;
  gap: 8px;
}

.c04-playback output {
  min-width: 6.5ch;
  font-variant-numeric: tabular-nums;
}

.c04-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.c04-figure {
  min-width: 0;
  margin: 0 0 10px;
  padding: 8px 10px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--plot);
}

.c04-figure-title {
  margin: 2px 0 0;
  font-size: .98em;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
}

.c04-figure figcaption {
  margin-top: 5px;
  color: var(--muted);
  font-size: .85em;
  text-align: center;
}

.c04-panel > [data-visual] > .c04-figure, .c04-single {
  max-width: 650px;
  margin-inline: auto;
}

.c04-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 345px;
  margin-inline: auto;
}

.c04-svg text {
  fill: var(--text);
  font: 17px system-ui, sans-serif;
}

.c04-svg .c04-axis-label { font-size: 15px; }
.c04-svg .c04-note, .c04-svg .c04-mini { fill: var(--muted); font-size: 14px; }
.c04-svg .c04-tag {
  font-size: 13px;
  font-weight: 650;
  paint-order: stroke;
  stroke: var(--plot);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.c04-svg .c04-grid { stroke: var(--grid); stroke-width: 1; }
.c04-svg .c04-axis, .c04-svg .c04-wire { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.c04-svg .c04-plot-back { fill: var(--plot); stroke: var(--line); }
.c04-svg .c04-guide { fill: none; stroke: var(--muted); stroke-width: 1.25; stroke-dasharray: 4 4; }
.c04-svg .c04-shade { fill: var(--c04-region); }
.c04-svg .c04-curve, .c04-svg .c04-vector {
  fill: none;
  stroke: var(--c04-signal);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.c04-svg .c04-vector { stroke-width: 1.8; }
.c04-svg .alternate { stroke: var(--orange); stroke-dasharray: 7 4; }
.c04-svg .reference { stroke: var(--c04-reference); stroke-dasharray: 3 3; }
.c04-svg .c04-open { fill: none; stroke: var(--text); stroke-width: 2.3; }
.c04-svg .c04-zero { fill: var(--plot); stroke: var(--orange); stroke-width: 2.3; }
.c04-svg .c04-closed { fill: var(--c04-signal); stroke: var(--plot); stroke-width: 1.3; }
.c04-svg .c04-block { fill: var(--surface2); stroke: var(--muted); stroke-width: 1.4; }
.c04-svg .c04-active { stroke: var(--accent); stroke-width: 1.8; }
.c04-svg .c04-node { fill: var(--muted); }
.c04-svg .c04-metal { fill: var(--surface2); stroke: var(--muted); stroke-width: 1.4; }
.c04-svg .c04-rail { stroke: var(--muted); stroke-width: 4; stroke-linecap: round; }
.c04-svg .c04-amber { stroke: var(--orange); stroke-width: 2.3; stroke-dasharray: 6 3; }

.c04-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  color: var(--muted);
  font-size: .83em;
}

.c04-legend span { display: inline-flex; gap: 5px; align-items: center; }
.c04-legend i { display: inline-block; width: 20px; border-top: 2px solid var(--c04-signal); }
.c04-legend .alternate { border-color: var(--orange); border-top-style: dashed; }
.c04-legend .guide { border-color: var(--muted); border-top-style: dashed; }
.c04-legend .open, .c04-legend .zero, .c04-legend .closed { width: 11px; height: 11px; border: 0; }
.c04-legend .open::after { content: '×'; display: block; line-height: 11px; font-weight: 700; color: var(--text); }
.c04-legend .zero { border: 2px solid var(--orange); border-radius: 50%; }
.c04-legend .closed { border-radius: 50%; background: var(--c04-signal); }

.c04-panel .c04-metrics { margin-bottom: 10px; }
.c04-verdict { margin-left: 4px; white-space: nowrap; font-size: .8em; }
.c04-verdict.pass { color: var(--c04-pass); }
.c04-verdict.fail { color: var(--c04-fail); }

.c04-table { overflow-x: auto; margin: 8px 0 15px; }
.c04-table table { width: 100%; border-collapse: collapse; font-size: .95em; }
.c04-table th, .c04-table td {
  padding: 7px 10px;
  border: 1px solid var(--line);
  text-align: left;
}
.c04-table th { background: var(--surface2); white-space: nowrap; }

@media (max-width: 760px) {
  .c04-pair { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .c04-figure { padding-inline: 4px; }
  .c04-tools { gap: 7px 10px; }
}
