:root {
  color-scheme: light;
  --bg: #fcfcfa;
  --fg: #292c2d;
  --muted: #646b6c;
  --border: #d5d9d8;
  --faint: #edf0ee;
  --accent: #23635b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
main {
  display: grid;
  grid-template-columns: clamp(320px, 25%, 360px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin: auto;
  padding: 20px 24px 28px;
}
.sidebar {
  min-width: 0;
  padding-right: 24px;
  border-right: 1px solid var(--border);
}
.chart-panel {
  min-width: 0;
  margin: 0;
  position: sticky;
  top: 16px;
}
h1 {
  font-size: 25px;
  line-height: 1.2;
  font-weight: 550;
  margin: 0 0 6px;
}
p {
  margin: 0;
}
a {
  color: var(--accent);
}
header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  margin-bottom: 20px;
}
.meta {
  color: var(--muted);
  font-size: 13px;
}
.toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  border-block: 1px solid var(--border);
  padding: 14px 0;
}
.toolbar .field:first-child,
.toolbar .reverse {
  grid-column: 1 / -1;
}
.field {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
}
.sports-teams {
  grid-column: 1 / -1;
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.sports-teams[hidden] {
  display: none;
}
.sports-teams legend {
  color: var(--muted);
  font-size: 12px;
  padding: 0 0 6px;
}
.sports-teams label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  cursor: pointer;
}
.sports-teams input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin: 0 2px 0 0;
}
.team-league {
  color: var(--muted);
  margin-left: auto;
  font-size: 11px;
}
.event-filters #event-options {
  display: grid;
  gap: 8px;
}
.event-filters label > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.event-filters input,
.event-filters .swatch {
  flex-shrink: 0;
}
.event-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}
.event-actions button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.event-marker {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji",
    sans-serif;
  font-size: 12px;
  pointer-events: none;
}
select,
input[type="date"] {
  font-family: inherit;
  font-size: 14px;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  height: 36px;
  padding: 0 9px;
  max-width: 100%;
  width: 100%;
  min-width: 0;
}
select:disabled {
  opacity: 0.4;
}
.segments {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  height: 36px;
}
.segments button {
  border: 0;
  border-radius: 0;
  padding: 0 7px;
  flex: 1;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.segments button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
}
.reverse {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  font-size: 13px;
  cursor: pointer;
}
.reverse input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}
.reverse[hidden] {
  display: none;
}
#sqrt-control:has(input:disabled) {
  color: var(--muted);
  cursor: default;
}
.export {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  width: 36px;
  height: 36px;
  border-radius: 4px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.export svg {
  width: 18px;
  height: 18px;
}
.export-options {
  position: fixed;
  top: 64px;
  left: 24px;
  width: 296px;
  max-width: calc(100vw - 48px);
  z-index: 20;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 5px 20px #0002;
  display: grid;
  gap: 12px;
}
.export-options[hidden] {
  display: none;
}
.export-options button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  background: var(--faint);
  font: inherit;
  cursor: pointer;
}
#export-status {
  font-size: 12px;
  color: var(--muted);
}
#export-status:empty {
  display: none;
}
.legend-section {
  min-height: 0;
  padding: 17px 0 10px;
  display: grid;
  gap: 6px;
  align-items: start;
}
.legend-main {
  flex: 1;
  min-width: 0;
  width: 100%;
}
.legend-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
}
.legend-unit {
  font-weight: 400;
  color: var(--muted);
  margin-left: 8px;
}
.legend-foot {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.legend-categories {
  display: flex;
  gap: 10px 20px;
  flex-wrap: wrap;
}
.key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  white-space: nowrap;
}
.swatch {
  width: 17px;
  height: 13px;
  display: inline-block;
  flex-shrink: 0;
}
.swatch.zero {
  background: var(--bg);
  outline: 1px solid #b4b9b7;
  outline-offset: -1px;
}
.swatch.missing {
  background: repeating-linear-gradient(
    135deg,
    #d9ddda 0 1px,
    transparent 1px 5px
  );
}
.key-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  align-items: center;
  max-width: 280px;
  padding-top: 4px;
}
.ramp {
  height: 13px;
  position: relative;
}
.ramp-ticks {
  position: relative;
  height: 24px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.ramp-tick {
  position: absolute;
  top: 0;
  padding-top: 5px;
  white-space: nowrap;
  transform: translateX(-50%);
}
.ramp-tick:before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  height: 4px;
  border-left: 1px solid var(--fg);
}
.ramp-tick:first-child {
  transform: none;
}
.ramp-tick:first-child:before {
  left: 0;
}
.ramp-tick:last-child {
  transform: translateX(-100%);
}
.ramp-tick:last-child:before {
  left: 100%;
}
.bins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
}
.bin {
  display: flex;
  gap: 7px;
  align-items: center;
  flex: 1;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  text-align: left;
}
.bin-color {
  height: 12px;
  width: 22px;
  flex: 0 0 22px;
}
.bin-label {
  overflow-wrap: anywhere;
}
.stage {
  position: relative;
  container-type: inline-size;
  width: min(100%, calc(100dvh - 40px));
  margin: 0 auto;
}
#summary-sidebar .narrative {
  margin: 16px 0;
}
#summary-sidebar .narrative h3 {
  font-size: 18px;
}
#summary-sidebar .narrative p {
  font-size: 13px;
}
#summary-sidebar .narrative .note {
  font-size: 12px;
}
.spiral {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  touch-action: pan-y;
}
.spiral text {
  font-family: inherit;
  fill: var(--fg);
  letter-spacing: 0;
}
.month-label {
  font-size: 14px;
}
.year-label {
  fill: var(--muted) !important;
}
.boundary {
  stroke: #8b9390;
  stroke-width: 1;
  fill: none;
}
.cell {
  stroke: none;
  cursor: crosshair;
}
.necklace-thread {
  fill: none;
  stroke: #969d98;
  stroke-width: 0.65;
}
.summary-line {
  fill: none;
  stroke: #525b58;
  stroke-width: 1.8;
}
.summary-area {
  fill: #b2b2b2;
  stroke: none;
}
.summary-area + .summary-line {
  stroke: #b2b2b2;
}
.summary-baseline {
  fill: none;
  stroke: #b5bcb8;
  stroke-width: 0.65;
  stroke-dasharray: 2 4;
}
.summary-label {
  font-size: 11px;
  fill: var(--muted) !important;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
}
.center-copy {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22%;
  height: 22%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}
.center-copy > * {
  flex-shrink: 0;
}
.center-copy.with-narrative {
  text-align: left;
}
.center-copy h2 {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 500;
  margin: 0 0 10px;
}
.center-copy p,
.narrative p {
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 10px;
}
.center-copy .note,
.narrative .note {
  font-size: 11px;
  color: var(--muted);
}
.narrative h3 {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 8px;
}
.center-copy .center-unit {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 0;
}
.center-copy.with-narrative .center-unit {
  margin-bottom: 12px;
}
.summary-caption {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  margin: 0 auto 12px;
  max-width: 760px;
}
.inspection {
  display: grid;
  gap: 8px;
  align-items: start;
  border-block: 1px solid var(--border);
  padding: 12px 0;
  margin: 10px 0 18px;
  min-height: 65px;
}
.inspection label {
  flex-shrink: 0;
  max-width: 168px;
}
.inspection p {
  font-size: 13px;
  white-space: pre-line;
}
.tooltip {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px #0001;
  padding: 9px 12px;
  max-width: 310px;
  font-size: 13px;
  white-space: pre-line;
  border-radius: 4px;
}
.tooltip strong {
  display: block;
  margin-bottom: 4px;
}
.source-section {
  max-width: 950px;
  font-size: 13px;
  color: var(--muted);
}
.source-section summary {
  cursor: pointer;
  font-weight: 550;
  color: var(--fg);
  padding: 4px 0;
}
.source-content {
  padding: 9px 0;
  display: grid;
  gap: 9px;
}
.source-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.footer {
  font-size: 12px;
  color: var(--muted);
  margin-top: 20px;
  display: flex;
  gap: 6px 14px;
  flex-wrap: wrap;
}
.footer > span {
  flex-basis: 100%;
}
.error {
  padding: 20px;
  color: #8c2226;
}
.highlight {
  fill: none;
  stroke: #202b28;
  stroke-width: 1.8;
  pointer-events: none;
}
.post-marker {
  fill: #202b28;
  stroke: var(--bg);
  stroke-width: 0.35;
  pointer-events: none;
}
@container (max-width:900px) {
  .center-copy h2 {
    font-size: 18px;
  }
  .month-label {
    font-size: 18px;
  }
  .summary-label {
    font-size: 17px;
  }
}
@container (max-width:650px) {
  .month-label,
  .summary-label {
    font-size: 24px;
  }
}
@container (max-width:480px) {
  .center-copy h2 {
    font-size: 12px;
  }
  .center-copy .center-unit {
    font-size: 10px;
  }
  .month-label,
  .summary-label {
    font-size: 32px;
  }
}
@container (max-width:330px) {
  .center-copy h2 {
    font-size: 10px;
  }
  .month-label,
  .summary-label {
    font-size: 38px;
  }
}
@media (max-width: 899px) {
  main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 14px 28px;
  }
  .sidebar {
    display: contents;
  }
  header,
  .toolbar,
  .legend-section,
  #summary-sidebar,
  .inspection,
  .source-section,
  .footer,
  .chart-panel {
    width: 100%;
  }
  header {
    order: 0;
  }
  .toolbar {
    order: 1;
  }
  .legend-section {
    order: 2;
  }
  .chart-panel {
    order: 3;
    position: static;
  }
  #summary-sidebar {
    order: 4;
  }
  .inspection {
    order: 5;
  }
  .source-section {
    order: 6;
  }
  .footer {
    order: 7;
  }
  .stage {
    width: 100%;
    max-width: 720px;
  }
  header {
    margin-bottom: 17px;
  }
  h1 {
    font-size: 23px;
  }
  .toolbar {
    gap: 12px;
  }
  .toolbar .field {
    flex: 1 1 140px;
  }
  .toolbar .field:first-child {
    flex-basis: 100%;
  }
  .legend-section {
    flex-direction: column;
    gap: 6px;
  }
  .legend-main {
    width: 100%;
  }
  .key-group {
    max-width: none;
    padding: 0;
  }
  .bin {
    font-size: 11px;
  }
  .bin-label {
    white-space: normal;
  }
  .inspection {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }
  .summary-caption {
    text-align: left;
  }
  .footer {
    gap: 10px;
  }
  .month-label {
    font-weight: 500;
  }
}
@media print {
  .toolbar,
  .inspection,
  .export,
  .source-section,
  .footer {
    display: none;
  }
  main {
    display: block;
    padding: 0;
  }
  .sidebar {
    display: contents;
    border: 0;
    padding: 0;
  }
  .chart-panel {
    position: static;
  }
  .stage {
    width: 100%;
  }
  .legend-section {
    min-height: 80px;
  }
}
