/* Hallmark · macrostructure: Map / Diagram · tone: playful editorial · anchor hue: blue */
@import url("https://fonts.googleapis.com/css2?family=Roboto+Serif:opsz,wght@8..144,400;8..144,600;8..144,700&display=swap");

* {
  box-sizing: border-box;
}
html {
  background: var(--paper);
  color: var(--ink);
}
body {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
}
button,
select,
input {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
}
.shell {
  width: min(1120px, calc(100% - 32px));
  margin: auto;
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 19px;
  border-bottom: 1px solid var(--ink);
}
.wordmark {
  color: var(--ink);
  font: 700 24px/1 var(--serif);
  text-decoration: none;
  letter-spacing: -0.06em;
}
.wordmark span {
  color: var(--blue);
}
.wordmark i {
  font: 13px var(--mono);
  margin-left: 5px;
  vertical-align: 5px;
}
.masthead-meta,
.section-kicker,
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 700;
}
.masthead-meta {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
}
.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
}
.intro {
  padding: 30px 0 25px;
  max-width: 660px;
}
.eyebrow {
  color: var(--blue);
  margin-bottom: 10px;
}
.eyebrow span {
  color: var(--ink);
  margin-left: 5px;
}
h1,
h2 {
  font-family: var(--serif);
  letter-spacing: -0.055em;
  margin: 0;
}
h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1;
}
.dek {
  color: var(--muted);
  font-size: 13px;
  max-width: 435px;
  margin: 12px 0 0;
}
.sample-banner {
  display: inline-block;
  background: var(--yellow);
  border: 1px solid var(--ink);
  padding: 6px 10px;
  margin-top: 13px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.workbench {
  background: var(--card);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
  padding: clamp(16px, 3vw, 29px);
}
.workbench-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}
.section-kicker {
  color: var(--muted);
  margin-bottom: 7px;
}
h2 {
  font-size: 31px;
  line-height: 1;
}
.head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}
.segmented {
  display: inline-flex;
  border: 1px solid var(--ink);
}
.segmented button {
  background: transparent;
  border: 0;
  padding: 7px 10px;
  font-size: 11px;
}
.segmented button + button {
  border-left: 1px solid var(--ink);
}
.segmented button.is-active {
  color: var(--card);
  background: var(--ink);
}
.status {
  padding: 48px 10px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--placeholder);
}
.status.error {
  color: var(--error);
  background: var(--error-bg);
  border-style: solid;
}
.status button {
  margin-left: 8px;
  border: 1px solid var(--ink);
  background: var(--yellow);
  padding: 5px 9px;
  font-size: 11px;
}
.chart-wrap {
  position: relative;
  margin: 4px 0 0;
  overflow: hidden;
}
.chart {
  display: block;
  width: 100%;
  height: 430px;
  overflow: visible;
}
.grid-line {
  stroke: var(--grid);
  stroke-width: 1;
}
.axis-line {
  stroke: var(--ink);
  stroke-width: 1;
}
.axis-label {
  fill: var(--muted);
  font: 10px var(--mono);
}
.series {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: opacity 0.2s var(--ease-out);
}
.series.dim {
  opacity: 0.13;
}
.point {
  stroke: var(--card);
  stroke-width: 2;
  cursor: pointer;
}
.point.dim {
  opacity: 0.2;
}
.hover-guide {
  stroke: var(--ink);
  stroke-dasharray: 3 4;
  opacity: 0.22;
}
.tooltip {
  position: absolute;
  min-width: 145px;
  background: var(--ink);
  color: var(--card);
  padding: 10px;
  pointer-events: none;
  font-size: 11px;
  z-index: 2;
  box-shadow: 3px 3px 0 var(--blue);
}
.tooltip strong {
  display: block;
  font: 600 14px var(--serif);
  margin-bottom: 3px;
}
.chart-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--hairline);
  padding-top: 13px;
}
.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.legend-item {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-size: 10px;
}
.legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.chart-note {
  color: var(--muted);
  font-size: 10px;
}
.note-mark {
  color: var(--blue);
  font-size: 16px;
  vertical-align: -1px;
}
.controls {
  border-top: 1px solid var(--ink);
  margin-top: 18px;
  padding-top: 15px;
}
.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.transport {
  display: flex;
  gap: 8px;
  align-items: center;
}
.icon-button,
.play-button,
.latest-button {
  border: 1px solid var(--ink);
  min-height: 33px;
  background: var(--card);
}
.icon-button {
  width: 34px;
  font-size: 18px;
}
.play-button {
  padding: 0 13px;
  background: var(--blue);
  color: var(--card);
}
.latest-button {
  padding: 0 10px;
  font-size: 11px;
}
.speed-control {
  color: var(--muted);
  font-size: 10px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.speed-control select {
  border: 1px solid var(--ink);
  background: var(--card);
  padding: 5px;
  color: var(--ink);
}
.scrubber-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.scrubber-row input {
  width: 100%;
  accent-color: var(--blue);
}
.time-label,
.replay-readout {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.replay-readout {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}
.replay-readout time {
  color: var(--ink);
}
.standings-section {
  margin: 70px 0 46px;
}
.standings-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.count-badge {
  background: var(--yellow);
  border: 1px solid var(--ink);
  padding: 5px 8px;
  font-size: 10px;
}
.table-wrap {
  background: var(--card);
  border: 1px solid var(--ink);
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}
.table-wrap th,
.table-wrap td {
  text-align: left;
  padding: 11px 13px;
  border-bottom: 1px solid var(--hairline);
}
.table-wrap th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}
.rank-cell {
  color: var(--muted);
  width: 50px;
}
.profile-cell {
  vertical-align: middle;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}
.profile-avatar {
  width: 32px;
  height: 32px;
  float: left;
  margin-right: 10px;
  border-radius: 50%;
  object-fit: cover;
}
.profile-cell small {
  display: block;
  color: var(--muted);
  font: 10px var(--mono);
  font-weight: 400;
  margin-top: 2px;
}
.votes-cell {
  font-weight: 700;
}
.change-cell {
  color: var(--blue);
  font-weight: 700;
}
.change-cell.down {
  color: var(--negative);
}
.change-cell.same {
  color: var(--muted);
}
.source-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--ink);
  padding: 17px 0 28px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
}
.source-footer a {
  color: var(--ink);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 600px) {
  .shell {
    width: min(100% - 22px, 1120px);
  }
  .masthead {
    padding-top: 16px;
  }
  .masthead-meta span:not(.dot) {
    display: none;
  }
  .intro {
    padding: 42px 0 31px;
  }
  .workbench-head {
    align-items: start;
    flex-direction: column;
  }
  .head-actions {
    justify-content: start;
  }
  .chart {
    height: 330px;
  }
  .chart-footer {
    flex-direction: column;
    gap: 8px;
  }
  .chart-note {
    line-height: 1.35;
  }
  .play-button span {
    display: none;
  }
  .latest-button {
    padding: 0 7px;
  }
  .standings-section {
    margin-top: 58px;
  }
  .table-wrap {
    overflow-x: auto;
  }
  .table-wrap th,
  .table-wrap td {
    padding: 10px 8px;
  }
  .table-wrap th:nth-child(4),
  .table-wrap td:nth-child(4) {
    display: none;
  }
  .source-footer {
    flex-direction: column;
    gap: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Accessible sizing and tokenized series colors. */
html,
body {
  overflow-x: clip;
}
body {
  font-size: 14px;
}
.segmented button,
.icon-button,
.play-button,
.latest-button,
.speed-control select {
  min-height: 44px;
}
.icon-button {
  width: 44px;
}
.scrubber-row input {
  min-height: 44px;
}
.legend-item {
  min-height: 36px;
  border: 0;
  background: transparent;
  font-size: 11px;
}
.chart-note {
  font-size: 11px;
}

[hidden] {
  display: none !important;
}
h1,
h2 {
  font-style: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}
button,
select,
a {
  white-space: nowrap;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
:where(a, button, select, input):focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.play-button:focus-visible {
  outline-color: var(--ink);
}
.legend-item {
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
}
.legend-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.legend-swatch {
  flex-shrink: 0;
}
.profile-cell {
  overflow-wrap: anywhere;
  min-width: 0;
}
.table-wrap table {
  table-layout: fixed;
}
.table-wrap th:first-child {
  width: 8%;
}
.table-wrap th:nth-child(2) {
  width: 60%;
}
.table-wrap th:nth-child(3),
.table-wrap th:nth-child(4) {
  width: 16%;
}
.chart-note {
  min-width: 180px;
  max-width: 32ch;
}
.tooltip {
  max-width: 225px;
  overflow-wrap: anywhere;
}
.time-label {
  font-size: 11px;
}
.replay-readout {
  flex-wrap: wrap;
  gap: 4px;
}
@media (hover: hover) {
  button:hover {
    background: var(--blue-soft);
    color: var(--ink);
  }
  .play-button:hover {
    background: var(--blue-hover);
    color: var(--card);
  }
  .legend-item:hover {
    color: var(--blue);
  }
}
button:active {
  transform: translateY(1px);
}
@media (max-width: 600px) {
  .control-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .scrubber-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
  }
  .scrubber-row input {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
  }
  .time-label:last-child {
    text-align: right;
  }
  .chart-note {
    max-width: none;
  }
  .table-wrap th:nth-child(2) {
    width: 62%;
  }
  .table-wrap th:nth-child(3) {
    width: 30%;
  }
  .source-footer {
    overflow-wrap: anywhere;
  }
}
.chart-footer {
  margin-top: 20px;
}
.table-note {
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 600px) {
  .standings-heading {
    flex-wrap: wrap;
  }
}
.source-footer,
.masthead-meta,
.section-kicker,
.eyebrow,
.sample-banner,
.count-badge,
.table-wrap th,
.profile-cell small {
  font-size: 11px;
}
.dek {
  font-size: 14px;
}
.speed-control,
.time-label,
.replay-readout {
  font-size: 12px;
}
@media (prefers-reduced-motion: reduce) {
  button:active {
    transform: none;
  }
}

.data-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.data-controls button {
  min-height: 44px;
  border: 1px solid var(--ink);
  padding: 8px 12px;
  background: var(--card);
  color: var(--ink);
}
.data-controls p {
  flex: 1 1 260px;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
