/* The decisive figure (templates/screens/figure.html and scatter.html): drawn on the server, coloured
   here. A wide screen shows its labelled drawing, a phone the small one, whose legend names the marks. */
.scatter-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-7) var(--space-7) var(--space-5);
}

.figure-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}

.figure-title {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.scatter {
  display: block;
  width: 100%;
  height: auto;
}

.scatter-phone {
  display: none;
}

.scatter text {
  font-family: var(--font-sans);
  font-size: var(--small-size);
  fill: var(--text-secondary);
}

.scatter .ticks text {
  font-family: var(--font-mono);
  fill: var(--text-muted);
}

.scatter .note,
.scatter .axis-title {
  fill: var(--text-muted);
}

.scatter .grid line {
  stroke: var(--line);
}

.scatter .axis line {
  stroke: var(--line-control);
}

.scatter .region {
  fill: var(--track);
}

.scatter .cost-bar {
  stroke: var(--line-control);
  stroke-dasharray: 2 4;
}

.scatter .threshold {
  stroke: var(--text-secondary);
  stroke-dasharray: 4 4;
}

.scatter .frontier {
  fill: none;
  stroke: var(--hatch);
}

.scatter .interval {
  stroke: var(--line-field);
}

.scatter .point {
  stroke-width: 1.25;
}

.scatter .model {
  fill: none;
  stroke: var(--text-secondary);
}

.scatter .policy {
  fill: var(--surface);
  stroke: var(--series-2);
}

.scatter .label.policy {
  fill: var(--series-2);
}

/* The chosen point: solid and light, in a halo. */
.scatter .chosen {
  fill: var(--text);
  stroke: none;
}

.scatter .halo,
.scatter .leader {
  fill: none;
  stroke: var(--hatch);
}

.scatter .chosen-name {
  font-size: var(--meta-size);
  font-weight: 500;
  fill: var(--text);
}

.scatter .chosen-figures {
  font-family: var(--font-mono);
}

.figure-caption {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: var(--small-size);
  line-height: var(--small-leading);
  color: var(--text-muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

.legend .policy {
  color: var(--series-2);
}

.legend .chosen {
  color: var(--text);
}

/* Where every point came from. */
.sources {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.sources dd {
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .scatter-card {
    padding: var(--space-4);
  }

  .scatter-wide {
    display: none;
  }

  .scatter-phone {
    display: block;
  }

  .sources {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
