@font-face {
  font-family: "IBM Plex Sans";
  src: url("/static/fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/static/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #f5f5f4;
  --surface: #fafaf9;
  --border: #e7e5e4;
  --text: #1c1917;
  --text-dim: #57534e;
  --primary: #0d9488;
  --danger: #be123c;
  --series-1: #0d9488;
  --series-2: #c2410c;
  --series-3: #7c3aed;
  --series-4: #be123c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --border: #2a2a2a;
    --text: #f5f5f5;
    --text-dim: #a1a1aa;
    --danger: #e11d48;
    --series-2: #ea580c;
    --series-3: #8b5cf6;
    --series-4: #e11d48;
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 120ms, opacity 120ms, background 120ms;
}

a:hover {
  opacity: .76;
  text-decoration: underline;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 16px;
}

h2 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 12px;
}

h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 8px;
}

.container {
  margin: 0 auto;
  max-width: 1280px;
  padding-left: 24px;
  padding-right: 24px;
  width: 100%;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 56px;
}

.header-inner {
  align-items: stretch;
  display: flex;
  height: 56px;
  justify-content: space-between;
}

.wordmark {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 15px;
  font-weight: 600;
}

.wordmark:hover {
  text-decoration: none;
}

.main-nav {
  align-items: stretch;
  display: flex;
  gap: 24px;
}

.main-nav a {
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  display: flex;
  padding-top: 2px;
}

.main-nav a.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.main-nav a:hover {
  text-decoration: none;
}

.page-content {
  min-height: calc(100vh - 105px);
  padding-bottom: 32px;
  padding-top: 24px;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
}

.footer-inner {
  padding-bottom: 12px;
  padding-top: 12px;
}

.mono,
code,
time {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.network-now {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  margin-bottom: 16px;
  padding: 8px 12px;
}

.page-heading {
  align-items: flex-start;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.page-heading h1 {
  margin-bottom: 4px;
}

.metadata,
.range-label {
  color: var(--text-dim);
  margin-bottom: 16px;
}

.range-label {
  font-size: 12.5px;
}

.range-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.account-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.account-form label {
  color: var(--text-dim);
  display: grid;
  font-size: 12.5px;
  gap: 4px;
}

.key-once {
  border: 1px solid var(--primary);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
}

.key-once code {
  overflow-wrap: anywhere;
}

.range-form label {
  color: var(--text-dim);
  display: grid;
  font-size: 12.5px;
  gap: 4px;
}

button,
input,
select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  height: 32px;
  padding: 4px 8px;
  transition: color 120ms, opacity 120ms, background 120ms;
}

button {
  cursor: pointer;
  font-weight: 600;
  padding-left: 12px;
  padding-right: 12px;
}

button:hover {
  background: var(--border);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.summary-strip {
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 32px;
  margin: 0 0 24px;
  padding: 12px 0;
}

.summary-strip div {
  align-items: baseline;
  display: flex;
  gap: 8px;
}

.summary-strip dt {
  color: var(--text-dim);
  font-size: 12.5px;
}

.summary-strip dd {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

caption {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

th,
td {
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
}

thead th {
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: 0;
}

tbody tr {
  transition: background 120ms;
}

tbody tr:hover {
  background: var(--bg);
}

.numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.empty-cell,
.empty-state {
  color: var(--text-dim);
  padding: 24px;
  text-align: center;
}

.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.split-tables {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 24px;
}

.chart-section {
  margin-top: 24px;
}

.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
}

.chart-plot {
  height: 300px;
  width: 100%;
}

.uplot {
  color: var(--text-dim);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 12.5px;
}

.u-legend {
  font-size: 12.5px;
}

.u-cursor-x,
.u-cursor-y {
  border-color: var(--text-dim) !important;
}

.chart-tooltip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .10);
  color: var(--text);
  display: none;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12.5px;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.chart-tooltip div {
  padding: 4px 8px;
}

.section-block {
  margin-top: 24px;
}

.pagination {
  align-items: center;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  margin-top: 16px;
}

.pagination a:last-child {
  justify-self: end;
}

.pagination span {
  color: var(--text-dim);
  font-size: 12.5px;
}

.error-page {
  padding: 32px 0;
}

.detail-list {
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.detail-list div {
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 12px;
  grid-template-columns: 120px minmax(0, 1fr);
  padding: 8px 12px;
}

.detail-list div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--text-dim);
  font-size: 12.5px;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.event-description p {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: 0;
  max-width: 88ch;
  padding: 12px;
  white-space: pre-wrap;
}

.booking-day + .booking-day,
.event-day + .event-day {
  margin-top: 24px;
}

.map-plot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #1c1917;
  overflow: hidden;
  width: 100%;
}

.map-live {
  height: 520px;
}

.map-replay {
  height: 420px;
}

.map-loading {
  color: var(--text-dim);
  padding: 24px;
  text-align: center;
}

.replay-controls {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  margin-top: 8px;
  padding: 8px;
}

.replay-controls input[type="range"] {
  padding: 0;
  width: 100%;
}

.replay-controls output {
  color: var(--text-dim);
  font-size: 12.5px;
}

.leaflet-control-attribution {
  font-size: 12.5px;
}

.leaflet-container {
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 12.5px;
}

.leaflet-bar,
.leaflet-control-layers,
.leaflet-popup-content-wrapper,
.leaflet-popup-tip,
.leaflet-tooltip {
  box-shadow: none;
}

.leaflet-bar,
.leaflet-control-layers,
.leaflet-popup-content-wrapper {
  border-radius: 6px;
}

.leaflet-popup-content-wrapper,
.leaflet-tooltip {
  border: 1px solid var(--border);
  border-radius: 6px;
}

.leaflet-popup-content {
  font-size: 12.5px;
}

@media (max-width: 760px) {
  .page-heading {
    display: block;
  }

  .range-form {
    justify-content: flex-start;
    margin-bottom: 16px;
  }

  .split-tables {
    grid-template-columns: 1fr;
  }

  .summary-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .main-nav {
    gap: 12px;
    overflow-x: auto;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .detail-list div:nth-last-child(2) {
    border-bottom: 1px solid var(--border);
  }

  .replay-controls {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .replay-controls output {
    grid-column: 1 / -1;
  }
}
