.stat-errors-widget {
  --stat-h0: #c44536;
  --stat-h1: #1f7a8c;
  --stat-threshold: #27364a;
  --stat-power: #2f7d32;
  --stat-overlap: var(--lca-widget-accent);
}

.stat-errors-chart {
  min-height: 390px;
  margin: 0.5rem 0 1rem;
}

.stat-errors-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.stat-errors-controls {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-errors-controls .lca-widget-control {
  display: grid;
  grid-template-rows: minmax(5.75rem, auto) auto 1fr;
  min-width: 0;
}

.stat-errors-controls .lca-widget-control label {
  grid-template-columns: 1fr;
  gap: 0.25rem;
  align-items: start;
  align-self: start;
  margin-bottom: 0;
}

.stat-errors-controls .lca-widget-value {
  min-width: 0;
  text-align: left;
  overflow-wrap: anywhere;
}

.stat-errors-controls .lca-widget-slider-row {
  grid-template-columns: max-content minmax(0, 1fr) max-content;
}

.stat-errors-controls input[type="range"] {
  min-width: 0;
}

.stat-errors-standard-error strong,
.stat-errors-threshold strong,
.stat-errors-threshold-label {
  color: var(--stat-threshold);
  fill: var(--stat-threshold);
}

.stat-errors-alpha strong,
.stat-errors-alpha-label,
.stat-errors-h0-label {
  color: var(--stat-h0);
  fill: var(--stat-h0);
}

.stat-errors-beta strong,
.stat-errors-h1-label {
  color: var(--stat-h1);
  fill: var(--stat-h1);
}

.stat-errors-power strong {
  color: var(--stat-power);
}

.stat-errors-overlap strong {
  color: var(--stat-overlap);
}

.stat-errors-axis,
.stat-errors-tick {
  stroke: var(--lca-widget-line);
}

.stat-errors-axis-label,
.stat-errors-curve-label,
.stat-errors-threshold-label,
.stat-errors-tick-label {
  font-size: 11px;
}

.stat-errors-axis-label,
.stat-errors-tick-label {
  fill: var(--lca-widget-muted);
}

.stat-errors-curve-label,
.stat-errors-threshold-label {
  font-weight: 700;
}

.stat-errors-h0-line {
  fill: none;
  stroke: var(--stat-h0);
  stroke-width: 2.6;
}

.stat-errors-h1-line {
  fill: none;
  stroke: var(--stat-h1);
  stroke-width: 2.6;
}

.stat-errors-h0-area {
  fill: var(--stat-h0);
  opacity: 0.45;
}

.stat-errors-h1-area {
  fill: var(--stat-h1);
  opacity: 0.38;
}

.stat-errors-mean-line {
  stroke-width: 1.4;
  stroke-dasharray: 4 4;
  opacity: 0.75;
}

.stat-errors-h0-mean {
  stroke: var(--stat-h0);
}

.stat-errors-h1-mean {
  stroke: var(--stat-h1);
}

.stat-errors-threshold-line {
  stroke: var(--stat-threshold);
  stroke-width: 2;
  stroke-dasharray: 6 5;
}

.stat-errors-interpretation {
  margin: 1rem 0 0;
  padding: 0.85rem;
  color: var(--lca-widget-ink);
  background: #fff8e8;
  border: 1px solid #ead59a;
  border-radius: 8px;
  line-height: 1.5;
}

.stat-errors-widget .stat-errors-interpretation + .lca-widget-note {
  margin-top: 1rem;
}

.stat-errors-widget .lca-widget-note {
  margin-bottom: 0.75rem;
}

@media (max-width: 980px) {
  .stat-errors-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-errors-controls .lca-widget-control {
    grid-template-rows: auto;
  }
}

@media (max-width: 760px) {
  .stat-errors-controls {
    grid-template-columns: 1fr;
  }

  .stat-errors-chart {
    min-height: 320px;
  }
}
