@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --midnight: #0a1628;
  --signal: #38d3f5;
  --deep: #0a84c6;
  --mist: #eef3f7;
  --ice: #e8f1f8;
  --white: #ffffff;
  --muted: #5a6b80;
  --border: #d6dee7;
  --raised: #132238;
  --alert: #8a2b24;
  --alert-wash: #f8e4e1;
  --ok: #0b5f45;
  --ok-wash: #e5f3ec;
  --focus: #0a84c6;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--mist);
  color: var(--midnight);
  font-family: "Geist", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums lining-nums;
}

::selection {
  background: #c5dff0;
  color: var(--midnight);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

a {
  color: var(--deep);
  text-underline-offset: 0.18em;
}

a:hover { text-decoration-thickness: 2px; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--white);
  color: var(--midnight);
  padding: 8px 12px;
  z-index: 3;
}

.skip:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.top {
  background: var(--midnight);
  color: var(--ice);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 28px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 32px;
}

body.wide .bar,
body.wide .shell {
  max-width: none;
}

.brand {
  display: block;
  line-height: 0;
}

.brand img {
  display: block;
  height: 32px;
  width: auto;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 4px;
  align-items: center;
}

.nav a {
  color: var(--ice);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
}

.nav a:hover { background: var(--raised); }

.nav a[aria-current="page"] {
  background: var(--raised);
  color: var(--white);
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 32px 72px;
}

h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.lede {
  max-width: 68ch;
  margin: 0 0 22px;
  color: var(--muted);
}

.banner {
  max-width: 72ch;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.banner.bad {
  background: var(--alert-wash);
  color: var(--alert);
  border-color: #e4c4bf;
}

.banner.good {
  background: var(--ok-wash);
  color: var(--ok);
  border-color: #c5e0d4;
}

.filters,
.pull,
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  margin: 0 0 18px;
}

.stack {
  display: grid;
  gap: 16px;
  max-width: 28rem;
  align-items: stretch;
}

label,
.choice {
  display: grid;
  gap: 6px;
  color: var(--midnight);
  font-weight: 500;
  font-size: 0.94rem;
}

.choice {
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  font-weight: 400;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select {
  font: inherit;
  color: var(--midnight);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  min-width: 11rem;
  caret-color: var(--deep);
}

input::placeholder { color: var(--muted); }

.grow { flex: 1 1 18rem; }
.grow input { width: 100%; }

button,
.button {
  font: inherit;
  font-weight: 600;
  color: var(--white);
  background: var(--deep);
  border: 1px solid var(--deep);
  border-radius: 8px;
  padding: 9px 14px;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover { background: #0873ad; }

button:disabled {
  background: var(--border);
  border-color: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

button.quiet,
.button.quiet {
  color: var(--deep);
  background: transparent;
}

button.quiet:hover,
.button.quiet:hover { background: var(--ice); }

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 400;
  padding-bottom: 8px;
}

.num,
.slip,
td.when,
.price-form input.price {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-weight: 400;
}

.book { overflow-x: auto; }

.filters.bar {
  display: grid;
  grid-template-columns:
    minmax(8rem, 1.6fr)
    minmax(6.5rem, 1fr)
    minmax(8.4rem, 0.8fr)
    minmax(8.4rem, 0.8fr)
    minmax(4.2rem, 0.55fr)
    minmax(4rem, 0.45fr)
    minmax(4rem, 0.45fr)
    minmax(6.2rem, 0.85fr)
    minmax(6.4rem, 0.75fr)
    minmax(6.4rem, 0.75fr)
    auto;
  gap: 8px;
  align-items: end;
}

.filters.bar label {
  min-width: 0;
  gap: 4px;
  font-size: 0.75rem;
}

.filters.bar input,
.filters.bar select {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.84rem;
}

.filter-go {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stack + h2 { margin-top: 28px; }

.sheet-scroll { overflow-x: auto; }

.grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

.grid th,
.grid td {
  white-space: nowrap;
  vertical-align: middle;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--white);
}

.grid th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--midnight);
  background: var(--white);
  border-bottom: 2px solid var(--midnight);
}

.grid th button.sort {
  display: inline;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  font-size: 0.75rem;
  line-height: inherit;
  text-align: inherit;
  cursor: pointer;
}

.grid th.num button.sort { text-align: right; }

.grid th button.sort:hover,
.grid th button.sort:focus-visible {
  background: transparent;
  color: var(--deep);
}

.grid th[aria-sort="ascending"] button.sort::after,
.grid th[aria-sort="descending"] button.sort::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.grid th[aria-sort="ascending"] button.sort::after { border-bottom: 5px solid var(--deep); }
.grid th[aria-sort="descending"] button.sort::after { border-top: 5px solid var(--deep); }

#results[aria-busy="true"] { opacity: 0.55; }

.grid tbody tr:nth-child(even) td { background: var(--ice); }

.grid th.num,
.grid td.num { text-align: right; }

.grid td.event a {
  display: block;
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.grid td.venue {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid .mk {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.15;
}

.grid .fine { display: inline; }

.grid tbody tr:hover td { background: var(--ice); }

.grid tr.past td { color: var(--muted); }

table {
  width: 100%;
  border-collapse: collapse;
}

.blotter table { min-width: 1080px; }

.attention-table { min-width: 640px; }
.admin-table { min-width: 880px; }
.admin-table form { margin: 0; }
.admin-table button.quiet { padding: 6px 10px; }

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--muted);
}

.when { white-space: nowrap; }

.event a {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.place,
.left,
.each,
.total,
.fine {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

.slips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slip {
  position: relative;
  flex: 0 0 auto;
  min-width: 9.5rem;
  background: var(--white);
  color: var(--midnight);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px 8px 16px;
  white-space: nowrap;
}

.slip::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--deep);
  border-radius: 2px;
}

.slip strong,
.slip span { display: block; }

.slip span { color: var(--muted); font-weight: 400; }

.states {
  list-style: none;
  margin: 0;
  padding: 0;
}

.states li { white-space: nowrap; }

.states li.on,
.on { color: var(--ok); }

.states li.off,
.off { color: var(--alert); }

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin-top: 16px;
}

.sheet { max-width: 920px; }

.sheet h1 { margin-bottom: 6px; }

.sheet h2 { margin-top: 28px; }

input.price {
  min-width: 0;
  width: 7.5rem;
  padding: 6px 8px;
}

.price-form td.mark { white-space: nowrap; }
.price-form .unit { margin-left: 6px; color: var(--muted); }
.price-form p { max-width: 62ch; }
.price-form .actions { margin-top: 14px; }

.facts { margin: 0; }

.facts div {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: 4px 16px;
  margin: 0 0 10px;
}

.facts dt { font-weight: 500; }
.facts dd { margin: 0; }

.notes {
  white-space: pre-wrap;
  margin: 0;
}

.steps {
  margin: 0 0 8px;
  padding-left: 1.2rem;
  max-width: 62ch;
}

.steps li { margin: 4px 0; }

.charts {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 16px;
  margin: 8px 0 8px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 16px;
}

.panel figcaption,
.attention h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.bars { display: grid; gap: 10px; }

.bar-row {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) 1fr auto;
  gap: 10px;
  align-items: center;
}

.bar-name { font-weight: 500; }

.bar-track {
  display: block;
  height: 10px;
  background: var(--mist);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: var(--deep);
  border-radius: 999px;
}

.weeks { width: 100%; height: auto; display: block; }

.week-count,
.week-label,
.week-sub {
  font-family: "Geist Mono", ui-monospace, monospace;
  fill: var(--muted);
}

.week-count { font-size: 13px; fill: var(--midnight); }
.week-label { font-size: 12px; }
.week-sub { font-size: 11px; }

.perforation {
  border: 0;
  height: 18px;
  margin: 22px 0;
  background-image: radial-gradient(circle, var(--border) 1.5px, transparent 1.7px);
  background-size: 16px 18px;
  background-repeat: repeat-x;
  background-position: center;
}

.attention { margin-top: 4px; }
.attention .lede { margin-bottom: 12px; }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.gate-panel {
  width: min(440px, 100%);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 28px 24px;
}

.gate-logo {
  display: block;
  height: 40px;
  width: auto;
  margin-bottom: 22px;
}

.switch { margin: 4px 0 0; }

@media (max-width: 1280px) {
  .filters.bar {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .filters.bar label:first-child { grid-column: span 2; }
}

@media (max-width: 860px) {
  .charts { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-name { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .bar,
  .shell { padding-left: 16px; padding-right: 16px; }

  .blotter table { min-width: 0; }
  .blotter thead { display: none; }

  .blotter tr {
    display: block;
    padding: 8px 0 14px;
    border-bottom: 1px solid var(--border);
  }

  .blotter table,
  .blotter tbody,
  .blotter tr,
  .blotter td {
    width: 100%;
    min-width: 0;
  }

  .blotter td {
    display: block;
    border: 0;
    padding: 8px 0;
  }

  .blotter td::before {
    content: attr(data-label);
    display: block;
    font-weight: 500;
    color: var(--muted);
  }

  .filters.bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters.bar > * { min-width: 0; }
  .filters.bar label:first-child { grid-column: auto; }

  .filters label,
  .stack label { flex: 1 1 100%; }

  .filters input,
  .filters select,
  .stack input,
  .stack select {
    width: 100%;
    min-width: 0;
  }

  .facts div { grid-template-columns: 1fr; }
}

.cf-turnstile { margin: 8px 0 4px; }
.pull .cf-turnstile { margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}
