/* === Layout === */
.viz-container {
  max-width: 720px;
  text-align: left;
}

.viz-container h1 {
  text-align: center;
}

/* === Visualization picker === */
.viz-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.viz-item {
  background: var(--color-bg-secondary);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.92rem;
}

.viz-item:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-accent);
}

.viz-item.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* === Panel === */
.viz-panel h2 {
  margin-bottom: 0.25rem;
}

#viz-link {
  color: var(--color-text);
  border-bottom: 1px dashed var(--color-accent);
}

#viz-link:hover {
  text-decoration: none;
  color: var(--color-accent);
}

#viz-description {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
}

#viz-description a {
  color: inherit;
  text-decoration: underline;
}

/* === Controls === */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.controls label {
  font-size: 0.92rem;
}

.controls button {
  padding: 0.4rem 1rem;
  font-size: 0.92rem;
}

.controls input[type='number'],
.minmax-row input {
  width: 74px;
  text-align: center;
}

.controls input[type='checkbox'] {
  width: auto;
}

input[type='range'] {
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  accent-color: var(--color-accent);
}

.slider-row {
  margin-bottom: 0.75rem;
}

.slider-row label {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.minmax-row {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.minmax-row input.current {
  font-weight: 600;
}

.equation {
  font-size: 1.05rem;
  margin-bottom: 0.9rem;
}

/* === Stage === */
/* The drawing surface stays light in both themes: the visualizations draw
   dark strokes and cut out shapes with white fills. */
.stage-box {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px;
}

.stage-box canvas,
.stage-box svg {
  display: block;
  width: 100%;
  height: auto;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  font-size: 0.9rem;
  color: #1a1a1a;
}

.legend .dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: -1px;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
